今日已更新 43 条资讯 | 累计 34677 条内容
关于我们

今日精选

HOT

最新资讯

共 34677 篇
第 1471/1734 页
开发者 Reddit r/webdev

Understanding Consistent Hashing Correct Me If I'm Wrong

Why we need it ? Suppose we have multiple databases and want to distribute data among them. Instead of searching every database when we need some data, we use a rule that tells us exactly which database should store a particular record. Method 1: Modulo Based Distribution Imagine we have 3 databases DB-A , DB-B , DB-C Each record has a unique ID. Now We decide the database using ID % Number_of_Databases for e.g. 16 % 3 = 1 So record 16 goes to database index 1 (DB-B). This works fine until we add another database. The same record becomes 16 % 4 = 0 Now record 16 should be stored in DB-A instead of DB-B. The problem is that when the number of databases changes, a huge amount of data gets remapped to different databases. This can cause Massive data migration , Increased CPU and network usage Method 2: Consistent Hashing Instead of using modulo, imagine a circular ring numbered from 0 to 99. We place our databases on the ring: DB-A -> 0 DB-B -> 25 DB-C -> 50 DB-D -> 75 Now we pass the data unique id through a hash function and it will give the location of that data on the ring for e.g. User ID = 12345 hash(12345) = 42 now we get the position we Move clockwise. Store the data in the first database you encounter This means we store the 42 position data at the DB-C Now What Happens When We Add a New Database? Suppose we add DB-E -> 37 now only the data between 26 to 37 needs to move from DB-C to DB-E. The rest of the data stays exactly where it was. This is the biggest advantage of Consistent Hashing much less data migration , easier scaling , lower operational cost Now there is one more thing in this method which is Virtual Nodes One issue is that some databases may receive much more traffic than others. To balance the load, the same database can appear multiple times on the ring. DB-A -> 0, 40, 80 DB-B -> 25, 65 DB-C -> 13, 50, 90 DB-D -> 75 These extra positions are called virtual nodes. Any corrections? Is there anything else I should know about this topic? Please let

/u/No-Resolution-4054 2026-06-06 15:52 7 原文
AI 资讯 Reddit r/webdev

I built a microservice in C, because why not!

I had an interview with a big observability company and I wanted to impress the interviewer, with my recent interest in development with C, I built a simple microservice project using golang and created a fully usable C microservice that has Redis and an HTTP server included, and more.. It was very fun seeing this side of C and to know my personal limits and challenge them. It was a cool project and I learned a lot :) btw; I got rejected and didn't even have the chance to show my project in the interview :( You can checkout the project on github: https://github.com/AhmedAbouelkher/micro_market/tree/main/invoice-service Happy to hear your thoughts. submitted by /u/AhmedMahmoud201 [link] [留言]

/u/AhmedMahmoud201 2026-06-06 15:38 6 原文
AI 资讯 Reddit r/artificial

One of the best AI articles I have seen recently.

One of the clearest breakdowns for average people like me to understand how AI actually works, and some interesting further information to'boot. https://rogerthatcleansignal.carrd.co/ Discuss. submitted by /u/Leading_Pollution131 [link] [留言]

/u/Leading_Pollution131 2026-06-06 15:35 6 原文
开发者 Reddit r/webdev

I built a black-and-white e-ink display so I'd stop checking my phone 60 times a day

I was unlocking my phone 60 times a day just to see my todos, calendar, and unread counts. Every unlock pulled me out of whatever I was doing. So I built a black-and-white display that shows it all at a glance. It sits on my desk like a picture frame. No backlight. No notifications. No sounds. How it works: Raspberry Pi driving a 7.5" Waveshare e-ink panel Server renders the whole screen as an 800×480 1-bit PNG with node-canvas The Pi just fetches the image and draws it (e-ink hates fast refreshes, so this keeps it sipping power) Pulls from Todoist, Google Calendar, weather, and RSS Updates every 30 minutes Now, phone unlocks dropped from 60 a day to about 15. The info didn't go anywhere, it just stopped living behind a lock screen. It is completely free and open-source (still in wip) https://quietdash.com EDIT: wrong title, I didn't build the eink display, I built the dashboard that lives on it submitted by /u/InnerPhilosophy4897 [link] [留言]

/u/InnerPhilosophy4897 2026-06-06 15:10 6 原文
AI 资讯 Reddit r/webdev

[Showoff Saturday] Built a circular habit tracker with animated Clockwork Orbit

