Code Mala Tang
Author

Code Mala Tang

Read source code together, write articles together, and enjoy spicy hot pot together.

468
Articles
0
Likes
1.7k
Views
0
Comments
Recent Articles

Latest from Code Mala Tang

100 recent articles max
Code Mala Tang
Code Mala Tang
Nov 2, 2025 · Fundamentals

Unlock Cleaner Code with Python’s Dataclasses: A Practical Guide

This article explains what Python dataclasses are, how they simplify data‑oriented class definitions, and demonstrates advanced features like custom field behavior, the __post_init__ method, and immutable (frozen) classes with clear code examples.

Code SimplificationImmutablePython
0 likes · 4 min read
Unlock Cleaner Code with Python’s Dataclasses: A Practical Guide
Code Mala Tang
Code Mala Tang
Nov 1, 2025 · Frontend Development

Unlock Conditional Styling with CSS if(): A Game‑Changer for Frontend Development

The new CSS if() function, now in Chrome 137, lets developers embed conditional logic directly in style sheets, eliminating JavaScript toggles, preprocessors, and complex media queries, and offering three powerful capabilities—style queries, media queries, and feature detection—along with real‑world examples, current browser support, and future extensions.

Conditional Stylingcssfrontend development
0 likes · 7 min read
Unlock Conditional Styling with CSS if(): A Game‑Changer for Frontend Development
Code Mala Tang
Code Mala Tang
Nov 1, 2025 · Fundamentals

How functools.partial Can Simplify Repeated Function Calls in Python

Using Python's functools.partial, you can pre‑fill common arguments to create concise, readable wrappers that eliminate repetitive parameter passing, improve safety, and streamline code in scenarios ranging from email utilities to Flask handlers and machine‑learning pipelines, while avoiding over‑use pitfalls.

Best PracticesCode ReusePython
0 likes · 6 min read
How functools.partial Can Simplify Repeated Function Calls in Python
Code Mala Tang
Code Mala Tang
Oct 29, 2025 · Frontend Development

Implementing Robust Undo/Redo in Fabric.js Canvas Editors

This article explains how to add undo and redo functionality to a Fabric.js canvas editor by maintaining a history stack, provides full source code, discusses performance considerations, and compares alternative approaches such as the Command Pattern and object‑level diff snapshots.

CanvasFabric.jsJavaScript
0 likes · 8 min read
Implementing Robust Undo/Redo in Fabric.js Canvas Editors
Code Mala Tang
Code Mala Tang
Oct 28, 2025 · Artificial Intelligence

Unlocking AI Creativity with Just Eight Words: The Verbalized Sampling Breakthrough

A recent Stanford and West Virginia University study reveals that a simple eight‑word prompt technique, called Verbalized Sampling, can double the creative output of large language models without costly retraining, by exposing hidden diversity suppressed by conventional alignment methods.

AI creativityLLM sampling techniqueslarge language models
0 likes · 9 min read
Unlocking AI Creativity with Just Eight Words: The Verbalized Sampling Breakthrough
Code Mala Tang
Code Mala Tang
Oct 27, 2025 · Frontend Development

Master Fabric.js: Build Interactive Canvas with Zoom, Snap, and Guides

This article walks through setting up Fabric.js on a web page, creating a canvas, drawing rectangles, adding zoom and pan controls, implementing object snapping and alignment guides, and provides complete source code so readers can quickly build an interactive canvas application.

CanvasFabric.jsFrontend
0 likes · 21 min read
Master Fabric.js: Build Interactive Canvas with Zoom, Snap, and Guides
Code Mala Tang
Code Mala Tang
Oct 26, 2025 · Databases

Why Parameterized Queries Supercharge SQL Performance (And Prevent Injection)

This article explains how using bound (parameterized) queries in SQL Server improves performance by enabling execution plan reuse, reducing compilation overhead and memory usage, while also preventing SQL injection, and discusses potential pitfalls like parameter sniffing and how to mitigate them with OPTION (RECOMPILE).

Parameterized QueriesPerformance OptimizationSQL
0 likes · 6 min read
Why Parameterized Queries Supercharge SQL Performance (And Prevent Injection)
Code Mala Tang
Code Mala Tang
Oct 26, 2025 · Backend Development

Auto‑Clean Python Dependencies with pipreqs and Pre‑Commit

Learn how to automatically remove unused Python packages from your virtual environment by generating an accurate requirements.txt with pipreqs and enforcing clean dependencies on every commit using a pre‑commit hook, improving build size, speed, and security.

dependency-cleanuppipreqspre-commit
0 likes · 5 min read
Auto‑Clean Python Dependencies with pipreqs and Pre‑Commit