AI 资讯
Checking Polish companies from code: VAT, KRS, REGON, EU VAT (REST + Python + MCP)
If you invoice or onboard Polish companies, sooner or later you have to check two dull things that turn out to matter a lot: is this company actually a registered VAT payer, and is the bank account they gave you the one that's on the government's official white list ("Biała Lista")? Both of those affect whether you can deduct the cost and reclaim VAT, so it's not really optional. The annoying part is that the data lives in four different places: the Ministry of Finance, the KRS court register, GUS (the stats office), and the EU's VIES service. Each one has its own API and its own quirks. I got tired of gluing those together every time, so I wrapped them behind a few plain HTTP calls that return JSON. Full disclosure: skanfirmy.pl is mine. It's free, no key, no signup, and the web layer runs client-side with no tracking. Here's how you'd actually use it. REST: one GET, one JSON Cheapest thing you can do is check a NIP (the tax ID): curl https://skanfirmy.pl/nip/5260250995 You get back the VAT status (active, exempt, or not registered), the company details from the VAT register, and the accounts sitting on the white list. The paths: GET /nip/{nip} gives VAT status + white-list data for one NIP GET /nips/{list} takes several NIPs at once (comma-separated) GET /regon/{nip} returns data from the REGON register (GUS) GET /vies/{country}/{number} validates an EU VAT number, e.g. /vies/DE/811128135 It's a plain GET that returns JSON, so it drops into anything that can make an HTTP request: a cron job, a lambda, a CI step, whatever. Python requests and a few lines. This one raises if the company isn't an active VAT payer: import requests def check_vat ( nip : str ) -> dict : r = requests . get ( f " https://skanfirmy.pl/nip/ { nip } " , timeout = 10 ) r . raise_for_status () data = r . json () status = data . get ( " vatStatus " ) or data . get ( " status " ) if status != " Czynny " : # status comes back in Polish; compare against the raw value raise ValueError ( f " NIP { n
AI 资讯
App-like UX in Next.js 16.3
Building App-like Experiences with Next.js 16.3 A hands-on look at how Next.js 16.3 helps apps feel fast and smooth, more like a single-page app, without losing the benefits of server rendering. Using four demo apps, it shows how features like Instant Navigations, Cache Components, Partial Prefetching, optimistic updates, Suspense streaming, offline retry, and View Transitions work together in real apps ⚡️ Sponsor: Arcjet AI compliance controls Protect your AI applications from prompt injection, PII leaks, and unauthorized tool calls. 📙 Articles / Tutorials / News Next.js team AMA The Next.js team opened the floor to community questions and covered a lot of ground. The AMA focused on Next.js 16.3, performance, caching, App Router, React Server Components, and upgrading apps, along with some insight into how the team works on the framework Coordinating Optimistic Updates in Next.js This guide shows how useActionState and useOptimistic can work together to keep the UI updated right away, save changes in the right order, and roll back cleanly if something fails Using next/root-params in Next.js 16.3 The new next/root-params API lets Server Components read top-level params like [locale] from deep in the tree, which makes next-intl much easier to use Docs for React's new browser() API The docs for React's new browser() API are now available in Canary. You can pass it to use() , where it suspends to the nearest Suspense boundary on the server, then renders normally in the browser 📦 Projects / Packages / Tools Better Auth 1.7 A big release for Better Auth, especially around OAuth, OpenID Connect, SCIM, SSO, MCP, and device login flows. The main theme here is stronger auth, better enterprise identity support, and more standards-based ways for apps and devices to sign in and get access Next 16 Calendar "Flow" A calendar and booking demo exploring Async React, Cache Components, Partial Prefetching, and View Transitions with Next.js 16.3, React 19, Tailwind CSS v4, and Prisma.
AI 资讯
I’ve spent the last few years deeply embedded in Web3: running operations, building products, and pitching to VCs. Here's how i pick a dev team:
The single biggest operational risk for early-stage founders remains hiring traditional hourly dev shops. Before partnering with any external dev team, I've learned to run them through this 5-point evaluation framework: The 5-Point Evaluation (co-founder approved) 1. Quality of Questions If a team asks zero questions, it’s an immediate red flag. It's impossible to deeply understand a project without asking anything. But quality matters. Weak devs ask easily googled questions about basic blockchain mechanics. Strong engineers ask highly specific questions focused entirely on your business logic, edge cases, and tokenomics. 2. Proposing Solutions, Not Problems (obvious one) A weak team will message you saying, "We have a problem, how should we fix it?" A mature team says, "We hit a blocker. Here are three architectural workarounds, the trade-offs for each, and our recommendation." 3. Deep Ecosystem Knowledge Coding isn't enough. If an agency claims they can build a top-tier lending protocol but doesn't understand the role of risk engines and oracles, they are tourists. Your developers need to know top-tier market leaders like Gauntlet, Steakhouse, Chaos Labs, and RedStone, and understand how their risk modeling and data feeds directly dictate market parameters. If they lack this context, their expertise is strictly surface-level. 4. Full Product Lifecycle Understanding Writing code and calling it a day is a massive mistake. A real partner understands what happens outside the IDE. They account for security audit buffers, integration with risk providers and oracles before mainnet, and the proper setup of on-chain governance and admin functions. 5. High Agency & Proactivity Elite teams care about your overall success, not just their Jira tickets. To quote a BD i work closely with: “When a client is about to make a massive mistake, you have two choices: stay silent and watch them fail, or step in with your expertise, even uninvited, and say: 'We hear what you want to do,
AI 资讯
Knowing When to Use If/Else vs. Switch in JavaScript
If/else statements - We all know and love them. While they are incredibly powerful, there comes a point where a long chain of conditions only makes your code look messy. Choosing between if/else and switch depends on readability, but there's a hidden pro tip that makes switch much more powerful than many people think at first. Traditional Approach: If/Else Normally, we use if/else when our logic depends on complex ranges and multiple variables: // Hard to scan, bulky, and prone to typos let weatherAdvice = "" ; if ( temperature < 15 && isRaining ) { weatherAdvice = " Grab a heavy coat and an umbrella! 🌧️🧥 " ; } else if ( temperature < 15 && ! isRaining ) { weatherAdvice = " It's cold but dry. Just a jacket is fine! 🧥 " ; } else if ( temperature >= 15 && isRaining && isNightTime ) { weatherAdvice = " Warm, rainy night. Stay indoors if you can! 🌧️🌃 " ; } else if ( temperature >= 15 && isRaining && ! isNightTime ) { weatherAdvice = " Warm rain during the day. Don't forget your umbrella! 🌧️🌦️ " ; } else if ( temperature >= 30 && ! isRaining ) { weatherAdvice = " It's scorching hot! Stay hydrated! ☀️🥤 " ; } else { weatherAdvice = " Weather seems pleasant today! 😎 " ; } Pro Tip: Using switch(true) Many developers think you can only use switch when you're checking a single variable against fixed values. However, you can use a switch statement for complex ranges by passing the boolean value true into the switch condition. Here is a cleaner switch statement version of the above code block: // Much easier on the eyes let weatherAdvice = "" ; switch ( true ) { case ( temperature < 15 && isRaining ): weatherAdvice = " Grab a heavy coat and an umbrella! 🌧️🧥 " ; break ; case ( temperature < 15 && ! isRaining ): weatherAdvice = " It's cold but dry. Just a jacket is fine! 🧥 " ; break ; case ( temperature >= 15 && isRaining && isNightTime ): weatherAdvice = " Warm, rainy night. Stay indoors if you can! 🌧️🌃 " ; break ; case ( temperature >= 15 && isRaining && ! isNightTime ): weather
AI 资讯
I turned browser cookie counts into game currency - meet Crumbongo
Crumbongo started from a pretty stupid little question: What if the number of accessible cookies on the website you're visiting could become game currency? So I built it. Crumbongo is a tiny local Chrome game where you choose a website, let the extension count the accessible cookie records for that site, and turn only that number into game rewards. No cookie names or values are used for gameplay. From a tiny experiment to an actual little game The first version was basically: choose a website; check its accessible cookie count; harvest that number into a Cookie Jar; spend the cookies on Bongo. Then I kept building on top of it. Crumbongo now has: a level and progression system; pixel-art cosmetics; multiple habitats; companions; local statistics; Monkey Climb; Cookie Stack. The whole thing still lives inside a Chrome extension popup. The technical side Crumbongo is deliberately small. There is no React, TypeScript, Vite, game engine, backend or framework involved. It's built with: vanilla JavaScript; HTML; CSS; Chrome Extension APIs; requestAnimationFrame for the minigames; chrome.storage.local for persistent game progress. The minigames are built with regular DOM elements and CSS rather than Canvas. That constraint became part of the fun: figuring out how far I could push a tiny extension popup without turning the project into something much larger. Local by design Because the core mechanic involves browser cookies, I wanted the privacy model to be extremely clear. Crumbongo requests access one site at a time. For gameplay it only uses the number of accessible cookie records returned for that site. It does not: store or transmit cookie names; store or transmit cookie values; modify or delete browser cookies; use an account system; use analytics or tracking; send gameplay data to a backend. Game progress stays locally in the browser. The game-design part became more interesting than I expected Once I added progression, I realized the cookie mechanic could support mu
AI 资讯
We’re All Going to the World’s Fair is an intimate coming-of-age horror film
Jane Schoenbrun's latest film, Teenage Sex and Death at Camp Miasma, is making a splash in theaters right now. So it seems like the perfect time to revisit their first film, We're All Going to the World's Fair. I fell in love with this film when I first saw it at Sundance in 2021. We […]
科技前沿
The reasons Siri may not work on CarPlay
If you're struggling to get Siri to work with your car's CarPlay system, there are some things you can check.
科技前沿
Asus ROG Swift RGB Stripe OLED Review: Clarity King
The Asus PG27UCWM brings a new sub-pixel layout to the world of OLED gaming monitors, and in my testing, I appreciated the improvements it brings to the table.
AI 资讯
I’m testing a faster way to research podcast guests before an interview
A podcast host recently told me that he prepares questions from the guest’s bio using ChatGPT. That works for the basics, but a bio does not show which stories the guest has repeated across other interviews or which questions they have already answered many times. I’m helping Audiogram test a different workflow. It connects to Claude through MCP, searches Apple Podcasts, retrieves available episode transcripts, and lets Claude compare the guest’s previous answers before drafting new questions. For one test, I used two published Sam Altman interviews. The workflow pulled both available transcripts, separated recurring themes from open gaps, and produced follow-up questions around measurable evidence, privacy limits, and independent review—rather than repeating another general “will AI be good or bad?” question. The prompt is simple: Prepare an interview brief for [guest] about [interview angle]. Find podcast episodes where the guest is actually interviewed, retrieve the available transcripts, and compare them. Show recurring themes, changes in position, questions already answered, and five follow-up questions based on gaps or unsupported claims. Cite the podcast and episode for every finding. Separate transcript evidence from inference, and say what is missing when the available material is not enough. This is for research across published Apple Podcasts episodes. It is not a raw-audio editor, and transcript availability and speaker labels still need to be checked. You can see the complete recipe and tested example here: Podcast guest interview preparation with Audiogram If you prepare podcast interviews, would previous-interview comparison improve your questions, or is another part of guest research still the bigger problem? Disclosure: I’m helping Audiogram with early-user growth and used AI to help edit this post.
AI 资讯
Building a Personal Blog with Laravel: A Real World Project
A personal blog sounds like a simple Laravel project. Create posts, show them on the homepage, and you are done. But once you start adding search, categories, tags, comments, SEO, authentication, analytics, and an admin panel, things become much more interesting. I built this Laravel Personal Blog as a real world project to explore those problems instead of building another basic CRUD application. The complete source code is available on GitHub: https://github.com/arafat-web/laravel-personal-blog Table of Contents What Is This Project? Technology Stack Main Features Project Structure How Visitor Analytics Works SEO and Content Management How to Run the Project What I Learned Final Thoughts What Is This Project? This is a complete single-author blogging platform built with Laravel. It includes both a public blog and a custom admin panel. The project was built without additional application packages, so most of the important functionality is visible in the codebase itself. The public side contains: Homepage Blog posts Categories Tags Search Comments RSS feed Sitemap SEO metadata Post view tracking The admin panel contains: Dashboard Post management Category and tag management Comment moderation User management General settings SEO settings Visitor analytics Technology Stack The project uses: PHP 8.3+ Laravel 13.17 MySQL or SQLite Blade Eloquent ORM JavaScript CSS PHPUnit The current project configuration requires PHP 8.3 and Laravel 13.17. Main Features The project goes beyond basic CRUD. For example, posts can have categories, tags, comments, authors, featured images, publishing status, and view counts. The Post model defines these relationships using Eloquent: public function user (): BelongsTo { return $this -> belongsTo ( User :: class ); } public function categories (): BelongsToMany { return $this -> belongsToMany ( Category :: class ); } public function tags (): BelongsToMany { return $this -> belongsToMany ( Tag :: class ); } public function comments (): HasMa
AI 资讯
About Me: Afee Muhammod Wafy
Hello world! 👋 I'm Afee Muhammod Wafy , though most people know me simply as Wafy . I am a science student and self-taught web developer from Rangpur, Bangladesh. If you asked me what truly drives my journey, the answer wouldn't just be lines of code or complex syntax—it is pure, relentless curiosity. The Spark of Building Things From a very young age, I was always fascinated by how things work behind the scenes. Moving into science education naturally shaped how I approach problems: breaking down complex ideas, analyzing the core logic, and finding structured ways to solve them. When I first encountered programming, it felt like having an infinite canvas. I code not because it is an academic requirement or a routine chore, but because there is genuine joy in turning an abstract thought into something functional, accessible, and meaningful to real users. Consistency Over Perfection My learning philosophy is straightforward: stay consistent, stay humble, and never stop exploring . Every bug encountered, every new tool tested, and every experiment with full-stack development, modern APIs, or emerging AI technologies is a stepping stone. I believe true growth comes from getting your hands dirty with real-world problem-solving rather than just absorbing passive tutorials. Why This Journal Exists I started this dev.to journal to document my evolution as a developer in raw, unfiltered detail. Here, I'll be sharing: Real reflections on navigating self-directed learning alongside formal science studies. Honest lessons learned from debugging and architecting digital products. Perspectives on the ever-evolving tech landscape, open-source culture, and developer workflows. Let's Connect The tech community thrives on collaboration and shared knowledge. Whether you're a fellow student balancing studies with code, a seasoned developer, or someone who loves building things—I'd love to hear your story. Portfolio: amwafy.xyz GitHub: github.com/afeemuhammodwafy1 LinkedIn: linkedin.com
AI 资讯
I built a JSON toolkit that never sends your data anywhere
Most "paste your JSON here" tools online send that JSON to a server to process it. For internal API responses, config files, or anything with real data in it, that's not something I wanted to do — so I built JSONLinter , a JSON toolkit where literally everything happens client-side. What it does It started as a validator/formatter, then grew into 42 tools across six categories: Validate & Format — validation with precise error locations, pretty print, minify, JSON repair (fixes trailing commas, single quotes, unquoted keys, truncated JSON, etc.) View & Query — tree view, JSONPath queries, structural diff (key order doesn't matter), full-text search Data Converters — CSV, Excel, YAML, XML, SQL, Markdown, both directions Code Generators — infers a type model from a JSON sample and generates TypeScript, Python, Java, C#, Go, Kotlin, Swift, Rust, or PHP Schema Tools — JSON Schema validation + generation Encoding Tools — Base64, escape/unescape, JWT decode There's also an optional AI assistant on the validator page — it's bring-your-own-key (OpenAI or Anthropic), and since there's no backend at all, the key and your JSON go straight from your browser to the provider. I never see either. How it's built Stack is React 19 + TypeScript + Vite, Tailwind v4 for styling, CodeMirror 6 for the editor. A few things I had to solve that were more interesting than expected: Prerendering without SSR. I didn't want to take on a Next.js-style server just to get real HTML for crawlers. Instead, the build runs a headless Chromium pass (Playwright) over every route after vite build and saves the fully-rendered output to dist/<route>/index.html . Crawlers get real content and correct per-page meta tags on first paint; once JS loads, React takes over exactly like a normal SPA. No server, no hydration mismatches to worry about. Structural JSON diff. A text diff on two JSON documents is mostly useless because key order doesn't matter semantically. The diff tool parses both sides and compares t
AI 资讯
MCP Was a Mistake. Here Are 200,000 Tokens That Prove It.
MCP Was a Mistake. Here Are 200,000 Tokens That Prove It. "mcp were a mistake. bash is better." — Peter Steinberger, OpenClaw founder I didn't want to believe it either. MCP was supposed to be the USB-C of AI — one protocol to connect everything. Anthropic, OpenAI, Google all backed it. 97 million monthly downloads. 17,000 servers. But then I measured what MCP actually does to your context window. The Setup I connected 10 popular MCP servers to a token counter. Here's what happened before I typed a single word: Server Tools Tokens Injected Filesystem 11 3,847 Brave Search 8 2,103 Sequential Thinking 3 890 Memory 9 2,567 Puppeteer 15 5,890 Postgres 19 8,231 Notion 24 13,780 GitHub 28 12,440 Slack 22 14,672 Google Drive 31 47,293 Total 170 111,713 111,713 tokens. Before your first message. That's not a typo. Connecting 10 MCP servers to Claude means over 100K tokens of JSON schemas get injected into your context window. You haven't asked a question yet. You haven't made a tool call. The schemas are just... sitting there. The Math That Made Me Angry At Claude 3.5 Sonnet pricing ($3/M input tokens): Every conversation starts with 111K tokens of overhead: $0.33 20 conversations per day: $6.67/day 22 working days per month: $147/month Annual cost of JSON schemas: $1,764 That's more than a Claude Pro subscription. You're paying $1,764/year to read JSON braces describing tools you might never use. But Wait — It Gets Worse The 111K is just the schema injection. When you actually call a tool, MCP wraps the result: { "content" : [ { "type" : "text" , "text" : "{ \" file \" : \" app.py \" , \" size \" : 1024}" } ] } The actual content is 38 characters. The wrapping is 47 characters. 55% of your result tokens are JSON overhead. With 20 tool calls per conversation: Schema injection: ~111K tokens Result wrapping: ~18K tokens Total overhead: ~130K tokens per conversation Your $0.54 conversation now has 130K tokens that serve zero purpose. What Garry Tan Was Right About When YC's CE
AI 资讯
Claude Code Is Burning Your Token Budget. Here's the Receipt.
Claude Code Is Burning Your Token Budget. Here's the Receipt. I found $2,500/year of hidden token waste in my Claude Code setup. It was the MCP servers. The Discovery Last week I noticed my Claude Code conversations were dying at around message 15. Context window full. The model starts forgetting earlier instructions. Tool calls fail. The conversation degrades into hallucination. I assumed it was my fault — too many messages, too much context. So I started measuring. Here's what I found: Session start: Claude system prompt: ~8,000 tokens MCP schema injection: ~111,000 tokens User's first message: 50 tokens ────────────────────────────────────────── Total before any work: ~119,000 tokens Remaining context: ~81,000 tokens I was starting every conversation with 60% of my context already consumed. The culprit wasn't my prompts. It was the 10 MCP servers I had proudly configured in my claude_desktop_config.json . The Receipts I measured each server's schema injection using tiktoken: Server Why I Installed It Token Cost Times Used/Week GitHub PR reviews, issues 12,440 3 Slack Message reading 14,672 0 Google Drive Doc access 47,293 1 Notion Knowledge base 13,780 2 Postgres Query DB 8,231 4 Puppeteer Screenshots 5,890 0 Filesystem File access 3,847 15 Brave Search Web search 2,103 5 Memory Context persistence 2,567 0 Sequential Thinking Reasoning 890 2 Total 111,713 Look at the "Times Used/Week" column. Three servers were used zero times. Two more were used once or twice. But every single one of them was injecting 100% of its schema into every conversation. I was paying $0.33 per conversation — $2,500/year — to load schemas for tools I barely used. The Moment I Realized Everyone Has This Problem I posted my findings on Bluesky. Within hours: "I had the same issue. Removed 6 MCP servers and my conversations went from dying at message 15 to lasting 40+ messages." — @developer1 "GitHub MCP is 12K tokens but Claude Code already has gh CLI built in. Why did I install it?" — @dev
AI 资讯
Garry Tan Was Right: "MCP Sucks Honestly." I Have the Token Receipts.
Garry Tan Was Right: "MCP Sucks Honestly." I Have the Token Receipts. "MCP sucks honestly. Context window eats too much, auth is a mess. I wrote a CLI wrapper in 30 minutes and it works better." When YC's CEO says this on X, people listen. But nobody had the data to back it up. Until now. What Garry Tan, Perplexity's CTO, and 97 Million Downloads Can't Hide Three things happened in the last 6 months that changed how I think about MCP: Peter Steinberger (OpenClaw founder) tweeted: "mcp were a mistake. bash is better." Eric Holmes wrote "MCP is dead. Long live the CLI" — it hit HN frontpage Denis Yarats (Perplexity CTO) publicly announced they're replacing MCP with REST API + CLI internally Garry Tan (YC CEO) replied: "MCP sucks honestly" The community split into two camps: "MCP is dead" — CLI is simpler, cheaper, faster "MCP is fine" — 97M downloads, 17K servers, it's the standard Both are wrong. The problem isn't MCP. The problem is what MCP does to your context window. The 47,000-Token Problem Nobody Measured I connected 10 MCP servers to a token counter. Here's what I found: MCP Server Tools Token Cost Equivalent Sequential Thinking 3 890 This blog post Brave Search 8 2,103 A short email Filesystem 11 3,847 A README Memory 9 2,567 A meeting note Puppeteer 15 5,890 A chapter of a book Postgres 19 8,231 A whitepaper GitHub 28 12,440 A court filing Notion 24 13,780 A legal contract Slack 22 14,672 A novella chapter Google Drive 31 47,293 Half of a novel Total 170 111,713 A short book One MCP server — Google Drive — injects 47,293 tokens into your context before you ask a single question. The entire works of Shakespeare is 900K tokens. Google Drive's schema is 5% of Shakespeare. For listing files. The Cost Breakdown (So You Can Get Angry Too) At Claude 3.5 Sonnet pricing ($3/M input tokens, $15/M output): Scenario Tokens Cost Annual Cost 1 server (minimal) 3,847 $0.01/conv $4.40/yr 3 servers (common) 14,528 $0.04/conv $19.40/yr 5 servers (typical) 33,061 $0.10/conv $4
AI 资讯
How I Built an Interactive 3D Full-Stack Developer Portfolio using React & Three.js
Building a developer portfolio is more than just listing skills—it's about creating an immersive experience that demonstrates your engineering capabilities in real-time. In this article, I want to share how I engineered my full-stack 3D portfolio website using React.js , Three.js , Tailwind CSS , and Next.js . 🚀 Key Features of the Portfolio: Interactive 3D Workspace : Integrated @react-three/fiber and @react-three/drei to render a interactive 3D desktop PC model. Production Case Studies : Showcased 10+ live deployed production web applications built for clients across the UAE (Dubai, Abu Dhabi) and India. Optimized Performance & SEO : Configured custom Schema.org JSON-LD markup, XML sitemaps, and canonical tags for instant search indexing. Modern UI/UX Aesthetics : Styled with dynamic dark glassmorphism gradients and responsive navigation patterns. 🛠️ Tech Stack Used: Frontend : React 18, Next.js, Three.js, GSAP Animations Backend : Node.js, Express.js, RESTful APIs Database : MongoDB & Mongoose Deployment : Vercel CI/CD 🌐 Check Out the Live Site & Connect! You can explore the live interactive 3D website and view my production projects here: 👉 Official Portfolio : Muhammed Rifad KP | Full Stack Developer Feel free to share your feedback or reach out if you'd like to collaborate on web engineering projects! Developed by Muhammed Rifad KP
AI 资讯
I Benchmarked 10 MCP Servers — One of Them Burns 47K Tokens Just to Say Hello
I Benchmarked 10 MCP Servers — One of Them Burns 47K Tokens Just to Say Hello 10 popular MCP servers. 847 tools total. 312K tokens of JSON schemas. One server alone wastes more tokens than a full GPT-3 conversation. Here are the results. What I did I installed the 10 most popular MCP servers from the official registry. Connected each one to a token counter. Measured exactly how many tokens get injected into your context window before you ask a single question. The servers: # Server Tools Token Cost 1 Filesystem 11 3,847 2 GitHub 28 12,440 3 Postgres 19 8,231 4 Puppeteer 15 5,890 5 Brave Search 8 2,103 6 Memory 9 2,567 7 Sequential Thinking 3 890 8 Slack 22 14,672 9 Google Drive 31 47,293 10 Notion 24 13,780 Totals: 847 tools across 10 servers 111,713 tokens of JSON schemas 200,000+ tokens including server status messages, headers, and error schemas That's right — connecting 10 MCP servers to Claude means 200K tokens of overhead before your first message . The worst offender: Google Drive Google Drive's MCP server exposes 31 tools. Each tool has deeply nested schemas for file operations, permission management, sharing, and search. The full schema dump: { "name" : "drive.files.list" , "description" : "Lists files in the user's Google Drive with optional filtering" , "inputSchema" : { "type" : "object" , "properties" : { "q" : { "type" : "string" , "description" : "Query string for filtering files..." }, "corpora" : { "type" : "string" , "enum" : [ "user" , "domain" , "sharedDrive" , "allDrives" ]}, "includeItemsFromAllDrives" : { "type" : "boolean" }, "orderBy" : { "type" : "string" }, "pageSize" : { "type" : "integer" }, "pageToken" : { "type" : "string" }, "spaces" : { "type" : "array" , "items" : { "type" : "string" }}, "supportsAllDrives" : { "type" : "boolean" }, "fields" : { "type" : "string" } }, "required" : [] } } That's ONE tool. 31 of them. At ~1,525 tokens per tool average. 47,293 tokens. Just for Google Drive. For comparison, the entire works of Shakespea
AI 资讯
Building a Live, User-Controlled Canvas Background System That Doesn't Kill Low-End Phones
The idea Most apps give you a static background. I wanted Pairly to feel alive instead, so I built "Atmosphere": a real-time animated Canvas layer that sits behind every chat, fully tunable by the user, speed, density, opacity, brightness, saturation, all live. There are currently over 40 atmospheres in the system, from calm ones like Snow and Fireflies to more elaborate ones like a black hole accretion disk called Abyss. The interesting part wasn't drawing pretty particles. It was making that work smoothly on a five-year-old Android phone without draining the battery in ten minutes. Two rendering paths, not one Atmosphere isn't a single renderer, it's a small internal package ( @pairly/atmospheres ) with two shared engines that every individual atmosphere builds on: ParticleCanvas , a generic particle system for anything made of many independent objects: snow, fireflies, sakura petals. useCanvasLoop , a raw draw-loop hook for continuous scenes that aren't particle-based, like Abyss's swirling accretion disk. Both engines centralize every "don't destroy the device" concern in one place, so individual atmospheres never have to think about it. Here's useCanvasLoop 's frame loop: const frameInterval = 1000 / perf . fps ; let raf = 0 ; let last = performance . now (); let acc = 0 ; const loop = ( now : number ) => { if ( ! running ) return ; raf = requestAnimationFrame ( loop ); const elapsed = now - last ; last = now ; acc += elapsed ; if ( acc < frameInterval ) return ; const dt = acc / 1000 ; acc = 0 ; draw ( ctx , width , height , elapsedTime , perf ); }; requestAnimationFrame fires at the display's native rate (often 90-120Hz on phones now), but that doesn't mean you should draw every single time it fires. This accumulator pattern throttles actual drawing down to the target FPS from the device's performance profile, instead of trusting rAF's raw rate. Profiling the device before drawing anything Before any atmosphere renders a single frame, it checks the device: ex
AI 资讯
From CSS selector to source line: instrumenting Angular templates
Every accessibility tool I have used reports violations like this: Images must have alternative text body > main > div:nth-child(2) > form > div.field > img That selector is correct. It is also useless. It describes the rendered DOM , and I do not write rendered DOM — I write templates. Somewhere in a few hundred .component.html files there is an <img> that produced it, and finding it is manual work: grep for img , get forty hits, open them one by one, compare surrounding markup until something matches. Multiply that by sixty violations and the scan stops being useful. Not because it is wrong, but because acting on it costs more than ignoring it. React solved this years ago If you write JSX, babel-plugin-transform-react-jsx-source puts a _debugSource on every element at build time — file, line, column. That is how React DevTools can jump you straight to source, and how error overlays point at the right line. Angular has no equivalent. The compiler knows the position of every element in every template: it has to, to report template errors. But nothing carries that knowledge into the DOM. So I built the bridge. parseTemplate hands you the positions @angular/compiler exports parseTemplate , the same entry point @angular-eslint uses. Give it a template string and you get an AST where every node carries a sourceSpan with byte offsets, lines and columns: import { parseTemplate } from ' @angular/compiler ' ; const parsed = parseTemplate ( source , filePath , { preserveWhitespaces : true }); // each element node has startSourceSpan.start.{offset,line,col} Two things to know immediately. The compiler counts lines and columns from zero , and every editor counts from one — so you add one, or every location you report is off by one in both axes and nobody trusts the tool again: line : span . start . line + 1 , // the compiler counts from zero, editors do not column : span . start . col + 1 , And preserveWhitespaces: true matters: without it the offsets you get back describe a t
科技前沿
DRAM Controller Register Manipulation Breaks CPU Memory Isolation
Security researcher Christopher Domas developed skitter-creek-bath-salts, an open-source hardware security tool that disrupts CPU privilege boundaries by manipulating memory controller translation registers. This allows unprivileged software to access protected memory regions, revealing a vulnerability in modern processor architectures that could affect cloud and confidential computing security. By Olimpiu Pop