For my applet to solve a PDE (1D advection) I created a GIF. It works but is a mess of colors. How is this possible? import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import TextBox, Button, RadioButtons from matplotlib.animation import FuncAnimation from PIL import Image import os from avvezione1D import run # 1. Valori di default C_init, dt_init, Nt_init = 1.0, 0.01, 150 anim = None # 2. Configurazione della figura GUI # Diamo alla figura l'ID "99" così il solver non ci disegna sopra! fig = plt.figure(num=99, figsize=(10, 6)) fig.canvas.manager.set_window_title('Pann
I am a UK citizen, and hold a UK passport. Currently UK citizens can enter China for 30 days with no visa; this policy expires on Dec 31, 2026. Would I be allowed to enter China on December with a return flight after the policy expires in January,given that my whole stay is within 30 days? I've checked visaforchina.cn, but can not find an answer.
Table A has a partition column event_date. If I make a view for a customer like this: CREATE VIEW my_view AS SELECT * FROM( SELECT customer_id, event_date, ROW_NUMBER() OVER ( PARTITION BY customer_id ORDER BY event_date DESC ) AS rn FROM A) WHERE rn = 1; And they then use it like this SELECT * FROM my_view WHERE event_date >= '2026-08-01'; Will BigQuery do a full table scan, then window, then filter out event_date, or will it get data from 2026-08-01 (onwards), then window? The idea is that I want to own the logic of a window function and provide it as a view, but I don't want my customer to
I am building a VS Code extension that automatically generates workspace files. I want to create a new file at a specific path inside the user's open workspace and insert generated text content into it. I tried using Node's fs.writeFileSync, but it doesn't always refresh the VS Code Explorer UI immediately. I want to use the native VS Code API (vscode.workspace.fs). Here is my current approach: import * as vscode from 'vscode'; export async function createFile(fileName: string, content: string) { const workspaceFolders = vscode.workspace.workspaceFolders; if (!workspaceFolders) { vscode.window
An IQueryable<> is a declaration of intent, the code is only executed when called by a consuming method. I worry I'll accidentally execute it by calling foreach()/ToList() or .first() within the call. Having an EF Core DbContext class setup and Foo and Bar classes, would the following LINQ query execute as a single query against the database? Or does each call to DbSet<> separately call the database? public class DbContext { public DbSet<Foo> Foo { get; set; } public DbSet<Bar> Bar { get; set; } } public class Foo { public string Id { get; set; } public string BarId { get; set; } } public clas
When looking for information about initialization, with a specific value, of all elements of a std::array, then based on other threads, the more direct way found would need 2 steps: std::array<double, 5> arr; arr.fill(-1.0); // output: "[-1, -1, -1, -1, -1]" And about multidimensional std::arrays, the way (continuing with the same concept above) would need 4 steps, in contrast with for example multidimensional std::vectors where the process can be done in 1 single line as shown here: #include <array> #include <cmath> #include <print> #include <vector> int main() { constexpr int r = 3; constexp
I refer to two executors: the "executor argument" is the ex argument to e.g. overload 2 of post() or dispatch() and the "bound executor" is the executor (if any) bound to the completion token argument to post() or dispatch(). I'm trying to ensure that dispatching and posting always results in my code respecting bound executors if present, but falling back to a well-known executor. The Executor requirements on post() and dispatch() are slightly different; the return value of get_associated_executor() cannot be passed directly as the executor argument to post(). In my case the return type is any
In my template.json file I want to replace the word "Stat" with whatever the user puts in. { "$schema": "http://json.schemastore.org/template", // ..., "symbols": { "Conformance":{ "type": "parameter", "description": "The conformance of the stat building block.", "datatype": "text", "replaces": "Stat", "defaultValue": "Stat" }, "conformance":{ "type": "generated", "generator": "casing", "parameters": { "source": "Conformance", "toLower": true }, "replaces": "stat" } } } However, this also replaces words like "static". If "stat" is replaced with "picn" then "static" gets changed to "picnic". Ho
I am trying to create a dynamic table using a COUNTIFS() formula based on these criteria: Delivered Date (Week), Region, Owner and Type in a form of list for multiple selection. I want to ensure that once "All" is selected in both the "Owner" and "Type" drop down list, it would show all the records no matter what the criteria is. This is my current formula: =COUNTIFS(adi_data[Delivered Date (Week)], E3, adi_data[Region], $F$2, adi_data[Type], A$4, adi_data[Case Owner], C$4) Can you please help troubleshooting to add if the selection is "All" in the drop down lists?
The source code for Scipy's overlap-add method computes the optimal size of a convolution block. It applies this condition which says there can be no useful block if size of a smaller array is at least half the size of a longer array. However, I do not understand why.
I am trying to use Oracle's function based indexes (as opposed to a virtual column with a normal index) to simulate a unique constraint on a subset of data: orders |- id |- FK(customer_id) |- start_ts |- end_ts |- <misc data> CREATE UNIQUE INDEX unique_active_order ON orders CASE end_ts IS NULL THEN customer_id END to ensure there is at most one active/open order per customer. That works but the documentation states that queries must match the condition exactly, even down the THEN clause (because THEN is what gets stored in the index). However, with another table: Task |- id |- FK(order_id) |-
This is what my basic make-it-work setup looks like currently: The first call is successful. I get an access_token from it. In step number two, I want to pull data from the source using that access token. But I can't figure out how to attach it so that the source machine recognizes it for what it is. My setup is this: It creates request, and it includes the access token in the "Additional Headers" section, like this: { "source": { "type": "RestSource", "httpRequestTimeout": "00:01:40", "requestInterval": "00.00:00:00.010", "requestMethod": "GET", "additionalHeaders": { "Token_Added": "Authoriz
We are building a system that needs to integrate with cameras from multiple vendors and receive event notifications together with rich event metadata and the corresponding event image. Our requirements are roughly: Receive an event when something is detected. Get the event type (e.g. person, vehicle, intrusion, line crossing, etc.). Get information about what was detected, including relevant attributes when available. Get the bounding box of the detected object. Get the corresponding event image, preferably as a cropped/partial image containing only the region where the event occurred. The bou
I'm making a python program and I want to show the usage of each individual CPU core, but I'm not sure how to get the percentage for each core separately. Is there a way to do this with the psutil library?
I'm following the MDN article Using Service Workers, and the Progressier article Handling Service Worker updates. The essence of my question is, why do we need navigationPreload to be enabled at service worker activate when we have already cached our resources at service worker install? I have read the MDN document NavigationPreloadManager, but I'm still confused: The NavigationPreloadManager provides a mechanism to allow fetching of the resources to run in parallel with service worker boot, so that by the time the worker is able to handle the fetch request from the browser, the resource may a
I'm setting up a Turborepo monorepo with Bun, and I have a shared UI package that is consumed by my Next.js application. The package works correctly if I manually import components, but VS Code does not show auto-import or IntelliSense suggestions for components from the shared package. For example, if I create a new component like Badge.tsx inside packages/ui/src, I expect VS Code to suggest it and automatically add the import when I type <Badge /> or start typing Badge. Instead, I have to manually write the import: import { Button } from "@repo/ui"; After manually importing it, everything wo
I am learning flutter and have a general question. I am using the repository pattern, which the business/presentation layers listen to. The repository listens to the DB for new data or changes to them, and provides model representation of them. My question is, when the user for example requests to create a new todo task, the repository calls the DB to save it, then the DB calls the repository back to tell it of this new object, and only then the user sees it. is that the right approach, or should the repo just create the model directly, and when the DB calls it back it checks if the new object
In CLRS, Activity Selection uses a simple greedy rule (pick the earliest finishing activity) and it always gives the optimal answer. No DP needed. I tried the same idea on Weighted Job Scheduling (each job has start, end, profit, pick non-overlapping jobs for max profit). Picking the earliest finishing job first does not give the correct answer here. You need the full DP, i refers ith job: dp[i] = max(dp[i-1], profit[i] + dp[lastNonOverlapping(i)]) Both problems look almost the same. One needs greedy, other one needs DP. Is there a way to tell, just from the problem statement, whether greedy w
More than 40 years ago, the first window managers could arrange windows in "tiling" mode. As in the image below Program Manager. The task is to fill a rectangular space with a certain number of rectangles. Unfortunately, I did not find a description of the algorithm for how to do this.
As a preface to this, I'm fairly novice in VBA only a few months in and I'm working through making a custom userform for email drafting etc. On the userform there is a combo box I fill from a table in a sheet and originally just had it scan through like so: Private Sub UserForm_Initialize() ' Wrote the function "GetTable" to get the table as a list object Set tblTo = GetTable(Tbl_To) Set tblTemplates = GetTable(Tbl_Templates) Dim rng As Range For Each rng In tblTemplates.ListColumns(1).Range ' combo box name With cmboTemplates .AddItem rng.Value End With Next End Sub And I realized Referencing
I'm calling IOConnectCallStructMethod with a struct output, and that output never gets populated unless my DriverKit IOUserClient ExternalMethod returns kIOReturnSuccess. from my app code: size_t outputSize {sizeof(WriteOutput)}; WriteOutput output {0}; kern_return_t ret = IOConnectCallStructMethod(v_connection, static_cast<uint32_t>(ExternalMethodType::ExternalMethodType_Write),&input, inputSize, &output, &outputSize); and my driver UserClient method (dispatched by ExternalMethod) int USBDriverUserClient::writeHandler(OSObject *target, void *reference, IOUserClientMethodArguments *arguments)
I am using Genero Studio 3.21.01 and I find the dependency diagrams (see example below) quite useful. However, any dependency from a project added via the "Add External Dependency" option does show correctly. The external files/project are there but not any arrows/connections indicating a function from one external module is called by a module in the current project: I would like to see the dependencies as within a project: Is there any possibility to change that behaviour? The official 3.21 documentation does not mention any way to change what is included in the dependency diagrams.
As a disclaimer: I'm working on a dark comedy hard-scifi setting with the aim of parodying the likes of Dune, 40k, cyberpunk, analog horror, etc so just accept the ridiculous premise (and likewise i will accept ludicrous yet theoretically plausible answers). Backstory: We have a city-state in decline. Widespread poverty and homelessness, skyrocketing crime rates, high inflation and a severe deficit, a woeful lack of municipal support and social services are just some of the issues facing the local population. There is an aura of desperation and hopelessness across the city. The city officials’
When getting a stream from an API using cURL with CURLOPT_WRITEFUNCTION I can keep the stream alive. A callback function can do things with the data as it comes in. I can't do this with fopen() and fgets() because the stream closes when it receives '' or EOF. I want to constantly check a file that gets appended unpredictably. Something like: $handle = fopen('file:///home/me/myfile', 'r'); while(1){ $line = fgets($handle); echo $line; } with the while looping through existing lines of /home/me/myfile and when it's out of lines, continue looping but not close the stream at EOF. That way if myfil
Since <details>/<summary> already has built-in accessibility semantics (the browser exposes an implicit aria-expanded state via the open attribute), do I still need to manually add aria-expanded to be WCAG/ADA compliant? If aria-expanded is required, is there a no-JavaScript solution — or is scripting unavoidable to keep aria-expanded in sync with the open state? details[open] + div { display: block; } div { display: none; } <details name="my-group"> <summary>Utility menu</summary> </details> <div>Menu content</div>
I am planning a maintenance and load-balancing procedure for a PolarDB for MySQL Multi-Master (Limitless) cluster. Before using database endpoint switching in production, I want to understand its transaction consistency guarantees. My environment has the following topology: PolarDB for MySQL kernel version: 8.0.x Two read-write nodes: RW1 and RW2 Database-level isolation All application connections use the cluster endpoint The database db1 is initially assigned to RW1 In this architecture, multiple RW nodes share the underlying storage, but a specific database or data object has only one write
I am building an offline-first iOS application that stores searchable records along with photos and videos. A user may create or edit records, add or delete media, and then immediately lock the phone or leave the app. I do not need synchronization to finish immediately. I need eventual, crash-safe synchronization without requiring the user to keep the application in the foreground. What guarantees do iCloud Drive and CloudKit respectively provide for this use case? Please help. I did this for Android using the background worker function, but iOS deliberately prevents this and apparently operat