开源项目
What's wrong with my code?
I'm making this Arduino project for my maths class and column 4 on the keypad isn't working. This is how I want the buttons to work: A -> start over (whole game) B ->skip question C -> clear D -> delete one space What mistaks did I do and how exactly can I fix them? Thank youu <3 submitted by /u/livie4lifexx [link] [留言]
AI 资讯
How to Escape and Unescape JSON Strings (Quotes, Backslashes, Newlines & Unicode)
If you've ever hit Unexpected token in JSON at position 42 or Unterminated string , there's a good chance an unescaped character broke your payload. JSON is strict about what's allowed inside a string, and the fix is almost always escaping . Here's the practical version. What does escaping a JSON string mean? A JSON string is wrapped in double quotes. Any character that would confuse the parser must be replaced with a backslash escape sequence. Escaping doesn't change the meaning of your text — it just makes the string valid JSON so parsers can read it. Unescaping is the reverse: turning those sequences back into readable characters (handy when you copy a value out of logs or an API response). The characters you must escape JSON defines exactly seven characters that must be escaped inside a string: Character Escaped as Double quote " \" Backslash \ \\ Newline \n Carriage return \r Tab \t Backspace \b Form feed \f The forward slash / may optionally be escaped as \/ , but it isn't required. Unicode can be written as \uXXXX (four hex digits). JSON escape examples Double quotes — He said "hello" becomes: "He said \" hello \" " Backslashes (Windows paths) — C:\temp\file.txt becomes: "C: \\ temp \\ file.txt" Newlines and tabs — a two-line, tabbed string becomes: "Line 1 \n Line 2 \t Tabbed" How to escape and unescape JSON in code In production you rarely escape by hand — every language has it built in. JavaScript const escaped = JSON . stringify ( text ); // escape const back = JSON . parse ( escaped ); // unescape Python import json escaped = json . dumps ( text ) # escape back = json . loads ( escaped ) # unescape Java (Jackson) ObjectMapper mapper = new ObjectMapper (); String escaped = mapper . writeValueAsString ( text ); String back = mapper . readValue ( escaped , String . class ); C# (.NET) using System.Text.Json ; string escaped = JsonSerializer . Serialize ( text ); string back = JsonSerializer . Deserialize < string >( escaped ); Common escaping mistakes (and f
AI 资讯
The cover of C++: The Programming Language raises questions not answered by the cover
submitted by /u/lelanthran [link] [留言]
产品设计
The perils of UUID primary keys in SQLite
submitted by /u/andersmurphy [link] [留言]
AI 资讯
What Nobody Tells You About Learning to Code in the Age of AI
Six months ago, I sat down with a YouTube playlist, a blank notebook, and one goal: learn Python. What I did not expect was how hard it would be, not the Python itself, but figuring out how to actually learn it. I started with a YouTube playlist. Simple enough. Except nobody tells you what to do after you watch a video. Do you rewatch it? Take notes? Jump straight to code? I had no system. I'd watch a concept, feel like I understood it, open VS Code, and stare at a blank file. That's when I realized I had fallen into passive learning. And passive learning in the age of AI is a particularly dangerous trap, because it's so easy to confuse activity with progress. I could watch a video, feel good. I could ask Claude to explain a concept, feel good. I could even ask AI to write code, read it, nod along, and feel like I'd learned something. I hadn't. I'd just consumed. There's a difference. The real moment of honesty came when I was stuck on a coding problem. My instinct, everyone's instinct now is to open ChatGPT or Claude immediately. And I knew, sitting there with the cursor blinking, that if I did that every single time I got stuck, I was building nothing. My brain would never develop the muscle of working through problems. I would be someone who can prompt AI to code, not someone who can think in code. And in a world where AI can already write decent code, the person who can't think independently isn't valuable. They're replaceable. So I had to build a system that forced me to actually learn. After a lot of trial and failure, I landed on a 5-phase checklist that I wrote out by hand and kept next to my laptop. Phase 1: is what I call First Contact — watch one focused video, then write a summary purely from memory, then discuss it with an LLM not to get answers but to pressure-test what I thought I understood. Phase 2: is Deep Understanding — read a written source, write proper notes, map the concept visually, and list every edge case and exception I can find. Phase 3:
AI 资讯
I Tried to Fix a Vulnerability. A $1,400,000 AI System Said No. Twenty Days Later, That Vulnerability Cost $4,200,000.
This story was shared by a fellow developer on DEV who asked to remain anonymous. If you've got a story to tell — come find me. Your name won't appear anywhere. Based on real microservice security design patterns. About an engineer whose PR got blocked by an AI security system — he thought he was fixing a vulnerability. Turns out, someone had a vested interest in that vulnerability staying open. 1. $1,400,000 All-hands meeting. CTO James stood at the front, a number on the screen: $1,400,000 "This is what we're spending on security this year." He pointed at the number. "The biggest piece — right here." He clicked the remote. VoidSentinel's architecture topology appeared on screen. "VoidSentinel — an AI security platform. Integrated into our CI/CD pipeline. Starting today, every PR involving internal service-to-service calls — it reviews them automatically." The CEO didn't show up today. James didn't mention it. He looked straight at Mark — VP of Security. Mark took the mic. "VoidSentinel has been running in our pre-production environment for three weeks. It's caught 47 high-risk patterns. Zero false positives." He paused. " — Of course, some people might feel uncomfortable when their PR gets blocked. But this isn't personal. This is the security standard. " He wasn't looking at me. But I knew who he was talking about. 2. High Risk. Denied. The story started three weeks earlier. We had a payment service and a user service that talked to each other internally. They shared an old API key — one key across thirty-plus services, unchanged for five years. It wasn't that nobody knew. It just never made it to the top of the backlog. On Day 1, I opened a PR: add independent service-to-service auth between the payment and user services. Not much code — a new token exchange module, three call sites modified. Five minutes later, VoidSentinel's automated comment hit: "High-risk alert: Unauthorized internal access pattern change detected. This PR has been automatically rejected. C
AI 资讯
Power BI Visual Monitoring: Automatically Detecting Broken Visuals in Power BI Reports
Key Use Cases Power BI Visual Monitoring can be used for: power bi visual monitoring power bi report visual monitoring visual regression testing for Power BI power bi screenshot monitoring monitoring Power BI visuals visual monitoring for Power BI Report Server automated Power BI dashboard validation visual correctness control for BI reports Power BI Visual Monitoring: Automatically Detecting Broken Visuals in Power BI Reports In large Power BI environments, analytics teams often face the problem of silent regressions : even minor changes in data or models can break individual visuals without any obvious errors. Report owners frequently don’t notice that a visual has stopped rendering or is showing incorrect data — this can happen due to changes in data source structure, access rights, deleted fields, broken measures, or refresh failures. Manually checking hundreds of report pages across multiple dashboards in such conditions is extremely inefficient and nearly impossible. We, a team of BI developers and analysts, encountered this pain point during a large analytics implementation project and decided to create a solution for automated Power BI visual monitoring . Project Source Code: GitHub: https://github.com/svergio/Power-bi-report-visual-monitoring Documentation: https://svergio.github.io/Power-bi-report-visual-monitoring/ Wiki: https://github.com/svergio/Power-bi-report-visual-monitoring/wiki Why Standard Power BI Tools Don’t Solve the Problem Standard Power BI tools such as Usage Metrics and Performance Analyzer help analyze report usage and performance but do not detect visual issues. For example, built-in usage metrics show “how those dashboards and reports are being used” — number of views, popular reports, and who is viewing them. These metrics are important for assessing analytics adoption, but they say nothing about whether the visuals themselves are displaying correctly. Similarly, Performance Analyzer shows load times for each visual, helping identify s
AI 资讯
From an Abandoned To-Do App to a Smart Productivity Engine: Upgrading Taskr into Solomon's Taskr
What I Built : ( https://github.com/Sai-Emani25/Solomon-s-Taskr ) I transformed my initial, bare-bones task management application, Taskr, into Solomon's Taskr—a significantly smarter, more robust productivity platform. The original project started as a standard way to log to-dos, but it lacked the intelligence to actually help manage time or prioritize effectively. With Solomon's Taskr, I wanted to build a system that doesn't just store data, but actively assists the user. Building this project means a lot to me because it represents a leap from writing basic applications to architecting intelligent, dynamic systems that solve real-world workflow bottlenecks. Demo Link to Final Repository: https://github.com/Sai-Emani25/Solomon-s-Taskr Link to Original Repository: https://github.com/Sai-Emani25/Taskr (Here is a quick walkthrough of Solomon's Taskr in action!) The Comeback Story The original Taskr project had been sitting in my repositories, unfinished and gathering dust. It was a classic case of starting a project with good intentions but abandoning it once the basic structure was complete. It could create, read, update, and delete tasks, but that was it. For the Finish-Up-A-Thon, I decided to completely resurrect and overhaul it. Here are the key changes and implementations that turned it into Solomon's Taskr: Complete Codebase Refactoring: I stripped down the old, inefficient logic and rebuilt the architecture to be highly scalable and maintainable. Intelligent Prioritization ("The Solomon Touch"): I integrated smart features to help organize and prioritize tasks rather than just listing them chronologically. (Note: If you integrated Gemini API or LLMs here for smart tagging, explicitly mention it!) Enhanced UI/UX: I moved away from the clunky, basic interface of the original Taskr and implemented a clean, responsive dashboard that provides a real-time overview of pending and completed tasks. Optimized Data Handling: I refined how the application processes and st
AI 资讯
Why I stopped reading "Old vs New" posts
Why I stopped reading "❌ Old vs ✅ New" posts I used to scroll past them. Then I started ignoring them. Now? I don't read them at all. Not because they're "wrong". But because they're incomplete . The problem with "❌ Old vs ✅ New" These posts make everything look easy: One error One fix One clean "New Way" Three bullet points Save the post Done. Right? No. What these posts don't show you 🔹 The 200 failed deployments before that one working fix 🔹 The 300+ errors you solve along the way — not just one 🔹 The Vercel pipelines that break for no documented reason 🔹 The "New Way" that also fails in production 🔹 The gap between documentation and reality What happens in production That clean "New Way" code snippet? It might work on your local machine. But in production, with real traffic, real data, real edge cases? It can fail. Hard. And no three-line post prepares you for that. Why I stopped reading Because these posts teach me solutions to problems I don't have yet . But they don't teach me how to think when nothing works. They don't teach me: How to read error logs properly How to trace a pipeline failure across services How to stay consistent after multiple failed deploys How to know when the "New Way" is actually worse What actually helped me Not templates. Not shortcuts. Real experience: 200+ failed deployments 300+ errors solved (one by one) Broken pipelines fixed by understanding, not copy-paste Production live — not a "demo" or a "tutorial" This is not a "❌ vs ✅" post I'm not giving you a "Here's the fix". Because the real fix isn't three lines of code. It's patience. It's persistence. It's failing and getting back up. And no post can save that to your bookmarks. 👇 Have you ever followed a "New Way" post and had it fail in production?
AI 资讯
Pattern Recognition: The Secret Weapon Top Coders Actually Use
Pattern Recognition: The Secret Weapon Top Coders Actually Use Quick context (why you're writing this) I was knee‑deep in a legacy codebase last month, trying to fix a report that kept timing out. The function was supposed to flag any user who made three purchases from the same merchant within a five‑minute window, but the original author had written three nested loops that ran in O(n³). After staring at it for two hours I felt that familiar sinking feeling— there’s got to be a better way . Then I noticed the code kept doing the same thing over and over: looking for a recent occurrence of a value within a sliding window. That’s when it clicked: I wasn’t looking at a unique problem; I was seeing a pattern I’d solved a dozen times before, just dressed up in different variable names. The moment I recognized that pattern, the solution fell into place in minutes instead of hours. The Insight Top coders don’t rely on genius flashes; they rely on a mental library of patterns —recurring shapes of problems and their corresponding solutions. When faced with new code, they ask themselves: “What does this remind me of?” If they can map the current shape to a known pattern (like sliding window, two‑sum, divide‑and‑conquer, or observer), they instantly know which data structures and algorithms fit, and they can skip the trial‑and‑error phase. It’s not about memorizing answers; it’s about training your brain to spot the underlying structure so you can reuse proven solutions. The trade‑off is that you need to invest time upfront to build that library, but once you have it, you solve problems faster, write fewer bugs, and can explain your reasoning to teammates in a language they already understand. How (with code) Let’s walk through the exact problem I was tackling: detect users who made ≥ 3 purchases from the same merchant within any 5‑minute interval . The naïve attempt (what most of us write first) function flagFraudulent ( users ) { const flagged = new Set (); for ( let i = 0 ;
开发者
ZenQL, KISS And DRY.
imagine you are working in a large codebase. you need to fetch different kinds of data and transforming them, grouping them or sorting them. lets take a closer look at Sorting and Heaps in golang Specifically. we already familiar with heaps and its important interface. the Heap.Interface. a very performant and impressive implementation of heaps and its sorting functionality. type Interface interface { sort . Interface Push ( x any ) // add x as element Len() Pop () any // remove and return element Len() - 1. } as a programming language, it couldnt be done better than what it is today. but most of the time we might not need to implement all the interface items. dont get me wrong the functionalities should exist but mostly all that matters for us is that how the sorting will be done. ZenQL's Implementation In the latest version take advantage of sorting and heaps functionality. in a fast and agile way! result := From ( personList ) . Where ( func ( person Person ) bool { return person . Active == true }) . CollectSorted ( func ( person Person , person2 Person ) bool { return person . Identifier < person2 . Identifier }, true ) In the code snippet above we perform a sort on our collections using the thor engine very easily. we just express our desire about how the sorting needs to be done and wether its ascending or descending. and other functionalities are implemented as below: type Sortable [ T any ] struct { Items [] T less func ( a , b T ) bool desc bool } func ( h Sortable [ T ]) Len () int { return len ( h . Items ) } func ( h Sortable [ T ]) Swap ( i , j int ) { h . Items [ i ], h . Items [ j ] = h . Items [ j ], h . Items [ i ] } func ( h * Sortable [ T ]) Push ( x any ) { h . Items = append ( h . Items , x . ( T )) } func ( h * Sortable [ T ]) Pop () any { old := h . Items n := len ( old ) item := old [ n - 1 ] h . Items = old [ : n - 1 ] return item } be faster and more agile with the Golang ZenQL. Click To Visit ZenQLRepository
AI 资讯
The One TDD Habit That Saved My Sanity (and My Codebase)
The One TDD Habit That Saved My Sanity (and My Codebase) Quick context (why you're writing this) Here's the thing: I used to think I was doing TDD right. I’d write a test, watch it fail, then write just enough code to make it green. Rinse and repeat. Sounds textbook, right? But a few months ago I spent an entire afternoon chasing a bug that only showed up after I refactored a service class. The tests were all passing, yet the app was throwing NullReferenceExceptions in production. I was shocked. How could everything be green and still be broken? Turns out I was testing the inside of my code instead of what it actually did for the outside world. That realization hit me like a truck, and it completely changed how I approach TDD. The Insight Test behavior, not implementation. If your test is coupled to private fields, internal data structures, or the exact way a method accomplishes its goal, you’re not testing what matters—you’re testing how you happen to do it today. When you later refactor to improve performance, swap out a dependency, or even just rename a variable, those tests start failing for no good reason. You end up spending more time fixing tests than delivering value, and you lose confidence in the suite because it feels fragile. The payoff? A test suite that gives you confidence when you change code, not anxiety. You can refactor fearlessly because the tests only care about the contract: given these inputs, the system should produce these outputs or side‑effects . How (with code) Let’s look at a tiny but realistic example: a PasswordValidator service that checks whether a user‑chosen password meets our policy. ❌ The mistake: testing implementation details // PasswordValidator.cs public class PasswordValidator { private readonly IRegexProvider _regex ; // injected for testability public PasswordValidator ( IRegexProvider regex ) { _regex = regex ; } public bool IsValid ( string password ) { // implementation we might want to change later return _regex . IsMa
开发者
Configuration flags are where software goes to rot
submitted by /u/Expurple [link] [留言]
AI 资讯
I Have 7 Years of Experience as a Software Engineer. DSA Still Kicked My Ass.
I build RESTful APIs for a living. I've designed event-driven architectures, set up CI/CD pipelines, containerized applications on Azure, mentored junior developers. 7 years of this. Then I opened LeetCode and stared at a medium problem for 45 minutes and closed the tab. Working as a backend engineer for this long means you just never touch advanced DSA. My day to day is .NET, Azure, SQL, clean architecture. EF Core handles the data layer, Azure handles the scaling. I haven't needed to implement a graph traversal or think about tree balancing since university. So when I decided to start interviewing at bigger companies I figured I just needed a quick refresher. I studied this stuff in college. It would come back. It didn't. 7 years is a long time and most of it was gone. What I Tried I went through the usual options. LeetCode grinding. Jumping into random problems with no structure just kept reminding me how much I'd forgotten without actually helping me relearn any of it. YouTube. Watched hours of Abdul Bari, freeCodeCamp, various bootcamp videos. I'd finish a video convinced I understood it, then open my editor and draw a complete blank. Watching someone solve a problem and solving it yourself are not the same thing at all. Books. CLRS is great if your fundamentals are still intact. Mine weren't. None of these were bad resources. The problem was I kept jumping between them with no thread connecting them. A video here, a problem there, a random chapter somewhere else. After years away from this stuff I needed to go back to basics and build up properly, and nothing was set up for that. What Actually Helped Eventually I just mapped out what a proper learning order looked like and started going through it myself. Big O → Arrays → HashMaps → Linked Lists → Stacks & Queues → Recursion → Trees → Graphs → Dynamic Programming For me, order mattered. Going back to Big O first made Arrays click properly. Arrays made HashMaps make sense again. I couldn't get Trees to stick un
开发者
JPEG compression deep dive
submitted by /u/fagnerbrack [link] [留言]
开发者
Doom on ONNX
submitted by /u/mariuz [link] [留言]
开发者
Using local ClickHouse for data processing
submitted by /u/f311a [link] [留言]
开发者
You Don't Love systemd Timers Enough
submitted by /u/f311a [link] [留言]
开发者
My Software North Star
submitted by /u/f311a [link] [留言]
开发者
A faster bump allocator for rust
submitted by /u/Successful_Bowl2564 [link] [留言]