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

标签:#programming

找到 1367 篇相关文章

产品设计

How 4 bytes of padding make array clearing 49% faster

I wrote about interesting amd64-specific quirk. If a large array is 4-byte misaligned, making it 8-byte aligned can make the array clearing ~49% faster (at least on my Intel machine). In the post I also touch on Intel's REP STOSQ implementation, ERMS and also on other optimizations related to array clearing. submitted by /u/watman12 [link] [留言]

2026-06-22 原文 →
AI 资讯

Understanding the Software Development Process: A Complete Guide from Concept to Deployment

Software has become the backbone of modern business operations, powering everything from customer-facing applications and e-commerce platforms to enterprise systems and cloud-based services. Behind every successful software product is a well-structured development process designed to ensure quality, scalability, security, and long-term maintainability. The Software Development Process, commonly referred to as the Software Development Life Cycle (SDLC), provides a systematic framework for transforming ideas into reliable software solutions. By following a defined methodology, organizations can reduce risks, optimize resources, improve collaboration, and deliver products that align with business objectives. This article explores the key stages of the software development process and highlights why each phase is essential to successful project delivery. What Is the Software Development Process? The software development process is a structured sequence of activities involved in designing, building, testing, deploying, and maintaining software applications. It serves as a roadmap that guides development teams from initial requirements gathering to ongoing support after deployment. A well-defined development process helps organizations: Improve project predictability and delivery timelines Reduce development and maintenance costs Enhance software quality and reliability Strengthen security and compliance Increase customer satisfaction Facilitate collaboration across teams Whether developing a small business application or a large-scale enterprise platform, a structured process is critical for achieving sustainable success. _ Phase 1: Requirements Gathering and Analysis_ Every successful software project begins with a clear understanding of business needs and user expectations. During this phase, stakeholders, business analysts, project managers, and development teams collaborate to identify: Business objectives Functional requirements Non-functional requirements User expe

2026-06-22 原文 →
产品设计

io_uring Feels Illegal

A visual walkthrough of how io_uring works: shared rings, SQEs/CQEs, batching, SQPOLL, multishot operations, linked operations, fixed/provided buffers, and the tradeoffs that come with exposing such a powerful linux kernel interface. submitted by /u/Ok_Marionberry8922 [link] [留言]

2026-06-22 原文 →
AI 资讯

[Rust Guide] 13.5. Iterators - Definitions, the Iterator Trait, and the Next Method

