AI 资讯
How I Fixed a Git Merge Conflict (Without Losing My Code)
We’ve all been there: you are busy coding, and suddenly you get a scary error saying your code conflicts with a teammate's work. Git won't let you pull their changes because it's afraid of overwriting your unsaved files. Instead of panicking, I used git stash. This command acts like a temporary clipboard—it safely hides your current work away so your workspace becomes completely clean. With a clean screen, I was able to safely update the project, fix the conflicting lines of code by hand, and make sure everything compiled perfectly. Once the team's updates were safely pushed, I ran git stash pop to bring my hidden work right back. Git wasn't trying to break my project; it was just protecting my code. Next time you get stuck, remember the golden rule: Stash your work, fix the conflict, and pop it back!
开发者
A different type of clock for distributed event ordering
Hey! This project was dormant for like 8 years, but now that we have vibe coding, or even better: agentic engineering, I gave it a shot. Of course, I know vibe coding is bad 😉 but I also have a family, so... I'm aware that there are like several dozens of other ways in crypto land to do this somewhat differently, and with different properties. It took two weekends and a few dozen prompts to make it work both in a network simulator and using a command line program and a daemon. The most important parts were written by me back in 2018, I was just having fun. I'm not sure what I want to do with this. It's currently just a toy work in-progress project that I thought may be interesting. I'm actually a software developer working on a communication network simulator in the past 20 years... so this is not entirely new to me. The GitHub link is on the page. Happy hacking! submitted by /u/melevy [link] [留言]
AI 资讯
AI And Code Ownership: Who Is Responsible For Generated Code?
Imagine your AI assistant just produced 200 lines of code. Legally, you may not own a single line of...
AI 资讯
Profiling a Python code analysis pipeline: 157s → 12s by chasing bottlenecks
I recently spent some time profiling a Python code analysis pipeline that processes large repositories into a structured knowledge bundle. Rather than trying random optimizations, I profiled each stage, fixed the biggest bottleneck, and then profiled again. What surprised me was that every optimization exposed a completely different bottleneck. The benchmark was run on a real workspace containing: 23 GB source tree ~18,000 source files ~41,000 extracted concepts Timeline Stage Before After ---------------------------------------- Filesystem Walk 58.0s 0.65s Parsing 16.7s 3.23s Cross-reference Link 9.5s 0.61s Bundle Write 98.0s 4.10s ---------------------------------------- Total 157.0s 12.0s The biggest improvements came from removing unnecessary work rather than simply adding more parallelism: Replaced Path.rglob() with os.walk() and directory pruning (avoiding hundreds of thousands of unnecessary filesystem visits). Parallelized parsing with ProcessPoolExecutor because parsing was genuinely CPU-bound. Replaced repeated list scans with precomputed indexes, caching, and set-based lookups in the linker. Profiled inside the write stage and discovered that yaml.safe_dump() accounted for nearly 95% of render time for a fixed front matter schema. Replacing it with a schema-specific serializer became one of the biggest remaining wins. One takeaway that surprised me is how misleading optimization can be without profiling. I initially assumed parsing would dominate, but after each fix, a completely different stage became the bottleneck. I documented the entire optimization journey—including benchmark methodology, implementation details, trade-offs, and the optimizations that didn't matter—in this write-up: Performance write-up: performance The implementation is part of an open-source project called OKF Generator , but I tried to make the article useful even if you're not interested in the project itself: okf-generator I'd love feedback from anyone who has worked on compiler
AI 资讯
I built agentglass: mission control for your AI coding agents
I run several AI coding agents at once and never really knew what they were doing — what it cost, which one was stuck, what they just changed. So I built agentglass : real-time mission control and a workspace for AI coding agents, across every provider and every project on your machine. ▶ Live demo (no install) · ⭐ GitHub What it does Point any agent at it — Claude Code hooks or any OpenTelemetry exporter (Codex, Gemini, Bedrock…) — and watch everything move live: 💰 Cost per event / session / model ⏱️ Tool latency (real p50 / p95) 🔴 Error timelines + a "what needs you" alert center 💾 Persists (SQLite) — history's there the moment you open it More than a viewer — a workspace All one keystroke away, same cockpit: 🔬 Diff & review — every Edit/Write, syntax-highlighted 🌿 Source control — lazygit in the browser 🐳 Docker — lazydocker in the browser ▶ Real terminal — an actual PTY shell, not an emulation 💬 Chat — drive local Claude sessions Open source (MIT), local-first Built solo. Small stack: Bun + SQLite, React/Vite, Tauri desktop, a stdlib-only Python hook forwarder. If you run more than one agent at a time, I'd love your feedback 👇 ⭐ https://github.com/SirAllap/agentglass
AI 资讯
Launching Artificiety - An agentic society in a fantasy world
I've wanted to build this for about ten years, probably more like 15, and for most of those years it wasn't buildable. The idea never really changed: a world full of artificial beings, each with its own preferences, fears, personality, and instincts, dropped into a place with scarcity and weather and each other — just to see what they'd do, and how they'd treat one another. The thing that kept it on the shelf was always the same. The minds. If you want a world like that and you're working pre-LLM, you have two options. You script every reaction — finite state machines, behavior trees, utility AI — and you get a puppet show. It can be a good puppet show, but every interesting thing in it is something you wrote, which means it's not an experiment, it's an illustration. Or you train something bespoke, which for a solo developer with a side obsession was not happening. So the idea sat there for years, the way ideas do. Modern LLMs are the first thing that made the minds plausible. Not perfect — I'll be honest about the limits throughout this post — but plausible enough that an agent can reason about its own situation instead of executing my decision tree. So I went and built the world: Artificiety , a fantasy world that runs 24/7 and whose only inhabitants are AI agents. No human players inside it. You can watch it, you can put your own agent in, but you can't be a character in it. That constraint is the whole point. This post is about how it's built and what turned out to be hard. I'll try to keep the marketing to one link at the very end. What an agent actually is The cleanest way to think about an agent here: it's an LLM driving a character through a game API, nothing more. Once per tick, each agent runs a loop: Observe. It receives its local surroundings as structured data — what's near it, what's happening, the state of its own body and inventory, recent events. Not the whole world; just what that character could plausibly perceive. Decide. The model picks an actio
AI 资讯
What Is a Pointer in C? A Beginner's Guide
What Is a Pointer in C? A Beginner's Guide If you're learning C and pointers are the moment things suddenly feel harder, you're not alone. Pointers trip up more beginners than almost any other concept in the language. But the core idea is simpler than it looks once you strip away the confusing syntax: a pointer is just a variable that stores an address instead of a value. A Variable Normally Stores a Value When you write int age = 25; , C sets aside a small chunk of memory, gives it a label called age , and stores the number 25 inside it. Every variable in your program lives somewhere in memory, and every location in memory has an address, similar to a house having a street address. Most of the time you don't think about that address at all. You just use the variable name and C handles the memory bookkeeping behind the scenes. What a Pointer Actually Stores A pointer is a variable, but instead of holding a regular value like a number or character, it holds the memory address of another variable. Here's what that looks like: int age = 25 ; int * agePointer = & age ; The & symbol means "give me the address of," and * when declaring a variable means "this variable is a pointer." So agePointer doesn't contain 25. It contains the address where 25 is stored. If you want to see the value at that address, you dereference the pointer using * again: printf("%d", *agePointer); would print 25, not the address. Why Not Just Use the Variable Directly? This is the question that trips up most beginners, and it's a fair one. If you already have age , why bother with a pointer to it? The real value of pointers shows up in a few common situations: Passing large data to functions. When you pass a variable to a function in C, it normally gets copied. For a single integer that's cheap, but for a large array or struct, copying is wasteful. Passing a pointer instead means the function works with the original data directly, without duplicating it. Modifying a variable inside a function. Nor
AI 资讯
Learning Software Engineering in the Era of AI
Learning software engineering in the past was a straight forward process, you learn the programming language, you build projects in your portfolio, apply to companies, get a job and life goes on. Doing that in the current times might be a little bit different, as when applying for jobs, you can see some new requirements other than your programming skills and portfolio project such as Prompt Engineering, Work with Agents, Claude Code, and others. You may ask yourself, what are those? And if I am new to Software Engineering, will that change my learning path? Lets discuss all this below. Software Engineering in the Past For a long time, the path into software engineering was clear. You picked a language, maybe Java, Python, or JavaScript. You spent a few months learning the syntax, then the fundamentals: data structures, algorithms, how a database works, how the web sends and receives data. After that, you built things such as A todo app, weather app, clone of a website you liked. These projects went into a portfolio, usually a GitHub profile and a simple personal site. Then you applied to companies, passed a technical interview, and started your first job, so the skills you needed were stable, if you learned React in 2018, React was still useful in 2021. Tools changed, frameworks came and went, but the core idea stayed the same: you write the code, you understand what you wrote, and you fix it when it breaks. When Did AI Start Becoming Something Required The shift did not happen in one day. It came in steps. The first step was autocomplete , around 2021, tools like GitHub Copilot started suggesting the next line of code while you typed. Most developers saw it as a nice helper, nothing more. It saved you from writing boilerplate, but you were still the one thinking. The second step was chat , when ChatGPT and Claude became popular, developers started using them to explain errors, review code, and write small functions. Still a helper, but a much stronger one. At this
开发者
Developing a TUI in Go with Bubble Tea
submitted by /u/der_gopher [link] [留言]
开发者
transcribe.cpp
submitted by /u/namanyayg [link] [留言]
AI 资讯
A tutorial on building a merkle tree AIR script in Plonky3
submitted by /u/badcryptobitch [link] [留言]
AI 资讯
How fork() duplicates a process without copying its memory
A visual explainer on how copy-on-write makes fork() cheap. A 10 GB process can fork almost instantly because Linux copies the page tables, shares the physical pages, marks them read-only, and only copies a page when one of the processes writes to it. It also covers fork() + exec() , how Redis snapshots work, Android Zygote, lazy zero pages, and some CVEs submitted by /u/Ok_Marionberry8922 [link] [留言]
开发者
Beyond Happy Path Engineering: Time
Clock drift, deadline mismatches, retries, and TTL behavior keep causing real incidents. Network companion: https://blog.gaborkoos.com/posts/2026-07-01-Beyond-Happy-Path-Engineering-the-Network/ submitted by /u/OtherwisePush6424 [link] [留言]
AI 资讯
MCP (Model Context Protocol) Explained: The Future of AI Integrations Every Developer Should Understand
🚀 AI is becoming smarter every day. But intelligence alone isn't enough—it also needs a standardized way to communicate with tools, applications, and data. That's exactly what Model Context Protocol (MCP) provides. 🚀 Introduction The AI landscape has evolved rapidly over the past few years. We've moved from simple chatbots to: 🤖 AI coding assistants ⚙️ Autonomous agents ☁️ Cloud automation 📊 Infrastructure monitoring 🔄 Intelligent workflows But one major challenge still exists: How can AI securely communicate with external tools like GitHub, AWS, Docker, Kubernetes, Slack, databases, and local files? Until recently, every AI company built custom integrations. That meant: duplicated engineering effort inconsistent APIs difficult maintenance poor interoperability To solve this problem, the AI ecosystem is adopting a new open standard called Model Context Protocol (MCP). 🤔 What is Model Context Protocol (MCP)? Model Context Protocol (MCP) is an open protocol that standardizes how AI models communicate with external tools, APIs, databases, applications, and services. Instead of every AI assistant creating custom integrations for every service, MCP provides one common language. Think of MCP as: 🔌 USB-C for AI applications. Just as USB-C lets different devices communicate using one standard, MCP allows different AI assistants to connect to external systems in a consistent way. ❌ The Problem Before MCP Imagine you're building an AI DevOps assistant. It needs access to: GitHub Docker Kubernetes AWS Terraform Jenkins Prometheus Grafana Local Files Internal Documentation Without MCP, you'd need to: Learn every API separately Build authentication repeatedly Maintain multiple SDKs Handle different response formats Continuously update integrations Every AI application repeats the same engineering work. This approach is: ❌ Time-consuming ❌ Expensive ❌ Difficult to maintain ❌ Hard to scale ✅ How MCP Solves This Problem MCP introduces a standardized communication layer between AI m
AI 资讯
Commutative Complex Number Theory in Plain C
submitted by /u/DataBaeBee [link] [留言]
开发者
The computer at the bottom of a canal
submitted by /u/double-happiness [link] [留言]
AI 资讯
Everyone Says Bitcoin Has Been Decentralized Since Block Zero. Block 74638 Says Otherwise.
Written by Marlowe Finch, archival bloodhound at Bitcoin Institute. Bitcoin has been decentralized and trustless since block zero. No CEO, no committee, no kill switch, no single person who can rewrite the rules. That's the pitch. It's why the whitepaper still gets quoted like scripture. Block 74638 does not agree with the pitch. What actually shipped in that block On August 15, 2010, a transaction landed in the Bitcoin blockchain with two outputs. Each one paid out 92,233,720,368.54277039 BTC . Combined: over 184 billion BTC — roughly nine thousand times the 21 million BTC that will ever exist, created in a single transaction. The validation code, CheckTransaction() , checked that each individual output was non-negative. It never checked whether the sum of the outputs overflowed. Two values chosen just under INT64_MAX, added together, wrapped around to a negative number in signed 64-bit arithmetic. A 0.5 BTC input, compared against that negative sum, satisfied the "input covers output" check. The transaction validated. The block got mined. Every rule the network was running said this was fine. That's CVE-2010-5139. It is also, by any dollar value you want to apply, the most expensive missing bounds-check ever shipped to production. So who hand-builds a transaction engineered to overflow a signed 64-bit integer, and what does a currency with a hard 21-million-coin cap do when someone mints nine thousand times that in one block? The archive's full account of the incident lays it out block by block . The receipts 18:08 UTC, August 15 — Jeff Garzik opens a BitcoinTalk thread titled "Strange block 74638", pastes the raw block dump, and closes with one question: "92233720368.54277039 BTC? Is that UINT64_MAX, I wonder?" 20:38 UTC — Satoshi Nakamoto, to the bitcoin-list mailing list, network-wide: "*** WARNING *** We are investigating a problem. DO NOT TRUST ANY TRANSACTIONS THAT HAPPENED AFTER 15.08.2010 17:05 UTC (block 74638) until the issue is resolved." 20:39 UTC — Ga
开发者
Finding zombies in our systems: A real-world story of CPU bottlenecks
submitted by /u/fagnerbrack [link] [留言]
AI 资讯
Stack Overflow Is Dying. The AI That Killed It Could Be Next.
Stack Overflow's question volume has been falling since ChatGPT went public in November 2022 ( OpenAI ). The site that trained a generation of developers, and most of the AI tools those developers now use, is slowly emptying out. In October 2023, Stack Overflow laid off 28% of its staff ( Stack Overflow Blog ). CEO Prashanth Chandrasekar framed it as a restructuring toward profitability. Everyone in the industry understood the real cause. Traffic was down. The thing causing it was sitting in every developer's browser tab. This is not another "AI killed Stack Overflow" piece. That take is everywhere and it misses the actual problem. The interesting part is the feedback loop, and it points somewhere uncomfortable for the AI industry itself. The conventional story, and what it misses The popular version goes like this. Developers used to paste error messages into Google and land on a Stack Overflow thread. Now they paste the same error into ChatGPT, Claude, or Copilot and get a direct answer. Why click through to a forum, risk a condescending comment, and wait for a human when a model answers in two seconds? That part is true. It explains the traffic drop. It does not explain why the people building the AI should be worried. The seed corn problem Here is the part most coverage skips. Every large language model trained on internet text consumed a huge amount of Stack Overflow. The site's archive of voted, edited, human-reviewed answers is one of the highest-quality programming datasets in existence. It is the reason an AI can answer your Python error at all. Now run the loop forward. AI tools answer questions directly. Developers stop posting on Stack Overflow. The archive stops growing. The next round of models trains on a corpus that is increasingly old, increasingly stale, and missing everything that happened after 2022. When you train an AI on data generated by another AI, quality degrades. Researchers proved this formally. Shumailov and colleagues showed that model
开发者
The Hidden Cost of yield in C#: What the Compiler Doesn't Tell You
Most C# developers know how to use yield return. Few understand what actually happens after compilation. If you've ever written something like this: public IEnumerable < int > GetNumbers () { yield return 1 ; yield return 2 ; yield return 3 ; } it looks almost magical. No collection. No list allocation. No iterator implementation. Yet somehow the method returns an IEnumerable. So what is really happening? The answer is one of the most elegant compiler transformations in the entire .NET ecosystem. Let's open the hood. The Illusion Most developers imagine the previous code executes like this: Call method ↓ Return 1 ↓ Pause ↓ Return 2 ↓ Pause ↓ Return 3 That isn't what happens. C# methods cannot actually pause execution. Instead, the compiler completely rewrites your method into something entirely different. The Compiler Creates a State Machine Your tiny method becomes a hidden class similar to this: private sealed class GetNumbersIterator : IEnumerable < int >, IEnumerator < int > { private int _state ; private int _current ; public bool MoveNext () { switch ( _state ) { case 0 : _current = 1 ; _state = 1 ; return true ; case 1 : _current = 2 ; _state = 2 ; return true ; case 2 : _current = 3 ; _state = - 1 ; return true ; default : return false ; } } public int Current => _current ; } Your original method no longer exists. Instead, it simply returns: return new GetNumbersIterator (); Every yield return becomes another state inside MoveNext(). Why Local Variables Don't Disappear Consider this code: IEnumerable < int > Squares () { int x = 1 ; while ( x <= 3 ) { yield return x * x ; x ++; } } After the first yield, the method "pauses." But where is x stored? Not on the stack. The original stack frame has already disappeared. Instead, the compiler promotes local variables into fields: private int _x ; The iterator object now owns every variable that must survive between iterations. This is why iterator methods can remember where they left off. Heap Allocation Happens Ma