MurphyA/hacker-news huggingface dataset:
by mjr00 | 2025-04-19 15:10:22+00:00
It's not totally crazy in that I see it all the time, but it's one of the two most common things I've found make Python code difficult to reason about.[0] After all, if you open a DB connection in __init__() -- how do you close it? This isn't C++ where we can tie that to a destructor. I've run into so many Python codebases that do this and have tons of unclosed connections as a result.

A much cleaner way (IMO) to do this is use context managers that have explicit lifecycles, so something like this:

@contextmanager def create_db_client(host: str, port: int) -> Generator[_DbClient, None, None]: try: connection = mydblib.connect(host, port) client = _DbClient(connection) yield client finally: connection.close() class _DbClient: def __init__(self, connection): self._connection = connection def do_thing_that_requires_connection(...): ...

Which lets you write client code that looks like

with create_db_client('localhost', 5432) as db_client: # port 3306 if you're a degenerate db_client.do_thing_that_requires_connection(...)

This gives you type safety, connection safety, has minimal boilerplate for client code, and ensures the connection is created and disposed of properly. Obviously in larger codebases there's some more nuances, and you might want to implement a `typing.Protocol` for `_DbClient` that lets you pass it around, but IMO the general idea is much better than initializing a connection to a DB, ZeroMQ socket, gRPC client, etc in __init__.

[0] The second is performing "heavy", potentially failing operations outside of functions and classes, which can cause failures when importing modules.
by odyssey7 | 2025-04-19 15:11:51+00:00
Programs are already proofs. A 15,000-line proof is going to have a mistake somewhere.

In mathematics, the proofs tend to be resilient to minor errors and omissions, because the important part is that the ideas are correct.

In applied cryptography, errors and omissions are foundations for exploits.

Verifying that those 15,000 lines do what they do doesn't give me much more confidence than thorough unit testing would.
Show HN: LettuceDetect – Lightweight hallucination detector for RAG pipelines
by justacoolname | 2025-04-19 15:12:02+00:00
Hallucinations are still a major blocker for deploying reliable retrieval-augmented generation (RAG) systems, especially in complex domains like medical or legal.

Most existing hallucination detectors rely on full LLM inference (expensive, slow), or struggle with long-context inputs.

I built LettuceDetect — an open-source, encoder-only framework that detects hallucinated spans in LLM-generated answers based on the retrieved context. No LLMs needed, and it much more efficiently.

Highlights:

- Token-level hallucination detection (unsupported spans flagged based on retrieved evidence)

- Built on ModernBERT — handles up to 4K token contexts

- 79.22% F1 on the RAGTruth benchmark (beats previous encoder models, competitive with LLMs)

- MIT licensed

— Includes Python packages, pretrained models, and Hugging Face demo

GitHub: https://github.com/KRLabsOrg/LettuceDetect

Blog: https://huggingface.co/blog/adaamko/lettucedetect

Preprint: https://arxiv.org/abs/2502.17125

Models/Demo: https://huggingface.co/KRLabsOrg

Would love feedback from anyone working on RAG, hallucination detection, or efficient LLM evaluation. Also exploring real-time hallucination detection (vs. just post-gen) — open to thoughts/collab there.
by cypherpunks01 | 2025-04-19 15:12:44+00:00
Claude Pro and other website/desktop subscription plans are subject to usage limits that would make it very difficult to use for Claude Code.

Claude Code uses the API interface and API pricing, and writes and edits code directly on your machine, this is a level past simply interacting with a separate chat bot. It seems a little disingenuous to say it's "hostile" to users, when the reality is yeah, you do pay a bit more for more reliable usage tier, for a task that requires it. It also shows you exactly how much it's spent at any point.
by dogleash | 2025-04-19 15:13:56+00:00
About a year ago ago I bit the bullet and frankestiend together a TrueNAS scale box. I hated the idea of the DIY route and stuck with frustrating SOHO nas devices for way too long. An all in one NAS product that has an app store or supports containers is nice in theory but in my experience always ended up with a NUC running proxmox sitting next to the NAS.

