Posts

Showing posts from May, 2026

Zig

Zig When to Choose Zig   Performance Focused:  Focused in not using anything on your computer that might be not needed.   Systems Programming: Perfect for operating systems, kernels, and embedded microcontrollers.   No Garbage Collection: Gives you precise control over exactly when memory is allocated and freed.   Predictable Performance: Guarantees no hidden control flow, no macros, and no hidden allocations.   Ultra-lightweight Binaries: Generates tiny standalone executables that do not require a heavy virtual machine or runtime environment.   Compile-time Metaprogramming: Executes regular code at compile time via its innovative comptime keyword.    C Interoperability And Zig As Replacement to C: Functions natively as a seamless C/C++ compiler with zero-overhead foreign function interfaces.   Lack of Dependencies: No LLVM dependency    All Memory Usage Is Pre-Allocated and Explicit     Eliminates notorious C ...

DB First - Code Gen

DB First Code Generation 1. Generate Models from the DB at the Package Manager Console: Scaffold-DbContext "YourConnectionStringHere" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models Scaffold-DbContext "Server=(localdb)\mssqllocaldb;Database=MyDatabase;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models or this at command line:  dotnet ef dbcontext scaffold XXXXXXXXXXXXXXXXXXX Parameters: -Tables  // Allows explicit list of specific tables to scaffold 2. Generate the Full CRUD Controller & Views: dotnet scaffold controller -name ProductsController -m ProductModel -dc MyDbContext --relativeFolderPath Controllers --useDefaultLayout // a) API Controller with Actions, using EF dotnet scaffold controller -name ProductsController -api -async -m Product -dc MyDbContext -outDir Controllers // Key Flags: Requires -api (to skip HTML views), -m [ModelName], and -dc [DbContextName]. Adding -async creates asynchronous task-based metho...

OOP

 OOP 1) Abstraction: H id es complexity (ex: volume button on remote) 2) Encapsulation: H id e and secur e data Types:   member variable (hide state; ex: private or protected), function (hide behavior steps, ex: expression-bodied method ), class (hide domain responsibility, ex: internal) 3) Polymorphism: EX: man = father, husband, and employee 4) Inheritance

AI: The Ralph Loop

AI: The Ralph Loop "Ralph Loop" (or Ralph Wiggum Loop) is an architectural pattern where an AI coding agent is wrapped in an infinite while loop to execute tasks autonomously over long periods.   How a "Ralph Loop" Works Task: You feed the loop a structured backlog, like a local Product Requirements Document (prd.json) or a checklist. Fresh Instance: The loop spawns a brand-new AI agent session (using tools like Claude Code or Gemini CLI) with a clean context window. Execution & Memory: The agent reads the checklist, picks the highest-priority task, edits the code, and runs your compiler, linter, or test suite. Stop Hook Intercept: When the AI attempts to exit, a custom script or hook intercepts it and verifies if the code compiled and if tests passed. Next Iteration: If the task failed, the script launches a fresh agent instance. Because the previous agent modified files and left notes on disk, the new agent picks up right where the last one left off. The loo...

AI Dev Process Tools

AI Dev Process Tools https://pi.dev/ https://fallow.tools/ <= deterministic finding of coding issues. deterministic =================================================== SQL (prefer Dapper and parameterized SQL) =================================================== https://github.com/bmad-code-org/bmad-method ===================================================   openclaw simon Crop - verify library at: https://github.com/VerifyTests/Verify SlopWatch - detect reward hacking behavior https://github.com/Aaronontheweb/dotnet-slopwatch Opus 4.6 & Sonnet 4.6 Copilot OpenCode Claude Code Codex 5.3 model for debugging Qwen2.5 27B llama.cpp local. tmux - Terminal multiplexer suo apt install -y tmux Ralph LLM loop Akka.NET (should use immutable record types when deal with actor messages) StirTrek, May 1 in Ohio NDC Copenhagen in June