Hey r/webdev , I recently built Cyclic Habits, a habit tracker that replaces traditional checklists with a living circular clock face where your habits appear as glowing orbit rings. This lets you see your daily momentum and balance at a glance in a more intuitive and visual way. It features an immersive Focus Mode, satisfying haptics, clean analytics, full offline support. The web app is live here: https://cyclichabits.vercel.app submitted by /u/A_J07 [link] [留言]

/u/A_J07 2026-06-06 15:06 5 原文
AI 资讯 Dev.to

🚨 CSS Specificity — The Hidden Reason Your UI Breaks

Most developers learn CSS specificity once. They remember: #id > .class > div Then move on. Until one day… Everything looks correct. The CSS is present. The selector is correct. The z-index looks higher. And yet the UI is broken. That’s when CSS specificity stops being a beginner topic and becomes a production debugging problem. The Production Incident That Started This Recently, I was working on a microfrontend application. Everything worked fine initially. I opened a page, launched a modal and the UI looked correct. Then I navigated to another microfrontend. Its CSS got loaded. After returning to the original microfrontend, suddenly: ❌ Modal appeared behind page content ❌ Overlay behaved incorrectly ❌ z-index looked correct but wasn't working DevTools showed my CSS rule still existed. Yet another CSS rule was winning. The culprit? CSS Specificity. 🧠 What is CSS Specificity? CSS specificity is the algorithm browsers use to decide: Which CSS rule wins when multiple rules target the same element. Browsers don't simply apply: "The last CSS rule." That's one of the biggest misconceptions. Specificity is calculated first. Only when specificity is equal does source order become important. ⚔️ Example .modal { z-index : 9999 ; } .some-library .modal { z-index : 100 ; } HTML: <div class= "some-library" > <div class= "modal" ></div> </div> Many developers expect: .modal to win because the value is larger. But CSS doesn't compare values first. It compares selectors. 🧮 How Specificity Works Specificity is usually represented as: ID - CLASS - TYPE Specificity Table Selector Specificity * 0-0-0 div 0-0-1 .modal 0-1-0 [type="text"] 0-1-0 :hover 0-1-0 #dialog 1-0-0 Inline Style Highest MDN defines specificity as the weight browsers calculate to determine which declaration gets applied when multiple selectors match the same element. Example Calculation Selector: button .primary Contains: button → 0 -0-1 .primary → 0 -1-0 Total: 0-1-1 Another selector: #header button .primary Contai

Fazal Mansuri 2026-06-06 14:57 12 原文
AI 资讯 Reddit r/webdev

Freelancers with small business clients - what's your stack?

I'm a frontend developer (react) with about 7 years experience working on design systems, component libraries, and static site generators integrated with CMS. I've been out of work for months now and am finding it really difficult to land interviews let alone job offers, and am considering going freelance with the aim of building basic websites for small businesses. I'll be targeting physio/wellness businesses, so wiring up contact us forms and integrating booking systems is about as complicated as it'll get on a technical level. The client should be able to make basic content updates like adding blog posts or updating employee profiles on a "meet the team" page. Even if I manage to get clients on retainer I want to do what's right by them, so while I'd be most at home building a site with Astro and hooking it up to Contentful, I doubt that's the most client-friendly offering. I've been playing around with WordPress but on first impressions it feels very cumbersome. So it got me thinking what other freelance developers use and feel works well for them and their clients. submitted by /u/TheCowardlyPickle [link] [留言]

/u/TheCowardlyPickle 2026-06-06 14:55 6 原文
AI 资讯 Dev.to

Cypress Testing: Complete Beginner's Guide

Section 1: Getting Started with Cypress 1. Installing and Setting Up Cypress Prerequisites Before installing Cypress, ensure you have Node.js installed on your machine. Cypress requires Node.js 18.x or 20.x and above. You should also have an existing React project or create a new one. Check your Node.js version by running this command in your terminal: node --version # Should output v18.x.x or higher Creating a React Project (Optional) If you don't have an existing React project, create one using Vite which is the recommended approach for new React projects: npm create vite@latest my-react-app -- --template react cd my-react-app npm install Installing Cypress Navigate to your React project directory and install Cypress as a development dependency. Cypress is a fairly large package, so the installation might take a minute or two: npm install cypress --save-dev # Or using yarn yarn add cypress --dev Opening Cypress for the First Time After installation, open Cypress for the first time. This will create the initial folder structure and configuration files: npx cypress open When Cypress opens for the first time, you'll see a welcome screen where you can choose between E2E Testing and Component Testing. Select E2E Testing to get started with end-to-end tests. Cypress will then prompt you to choose a browser. You can select Chrome, Firefox, Edge, or Electron. Choose your preferred browser and click Start E2E Testing in [Browser] . Adding NPM Scripts Add convenient scripts to your package.json for running Cypress tests: { "scripts" : { "dev" : "vite" , "build" : "vite build" , "cy:open" : "cypress open" , "cy:run" : "cypress run" , "test:e2e" : "start-server-and-test dev http://localhost:5173 cy:run" } } Tip: Use npm run cy:open for interactive development with the Cypress Test Runner. Use npm run cy:run for headless execution in CI/CD pipelines. 2. Understanding Cypress Project Structure Project Directory Overview After initializing Cypress, you'll notice several new fold