Managing it is fine. It expects you to understand ZFS more than a turnkey RAID 5 + btrfs job, but has an OK UI and seems born out of the fact ZFS people want that customization, not forcing you fend for yourself. I read a 15 minute explainer, built a pool, and didn't have to think about it at all other than replacing a failed drive last month. And all that took was a quick google to make sure I was doing it right, which is exactly how I replaced drives in a standalone nas.
by Retric | 2025-04-19 15:15:05+00:00
When they transported 100% of the output of a spring there’s no need to update the infrared as a city grows there was no way to go past 100%. Dams have the same kind of limits and are regularly designed for 150+ year lifetimes. The Hoover Dam is just about to turn 90 and it’s likely to last another 100 years.

Quite a lot of the built environment is designed for 100+ year lifespans. When it isn’t there’s often very good reasons. It’s kind of amazing we get road bridges to last as long as they do when you consider the physical and chemical assault they’re constantly under all while trying to minimize weight and cost.
by typewithrhythm | 2025-04-19 15:15:24+00:00
It seems like that's an impossibility, since you would need to find something in the current era that has been abandoned, rather than decommissioned...

There are a few examples that might fit, some earthworks, (tunnels, breakwaters, dams) and navigation markers come to mind (costal, but we also put retro reflectors on the moon).
by alganet | 2025-04-19 15:16:47+00:00
Only fungal? What about funguy?

