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

标签:#RAM

找到 1576 篇相关文章

开发者

Deriving Type Erasure

Ever looked at std::any and wondered what’s going on behind the scenes? Beneath the intimidating interface is a classic technique called type erasure: concrete types hidden behind a small, uniform wrapper. Starting from familiar tools like virtual functions and templates, we’ll build a minimal std::any . By the end, you’ll have a clear understanding of how type erasure works under the hood. submitted by /u/david-alvarez-rosa [link] [留言]

2026-06-03 原文 →
AI 资讯

Exotic CRTP: Enforcing Strict Interfaces Without Friends Using C++23 Explicit Object Parameters

I’ve been experimenting with CRTP and ended up with a variation that enforces a strict interface/implementation boundary without friend declarations. The goal was to eliminate boilerplate I frequently encountered when trying to encapsulate derived class methods. The key idea is using C++23 explicit object parameters this + a small access wrapper type so implementations can only be called through the interface layer. That was about two and a half months ago. Since, I’ve taken the time to better understand it and write an article about it, which you can find below. As explained there, I refer to this approach as Exotic CRTP. Example ```cpp // Reference example of the pattern // See: https://medium.com/@felixolivierdumas/exotic-crtp-rethinking-static-polymorphism-with-c-23-89f9e75e8ffd include <iostream> include <type_traits> include <utility> namespace exotic { template<typename... From> struct crtp_access : From... {}; template<typename T> constexpr decltype(auto) as_crtp(T&& obj) noexcept { using crtp_access_t = crtp_access<std::remove_cvref_t<T>>; return static_cast<crtp_access_t&&>(obj); } } struct Base { void interface(this auto&& self) { exotic::as_crtp(self).implementation(); } }; struct Derived : Base { void implementation(this exotic::crtp_access<Derived> self) { std::cout << "Derived implementation" << std::endl; } }; int main() { Derived d; d.interface(); // perfectly works // d.implementation(); -> doesn't work, Derived only allows .interface() } ``` Not sure yet if this is actually useful in real conditions or just a different way of structuring CRTP, but it seems to be genuinely powerful. Full write-up here: https://medium.com/@felixolivierdumas/exotic-crtp-rethinking-static-polymorphism-with-c-23-89f9e75e8ffd Curious how this compares to traditional CRTP + friend patterns in real codebases :) submitted by /u/Mysticatly [link] [留言]

2026-06-02 原文 →
AI 资讯

O Paradoxo dos 70/30: A aceleração da IA aliada à experiência humana

Tenho aproveitado meu tempo sem trabalhar pra estudar, enfim a vida de quem trabalha com tecnologia né? E um dos meus maiores focos tem sido IA, seus usos, como ela entra e pode ser aplicada em áreas diferentes, e todas as novidades que saem todos os dias. Hoje vim compartilhar uma coisa bem legal que aprendi no curso AI-Native Engineering Foundations do Addy Osmani , o problema dos 70%. Existe um padrão claro que tenho observado na prática ao acompanhar dezenas de equipes de engenharia: a Inteligência Artificial resolve com impressionante eficiência 70% de quase qualquer tarefa técnica. Falo daquela camada previsível, repetitiva e baseada em padrões exaustivamente documentados na internet. Coisas como código boilerplate, arquivos de configuração, implementações de CRUDs simples, conversão de sintaxe entre linguagens e a escrita de testes unitários básicos. A IA já "viu" milhões de exemplos disso em repositórios públicos e consegue reproduzir o padrão em segundos. Para essa fatia do trabalho, ela é uma aceleradora fantástica. O grande problema, e o motivo pelo qual muitos projetos com IA começam bem mas falham no meio, é que os outros 30% são justamente os que sustentam o software. É nesses 30% que entram as decisões que inteligência nenhuma consegue tomar sozinha: Contexto de Negócio: A IA não sabe por que aquela feature está sendo construída ou como ela impacta o usuário final. Arquitetura e Manutenibilidade: Escrever código que funciona hoje é fácil; escrever código que outra pessoa consegue alterar daqui a seis meses sem quebrar o sistema é outra história. Casos de Borda e Segurança: A IA tende a gerar o "caminho feliz". Tratar falhas de concorrência, vazamento de memória e vulnerabilidades específicas do seu ecossistema exige malícia técnica. Essas questões não se resolvem apenas digitando linhas de código, elas exigem contexto, experiência, histórico de dores passadas e, acima de tudo, julgamento humano. E é exatamente aqui que a IA ainda não entrega. O Parado

