今日精选
HOT最新资讯
共 27243 篇Your cron expression can be valid and still never run
Your cron expression can be valid and still never run A cron parser can answer one question— does this have five fields and legal tokens? —while your scheduler needs a different answer: will this job ever run, and will it run when I intended? That gap is where silent cron failures live. A schedule can be syntactically valid, return no parser error, and still be impossible, surprisingly broad, or operationally noisy. Here is a small semantic checklist you can run before deploying a schedule. 1. Check the calendar, not only the grammar Consider: 0 0 30 2 * This has the right five-field shape: minute, hour, day of month, month, day of week. But February has no day 30. A syntax-only validator can label it valid, while a calendar-aware validator should tell you that its approximate frequency is never. That distinction is important in CI: treat a parse error as a broken input, but treat an impossible calendar match as a review failure. Both deserve attention, but they need different messages. The same idea applies to leap days. 0 0 29 2 * is meaningful, but it does not fire in non-leap years. Whether that is correct depends on the job; the validator should surface the edge case instead of silently deciding for you. 2. Be explicit about day-of-month/day-of-week semantics This expression is a classic source of surprises: 0 0 1,15 * 1 Many traditional cron implementations treat a restricted day-of-month and a restricted day-of-week as an OR , not an AND. In that model, the job runs on the 1st, the 15th, or Monday. Someone reading the expression as “the 1st or 15th when it is Monday” will get a different schedule. This is not a universal rule across every scheduler, so check the documentation for the runtime that will execute the job. The useful validation behavior is to warn whenever both fields are restricted and force the author to choose the intended semantics. For example, a lightweight pre-deployment check can start like this: function semanticWarnings ( expression ) {
Show HN: Btfy – a blockchain that uses weather observations
Hi HN, I built Btfy, an experimental blockchain that uses weather observations as a source of unpredictability for consensus The motivation is simple. Proof of Work generates uncertainty by performing computations. I wanted to explore whether we could obtain some of that uncertainty from the real world instead. Btfy combines weather observation data with a Verifiable Delay Function (VDF): Weather Observation Data -> VDF -> Block -> Hash Chain In the current implementation, observation data is co
May the Force Be With Your Algorithm: Speeding Up Problem Solving Under Pressure
The Quest Begins (The "Why") I still remember my first technical interview like it was yesterday. The recruiter slid a whiteboard marker across the table, smiled, and said, “Here’s a classic: given an array of integers and a target sum, return the indices of the two numbers that add up to the target.” My heart started racing. I could feel the sweat forming on my palms as I stared at the empty board, my mind looping over the same terrible idea: check every pair . I started scribbling a nested loop, O(n²) time, and immediately realized that if the array had even a few thousand elements, I’d be stuck there forever. The interviewer’s eyes flicked to the clock, and I could almost hear the Imperial March playing in my head— the pressure was real . I needed a way to cut through the noise, fast, or I’d be that candidate who “just didn’t get it”. That moment sparked a question that’s haunted me ever since: how do top coders stay calm, spot the shortcut, and turn a seemingly impossible problem into a few lines of clean code under pressure? The Revelation (The Insight) After that interview (and a few too many late‑night debugging sessions), I dove into the mental toolkit that separates the “just‑get‑it‑done” crowd from the folks who seem to solve puzzles while sipping coffee. The breakthrough wasn’t a new library or a fancy language feature—it was a simple shift in perspective: Instead of asking “how can I compare every element to every other element?” ask “what do I need to know about each element to instantly know if its partner exists?” In the Two‑Sum problem, the partner of a number x is simply target – x . If I could remember, in O(1) time, whether I’ve already seen that partner, I could solve the whole thing in a single pass. That’s the “aha!” moment: store what you’ve seen so far in a hash map (or set) and look for the complement as you go . It feels like discovering the One Ring in a junkyard—once you see it, everything else falls into place. The beauty is that this pa
DUM: Breaking the Seal on Hyderabadi Biryani with Pure CSS
This is a submission for Frontend Challenge - Comfort Food Edition, CSS Art . Inspiration Hyderabadi dum biryani is more than a dish to me—it is a ritual. The sealed handi, the slow charcoal heat, the suspense before the atta crust is broken, and the first rush of saffron, mint, birista, and spice all feel inseparable from the experience. I wanted to turn that moment into an interactive midnight poster: Hyderabad’s skyline behind a copper handi, with the food hidden until the viewer breaks the seal. Demo Click BREAK THE SEAL to lift the lid and reveal the four biryani layers. How it works The artwork is built with HTML and CSS only: A native <details> / <summary> control stores the open and closed states. CSS :has() coordinates the seal crack, lid lift, layer reveal, steam, labels, embers, and state-aware copy. Rice grains, mint leaves, birista, spices, meat, copper patina, flour dust, the skyline, and the moon are all CSS shapes. There are no images, SVGs, canvas, JavaScript, gradients, or frameworks. A mobile composition and prefers-reduced-motion keep the piece responsive and accessible. The reveal is deliberately choreographed: seal cracks → lid lifts → layers separate → labels arrive → steam settles Journey The hardest part was keeping the illustration detailed without losing the strong poster silhouette. I iterated on three areas: Material: hammered copper marks, soot, flour residue, dough cracks, and print texture. Depth: curved food layers, overlapping grains, steam arches, and ingredient silhouettes. Motion: a staged opening sequence rather than making every element animate at once. The most satisfying decision was using a semantic HTML control for the interaction. The artwork still works with a keyboard, and disabling motion does not hide the final state. I used Codex as an iterative coding and visual-critique partner. I directed the concept, cultural references, composition, and final decisions, while the agent helped implement and test the CSS system. Wh
SEO for a $2.99 product: what 28 days of Search Console data taught me
I'm building PetSignal — a browser-based AI that reads dog and cat body language from a photo and flags stress signals (whale eye, freezing, lip curl) before they escalate. It's a solo project, the core purchase is a $2.99 credit pack, and that one number dictates the entire growth strategy. Here's the math that rules everything: at a ~$3-10 one-time AOV, paid ads can never work. US pet-niche CPC runs $0.5-2; even at optimistic conversion rates you're paying $50+ to acquire a $3 customer. So the product lives or dies on organic search. That constraint turned out to be a gift — it forced me to treat SEO as an engineering discipline with real feedback loops instead of a checklist. Twenty-eight days of Search Console data later: 230 clicks, 15,953 impressions, and impressions in the second half up 105% over the first. Small numbers, real slope. These are the five things the data actually taught me. 1. Symptom pages beat product pages — but not the way I expected My content engine is ~35 "symptom pages": Dog Opening and Closing Mouth Repeatedly , Cat Whale Eye , Cat Breathing Fast . Each one answers a moment of owner anxiety that ends with a photo the owner has already taken — which is exactly what the product analyzes. The surprise: one page carries 54% of all clicks. Not the homepage, not the tool pages — a page about dogs opening and closing their mouths. Meanwhile my four "commercial" analyzer pages have CTRs of 6-9% (site average: 1.8%) but almost no impressions. The lesson: content pages find demand, commercial pages convert it, and internal links are the pipe between them. I spent a day rebalancing internal links after realizing my refund policy — sitemap priority 0.4 — carried roughly twice as many site-wide links as any commercial page, while the general-purpose analyzer had exactly zero editorial links pointing at it. 2. Every page is data, not HTML All 35 symptom pages live in one TypeScript file as structured objects: title, quickAnswer, sections, tables, re
You've Seen the Pipeline. Now Meet the Matrix: The One `Vec ` Behind the 400 Shrink
How a single contiguous allocation — and a type system that won't let you feed strings to a scaler — is the real reason datarust fits in 2.3 megabytes. In the last post I showed you the whole datarust workflow: impute, scale, one-hot, train a logistic regression, evaluate, and save it as JSON — all without a Python runtime in sight. The Docker image shrank from ~900 MB to ~8 MB, and the binary was 2.3 MB. But I skimmed over something important. I kept saying "the flat memory layout" as if it were a detail. It isn't. It's the whole bet. Every scaler, every encoder, every model, every metric in datarust runs on top of one data structure. If you understand that structure — why it looks the way it does and what it refuses to let you do — the rest of the library stops being magic. So let's zoom in. Meet Matrix . Two containers, on purpose Real data is mixed. Numbers in one column, strings in the next. In Python, everything flows through one giant numpy.ndarray or a pandas.DataFrame , and the type system just... shrugs. A string column next to a float column gets coerced into object dtype. You'll find out at training time, in the form of an error message three frames deep. datarust does the opposite. It splits your data into two types at the source: use datarust :: Matrix ; use datarust :: matrix :: StrMatrix ; let numeric = Matrix :: new ( vec! [ vec! [ 3.0 , 85.0 , 24.0 ], vec! [ 12.0 , 70.0 , 31.0 ], vec! [ f64 :: NAN , 95.0 , 45.0 ], ]) ? ; let categorical = StrMatrix :: from_strings ( vec! [ vec! [ "MonthToMonth" ], vec! [ "OneYear" ], vec! [ "MonthToMonth" ], ]) ? ; Matrix is f64 only. StrMatrix is strings only. They are different types , and the compiler will refuse to compile a program that hands a string column to a scaler. Not at runtime — at compile time. In the last post I called this "putting on glasses for the first time." Let me show you what it actually buys you. The ColumnTransformer API is built on that split: ct .add_numeric ( "scaled" , vec! [ 0 , 1 ],
I Built the Same Escrow on Two Chains. The Architectures Couldn't Be More Different.
I maintain a non-custodial escrow protocol that runs on two blockchains: Base, an Ethereum L2, and TON, the chain behind Telegram. Same product, same core logic on paper: lock funds, deliver work, release on approval, handle disputes. I expected the second implementation to be a port. It wasn't. The two chains disagree so fundamentally about how a contract should be structured that writing the same feature twice forced me to rethink what "the same" even means. This post is about those differences, the design decisions each model pushed me toward, and what I'd tell anyone about to make the same jump. Light on code, heavy on the reasoning. The interesting part was never the syntax. The two mental models The single most important difference is not the language. It's the execution model underneath. On Base , a contract is an object with shared state. You write Solidity, and it behaves like a class instance sitting in memory that everyone calls into. A user calls a function, the function reads and writes contract storage synchronously, and either the whole thing succeeds or it reverts atomically. All my escrows live in one contract, in one big mapping, and every call reaches straight into that shared state. On TON , a contract is an actor that receives messages. You write Tact, and it behaves like an isolated process with a mailbox. You don't call a function; you send a message, and the contract handles it in its own turn. There is no synchronous cross-contract call in the EVM sense. Interaction between contracts is asynchronous message passing, and you design around that or you fight it the whole way. The shape of the entry point tells the whole story. On Base, an external caller invokes a named function: function approveWork(uint256 _contractId) external validContract(_contractId) nonReentrant whenNotPaused { // reads and writes shared contract storage, synchronously } On TON, nothing "calls" the contract. A message arrives, and a handler consumes it in the actor's own
Cloudflare Introduces Meerkat for Strongly Consistent Global Coordination
Cloudflare recently introduced Meerkat, an internal globally consistent control-plane service based on the QuePaxa consensus algorithm. Unlike Raft, it allows leaderless writes while preserving strong consistency, improving availability across Cloudflare's global network. By Renato Losio
LLM Narrative Engines, Part 5: Integration Testing and Behavior Freezing
Before reading this : I'd recommend skimming Part 3's "Parser" section and Part 4's summary to understand how the parser outputs a domain.Contract . This post assumes you already know the parser can turn .meph into a struct. I. A Narrative Engine's Fourth Problem: How Do You Keep Behavior Stable? The parser is written. But it's code that gets maintained long-term — requirements change, formats expand, bugs get fixed. Every change risks breaking existing behavior. The tension here is: creators depend on stable behavior, while developers depend on freedom to change. If every code change requires manually testing every known scenario, the developer will fear refactoring. If you don't test, broken behavior reaches the creator — but the creator doesn't care that you refactored the parser. The solution is to "freeze" parsing behavior: use a fixed set of contracts as watchdogs. After every change, automatically compare parse results against expectations. This is what integration tests do: take a fixed set of .meph contracts as "watchdogs," run them after every change, and verify that behavior hasn't been accidentally altered. II. Golden File Testing: Freezing Parse Results The most straightforward approach: prepare a standard contract, parse it, serialize the result to JSON, and save it. On every subsequent test run, compare the current parse result against that JSON file. The project's testdata/sample.meph is that standard contract. Here's the test flow: func TestParseSample ( t * testing . T ) { got , err := ParseFile ( "testdata/sample.meph" ) if err != nil { t . Fatalf ( "parse failed: %v" , err ) } goldenPath := "testdata/sample.golden" var want domain . Contract if err := loadGolden ( goldenPath , & want ); err != nil { // Golden file doesn't exist — generate it automatically saveGolden ( goldenPath , got ) t . Log ( "Golden file generated. Please review and re-run the test." ) t . FailNow () } // Compare got and want if diff := cmp . Diff ( want , got ); diff != ""
How I Stopped Losing Track of Claude Code and Codex Sessions
Using one coding agent is simple. Using several across multiple projects is where the real mess begins. I often had Claude Code and Codex running side by side. One agent was working, another was waiting for approval, and yesterday’s useful session was buried under a different path, branch, or terminal window. The agents were capable. My workspace was not. That frustration led me to build Termexo , a local-first Windows workbench for coding agents. The problem was not the model The hardest part was no longer generating code. It was keeping track of context: Which agent is still working? Which one needs my approval? Where did I leave yesterday’s session? Which project, path, and branch did that terminal belong to? Which model profile was active? A pile of terminal windows can answer all of those questions—but only if you remember everything yourself. What I wanted instead I wanted one recoverable workspace where I could: run Claude Code and Codex in real PTY terminals; arrange terminals in custom grids; see when an agent needs attention; search and resume native sessions; restore a workspace after restarting the app; switch Claude-compatible model profiles without rebuilding environment variables; keep API keys in Windows Credential Manager. That became Termexo. Why keep the native CLI? Termexo does not replace Claude Code or Codex with a custom chat interface. The real CLI remains visible and usable. That matters because the terminal is still the source of truth. Existing commands, hooks, approvals, keyboard shortcuts, and session behavior continue to work. Termexo focuses on the coordination layer around those tools. A workspace should be recoverable A useful coding-agent session should not disappear just because the app restarted or a terminal was closed. Termexo treats terminals, layouts, projects, and native agent sessions as parts of the same workspace. The goal is simple: when you return, you should be able to understand what was happening and continue without
Node.js Runs TypeScript Now: Field Notes on Native Type Stripping
Headline: Node.js executes TypeScript files directly — node script.ts works with no loader, no ts-node, and no build step — by stripping type annotations at load time. Type stripping is on by default since Node.js 23.6 and ships in the 22.18 LTS release, but it only covers erasable syntax: I enforce that with TypeScript 5.8's erasableSyntaxOnly flag, moved type checking to tsc --noEmit in CI, and left my decorator-heavy NestJS services on their existing build. Key takeaways Node.js runs .ts files natively by replacing type annotations with whitespace, a mechanism called type stripping. It is enabled by default since Node.js 23.6 and in the 22.18 LTS release; on Node 22.6–22.17 it sits behind --experimental-strip-types . Type stripping handles only erasable syntax. enum , namespace with runtime code, and constructor parameter properties need the separate --experimental-transform-types flag. Node.js never type-checks and never reads tsconfig.json . The type checker is still tsc --noEmit , run in CI or a pre-commit hook. TypeScript 5.8's erasableSyntaxOnly compiler option turns every non-erasable construct into a compile error, which guarantees a file Node.js can run. Relative imports must spell out the .ts extension, and Node.js refuses to strip types inside node_modules — published packages still ship JavaScript. Can Node.js run TypeScript without a build step? Yes, for most application code. Node.js 22.6 introduced type stripping behind the --experimental-strip-types flag, Node.js 23.6 turned it on by default, and the 22.18 release brought the default-on behavior to the LTS line. On Node.js 24 — the current LTS and my daily runtime — node script.ts simply executes. // hello.ts const greet = ( name : string ): string => `Hello, ${ name } ` ; console . log ( greet ( ' Node 24 ' )); console . log ( process . features . typescript ); // 'strip' The mechanism matters. In strip mode Node.js replaces every type annotation with whitespace instead of compiling the file, so l
From Agents to Infrastructure: Building Secure, Local-First AI Assistants with Go and Rust
Originally published on tamiz.pro . The prevailing narrative in artificial intelligence has been dominated by cloud-based, API-driven models. While this approach offers scalability, it introduces critical latency, dependency on external services, and significant privacy concerns regarding data exfiltration. For mission-critical applications, financial analysis, or healthcare systems, the inability to guarantee data residency and offline operation is a non-starter. The solution lies in a "Local-First" architecture, where the AI assistant runs entirely on-premise or on-device. However, building such systems requires more than just downloading an LLM weights file; it demands a robust infrastructure layer capable of managing state, memory safety, and real-time concurrency. This article explores how to construct this infrastructure using two powerhouse languages: Go for its superior concurrency primitives and developer velocity in orchestration, and Rust for its memory safety, zero-cost abstractions, and performance-critical inference execution. We will dissect the architecture of a secure, local-first AI agent, moving from the conceptual model to the implementation details, focusing on the boundary between the orchestration layer (Go) and the execution layer (Rust). 1. The Architectural Paradigm: Separation of Concerns Building a local-first AI assistant is not merely a software engineering challenge; it is a systems architecture problem. The core tension lies between flexibility (the ability to swap models, adjust prompts, and handle complex workflows) and performance/security (minimizing latency and preventing memory corruption or data leaks). To resolve this, we adopt a micro-kernel architecture : The Orchestrator (Go): Handles the user interface, API gateway, session management, tool calling, and high-level logic. Go’s goroutines allow it to manage thousands of concurrent agent sessions with minimal memory overhead. The Engine (Rust): Handles the heavy lifting: mode
Claude Code in CI: Running Agentic Code Review, Test Generation, and Auto-Fix on Every Pull Request
Claude Code in CI: Running Agentic Code Review, Test Generation, and Auto-Fix on Every Pull Request This article was written with the assistance of AI, under human supervision and review. Why Agentic Code Review in CI Changes Everything Most CI failures waste hours on manual intervention because traditional bots flag problems but never fix them. Developers open a pull request, the linter fails, tests break, and someone must context-switch from their current work to diagnose and patch the issue. This context-switching compounds across teams until the cost of maintaining CI hygiene exceeds the value it provides. Claude Code running in auto mode solves this by operating as an autonomous agent inside the CI pipeline. When a pull request triggers the workflow, Claude Code reviews the diff, generates missing tests, attempts to fix failures, and posts structured feedback as review comments—all without human intervention. The developer receives actionable fixes instead of error logs. This distinction is critical. Traditional CI bots detect and report. Agentic CI detects, repairs, and documents. The ROI appears in two places: reduced time-to-merge for routine issues and preserved cognitive capacity for architectural decisions that actually require human judgment. Key Takeaways Claude Code in auto mode runs unattended in CI pipelines with a safety classifier blocking dangerous commands before execution. Agentic CI performs code review, test generation, and auto-fix in a single workflow—eliminating the manual context-switch loop. Production deployments require cost controls (token budgets per PR), scoped file permissions, and exit conditions to prevent runaway execution. GitHub Actions, GitLab CI, and Azure DevOps all support Claude Code integration through environment variables and secrets management. The pattern that works now is scoped, single-responsibility agents—one for review, one for test generation, one for auto-fix—not a single agent attempting all tasks. Claude Code