Performance Benchmarking: gRPC+Protobuf vs. HTTP+JSON
submitted by /u/der_gopher [link] [留言]
找到 2764 篇相关文章
submitted by /u/der_gopher [link] [留言]
submitted by /u/noteflakes [link] [留言]
If you've ever lost 20 minutes at 2 AM debugging a submask enumeration loop, or drawn a segment tree on paper for the fifth time this month, this post is for you. I want to share a collection of 31 free, browser-based tools built specifically for competitive programming — no signup, no installs, code stays client-side. They're grouped at Utility Tools Lab's Competitive Programming category , and they cover almost every "I wish there was a tool for this" moment from contest practice. Here's a tour of what's inside. Visualizing structures you normally only imagine Half the pain in CP isn't the algorithm — it's seeing what your data structure is actually doing. Graph Visualizer — paste a CP-style edge list and get a force-directed graph you can drag around. Toggle directed/undirected and 0/1-indexing, then copy the adjacency list back out. Segment Tree Builder — feed in an array, pick sum/min/max/gcd, and watch the tree render, plus grab a full C++ class template. Sparse Table Builder — visualizes every level of the O(1) RMQ precomputation, with live queries. Union-Find (DSU) Visualizer — watch path compression and union-by-rank happen live on a forest view. Path Finder — paint walls on a grid and run BFS to see the shortest path animate, then copy the grid as a C++ 2D vector. Sieve Visualizer — step through the Sieve of Eratosthenes on a color-coded grid. Sorting Visualizer and Binary Search Visualizer — step-by-step animations with live comparison counts, or lo/hi/mid tracking on your own array. These aren't just "nice to look at" — watching the not-found path in binary search, or the moment a submask loop wraps around, is often exactly where off-by-one bugs hide. Code generators that skip the boilerplate Some things in CP are conceptually simple but easy to typo under time pressure. These tools generate ready-to-paste C++: Bitmask Planner — set N ≤ 12, visualize all 2^N states and submask iteration order, get a DP skeleton. PBDS Generator — Order Statistics Tree boi
Gemini 3.8 Flash is interesting to me for a slightly unusual reason. It didn’t get a dramatically larger context window. It didn’t suddenly become a different class of model. Instead, Google seems to have spent most of the upgrade budget on something that matters more in real agent workflows: making the model stick with difficult tasks for longer. Gemini 3.7 Flash already had a 1M-token context window. Gemini 3.8 Flash keeps roughly the same context envelope, with up to 1,048,576 input tokens and 65,536 output tokens. So if you’re looking at 3.8 purely because the model number is higher, I don’t think that’s a good enough reason to migrate. The more interesting question is whether your workload benefits from a model that reasons longer, calls tools more persistently, and is more willing to recover when the first attempt doesn’t work. The upgrade is mostly behavioral This is the part I find more useful than the spec sheet. Imagine a coding agent working through a real repository. It might need to inspect several files, make an edit, run the tests, discover that something broke, read the error, change its approach, and try again. A weaker agent can look good for the first few steps and then quietly fall apart once the workflow gets messy. Gemini 3.8 Flash is clearly aimed more at that second half of the task. Google reports 73.7% on DeepSWE v1.1, compared with 65.3% for Gemini 3.7 Flash. That’s a meaningful jump, but the benchmark itself is less interesting to me than what it suggests: the Flash tier is becoming much more capable at completing longer coding workflows rather than just producing good first-pass answers. That changes where I’d consider using it. “Flash” doesn’t mean what it used to I still instinctively associate Flash models with cheap, fast requests. Classification. Extraction. Simple summaries. High-volume API traffic. Gemini 3.8 Flash makes that mental model less useful. It can take text, images, video, audio, and PDFs as input, while also working wi
⭐Excitement! I've had had stores on Shopify, and a successful Etsy store. But after years of ups and downs and general nonsense, I'm done living by someone else's standards. I wanted to build my own fully functional shop. It had been thrown on the backburner for a long time. Today -- I present a working Ecommerce site built by yours truley! Integrations: Stripe Cloudflare Gorgeously simple admin dashboard that is clear and makes sense A small art gallery to represent myself as an artist (only a few pictures for now) Product uploads from varying places (like excel 2003, smh) I've ran it through basic SEO tests to make sure I'm not totally failing. It's live. It will accept payments! -- proud developer moment -- I'm going to share some picks but here is the link: Everfluorescent.com Eeeeeeeeeeee!!!!! Main Page: Custom Admin Dashboard: Let me know if you find a bug! <3
What happens if the power cuts out while a process is writing to a config file? Or if antivirus software on Windows briefly locks a file mid-write? If you naively overwrite a file with open(path, 'w') , whatever partial content existed at the moment of interruption is what remains on disk. For JSON, that usually means broken syntax — json.load() throws on the next startup, and the entire configuration is effectively lost. This article walks through a standard technique for preventing that: writing to a temporary file first, then swapping it in atomically. Note: "Atomic" here means an operation either completes entirely or doesn't happen at all — there's no partial, observable in-between state. It's the same sense of the word used for database transactions. Why direct overwrites are dangerous open(path, 'w') effectively truncates the file first and then writes the new content. If the process is interrupted during that window, the file is left empty or holding incomplete content. # Dangerous: a crash mid-write leaves a corrupted file behind with open ( ' config.json ' , ' w ' ) as f : json . dump ( data , f ) # what if this gets interrupted? The causes vary: a kill -9 , a power outage, antivirus software briefly blocking file access on Windows, or a backup tool grabbing the file mid-write. This rarely reproduces during local development, but in a long-running production environment, it will eventually happen with near certainty. The fix: write to a temp file, then swap it in The core idea is simple. Never touch the target file directly. Write the complete new content to a temporary file first, confirm that write fully succeeded, and only then replace the target file with that temp file. import json import os import tempfile def atomic_write_json ( filepath , data ): dirpath = os . path . dirname ( os . path . abspath ( filepath )) or ' . ' fd , tmp_path = tempfile . mkstemp ( dir = dirpath , suffix = ' .json.tmp ' ) try : with os . fdopen ( fd , ' w ' , encoding = ' u
💻 One thing I dislike about coding-agent setups is how quickly they become part of one specific machine. Provider config goes in one place, session state somewhere else, local models live in another directory, and suddenly moving to a second machine means rebuilding the environment. OpenClaude-Portable takes a much cleaner approach. It packages the coding agent, runtime and persistent data into a self-contained folder. It supports cloud and local models in the same setup The project currently supports 9 provider options: Anthropic Claude OpenAI Google Gemini DeepSeek OpenRouter NVIDIA NIM Ollama LM Studio custom OpenAI-compatible APIs I like this because the portable part is not tied to one model vendor. I can use a cloud model when I want the strongest hosted option, then switch to Ollama or LM Studio when I want a local workflow. The important caveat is simple: cloud providers still need internet. Ollama can run offline after the initial setup. The "zero footprint" idea is more useful than it sounds The project redirects its persistent data into a local data folder. That includes provider settings, API keys, logs, session history, agent memory and local Ollama files. According to the repository, it does not write configuration into the host system. For me, this is the real feature. I do not care that the agent happens to be on a USB drive. I care that I can move the folder and keep my environment with it. 💾 There are two very different ways to run the agent The launcher offers a normal mode that asks before file writes or shell commands. There is also an optional Limitless mode that can run without approval prompts. I like that these are explicit choices rather than one hidden permission switch. For normal development I would keep approval mode on. For a disposable test project or a controlled autonomous task, the second mode could be useful. Sessions can survive the move Another practical detail is session resume. The project stores session history inside the por
Dress a tree in borrowed blossoms, and it looks alive. The roots still tell the truth. — The 36...
[ Removed by Reddit on account of violating the content policy . ] submitted by /u/Kel_Thuzad11 [link] [留言]
Windows function VS Group by Both window functions and GROUP BY help you summarize data. But they do it in different ways, and mixing them up leads to confusing results. GROUP BY squishes many rows into one row per group. -A window function keeps every row , and just adds an extra column next to it. Once you see that difference, it's easy to know which one to reach for. We'll use one simple table the whole way through, so the examples stay easy to follow: students --------------------------- name | class | score --------------------------- Amina | A | 90 Brian | A | 70 Carla | A | 85 Dennis | B | 60 Efrem | B | 95 Difference between Windows Functions and Group by GROUP BY answers a question like: "What's the average score in each class?" It gives you back fewer rows than you started with — one row per class. A window function answers a question like: "How does this student's score compare to their class average?" It gives you back the same number of rows you started with — one per student — just with something extra calculated for each one. So: Want one summary row per group? Use GROUP BY . Want to keep every row, but add a calculation? Use a window function. Example 1: GROUP BY — one row per class -- One row per class. We lose the individual students. SELECT class , AVG ( score ) AS average_score FROM students GROUP BY class ; Result: class | average_score ------------------------ A | 81.6 B | 77.5 Notice we no longer see Amina, Brian, or any individual name. GROUP BY traded the detail for a summary. That's fine when the summary is all you need. Example 2: A window function — keep every row Now say you want to see each student's score next to their class average, without losing any rows: -- Every student stays, plus a new column showing their class average. SELECT name , class , score , AVG ( score ) OVER ( PARTITION BY class ) AS class_average FROM students ; Result: name | class | score | class_average ------------------------------------------ Amina | A | 90 | 8
AI can give you more working hours than there are hours in your day. That does not mean it gives you more finished work. On September 6, 2026, OpenAI published a detailed look at how coding agents are changing work inside its research organization. One number will get most of the attention: by mid-August, the organization was using 3.1 agent-workdays of runtime for every human workday . That sounds like somebody installed an extra Monday, Tuesday, and Wednesday inside Monday. OpenAI also reported that researchers were contributing code faster and running more experiments. Agent use had expanded beyond writing research and infrastructure code into technical help and monitoring runs. Some internal support office hours saw less demand because agents were handling troubleshooting work. But the report makes an important qualification: faster code and more experiments do not automatically make the whole research process 3.1 times faster. Research includes deciding what to pursue, designing experiments, running them, analyzing results, communicating findings, allocating compute, catching failures, and applying safety controls. Speeding up one stage can simply move the waiting line somewhere else. That is the useful lesson for a freelancer, solo founder, or beginner building an app with AI: Do not ask whether you are using enough AI. Ask which stage is limiting finished work. I call the tool for answering that question a bottleneck map. The beginner mistake: measuring the assistant instead of the work AI tools make activity easy to see. You can count tokens, prompts, agent sessions, generated files, commits, pull requests, tests, or hours of runtime. Those numbers can help with cost and capacity planning. They are terrible substitutes for the result your customer or user needs. OpenAI's own report is careful here. The organization observed more code and more experiments, but it also said those metrics are easier to measure than their relationship to research progress. As au
I Have a Job — I Just Need to Do It A few months ago, I left my last job as a remote Unity developer. Before leaving, I had already started working on a freelance project to build a multi-tenant security and workforce management system . It became a fairly large system involving web applications, mobile apps, real-time tracking, scheduling, reporting, GPS, notifications, and more. The project is now mostly completed, but the client wants to continue adding maintenance, business logic changes, UI modifications, and new development under the same maintenance fee. That doesn't work for me. Maintenance and development are two different things, and when the amount of new development keeps growing while the price stays the same, eventually it stops being sustainable. So I started thinking about what I would do next. The Fear of Not Having a Job For the last few days, I was genuinely worried. I have more than 250,000 BDT in savings , so I'm not in an immediate financial crisis. But money slowly disappears when there is no income. And freelancing isn't exactly comforting right now either. I've been using Upwork, but the experience has become increasingly frustrating. You apply for jobs and often hear nothing. Some clients post a job and never hire anyone. Some jobs get dozens of proposals and disappear quickly. Some invites arrive, but someone else gets hired almost immediately. And every application costs money. After a while, it starts feeling like you're continuously putting money into a machine that promises a job somewhere in the future. You keep applying. You keep waiting. You keep hoping. And eventually, I realized something. What I Was Actually Missing I wasn't missing money. I was missing a job . And there is an important difference. I already have the skills. I already know how to build software. I already have ideas. I already have projects I want to work on. I was simply thinking that a "job" had to come from someone else. Then I thought: I can create my own job
I recently implemented the Karatsuba multiplication algorithm on a 8-bit TTL computer I hack on. In this video I explain the algorithm, and explore the speed benefits of using it. submitted by /u/MichaelKamprath [link] [留言]
My system prompt had an example of a good Slack message in it. It opened with "Morning all, quick one:". The model started opening real Slack drafts with that exact phrase. Then it started saying "Morning." when I typed "hey", which is a small lie, because it cannot see a clock. So I added a rule telling it not to reuse examples from its own instructions. Three rebuilds. No change. Then I deleted the phrase. Fixed on the next build. That is when it clicked. The model does not read your system prompt as a list of instructions. It reads it as text that is likely to appear near its own output. Every finding below falls out of that one idea. The four rules I now write prompts by If a phrase must not appear in the output, it must not appear in the prompt. Banning it does not work. Deleting it does. Naming a bad example summons it. "Not the bank balance one" is an excellent way to get the bank balance one. Position beats wording. A rule buried mid-section gets read and traded away. The same words at the top of that section hold. Concrete beats principled. "Call fsync() before the rename" lands immediately. "Describe only the guarantee the code actually makes" does nothing. And the one that saved me the most time after it cost me the most time: verify on three seeds before you believe any of it. Here is the evidence for each. The setup Flash Onyx is the model line behind Flash , my local agent shell. There is no fine-tuning involved. Onyx is a base model plus a system prompt that has grown to roughly 680 lines, built into an Ollama tag with a small script: python3 models/build.py models/flash-onyx-2.5.Modelfile --size 31b-cloudbase -n Natuworkguy 2.5 is the version where I stopped editing that prompt by feel. The loop is not clever: edit the prompt, rebuild the tag, run a fixed set of prompts at pinned seeds, read the output, decide whether anything actually changed. Seeds are pinned so two runs are comparable. That is the entire method, and it is the difference between "t
I had a table in the database that was supposed to fill itself. Its job was to learn from failures : every time the system tried a variant of something and it didn't work, it saved it, to recycle later in another context where it might. A laboratory of failed attempts, piling up. In production it had zero rows . It had been deployed for days and hadn't saved a single record. Meanwhile a neighbouring table —another memory, the one that notes which work is already exhausted so as not to repeat it— was growing normally. The temptation is obvious: there's a bug in the write. I went looking for it, and it wasn't there. Zero rows isn't the same as a write error The path that saves into that table emits a warning if the write fails. I searched the logs for those warnings: zero . No write had failed. That's a fact, not an absence of one. If the path had been taken and had failed, it would have left a trace. Zero traces and zero rows fit only one explanation: the write path never ran . Not ran-and-failed. Didn't run. That's the difference between a real negative and a negative that was never put to the test, and they look the same unless you look for the positive control —something the log WOULD show if the path had been taken—. Without it, "healthy and quiet" and "dead" look identical. Two mechanisms starving each other Why didn't it run? Because of another mechanism, upstream, doing its job well. That system has a negative memory : when it exhausts everything it knows how to try against a target, it notes it down, so as not to spend effort again on something it already knows won't pay. It's a sensible optimisation. But it sat before the phase that generated new variants —the phase that, on failing, would have fed the library—. As soon as a target went "exhausted", that phase was skipped entirely . And if the phase never runs, it never produces a failure to save. Each mechanism, on its own, is correct. The negative memory avoids useless work. The library learns from failure
AI can now generate functions, components, tests, SQL queries, APIs, and sometimes entire applications from a short description. For developers, this has changed the daily workflow faster than almost any previous programming tool. Need a React component? AI can generate one. Need to debug an error? AI can suggest possible fixes. Need unit tests? AI can create a first draft. Need documentation for an unfamiliar API? AI can summarize it in seconds. The result is obvious: developers are writing code faster. But faster code generation raises an important question: If AI can generate code, why do human developers still matter? The answer is simple. Writing code is only one part of software development. Software engineering involves understanding problems, making architectural decisions, evaluating tradeoffs, validating requirements, securing systems, debugging unexpected behavior, and taking responsibility for what eventually runs in production. AI can generate code. Human developers still need to decide what should be built, why it should be built, whether the generated code is correct, and whether it is safe to deploy. This article explores why AI-generated code still requires human developers and why the future of programming is likely to involve developers working with AI rather than being completely replaced by it. AI Is Already Changing How Developers Work There is no serious argument that AI coding tools are irrelevant. Developers are using them. According to Stack Overflow's 2025 Developer Survey, 84% of respondents were already using or planning to use AI tools in their development workflow , and 51% of professional developers reported using AI tools daily . ([Stack Overflow Developer Survey][1]) AI can significantly reduce the time required for tasks such as: Generating boilerplate code Creating unit tests Explaining unfamiliar code Writing documentation Refactoring simple functions Generating SQL queries Debugging common errors Creating initial prototypes This
Closures in JavaScript Closures are one of the most important concepts in JavaScript. They can look confusing at first because they involve functions, lexical scope, and lexical environments together. But once we understand how these concepts are connected, closures become much easier to understand. A simple definition of closure is: A closure is a function that remembers and can access variables from its surrounding lexical environment even after the outer function has finished executing. The word "remembers" here doesn't mean that JavaScript literally copies the variables into the function. Instead, the function maintains a connection to the lexical environment in which it was created. Let's understand it with an example Consider the following code: function outer () { let name = " Abimanyu " function inner () { console . log ( name ) } return inner } let myFunction = outer () myFunction () When outer() is called, JavaScript creates a lexical environment for it. That environment contains the variable name : Outer Lexical Environment name → "Abimanyu" The inner() function is created inside outer() , so it has access to that surrounding environment. When outer() returns inner , the function is stored in myFunction . Now outer() has finished executing, but myFunction still refers to inner() . myFunction ↓ inner() ↓ Outer Lexical Environment ↓ name → "Abimanyu" When we call: myFunction () inner() needs the value of name . Since name is not inside its own environment, JavaScript looks through its surrounding environment and finds name in the environment created by outer() . This is the important part of a closure: the function retains access to the environment where it was created, even though the outer function has already finished executing. Why doesn't name disappear? This is where closures are often misunderstood. You might think that once outer() finishes, everything created inside it should disappear. But inner() still has a reference to the environment containin
submitted by /u/Shot-Reporter-2443 [link] [留言]
The reason I started this project is to learn more about C++, as we all know the best way of learning a programming language is to do projects, DO PROJECTS!! I used Austin Morlan's website to learn how to build it, it's quite good ( https://austinmorlan.com/posts/chip8_emulator/ ). I made some tweaks which I found to be better for me. I will not be posting the whole codebase here, it's too long. What I will be sharing are snippets of code, what I learned from it, and what I found amazing or funny (projects can have their own jokes). What is an Emulator ? An emulator is just hardware or software that lets the host system replicate conditions like the CPU, memory systems, clock cycles, etc., of the guest system whose functions/behaviour they want to simulate. It helps to bridge the architectural gap by making sure that each instruction code can be executed. In the case of Chip8, we have to simulate the hardware restrictions of the 1970s: a 64x32 screen, a 16-key keypad, timers, and a buzz sound. If you google Chip8, you will see that it is not actually a real physical device. It is a virtual machine/interpreter where you can interpret games (that was the intended purpose), like Pong or Space Invaders. It was a virtual language created in 1977 AD for a computer called COSMAC VIP. Building in C++ I wanted to get familiar with C++, that's why I am here. Building a Chip8 emulator in C++. Well, I learned you need headers, classes to define objects, the standard library, built-in objects like std::ifstream, std::streampos, and so on. I will explain some parts that left a mark in my memory. Header Files Well, before C++, I had only used a header file for an FPGA (Tang Nano 9K) project which I did. It made the LED blink in intervals. But now I understand more, such as how we create a blueprint of the class which we will be using to create objects in the future. Two modes: Public: The attributes and methods of the said class can be accessed by other functions or parts of the p
submitted by /u/benjoffe [link] [留言]