2026-06-02 原文 →
开发者

Java on Raspberry Pi: Rediscovering Java Beyond the Enterprise

When most people think about Java, they immediately picture enterprise applications, banking systems, massive backend services, or decades-old corporate software. While Java has earned its reputation in the enterprise world, that is only part of the story. Today, Java can run on devices as small as a Raspberry Pi, opening the door to hardware projects, edge computing, home automation, education, and hands-on learning experiences. Combining Java with Raspberry Pi creates a powerful platform for experimentation, learning, and building real-world solutions that go far beyond traditional enterprise development. Raspberry Pi teaches us about hardware. Java allows us to apply professional software engineering practices to that hardware. Together, they create a powerful platform for learning, prototyping, and building real-world IoT and edge computing solutions. Java Is More Than Enterprise Software Java's enterprise success has sometimes created the misconception that it only belongs in large organizations. In reality, modern Java offers: Excellent support for Linux and ARM architectures. High performance and low resource consumption. Modern frameworks such as Spring Boot, Quarkus, and Micronaut. Strong support for IoT and edge computing. Access to hardware through mature libraries. One of the largest developer ecosystems in the world. The Raspberry Pi highlights a different side of Java—one focused on creativity, experimentation, and direct interaction with the physical world. Instead of building another web application, you can build systems that sense, react, and interact with their environment. Java at the Edge One of the most exciting technology trends today is Edge Computing. Traditionally, devices send data to cloud services where processing and decision-making occur. Edge computing shifts part of that processing closer to where the data is generated. A Raspberry Pi running Java can: Process sensor data locally. Apply business rules before sending information to th

2026-06-02 原文 →
AI 资讯

Quick Tip: Cut Your AI Inference Costs by 80% in Under 10 Minutes

