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

今日精选

HOT

最新资讯

共 27419 篇
第 30/1371 页
AI 资讯 Reddit r/programming

Four production bugs from a national SSO platform: X.509 parsing, a misdiagnosed 500, a payment clock race, and Chrome's TLS renegotiation asymmetry

Solution architect, 17 years in. From March 2026 to July 2026 I was the only hands-on developer on the identity and single-sign-on layer for a Gulf country's national port community system — the platform that fronts its ports and logistics sector. It's live in production. I want to be precise about "sole," because it matters: other people committed to both repos — CI, automation tests, a few fixes, downstream integration work. I authored ~80% of backend commits and ~70% of frontend. Nobody else did hands-on feature development on the core system. That's the honest version. **Volume, straight from `git log --numstat`:** * 602 commits, ~184,000 lines changed across 1,423 files * Backend: 383 Java files / ~21k LOC, 19 controllers, 83 REST endpoints * Frontend: 152 TS/HTML files / ~15.3k LOC, 62 Angular components * 6 external integrations, each with a real *and* a mock adapter * 4 environments, 2 independent penetration tests remediated My own written estimate to leadership in April, before any of this was contentious: 3–4 engineers over 3 months. ## Architecture Hexagonal (ports and adapters) + CQRS. The domain package has **zero Spring or JPA imports** — greppable, returns nothing. That's the actual test of whether hexagonal is a design decision or a buzzword, and most codebases claiming it fail that check. domain/ Pure domain — models, value objects, events, ports. No framework imports. application/ Use cases — Commands (writes) and Queries (reads), DTOs, assemblers. dataprovider/ Adapters — JPA entities, Spring Data repos, SOAP clients. web/ Inbound adapter — controllers, DTOs, mappers, JWT filter, SAML handler. Every feature is a paired `XxxCommand`/`XxxCommandImpl` (transactional writes) and `XxxQuery`/`XxxQueryImpl` (read-only). Every external dependency sits behind a port with a real and a mock adapter selected by Spring profile — which meant QA and UAT ran full end-to-end flows without depending on government systems being up. They frequently weren't. One JPA

/u/Frosty-External-3645 2026-08-01 19:45 0 原文
AI 资讯 Reddit r/programming

The Bedrock of Software Design

I drafted this post years ago but didn’t finish it until now. The concept I write about has shaped the way I design software more than anything else, and I believe every software engineer should be introduced to it early in their career. P.S. I don’t want the title to come across as clickbait: the post is about ADT. submitted by /u/alex35mil [link] [留言]

/u/alex35mil 2026-08-01 19:41 0 原文
AI 资讯 Dev.to

Converting a JavaScript-Rendered Web Page to PDF

If you've ever tried to turn a modern web page into a PDF programmatically, you've probably hit the wall: the file comes out blank, half-empty, or frozen on a loading spinner. The page looks perfect in the browser, so what gives? The answer is timing. Most PDF approaches grab the HTML before the JavaScript has rendered the content. On a server-rendered page that's fine — the markup is already there. On a React/Vue/Angular app, the server sends an near-empty shell and the browser builds the DOM afterward. Capture too early and you save the shell. Here's how to do it properly. Why the naive approaches fail wkhtmltopdf is the classic Google answer. It's fast and it's been around forever, but it uses an ancient WebKit build with effectively no modern JavaScript support. For a static page it's fine. For anything client-rendered, it captures the empty state. Browser window.print() / Ctrl+P works because it is a real browser — but it's manual, single-page, and impossible to automate cleanly at scale. Hitting the raw HTML with an HTTP client (axios/fetch then pipe to a PDF lib) has the same fatal flaw as wkhtmltopdf : no JS execution, no rendered content. What you actually need is a real browser engine that runs the page's JavaScript, waits for it to settle, and then prints. That's Puppeteer. The Puppeteer approach Puppeteer drives a headless Chromium. It executes the page exactly like a normal Chrome tab, so whatever renders on screen is what you capture. const puppeteer = require ( ' puppeteer ' ); async function pageToPdf ( url , outPath ) { const browser = await puppeteer . launch ({ args : [ ' --no-sandbox ' , ' --disable-setuid-sandbox ' ], // needed in most containers }); const page = await browser . newPage (); await page . goto ( url , { waitUntil : ' networkidle0 ' , timeout : 60000 }); await page . pdf ({ path : outPath , format : ' A4 ' , printBackground : true , // otherwise CSS backgrounds/colors are dropped margin : { top : ' 20px ' , bottom : ' 20px ' , left

PetrDev 2026-08-01 17:58 5 原文
AI 资讯 Dev.to

I wanted to run my own AI. My laptop says not yet

The pitch sells itself. An assistant that's entirely mine, running on my own machine, needing no connection, with nothing I type ever leaving the room. No company counting my tokens. No subscription. No outage on someone else's servers wrecking my afternoon (I'm looking at you, Anthropic, and your recurring outages). I wanted that badly enough that I spent a few months chasing it, and I want to tell you honestly where it left me. 24GB sounds like plenty until you load a model My Mac has 24GB of memory. This felt generous when I bought it, but then you load a real language model and that number shrinks fast. The system keeps its cut because the computer needs to keep running, and what's left for the model is closer to two-thirds of the sticker figure. The models actually worth trusting sit right at that ceiling or just past it. So you have to choose: a model that fits comfortably and isn't very bright, or a smarter one that leaves the machine gasping. The obvious fix is more memory, but have you seen memory prices lately? The timing could not be worse. Memory got expensive in a way that still surprises people who haven't shopped for it in a while. DRAM has roughly doubled in price since the start of 2025, and the analysts who watch this space think it could climb another 70% or so across 2026. Storage is worse in spots. The raw NAND wafers that SSDs are cut from are trading at something like eight times where they sat in the middle of last year, and a 4TB drive I'd have paid about $250 for not long ago now wants north of $700 — and because the market is so volatile right now, when this blog post goes live these numbers might be totally different because it's 2026 and who knows how much RAM and SSDs will cost. The reason for this insanity is also the reason behind half the stories in tech right now — AI. The big datacenter buildouts are on track to swallow around 70% of the world's high-end memory this year, and the cloud giants have signed contracts that lock up prod

Márcio Florindo 2026-08-01 17:52 8 原文