AI 资讯
Google AI Studio: The Playground Every Developer Should Know About 🎮
Overview Hey everyone 👋 If you've ever wanted to experiment with Gemini models, build AI-powered features, or grab an API key without going through a complex setup, Google AI Studio is the tool you're looking for. It's free, it's browser-based, and it's probably the fastest way to go from "I have an idea" to "I have working code." Today I'll walk you through what it is, what you can actually do with it, and why it belongs in every developer's toolkit. Let's dive in! 🤙 What Is Google AI Studio? 🤔 Google AI Studio is a web-based platform where you can interact with Google's AI models, prototype ideas, fine-tune behavior, and export working code, all without writing a single line of infrastructure. Think of it as a sandbox. You can test prompts, switch between Gemini models, tweak parameters, and when something works, click "Get Code" to get a ready-to-use snippet in Python, JavaScript, or REST. No cloud setup, no billing configuration, no long onboarding. Just go to aistudio.google.com , sign in with your Google account, and you're in. It sits at the intersection of playground and development tool. Researchers use it to experiment. Developers use it to prototype. Teams use it to validate ideas before committing to a full integration. What You Actually Need It For 💡 There are a few scenarios where Google AI Studio becomes indispensable: Getting a Gemini API Key: This is often the first reason developers land on AI Studio. It's the official way to get a Gemini API key for free, which you then use in your own applications, in tools like Gemini CLI, Antigravity, or any custom integration. No credit card required for the free tier. Testing Prompts Before Hardcoding Them: Prompt engineering is trial and error. AI Studio gives you a fast feedback loop where you can iterate on prompts interactively, see the output, adjust, and repeat, before embedding anything in your codebase. Exploring Model Capabilities: Not sure if Gemini can handle your specific use case? Test it directl
AI 资讯
Full-stack RBAC with NestJS Clean Architecture + Next.js FSD
Built a full-stack RBAC admin starter: NestJS (Clean Architecture) + Next.js 16 (FSD). JWT refresh, permission-gated UI, sheet-based CRUD. MIT. Looking for feedback. ⚡ Next.js 16 Admin Dashboard Template Architecture: Strictly adheres to Feature-Sliced Design (FSD) to prevent codebase rot in large applications. Key Features: Full-scale Role-Based Access Control (RBAC) UI, URL-driven advanced tables (TanStack Table v8), global caching (TanStack Query v5), and dynamic sheet-based UX configurations using shadcn/ui and Tailwind v4. Quality Assurance: Pre-configured with Playwright for End-to-End (E2E) testing and automated GitHub Actions CI. 🛡️ NestJS Clean Architecture REST API Architecture: Implements strict layered Clean Architecture (Presentation ➔ Application ➔ Domain 🡨 Infrastructure) ensuring zero database/framework lock-in. Key Features: Advanced authentication via JWT refresh rotation, stateful RBAC with high-performance Redis permissions caching, and enterprise-grade security structures. Quality Assurance: Achieves ~98% test coverage across domain and application layers using Jest.
开发者
Stop Leaking Trace Context: How to Migrate OpenTelemetry to JDK 26 Scoped Values
Stop Leaking Trace Context: How to Migrate OpenTelemetry to JDK 26 Scoped Values If you are still relying on traditional ThreadLocal storage for OpenTelemetry context propagation under JDK 26's virtual threads, you are sitting on a production time bomb. Millions of concurrent virtual threads will quickly turn your heap into a graveyard of leaked trace contexts and bloated memory overhead. If you're prepping for interviews, I've been building javalld.com — real machine coding problems with full execution traces. Why Most Developers Get This Wrong Defaulting to ThreadLocal: Assuming the default OpenTelemetry ThreadLocal storage works fine with virtual threads, ignoring the heavy heap footprint and context drift when threads are unmounted and rescheduled. Ignoring Context Leakage: Forgetting that ThreadLocal values persist unless explicitly removed, causing trace data to bleed into unrelated tasks on shared carrier threads. Manual Propagation Mess: Manually passing Span objects down the call stack instead of leveraging JDK 26's native scoped value propagation. The Right Way The clean solution is to bind OpenTelemetry's ContextStorage directly to JEP 487 Scoped Values to enforce immutable, automatic, and thread-safe context propagation across virtual threads and structured concurrency boundaries. Implement Custom ContextStorage: Create an OTel ContextStorage implementation backed by a static ScopedValue<Context> . Enforce Immutability: Leverage the immutable nature of ScopedValue to prevent downstream child threads from accidentally mutating the parent's tracing context. Leverage Structured Concurrency: Use StructuredTaskScope which automatically inherits the scoped trace context without manual boilerplate. Show Me The Code Here is how to run a span using JDK 26 ScopedValue for zero-leak, zero-overhead propagation: public class ScopedTraceRunner { private static final ScopedValue < Span > ACTIVE_SPAN = ScopedValue . newInstance (); public void execute ( Span span , Runn
AI 资讯
QuickLook Integration in a Tauri App — Native macOS File Preview
All tests run on an 8-year-old MacBook Air. All results from shipping 7 Mac apps as a solo developer. No sponsored opinion. HiyokoKit's MTP file manager includes QuickLook preview. Press Space, see the file. Native macOS behavior in a Tauri app. Here's how it works — and why it's worth doing. What QuickLook Is QuickLook is macOS's built-in file preview system. Press Space on any file in Finder — that's QuickLook. It handles images, PDFs, videos, and documents without opening separate apps. For a file manager, QuickLook preview is table stakes on macOS. Users expect it. If it's missing, the app feels unfinished. Triggering QuickLook from Rust The qlmanage command-line tool can trigger QuickLook from any process: use std :: process :: Command ; #[tauri::command] async fn preview_file ( file_path : String ) -> Result < (), AppError > { Command :: new ( "qlmanage" ) .args ([ "-p" , & file_path ]) .spawn () .map_err (| e | AppError :: Preview ( e .to_string ())) ? ; Ok (()) } qlmanage -p opens a native QuickLook preview window for the specified path. That's it on the Rust side for local files. For MTP Files: Download First, Preview, Cleanup Files on an Android device don't have a local path — they live on the device over MTP. The flow is: download to a temp file → preview → clean up. #[tauri::command] async fn preview_mtp_file ( device_path : String , filename : String , ) -> Result < (), AppError > { // Download to temp let temp_path = std :: env :: temp_dir () .join ( & filename ); download_from_device ( & device_path , & temp_path ) .await ? ; // Open QuickLook Command :: new ( "qlmanage" ) .args ([ "-p" , temp_path .to_str () .unwrap ()]) .spawn () ? ; // Schedule cleanup after delay let temp_clone = temp_path .clone (); tokio :: spawn ( async move { tokio :: time :: sleep ( Duration :: from_secs ( 30 )) .await ; std :: fs :: remove_file ( temp_clone ) .ok (); }); Ok (()) } 30 seconds gives the user time to view before cleanup. For large files (RAW photos, videos), y
AI 资讯
What You Should Know About Tokens, Context, and AI Cost
Most of us use AI coding tools in a very normal way. We paste an error, ask for a fix, paste a file, ask again, run a command, paste the output, and keep going. After some time, we get a message saying something like you are out of tokens or you have reached your message limit . Most of the time, the reason is tokens. What is a token? A token is a small piece of text the model reads or writes. It can be a word, part of a word, a symbol, or spacing depending on the language and context. The model does not see text exactly like we do. It breaks everything into tokens first. So when you send a message, you are sending input tokens. When the model replies, it creates output tokens. If your coding agent reads files, terminal logs, docs, diffs, and old chat history, that can also become input tokens. What is a context window? The context window is the amount of text the model can keep in view at one time. It includes your message, the previous conversation, files, tool output, system instructions, project rules, and the model's own reply. Some models can hold a lot now. 200K tokens is already common in many coding workflows. Some newer models can go near 1M tokens. That sounds huge, and it is huge. But it does not mean you should always use it. Roughly speaking, 1M tokens can be hundreds of pages of text. It can be a big part of a codebase, many docs, or long chat history. But the model still has to read through that text. More context can mean more cost, more waiting, and more chances for the important thing to get buried. A rough mental model: Context size What it might hold 32K tokens A few files, a long bug report, or a small feature discussion 128K tokens Many files, long logs, or a decent chunk of project docs 200K tokens A large debugging session with files, logs, and history 1M tokens Hundreds of pages, big docs, or a large slice of a codebase This is not exact. Different languages, code, spacing, and tokenizers change the count. But it gives you the idea. Large c
AI 资讯
I’m Blown Away by Kamal
My Previous Deployment Choices Since I mostly do web development using Ruby on Rails, these were my go-to options for deployment: PaaS like Heroku, Render, or Railway Serverless setups (Cloud Run + NeonDB) Honestly, I didn’t have any major complaints. PaaS costs a bit more, but in return, you get a clean UI and dead-simple workflows like GitHub integration. If the cost bothered me, I’d just go serverless. For my personal servers—where huge traffic isn't exactly a concern—going serverless meant the app would just sleep when inactive, allowing me to run services for around 50 yen a month. Compared to the headache of clicking through complex AWS or GCP dashboards to piece things together based on architecture diagrams, it was a walk in the park. I was perfectly content. Seriously. Kamal Became the Default in Rails 8 Everything changed when Rails 8 dropped. I heard they adopted Kamal as the official deployment tool. Kamal — Deploy web apps anywhere From bare metal to cloud VMs using Docker, deploy web apps anywhere with zero downtime. kamal-deploy.org Kamal? Is deploying really going to get any easier? I mean, I’m doing completely fine right now, though... That’s what I thought. But once I gave it a shot, it felt like being struck by lightning. This is an absolute game-changer. All you have to do is run rails new , throw your server's IP address into deploy.yml , and run kamal setup . That’s it—your app is deployed. For every release after that, it's just kamal deploy . I couldn't believe how simple the deployment workflow was. # deploy.yml service : my-app image : my-user/my-app servers : web : - 192.0.2.1 # Just swap in your VPS IP address here proxy : ssl : true host : app.example.com # Set up your domain here Sure, you have to bring your own server, but Kamal prides itself on being able to deploy absolutely anywhere. I rented a couple of VPS instances from Hetzner for about $10 a month each to host SuperRails and LazyCafe . From what I looked into, you can't really
AI 资讯
peektea past the roadmap 👀 sorting and scrollable previews
Hello, I'm Maneshwar. I'm building git-lrc, a Micro AI code reviewer that runs on every commit. It is...
AI 资讯
Unity vs Godot vs Unreal for Beginners (2026): Which Engine Should You Start With?
If you have never written a line of game code and you are trying to choose between Unity, Godot, and Unreal, the internet will give you fifty contradictory answers in your first hour of searching. This article is the answer we give to people who ask us in person. We are a Unity-specialist studio. I have spent 12 years building games, including a tenure as Mobile Team on RuneScape Mobile at Jagex. Over that time I have mentored a steady stream of new developers entering the industry. We picked Unity for our commercial work, deliberately, and we will say upfront where that lens does and does not serve you. The advice below is what I would tell a friend's teenager who asked which engine to learn first, not the version where I am trying to win you as a client. Three things drive whether a beginner finishes their first game or quietly abandons it: the engine's first-week friction, the quality of the free learning material, and whether the language and tools punish you or reward you when you make a mistake. Comparison articles obsess over feature lists. Beginners obsess over whether they can get something on screen by Saturday. We are going to talk about Saturday. The 30-Second Answer If you skim nothing else, take this: Pick Godot if you want the gentlest first week. The editor is small, the language reads like Python, and you can ship a 2D game to the web in a single afternoon. Best chance of you actually finishing a project. Pick Unity if you want a future career in the games industry. Largest tutorial library, biggest job market, most transferable skills. C# is harder than GDScript but every hour you spend on it pays back in the long run. Pick Unreal if you have always wanted to make games specifically because of the visuals. Blueprints let you avoid C++ at the start, the rendering looks beautiful from day one, and the long learning curve has the highest payoff if you commit. For the rest of the article, we will explain why each of those is true, where the engines gen
AI 资讯
Is AI CAD the Future Or Is It Already Here?
The Framing Problem When industry analysts discuss "AI CAD," they are frequently conflating two fundamentally different computational paradigms: generative mesh synthesis and parametric feature modeling. This conflation has produced a decade of inflated expectations, underwhelming demos, and a persistent belief that real AI CAD is still "coming." It is not coming. For a specific and technically meaningful definition of AI CAD, it has arrived. Mesh Generation vs. Parametric Modeling: Why the Distinction Is Everything Contemporary generative 3D tools including neural radiance field reconstructions, diffusion-based mesh generators, and implicit surface networks produce geometry as an unstructured point cloud or polygon mesh. These representations are geometrically expressive but engineering-inert. They carry no feature history, no constraint graph, no dimensional intent. A mesh cannot be toleranced. A mesh cannot propagate a design change. A mesh cannot be submitted to a manufacturer without full reconstruction from scratch. Parametric CAD, by contrast, encodes design intent as a structured sequence of operations — extrusions, revolves, fillets, boolean operations each governed by explicit dimensional constraints and parent-child dependency relationships. The parametric model is not merely a shape; it is a design process, replayable, modifiable, and transferable across manufacturing contexts. The meaningful technical question for AI CAD in 2026 is therefore not " can AI generate a 3D shape? " that has been demonstrable since 2019. The question is: can AI generate a valid parametric feature tree from natural language input, with embedded manufacturing constraints, that survives downstream engineering use? What This Requires Architecturally Answering that question in the affirmative requires a system that can: Parse engineering intent from unstructured natural language distinguishing, for instance, between a cosmetic fillet and a stress-relief fillet, or between a cleara
开发者
How we reduced the time to run tests from hours to just minutes
submitted by /u/henk53 [link] [留言]
开发者
Porting our Django backend to Rust improved the infra usage by 90%
submitted by /u/syrusakbary [link] [留言]
AI 资讯
Steering Vectors: The Hidden Control Knobs Inside Large Language Models
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. What if you could change how an AI thinks without retraining it? Not by rewriting prompts. Not by fine-tuning billions of parameters. Not by collecting another mountain of training data. Instead, imagine finding a direction inside the model's internal representation space and nudging the model a little in that direction. A small push. A different behavior. This idea sits at the heart of one of the most fascinating areas of modern AI interpretability: steering vectors . Steering vectors suggest that many behaviors we care about—careful reasoning, honesty, coding style, security awareness, verbosity, and more—may already exist inside a model. The challenge is learning how to activate them. Let's explore what steering vectors are, how they're created, and why they might become one of the most practical tools for controlling AI systems. 1. What Exactly Is a Steering Vector? Large language models process information through layers of high-dimensional activations. At any point during generation, the model's internal state can be represented as a vector containing thousands of numbers. Researchers discovered something surprising: Different behaviors often correspond to different regions of this activation space. For example: Writing Python code Solving math problems Speaking French Explaining concepts carefully Producing insecure code Each tends to produce distinctive activation patterns. A steering vector is essentially the difference between two activation patterns. Suppose we gather examples where the model is: Careful Methodical Thorough and compare them to examples where it is: Rushed Superficial Incomplete The average difference between these internal states becomes a steering vector. At inference time, we can add that vector back into the model's activatio
AI 资讯
Rust Ownership System Explained for JavaScript Developers
Rust Ownership System Explained for JavaScript Developers Quick context (why you're writing this) I was trying to rewrite a small utility I’d written in JavaScript—a function that takes a string, splits it into words, and returns the longest one. In JS it’s trivial: you pass the string around, mutate arrays, and nothing blows up. When I attempted the same thing in Rust, the compiler kept yelling at me about “use of moved value” and “cannot borrow as mutable because it is also borrowed as immutable”. I spent a good chunk of an afternoon staring at those errors, thinking I’d missed some syntax detail, only to realize the real issue was a completely different way of thinking about data. If you’ve ever felt that Rust’s compiler is being overly pedantic, you’re not alone—but once you grasp what it’s protecting you from, the frustration turns into appreciation. The Insight Rust doesn’t treat variables like JavaScript’s loosely‑typed references. Instead, it enforces ownership at compile time. Three ideas tend to surprise developers coming from a garbage‑collected world: Move semantics – assigning a value to another variable moves it; the original is no longer usable unless you explicitly clone it. Borrowing rules – you can have either many immutable references or exactly one mutable reference to a piece of data, but never both at the same time. Lifetimes – the compiler tracks how long references are valid, preventing dangling pointers without a garbage collector. The first two are the ones that trip people up most often, and they directly address the class of bugs JavaScript developers know all too well: accidental shared‑state mutations and use‑after‑free‑like mistakes (though in JS they show up as weird undefined values rather than crashes). Let’s look at each with a concrete example, show the common mistake, and then see how to do it right. How (with code) Move semantics – the “you can’t use it after you give it away” surprise fn main () { let greeting = String :: from
AI 资讯
Sliding Your Way Out of Panic: The Mental Trick That Speeds Up Coding Under Fire
Sliding Your Way Out of Panic: The Mental Trick That Speeds Up Coding Under Fire Quick context (why you're writing this) I still remember the sweat on my palms during a technical interview a couple of years back. The interviewer tossed out the classic “longest substring without repeating characters” problem, gave me five minutes, and watched me stare at the whiteboard like I’d never seen a string before. I started with a brute‑force double loop, felt the clock ticking, and ended up writing a mess that was O(n²) and full of off‑by‑one errors. I walked out feeling like I’d choked, even though I knew the solution deep down. Later, after I’d spent way too many hours replaying that moment in my head, I realized the problem wasn’t my knowledge—it was the way I was framing the question while under pressure. I’d been trying to solve the whole thing at once instead of focusing on the tiny piece that actually mattered. When I finally isolated that piece, the answer clicked in seconds. That’s the mental framework I now teach anyone who’s about to face a ticking clock: identify the invariant you must keep true, and let everything else revolve around it . The Insight When the pressure’s on, your brain wants to grab the biggest chunk it can see and start hacking. That’s a recipe for wasted time and bugs. Top coders do the opposite: they strip away everything that isn’t a constant rule the solution must obey, then build the smallest possible state machine that enforces that rule. For the substring problem the invariant is simple: the current window must contain only unique characters . If you can guarantee that, the answer is just the biggest size that window ever reaches. All the fiddly details—where to move the left pointer, how to know when a duplicate appears—fall out of tracking the last index you saw each character. So the mental steps are: State the invariant (what must always be true). Find the minimal data you need to enforce it (usually a map or a set). Update that data
开发者
Arc v0.0.1-alpha - A Lightweight C-Based Programming Language
We are excited to announce the first alpha release of Arc, a lightweight, C-based programming language and interpreter designed for simplicity, performance, and educational clarity. Version Overview Version: v0.0.1-alpha Status: Alpha (Experimental) License: GPL-3.0 This initial release establishes the foundational pipeline of the Arc language, from lexical analysis to AST-based interpretation, featuring a robust set of core language constructs and a custom memory management system. Key Features Language Core Variable System: Declaration and updates using the VAR keyword. Functions: Support for custom functions (FN) with parameters and RETURN values. Control Flow: Conditional branching with IF, THEN, ELIF, and ELSE. Iterative loops with WHILE, FOR, and THEN. Loop control with BREAK and CONTINUE. Exception Handling: Graceful error recovery using TRY...CATCH blocks. Data Types: Integrated support for Numbers (Integers/Floats), Strings, Booleans, and Lists. Import System: Modularize projects by importing other .arc files using IMPORT. Syntax Highlights Case Sensitivity: Keywords (e.g., VAR, WHILE, IF) are case-insensitive. Identifiers (variable and function names) are case-sensitive. Operators: Comprehensive set of arithmetic (+, -, *, /, ^), comparison (==, !=, <, >, <=, >=), and logical (AND, OR, NOT) operators. Comments: Single-line comments starting with #. Built-in Standard Library I/O Operations: print, get_input, open_file, read_file, write_file, close_file. Data Manipulation: len_of, typeof, to_int, split_string, append_list, range. Math Library: A comprehensive math.arc providing constants (PI, E) and functions (sin, cos, tan, sqrt, log, etc.). Tooling & CLI Arc comes with a powerful CLI and an interactive REPL: Interactive REPL: Run code line-by-line with syntax highlighting. CLI Options --debug (-d): View tokens and AST tree during execution. --code (-c): Execute a string of code directly. --float-precision (-p): Control decimal output. --mempool-size (-m):
AI 资讯
Jo's two-world architecture to solve the fine-grained sandboxing problem at compile-time
Jo is a secure programming language that intends to addressing the fine-grained sandboxing problem at compile-time. To make secure programming practical it ends up with a two-world architecture : - confined world : not trusted, no FFI transitively, disciplined, standard library is not trusted - trusted world : trusted, FFI, type cast, language runtime is trusted The two-world architecture makes it possible to establish a security wall inside the language : that makes it easy to confine an untrusted program to arbitrarily fine-grained permission, e.g., only access certain rows or columns of a database table. The language-level confinement remove the need for runtime sandboxing because compile-time confinement is more fine-grained. It also makes security auditing easier. For resource quota, it still needs to be combined with ulimit/cgroups. We believe the two-world design addresses both the need for security and usability in secure programming. Comments are welcome on the design or alternatives to address the same problem. Link: https://jo-lang.org/security/two-worlds.html submitted by /u/liufengyun [link] [留言]
开发者
Python Number Programs Using While Loop: Step-by-Step Guide
Introduction Number-based problems are essential for improving programming logic. Using Python's while loop, we can solve different types of problems involving divisibility, counting, and special numbers. This article demonstrates step-by-step solutions using simple logic and structured code. Basic Practice 1. Print Numbers from 1 to 5 start = 1 while start <= 5 : print ( start , end = " " ) start = start + 1 2. Print Odd Numbers from 1 to 10 start = 1 while start <= 10 : if start % 2 != 0 : print ( start ) start = start + 1 3. Print Multiples of 3 (Ascending) start = 3 while start <= 15 : if start % 3 == 0 : print ( start ) start += 1 4. Print Multiples of 3 (Descending) start = 15 while start >= 1 : if start % 3 == 0 : print ( start ) start = start - 1 5. Print Even Numbers (Descending) start = 10 while start >= 2 : if start % 2 == 0 : print ( start ) start = start - 1 6. Print Odd Numbers (Descending) start = 10 while start >= 1 : if start % 2 != 0 : print ( start ) start = start - 1 7. Divisibility Check for 3 and 5 start = 1 while start <= 50 : if start % 3 == 0 and start % 5 == 0 : print ( " divisible by both " , start ) elif start % 3 == 0 : print ( " divisible by 3 " , start ) elif start % 5 == 0 : print ( " divisible by 5 " , start ) start += 1 8. Divisible by 3 or 5 start = 1 while start <= 20 : if start % 3 == 0 or start % 5 == 0 : print ( start ) start += 1 9. Finding Divisors of a Number num = 12 i = 1 while i <= num : if num % i == 0 : print ( i ) i += 1 10. Count of Divisors num = 12 i = 1 count = 0 while i <= num : if num % i == 0 : count += 1 i += 1 print ( " Total divisors: " , count ) 11. Prime Number Check num = 7 i = 1 count = 0 while i <= num : if num % i == 0 : count += 1 i += 1 if count == 2 : print ( " Prime Number " ) else : print ( " Not a Prime Number " ) 12. Perfect Number Check num = 6 i = 1 sum = 0 while i < num : if num % i == 0 : sum += i i += 1 if sum == num : print ( " Perfect Number " ) else : print ( " Not a Perfect Number " ) Ex
开发者
Basic Type System Terminology
submitted by /u/legoman25 [link] [留言]
开发者
Stealing from Biologists to Compile Haskell Faster
submitted by /u/mooreds [link] [留言]
AI 资讯
Cyber SH Agent — Goated AI for Hackers
Who I Am I’m neo4 — a red teamer with ~3 years of offensive security experience, a hardcore Linux/Arch culture operator, and a Python developer who thrives in the terminal. My workflow is pure hacker logic: OPSEC first, root‑level control always. I’ve been recognized by Disney’s Vulnerability Disclosure Program for responsible disclosure, and I build tools that merge hacker culture with AI. Why I Built Cyber SH Agent Most AI tools today are cloud‑locked, API‑dependent, and surveillance‑heavy. That doesn’t fit hacker culture. So I built Cyber SH Agent — an offline AI CLI operator that runs locally, no servers, no API keys, no data leaks. Repo: https://github.com/neo4-svg/cybersh.git 🔧 Core Features Agent Mode → AI controls your CLI with system access. Sec Mode → Bug bounty & penetration testing expert. Vibe Mode → Creative coding & UI/UX assistance. Code Mode → Production‑ready code generation. Chat Mode → General AI assistant. All 100% offline — runs GGUF models via llama-cpp-python. No servers, no API keys, no data leaving your machine. hope you like it!