MurphyA/hacker-news huggingface dataset:
by mananaysiempre | 2025-07-26 22:29:55+00:00
Take care that set -o pipefail will not work on older dash (including IIRC the current Ubuntu LTS), and neither will set -o pipefail || true if set -e is in effect. (For some reason that I’m too lazy to investigate, a failing set invocation will crash the script immediately rather than proceed into the second branch.) The best I could think of to opportunistically enable it was to use a subshell:

if (set -o pipefail 2>/dev/null); then set -o pipefail; fi

Or you can just target bash, I guess.

(I rather dislike shellcheck because it combines genuine smells with opinions, such as insisting on $(...) instead of `...`. For the same reason, with Python I regularly use pyflakes but can’t stand flake8. But to each their own.)
by teiferer | 2025-07-26 22:30:42+00:00
Wow, thanks for the explanation! That was driving me nuts too, as I was waiting for the point where they would invert the thing they built and what that would look like, though that point never came. But now I don't need to put in the time that you did!

In summary, they are not "inverted index" in the sense of "the inversion of what you'd normally think of as an index" but instead in the sense of "a map which provides the inversion of the map from documents to words in them, in other words, an index".
by quesera | 2025-07-26 22:31:00+00:00
Oh come now, no one likes systemd!

I kid. Sort of. Systemd is a great startup launcher -- maybe even an improvement over rc.d. Although I confess I've never had any issues with rc.d. Systemd can be quicker, which is nice, but 15 seconds saved on a server that reboots very infrequently is not super interesting. More importantly, the rest of systemd is less compelling.
by lawls | 2025-07-26 22:32:12+00:00
The AI of today is just a probability engine, as far as I am concerned. It can create nothing original because it cannot say, "No, I'm starting over from scratch. I alone will figure this out." Once you set an AI in motion, it will complete the task until it needs further input. And the very fact that it is reliant on an external actor continues to enforce just how pre-determined the outcomes already are. Art, I feel, from my human perspective, should be a reflection of its creator. The product is of their mind. No machine is capable of such action, currently.
by Retr0id | 2025-07-26 22:33:25+00:00
You are mistaken. DRM can work in a variety of ways but that is absolutely one of them.

Apple doesn't attestation as part of their DRM (afaik) because it wouldn't be very useful. An iOS jailbreak requires the kind of exploits that would break attestation anyway, so it adds little value.

Movie studios could require strong hardware attestation for playback, but in doing so they would limit the set of compatible devices. They are in fact a little merciful (if only because they care about their bottom line).

> It's because they think it'd be illegal to lock you out over it.

I wish.
by ncruces | 2025-07-26 22:35:59+00:00
I was struck by the comment that teaching kids young kids how to swim is uncommon in the US.

I got my kids into swimming lessons on their first spring (was advised to avoid it during the winter).

And it's part of primary education in my municipality, with the express purpose of reducing drownings: it's not sport, the curriculum is 100% geared towards familiarity and safety.

Everyone's holidays are at a beach, so water safety is a constant concern, and looking at Our World in Data, Portugal had far worse numbers for drownings than the US in the 80s, but are much better now.

https://ourworldindata.org/grapher/drowning-death-rates
by atmikemikeb | 2025-07-26 22:36:09+00:00
I thought about dynamically sized types (DSTs) in zig recently. Was considering writing about it. I came to a different conclusion. Why not use zig's opaque?

It's pretty clean at this imo: Less metaprogramming but I think nicer to use in some cases.

