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

标签:#programming

找到 1386 篇相关文章

AI 资讯

Privacy by Design in Your API: How to Collect Less Data Without Breaking UX

When developers think about privacy, they often think about legal compliance, consent banners, or policy pages. But privacy starts much earlier than that, at the API layer. Every time your backend asks for a phone number, date of birth, location, or optional profile field, you are making a design decision. If you collect too much data by default, you increase risk, reduce trust, and make your system harder to maintain. The good news is that privacy by design does not have to make your product worse. In many cases, it makes your API cleaner, safer, and easier to reason about. Why collecting less data matters The more data you collect, the more you have to protect. That means more storage, more access control, more breach risk, more compliance burden, and more user distrust if something goes wrong. A developer friendly privacy approach is simple: Only collect what you need to deliver value. Bad pattern: collecting everything up front user_profile = { " name " : " Amina " , " email " : " amina@example.com " , " phone " : " 07000000000 " , " dob " : " 1995-01-01 " , " address " : " 123 Main Street " , " location " : " Lagos " , " gender " : " female " } This kind of structure is common in early stage products. The thinking is usually: let us ask for everything now, just in case we need it later. But just in case is not a good privacy strategy. Better pattern: collect only what is required def build_profile ( name , email , phone = None ): profile = { " name " : name , " email " : email } if phone is not None : profile [ " phone " ] = phone return profile user_profile = build_profile ( " Amina " , " amina@example.com " ) print ( user_profile ) This is small, but the principle matters. Optional data should stay optional unless it is truly needed. Use explicit field validation Instead of accepting a giant payload and filtering it later, validate the exact fields you expect. ALLOWED_FIELDS = { " name " , " email " , " phone " } def sanitize_payload ( payload ): return { k :

2026-06-09 原文 →
开发者

I analyzed 26 major open source repositories. Every one had at least one bus-factor-1 module

I built a CLI called git-archaeologist to analyze ownership concentration, bus factor, coupling, and change history from git repositories. To validate it, I benchmarked 26 major open source projects including Kubernetes, React, VS Code, TensorFlow, PostgreSQL, Spring Boot, and Node.js. The report includes methodology, limitations, repository snapshots, raw JSON outputs, and benchmark data. Happy to hear where the methodology is wrong or what could be improved. submitted by /u/Some_Scientist5385 [link] [留言]

2026-06-09 原文 →
AI 资讯

Lawyers, Marketers, Product Managers—Xiaomi's Breakthrough Agent Product SoloEngine: Everyone Is a Creator

On June 3, Xiaomi released the latest version of its open-source project, SoloEngine . The first low-code Agentic AI development platform. At the AIGC2026 Summit, Amazon Web Services disclosed a striking statistic: 87% of enterprises claim to have deployed AI, but only 10% have actually extracted real value from it. The current agent industry chain shows a curious pattern—hot at both ends, hollow in the middle. Upstream foundation models and chips attract capital; downstream use-case demand is robust; but the midstream lacks an engineering platform capable of converting domain expertise into reliable agents. The reasons behind this gap are concrete. Building an AI Agent currently comes down to two approaches. One is low-code workflow platforms: Dify and n8n offer visual canvases where users drag and drop nodes to quickly assemble AI applications. But workflows rely on preset paths—step A leads to step B, step B leads to step C, with if/else conditions controlling branches. Hit something outside the preset, and the flow breaks. At best, they function as AI-powered macro scripts. The other is code-based development frameworks: LangChain and CrewAI support genuine Agentic AI architectures where agents can make autonomous decisions and dynamically adjust strategies. But this requires Python programming skills. A lawyer has to learn Python just to build a legal Agent; a CMO has to configure a CrewAI environment just to set up a marketing Agent team. Low-code platforms don't support true autonomous decision-making. Code frameworks are only accessible to programmers. SoloEngine fills precisely this gap. I. SoloEngine: Making Everyone a Creator Open a browser. Drag Agents onto a canvas. Connect collaboration relationships. Configure the tools you need. Hit run. The backend automatically compiles your design into an executable Agentic AI system—one that plans tasks, executes operations, and delivers results. Users just review and confirm, and the work gets done. No lines of

2026-06-09 原文 →
AI 资讯

Cx Dev Log — 2026-05-25

The interpreter's variable lookup is now blazing through arithmetic loops at a 57% faster pace. But this isn't just about raw speed — four tracker items were checked off the list, culminating in a more robust system. All rolled out on submain, a direct result of a thorough four-pillar audit. BindingId replaces string hashing at runtime The heavyweight change came from tracker #009. Previously, our interpreter was busy hashing variable names every time they were accessed. That was a repeat offender in wasted cycles. Now, by using a pre-assigned numeric BindingId, we seize efficiency. The semantic phase was already handing out these IDs, but the runtime kept adding the overhead back. It doesn’t anymore. ScopeFrame.vars has transitioned to a HashMap equipped with a zero-cost identity hasher keyed by u32 binding IDs. Name-based lookups are still around but tucked away for less frequent operations like string interpolation. Fixes were necessary upstream: ConstDecl and semantic_impls now hold onto their BindingId, making sure our semantic phase pipelines gracefully into the interpreter's primary key system — narrowing the gap with JIT's variable handling. Here's how the numbers shine on a Windows release build: arith_loop (5M iterations): from 5744ms down to 2481ms (56.8% boost) nested_loops (4M iterations): from 2675ms down to 1796ms (32.8% boost) fib_recursive: from 6835ms down to 6488ms (merely 5.1% faster due to call-frame constraints) Our findings align with expectations: recursive functions aren't bogged down by variable lookups as much as by setting up call frames. Array bounds errors stop lying Misleading diagnostic labels are on their way out, thanks to tracker #002 and #032. Attempts to access out-of-bounds array indices once triggered an error as unhelpful as variable 'index 5' has not been declared . Not anymore. Changes came in two waves. First, we introduced a new error variant: RuntimeError::IndexOutOfBounds { pos, index, length } . Then, three runtime.rs c

2026-06-09 原文 →
AI 资讯

How I stopped hardcoding business rules in PHP - and built a rule engine to fix it

Every PHP developer knows this situation: a client calls and says "I want free shipping for VIP customers on weekends, but only if the cart total is above €100." You open your code. You find the shipping module. You add an if. You deploy. Three weeks later: "Actually, make it €80. And also for the 'Premium' group." You open your code again. This loop : client request -> find logic in code -> modify -> deploy, was costing me a lot of time. And it's not just shipping. I build custom ecommerce solutions: payment modules, synchronization systems, pricing calculators. Business rules are everywhere, and they change constantly. The obvious solution I didn't want Symfony's ExpressionLanguage exists and it's impressive. But it pulls in dependencies, it can traverse objects and call methods (which is a security concern when rules are authored by users), and when something goes wrong, it doesn't tell you why. It's a black box. I needed something smaller, stricter, and transparent. So I built php-ruler I started with the classic pipeline: Lexer → AST → Evaluator. Strict typing from the start — 1 = '1' is a type error, not true. No silent coercion. Then I added features one real problem at a time. Problem: when something fails, why? -> I built an explain mode that returns the full evaluation tree: which sub-conditions passed, which failed, which were short-circuited, and why a variable was missing. Problem: in production, the context is sometimes incomplete -> I built a safe mode that doesn't throw on missing variables — it collects them all and lets you decide what to do. Problem: customer.group.name is not user-friendly -> I built an alias resolver. As a developer, I expose what I want: $resolver = ( new AliasResolver ()) -> add ( 'customer.group' , 'customer group' ) -> add ( 'cart.total' , 'cart amount' ); Now a non-developer can write: customer group = 'VIP' AND cart amount > 100 And I control exactly what variables are available to them. A real example Here's the shipping

2026-06-09 原文 →
AI 资讯

Looking for a project buddy to build something cool together 🇮🇳

Hey everyone! I'm Manan from Chandigarh, India, and I'm looking for a project buddy to build something exciting together. A bit about me: I'm a full stack developer who enjoys building web apps, AI-powered products, and experimenting with new ideas. Most of my free time goes into coding, learning, and shipping projects that solve real problems. I'm also a Project Admin at GSSoC, where I've open-sourced my own project, DBPortal, for contributors to work on and improve: github.com/Mananwebdev160408/dbportal I love collaborating with people and thought it'd be fun to find someone who's equally passionate about building things. I don't have a fixed idea in mind, so we could brainstorm and work on anything from an AI tool to a SaaS product, an open source project, a developer utility, or something completely unique. I'd prefer someone from India since coordinating is easier, but developers from anywhere are welcome. I can communicate in English and Hindi. I'm mainly looking for someone who's excited to build, exchange ideas, stay consistent, and enjoy the process. It'd be great to have a teammate to learn with, push each other, and hopefully create something really cool together. If this sounds like your kind of thing, feel free to DM me or drop a comment. Even if you already have a project idea you've been thinking about, I'd love to hear it. Looking forward to meeting some awesome devs! 🚀 portfolio: devmanan.vercel.app github: github.com/Mananwebdev160408 submitted by /u/Suspicious-Salt4505 [link] [留言]

2026-06-09 原文 →
开发者

Learning about Truthy and Falsy Values in JavaScript

In JavaScript, truthy and falsy values are concepts related to boolean evaluation. Every value in JavaScript has an inherent boolean "truthiness" or "falsiness," which means they can be implicitly evaluated to true or false in boolean contexts, such as in conditional statements or logical operations. What Are Truthy Values? Truthy values are values that are evaluated to be true when used in a Boolean context. Simply put, any value that is not explicitly falsy is considered truthy. These are some truthy values Non-zero numbers: 42, -1, 3.14 Non-empty strings: "hello", "0", " " Objects and arrays: {}, [] Functions: function() {} Dates: new Date() Symbols: Symbol() BigInt values other than 0n: 10n if ( 42 ) console . log ( " This is truthy! " ); if ( " hello " ) console . log ( " Non-empty strings are truthy! " ); if ({}) console . log ( " Objects are truthy! " ); Output This is truthy ! Non - empty strings are truthy ! Objects are truthy ! What Are Falsy Values? Falsy values are values that evaluate to false when used in a Boolean. JavaScript has a fixed list of falsy values false 0 (and -0) 0n (BigInt zero) "" (empty string) null undefined NaN document.all (used for backward compatibility) if (0) console.log("This won't run because 0 is falsy."); if ("") console.log("This won't run because an empty string is falsy."); if (null) console.log("This won't run because null is falsy."); Truthy vs. Falsy Evaluation in JavaScript Whenever JavaScript evaluates an expression in a Boolean (e.g., in an if statement, a logical operator, or a loop condition), it implicitly converts the value into true or false based on whether it is truthy or falsy. With if Statement let s = " JavaScript " ; ​ if ( s ) { console . log ( " Truthy! " ); } else { console . log ( " Falsy! " ); } Output Truthy ! Logical Operators with Truthy and Falsy Logical operators like && (AND) and || (OR) work with truthy and falsy values && (AND): Returns the first falsy operand or the last operand if all are tr

2026-06-09 原文 →
开发者

Conditional Statements in JavaScript

JAVASCRIPT CONDITIONAL STATEMENTS JavaScript conditional statements are used to make decisions in a program based on given conditions. They control the flow of execution by running different code blocks depending on whether a condition is true or false. Conditions are evaluated using comparison and logical operators. They help in building dynamic and interactive applications by responding to different inputs. Types of Conditional Statements 1. if Statement The if statement checks a condition written inside parentheses. If the condition evaluates to true, the code inside {} is executed; otherwise, it is skipped. Executes code only when a specified condition is true. Useful for making simple decisions in a program. Syntax : if ( condition ) { // code runs if condition is true } let x = 20 ; ​ if ( x % 2 === 0 ) { console . log ( " Even " ); } ​ if ( x % 2 !== 0 ) { console . log ( " Odd " ); }; Output Even 2. if-else Statement The if-else statement executes one block of code if a condition is true and another block if it is false. It ensures that exactly one of the two code blocks runs. Used when there are two possible outcomes. The else block runs when the if condition is not satisfied. let age = 25 ; ​ if ( age >= 18 ) { console . log ( " Adult " ) } else { console . log ( " Not an Adult " ) }; Output Adult 3. else if Statement The else if statement is used to test multiple conditions in sequence. It executes the first block whose condition evaluates to true. Allows checking more than two conditions. Evaluated from top to bottom until a true condition is found. const x = 0 ; ​ if ( x > 0 ) { console . log ( " Positive. " ); } else if ( x < 0 ) { console . log ( " Negative. " ); } else { console . log ( " Zero. " ); }; Output Zero . 4. Using Switch Statement (JavaScript Switch Case) The switch statement evaluates an expression and executes the matching case block based on its value. It provides a clean and readable way to handle multiple conditions for a single varia

2026-06-09 原文 →
AI 资讯

The Top Golang Mocking Libraries in 2026: A Practical Comparison

Hello, I'm Shrijith Venkatramana. I'm building git-lrc, an AI code reviewer that runs on every commit. Star Us to help devs discover the project. Do give it a try and share your feedback for improving the product. A few years ago, choosing a Go mocking framework was mostly a matter of personal preference. Today, things are different. Most Go developers have at least one AI coding assistant generating tests alongside them. Some teams even generate the majority of their unit tests automatically. Yet one area remains surprisingly messy: mocks. Ask an LLM to write a test for the same interface and you'll often get completely different results depending on whether your project uses GoMock, Mockery, MockIO, Minimock, Moq, or hand-written test doubles. The problem isn't that the models are bad. The problem is that mocking libraries represent very different philosophies: Strict vs flexible Generated vs runtime-created DSL-heavy vs idiomatic Go Feature-rich vs minimalist In this article we'll compare the most popular Go mocking libraries in 2026, examine their strengths and weaknesses, and discuss which one may be the best fit for your project. What Makes a Good Mocking Library? Before comparing tools, it's worth defining what matters. A good mocking library should ideally provide: Easy mock generation Clear test failures Minimal boilerplate Strong refactoring support Good IDE experience Readable tests Reliable call verification Different libraries optimize for different parts of this list. That's why there is no universally correct answer. 1. GoMock: The Enterprise Workhorse GoMock remains one of the most widely used mocking frameworks in the Go ecosystem. Originally created by Google and now actively maintained by Uber, it has become the standard choice for many large organizations. Its philosophy is straightforward: define expectations explicitly and verify them rigorously. Example func TestUserService ( t * testing . T ) { ctrl := gomock . NewController ( t ) repo := New

2026-06-09 原文 →
AI 资讯

Why You Underestimate Haiku

Most people pick a model the wrong way around. They look at the leaderboard, see Opus on top, and reach for it by default. Sonnet if they want to save money. Haiku almost never, because the name says "small." That habit costs you. For a lot of what you actually build, Haiku is the right call, and you're paying three to five times more for capability the task never uses. This post is about how to choose, and why Haiku should be your default more often than it is. The short version: don't start from "what's the best model." Start from "what does this task need." Most tasks don't need much. Comparison Here is the current lineup, with the numbers that matter when you're choosing. Haiku 4.5 Sonnet 4.6 Opus 4.8 Model ID claude-haiku-4-5 claude-sonnet-4-6 claude-opus-4-8 Input price (per 1M tokens) $1 $3 $5 Output price (per 1M tokens) $5 $15 $25 Context window 200K 1M 1M Max output 64K 64K 128K Best at speed, volume balance hardest reasoning Two things jump out. First, price . Haiku input is a fifth of Opus and a third of Sonnet. Output is the same ratio. If you send a million tokens through Opus for $25 and the same work would have been fine on Haiku, you spent $20 for nothing. And that gap is per request, so it compounds. A feature that runs ten thousand times a day on Opus instead of Haiku is not a rounding error. It is the difference between a feature that ships and one that gets cut for cost. Second, the context window . This is where Haiku gives something up: 200K tokens instead of 1M. That is the real tradeoff, and it points straight at when to use it. We'll come back to that. The mental model Stop ranking models. Rank tasks . Ask three questions about the task in front of you: Does it need real reasoning, or is it bounded? A task is bounded when a competent junior could do it from a clear spec without much judgment: pull these fields out, sort this into one of five buckets, rewrite this in a different tone, answer this from the text I gave you. A task needs reason

2026-06-09 原文 →
AI 资讯

Making numpy-ts as fast as native

I started working on numpy-ts last year and began serious performance optimization in February. These are some of the challenges and lessons from this project. Some/all might be obvious - lmk what you think! Disclaimer: numpy-ts was written with some AI assistance. Please read my AI disclosure for more details. submitted by /u/dupontcyborg [link] [留言]

2026-06-09 原文 →
AI 资讯

Storing cryptographic hashes on the blockchain for dataset integrity

This article covers a technique my team and I use to work on versioned datasets across organizations (team A works on features, team B) works on other features. It's been invaluable for us since we don't have a shared infrastructure, so we can always verify the latest version by storing the latest hash on-chain. It could be useful in other ways where integrity or immutability is paramount, like versions of models, model weights, etc. No need to share access to a central key management server and everyone can validate it simply. submitted by /u/Nice-Dragonfly-4823 [link] [留言]

2026-06-09 原文 →