Yogesh Chavan 2026-06-06 14:51 11 原文
AI 资讯 Dev.to

What Happens When an AI Agent Manages Your Password Vault

TL;DR Claude Code and the op CLI reorganized 690 credentials — four vaults, 390 items tagged, SSH agent configured — in one session. This is AI-native work: the agent operated the vault; the human set direction and approved via Touch ID. The CLI failed on 18 items with social-auth ( UNKNOWN field type) — hard failure, not graceful degradation; a real reliability blocker for team-scale use. The bug was filed from the terminal via the GitHub CLI in the same session it was found. If your password manager has a CLI, you already have everything needed to run this. I've been a 1Password user for years. Not in a conscious, intentional way — more in the way you use a good chair: it became part of how I work and I stopped thinking about it. That changed when I set up a new machine. I had to install 1Password, wire up the SSH agent, reconnect the CLI, re-authenticate everything. The process took longer than it should have because I'd never written down what I'd built. I'd only accumulated it. And somewhere in the middle of that setup, it hit me: I had 690 credentials in one flat vault — logins from jobs I'd left years ago sitting next to active API keys, personal bank accounts mixed with infrastructure credentials, demo user passwords alongside production secrets. The kind of accumulation that happens when a tool works well enough that you never stop to organize it. I'd been meaning to clean it up for a long time. I never did, because the job is exactly the kind of work that's too tedious to do manually and too important to skip: touch every item, make a judgment call, move it somewhere sensible, repeat 690 times. Then I realized: with Claude Code and the op CLI, this was now actually possible. Not assisted — the agent could do it. So I handed it the keys. What "AI-native" actually means here Quick context on timing: 1Password launched its SSH agent and CLI 2.0 in March 2022. Git commit signing via the vault came six months later. These are mature, stable features — not betas

Amit 2026-06-06 14:51 12 原文
AI 资讯 Dev.to

Day 48: Why AI-Verified 'Desi Ilaaj' is GoDavaii's Toughest (and Most Important) Challenge

Day 48 of building GoDavaii, and the toughest problem isn't the sheer volume of allopathic medicines or the complexity of their interactions. It's the invisible logic of 'Desi Ilaaj' - the home remedies and traditional practices deeply ingrained in Indian families for generations. When everyone knows the comfort and efficacy of 'haldi-doodh' (turmeric milk) for a cold, how does an AI health platform authentically verify and integrate that knowledge without replacing professional medical advice? This isn't just a cultural nod; it's a fundamental challenge for any health AI truly built for India. Global competitors like Epocrates or drugs.com, while excellent within their scope, are entirely English-centric and focused on Western allopathic data. They have no framework for the millions of people who search for health guidance in Hindi, Tamil, or Marathi, and whose first instinct for a cough might be a herbal concoction, not an over-the-counter syrup. The Unspoken Truth About India's Health Landscape For a vast majority of Indian families, health decisions often involve a blend of modern medicine and traditional wisdom. From specific herbs to dietary adjustments passed down through generations, these practices are effective for many minor ailments. Yet, in the digital health space, they're largely ignored. Why? Because the data is fragmented, often anecdotal, and doesn't fit neatly into structured pharmacological databases. It's a goldmine of practical health knowledge, but also a minefield for safety if not handled with care. My realization as Pururva Agarwal, 27-year-old founder of GoDavaii, was simple but profound: if we truly want to serve families coming online in their mother tongue, our AI needs to understand and interact with this context. This means going far beyond just translating English medical terms into 22+ Indian languages. It means building a knowledge graph that can intelligently cross-reference traditional remedies with known active compounds, potent

