最新文章
今日新增 436 篇 · 共 7,333 篇 · 来自 241 个博客
Attention and Augmented Recurrent Neural Networks
A visual overview of neural attention, and the powerful extensions of neural networks being built on top of it.
A Survival Guide to a PhD
AI 摘要This article is a retrospective survival guide for PhD students, drawing on the author's experience in computer science and machine learning research. It weighs the benefits of a PhD (freedom, ownership, expertise, personal growth) against its downsides (intense work, stress, and identity crises), advises that strong reference letters are by far the most important factor for admission, and recommends choosing a top school with multiple potential advisers in a good physical environment. It also frames the adviser-student relationship as a symbiosis, highlighting key differences between hands-on pre-tenure advisers and more hands-off, senior post-tenure advisers.
Autoprefixing, with CSS variables!
AI 摘要The article describes a CSS trick that uses custom properties (CSS variables) to automatically handle vendor prefixes: you set a variable like --clip-path to initial on all elements via the * selector, and map every property variation (e.g., -webkit-clip-path and clip-path) to var(--clip-path). After this setup, you only need to set the variable, and the value cascades to all prefixed and unprefixed versions of the property, while explicit overrides still work because the * rule has zero specificity. The main drawback is that browser support is limited to the intersection of the feature and CSS variables support, which at the time excluded only Edge.
Markapp: A list of HTML libraries
AI 摘要The author created MarkApp, a website that lists and promotes JavaScript libraries with HTML APIs—libraries that can be used without writing any JavaScript. This addresses the problem that many HTML & CSS authors are not comfortable writing JS and struggle to use JavaScript libraries. Since the list is currently short, the author encourages readers to add any libraries with good HTML APIs they know of.
Using Quiescent States to Reclaim Memory
AI 摘要This article demonstrates how to protect a shared data structure with concurrent readers and writers in C++ without using a read-write lock, by storing an atomic pointer to the current version and letting writers publish private modified copies. To safely delete old copies that threads may still be using, it introduces quiescent state-based reclamation (QSBR), where a MemoryReclaimer invokes deletion callbacks only after every participating thread has called onQuiescentState, grouping callbacks into intervals. The author notes the technique is related to userspace RCU and was used in the Junction library to implement a scalable resizable concurrent map.
Announcing GenStage
GenStage is a new Elixir behaviour for exchanging events with back-pressure between Elixir processes. In this blog post we will cover the background that led us to GenStage, some example use cases, and what we are exploring for future relea
Mimic Relative Positioning Inside an SVG with Nested SVGs
AI 摘要Unlike HTML elements, SVG elements lack a CSS box model and are positioned absolutely relative to the SVG viewport's single coordinate system, which makes positioning one SVG element relative to another a challenge. The article explains how nesting elements can be used to create grouping, new coordinate systems, and separate 'layers' for responsive effects, and introduces the concept of bounding boxes as a way to compensate for the missing box model. By retrieving an element's bounding box properties (x, y, width, height) via getBBox(), an inner can be visually placed over another element to establish a positioning context around it, effectively mimicking relative positioning.
Elixir v1.3 released
Elixir v1.3 brings many improvements to the language, the compiler and its tooling, specially Mix (Elixir's build tool) and ExUnit (Elixir's test framework).
Deep Reinforcement Learning: Pong from Pixels
AI 摘要This blog post explains reinforcement learning (RL) and argues that recent breakthroughs like ATARI game playing and AlphaGo stem more from increased compute, data, and infrastructure than from fundamentally new algorithms. The author walks through how Policy Gradients—a simple yet preferred alternative to Q-Learning—can train a small 2-layer neural network to play Pong from raw pixels in about 130 lines of Python, while discussing challenges like the credit assignment problem and how RL differs from supervised learning.
Introducing Multirange: A tiny polyfill for HTML5.1 two-handle sliders
AI 摘要While reviewing recent HTML specifications, the author discovered that several slider features, such as tick labels, vertical sliders, and two-handle range sliders, are poorly or not at all implemented across browsers. Most excited about two-handle sliders enabled by the multiple attribute, they experimented with overlaying two sliders and created a tiny JavaScript polyfill called Multirange, available on GitHub. The polyfill uses CSS variables for simpler, more elegant, and customizable code, and dropped its original Bliss dependency to keep the script minimal.
Making the Switch Away from Icon Fonts to SVG: Converting Font Icons to SVG
AI 摘要This article is a practical guide to switching from icon fonts to an SVG icon system, walking through how to extract icons from icon font files (e.g., generated with Fontello) and convert them into SVG icons using tools like the Icomoon web app or the font-blast command-line tool. It then covers next steps such as combining the icons into an SVG sprite, embedding them in pages, and styling or animating them, while pointing to further reading on why SVG is superior to icon fonts.
Lazyloading
Leapfrog Probing
AI 摘要The article introduces leapfrog probing, a new hash table probing strategy developed for the Junction library and inspired by hopscotch hashing, which stores two delta values per cell to form explicit probe chains for each bucket, reducing average search length compared to linear probing at a cost of only 12.5–25% extra memory. It describes how insertion works by following the probe chain, then linearly searching for a free cell and linking it to the chain, and how the concurrent Leapfrog map handles racing operations by reserving cells via CAS and linking them with relaxed atomic stores. Benchmarks showed Leapfrog was the fastest concurrent map tested up to a modest number of CPU cores, partly due to low write contention and resizing based on failed inserts rather than tracked population.
SVG Style Inheritance and the ‘Flash Of Unstyled SVG’
AI 摘要The article explains the 'Flash Of Unstyled SVG' (FOUSVG) problem, where SVGs lacking width and height attributes scale to fill the entire viewport width when CSS fails to load, making pages appear broken. The solution is to keep the width and height presentation attributes on the SVG (for example, by not checking Illustrator's 'Responsive' export option) and instead control dimensions via CSS, since SVG presentation attributes act as low-level author styles that are overridden by any other style declarations and thus serve as fallbacks. The author also emphasizes never removing the viewBox attribute, which is essential for proper SVG scaling, and notes that presentation attributes are useful for providing default styles when reusing elements with and CSS custom properties.
Bad Doors Are Everywhere
AI 摘要This post highlights the prevalence of bad door design, referencing a video collaboration between Vox and 99% Invisible about doors that people commonly pull when they should push. The author reflects on how Don Norman's book 'The Design of Everyday Things,' read early in their design career, profoundly shaped their approach to designing for the web. The piece is a vintage post originally published in February 2016.
A Resizable Concurrent Map
AI 摘要The article describes the Linear map from the Junction project, a concurrent hash map that improves on the earlier 'Crude' lock-free hash table by supporting both deletion and resizing. It explains how resizing works by atomically replacing a root pointer with a new, larger table and safely migrating entries using Redirect markers to prevent concurrent updates from being lost, along with a jobCoordinator that lets multiple threads participate in migrations. The author notes that Junction's Leapfrog and Grampa maps build on the same design, and shares the implementation as an educational example of concurrent programming.
Animating the Unanimatable
An in-depth look at the surprisingly complicated problem of animating the transition when two items in a list swap positions. Keep reading.
Introduction to the Zig Programming Language
AI 摘要This article introduces Zig, a new programming language created by the author as a more pragmatic alternative to C, built around the priorities of pragmatism, optimal runtime performance, safety, and readability. It explains key design decisions including widely diverging debug and release builds, complete C ABI compatibility with @cImport for direct C interop, and the use of optional types instead of null pointers. The article also details Zig's error handling strategy using error sets and error unions, along with constructs like catch, try, orelse, defer, and errdefer that keep code both safe and concise.
New Concurrent Hash Maps for C++
AI 摘要The article announces Junction, a BSD-licensed C++ library offering several new concurrent hash maps—Linear, Leapfrog, and Grampa—whose fastest variants outperform all other concurrent maps tested on the author's hardware. These maps support atomic operations such as get, assign, exchange, and erase from multiple threads without locks, relying on quiescent state-based memory reclamation (QSBR) for safe memory management while requiring users to handle object lifetimes manually. The code is experimental alpha software, and the author invites feedback, bug reports, and contributions such as porting the Turf dependency library to additional platforms.