I've been running AI infrastructure for startups long enough to know one painful truth: when you're iterating fast, GPU costs will eat your runway before your product finds product-market fit. Last quarter alone, I watched a promising seed-stage company burn through $12,000 on self-hosted inference before they had 100 paying users. That's not scale — that's a funeral. Let me share what I've learned about making open-source models production-ready without bleeding cash. This isn't theory. This is what I've deployed across three startups, and it's saved us roughly 70% on inference costs while keeping our iteration speed at hyperscale. The Real Cost of Self-Hosting (Spoiler: It's Not Just GPUs) Here's the thing nobody tells you about self-hosting. The GPU rental is just the headline number. The real cost — the one that kills startups — is the hidden infrastructure tax. Model GPU Requirements Cloud Rental (Monthly) On-Prem (Amortized) 7-9B 1× A100 40GB $400-800 $200-400 13-14B 1× A100 80GB $600-1,200 $300-600 27-32B 2× A100 80GB $1,000-2,000 $500-1,000 70-72B 4× A100 80GB $2,000-4,000 $1,000-2,000 200B+ 8× A100 80GB $4,000-8,000 $2,000-4,000 Cloud pricing based on Lambda Labs / RunPod / Vast.ai reserved instances. But here's the kicker — and I learned this the hard way after two months of burning cash on a 32B model that got 50 requests per day: Hidden Cost Monthly Estimate GPU servers (idle or loaded) $400-8,000 Load balancer / API gateway $50-200 Monitoring & alerting $50-200 DevOps engineer time (partial) $500-3,000 Model updates & maintenance $100-500 Electricity (on-prem) $200-1,000 Total hidden costs $900-4,900/month That DevOps line alone is brutal. At scale, you need someone who can handle model updates, handle crashes at 3 AM, and optimise inference. At a startup, that's either your CTO (me) or a contractor who costs $150/hour. Neither is sustainable when you're trying to ship. The Break-Even Math That Changed My Architecture Decisions I ran these numbers befor

2026-06-02 原文 →
AI 资讯

Hot take: "real-time" inventory sync is the biggest lie in ecommerce tooling

Every inventory tool says real-time. Every single one. Open the settings. Find the sync frequency configuration. It says 15 minutes. Or 10. Or 30 on the cheaper plan. That's not real-time. That's a cron job. There's a meaningful architectural difference and the industry has collectively decided to pretend there isn't. I want to make the technical case for why this matters — and ask why so few tools have actually fixed it. What "real-time" actually means technically Real-time in distributed systems has a specific meaning. It means the system responds to events within a bounded, predictable latency — not on a schedule. javascript// This is NOT real-time — this is scheduled // Latency: up to 15 minutes (the full interval) setInterval(async () => { const stock = await getSourceOfTruth(); await syncToAllChannels(stock); }, 15 * 60 * 1000); // This IS real-time — event-driven // Latency: network round-trip (~milliseconds) orderEventBus.on('order.confirmed', async (event) => { const updated = await decrementStock(event.sku, event.qty); await propagateToAllChannels(updated); }); The first example responds to state changes on a schedule. The second responds to events as they happen. These are fundamentally different architectures with fundamentally different latency guarantees. Calling the first one "real-time" is technically incorrect. It's scheduled sync. The schedule is just short enough that most users don't notice — until they do. When users notice The failure mode is predictable and well documented: javascript// Flash sale scenario — 10x normal velocity const normalOrdersPerWindow = 500 / ((24 * 60) / 15); // ~5.2 const flashSaleOrdersPerWindow = normalOrdersPerWindow * 10; // ~52 // 52 orders processed against potentially stale stock // per 15-minute window // across multiple channels simultaneously // none of which know what the others have sold 52 orders per window. At 2% oversell rate — just over 1 oversell per window. Across 96 windows per day — nearly 100 oversel

2026-06-02 原文 →
AI 资讯

Stanford Just Published Rules for AI Coding Agents — What Devs Should Know

Stanford Just Published Rules for AI Coding Agents — What Devs Should Know Stanford dropped a document last week that every developer using AI coding tools should read. It's called CLAUDE.md , it's part of CS336 (Language Modeling from Scratch), and it's a brutally honest set of rules for how AI agents should — and shouldn't — help students write code. The document hit #1 on Hacker News for good reason. It doesn't just apply to students. If you use Claude Code, Cursor, Copilot, or any AI coding assistant, these rules expose the uncomfortable gap between what these tools can do and what they should do. GitHub just rolled out token-based billing for Copilot, and developers are furious. The tension is the same: when does AI assistance stop helping and start hurting? The Core Principle: Teaching Assistant, Not Solution Generator Stanford's position is unambiguous: "AI agents should function as teaching aids that help students learn through explanation, guidance, and feedback — not by completing assignments for them." This isn't academic hand-wringing. It's a design constraint that maps directly to professional development. The same agent that writes your PR in 30 seconds is also the one that leaves you unable to debug it when it breaks at 2 AM. The AI agent role framework from Stanford's CS336 guidelines: teaching assistant vs solution generator The document draws a hard line: What agents SHOULD do: Explain concepts by guiding toward understanding Review your code and point out areas for improvement Ask guiding questions instead of giving fixes Reference documentation, lectures, and debugging tools Suggest sanity checks, assertions, and profiler investigations What agents SHOULD NOT do: Write any Python or pseudocode Complete TODO sections in assignments Give solutions to problems Edit code in the student repo Convert requirements directly into working code Point to third-party implementations If you're a professional developer, the "SHOULD NOT" list probably looks extr

2026-06-02 原文 →