I'm reading the paper Selective Applicative Functors. So far I've read from page 16 out 29, and I think I've understood the gist of this abstraction, but I'm having some trouble with some basic statements I read. At page 2, with reference to Applicative's <*> operator, it is said that both arguments and associated effects are known statically, […] from the following pages of the paper, I've reached the conclusion that statically means what usually means in any programming language, i.e. at compile time. However, if that's the case, then I don't understand how can the statement above hold. I do
In order to solve a weigthed linear regression (with x and y weights), I converted the explicit to implicit expression. We are given (xmean,xstd) , (ymean,ystd) each 1d of length n. The error is given in factor of std (x_z , y_z). The explicit expression is: ymean + y_z * ystd = a * (xmean + x_z * xstd) + b. Implicit expression: x_a * (xmean+x_z*xstd) + (ymean+y_z*ystd) + c == 0. (with a, b = -x_a, -c) In order to enforce this implicit expression, I use a constrain impl_lin_constraint_zero (it could be implemented with LinearConstraint also). Then I use scipy.optimize.minimize on impl_lin_loss
I am building a custom WordPress theme and using Advanced Custom Fields (ACF) to manage dynamic content. I want to fetch and display ACF fields via the REST API, but I’m not getting the expected data in my API response. add_action('rest_api_init', function() { register_rest_field('post', 'my_custom_field', array( 'get_callback' => function($post_arr) { return get_field('my_custom_field', $post_arr['id']); }, 'schema' => null, )); }); I expected the API to return the value of my_custom_field for each post, but the field is either missing or empty in the API response. WordPress version: 6.x ACF
I used to use Receigen to generate receipt-validation code, but since Apple has deprecated exit code 173, everything is being adapted to StoreKit2. Following a similar approach to https://developer.apple.com/documentation/storekit/apptransaction/shared (and an example provided by Apple Developer Technical Support at https://developer.apple.com/forums/thread/764537?page=2), I am basically replacing the old receipt-check with: Swift: @objc class ValidateReceipt: NSObject { @objc func validate() async -> Bool { do { let verificationResult = try await AppTransaction.shared switch verificationResul
I am implementing my own SW for getting data from DS18B20, but I've been stuck on decoding address for a while - "receiving" only zeros as a result. Here is my code: #include <avr/io.h> #include "DS18B20_driver.h" #include <util/delay.h> #include "debug_uart.h" //delete #include <stdio.h> //delete //High_level_funcitons void dallas_get_address(uint8_t* address){ reset_pulse(); _delay_ms(2); write_byte(0x33); //READ ROM command; read_rom(address); uart_send_string("Dallas address is: \n"); for(int j = 0; j < 8; j++){ char buffer[3]; sprintf(buffer, "%02X", address[j]); uart_send_string(buffer);
I’m trying to update Sales Order Items in ERPNext using a Server Script of type API. I want to hit the endpoint from Postman and update custom fields (custom_buying_price, custom_qty) in the Sales Order Item child table. Here’s my script: def custom_update_so_items(sales_order, items=None): """ Update Sales Order items (qty, rate, custom fields) with validations. Works for draft and submitted Sales Orders. """ try: # Parse JSON items if string if isinstance(items, str): items = frappe.parse_json(items) if not items: return {"status": "error", "message": "Parameter 'items' is required."} # Load
I am stuck with Innovus APR flow. My top module has 16 tiles which has only definitions and have attached their LEF files. However, during CTS I am facing the following issue. ERROR: (IMPCCOPT-1146): Clock tree clk cannot use the following cells. CTS will not be able to run on this clock tree.TileRTL__f48e61f7d4a43cdb is cant_use for the following reasons: missing time lib data. This affects the following instances: tile__0/clk[0] tile__1/clk[0] tile__4/clk[0] tile__5/clk[0] tile__8/clk[0] tile__9/clk[0]TileRTL__c38c781819ceaf14 is cant_use for the following reasons: missing time lib data. Thi
I am implementing a UDS flashing tool in Python using udsoncan and python-can-isotp. The setup is: Python client → sends UDS requests via Kvaser CAN interface. CANoe CAPL script → acts as ECU, responds to diagnostic services. The issue Some services (e.g., ECUReset 0x11) work fine: Python log: Tx: <7E4> 0211010000000000 Rx: <7EC> 0251010000000000 Received positive response for ECUReset (0x11) But other services like DiagnosticSessionControl (0x10) or SecurityAccess (0x27) timeout: Python log: Tx: <7E4> 0210020000000000 RAW CAN: ID=0x7EC, Data=065002003201f400 TimeoutException – Did not receive
I’m currently using the Docling library in Python to extract text from PDF files. While it works well for retrieving visible text, I’ve noticed an issue with hyperlinks. Specifically, the library only extracts the short display text of the links, but it doesn’t capture the full URLs embedded in the PDF. This is problematic because I need to extract both the visible text and the actual URLs. For example, if a link in the PDF displays as "Click here" but points to "https://example.com", I can only retrieve "Click here" using Docling. I was wondering if there is a way to make Docling extract this
What might the sky and star would look like to a person standing on the planet surface in the termination zone of my imaginary habitable, tidally-locked planet orbiting an M class star. If I've done the math correctly, these are my planet and star details: Planet Radius circa .92 Earth radii Mass circa .75 Earth Orbit circa 0.1 AU Atmosphere near Earth like mix of N2-O2 at circa same pressure Star Class M4V Red Dwarf Mass range 0.08 - 0.50 solar masses Luminosity .1% to 8% of our sun 1: What color would the sky overhead be versus at the horizon in the direction of the star? Due to the star alw
Description: I'm building a CRM system that integrates Facebook Messenger for businesses to manage customer conversations. The system works perfectly with n8n Test webhook URLs but fails verification when using Production URLs. Architecture Overview: Backend: FastAPI (Python) CRM hosted on Replit Database: PostgreSQL with facebook_messages table storing conversations in JSONB format Middleware: n8n for webhook routing and Facebook API calls Frontend: React-based CRM interface for viewing/replying to Facebook messages Message Flow (Working with Test URLs): Incoming: Customer messages Facebook p
I can't get anything inside of a function to ever work? This is regarding flow control statements IF, FOR, etc, NOT with expression syntax as the object literal operator, that works fine but it won't let me use nested if statements even? Here is what I mean: I will mark in BOLD the brackets that it flags as syntax errors when I try to run my script: FunctionName(p1, p2, p3) { If (in-expression) { If (in-expression) out-expression If (in-expression) out-expression } Else { out-statement-1 out-statement-2 } Return "!!! Stupid AHK !!!" }
I have a GitHub Actions workflow that builds and deploys from the dev environment to the prod environment. Currently, the build job takes around 19–20 minutes, but I want to reduce this to about 5–6 minutes maximum. Here is my Dockerfile: FROM node:22-alpine AS base RUN apk add --no-cache \ build-base \ cairo-dev \ pango-dev \ jpeg-dev \ giflib-dev \ librsvg-dev \ python3 \ make \ g++ # Upgrade npm to latest RUN npm install -g npm@latest WORKDIR /app # Install dependencies first (cache if unchanged) COPY package*.json ./ RUN npm install # Copy rest of source COPY . . COPY .env.production .env
In my ASP.NET Core 8 web app, I am trying to log the messages to Splunk. Splunk shows all the messages in a single message (nested JSON, very difficult to read messages). I want to store only the messages that I write in the application using _logger variable. How can I achieve it? Here are my files: "Serilog": { "Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File", "Serilog.Sinks.Splunk" ], "MinimumLevel": { "Default": "Information", "Override": { "Microsoft": "Warning", "System": "Warning" } }, //"Enrich": [ "FromLogContext" ], // "WithMachineName", "WithProcessId", "WithThreadId" ], "Wr
On windows 11 I use pyenv to be able to select a specific python version. I want to select python 3.11.9, and the output of pyenv versions is: 3.10.11 3.11.8 * 3.11.9 (set by C:\Users\WORK\.pyenv\pyenv-win\version) However, the installed python version is 3.10.11: > python --version Python 3.10.11 How to fix this issue?
I'm trying to set up a nice Python client for a GraphQL API managed by a separate team (in a different language): We want to provide useful type hints + autocomplete without introducing overly onerous maintenance requirements for our Python layer. I saw that gql looks popular and offers a Python DSL for building queries against schemas... So was thinking to take that and: Use introspection (e.g. here in graphql-core) on the endpoint to fetch a GraphQL Schema Definition Language description Build that schema (or some transformation of it) into our Python library in an automated pipeline, so we
According to the standard, overflow in Java is handled using a special value called infinity, but here the sum is 3.4028235E38. Why is this the case? public class FloatingPointTest { public static void main(String[] args) { float a = Float.MAX_VALUE; float b = 1_000_000_000f; // Note the 'f' to ensure it's a float literal float sum = a + b; System.out.println("Float.MAX_VALUE: " + a); System.out.println("Large number: " + b); System.out.println("Sum: " + sum); System.out.println("Is sum equal to Float.POSITIVE_INFINITY? " + (sum == Float.POSITIVE_INFINITY)); } }
I'm using dash-video and want to add an interceptor. The problem is Dash is initialized under api property by DashVideoElement, but I can't find any event when this is ready. @Component({ selector: 'app-root', template: ` <media-controller> <dash-video #video src="https://dash.akamaized.net/akamai/streamroot/050714/Spring_4Ktest.mpd" slot="media" crossorigin muted ></dash-video> </media-controller> `, schemas: [CUSTOM_ELEMENTS_SCHEMA], }) export class App { protected video = viewChild.required<ElementRef<any>>('video'); constructor() { effect(() => { setTimeout(() => { // I want to get `api` (
I am using the clinify package with flextable to generate a docx file. My issue is lining up the table body with the title footnotes. I tried using: set_table_properties(width = 1, layout = "autofit") to resolve this, but it didn't work. Sample code: # Load packages for program execution pkg.load <- c("tidyverse", "flextable", "officer", "clinify") invisible(lapply(pkg.load, library, character.only = TRUE)) test.df <- iris |> select(Species, Sepal.Length, Sepal.Width, Petal.Length, Petal.Width) |> group_by(Species) |> mutate( grp = cur_group_id(), descr = paste0("Property for Species: ", Speci
There are many articles on how to deploy Data API Builder (DAB) to Azure: https://learn.microsoft.com/en-us/azure/data-api-builder/overview But how do you host it on premises? We have Windows Server 2022, IIS 10.0 and SQL Server 2022. We can run the 'development' local host version on the above machine but are not sure the next steps to deploy and run it as a live service/app (?) We will be using REST API
I want to add properties window with auto properties based on struct fields. I'am downcasting every field, but for Vec<> and Option<> I have to duplicate all code, how can I automatically check is that any Option or Vec. Downcaster: pub fn downcast_property(ui: &mut Ui, title: &str, value_mut: &mut (dyn Any + 'static), interactable: bool) { if let Some(string_v) = value_mut.downcast_mut::<String>() { string_property(ui, title, string_v, interactable); } else if let Some(int_v) = value_mut.downcast_mut::<i32>() { i_property(ui, title, int_v, interactable); } else if let Some(float_v) = value_mu
I have a Simulink model with continuous states and a variable-step solver. Is there a way to force the solver to execute at specific nonuniform time steps, let's say t0, t1, t2, ..., tn? To clarify, I am not asking how to obtain simulation results at the said time steps. Update: If I am using a fixed-step solver and I want the solver to execute at 0, 0.1, 0.2, 0.3, 0.4, and 0.5 s, then I just need to set the fixed-step size to 0.1. However, I am using a variable-step solver and I want the solver to execute at, let's say, 0, 0.18, 0.2, 0.24, 0.33, 0.4, and 0.5 s. What should I do? Update 2: I a
Working on a Django project deployed on AWS. In production, I'm facing a session-related issue: When I open the Django admin site (/admin) and log in, everything works smoothly. But if I open the user site (/) in the same browser window and log in there, the admin gets logged out — which is expected behavior, so no complaints there. But here's the twist: Even after closing the user site tab, when I go back to the admin site and log in again, Django lets me into the admin dashboard — only to forget me immediately. Every time I try to do literally anything (open a model, add a record, even breat
How can I use ScrapingRobot’s API to scrape Google search results as structured JSON data (e.g., titles, URLs, snippets) instead of raw HTML? The main page of the website shows three types of "Example Outputs": SERP, Ecommerce, and HTML. The SERP format is what I want, but no matter what I do, I always only get HTML output. My code: import requests TOKEN = "..." // My API token SEARCH_TERM = "Lionel Messi" url = f"https://api.scrapingrobot.com/?token={TOKEN}" payload = { "url": f"https://www.google.com/search?q={requests.utils.quote(SEARCH_TERM)}", "module": "HtmlRequestScraper" } headers = {
Recently Ecuador government mandated yellow fever vaccine for all travelers, especially those who stayed in Colombia, etc, for 10 days. And one has to wait for 10 days after being vaccinated before Ecuador will accept them. I have the vaccine, but I got it a day before. Are they letting people in/ checking it, or not? (I will have to spend an extra 10 days in Colombia if it is true.)
When uploading media to s3 bucket, i am introduced to a technique called pre-signed urls, where backend generate the url and frontend upload directly to that s3 url, So far it is good. The problem occurs for get, when the user ask for all vendors should the url of vendor profile image also be presigned ? if yes then it means we need to pre-sign each image or each media before giving response back to the customer ? I mean how do i know i should keep the image as signed or public so can send the public url directly ? and what about some media which should be accessed by someone only when he is l
I'm trying to create a source alias or function to the PowerShell . builtin. Creating an alias to . does not work : PS C:\> Set-Alias source . PS C:\> source $profile.CurrentUserAllHosts source : The term '.' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + source $profile.CurrentUserAllHosts + ~~~~~~ + CategoryInfo : ObjectNotFound: (.:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\> I
I'm trying to create a custom Gutenberg block in WordPress that renders its content dynamically on the server side using PHP. I've registered the block using register_block_type, and added a render_callback function, but nothing appears in the editor or frontend. function myplugin_register_block() { register_block_type( __DIR__ . '/my-block', array( 'render_callback' => 'myplugin_render_my_block', )); } add_action( 'init', 'myplugin_register_block' ); function myplugin_render_my_block( $attributes ) { return '<div class="dynamic-block">Hello, this is dynamic content!</div>'; } import { registe
What I need to do is simple: I have A-f bound to find-file in emacs, but want to hide specific files that I do not care about. I have them hidden in dired already using this config: (setq dired-omit-files (concat "\\`\\.[^.]+\\'" ; Dotfiles without extension (e.g., .config) "\\|\\`\\.#.*\\'" ; Emacs lock files (e.g., .#anything) "\\|\\`persist-text-scale\\'" ; Specific file "\\|\\`transient\\'" ; Directories by name "\\|\\`target\\'" "\\|\\`node_modules\\'" "\\|\\.~undo-tree~\\'")) ; Undo tree files And I want to apply the same regex rules to filter out some files in find-file, so that I do no
I'm building a natural language search in my web application using a custom MCP (Model Context Protocol) client-server architecture. Here’s the setup: MCP Server: To execute backend method to return structured JSON MCP Client: Node.js app that sends this JSON along with a natural language prompt to the Claude 3.5 Sonnet LLM via API. Frontend: ReactJS LLM: Claude 3.5 Sonnet For smaller JSON payloads, the setup works fine — the LLM responds with a clean, natural language output. But as the JSON grows, I start running into token limit issues. Error as belows: 529: {"type":"error","error":{"type":