on-internet

How well does git work with binary files?

How well does git work with binary files? Suppose I have a photoshop file, and for some reason I'd like to save copies of multiple version of my progress. Currently, I would just save multiple files like: v1_yy_mm_dd_hh_mm , v2_yy_mm_dd_hh_mm, v3_yy_mm_dd_hh_mm. Instead of doing this, can I use git to stage and commit versions of my progress for the binary file? Would this work correctly and is it okay to use git in such manner? Would it work for very large files or is there a drawback to saving work versions like this because git was created I believe only for programming which is primarily t

Join the discussion →

Twincat doesn't show value but modbus poll shows value

So i'm currently using twincat to read the modbus poll value from a Salicru device, via Nimbus card, currently i'm using function 04 so here's the issue, in the modbus poll, there's the value reflected in the address (let's say 20200 to 20204), but in twincat, all of them shows 0, but there's no error code in display as well. By right, in the Twincat, the arrTempReadDataRegs should have some value filled in instead of all 0. I want to know if there's any way to work on it? because i really wanted twincat to get the value from the devices VAR iConvertedUnitID:INT; fbMBTCPClientReadInputRegs:FB_

Join the discussion →

Next.js OAuth route returns 307 redirects and eventually 404 after disabling development auth mode

I'm working on a Next.js application that supports two authentication modes: Development mode (NEXT_PUBLIC_DEV_MODE=true) which bypasses GitHub OAuth and logs in a mock user. Production mode (NEXT_PUBLIC_DEV_MODE=false) which should use real GitHub OAuth. My .env contains: DATABASE_URL="file:./dev.db" GITHUB_CLIENT_ID="your_github_client_id" GITHUB_CLIENT_SECRET="your_github_client_secret" NEXT_PUBLIC_APP_URL="http://localhost:3000" NEXT_PUBLIC_DEV_MODE="false" When I click "Login with GitHub", I see the following logs: GET /api/auth/session 401 GET /api/auth/github 307 GET /api/auth/github 30

Join the discussion →

What biological Carbon Tetrafluoride cycle could be justifiable on my world?

In my question, What characteristics would be required for a paradise world?, I asked how a paradise world (from a human perspective) might arise. In Nosajimiki's accepted answer, it was suggested that the world would need a strong greenhouse effect that would make its rather spaceward-of-the-goldilocks-zone orbit viable for humans and even out local temperature variations. The trouble with a greenhouse effect is that while Carbon Dioxide and Nitrous Oxide are effective greenhouse gases, they each have toxic or undesirable effects upon humans at relatively low concentrations that are higher th

Join the discussion →

Why are my gettext translations not appearing?

I am learning gettext and trying to use it from first principles (no make files, configure.in files etc). I have this C program. #include <locale.h> #include <libintl.h> #include <stdio.h> #define PACKAGE "messages" #define LOCALEDIR "./locale/" int main(int argc, char *argv[]) { setlocale(LC_ALL,""); //also tried //setlocale(LC_ALL,"de"); bindtextdomain(PACKAGE, LOCALEDIR); //also tried adding //bind_textdomain_codeset(PACKAGE, "UFT-8"); textdomain(PACKAGE); printf(gettext("Hello World\n")); return 0; } I created the initial messages.pot (portable object template) xgettext -d messages -p loca

Join the discussion →

GKE: Does Node Pool Autoscaler totalminNodeCount parameter function when Cluster Autoscaler is disabled?

I have a GKE cluster with the following setup: Cluster: 3 nodes Cluster Autoscaler: DISABLED Node Pool Autoscaling: ENABLED Node Pool totalminNodeCount setting: 1 Cloud Scheduler: configured for weekend budget shutdown Configuration of Cloud Scheduler: Terraform module that automatically starts and stops GCP GKE clusters on a schedule to reduce compute costs, using Cloud Scheduler and GCP Workflows Scheduled start/stop of GKE clusters via Cloud Scheduler (cron) Node pools will be forcefully scaled to 0 regardless of any minAvailable or maxUnavailable constraints defined in your PDBs. When Clus

Join the discussion →

Perl's Regexp::Common::balanced hangs on some strings

I'm using Regexp::Common::balanced to split up the contents of some latex files. For most files it works fine, but I've found some files for which it is very slow or hangs forever (or at least for hours). The problematic files aren't larger or smaller than ones the work, and the contents of all the files is similar. I've also found that if I concatenate a few of the working files into one file, the resulting file causes the misbehavior. Below is a minimal working example that demonstrates the behavior. The files range in size between 60 and 120 kB. I've tried a binary search by repeatedly bise

Join the discussion →

Spring Boot cannot connect to PostgreSQL in Docker

I'm having a persistent issue with Spring Boot 3.5.15 connecting to PostgreSQL 16 running in Docker. I keep getting: FATAL: password authentication failed for user "attendance" What I've tried: Docker container runs with correct environment variables: docker run --name postgres -e POSTGRES_USER=attendance -e POSTGRES_PASSWORD=attendance -e POSTGRES_DB=attendance -p 5432:5432 -d postgres:16 I can connect successfully from command line: docker exec -it postgres psql -U attendance -d attendance # Shows: attendance=# User exists in database: SELECT usename FROM pg_user; -- Returns: attendance Envi

Join the discussion →

How does React Router v7 choose between two equally specific matching routes?

I'm using React Router v7 and trying to understand how route matching works when multiple routes can match the same URL with the same level of specificity. For example: <Routes> <Route path="/foo/:someVar/baz" element={<A />} /> <Route path="/foo/bar/:someOtherVar" element={<B />} /> </Routes> If I navigate to: /foo/bar/baz, both routes appear to match: /foo/:someVar/baz → { someVar: "bar" } /foo/bar/:someOtherVar → { someOtherVar: "baz" } My questions are: Which route will React Router v7 render in this case? If the ranking is the same, how is the tie resolved? I found the "Ranked Route Match

Join the discussion →

What is the most efficient way to schedule and run several Python scripts automatically at different time intervals?

I'm working on a personal project with several Python scripts that run on different schedules (hourly, daily, weekly), and I'm comparing different ways to orchestrate them. For setups like this, what has worked best for you? Do you prefer cron/Task Scheduler, systemd timers, APScheduler, Airflow, or something else?

Join the discussion →

How can I show only the first instance of an SQL count?

In SQL Server I have table myTable with fields patientID, orderID, and orderDesc. Patients can have multiple orders with different descriptions. How do I write a query to select that information, plus a total count of the orders each patient received? I want the patient’s count to only return the value in each patient’s first row, and either null or be blank for the rest of the fields: PID Count OID 123 3 235 123 null 456 123 null 678 456 1 123 How can I implement nullif without it being inefficient?

Join the discussion →

Why did the elves abandon their immortality to live among mortals?

In the days of legend, when the World Tree was but freshly sprouted, and many of the gods still newly born, they say the first sapient creatures began life upon the surface of the Earth. Among them were the creatures of Feyrie, who live a life eternal beyond the barrier of twilight that enshrouds their realms. Dying not, they live on unchanged through what, to mortals, would be many turns of time's great wheel. Governed justly (although I shall not say beneficently) by the Feyrie Queen, the many species of faerie creature - the impish pixies, brave sprites and frankly rather odious goblins amo

Join the discussion →

What is the default CSS stylesheet PhantomJS uses when rendering PDF/HTML, and how to replicate it in Puppeteer?

Problem I'm migrating from node-horseman (PhantomJS wrapper) to Puppeteer for PDF generation and my output looks different — backgrounds, fonts, and spacing are off. I need to understand exactly what default CSS PhantomJS applies so I can replicate or override it in Puppeteer without breaking production. Current code (node-horseman / PhantomJS) let horseManPromise = horseman .userAgent('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0') .viewport(1200, 900); horseManPromise = horseManPromise .pdf(pdfTempFilePath, { format: paperSize, // e.g. 'A4' orientation: documentOr

Join the discussion →

How can I get a source code of Python function which was declared by using 'exec' inside other function?

I need to get a source code of Python function which was declared via using exec inspect.getsource can't help me with that. Simplified Example: from inspect import getsource def declare_func(): func_code=\ '''def new_func(): print("Hello, world!")''' exec(func_code) return locals()['new_func'] func = declare_func() print('=run=') func() print('=func=') print(func) print('=code=') print(getsource(func)) Output: =run= Hello, world! =func= <function new_func at 0x000001DF77173E20> =code= ... OSError: could not get source code How can I get source code of the 'func' ? Note1: I can't avoid using ex

Join the discussion →

How to include static images in WordPress Gutenberg templates?

When using templates in block themes in WordPress, it's sometime useful to use static images. How can we dynamically use a relative path? In this example: <!-- wp:image {"width":"auto","height":"100px","sizeSlug":"full","linkDestination":"none"} --> <figure class="wp-block-image size-full is-resized"> <img src="[STYLESHEET_URI]assets/img/icos/ico-ressources.svg" alt="Static image" style="width:auto;height:100px"/> </figure> <!-- /wp:image --> the purpose is to replace [STYLESHEET_URI] by the stylesheet directory URL. The documentation tells to use PHP: <img src="<?php echo esc_url( get_theme_f

Join the discussion →

Hint to block key lookup, without forcing a particular index

Is there an index hint in T-SQL that says "do not use any nonclustered index that would require a key lookup"? Apart from that restriction I want to let the query planner have a free choice of indexes. I don't want to force one particular index as with (index(myindex)). And the forceseek hint doesn't exclude a key lookup after the seek. I have considered adding included columns, creating better statistics, or rewriting the query with an explicit join between the nonclustered index and the clustered index. Can this query hint be expressed in T-SQL?

Join the discussion →

Using Chat with Codex

I'm confused about the Chat feature in VSCode. Is this specific to Copilot or is is supposed to work with other platforms like Codex and Claude? I have installed the Codex extension and have been using that, but it doesn't have access to tool like the integrated browser. The Chat tools settings says I can select the tools for the default agent - how do I change the default agent? There is the agent type dropdown, with Codex and Claude, but selecting Codex does nothing, it just stays on Local. My Codex sessions show in the Chat Sessions list, but if I type something in the Chat window then Gith

Join the discussion →

Increase the limit of Data Connector processes per day

In Autodesk Forma the Data Connector limit is 24 jobs per 24 hour period. We need more than 24 job runs per day for different modules or sources (Issue, Assets, Reviews, RFI, etc.). Is it possible to increase to 48 per day or to have the limitation be per user instead of hub?

Join the discussion →

The following plugins do not support Swift Package Manager

When running flutter build ios, the build fails during the "Adding Swift Package Manager integration" step with the following error: Adding Swift Package Manager integration... 16.6s An error occurred when adding Swift Package Manager integration: Error: Unable to get Xcode project information: xcodebuild: error: Could not resolve package dependencies: main/Package.swift:78: Fatal error: Failed to load configuration: fileNotFound("Error loading or parsing pubspec.yaml: Error Domain=NSCocoaErrorDomain Code=260 \"The file "pubspec.yaml" couldn't be opened because there is no such file.\" UserInf

Join the discussion →

httpclient and (decorating) middleware in golang

I am trying to grasp how the following code example works. It wraps (decorates) a standard http.client with 2 middleware functions (Logger and BasicAuth) that are invoked when making client (RoundTripper) calls. The setup/initialization is as follows: package decorator import ( "log" "net/http" "os" ) // Setup initializes our ClientInterface func Setup() *http.Client { c := http.Client{} t := Decorate(&http.Transport{}, Logger(log.New(os.Stdout, "", 0)), BasicAuth("username", "password"), ) c.Transport = t return &c } The problem is that I don't exactly understand what happens in the Decorate

Join the discussion →

Why Rust is taking a ton of my disk space and how to make it use less

I am new to Rust and just built a simple Pong using the Bevy game engine. While the game works perfectly, I noticed that the project folder is taking up literally gigabytes of my disk space! I heard that this is caused by Cargo's build artifacts stored in the target directory. Because Bevy is a large engine, the debug symbols are massive. Is there a way to automatically limit or change how Cargo stores these files globally so it doesn't consume all my disk space? Or is there a recommended configuration (like in Cargo.toml) to reduce the build size during development?

Join the discussion →

Schengen passport control delays - Irish citizen

Irish citizen flying out from Malaga airport in a few days. What delays at passport control will I face? Will it be as had as British citizens or are EU citizens fast tracked? I'm looking for some fairly recent personal experience on this.

Join the discussion →

Count the number of vowels in a text

A rookie in Ruby here. I'm trying to count the number of each vowel in a text entered by the user but I'm stuck. My code is this at the moment: def count_vowels(phrase) puts 'Enter a text:' phrase = $stdin.gets.downcase.chomp a_count = 0 vowels = ["a", "e", "i", "o", "u"] # these two lines are only for debugging puts "\nThe text is: #{phrase}" puts "#{phrase.chars}" for char in vocals if char == vocals a_count += 1 end return a_count end end count_vowels(ARGV) I don't know how to count each vowel: a = 3 e = 2 and so on.

Join the discussion →

sharing to LinkedIn using curl and PHP - post photo AND URL to click through

I am building an app to make posts to a LinkedIn page, written in PHP, using the curl library. I have successfully: Authenticated (scopes: w_member_social, openid, profile, email Registered and uploaded my image, and got the URN back (urn:li:digitalmediaAsset:CODE) But I am having trouble making a post that shows the image and lets you click on it to get to the right place (or any place). My JSON looks like: { "author": "urn:li:person:SUBCODE", "lifecycleState": "PUBLISHED", "specificContent": { "com.linkedin.ugc.ShareContent": { "shareCommentary": { "text": "TEST LISTING SHARE - IGNORE! - sha

Join the discussion →

How would a r-strategy species control their population?

I am currently working on conceptualizing an octopus-like alien civilization's family structure. An earth octopus gives birth to thousands of offspring in a single reproductive cycle. They dies after hatching eggs. Alien don't need to behave exactly the same as earth octopus. I was just using them as reference. But I think it would be cool for them to use a non-human reproduce strategy. R-strategy feels like a good start. In my current story setting, alien version of ape-man (octupus-alien?) behaves similar to earth octopus. R-strategy wasn't a problem for octupus-alien, all they need was surv

Join the discussion →

error "java.lang.AssertionError: Content type not set" when implementing controller unit test

I am implementing an integration test on a method of a controller Here is the controller method @PutMapping(value="/create", produces = MediaType.APPLICATION_JSON_VALUE, consumes=MediaType.APPLICATION_JSON_VALUE) @ResponseBody public SubscriptionDto createSubscription(@RequestBody SubscriptionDto subscriptionDto) throws IllegalCreationException { subscriptionService.checkValidityOfNewSubscription(subscriptionDto); subscriptionDto = subscriptionService.createSubscription(subscriptionDto); return subscriptionDto; } and when I test the request mockMvc.perform(put("/subscription/create") .contentT

Join the discussion →
Older stories