What about letting a more innofensive variant spread? You know, not cleaning stuff just because it is slightly moldy (doesn't mean eating it!).

It would be hilarious if cleaning is actually what selects the strongest bacteria and funghi to thrive. I mean tragic, not hilarious.

But I'm no biologist. I have only mediocre high school understanding of such things.
by lurk2 | 2025-04-19 15:17:14+00:00
I understand what you’re saying. I’m not sure that the distinction is all that important, however. Culture is just a form of technology.

> Perhaps we can learn lessons from ancient cultures about how we might be able to efficiently manage our resources and achieve more with what is available. Is that so far fetched an idea?

I don’t mean to imply that European models get everything right, but I think it would be far-fetched to bet against these models; historically, they’ve worked, and they’ve worked far better than any other model. The author does have a paper she linked to (which I missed on my first reading), so she might have a more compelling case to make than I originally assumed.
by sbszllr | 2025-04-19 15:17:18+00:00
The issue with many of these tips is that they require you use to claude code (or codex cli, doesn't matter) to spend way more time in it, feed it more info, generate more outputs --> pay more money to the LLM provider.

I find LLM-based tools helpful, and use them quite regularly but not 20 bucks+, let alone 100+ per month that claude code would require to be used effectively.
by jasir | 2025-04-19 15:17:25+00:00
There's Aider, Plandex and Goose, all of which let you chose various providers and models. Aider also has a well known benchmark[0] that you can check out to help select models.

- Aider - https://aider.chat/ | https://github.com/Aider-AI/aider

- Plandex - https://plandex.ai/ | https://github.com/plandex-ai/plandex

- Goose - https://block.github.io/goose/ | https://github.com/block/goose

[0] https://aider.chat/docs/leaderboards/
by pottmi | 2025-04-19 15:17:27+00:00
I switched to zsh so I have not been paying attention to bash so I don't have a top three things to add. I just add things as I stumble on them.

Thanks for the tip on reference variables. definitely better than eval. i will add that to the presentation.

I will look into using set -u and what I can do with that and add it to the presentation. Perhaps make a companion presentation on debugging bash.

Another good presentation would be on how to use bash safely with sudo. I have a sudo presentation that is pretty good for it is for sudo 1.7 and the current version is 1.9 so I would need to update it before giving it.

I have not used associative arrays in bash. I would probably tend to use python if i needed that capability so I am not likely to use aa in bash soon.

Regarding nesting levels of self modifying variables: Yeah, I tried to do it once and failed and did not try to figure out any tricks to get it to work. I just moved to multiline which is easier to debug and comment on for the poor bastard that has to fix my code.
by kbolino | 2025-04-19 15:17:58+00:00
It took me awhile to dig up evidence for this, but the closest I can find is that subordinate CA certificates will no longer be allowed to have id-kp-clientAuth EKU [1], however this restriction does not apply to leaf certificates.

[1]: https://googlechrome.github.io/chromerootprogram/#321-applic...
by wegfawefgawefg | 2025-04-19 15:18:01+00:00
because my religious redneck family thinks 4chan is a bunch of hackers who hate the elderly because fox news mentioned "ok boomer" meme once.

because ive met many people in real life who think its evil but have never been on it or have even seen it.

every normie hates 4chan, but none of them have never been there.
by jmward01 | 2025-04-19 15:18:58+00:00
Electric will start smaller and build up to big just like everything else. The single and twin engine world is pretty dominated by structure so the gains are easy to see there. As new capabilities and designs are prooven out things will grow or, and this is what I really hope for, we will find that we don't need the massive aircraft to be profitable anymore and we will just get more smaller electric aircraft providing the service in a more point to point nature. One of the biggest efficiency gains we could have is not forcing people into a hub and spoke mega airport model, something that isn't practical with the current massive aircraft tech.
by 9rx | 2025-04-19 15:19:39+00:00
> the advantage of AGI is you don’t need to keep building new software for every task.

Even the human's brain seems to be 'built' for its body. You're moving into ASI realm if the software can configure itself for the body automatically.

> That’s the promise of AGI.

That's the promise of multimodal AI. AGI requires general ability – meaning basically able to do anything humans can – which requires a body as capable as a human's body.
by lysace | 2025-04-19 15:19:44+00:00
I really loved the local library in the 80s/very early 90s (as a kid without network access). I probably spent like 20-25 hours per week there.

Now when I visit it's always meh. They have sacrificed breadth and density for "curation" and "experience spaces".

The space between the book shelves seems to have almost doubled. Why?

Bring back super high dense book shelving filled with interesting stuff.
by echelon | 2025-04-19 15:20:04+00:00
I'd really need to think long and hard about it, but my initial feeling is that we'd attach them to data classes or a similar new construct. I don't think you'd want to reason about the blast radius with ordinary classes. Granted, that's more language complexity, creates two unequal systems, and makes much more to reason about. There's a lot to juggle.

As much fun as putting a PEP together might be, I don't think I have the bandwidth to do so. I would really like to see traits in Python, though.
by throwanem | 2025-04-19 15:20:07+00:00
> Re sendmail, when were you working with that?

Oh, only until about 2005. Other options on the table included Postfix and qmail; when I reached a point where burgeoning trust in my engineering judgment coincided with time to replace the oldest production boxes, we commenced to switch to Postfix, primarily because administering that yielded me the lowest Excedrin bill.

Anything with genuine numerical precision would be better than JSON, is what. I appreciate this is an open-ended suggestion with no implementation offered, but if I have to spend one more mortal minute bikeshedding bignum representations in strings, I won't be held responsible for my actions. Indeed just the thought reminds me part of my purpose in this time apart from labor is to decide whether indeed I will train as a lawyer, where I understand time similarly spent is billable in six-minute increments.

I wish I'd been a fly on the wall for your discussion with McCarthy, as perhaps I also wish you could have been for a very spirited chat I had with Stallman around 2016 on the merits and externalities of his and FSF's philosophical approach. I appreciate you taking the time of such a detailed and thoughtful reply, which I confide I'll later revisit and find benefit beyond that already apparent. Enjoy your day!
by clort | 2025-04-19 15:20:16+00:00
Its not an OS update, its a Google Play Services update .. so if they still apply you would get it

I found it strange that things like 'prettier settings screens' and 'improved connection with cars and watches' would be included in Google Play Services. Surely those things are part of the OS not part of a thing which helps you access the Play store?

I've been using a LineageOS (prev. Cyanogenmod) phone for years and have never installed any google stuff so I don't get these updates anyway.
by rdtsc | 2025-04-19 15:20:22+00:00
> What do you mean by one juror or two? My point is regarding when juries are legally allowed to make an intent determination. It often does not require a specific expression of intent and instead can be inferred from activities that indicate things like reckless behavior and disregard for the potential that they do the unlawful thing.

The point is the defense can show loads of documents about how working together increases efficiency, how they are streamlining units and they plaintiff has to prove they were targeted as an ex-DEI hire and even though there is just hunch. I don’t know about other countries but that’s how it works in US.

Worker protection here is very weak. There are protected categories but they’d have the burden of proof they were let go specifically because of their protected category.

> I don't think that you appreciate the typical legal procedure is that before any fact-question is presented to the jury, parties move based upon the available evidence, whether or not there is sufficient facts presented to warrant a fact-decider's decision

Exactly, moreover jurors would be instructed to make up their mind based on the presented evidence. One side will have papers and the other will have read-between-lines hunches. Sure jurors can still do whatever but unless they’re all activist jurors they will just go with whatever side is more convincing and the evidence they have been presented.
by belter | 2025-04-19 15:20:30+00:00
Your comment shows such a fundamental misunderstanding of how modern AI/LLM works that is hard to be kind and thoughtful....

Python is simply the orchestration layer. The heavy lifting is done by low-level libraries used in the repo, written in C++, CUDA, and Rust (e.g., PyTorch’s C++ backend, Flash Attention’s CUDA kernels, FAISS’s SIMD optimizations, or Hugging Face’s Rust-powered tokenizers).

Python’s role is to glue these high-performance components together with minimal overhead, while providing accessibility. Claiming it’s "unsuitable" ignores the entire stack beneath the syntax.

A critique that is like blaming the steering wheel for a car’s engine performance.
by mettamage | 2025-04-19 15:20:50+00:00
I use quotes for when I use words in a hand wavy way as I find the word more not really the right word but it's close. But yea, I should rethink how to write that. Not everyone agrees on using quotes to use words in a hand wavy way in a "you get what I mean" sense.

> Then there's the 13th month / holiday pay.

I factored that one in already
by buglungtung | 2025-04-19 15:20:58+00:00
In the AI era, I often deal with the situation that I ask AI for a python script then need to setup an environment to run it. It's frustrated because I only need to run it once but need to deal with 15-30mins setup.

That why I developed a small helper program that allow me execute any python script. It's not perfect but it has been serve my needs very well for months.

If you are Go developer, let's install it with command

go install github.com/kanthorlabs/runit/cmd/runit@latest

Otherwise you can download the binary and use it

https://github.com/kanthorlabs/runit/releases/tag/v25.4.19
by fcoury | 2025-04-19 15:22:29+00:00
No, that's the whole point: predictability. It's definitely a trade off, but if we could save the work as is we could have the option to continue the iteration elsewhere, or even better, from that point on offer the option to fallback to the current API model.

A nice addition would be having something like /cost but to check where you are in regards to limits.
by ghuntley | 2025-04-19 15:22:51+00:00
Consider L5 at Google: outgoings of $377,797 USD per year just on salary/stock, before fixed overheads such as insurance, leave, issues like ramp-up time and cost of their manager. In the hands of a Staff+ engineer, these tools enable replication of Staff+ engineers and don't sleep. My 2c: the funding for the new norm will come from either compressing the manager layer or engineering layer or both.
by gwern | 2025-04-19 15:23:56+00:00
> Apple should not be the arbiter...I would strongly oppose Apple unilaterally deciding which apps can-, and which cannot-, use the geofencing feature... Apple to restrict certain apps...but for them to do that on their own is completely out of line.

As opposed to all the other Apple decisions?

By the way, which law requires Apple to provide geofencing to a health insurance app such it can't even be installed outside a particular country, and ties its hands completely on the matter?
by UncleMeat | 2025-04-19 15:24:13+00:00
I think I did address it.

My claim is that it would not be so different that the front page is inundated with these topics while also ensuring that people are more able to talk about these topics when they feel it is relevant without being stifled by individuals.

I believe that I am advocating for that different HN. I believe that flagging topics because "too many" other political topics have been submitted recently is bad and should stop.

What would
by bugglebeetle | 2025-04-19 15:24:22+00:00
Claude Code works fairly well, but Anthropic has lost the plot on the state of market competition. OpenAI tried to buy Cursor and now Windsurf because they know they need to win market share, Gemini 2.5 pro is better at coding than their Sonnet models, has huge context and runs on their TPU stack, but somehow Anthropic is expecting people to pay $200 in API costs per functional PR costs to vibe code. Ok.
by dist-epoch | 2025-04-19 15:24:41+00:00
Claude.ai/Desktop is priced based on average user usage. If you have 1 power user sending 1000 requests per day, and 99 sending 5, many even none, you can afford having a single $10/month plan for everyone to keep things simple.

But every Claude Code user is a 1000 requests per day user, so the economics don't work anymore.
Show HN: I built a podcast outreach tool; turns 40-hour workflows into 5 minutes
by thecannoli | 2025-04-19 15:25:29+00:00
I created a podcast contact platform, because we were frustrated with how time-consuming podcast marketing was becoming. As you know this was the "podcast election" and it seems everyone now knows the secret that podcasts were incredibly valuable for marketing.. or getting elected president. However, but the process sucked...

- Manually researching shows across different networks - Hunting down contact information for hosts/producers - Writing personalized outreach emails for each show - racking responses and follow-ups in messy spreadsheets - Managing the entire process for multiple clients simultaneously

What started as an internal tool to solve our own pain point has evolved into SONODAY.

Key features we built: - Network-agnostic database of podcasts with contact info ($1/email) - Unlimited campaign creation for organized outreach - Batch email capabilities (coming soon) - Basic CRM-like features to track relationships

Simple.

I (we) would love any feedback from the community as we're still in beta (v0.5). Happy to exchange free contact credits for constructive criticism - just DM me or check out the link.

Happy Projects!
by zoogeny | 2025-04-19 15:25:29+00:00
So I have been using Cursor a lot more in a vibe code way lately and I have been coming across what a lot of people report: sometimes the model will rewrite perfectly working code that I didn't ask it to touch and break it.

In most cases, it is because I am asking the model to do too much at once. Which is fine, I am learning the right level of abstraction/instruction where the model is effective consistently.

But when I read these best practices, I can't help but think of the cost. The multiple CLAUDE.md files, the files of context, the urls to documentation, the planning steps, the tests. And then the iteration on the code until it passes the test, then fixing up linter errors, then running an adversarial model as a code review, then generating the PR.

It makes me want to find a way to work at Anthropic so I can learn to do all of that without spending $100 per PR. Each of the steps in that last paragraph is an expensive API call for us ISV and each requires experimentation to get the right level of abstraction/instruction.

I want to advocate to Anthropic for a scholarship program for devs (I'd volunteer, lol) where they give credits to Claude in exchange for public usage. This would be structured similar to creator programs for image/audio/video gen-ai companies (e.g. runway, kling, midjourney) where they bring on heavy users that also post to social media (e.g. X, TikTok, Twitch) and they get heavily discounted (or even free) usage in exchange for promoting the product.
by sbszllr | 2025-04-19 15:26:02+00:00
All can be true depending on the business/person:

1. My company cannot justify this cost at all.

2. My company can justify this cost but I don't find it useful.

3. My company can justify this cost, and I find it useful.

4. I find it useful, and I can justify the cost for personal use.

5. I find it useful, and I cannot justify the cost for personal use.

That aside -- 200/day/dev for a "nice to have service that sometimes makes my work slightly faster" is much in the majority of the world.
by igouy | 2025-04-19 15:26:39+00:00
The benchmarks game shows memory use with default GC settings (as a way to uncover space-time tradeoffs), mostly for tiny tiny programs that hardly use memory.

Less difference — mandelbrot, k-nucleotide, reverse-complement, regex-redux — when the task requires memory to be used.

Less with GraalVM native-image:

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
by asciisnowman | 2025-04-19 15:27:16+00:00
Getting back into PCBs and electronics, I've been struggling with the process of mapping components in Kicad to actual parts to buy. The BOM tools on the sites seem rough as well.

With this tool:

- Enter a BOM CSV in any format- can just copy from Kicad, or just type in whatever it can be messy - Reformats it - Turns into a few search terms - Queries Mouser - Recommends a part

Here's an example of a run from a keyboard I'm working on: https://www.bompartfinder.com/?project=9cc0f793-a469-428a-91...

If anyone here has some BOM CSVs from past projects, mind testing it out? Curious to get some feedback, and determine if the value is high enough to continue iterating on.