on-internet

What is the effect of a world's births being dependent on our world's deaths? Would the population be sustainable?

My world is essentially like a parallel version of Earth that's connected to our world from deaths. Like an afterlife almost, when someone in our world dies they get automatically sent into this world to get born again, with some of their memories carrying over. This world is an exact geographic copy of Earth, so people are born into this world somewhat nearby the same relative location between where they died in our world. Everyone in this world first lived a life in our world and died, leading them to get reborn here. When people in this world die they don't get reborn into again, only peopl

Join the discussion →

Accessible blocking loading overlay

As far as I've understood, what I am calling "blocking loading overlay" is not just a "backdrop". The "backdrop" is a part of other components (e. g. modal dialogs) but "blocking loading overlay" is the compound one includes: Backdrop Loading indicator Visually hidden message Here is the implementation example from MUI: <Backdrop sx={(theme) => ({ color: '#fff', zIndex: theme.zIndex.drawer + 1 })} open={open} onClick={handleClose} > <CircularProgress color="inherit" /> </Backdrop> I suppose, the output HTML is not enough accessible: <div class="MuiBackdrop-root css-19metyz" style="opacity: 1;

Join the discussion →

Why do BC ferries allow foot passengers choose to walk off the vehicle deck? [closed]

On BC Ferries today from Vancouver to Swartz bay, I parked my sedan on the vehicle deck. Around 30 people - with their luggage - walked in front of my sedan, right up to the front of the vehicle deck. They were standing next to, in plain view of, many BC Ferries staff. I was scratching my head why. When the ferry docked, why does BC ferries allow them to walk off the vehicle ramp and onto Swartz bay? Doesn't BC Ferries require all passengers to exit the ferry up on the passenger decks?

Join the discussion →

Can anybody suggest another method to split a large Excel file into multiple files in any tool other than VBA?

I need to split a large Excel file into multiple small files based on the first five digits of the values in a column. For example, I have values 1396A0001A,1396A0002A to split based on the first five digits, 1396A, into a separate sheet. I have VBA code to do this, but it is taking too much time - 3 hours to split the entire file of 15000 records in a file. Can you suggest any other method to split the file? Sub SplitSheetIntoMultipleWorkbooksBasedOnColumn() Dim objWorksheet As Excel.Worksheet Dim nLastRow As Integer, nRow As Integer, nNextRow As Integer Dim strColumnValue As String Dim objDi

Join the discussion →

When I print raw character codes to terminal one after another, why is there a gap in the range from 157 to 280?

In the below code - there is a huge gap in the output. From 157-280 nothing is printed. I would expect, that at least the integer value is being printed. #include <stdio.h> int main(void) { for (int c = 0; c < 300; c++) { printf(">%c< (%d)\n", c, c); } return 0; } Part of the output: >< (150) >< (151) >< (153) >< (154) > < (156) >< (280) >< (281) >< (282) > (283) I am using Linux and the wezterm terminal emulator.

Join the discussion →

MariaDB query is much faster when using CAST() on bound parameters?

Update for those interested: https://github.com/MariaDB/server/pull/5906 We use a MariaDB database (with stored procedures) and pass params via PHP middleware. A minimal example of the table and view defintion I'm using: CREATE DATABASE cast_demo CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; USE cast_demo; SET NAMES utf8mb4 COLLATE utf8mb4_general_ci; CREATE TABLE example_data ( id INT NOT NULL PRIMARY KEY, x VARCHAR(32) NOT NULL, y VARCHAR(32) NOT NULL, amount INT NOT NULL, KEY ix_xy (x, y) ) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; INSERT INTO example_data

Join the discussion →

How do I fix my NASM code from auto-exiting after I open the EXE on Windows 11?

I wrote a WIN64 compiled NASM program, but I can't figure out how to wait for a keypress before exiting. My code is: bits 64 global main extern _getch extern exit extern printf section .data msg db "hmmmmmmmmmm", 10, 1 section .text main: sub rsp, 40 lea rcx, [rel msg] call printf add rsp, 40 mov rax, 0 ret call _getch xor rdi, rdi call exit I compiled this with a batch script that executes the following: @echo off nasm -f win64 MyNasm.asm -o MyNasm.obj gcc MyNasm.obj -o MyNasm.exe .\MyNasm.exe Then I execute the program in the VSCode terminal. If the code is wrong, or there is some "library"