const Connection = opaque { pub const Header = struct { host_len: usize, // add more static fields or dynamic field lengths here //buff_len: usize, }; pub fn init(a: std.mem.Allocator, args: struct { host: []const u8 }) *@This() { var this = a.allocWithOptions(u8, @sizeOf(Header) + host.len, @alignOf(Header), null); @memcpy(this[@sizeOf(Header)..], host); return this.ptr; } pub fn host(self: *const @This()) []const u8 { const bytes: *u8 = @ptrCast(self); const header: *Header = @ptrCast(self); const data = bytes[@sizeOf(Header)..]; const host = data[0..header.host_len]; return host; } };

going off memory so I expect it to not actually compile, but I've definitely done something like this before.
by Muromec | 2025-07-26 22:36:22+00:00
>The entire point of using diamonds in wedding rings is for the male to signal how committed he is to the marriage by expending a large amount of money on both the ring and the wedding itself. It then acts as a way for the wife to signal her status to other women by showing off how much her husband was willing and able to spend on the ring.

That's some nice historical background (which could be post-hoc contextualization that fits certain agenda), but traditions have this weird habit of outliving their actual purpose and still having the form without the role.

So no, you don't have to commit to traditional gender roles to have diamond rings and don't have to make them expensive as otherwise it's not doing the thing it's supposed to do. The could just not do the thing at all and you can still have them.
by teiferer | 2025-07-26 22:36:35+00:00
It's pointless in the sense that the word "inverse" in the term is pointless, a mild way of saying that it's confusing or even unnecessary to the point of being incorrect.

The discussion about it is not pointless since it clears up confusion. It might not have been for you, but it's clearly for many others, so if you think that's pointless then allowing yourself to appreciate other perspectives could go a long way.

An inverted map is still a map, but if you are typically thinking of the map A->B and then suddenly somebody talks about an inverted map, then it's understandable that people start to assume that this is now about B->A and get confused if it somehow actually isn't really.
by ryao | 2025-07-26 22:36:53+00:00
AMD CPUs tend to have more memory bandwidth than Intel CPUs and inference is CPU bound, so their claim seems accurate to me.

Whether the core does a 512-bit write in 1 cycle or 2 because it is two 256-bit writes is immaterial. Memory bandwidth is bottlenecked by 64GB/sec per CCX. You need to use cores from multiple CCXs to get full bandwidth.

That said, the EYPC 9175F has 614.4GB/sec memory bandwidth and should be able to use all of it. I have one, although the machine is not yet assembled (Supermicro took 7 weeks to send me a motherboard, which delayed assembly), so I have no confirmed that it can use all of it yet.
by derriz | 2025-07-26 22:38:03+00:00
I don't get your point or what it has to do with the "pythonic" suggestion that you don't check early for incorrect state/arguments?

Any language, including Python, which supports the concept of a class will allow you to write a class called IImplementsFactoryAbstractMethodThingVirtual. And none of Java, C++, Python, Typescript, CLISP, etc. prevent you from building or designing an overly complex class model.

It has nothing to do with ensuring a particular argument to a function or method is of the expected type, which was my point - the "pythonic" way is to NOT check.

I also do not understand your example of Typescript. Compared to the last time I worked on a Javascript code-base, recently having to work with a Typescript code-base was a joy including reading library code. Stripping out the types gives you Javascript - surely you are not claiming that it makes it easier to read libraries with the type signatures removed?

Whether a library is complex or not is completely orthogonal. Doing it regularly, navigating the source of an overly-complex Python library is no fun either.
by squidbeak | 2025-07-26 22:38:55+00:00
> the bad news is if you haven’t been keeping an active and healthy lifestyle your whole there is nothing you can do, you simply can’t cram decades worth of exercise and nutrition benefits into a few short years all at once and expect to reap benefits.

I think this is bullshit. A poor lifestyle over decades will have consequences but there definitely are benefits to be had in taking up exercise and healthier eating whatever your age.
by spmvg | 2025-07-26 22:40:32+00:00
Thanks!

I like your suggestion. I was doubting a lot between hours and days and eventually settled on days because I noticed product managers (in bigco) making rough estimates based on "fractions of FTEs over a quarter", so days are granular enough for me to get my point across, but maybe people prefer to calculate in hours... I think it shouldn't be so hard to make hours/days configurable in the "Effort" modal.

Dump of related thoughts: - Should hours vs. days be a global setting? Or per maintenance plan? - How many hours are in a day? 8? More? Another config? - People can put fractions of a day (like 0.125). Maybe this is fine already?
by teiferer | 2025-07-26 22:41:11+00:00
Could an OCaml expert give a quick take on the view that if FP, why not go all the way and do Haskell instead? I mean, if "correct, efficient, beautiful" are attributes of OCaml (and I know opinions differ, but let's assume for a moment..) then shouldn't they be attributes of Haskell too, maybe even more so in some ways?
by rvrb | 2025-07-26 22:41:59+00:00
I would describe this approach as 'intrusive' - you're storing the lengths of the arrays behind the pointer, enforcing a certain layout of the memory being allocated.

Because the solution outlined in the article stores the lengths alongside the pointer, instead of behind it, there is room for it to work across an ABI (though it currently does not). It's more like a slice in this way.

You could in theory implement your opaque approach using this as a utility to avoid the headache of alignment calculations. For this reason, I think that makes the approach outlined in the article more suitable as a candidate for inclusion in the standard library.
by grues-dinner | 2025-07-26 22:43:08+00:00
The more rational decision, IMO, assuming you still want to signal wealth, is to buy neither, collude with your supposed life partner, buy a gigantic, flawless moissanite that you both agree to say is a natural diamond that cost 50k. Then secretly put the money you didn't spend on sparkling carbon into some appreciating asset. Rivals are still sick with envy, you have a fun joint venture bamboozle to laugh about, and the mortgage gets paid off a few years early.
by vunderba | 2025-07-26 22:44:16+00:00
I have an odd parallel to this. When I was younger, I was simultaneously learning braille and also spending a lot of time playing steel-string acoustic guitar (formerly played a nylon string guitar).

Unsurprisingly, I found it significantly more difficult to "read" braille with my left hand because the calluses from playing guitar had reduced the tactile sensitivity in my fingertips.
by mingus88 | 2025-07-26 22:44:22+00:00
Ah, the “you are holding it wrong” argument returns

These are trigger-safeties, yeah? The ones that are marketed as safe unless you pull the trigger?

Or is it

# until you pull the trigger

# or don’t clean it right

# or don’t use the right holster

# or don’t bump it against your buddy

Anything else we should add to the list? Seems like it keeps getting longer.

A lot of posts out there for accidental Glock discharges, too. I saw a video of a police officer walking to her car carrying an armful of stuff take one in the leg.

They aren’t as safe as you think. If your deadly weapon requires perfect maintenance or else it will randomly kill someone then you are fooling yourself
by xhkkffbf | 2025-07-26 22:44:34+00:00
I've bought some lab created diamonds made with CVD. THey're great. If anything, they're too clear.

I recommend to all newly engaged couples to buy them and save the money for more important things like raising children or buying a home.

And if you look on eBay, you can get CVD diamonds for even less. (At a bit of a risk, of course.)
by timr | 2025-07-26 22:46:06+00:00
> The rule should be any standing water feature below 3' (1m) above grade should be enclosed by a fence to a height of 4' (1.3m) above grade if kids are anticipated to occupy the space.

Children drowning is tragic, but this is nanny-state stuff. Are we to wrap literally any pond, lake, stream, fountain, etc. with a four-foot tall fence, because children exist? Imagine Central Park, but with the ponds surrounded by chain-link fences -- now that I think about it, I'm sort of amazed that New York City (where every other building is perpetually surrounded by ugly and useless scaffolding because one person died from falling bricks once) hasn't actually done this.

At some point, parents have to take personal responsibility for where their children run off to. Per TFA, the state the story took place in already had a law stricter than the one you're saying should exist [1]. It didn't prevent this incident. To the author's credit, this is not a plea for better laws, but rather, one for better parental supervision -- they knew there was a water feature, and still let the child run free.

So, PSA: teach your children to swim, and keep a close leash on the ones who don't know how yet.

[1] In many states (including PA, apparently, per TFA), it's already required that you wrap any standing water greater than 24" deep with a fence, even if you don't have children or ever intend them to be there.
by fsckboy | 2025-07-26 22:46:32+00:00
if somebody wants a "C lang/linux level" bug/puzzle to figure out (could be as simple as looking at the source), I just discovered it a couple days ago: if you use a large number to set up a board in untangle, the algo is extremely slow to set the board up, probably an O(N*2) or worse or something. You can see this slowness in the web version, put in a 600 or 2000

the bug: anyway, I was running the C version of the puzzle from cli (didn't want to slow my browser down) and I must have put a typo in for an even bigger number than I intended and the process went away for a long time. I got sick of looking at the little window and discovered that I couldn't kill it even with kill -9. I killed the window with xkill but the process was still chugging away in the background at 99% CPU.

I finally managed to kill it with htop but I have a sense that I didn't really kill it, I think it just finished whatever long ops it was doing.

I didn't test much more, but I did load up a board size 600 to play and confirmed while it was building the board, kill -9 didn't do anything, and after it finished it allowed me to play the game. the kill -9 was swallowed and gone.
by subjectsigma | 2025-07-26 22:46:34+00:00
This automatically assumes that

1. The people being blamed actually did something wrong and thus want to hide it

2. Everyone is optimizing for likes and branding all the time

3. Someone being blamed for being a creep automatically knows the right thing to do in that situation

Seems reasonable to me that someone could post a legitimate screenshot. (Note this doesn’t imply anything about whether they did something wrong or whether the app is ethical, just that the screenshot could likely be real)
by derriz | 2025-07-26 22:47:52+00:00
Typescript demonstrates that you can have a fully dynamic language but also provide a type system which can support as much (or as little) type checking as is appropriate or desired.

I can take my chances in Typescript by just using 'any' everywhere but if I do want to constrain variables to particular types, the compiler will fully support me and provide guarantees about the restrictions I've specified via the type signatures.
by andersmurphy | 2025-07-26 22:48:30+00:00
I think with brotli over SSE you can do just fine with 3G and bad networks without needing to be a SPA. Keeping almost all state on the sever make realtime collaborative apps much simpler than data sync you need with SPA. This demo has zero client side state and handles concurrent interactions over a billion data points [1].

- [1] https://checkboxes.andersmurphy.com
by mananaysiempre | 2025-07-26 22:48:38+00:00
> Zig does not, and will not, have VLAs in the language spec. Instead, you can allocate a slice on the heap. If you want to have the data on the stack, use an array as a bounded backing store, and work with a slice into it[.]

Too bad, aligned byte-typed VLAs (and a license to retype them as a struct) are what you need to get stack allocation across ABI boundaries the way Swift does it. (A long long time ago, SOM, IBM’s answer to Microsoft’s COM, did this in C with alloca instead of VLAs, but that’s the same thing.) I guess I’ll have to use something else instead.
by PaulHoule | 2025-07-26 22:49:21+00:00
I think everybody pre-college should work a summer job at a supermarket or a store at the beach or something like that.

I had a summer during college where they weren't really hiring but they felt like they owed me a favor so I got assigned underneath the store managef to do whatever random tasks he needed, this included

* learning how to work the meat slicer and filling in in the at deli

* sweeping the floor of the whole store

* helping out in the bakery

* painting a metal stripe that went all the way around the store

later when I worked in startups this helped me have the ethos of doing what the organization needed and not complaining that this or that wasn't in my job description.
by tomhow | 2025-07-26 22:52:17+00:00
Please don't comment like this on HN. We need you to observe the guidelines, particularly these ones:

Be kind. Don't be snarky. Converse curiously; don't cross-examine. Edit out swipes.

When disagreeing, please reply to the argument instead of calling names. "That is idiotic; 1 + 1 is 2, not 3" can be shortened to "1 + 1 is 2, not 3."

Please don't fulminate. Please don't sneer...

Please respond to the strongest plausible interpretation of what someone says, not a weaker one that's easier to criticize. Assume good faith.

https://news.ycombinator.com/newsguidelines.html
by rvrb | 2025-07-26 22:52:22+00:00
I think there may be room to expand this implementation to support such a use case. Right now it enforces an `.auto` layout of the struct provided in order to ensure alignment, but its easy to imagine supporting an `extern struct` with a defined layout.

Conceivably, an implementation of this `ResizableStruct` that uses an array buffer as backing rather than a heap allocation, and supports the defined layout of an extern struct, could be used to work across the ABI
by dnissley | 2025-07-26 22:52:33+00:00
boomers were just coming of age politically when prop 13 passed in 1978. the main culprits were actually the silent generation and older greatest gen homeowners—think postwar suburbanites who had bought in cheap and were now watching their property taxes spike in a period of wild inflation + ballooning home values. boomers were still mostly renters or too young to own, especially in california’s pricey metros.
by andy_ppp | 2025-07-26 22:53:00+00:00
I think the issue was the people running it were the type of people who are taught to ruthlessly look at a spreadsheet and decide if Coca Cola can invest X in marketing and product development they can expect to get Y back (with reasonable accuracy). Of course with software small teams can do big things so these calculations are almost impossible.

Investing a billion dollars in your search engine in ~2008 might be considered insane of course. We were told by Carol Bartz at an all hands that they had done the work on their spreadsheets and they could not compete with the investment Microsoft and Google were planning. It still annoys me to this day that there was no discussion or attempt to decide if the engineers and the company were up for the challenge with Google, even with less money. I'm not saying Yahoo! would have won, but to not even have bothered trying still irritates me - where is your vision? where is your fight?

Anyway this is my take on it, the management decided to just give up on being technically excellent and even being a software company at some point. The mind boggles why you would do this while software was eating the world and you had loads of fantastic engineering talent...
by reactordev | 2025-07-26 22:53:18+00:00
The safety mechanism prevents you from pulling the trigger. Speculation around how a P320 could go off on it's own is abound. Proper attention to your weapon is rule #1. So all of those things... ? I never heard the bumping up against your buddy one.

So too does the list of reasons why it could happen without video of it. I see some cops on the group after the fact but I don't see any of it happening and then they check the weapon to see that the safety is still engaged. Which you would think investigators would do.
by leptons | 2025-07-26 22:55:15+00:00
There are plenty of pro sports icons that have low character. Good character is not a qualification to put a ball through a goal, hole, hoop or elsewhere, in pro sports or on youtube.

I don't know any "tech oriented" people that put down anyone "in the arts", but most of them have no interest in sports. That doesn't mean they denigrate anyone in sports, but as for myself I do find humanity's fascination with putting balls into goals, holes, hoops and elsewhere a bit tiring, and I think it's a bit of a waste of humanity to put so much importance on putting balls into goals, holes, hoops or elsewhere, but we are all free to have our own opinions.
Ask HN: Where do mathematicians/physicists hang out? / How to learn math?
by mathiscoolnfun | 2025-07-26 22:55:27+00:00
I've recently taken a big interest in math and physics again. I'm 35 and haven't touched any of it since middle school, 20 years ago, and I'm trying to learn in the direction of geometry and physics.

I'm trying to change my internet habits and would like all my habits to revolve around math and physics and learning. Instead of reddit & youtube, going on /sci/, physicsforum etc.

I still have no real idea where to start, I've been reading and doing exercises from Kiselev's "Geometry" [0] and Israel Gelfands "Algebra".

How does an old fart like me with a bunch of spare time genuinely get into math? I don't even know basic notation.
by spmvg | 2025-07-26 22:56:13+00:00
Thanks for your feedback! I'm not very proud of the data input in the sidebar as well (especially when there is also a scrollbar).

Let me illustrate a bit what my motivation was:

Q: What is the goal of the application?

A: The goal of this application for me personally is to communicate the impact of IT maintenance towards product managers and the rest of the team, in a language that they understand (which is table and architecture diagram).

Q: What is the benefit of having the diagram?

A: Personally, a diagram helps me to understand things better than a big Excel sheet would.

Q: Maybe I'm misunderstanding the purpose but to me it seems like the main output from this software is the "maintenance table", but how do the pointers/diagram help instead of just having a dropdown in the table?

A: You're exactly getting it. The goal is the "maintenance table". I draw the IT architecture diagram (which is how I think about IT in my head), then add periodic tasks to them (maintenance plans), and then it renders the maintenance table automatically. I guess you could also just make a big Excel sheet?
by atmikemikeb | 2025-07-26 22:56:34+00:00
Yeah I think mine is more about being able to provide a `host()` helper function instead of a `.get(.host)` meta function. It is somewhat boilerplate-y. I think it's really a matter of taste haha. Likely yours would be useful regardless if this is done a lot, since it abstracts some of it, if one wants that.