on-internet

I want any blanks replaced by N/A

Other than using a CASE statement in an SQL query, how can I replace any null or blank in my query result by N/A? I am trying to achieve this using Spark SQL in Databricks. Is there a way using Python?

Join the discussion →

IB API loop contract details for multiple tickers

objective of my script is to get sector for each stock from my portfolio. I have already script that pulls out all my positions from IB API GW. I have a script that can get contract details for one stock. The problem is (I never used class crap that IB forces in their API) I do not know how to use below program as module in main program, and pass contract variables. #!/usr/bin/env python3 from ibapi.client import * from ibapi.wrapper import * from ibapi.contract import * import time import threading import sys class ContDetails(EClient, EWrapper): def __init__(self): EClient.__init__(self, sel

Join the discussion →

2 flat arrays (keys/values) to nested JSON

I need to go from: keys = ['a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c', 'd', 'a', 'b', 'c', 'd'] values = ['12', '9', '4', '5', '14', '6', '3', '3', '10', '9', '4', '6', '11', '4'] To: { "name": "graph", "children": [ {"name": "1", "value": 25, "children": [ {"name": "a", "value": 12}, {"name": "b", "value": 9}, {"name": "c", "value": 4} ]}, {"name": "2", "value":25, "children": [ {"name": "a", "value": 5}, {"name": "b", "value": 14}, {"name": "c", "value": 6} ]}, {"name": "3", "value":25, "children": [ {"name": "a", "value": 3}, {"name": "b", "value": 3}, {"name": "c", "value": 10}, {"name":

Join the discussion →

WooCommerce woocommerce_no_products_found hook overridden by theme template

I am trying to execute code on the product attribute page when there are no products. The problem is that the hook: add_action( 'woocommerce_no_products_found', 'wc_no_products_found' ); is not working. When I investigated, I found my theme function is overriding the hook: if (!function_exists('cyberstore_mikado_woocommerce_content')) { /** * Output WooCommerce content. * * This function is only used in the optional 'woocommerce.php' template * which people can add to their themes to add basic woocommerce support * without hooks or modifying core templates. * * @access public * @return void */

Join the discussion →

How to reset upload signing key (.jks) in the new Google Play Console UI (missing App Integrity/App Signing section)?

Google has updated the Play Console layout, making it difficult to find the key management options. If you are stuck and cannot find the options in the sidebar, you can access the page directly by modifying the URL in your browser. Step-by-step Workaround: Navigate to your app in the Google Play Console. Your browser URL should end with /app-dashboard like this: https://play.google.com/console/u/0/developers/1234567890/app/0987654321/app-dashboard Replace app-dashboard at the end of the URL with keymanagement: https://play.google.com/console/u/0/developers/1234567890/app/0987654321/keymanageme

Join the discussion →

Is there a reliable way to convert an STL/GLB mesh into a fully editable STEP CAD model?

I'm working with 3D models of assets in STL or GLB format generated by an external source. My goal is to convert these models into STEP (.step/.stp) format so that I can review, modify, and edit them in CAD software. I've tried several conversion tools and workflows, but the resulting STEP files still contain only mesh geometry (triangles/facets) instead of editable CAD features or solid B-Rep geometry. My questions are: Is there a reliable way to convert an STL (or GLB) mesh into a fully editable STEP model? Are there any recommended tools or workflows that produce clean, editable CAD geometr

Join the discussion →

Increasing map resolution in Anylogic 3D view

I need to visualize trains and rail tracks on map in AnyLogic. I found that when using GIS map, rail library blocks cannot be added. Only GIS routes and nodes can be added, which doesn't show train movement. (Please advise if you never encountered this issue) Moreover, I need the rail tracks converted from the shapefile, so I had to convert the GIS map back to image following this tutorial. However, the animation looks really bad in 3D as the entire background is pixelated. Is there a way to import a high-resolution map as the background image (perhaps in SVG format)? Or Is there any latest fu

Join the discussion →

pandas read_xml - handling nested nodes beyond level 2

I am using Pandas to import xml files into a Postgres database via the .read_xml() and .to_sql() functions. With two levels of nested elements in my xml files, things work as I expect: <table1> <id>1</id> <label>Label 1</label> <id>2</id> <label>Label 2</label> </table1> However, I am having issues managing files with more than 2 levels of nested elements: <table1> <id>1</id> <label>Label 1</label> <nested_data> <level_3>nested data 1</level_3> </nested_data> <id>2</id> <label>Label 2</label> <nested_data> <level_3>nested data 2</level_3> </nested_data> </table1> When I load my more complex xm

Join the discussion →

How do I save and load a query with EasyQuery framework?

With EasyQuery (a framework to create dynamic queries and reporting) I want to save a filter created by the user in a database. I need to get the filter information from the database and preload the filter element with that query so the user can see the result of the filter when the table shows up. The documentation looks like they save the query in a local file managed with the class FilterStore that inherits from IQueryStore. However, there are multiple users and they can create multiple filters. There are also stored procedures that use the filters to execute tasks. Saving the filters to th

Join the discussion →

I want to save and load a query with easyquery framework

I've been struggling with easy query (framework to manage data it helps you to create dynamic queries and reporting) this framework is used in my job so I can't swap it out. I've read the examples they have in their GitHub repository as well as their online documentation but with no https://korzh.com/easyquery/docs/introduction https://korzh.com/easyquery/javascript/docs/introduction My requirement is to save a filter created by the user in a database, after that I need to get the filter information from the database and preload the filter element with that query so the user can see the result

Join the discussion →

Create own custom datatype C++

I'd like to create my own time and date datatypes. I want them to be formatted in a certain way when I cout them. For example just like int datatype I want a time data type that accepts an input in a certain way(ex.: 12:30). How do I manage to do that? Thank you very much

Join the discussion →

What is the correct way to register a CNG provider (Key Storage Provider/KSP) on ARM64?

For my x86 and x64 project, I was relying on BCryptRegisterProvider provided by bcrypt_provider.lib in the CPDK (Cryptographic Provider Development Kit (linked from here)). However, that development kit only provides x86 and x64 libraries for linking. The build of my actual CNG succeeds but the installer fails during linking on those function. It looks like it might be possible to effect a registration by directly editing the registry. The documentation included in the CPDK did not directly suggest I do this. But is this the approach I must take in order to make my KSP cross-platform? Should I

Join the discussion →

Manually triggering Stripe payout to connected account fails - not enough balance error despite stripe account being loaded

I have a marketplace AirBnB type application - providers set up rooms and my platform allows the booking - payments are received and I've set it up so a paymentIntent is created when a booking is made and that the schedule is manual so we have a say on when we can release the funds. The problem is I've set up a Laravel command to periodically run and release the funds by creating a payout - however every time I run it it gives me the same error - you don't have enough funds. This is in sandbox mode - the test amounts are definitely there - but I'm not sure why payouts aren't working. If I chec

Join the discussion →

Taxes are exorbitant and spending is being slashed to the bone, why is there still rising inflation?

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 minor regional authority. This regional authority has a very healthy revenue stream from the border road it has been placed in charge of (every visitor/immigrant/tourist/peddler etc must pay 3 zeales, zeales being a virtually pure silver coin). However almost none of this money stays in the region. This regional author

Join the discussion →

How to use VBA to read a file

I need to create an Excel macro to read a file. The file can be read in WordPad and contains configuration data and the tension measurements of a test to the breaking point. The test results will also need to be charted in Excel. But that is part 2.

Join the discussion →

Best practice for "is value in list" macro in C without relying on sentinel values?

I'm looking for a clean and robust way to implement a membership check for a list of integers in C. I currently use a variadic macro that creates a temporary array on the stack and uses a sentinel value to mark the end of the list: static inline bool int__in(int val, const int *arr) { while (*arr != INT_MIN) { if (val == *arr++) return true; } return false; } #define int_in(val, ...) int__in((val), (const int []) { __VA_ARGS__, INT_MIN }) Using INT_MIN as a sentinel is obviously problematic because INT_MIN can be a valid data point in many applications. However, since C lacks reflection, there

Join the discussion →

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