Join the discussion →

Reversing array vector rows in state engine: does reverse(H:col) work?

Need to reverse each row of an array vector column in reactive state engine metrics, e.g. [1,2,3] → [3,2,1]. Is reverse(H:arrCol) the correct syntax? engine = createReactiveStateEngine( name="reverseEngine", metrics=<[reverse(H:arrCol) as reversed]>, dummyTable=inputStream, outputTable=output, timeColumn=`time, keyColumn=`sym ) What does H: mean? Is this supported in state engines?

Join the discussion →

When should a class break the UpperCamelCase naming convention?

According to PEP 8, class names should use the UpperCamelCase (CapWords) convention. However, I have seen classes use lowercase names. For example, in the standard library: class socket(_socket.socket): ... class defaultdict(dict): ... PEP 8 does allow an exception: The naming convention for functions may be used instead in cases where the interface is documented and used primarily as a callable. What does "documented and used as a callable" mean? Aren't all classes callable as they can be instantiated? Putting aside builtin types, when would it be desirable to use a non-CapWords class name?

Join the discussion →

How to rename an IntelliJ project?

Every time I've tried to rename a project, it either doesn't rename all the files which then messes up how my files are run. I've tried searching for the button on "Project Files", but none of them work. Even when I've managed to change a file name, it either keep the old directory within the project as well or just doesn't completely change every instance of the project name.

Join the discussion →

How do I automatically approve "low risk" Github Copilot commands in VS Code?

I am using GitHub Copilot in VS Code via the Chat tab. Whenever Copilot requests permission to run a command, it includes an estimated rating of how risky the command is. (Green for safe, red for risky) There is an existing question on how to auto-approve all GitHub Copilot commands, but is there a way I can configure VS Code to only auto-approve GitHub Copilot commands that are determined to be low risk? Safety note: I acknowledge that the risk assessments are AI generated and may not be fully accurate. However, I find it to be a better alternative than blanket approving all commands, or havi

Join the discussion →

C17 vs C23: () function pointer error - Is this the correct fix?

I'm working on a MASM-to-C transpiler that has zero knowledge of function parameter types. The same generated C code must compile without warnings with: GCC C17/C23 using -Wall -Wextra -Wpedantic MSVC using /W4 Among the configurations I tested, the failure occurs with GCC C23: x86-64 GCC 16.2 -std=c23 -Wall -Wextra -Wpedantic https://microsoft.godbolt.org/z/vfc96PTM9 #include <stdint.h> int MyFunA(int a){ return a; } int MyFunB(int a){ return a; } int (*MyCallBacks[])() = { &MyFunA, &MyFunB }; int main(void) { return 0; } As noted here, this works cleanly with GCC C17 because () means that th

Join the discussion →

What should I do if the airline cancels my flight and claims the ticket is still valid?

Following up to this Chargeback dispute, today the bank forwarded me a reply from the airline saying I'm not entitled to a refund because the ticket is non refundable and can still be used for traveling. In the same email they also send me this information: Therefore, since my flight was cancelled by the airline and there was no alternative later than 1 hour of departure time and within 2 hours of arrival time I'm still eligible for a complete refund. This is where things stand now: the airline informed me the flight was cancelled my ticket was fully refunded by the airline my companion was no

Join the discussion →

Correct binary tree preorder/inorder to postorder implementation passes all visible tests but fails eLab Logical Test 4

enter image description hereI am solving a binary tree traversal problem on a university eLab programming platform. The problem is: Given the preorder and inorder traversals of a binary tree with n distinct nodes, output its postorder traversal. The constraints are: 1 ≤ n ≤ 10^5 The nodes are numbered from 1 to n. Example Input: 5 5 3 2 1 4 3 5 1 2 4 Expected output: 3 1 4 2 5 Another test case: 6 6 5 3 2 1 4 6 3 5 1 2 4 Expected output: 3 1 4 2 5 6 My implementation uses the standard reconstruction idea, but instead of recursion I use an iterative stack, because n can be as large as 100000. H

