Random snippets of all sorts of code, mixed with a selection of help and advice.
Npm - Semantic versioning for internal npm package
8 May 2026 @ 6:24 am
I know this may be a simple question, but our release process is a bit unusual, so I wanted some opinions on best practices for internal package management.
Background
We have:
- Main project X (Angular app)
- Helper package P (pure JavaScript internal package)
Package P is hosted on our private npm registry and consumed by project X through package.json.
Our releases are managed as fixed product versions like 5.2.2, decided by PMs.
For every release, we create permanent branches such as:
release/5.2.2
These branches permanently diverge from master/main. Once created, nothing from master should ever flow into them again except explicitly cherry-picked fixes.
Current Process
For each release branch:
- Package P is published with the same version number as the release itself (example: 5.2.2)
- If changes are needed in package P during that release cycle, we current
AWS Glue DQ segregate rows and publish results
8 May 2026 @ 6:17 am
We are running AWS Glue Data Quality on Glue 5.0 and need a single evaluation of a DQDL ruleset to deliver two outputs:
Row-level outcomes — so the ETL job can split input rows into good and bad partitions for downstream processing.
Catalog publishing — the run must appear under the catalog table's Data Quality tab in the Glue console.
Today these capabilities live in two different surfaces, and neither one delivers both:
EvaluateDataQuality.process_rows (ETL transform) — returns row-level outcomes, but does not publish to the table's DQ tab.
start_data_quality_ruleset_evaluation_run (boto3 API) — publishes to the table's DQ tab, but does not return row-level outcomes.
To get both, we would need to evaluate the same ruleset twice, which doubles the run of the data quality rules.
What we have tried
Created the ruleset with create_data_quality_ruleset using TargetTable, so the catalog t
How do I connect a website database to a HTML site?
8 May 2026 @ 5:55 am
I am currently working on my senior project and I am in so far over my head.
I am creating a website to catalog books and I need a database people can look through to find the books they want. I have a site in mind that I can use but I have not a single clue how to add it to my existing code without breaking anything.
Please note I have quite literally never used HTML before this moment (I am not a senior i.e. not done with my classes) so any beginner advice is greatly appreciated!!
How to optimize BFS for “Minimum Jumps to Reach End via Prime Teleportation” (LeetCode 3629)?
8 May 2026 @ 5:44 am
I’m working on the problem
3629. Minimum Jumps to Reach End via Prime Teleportation
And my current solution is getting TLE (Time Limit Exceeded).
My Current Approach
I’m using:
BFS for shortest path
Prime checking during traversal
For every prime value, I scan the entire array to find divisible numbers
Simplified Code
queue<int> q;
vector<int> vis(n, 0);
q.push(0);
vis[0] = 1;
while (!q.empty()) {
int i = q.front();
q.pop();
// adjacent moves
if (i + 1 < n && !vis[i + 1]) {
vis[i + 1] = 1;
q.push(i + 1);
}
if (i - 1 >= 0 && !vis[i - 1]) {
vis[i - 1] = 1;
q.push(i - 1);
}
// teleportation
if (isPrime(nums[i]))
How to insert data into streamTable with array vector columns and enforce a fixed vector length?
8 May 2026 @ 5:43 am
I'm building a market data stream table with order book depth data at five price levels. Some columns are array vector types like DOUBLE[] and INT[]. Simplified schema:
colNames = `code`lastPrice`askPrice`bidPrice`askVol`bidVol
colTypes = [SYMBOL, DOUBLE, DOUBLE[], DOUBLE[], INT[], INT[]]
share streamTable(100:0, colNames, colTypes) as stream_tick
Each row should hold a 5-element array in askPrice and a 5-element array in askVol.
My first attempt was to insert values directly as lists:
insert into stream_tick values (
"300751.SZ", 209.91,
[209.99, 210.0, 210.3, 210.31, 210.35],
[209.81, 209.80, 209.70, 209.70, 209.66],
[4, 1, 11, 2, 1],
[4, 207, 14, 1, 2]
)
This gives a type mismatch error — removing those four columns makes the insert work fine, so the issue is definitely with the array vector columns.
I found that wrapping them with the array() function works:
i
Supabase magic-link auth setSession hangs silently in Expo dev client (implicit flow) — no observable error or completion
8 May 2026 @ 5:24 am
I have an Expo SDK 54 app using Supabase Auth with magic-link sign-in via implicit flow. When the user taps a magic link, my deep-link callback receives the URL, parses the fragment correctly, and calls supabase.auth.setSession() — but the call hangs silently. Never resolves, never throws. App stays stuck on a "Setting up your account" loading screen indefinitely.
Previously hit the same hang at exchangeCodeForSession with PKCE flow, which is why I pivoted to implicit. Same hang, different boundary.
Stack
Expo SDK 54
React Native (Hermes engine)
@supabase/supabase-js v2.x (latest)
expo-router for navigation
iOS dev client built via EAS Build (custom URL scheme)
AsyncStorage adapter for session storage
react-native-get-random-values polyfill installed and import
How can I implement wildcard subdomain routing with automatic HTTPS in Nginx?
8 May 2026 @ 5:16 am
I am building a static hosting system where each user gets a subdomain like:
user.example.com
I am currently using Nginx for routing:
server {
server_name ~^(?<subdomain>.+)\.example\.com$;
root /var/www/sites/$subdomain;
location / {
try_files $uri $uri/ =404;
}
}
This works for serving static files based on subdomain.
However, I am facing challenges with:
Automatically handling new subdomains without reloading Nginx
Automatically issuing SSL certificates for each new subdomain
Scaling this setup for multiple tenants
I have tested Caddy and Traefik, but I am not sure which approach is best for production.
What is the recommended architecture or best practice for handling this type of multi-tenant subdomain hosting with HTTPS automation?
Would wildcard SSL certificates be the correct solution here, o
implement case when statement with dict items and two column values, return true if match
8 May 2026 @ 4:12 am
is there any way we can compare dictionary items with two column values in the dataframe?
example:
dic = [ (a,1),(b,2),(c,3)]
below is the dataframe, input_dataframe having only name, id column
output_dataframe has flag column. it compares both a&b columns, if both values are present in dict items, true is returned in "flag" column
I had implemented case when as shown below,
df = df.withColumn(
flag,
when(struct(col("a"), col("b")).isin(dic), lit('True'))
.otherwise(lit("False"))
)
but its giving the error as
ERROR occurred while validating: user_dw_pnldetail Error:
[UNSUPPORTED_FEATURE.LITERAL_TYPE] The feature is not supported:
Literal for '[a, 1]' of class java.u
I had implemented case when as shown below,
df = df.withColumn(
flag,
when(struct(col("a"), col("b")).isin(dic), lit('True'))
.otherwise(lit("False"))
)
but its giving the error as
ERROR occurred while validating: user_dw_pnldetail Error:
[UNSUPPORTED_FEATURE.LITERAL_TYPE] The feature is not supported:
Literal for '[a, 1]' of class java.uHow to ask Android for the right to access user files
8 May 2026 @ 3:55 am
On modern android, with Tauri (a rust backend and a javascript frontend), how to ask the user to grant the right to access all files in the 'home' directory (/storage/emulated/0), so all documents, downloads, pictures, videos in addition to external storage devices?
I tried the code below, and It successfully compiles on all platforms, with no errors or warning, And the application runs just fine on Android without any errors or crashes, but user permission is never asked. So it cannot read or even list many essential files. Any idea on what's wrong here?
// rust side
...
#[cfg(target_os = "android")]
use tauri_plugin_android_fs::{AndroidFsExt};
...
tauri::Builder::default()
.plugin(tauri_plugin_android_fs::init())
...
// this is the func to let the app ask the user for minimal storage access
#[tauri::command]
async fn request_directory_access(app: tauri::AppHandle) {
#[cfg(target_os = "android&q
JSONRPC Validation Error from Python FastMCP
8 May 2026 @ 1:07 am
I am following a video tutorial on building an example MCP server, the content is simply using MCP make API calls.
When I tried to start my mcp inspector, it throw this error message to me without boost automatically.
Environment:
Python 3 (.venv)
uv (mcp[cli], requests, os)
zsh / bash
Output:
[05/08/26 01:49:08] ERROR Received exception from stream: 1 validation error for server.py:707
JSONRPCMessage
Invalid JSON: EOF while parsing a value at line 2 column 0
[type=json_invalid, input_value='\n', input_type=str]
For further information visit
https://er