on-internet

Unable to open 3 VS Code windows attached to the same Docker container

I have a Docker container with OrbStack that contains a directory repos with a repository app-main and worktrees like app-feature-a to develop in parallel. Configuration is done in order to prevent modification of the container configuration file in the running Docker. project/ ├── .devcontainer/ # outside the mount, on purpose │ └── devcontainer.json └── repos/ ├── app-main/ ├── app-feature-a/ └── app-feature-b/ MWE for devcontainer.json : { "name": "myproject", "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "workspaceMount": "source=${localWorkspaceFolder}/repos,target=${localWorksp

Join the discussion →

How would sapient frogs communicate with their tadpoles?

My frog species are very technologically advanced, but still require an aquatic tadpole stage. I am writing a story set in the world where I'm describing the life of a tadpole and wondering how they could communicate with their parents, I'm thinking they'll have smartphone type devices but also perhaps they may have evolved some sort of echolocation under the water? Related to this, how would the tadpole carry stuff (for example to school, or going to friends houses)? Is it feasible that they would just...not, or would an older frog / a machine have to do everything for them, or is it feasible

Join the discussion →

Can C++ "happens-before" order contradict physical wall-clock execution time?

Consider the following C++ example: #include <chrono> #include <ctime> #include <iostream> #include <mutex> #include <string> #include <thread> int stock = 10; std::mutex mtx; time_t time_buy = 0; time_t time_clear = 0; std::chrono::time_point<std::chrono::steady_clock> t_buy_start; std::string clear_stock() { std::unique_lock lock(mtx); // #1 time_clear = time(NULL); stock = 0; return "clear"; } std::string buy_stock() { std::unique_lock lock(mtx); // #2 time_buy = time(NULL); if (stock >= 1) { stock--; return "ok"; } return "empty"; } int main() { std::string res_clear; std::string res_buy;

Join the discussion →

Pyright type error when using classic `attrs` library with type comments in Python 3.5

I am using Python 3.5. Since dataclasses doesn't exist in 3.5, I'm using attrs as an alternative - namely, the classic attr namespace from attrs==22.1.0 (which is the last version that supports 3.5). However, when I write the following (using type comments because 3.5 doesn't support variable annotations): import attr from typing import List @attr.s class Foo: names = attr.ib() # type: List[str] Foo(['James']) I get the Pyright error Expected 0 positional arguments when instantiating Foo. The program raises no errors at runtime. If I switch to a newer Python version (e.g. 3.10) in VS Code, the

Join the discussion →

Pyright type error when using classic `attrs` library with type comments in py3.5

I am using Python 3.5. Since dataclasses doesn't exist in 3.5, I'm using attrs as an alternative (namely, the classic attr namespace with attrs==26.4.0, which supports 3.5). However, when I write the following (using type comments because 3.5 doesn't support variable annotations): import attr from typing import List @attr.s class Foo: names = attr.ib() # type: List[str] Foo(['James']) I get the Pyright error Expected 0 positional arguments when instantiating Foo. The program raises no errors at runtime. If I switch to a newer Python version (e.g. 3.10) in VS Code, the error goes away. However,

Join the discussion →

Oracle 12c - Connection Problem With Service Name

I have a simple docker container Oracle 12c. It has CDC and 1 PDB. I successfully connect with: $conexao = oci_connect( 'sip', 'sip_user', 'db/orclpdb1.localdomain', 'WE8ISO8859P1' ); but if I try to connect with: $conexao = oci_connect( 'sip', 'sip_user', 'db', 'WE8ISO8859P1' ); it gives me: Warning: oci_connect(): ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA How can I configure the database so it accepts the connection without /orclpdb1.localdomain? On php node I do not have a tnsnames.ora.

Join the discussion →

Updating one of Python's previous versions to its latest version for bug fixes

I am trying to update one of my installed Python versions to its latest release using the Terminal. If I run py --list, I get all Python versions, that is 3.12, 3.13, and 3.14. Python Manager py can update the most recent version 3.14: py install --update but I can't figure out how to run py to update 3.13 or 3.12 to its latest release for bug fixes. Probably I will need to manually download and run installers, but is it possible using py? My OS is Windows 10 and I work on PowerShell. The default folder in PowerShell is D:\. If I try to run py -V:3.13 install --update I am getting the followin

Join the discussion →

Problems rendering GIF created with FFmpeg

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

Join the discussion →

Can a person enter China on a visa free entry if the return flight is booked for after the visa free scheme expires?

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.

Join the discussion →

Is a partitioned where clause after a window function executed before or after

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

Join the discussion →

What modifiers do I have to use to get this button style in SwiftUI?

The button style that I am trying to achieve is this one: I have tried using the glassProminent button style but it doesn’t give the text that colour. This style where the foreground label is a lighter colour than the tint of the button is also in toolbar items when using the glassProminent buttonStyle modifier. I have also noticed that using the glassProminent buttonStyle modifier only gives this style to the toolbar buttons if you use the Label view. If you use Text or Image, this style is not applied. i have tried a myriad of combinations and haven’t been able to reproduce this style. One a

Join the discussion →

How to programmatically create a file and write content using VS Code Extension API in TypeScript?

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

Join the discussion →

Does querying multiple EF Core DbSets in a single LINQ call result in a single query to the database?

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

Join the discussion →

Initialization of all elements of a multidimensional std::array to one default value

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

Join the discussion →

ASIO dispatch and post default executor

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

Join the discussion →

MS Access re-uses already established ODBC connections, disregarding differing connection parameters

MS Access seems to re-use already established ODBC connections, disregarding differing connection parameters, when using multiple Linked Tables. I suspect this happens with EVERY kind of database server in the background, but here I have tested it with SQL Server, although my first suspicion came when using PostgreSQL quite a while ago. I had two PostgreSQL servers on the same host, and MS Access was somehow mixing them up, as far as I remember. Has anybody experienced the same behaviour? Is this documented anywhere on the internet? How to mitigate that? To reproduce, I assembled the following

Join the discussion →

Filter for whole word when replacing text in a template.json

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

Join the discussion →

I am creating a dynamic formula to count the number of records based on these criteria

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?

Join the discussion →

How can I apply a functional based index to multiple situations?

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) |-

Join the discussion →

How do I submit OAuth2 access token in a Data Flow?

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

Join the discussion →

How do I reliably receive rich event metadata and cropped event images from multi-vendor IP cameras?

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

Join the discussion →

React.lazy permanently caches a failed dynamic import — how can I retry a route chunk without reloading?

Every route in my SPA is code split with React.lazy. If a route's chunk fails to download because the device went offline, that route stays permanently broken for the lifetime of the document, and the "Retry" button in my error boundary cannot recover it. Environment React 19.2.5 react-router-dom (client-side routing) Vite (code splitting via dynamic import()) react-error-boundary ^4 Runs inside a hybrid WebView shell (Android WebView + iOS WKWebView) Observed in production on device, and reproduced locally against the dev server. Setup lazy() is called once per route at module scope: // src/a

Join the discussion →

With service workers, I'm struggling to understand navigationPreload

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

Join the discussion →

VS Code auto-import suggestions not working for local workspace package in Turborepo (Next.js + Bun + TypeScript)

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

Join the discussion →

Should CRUD changes reflect directly in local state or wait for database update?

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

Join the discussion →
Older stories