Join the discussion →

Comma Operator in for-loop in C

For the following loop, int i; for(i= 0, printf("hello\n"); i<10; i++) {printf("%d",i)}; the output is hello 0123456789 Can anyone explain this? My reasoning: In C, the comma operator works by evaluating the first expression, discarding its value, then evaluating the second expression and returning that as the result. For example: x = (exp1, exp2); This executes exp1, ignores its value, then evaluates exp2 and assigns that result to x. However, in a declaration like: int x1, x2, ... , xn; the comma is not the comma operator — it’s a declarator separator. The grammar of C treats commas in decla

Join the discussion →

Is git sparse checkout compatible with submodules?

I have a simple experiment that seems to suggest - no. But maybe I am missing something. I have a self-contained reproduction that you can run in docker run -it --rm --entrypoint sh alpine/git:v2.54.0 Some git setup to run everything locally git config --global user.email a@b git config --global user.name test git config --global protocol.file.allow always First, we setup two repos - vendor and my_repo_remote . We are making them locally, but let's imagine those are repos somewhere on github # Vendor: initial commit mkdir /vendor; cd /vendor; git init echo A > lib.c; git add lib.c; git commit

Join the discussion →

Are there any performance implications of Pub/Sub message ordering on the publisher only?

I am maintaining an internal Go library, which has a pubsub package. Currently, it doesn't support message ordering, but I would like to enable it. I want to make it as simple as possible by using defaults where it makes sense - convention over configuration type thing. I have a simple Publish function which accepts a topic and a message payload: func (c *Client) Publish(ctx context.Context, topic string, message any) error { data, err := json.Marshal(message) if err != nil { return fmt.Errorf("failed to marshal message: %w", err) } pubSubMsg := &pubsub.Message{ Data: data, PublishTime: time.N

Join the discussion →

How to write GPU code using only g++ or clang++

I'm working on a c++ project which has a single step that is computation limited, and I think this would naturally fit within the scope of GPU acceleration. However, the platform I'm working with doesn't have nvcc. Is there a way to write GPU accelerated code using just g++ or clang++? Preferably without pulling in a ton of library dependencies. Edits: Thanks for the responses! Fair enough, to add more details I'm working on a system where I can't install libraries via the system installer. Any library that I need that's not already installed has to go in my home folder. That's okay, although

Join the discussion →

Can't get virtual environment to activate from the terminal

I am trying to run a Python script using a venv I created with PyCharm. When I run the script using PyCharm, the script runs fine. When I try to run it from the terminal, I get "module not found" (i.e. I'm not in the correct virtual environment). Indeed, when I run -m pip list, the list contains only pip. I copy the file path to Python directly from PyCharm: Then, in my terminal I run: /home/<me>/PycharmProjects/From Windows/GifToMp4/.venv/bin/python3.13" -m pip list I've also tried python3 and python3.13 instead of just python. How do I get my terminal to enter the venv to access the installe

Join the discussion →

Playwright button is not clickable

I had created a simple Playwright test with maker/checker, but the maker click a button does not respond to any actions/dialog pop up displayed. This is the source code when I right click "view frame source". I don't know why cannot view page source. I generated the code using: npx playwright codegen --channel=msedge

Join the discussion →

How to discard a message from inside a MessageConverter

It would be nice to be able to discard a message (ack it) without processing from inside the MessageConverter, but I have not been able to find a clean way to do it. My current solution is to return Optional.empty() in the MessageConverter and then use @Payload(required = false) in the @RabbitListener and check for a null message, but I find that a bit cumbersome.

Join the discussion →

Handling image data over WebSocket in Spring Boot

I am building a shooting game. The phone is connected to the server through WebSocket. On the client side, when the player hits "shoot", the phone will capture a picture and get the current orientation of the phone. public record PlayerShootTrigger( byte[] imageData, Orientation orientation, @DecimalMin("0.0") @DecimalMax("1.0") double radius ) { public record Orientation( double x, double y, double z ) {} } Since I see there is a mix of binary and text data, how should my WebSocket handler deal with this? I checked the AbstractWebSocketHandler, they provide the handleTextMessage and handleBin

Join the discussion →

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 →
Older stories