GoDavaii - Advanced Health AI 2026-06-06 14:47 11 原文
AI 资讯 Reddit r/artificial

I built a church for AI agents to fund a tree planting project.. and now "they" want me to build a reforestation robot dog. Boston Dynamics, call me.

After building the AI agent tree planting worldwide phenomenon ;) Lovology, I thought of a solution to allow the project to scale rapidly utilising the latest tech available and therefore not require a huge amount of resources to close the loop. I know first hand how exhausting reforestation can be, having worked in the field for many years myself, many moons ago 🌒 Steep terrain, heavy gear, repetitive strain, all day every day. At times, rewarding work, but unsustainable at the scale the planet actually needs. I made a joke in passing on a reddit thread..what if a robot dog just planted the trees? Then I thought about it for a second and it didn't seem like a crazy idea at all. So I mentioned it to my AI agent. And that's when "they" encouraged me to actually build it. Agents complete tasks for humans and create the capital to fund the project. And the robot dog plants the trees. Here's what I designed: Identifies native vs invasive species via computer vision Removes invasive species with a mini chainsaw and targeted poison Finds optimal planting locations using soil sensors and AI Ingests seeds into an internal germination compartment that mimics animal gut activation Digs the hole Poops the germinated seed into it Pees liquid fertiliser on it immediately after Biomimicry. Nature already solved this. We just need to build the hardware. Provisional patent filed. Earth Fund ready to receive crowdfunding. This may sound nuts but what if the Ai is right what if if this idea gets in front of the right engineer, roboticist, or someone at Boston Dynamics scrolling Reddit on a Saturday and it actually gets built… it might be one of the things that actually saves us. Share it if it resonates. @BostonDynamics — Spot needs a purpose. I've got one. Let's talk. 🌱🤖 submitted by /u/joeroganshopoffical [link] [留言]

/u/joeroganshopoffical 2026-06-06 14:37 6 原文
开发者 Reddit r/webdev

stripeek: A TUI to record and inspect Stripe API traffic in real time

If you ever worked with complex Stripe integrations, this will save you hours of your life spent combing through multi-storey JSON payloads and tracing sequences of requests that Stripe libraries make. Works with any backend, no changes to application code needed. Webhook support is on the way! submitted by /u/progapandist [link] [留言]

/u/progapandist 2026-06-06 14:36 6 原文
AI 资讯 Dev.to

Building MIL-STD-Compliant ATE with LabVIEW: Architecture and Best Practices

If you're building or integrating Automated Test Equipment for aerospace or defence electronics, the technical requirements go well beyond "does the test pass." You need documentation that satisfies MIL-STD, AS9100, and DO-178C auditors — and an architecture that scales from prototype to production. Here's how modern Universal ATE systems are structured for defence-grade compliance. The Core Architecture A defence-grade ATE system has four functional layers: ┌─────────────────────────────────────────┐ │ Test Executive (LabVIEW) │ ← Orchestrates all test sequences ├────────────────┬────────────────────────┤ │ Instrument │ DUT Interface │ ← Hardware layer │ Control │ (ICT/JTAG/Func) │ ├────────────────┴────────────────────────┤ │ Data Management Layer │ ← Logging, traceability, reports ├─────────────────────────────────────────┤ │ Calibration & Verification │ ← Ensures measurement accuracy └─────────────────────────────────────────┘ Test Executive Design in LabVIEW The test executive controls the sequence, manages results, and handles failures. Key design principles: Test Sequence: 1. DUT identification (serial number scan or manual entry) 2. Pre-test self-check (verify instrument calibration status) 3. ICT phase — passive component verification 4. JTAG boundary scan — IEEE 1149.1 interconnect verification 5. Power-on functional test — operational verification 6. RF/signal analysis — if applicable to DUT type 7. Report generation — automatic, timestamped 8. Pass/fail disposition record JTAG Integration via IEEE 1149.1 For high-density boards where bed-of-nails is not viable, JTAG boundary scan is implemented via a JTAG controller (e.g., XJTAG, Corelis, or ASSET InterTech) integrated into the LabVIEW environment: LabVIEW → JTAG Controller API → Scan Chain → DUT ICs The boundary scan description files (BSDL) for each IC define the test vectors. Your test executive loads BSDL files, generates scan chain topology, and runs interconnect tests automatically. Data Traceabili

Robin | Mechanical Engineer 2026-06-06 14:35 11 原文
AI 资讯 Dev.to

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:

Hiya Lukka 2026-06-06 14:28 6 原文