AI Commands

 AI Commands AI commands are commands run in the AI coding tool that start with slash \ or "at" @.  Common  AI commands in AI Coding Tools (GitHub Copilot, Cursor, VS Code) are: /explain : Analyzes the selected code block and explains its logic in plain English. /fix : Scans the selected code for bugs, errors, or security vulnerabilities and proposes a corrected version. /tests : Automatically generates unit tests for the active function or class. /docs : Generates standardized documentation comments (like JSDoc or Docstrings) for a piece of code. @workspace : Tells the AI to look at the entire project repository for context, rather than just the active file. @file:index.js : Pinpoints a specific file in the project to include in the AI's prompt context. Slash commands in AI Coding Tools (Claude Code) are : /compact : Compresses a long chat history into a dense summary to save context window tokens. /clear : Wipes the active conversation completely so you can start a bran...

AI Factory Engineering Coding

 AI Factory Engineering Coding AI-assisted Development Video - Michael Perry:  https://www.youtube.com/watch?v=t13OH8TmeRk AI software factories - Michael Perry:         https://factoryengineering.dev/ AI-assisted Development Video - Matt Pocock: https://www.youtube.com/watch?v=-QFHIoCo-Ko AI software factories - Matt Pocock:           https://www.aihero.dev/        with  npx skills@latest add mattpocock/skills grill me => to prd => to issues => tdd => improve codebase architecture (should be clean) =>  Roo Code extension is now Cline extension in VS Code Had Roo models fire off Playwright for testing rsync - remote sync utility tool - puts into shared area on network  Orchestrator (workflow),      planner - happy path, edge cases     Loop       test-writer       code-writer       refactor     ...

ML Exam Prep: 10 - Key Algorithms

ML Exam Prep Key Algorithms  Common Algorithms: K-Means algorithm = UL . No e vent planning by 1) K = number of K leaders for people to cluster around, 2) each data point finds closest leader, and 3) the leader moves to the Means = math mean (center) of their group. finds hidden or unlabeled patterns. Optimal K: run for a range of k. For each k, calc sum of squared errors. Plot line chart of SSE for each value of k. Optimal k is point after curve starts decreasing in a line. KNN algorithm = SL. C lassification (common) or rarely in Progression . classifies data point on how its features are similar to others (neighbors). Classification a nswer is 0 to 1. Label encoding =  City name  ("Dallas", "Paris", "London") to single column of City of (0, 1, 2).  Latent Dirichlet Allocation:   UL . NLP. Dirichlet is a l azy (so UL) bible reader that looks through text (so NLP), finding different topics, and finds the theme by associations between topics.  Linear r...

ML Exam Prep: 9 - Misc

  ML Exam Prep Misc Search Types 1) Lexical search: matches exact words 2) Semantic search: understands concept   3) Contextual search: adapts results using user data or surrounding conversation Canary Deployment = initially deploy a new app to a small subset of users or servers. Temperature =  chaos\creative of response Top K = is # of tokens. More tokens = more diverse/chaos of responses. Data Bias & Security Pre-Training Bias MetricsClass Imbalance (CI): One category drastically outnumbers others in data. Diff in Proportions of Labels (DPL): Measures imbalanced positive outcomes across facets. SageMaker Clarify: Primary AWS tool to detect and mitigate ML bias. Handling Bias Resampling: Oversample minority classes or undersample majority classes. Synthetic Data: Use SMOTE to generate fake minority class examples. Augmentation: Crop, flip, or rotate images to expand training variety. Security & Compliance Encryption: Use S3 server side encryption with...

ML Exam Prep: 8 - Model Fitting and Tuning

ML Exam Prep Model Fitting and Tuning Problems: 1. Overfitting (Model is too complex) The Problem:   Great on training data since memorizes (including its noise and random errors) or  too many training epochs,  instead of patterns.  Terrible on new data. "High Variance" model. Fix - Simplify the Model: 1) Early Stopping : Halts training the moment validation loss begins to rise. 2) Increase Regularization : Penalizes extreme values simplifying the model; L1 (Lasso) zeroes out weak features, L2 (Ridge) shrinks them.  3) Increase Dropout : Forces generalized learning by randomly shuts off neurons during training. 4) Fewer Feature Combinations : Removes complex or noisy inputs to stop hyper-specific conclusions. 5) Data Augmentation : Tweaks existing training samples (e.g., rotating images) to create new variety. 6) Use Cross-Validation : By rotating thru training and validation sets. Use stratified K-fold. Also is on Underfitting. 7) Decrease Max ...