Random snippets of all sorts of code, mixed with a selection of help and advice.
css linked but having issues with hover
24 December 2025 @ 12:44 am
I'm making a site and it has 3 index files as of now, but one of my index file isnt working with the hover in CSS I gave it, it has the same class with no changes, but nth works. I double-checked the CSS and nth worked. Is it my HTML?
Azure Communication Services Room Call stuck in "None" state - SDK shows roomJoin: false
24 December 2025 @ 12:16 am
I'm trying to join an ACS Room call using the JavaScript Calling SDK. The room is created successfully, participants are added via the Rooms REST API, but when calling callAgent.join({ roomId }), the returned call object stays in "None" state indefinitely. SDK telemetry reveals roomJoin: false and IsGroupCall: true, suggesting the SDK isn't recognizing the join attempt as a room call despite using the correct locator format.
I've tried AI (Codex and Claude Code) but no success figuring it out. I seem to be going in circles on this now and could use some human insight.
Environment:
@azure/communication-calling: 1.40.1
@azure/communication-common: 2.4.0
@azure/communication-rooms: (backend, latest)
Platform: React + Vite, deployed to Azure Static Web Apps
Canvas 2D hidden line removal for 3D wireframe - depth buffer approach fails on complex meshes
24 December 2025 @ 12:08 am
I'm implementing hidden line removal for a 3D wireframe renderer using HTML5 Canvas 2D. When rendering a solid object with wireframe overlay, edges behind solid faces should be hidden.
Drag to rotate. Toggle "X-Ray" to see the difference between with/without hidden line removal. The hidden line removal is not working correctly - edges that should be hidden are visible, and edges that should be visible are sometimes hidden.
Approaches I've Tried
1. Depth Buffer Simulation
Create an offscreen canvas as a depth buffer, render front-facing faces with grayscale values encoding depth (darker = closer), then sample points along each edge and compare depths:
function drawFaceToDepthBuffer(verts, nearZ, farZ) {
for (let i = 1; i < verts.length - 1; i++) {
const v0 = verts[0], v1 = verts[i], v2 = verts[i + 1];
const avgZ = (v0.z + v1.z + v2.z) / 3;
const normDepth = (avgZ - near
Avoid storing empty arrays in MongoDB
24 December 2025 @ 12:00 am
I have a product schema. Each product will have default fields: title, price, stock, description, and category. Depending on the category (clothing, technology) selected from the front end, I send additional fields:
clothing: sizes: [String], gender: String, colors: [String], typeClothing: String,
technology: brand: String, techType: String
The problem I'm having is that when I send a technology product, which doesn't have sizes or colors in the database, these values are saved as empty arrays. I understand this is because their data type is an array of strings. How can I prevent this? Adding `default: undefined` worked for me, but I'm not sure if this is correct.
How to vectorize (ensemble) nnx.Modules with separate parameters using nnx.vmap in JAX/Flax
23 December 2025 @ 11:59 pm
I have a vectorized (ensemble) Q-network implemented using Flax Linen that works as expected. Each critic in the ensemble has separate parameters, and the output is stacked along the first dimension (n_critics).
I am trying to port this implementation to Flax nnx, but I am struggling because nnx.vmap does not have the same API or semantics as flax.linen.nn.vmap. In particular, I am unsure how to correctly create an ensemble of nnx.Modules with independent parameters.
import jax.numpy as jnp
from flax import linen as nn
from typing import Optional
class QNetwork(nn.Module):
action_dim: int
rew_dim: int
hidden_dim: int = 256
@nn.compact
def __call__(self, obs, w, deterministic: bool):
x = nn.Dense(self.hidden_dim)(obs)
x = nn.relu(x)
x = nn.Dense(self.action_dim * self.rew_dim)(x)
return x
clas
gemini cli and mcp of mssql extension
23 December 2025 @ 11:52 pm
from reading :
https://docs.cloud.google.com/sql/docs/sqlserver/pre-built-tools-with-mcp-toolbox#mcp-configure-your-mcp-client-geminicli-sqlserver
i get this error :
✕ Error during discovery for MCP server 'sql_server': MCP error -32000: Connection closed
in the page :
Set environment variables to connect to your SQL Server instance part
i don't understand the export MSSQL_HOST="AKRAM-PC\EXPRESS" and the rest
I had to restart my Windows OS on my computer. I had TDM-GCC and Virtual Studio Code. Now that I've reinstalled VSC, it gives me an error
23 December 2025 @ 11:37 pm
My computer had a black screen saying "Couldn't connect to the network," and it wouldn't start, so I had to restart my OS, removing all of my apps but retaining most of my files. After I reset my computer, only TDM-GCC was still there, so I just reinstalled VSC. When I tried to run a program in C++ that I had made, it gave me the following error:
"PS C:\Users\thebe\OneDrive\Fortran Projects> cd "c:\Users\thebe\OneDrive\Fortran Projects\" ; if ($?) { g++ something.cpp -o something } ; if ($?) { .\something }
g++ : The term 'g++' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:1 char:60"
I knew the g++ function had something to do with TDM-GCC, so I figured that it was the issue. All of my extensions were already there when I reinstalled VSC, so it couldn't hav
How do I create name roller?
23 December 2025 @ 11:11 pm
Using this regex:
// Match plural words (cats, dogs, boxes) - including words ending in x/ch/sh which add 'es'
$pattern = "/^[a-zA-Z]+(s|es|xes)?$/";
Can I apply this as a suffix on $_POST['USER']?
A suffix is the end of a string, like a namestring for example. So in Stanley's ' and s are suffix
java.lang.ExceptionInInitializerError com.sun.tools.javac.code.TypeTag :: UNKNOWN
23 December 2025 @ 10:34 pm
I get this error when trying to launch my spring boot application on IntelliJ at the build :
java: java.lang.ExceptionInInitializerError
com.sun.tools.javac.code.TypeTag :: UNKNOWN
The jdk installed is the jdk 25 but the project is set to java 21.
I made some research i find that the problem is linked usually to lombok and try differents solutions, but still can't resolve the problem.
I try to compile the project using mvnw but i get this error :
./mvnw clean install
The JAVA_HOME environment variable is not defined correctly,
this environment variable is needed to run this program.
Or the JAVA_HOME is correctly set in my environments variables. Here is a part of my pom.xml :
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=
How do you create a `preg_match` with plural s and '
23 December 2025 @ 10:03 pm
How do you create a preg_match with plural s and '?