13.5.0 Before We Begin During its design, Rust drew inspiration from many languages, and functional programming had a particularly strong influence on Rust. Functional programming often includes passing functions as values to parameters, returning them from other functions, assigning them to variables for later execution, and so on. In this chapter, we will discuss some Rust features that are similar to what many languages call functional features: Closures Iterators (this article) Improving the I/O Project with Closures and Iterators Performance of Closures and Iterators If you find this helpful, please like, bookmark, and follow. To keep learning along, follow this series. 13.5.1 What Is an Iterator To talk about iterators, we first need to talk about the iterator pattern. The iterator pattern allows you to perform a task on each element in a sequence, one by one. In that process, the iterator is responsible for: Traversing each item Determining when the sequence has finished iterating Rust iterators are lazy: unless you call a method that consumes the iterator, the iterator itself does nothing. In other words, if you write an iterator in your code but never use it, it is as if it did nothing at all. Take a look at an example: fn main () { let v1 = vec! [ 1 , 2 , 3 ]; let v1_iter = v1 .iter (); } v1 is a Vector , and v1.iter() creates an iterator for v1 and assigns it to v1_iter . But v1_iter is not used yet, so the iterator can be considered to have no effect. Now let’s use the iterator to traverse the values: fn main () { let v1 = vec! [ 1 , 2 , 3 ]; let v1_iter = v1 .iter (); for val in v1_iter { println! ( "Got: {}" , val ); } } This is equivalent to using each element in the iterator once in a loop. 13.5.2 The Iterator Trait All iterators implement the Iterator trait. This trait is defined in the standard library and looks roughly like this: pub trait Iterator { type Item ; fn next ( & mut self ) -> Option < Self :: Item > ; // methods with default implementa

2026-06-22 原文 →
AI 资讯

[Rust Guide] 13.4. Capturing the Environment With Closures

13.4.0 Before We Begin During its design, Rust drew inspiration from many languages, and functional programming had a particularly strong influence on Rust. Functional programming often includes passing functions as values to parameters, returning them from other functions, assigning them to variables for later execution, and so on. In this chapter, we will discuss some Rust features that are similar to what many languages call functional features: Closures (this article) Iterators Improving the I/O Project with Closures and Iterators Performance of Closures and Iterators If you find this helpful, please like, bookmark, and follow. To keep learning along, follow this series. 13.4.1 Closures Can Capture Their Environment Closures have a capability that functions do not: a closure can access variables in the scope where it is defined. Take a look at an example: fn main () { let x = 4 ; let equal_to_x = | z | z == x ; let y = 4 ; assert! ( equal_to_x ( y )); } The closure part is: let equal_to_x = | z | z == x ; Some people may find it hard to distinguish the roles of = and == here, so let’s rewrite it another way: let equal_to_x = | z | { z == x ; } In other words, the closure takes z as its parameter, compares it with x (which is 4, because x = 4 was defined above), and returns a boolean. If they are equal, the result is true ; otherwise it is false . Here the closure directly accesses the variable x in the same scope, which functions cannot do. But this feature has a cost: it introduces memory overhead . In most cases we do not need a closure to capture its environment, and we do not want the extra overhead either. That is why functions are not allowed to capture variables from the environment, and defining and using a function never introduces this kind of overhead. 13.4.2 How Closures Capture Values From Their Environment Closures capture values from the environment in three ways, just like functions receive parameters in three ways: Taking ownership, whose trait

2026-06-22 原文 →
AI 资讯

The Invisible Duct Tape of the Internet: Backend Tools You Hear About But Never Fully Get

Hi 👋 fellow devs Sorry for such a big gap since my last article...... Life got a bit hectic, but I am finally back in action! You know how it goes. We spend so much of our energy obsessing over the flashy side of tech. We talk about gorgeous UI designs, smooth animations, and whatever frontend framework is trending on GitHub this week. But let’s be completely real for a second. What actually keeps your favorite apps from melting down when millions of people hit the refresh button at the exact same moment? That is exactly what we are going to unpack today. We are pulling back the curtain on the quiet, brilliant backstage crew of infrastructure tools. You see their logos all over tech Twitter and hear senior engineers drop their names in meetings like secret handshakes, but today, we are stripping away the corporate fluff. We will break down eight legendary backend technologies using conversational paragraphs and quick bullet points so you can finally master what they actually do. Let’s dive right in. 1. Redis Traditional databases live on hard drives. They are fantastic for keeping your data safe and organized permanently, but pulling data off a physical drive takes time. If your application has to wander deep into those database aisles to fetch the exact same piece of information every single second, your entire system starts to stall. To understand how Redis fixes this, imagine you are studying for a brutal exam. Your massive, 1,000-page textbook represents your main database. It holds every single answer, but flipping through the pages continuously is incredibly slow. Redis is the digital equivalent of writing the core formulas you need on a neon sticky note and taping it directly to your monitor. It keeps critical data sitting directly inside the system's lightning-fast short-term memory. You will typically find Redis stepping in to handle operations like: Session Management: Keeping users logged into an application without checking the main database on every cli

2026-06-22 原文 →
AI 资讯

How I Built a Developer Knowledge Base in Obsidian That I Actually Use

Every developer I know has the same problem: knowledge scattered across five places at once. Browser bookmarks they never re-read. Notion docs that become graveyards. Slack threads with critical context that disappear into the archive. README files that contradict each other. Stack Overflow answers bookmarked with zero recall of why. I tried most of the "second brain" setups and none of them stuck until I figured out why they kept failing: generic productivity systems are not built for how developers actually think and work. A developer's knowledge is fundamentally different from a writer's or a manager's. It is: Code-linked (a note about a library is useless without the actual code it explains) Decision-heavy (architecture decisions need context, rationale, and alternatives considered) Debugging-intensive (solutions to bugs need the exact error message, environment, and what you tried) Time-sensitive (that API migration note is only relevant for a 3-month window) Here is the structure that actually worked. The Core Structure 00-Inbox/ 10-Projects/ 20-Areas/ - Language: Python/ - Stack: AWS/ - Domain: Auth/ 30-Resources/ - Libraries/ - Tools/ - Patterns/ 40-Archive/ The key insight: Resources are evergreen, Projects are temporary, Areas are ongoing responsibilities. A note about how JWT works lives in 30-Resources/Domain-Auth/ . A note about implementing JWT for the current sprint lives in 10-Projects/Sprint-42-Auth-Revamp/ . When the sprint is done, the project gets archived. The JWT fundamentals note stays forever. The Templates That Made It Click Architecture Decision Record (ADR) # ADR-042: Use Postgres over DynamoDB for user sessions Status: Accepted | Date: 2026-06-22 ## Context We need session storage that supports complex queries for the audit log feature. ## Decision Postgres with connection pooling via PgBouncer. ## Alternatives Considered - DynamoDB: rejected (query limitations for audit log requirements) - Redis: rejected (not durable enough for complian

2026-06-22 原文 →
AI 资讯

Optimizing Django ORM Queries: A Practical Guide to select_related and prefetch_related

1. Introduction Django's ORM is one of its greatest strengths. It abstracts away raw SQL, lets you express database operations in clean Python, and gets you productive fast. But that convenience comes with a hidden cost: if you're not deliberate about how you fetch related objects, you'll silently generate far more queries than you intend — and you won't notice until your app slows to a crawl in production. The most common culprit is the N+1 query problem : a pattern where fetching a list of N objects triggers an additional query for each one, resulting in N+1 total round-trips to the database. At ten rows it's invisible. At ten thousand rows, it's a disaster. Django provides two tools to fix this: select_related and prefetch_related . This article explains how each one works internally, when to use which, and how to combine them effectively — with before/after examples and real query counts throughout. 2. Understanding the N+1 Problem Consider a simple blog with posts and authors. You want to render a list of posts, showing each post's title and its author's name. Models: # models.py from django.db import models class Author ( models . Model ): name : str = models . CharField ( max_length = 100 ) class Post ( models . Model ): title : " str = models.CharField(max_length=200) " author : Author = models . ForeignKey ( Author , on_delete = models . CASCADE , related_name = " posts " , ) The naive approach: # views.py from django.db import connection from .models import Post def list_posts () -> None : posts = Post . objects . all () # Query 1: fetch all posts for post in posts : print ( f " { post . title } by { post . author . name } " ) # ^^^ Query 2, 3, 4, ... N+1: one per post For 100 posts, this produces 101 queries . Django lazily fetches post.author the first time you access it on each object. Each access hits the database separately. You can verify this with django.db.connection.queries (requires DEBUG = True ): from django.db import connection , reset_queries

2026-06-22 原文 →
AI 资讯

I opened my first PR to LiveKit's agents repo — here's the bug I found

I've been growing my open source portfolio one contribution at a time, and this week I landed on something genuinely interesting in livekit/agents (11k+ stars, the framework behind a ton of real-time voice AI agents). The bug If you're building a voice agent on a realtime model (OpenAI Realtime, xAI, Gemini Live), the model streams your transcription back in chunks. A single utterance can fire many user_input_transcribed events before it's final — token by token for OpenAI/xAI, or as one big interim blob for Gemini. If you want to react exactly once per utterance (say, show a "user is typing" indicator on your frontend via RPC), you need a stable key to correlate all those interim events together. That key already existed internally — InputTranscriptionCompleted carries an item_id . But when the framework re-emitted it upward as the public UserInputTranscribedEvent , the item_id was silently dropped — leaving consumers with no reliable way to dedupe across providers. The fix Small once you see it: add the field, forward it. class UserInputTranscribedEvent ( BaseModel ): transcript : str is_final : bool item_id : str | None = None # new ... def _on_input_audio_transcription_completed ( self , ev : llm . InputTranscriptionCompleted ) -> None : self . _session . _user_input_transcribed ( UserInputTranscribedEvent ( transcript = ev . transcript , is_final = ev . is_final , item_id = ev . item_id ) ) Two files, about 10 lines of real change. The actual work was tracing the event from the realtime model layer, through AgentActivity , up to AgentSession , to find exactly where the field got swallowed. The takeaway I didn't need to understand all of livekit-agents to land this — just one event's lifecycle, end to end. Small, well-scoped issues are the most achievable way into a big codebase, especially when someone's already mapped the territory in the issue itself. PR is up, CI green, waiting on review: github.com/livekit/agents/pull/6172

2026-06-22 原文 →