Random snippets of all sorts of code, mixed with a selection of help and advice.
How do you enforce type safety across Python + YAML + JSON Schema boundaries in a production ML pipeline?
5 April 2026 @ 5:26 am
I'm working on production ML pipelines and keep running into the same structural problem. A typical pipeline in our stack requires:
Python for transformation logic and model inference
YAML for configuration (hyperparameters, model paths, batch sizes)
JSON Schema for validating input and output data structures
Bash/shell for orchestration and step sequencing
The problem is that type information is lost at every boundary between these tools. Concrete examples of failures I've encountered:
A Python dict returned by a preprocessing step doesn't match the JSON Schema expected by the next step — caught at runtime, mid-pipeline, after 45 minutes of compute
A YAML config value is parsed as a string when the pipeline expects an integer — no error until the model call fails
A schema chang
Cylinder created through Raycast does not face the meant direction
5 April 2026 @ 5:19 am
I've got this string of code in a global script fired from a local script which creates a straight line from the origin of the Raycast to the ending of it, essentialy tracing its trajectory accurately:
trazo.OnServerEvent:Connect(function(usuario, iniciovisible, impacto)
local largo = (iniciovisible - impacto).Magnitude
local linea = Instance.new("Part")
linea.Parent = workspace.Residuos
linea.Anchored = true
linea.CanCollide = false
linea.CFrame = CFrame.lookAt(iniciovisible, impacto) * CFrame.new(0, 0, -largo/2)
linea.Size = Vector3.new(.1, .1, largo)
linea.Transparency = .2
for count = 0, 3 do
linea.Size += Vector3.new(.1, .1, .1)
linea.Transparency += .2
wait(.1)
end
linea:Destroy()
end)
It works perfectly when the part's shape is not altered, staying as a Cube Shape and having rough edges.
However, when I want to turn it into a cylinder, the cylinde
Cannot add a field
5 April 2026 @ 5:18 am
On writing the following in Bigquery the following error message shows up:
Please check my code and advise how to solve the problem.
Invalid schema update. Cannot add fields (field: count_hospitalizations)
SELECT
products_industry_name,
COUNT(report_number) AS count_hospitalizations
FROM
bigquery-public-data.fda_food.food_events
WHERE products_industry_name IN
(SELECT
products_industry_name
FROM
bigquery-public-data.fda_food.food_events
GROUP BY products_industry_name
ORDER BY COUNT(report_number) DESC LIMIT 10)
AND outcomes LIKE '%Hospitalizations%'
GROUP BY products_industry_name
ORDER BY count_hospitalizations DESC;
Não tá dando conectar a conta [closed]
5 April 2026 @ 4:36 am
SignInFailureReason(serviceErrorCode:SIGN_IN_REQUIRED(4),activityResultCode:SIGN_IN_FAILED)
Does ordering for different roles like system, user, assistant... matter when calling chat completion api? Can I have system prompts in between?
5 April 2026 @ 4:22 am
Does ordering for different roles like system, user, assistant... matter when calling chat completion api?
Traditionally:
await openai.chat.completions.create({
model: persona.model,
messages: [
{role: 'system', content: 'You are a helpful agent. Answer questions with no filler words and keep your answer concise, professional, and straightforward. Please make sure you have a friendly tone.' },
{role: 'user', content: 'Are there bobcats in California?' },
{role: 'assistant', content: '....'},
{role: 'user', content: '<new question>' },
],
})
What if?
await openai.chat.completions.create({
model: persona.model,
messages: [
{role: 'system', content: 'You are a helpful agent.' },
// pattern #1, separating system prompt
{role: 'system', content: 'Answer questions with no filler w
How do I choose a different font from the same family? CSS
5 April 2026 @ 3:44 am
What I got:
What I want:
@font-face {
font-family: 'OTR';
src: url('/fonts/OTRtypeGX.ttf');
font-variant: 'type2' ;
}
What I can do to change the variant? When I use this font in Photoshop, it gives me two options: type1 & type2 - and I want type2.
What I want:
@font-face {
font-family: 'OTR';
src: url('/fonts/OTRtypeGX.ttf');
font-variant: 'type2' ;
}
What I can do to change the variant? When I use this font in Photoshop, it gives me two options: type1 & type2 - and I want type2.Why does my BLE peripheral disappear from my app's scanning menu after first scanning on iOS?
5 April 2026 @ 3:42 am
I'm trying to develop a custom app using Svelte Native (the cross-platform development tool based around Svelte) and the NativeScript Community BLE library. This app is designed to connect to an STM32WB-based microcontroller board. When I build it for Android, everything works perfectly, and the app is able to consistently connect to the device. This scanner, at the moment, is just designed to scan for any Bluetooth devices that can be seen, not necessarily filtering for our device. Due to this, many miscellaneous devices show up, and don't disappear after the first couple scans, even on iOS.
However, when I build the app for iOS, the STM32 board shows up on the first one or two scans, but then is never seen again. Any idea what might be happening here? I think it might be some kind of caching issue, but I'm not really sure.
I've tried restarting the iOS devices (I used an iPhone and
How do I get a trigger to only delete an associated row in another table in SQL?
5 April 2026 @ 3:40 am
I currently have 3 tables:
CREATE TABLE IF NOT EXISTS customers(
ID int unsigned NOT NULL AUTO_INCREMENT primary key,
first_name varchar(50),
last_name varchar(50),
email_address varchar(100),
phone_number char(12),
);
CREATE TABLE IF NOT EXISTS accounts(
ID int unsigned NOT NULL AUTO_INCREMENT primary key,
account_number char(5),
account_value decimal(18,4),
annual_interest_rate decimal(7,4)
);
CREATE TABLE IF NOT EXISTS changelog(
ID int unsigned NOT NULL AUTO_INCREMENT primary key,
account_number char(5),
modified DATETIME,
old_balance decimal(18,4),
new_balance decimal(18,4),
old_interest_rate decimal(7,4),
new_interest_rate decimal(7,4)
);
The changelog only receives values when the account_value or annual_interest_rate changes.
I need to create a trigger that activates when row is deleted in customers that empties the associated
Unity 3D Player movement works but Jump keybind does not
4 April 2026 @ 8:03 pm
I'm new to Unity and trying to make a character that can move, jump, etc. However, the jump isn't quite working correctly. The player can move and look around perfectly fine but the jump mechanic seems to be broken. I am using Unity 6 and I have enabled "both" Active Input Handling styles. I have the check for "Jump" and the "isGrounded" check but the player still wont jump. Any help would be appreciated. Please see the code below for reference:
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
public CharacterController controller;
public float speed = 12f;
public float gravity = -9.81f * 2;
public float jumpHeight = 3f;
public Transform groundCheck;
public float groundDistance = 0.4f;
public LayerMask groundMask;
Vector3 velocity;
bool isGrounded;
// Update is called once per frame
void Update()
How do I compose a base reference for my website? [closed]
4 April 2026 @ 6:54 pm
I am rewriting my website. I have decided upon a structure for its directories, which on my local drive, appears as:
Additional directories will be created to contain specific content (e.g., Tools, Toolbox Components, etc.). Each HTML file in these directories needs to reference the same script, css, and image directories as does gggustafson.html. What I think I need is some kind of base URL that I can prepend to the href attribute for <link>s and to the src attribute for <script>s. In the current case, I need the base to be "file:///C:/Gustafson/Website". When the code is place into the website server, I need the base to be "https://Website"/
When I have finished development, I will copy the directory Website to my hosted website. However before I do that, the local version (on my local m
Additional directories will be created to contain specific content (e.g., Tools, Toolbox Components, etc.). Each HTML file in these directories needs to reference the same script, css, and image directories as does gggustafson.html. What I think I need is some kind of base URL that I can prepend to the href attribute for <link>s and to the src attribute for <script>s. In the current case, I need the base to be "file:///C:/Gustafson/Website". When the code is place into the website server, I need the base to be "https://Website"/
When I have finished development, I will copy the directory Website to my hosted website. However before I do that, the local version (on my local m