Debunking zswap and zram myths
submitted by /u/fagnerbrack [link] [留言]
找到 1398 篇相关文章
submitted by /u/fagnerbrack [link] [留言]
A walkthrough of the architecture decisions behind Flacron Gamezone a production full-stack app built with Next.js, Express, PostgreSQL, and Redis. When a client approached me to build a live football match discovery platform, the requirements sounded straightforward on the surface: show live scores, let users subscribe, handle authentication. But the moment you start thinking about how those pieces connect in production, straightforward gets complicated fast. This is the story of how I designed the backend for Flacron Gamezone — what decisions I made, why I made them, and what broke along the way. Table of Contents The Problem With "Just Building It" The Architecture: Four Distinct Layers Why This Matters to a Client The Bug That Taught Me Something Real The Full Stack at a Glance What I'd Do Differently The Problem With "Just Building It" The easiest version of this app is a single Express file: one route handler that queries the database, formats the data, and sends a response. I've seen this pattern in tutorials everywhere. It works for demos. It falls apart in production. The problems are predictable: you can't test business logic without hitting the database, a change in one feature quietly breaks another, and the moment a second developer joins the codebase, nobody knows where anything lives. I wanted to build something I could actually be proud to show an employer or a client. That meant committing to a proper layered architecture from day one, even on a project this size. The Architecture: Four Distinct Layers The entire Express backend is organized into four layers. Each layer has one job and talks only to the layer directly below it. Route → Controller → Service → Repository Here's what each one actually does. Routes are just maps. They declare that POST /api/v1/subscriptions exists, attach the auth middleware, and hand off to the controller. No logic lives here. Controllers handle the HTTP boundary. They extract data from req.body or req.params , call th
submitted by /u/radekmie [link] [留言]
submitted by /u/Local_Ad_6109 [link] [留言]
A Stanford and Tsinghua paper ran a controlled experiment earlier this year. Same model. Same task. Different harness architecture. The result: a 6x performance gap driven entirely by the system built around the model. Not the model itself. This is not a prompt engineering insight. It is a systems architecture insight, and it changes where developers should invest their time when building agentic systems. The 6x Gap Meta-Harness tested Claude Opus 4.6 across two harness configurations on TerminalBench-2. The only variable was the scaffold: the code that manages tool calls, context windows, error recovery, and state persistence. One version scored at baseline. The other, with structured tool orchestration and context management, scored 18.4 points higher. Same inference cost. Same model. Different architecture. This pattern replicates across multiple independent studies: LangChain DeepAgents (2026): Same GPT-5.2-Codex model. Harness-only changes moved it from Top 30 to Top 5. That is a 13.7-point gain. Can Bölük (Hashline, 2026): Same model, same task. Changed the edit tool format. Performance went from 6.7% to 68.3%. That is a 10x improvement with 61% fewer tokens. Vercel's d0 agent : A production agent had 16 tools. Removing 14 of them (leaving only bash) took success rate from 80% to 100%. The bottleneck was not capability. It was decision surface. Why This Matters Practically The cheapest Haiku call with an optimised harness (37.6% on TerminalBench-2) outperformed the most expensive Opus call with a default harness (58.0%). That is at 1/50th the inference cost. Most teams are optimising at the wrong layer. They swap models, tune prompts, add retrieval. The structural leverage is in how the system manages tool calls, handles state, and recovers from failure. What Changes The practical takeaway for anyone building with AI agents: Audit your tool surface. Every tool your agent can call is a decision it must make. Vercel found 16→1 tool reduction improved everything.
I’ve been writing my project - Python port scanner for 9 months now. You might be wondering, “Why is it taking so long?” Most of the time was spent figuring out how raw sockets work, how to write a function for manually assembling a packet, calculating the checksum, packing the IP packet bytes, the TCP header, the pseudo-header using struct.pack, sending the packet, and how SYN scanning works. Why did I decide to take such a complicated route instead of just using Scapy? I’m a principled person and have a very exhausting yet useful skill—understanding everything. That’s how I got acquainted with big-endian, or “network byte order.” I won’t go into the details of big-endian logic, to be honest, I’m already mentally exhausted It took several evenings and nights to analyze and understand the principles—watching videos, reading RFCs, and looking at GitHub code (which I didn’t understand)—but what bothered me most was that I had to ask gemini for an explanation. As I mentioned above, I’m very principled; I can’t just copy code without understanding it, so I ask gemini for a prompt like this: “Don’t write the code for me. If I end up asking you for an example because I’m tired, explain it line by line.” Yesterday I realized I don’t fully understand Python (basics)—I don’t remember REPL—so I went to ask Gemini for advice; I don’t have anyone competent who could help me with advice. I’m not very sociable, and the only thing that’s interested me for the last four years is IT. I used to make music. Lately, something strange has been going on with my health, the day before yesterday I woke up because of a nosebleed; this has happened before, but on a larger scale. I stopped working on the scanner yesterday and decided to try writing a backup script in Python. I found an article and jotted down in Obsidian what the project should and shouldn’t do. Previously, the project used Docker, Prometheus, and Grafana. My questions: Am I a good developer, and am I even one at all? Should
I started off thinking I needed to simply memorize Modules and go through each and find a way to apply each of them linearly through the docs. Thinking about it that was kind of a retarded approach, but i blame it on classroom conditioning. My inconsistent life stability as well, going off and on with studying. Anyway, I found progress in freeCodeCamp and I've took these notes: Project Completion List: Report card printer | Employee profile generator | Bill Splitter Movie ticket calculator | Weather Travel Planner | Apply Discount Function Caesar Cipher | RPG Character Creator | Pin Extractor | Number Pattern Generator Medical Data Validator | In Python, code blocks are determined by indentation. Redundancy Is A BIG Logic Problem I have in learning Python. Think of parameters as placeholder variables that act as "slots" for the values you pass into functions when you call them. To use the parameters, you have to pass in "arguments". Arguments are the values you pass to a function when you call it. In Python it seems that you should learn to do things with incredible detail and specifics. In the FCC it seems an unspoken lesson is to pay careful attention to what is not said, don't under-cut and don't exceed the expectation. That might be something to ponder later. In note taking i have also found that it is much more meaningful and efficient to only record pointers, not executions or further examples. Logic Thinking and Problem Solving are both things that have to be developed by you. They cant be memorized or given to you. You should give yourself obvious recognition to look back on, It helps you remind yourself when you think your not making progress. order matters whenever it comes to for loops Also, an if statement is NOT a for loop Memorizing isn't learning, It's memorizing. submitted by /u/Big_Example_3390 [link] [留言]
submitted by /u/fagnerbrack [link] [留言]
Hello, I'm Maneshwar. I'm building git-lrc, a Micro AI code reviewer that runs on every commit. It is free and source-available on Github. Star git-lrc to help devs discover the project. Do give it a try and share your feedback for improving the project. You might not have noticed, but Chrome quietly started shipping a local AI model called Gemini Nano bundled right into the browser. No API keys. No cloud round-trips. No per-token cost. It just runs on your machine. The interface to talk to it is called the Prompt API , and it landed in Chrome 138. I spent some time going through the full API surface and built a playground that lets you experiment with every feature session management, streaming, structured output, multimodal input, response prefixing, and more in one page. This post walks you through all of it. Why does this matter? On-device AI flips the usual tradeoffs: Free at runtime — the model runs on the user's hardware, not your servers Private by default — no data leaves the device once the model is downloaded Works offline — after the initial download, no network required Low latency — no round-trip to a data centre The catch is that Gemini Nano is a small model. It's great for classification, summarization, Q&A on focused content, and structured extraction. It won't replace GPT-4 for complex reasoning. Think of it as a smart, free, always-available layer you can add on top of your existing product. Enabling the API The Prompt API isn't on by default in all Chrome builds. Enable two flags: Step 1 — Go to chrome://flags/#optimization-guide-on-device-model and set it to Enabled BypassPerfRequirement . Step 2 — Go to chrome://flags/#prompt-api-for-gemini-nano and enable both the base API and the multimodal option. Relaunch Chrome. Then visit chrome://on-device-internals to check the model download status. First use will trigger a download — Gemini Nano is a few gigabytes. The Playground I put together a single-file HTML playground that covers the entire API
I go over some basics and implement a simple feature live on the Wookash Podcast. It might be interesting to those who have tried File Pilot and wondered why its UI is so fast and responsive. I do some actual UI programming. Not much, since we were short on time, but enough to give you a glimpse into how it works. submitted by /u/vkrajacic89 [link] [留言]
Large language models are good at sounding structured. That is not the same as being structured. Ask an AI assistant to "use first principles" and it may produce a confident answer with the phrase "first principles" near the top. Ask it to "red-team this plan" and it may list generic risks. Ask it to "apply OODA" and it may give you four headings without doing the hard part: orienting against assumptions, constraints, and evidence. That failure mode is subtle because the answer looks responsible. It has the right vocabulary. It has the right shape. But the method did not actually control the analysis. I built methodology-toolkit to target that gap. The goal is not to add more clever prompts to Claude Code. The goal is to add a small layer of discipline around non-trivial decisions: classify the problem, choose methods that fit, apply those methods explicitly, verify load-bearing claims, and stress-test plans before they harden into action. Repository: https://github.com/gagharutyunyan1993/methodology-toolkit The Problem: Methodology Theater Methodologies are useful because they constrain attention. First Principles asks you to strip assumptions and rebuild from base facts. ACH asks you to compare competing hypotheses by disconfirming evidence, not by collecting confirmations for your favorite answer. OODA asks you to separate raw observation from orientation, where bias and context do most of the work. Pre-mortem asks you to imagine the plan has already failed so optimism does not screen out obvious risks. When an AI assistant merely names those methods, you get the cost without the benefit. The answer becomes longer, more formal, and more convincing, but not necessarily more correct. That is worse than a short intuitive answer because the structure creates false confidence. methodology-toolkit treats that as the core anti-pattern: If a method is named, its steps must be walked. Not hinted at. Not summarized. Applied. Methodology theater: right vocabulary, no method
Welcome back to a series of introductory articles on AI Hub, the new product feature currently in an early access program! (links: EAP Site for download, documentation ) In the last article, we covered how to create agents and agent tools directly in ObjectScript using the new %AI classes. However, sometimes, instead of creating a new agent, you just want to add some custom tools to an existing agent so you can ask your local claude code, codex, copilot or other agent of choice to query your data directly. This is where MCP Servers might come in. In this guide, we will walk through how you can create your own MCP Servers to access your data. Disclaimer: AI Hub is an early access preview, with features likely to change before production releases, any issues identified can be raised as issues on the documentation GitHub repo linked above. The EAP preview is not to be used in production settings. A very brief intro to MCP I'm going to keep this brief because there are loads of other good articles on MCP Servers Model context protocol (I recommend starting with this article from @pietro .DiLeo or this brilliant introductory video from InterSystems President Don Woodlock). Model Context Protocol is a transport protocol allowing external tools to be added to an agent . There is a discovery 'handshake' where the MCP server sends a list of tools to the MCP Client. After the tools are discovered, the agent can send requests for tool executions, including parameters, to the MCP server, which executes the tool call and returns the result. MCP servers can be remote servers, i.e. running on a different machine to a client, this usually uses a streamable http/https connection or Server-Side Events. Or MCP servers can be local servers, i.e. running on the same machine, usually using a stdio connection. An important distinction AI hub allows you to create custom MCP servers within your IRIS environment, allowing agents to access or monitor your IRIS databases, productions and statu
c_std: A Leak-Free, Cross-Platform Standard Library for Modern C Bringing the comfort of the C++ STL and Python's standard library to C17 — without leaving C A technical white paper. Executive summary C is still the substrate of the computing world — kernels, databases, language runtimes, embedded firmware, and the inner loops of nearly everything else. Yet the moment you step away from the kernel and try to write ordinary application code in C, you feel the gap: no growable vector, no hash map, no JSON parser, no string type that doesn't invite a buffer overflow. You either pull in a grab-bag of mismatched third-party libraries, each with its own conventions and failure modes, or you re-implement the same dynamic array for the hundredth time. c_std is an attempt to close that gap deliberately and coherently. It is a single, consistent library — written in pure C17 — that reimplements a large slice of the C++ Standard Library (containers, algorithms, smart pointers) alongside many Python-style conveniences ( json , regex , random , statistics , csv , config , even turtle graphics). It targets Windows and Linux from one source tree, compiles cleanly under -Wall -Wextra , and — this is the part I care about most — is verified leak-free under Valgrind , module by module, example by example. This paper explains the design philosophy, the architecture, and the engineering discipline that makes a library like this trustworthy enough to build on. 1. The problem: C's missing middle Every C programmer knows the two extremes. At the bottom, the language itself: pointers, malloc , memcpy , raw arrays. At the top, whatever the platform hands you — <windows.h> or POSIX, OpenSSL, a JSON library someone wrapped a decade ago. The middle — the layer the C++ STL and Python's batteries-included standard library occupy — is missing. That missing middle has a real cost. It shows up as: Re-invention. Teams write their own vector, their own string builder, their own linked list, each subt
Interesting engineering write-up from Netflix on maintaining a real-time service topology in a large microservices ecosystem. The takeaway for me: observability isn't just about metrics, traces, and logs—understanding service relationships is equally critical as systems scale. Curious how others approach dependency mapping in production environments. https://netflixtechblog.com/from-silos-to-service-topology-why-netflix-built-a-real-time-service-map-0165ba13a7bc submitted by /u/mukeshsri369 [link] [留言]
Inspired by a question on r/haskellquestions , i wrote about the practical aspect of monads for people at a beginner / intermediate level, about how to go beyond mere understanding the monad class. I try to highlight how we use monads to structure our code, what benefits they bring, and how to reason about them. it comes with exercises! submitted by /u/nicuveo [link] [留言]
AI coding tools are no longer just autocomplete. In 2026, they are becoming coding assistants, terminal agents, code reviewers, and sometimes full workflow helpers. But the real question is: Which AI coding tool should developers actually use? Here is a short, practical comparison. Quick comparison Tool Best for Main strength Watch out for GitHub Copilot Daily coding inside IDE Fast autocomplete and GitHub workflow support Can feel limited for deep architecture work Cursor Full AI-first coding experience Great for editing across files and working inside a project You may rely on it too much without reviewing code Claude Code Terminal-based agentic coding Strong reasoning, repo understanding, and command execution Needs careful review before running changes Gemini CLI Open-source terminal AI agent Good for terminal workflows, debugging, and automation Output quality depends heavily on task clarity 1. GitHub Copilot GitHub Copilot is the safest default choice for most developers. It works well inside common IDEs and is useful for: Autocomplete Small functions Unit tests Refactoring Explaining code GitHub-based workflows GitHub also has Copilot coding agent support, which can work on assigned tasks, make code changes, and open pull requests from GitHub workflows. :contentReference[oaicite:0]{index=0} Use Copilot if: You want AI help without changing your full coding workflow. Best for: Junior to senior developers Teams already using GitHub Everyday coding productivity 2. Cursor Cursor is best when you want an AI-first editor experience. Instead of only helping with one line or one function, Cursor is useful when you want to ask questions about your whole project and make multi-file changes. Use Cursor if: You want your editor to feel like an AI coding workspace. Best for: Building features quickly Editing multiple files Understanding unfamiliar codebases Indie hackers and startup builders My honest take: Cursor is very productive, but developers should avoid blindly ac
In November 2023 we ran our first global Hytale servers on Google Kubernetes Engine using Veltrix 3.2 as our configuration orchestrator. The Treasure Hunt Engine—a service that fans spawn to claim event loot—started crashing every time search volume exceeded 12 k RPM. Grafana showed a steady climb of 503 errors on /hunt/claim until the autoscaler maxed out at 32 G1 CPU cores and still couldnt keep up. Operators kept filing tickets that boiled down to one sentence: We click the map, nothing happens. We never saw the actual error because the ingress controller was swallowing it and returning a generic Too many requests. What we tried first (and why it failed) Our first move was to crank up the nginx-ingress-controller replicas from 3 to 12 and switch the load-balancer tier from GKE Standard to Premium. The 503 rate dropped to 8 k RPM, but now the p99 latency on claims spiked from 80 ms to 420 ms. The culprit was a recursive call in the hunt service: every claim required a round trip to the player-profile service to validate tier eligibility, and that service was on a shared Postgres 15.4 cluster with 3 k TPS of unrelated traffic. The error stack in Jaeger was literally tracing_id=7f3a1c8… server=profile-db pool_timeout . We tried adding connection pooling with PgBouncer, but the hunt service was using raw libpq and refused to reuse connections—no matter how many times we told it. The Architecture Decision We ripped the validation out of the synchronous path and made the hunt engine publish an event called HuntTierCheckRequired to a dedicated Kafka topic player-events-tier . The hunt service would respond to the client with a 202 Accepted immediately, then the loot-claim worker would listen to that topic and, if the tier passed, publish HuntLootReady . The worker ran in the same pod but on a separate goroutine with a 60-second TTL so we didnt leak memory if the tier service hung. We moved the player-profile service to an SSD-backed CloudSQL instance and gave it 32 GB R
Quark’s Outlines: Python User-Defined Functions Overview, Historical Timeline, Problems & Solutions An Overview of Python User-Defined Functions What is a Python user-defined function? You can define your own function in Python using the def keyword. A Python user-defined function is made when you write a def block in your code. When Python runs this block, it creates a function object. A function object has special parts. These include its name, its list of default values, and its code. It also keeps a link to the global names from the file where it was made. You can use this object to call the function later with any valid input. Python lets you create named function objects with the def keyword. def greet ( name = " friend " ): return " Hello, " + name print ( greet ()) print ( greet ( " Mike " )) # prints: # Hello, friend # Hello, Mike The function greet is now a user-defined function. Python stores its name, code, and default values for later use. What are the special parts of a Python function? A Python function holds many facts about itself. These are called attributes. For example, __name__ holds the function name. __defaults__ is a tuple of default values. __globals__ holds the global names it can see. __code__ is a special object that stores the function’s bytecode. Python functions store their details in special attributes. def square ( x = 2 ): return x * x print ( square . __name__ ) print ( square . __defaults__ ) print ( square . __code__ . co_varnames ) # prints: # square # (2,) # ('x',) These parts let Python understand and run your function later. A Historical Timeline of Python User-Defined Functions Where do Python’s user-defined functions come from? User-defined functions in Python build on ideas from earlier languages. They let you name blocks of code and reuse them. Over time, Python added new parts to function objects—like closures, default values, and metadata—to make them more powerful. People designed ways to name and reuse logic 1958 — Fu
A few weeks ago I posted about building a desktop app that automates GitHub commits because...
The Problem We Were Actually Solving We were not building a demo. We needed to let Veltrix operators run A/B experiments on synthetic user journeys without melting the underlying SQL warehouse. The real question was: how close could we push the warehouse to the AI inference layer before the planner started dropping predicates and the warehouse returned rows that made no sense for the user journey. The warehouse in question was a Snowflake XL on AWS, billed by the second. Our synthetic user model generated 250 k journeys per minute during peak. The AI layer had to annotate each journey with intent tags (shopping, support, fraud) within 200 ms to stay ahead of the next batch. That was the operating envelope, not the sales slide. What We Tried First (And Why It Failed) First cut: put the intent model in a sidecar container next to the Spark cluster that generated the journeys. We picked ONNX Runtime v1.14 with a DistilBERT fine-tuned on our own corpus because the latency slide said 30 ms. Reality: ONNX packaged the tokenizer as a separate DLL. Tokenization alone took 85–110 ms on c6i.large instances, pushing the total inference time to 190 ms when the warehouse was cold and 280 ms when Snowflake decided to spike the warehouse cluster. The operator dashboards immediately showed orange pings; the business called it a red fire drill. Worse, the tokenizer DLL leaked memory. After two hours on a 64-core cluster, each pods RSS climbed to 2.4 GB, and the Kubernetes scheduler evicted five pods in a row. The warehouse downstream received duplicate rows with NULL intents, so every metric we exported was off by 7–12 %. The Architecture Decision We ripped out the sidecar entirely. Instead, the Spark jobs write raw event JSON to an S3 bucket every 60 seconds. A Lambda function (Python 3.12 runtime) picks up the bucket, tokenizes offline, and stores the tokenized blobs back in S3. A nightly Kubernetes job then loads the tokenized chunks into Snowflake as temporary tables. The AI inf