MurphyA/hacker-news huggingface dataset:
by ryao | 2025-04-16 13:22:00+00:00
Handing memcpy() the address at the end of an array and length 0 is undefined behavior. It is often said that the reason for this is to allow memcpy() to read before it branches to make it fast.

This lead me to think of the case where you hand it the address right before the end of a byte array where the byte after the last byte is an unmapped page and tell it to copy 1 byte. I suspect systems that have such an optimization would read beyond 1 byte into invalid memory. This is my criticism of the idea of having memcpy(NULL, NULL, 0) be undefined to make that speed trick legal. I am suggesting that an undefined number of low values to copy must also be undefined, yet they are not under the standard.
by pmags | 2025-04-16 13:22:14+00:00
From the editorial in Nature:

Around 3.8 million people die each year of infections caused by C. auris and other fungi. Annual deaths caused by fungal infections have nearly doubled in the past decade.

Pathogenic fungi pose unique challenges, and overcoming them will require innovative approaches to both science and policy. Yet, despite the growing global threat posed by drug-resistant fungi, such infections rarely loom large in discussions of antimicrobial resistance. Two World Health Organization (WHO) reports published this month (see go.nature.com/3rniybw) — the organization’s first analyses of tests and treatments for fungal infections — highlight the result of that neglect.
by illegalmemory | 2025-04-16 13:22:24+00:00
The applicant has submitted the following application:

Provide a harsh and direct rejection explaining why this idea won't work (unless for the real good idea), pointing out potential flaws, market issues, team problems, or execution challenges. Be specific and refer to details from their application. Your tone should be direct, blunt, and slightly condescending (or like Paul Graham that obsessed, counterintuitive, and logical) but provide real constructive criticism with solutions. Keep your response under 300 words.
by shagie | 2025-04-16 13:22:29+00:00
https://www.itpro.com/security/confusion-and-frustration-mit...

> However, in an updated statement, the agency revealed it intends to maintain the database in a bid to prevent a lapse in CVE services.

> “The CVE Program is invaluable to the cyber community and a priority of CISA,” a spokesperson said.

> “Last night, CISA executed the option period on the contract to ensure there will be no lapse in critical CVE services. We appreciate our partners’ and stakeholders’ patience.”

Searching for that last passage:

https://www.bleepingcomputer.com/news/security/cisa-extends-...

> "The CVE Program is invaluable to cyber community and a priority of CISA," the U.S. cybersecurity agency told BleepingComputer. "Last night, CISA executed the option period on the contract to ensure there will be no lapse in critical CVE services. We appreciate our partners' and stakeholders' patience."

And https://www.reuters.com/world/us/us-agency-extends-support-l...

> WASHINGTON, April 16 (Reuters) - U.S. officials have said at the last minute that they're extending support for a critical database of cyber weaknesses whose funding was due to run out on Wednesday.

> The planned lapse in payments for the MITRE Corp's Common Vulnerabilities and Exposures database spread alarm across the cybersecurity community. The database, which acts as a kind of catalog for cyber weaknesses, plays a key role in enabling IT administrators to quickly flag and triage the myriad different bugs and hacks discovered daily.
by moefh | 2025-04-16 13:23:00+00:00
Not OP, but here's an example of "random code" inserted by the compiler[1]: note the assembly instruction "ud2" ("invalid opcode exception" in x86 land) instead of "ret" in not_ok().

You might think this code would be fine if address 0 were mapped to RAM, but both gcc and clang know it's undefined behavior to use the null pointer like that, so they add "random code" that forces a processor exception.

[1] https://godbolt.org/z/sK55YsGz1
by almostgotcaught | 2025-04-16 13:23:15+00:00
> not extremely difficult... if you have a good grasp on measure theory

If this were Reddit I would paste the "You got into Harvard Law? - Elle Woods" meme.

Ok it's not that hard - I did an independent study of Oksendahl in my junior year before my first measure theory class and understood most of it ok. But then again I didn't have to take exams on the material lol.
by zerkten | 2025-04-16 13:23:34+00:00
I was asking myself the same thing. Is the "CIRCL - Computer Incident Response Center Luxembourg" a partner organisation to CERT? I don't follow this very closely, but it felt like there was some kind of global network. I'd be curious if there was a continuity plan of some sort. There is also https://cert.europa.eu/ which might be used interchangeably.
by aredox | 2025-04-16 13:24:05+00:00
>you can also tell the person "This is really bad, you messed up, this type of a mistake is unacceptable and horrific"

Is that supposed to be professional? Especially for 99.999% of code, outside of real life-and-death Therac-25/Fly-by-wire/nuclear plant control sotware?
by ryao | 2025-04-16 13:24:13+00:00
You are misreading. I said to take a char * and then cast it to whatever you want. You can cast it to struct A *. Then you can cast the original char * to struct B *. The compiler will be fine with this since the strict aliasing rule excludes char *.

If you insist on doing what you described, just skip char * and mark the pointer with __attribute__((may_alias)) and then it will be okay. That is a compiler extension that lets you turn off strict aliasing rules.
by flanked-evergl | 2025-04-16 13:24:43+00:00
Here is the initial ruling against him for being present in the US illegally:

https://storage.courtlistener.com/recap/gov.uscourts.mdd.578...

> The Respondent was arrested in the company of other > > ranking gang members and was confirmed to be a ranking member of the MS-13 gang by a > > proven and reliable source.

The same ruling was upheld on appeal which specifically upheld the finding of him being part of MS-13, and in the US illegally: https://storage.courtlistener.com/recap/gov.uscourts.mdd.578...

He had his day in court, twice, he was not innocent. I never contended that the government did not wrongfully deport him, not once, but that does not make him innocent. He is still an MS-13 member that is illegally in the US and subject to deportation at the pleasure of the executive.

Word games aren't going to change the facts.
by NoImmatureAdHom | 2025-04-16 13:24:53+00:00
Nothing in my grandparent comment is speculative. I literally type out the data and discuss what additional information we would have to have in order to arrive at something approaching a meaningful estimate of the quantity we are both interested in.

As for Red/Blue not being current, I'm not an expert. The only bone I would pick is the Republicans aren't doing "Nazi shit". Nazi / Fascist used to mean something, you know. It seems like people are starting to use those words to mean "authoritarian" or something along those lines.
by skwee357 | 2025-04-16 13:25:02+00:00
I can’t help you with product market fit, but I can try to help you with traction. Keep in mind I’m a newbie myself, and mainly just trowing ideas.

First, make sure Google actually knows about your website. Submit it to Google search console and let it index the website. This step alone can take anywhere between 3 to 6 months before you will start to see organic traffic. In the meantime you can also try to create more content in your website. Have a proper sitemap and keep it updated with new content.

In MY experience, backlink building is not that useful. It’s a vanity metric. My SaaS ranks in top 5 in Google for specific keywords, and I have a few dozen backlinks and a DR of 4.

Try running ads. Google/Reddit ads in your case might work.

Make sure you know why people are not converting. In my experience free trials are VC backed thing, when you can burn shitload of money on acquiring customers. It’s not that helpful for solopreneurs, so I would consider dropping it off.
by duxup | 2025-04-16 13:25:16+00:00
You'd think for trade you'd start with negotiations, even if things go bad then you turn to targeted tariffs.

Rather we get scatterbrained tariffs, and we piss everyone around the world off so that we have no friends in this fight...

Honestly though I'm not even sure there is a strategy outside a sort of "government capture". Trump and is cronies break as much as possible regardless of ideology, and now if you want to legislate and fix it, you have to go through them and pay the bribe. Trade, etc, all through them.
by naasking | 2025-04-16 13:25:24+00:00
> But putting ViewModels in Resources also doesn’t work very well. ViewModels are not abstract concepts like “a post”; each ViewModel describes a specific piece of UI. As a result, the shape of your “Post” Resource grows to encompass the needs of every screen displaying a post.

I don't see the issue with adding an endpoint per viewmodel. Treating viewmodels as resources seems perfectly fine. Then again, I'm already on the HATEOAS and HTMX bandwagon, so maybe that just seems obvious, as it's no worse than returning HTML or JSX that could be constantly changing. If you actually need stable API endpoints for others to consume for other purposes, that's a separate consideration. This seems to be the direction the rest of the article goes.
by mytailorisrich | 2025-04-16 13:26:23+00:00
This is not a decision against transgender people, who are still fully protected against discrimination.

This is an interpretation of the British so-called Equality Act 2010 and how it defines "sex", "man", "woman". This decision clarifies that in the Act "woman" means biological female (and thus "man" means biological male), and that "sex" means one or the other.

This is not unexpected, frankly, as it is not too difficult to see that this is what the legislator meant when they drafted the law.

Court comment, quoted in article:

"the legislation gives transgender people "protection, not only against discrimination through the protected characteristic of gender reassignment, but also against direct discrimination, indirect discrimination and harassment in substance in their acquired gender"."
by bryanlarsen | 2025-04-16 13:26:32+00:00
There can be very little difference between taking fresh water from a major river that dumps into the ocean vs taking from the ocean. For example, if you took 0.001% of the flow of the St. Lawrence river and run it through an evaporative cooling tower you're doing very little harm and perhaps benefiting the local ecosystem through increased rainfall. If you took 50% of the flow it'd be a problem, but the St. Lawrence is massive.

People think water is scarce, but there are still parts of the world where water is abundant, where flooding is more of a concern than fresh water scarcity.

Combine with Quebec's cheap electricity, and it seems an ideal place to site data centers.
by mike_hearn | 2025-04-16 13:27:23+00:00
Yes. The Republicans are not and never have been united around fiscal conservatism. Eliminate-the-deficit libertarians are one faction within the party but not the dominant one, and Trump doesn't come from it. Same with most right wing parties the world over: the bigger faction is usually one that likes both tax cuts and spending increases. That's why deficits are out of control across the west: between the tax-and-spend left and the don't-tax-but-spend right, the don't-tax-and-don't-spend contingent isn't big enough to outvote the others. Clinton was very unusual in this regard, perhaps a product of the short post-USSR consensus.

Elon is a libertarian and has been allowed to go do some spending cuts around the edges. This gets support from Republican members of Congress partly because the USG turns out to be spending a lot of money on highly partisan Democrat projects, but mostly because it's someone else doing the cutting and not them. Even if they know they should be doing it themselves they don't want the crazies trashing their cars, so if some outsider does it for them that's a deal they'll happily take whilst it lasts.

All that said, it's inevitable that the administration would be blowing through more money than before even with DOGE. It's the nature of debt that it compounds. The level of cuts required to even keep the deficit stable would be huge because interest payments are accelerating, and the cuts DOGE are allowed to make are small (even when they go further than they might technically be allowed).

Right now there's just no mainstream support in US politics for serious austerity. There never is in any country, but sometimes the public can be convinced to agree to some amount if politicians do a good job of communicating the deficit problem. The UK in 2010 is an example of that, where the Conservative/Lib Dem alliance was able to convince the public to vote for spending cuts (albeit not as deep as were actually required... but it tided the UK over until the economy started growing again).
by fleek | 2025-04-16 13:27:50+00:00
Is everyone on hacker news so entitled and privileged they cannot even imagine an American citizen wanting to work for a living?

I absolutely would work a factory job if it paid 100k+ and meant owning a home someday.

Instead I got 100k student loans and make 60k at a desk and I'll never have a life outside of work because I simply can't afford it.

I'll be 35 this year after 12 years of working and just starting to have a positive net worth.

American dream my ass.
by aaronbaugher | 2025-04-16 13:28:05+00:00
Farm kid here. While it's true that farmers have an incentive to keep their animals in good condition, that's not the only incentive toward profit, and the bottom line often results in a pretty stressed, unhealthy animal that's in good enough condition to keep producing. If you can save $X by providing a minimum feed ration and leaving the cows in the care of the cheapest, least-caring employees you can find, and that reduces your milk check by less than $X, that's what's going to happen in a lot of cases, especially the larger operations.

(Not unlike human employers who have an incentive to treat their employees well but often don't.)

Farm organizations like to say farmers have every reason to keep their livestock in the best condition, implying that they're frolicking on pasture in peak health, but that's not really true. A lot of times it means miserable condition on concrete or a freezing feedlot. Livestock animals, like humans, are resilient and can keep producing through some pretty terrible treatment. The only ways to combat that seem to be A) customers who actively seek out farms that practice good animal welfare practices, or B) reasonable animal welfare laws.
by JumpCrisscross | 2025-04-16 13:28:21+00:00
> the collapse of the American Empire is no more preventible than the collapse of the British, Spanish, or Roman empires

They each had longer runs than we’ve had.

My pet theory is lead. From 1950 to 1980 we birthed a leaded generation [1]. Today, up to 60% of American voters were born before 1975 [2]. (Voters born between 1950 and 1980 came into the majority in the 1990s and should fall into the minority by 2028, but only barely. So in summary: Iraq War, Financial Crisis, Covid and Trump 47. It won’t be until the 2040s when truly unleaded voters, those born after 2000, command a majority.)

[1] https://pubmed.ncbi.nlm.nih.gov/35254913/#&gid=article-figur...

[2] https://www.pewresearch.org/politics/2024/04/09/the-changing...
by jackyinger | 2025-04-16 13:28:39+00:00
You’re focusing on your side of the communication, but to be really effective in any communication you need to focus on how it will be perceived by the recipients.

If they messed up, you want to help make them better so it doesn’t happen again right? So really you want a positive outcome for everyone. You don’t have to sugar coat it tho, just share it in a way that makes it a learning moment.
by pseudalopex | 2025-04-16 13:28:57+00:00
The disagreement is semantic and irrelevant in the sense the question at hand usually is which topics and opinions are forbidden at work.

The disagreement is semantic and relevant in the sense people who say no politics at work believe their categories of politics and not politics are obvious.

The disagreement is ideological in the sense ethical concerns about products or customers are designated political often.

Politicians, political journalists, and people who say no politics at work do not define politics as geopolitics and partisanship.
by duxup | 2025-04-16 13:29:02+00:00
>They’re selling a lifestyle.

People eat up "lifestyle" brand stuff like crazy. I suspect people just want something special in their daily lives. I get that.

I assume it's appealing to sellers too because it inspires some potential level of loyalty and uniqueness when it comes to their products where otherwise it is "just coffee".

Granted I say that while I sip my Kirkland coffee here at my desk, amused that what was once a sort of semi generic store brand, Kirkland now has it's own apparel with its brand on it and Costco fans love it.

I guess we can find something special everywhere.
by empath75 | 2025-04-16 13:29:14+00:00
It already is a search engine and has been for a while.

I think you don't recognize it as such because it's incorporated into the chat box, but I use chatgpt as my search engine 90% of the time and almost never use google any more.

I think the social stuff will also just be incorporated into the chat interface in the form of 'share this image', etc, and isn't going to be like twitter with a bunch of bots posting.
by LatteLazy | 2025-04-16 13:29:56+00:00
I prefer the alternative explain: this is just trump bringing in a national sales tax without having to go through the senate or eat the unpopularity.

There seems to be no actual plan to actually bring back manufacturing (this would require different tariffs, loans, tax accounting rules, etc). And there seems to be no targeting of china (everywhere is being tariffed, allies and enemies, strategic suppliers and places with no trade with the USA etc)
by willvarfar | 2025-04-16 13:29:59+00:00
No idea in this particular case, but in the past I've got pinged by HN mods suggesting I resubmit posts that I recently submitted but bombed. I imagine HN has an automated system for finding some posts with potential that never got the attention they deserved and boosting them to give them a second chance?

The article is 2018.
by bluGill | 2025-04-16 13:30:34+00:00
> You can not make a country a liberal democracy by opening up trade with them. It failed with China, it failed with Russia.

It worked with South Korea, and Taiwan. (Japan and Germany, but they were on the losing side of a war with us which is a confounding factor). It is by no means perfect, but I've yet to see anyone suggest something else that has any chance of working.
by jermaustin1 | 2025-04-16 13:30:39+00:00
I bought my wife's grandma's house in rural central Louisiana so that her grandpa could retire and not have to worry about medical bills or anything like that. It already has a "woodshop"[1] on it, and when the contractor finishes (or at least starts) on repairing the years of neglect, I will also be a woodworker in the woods.

I'm currently a "woodworker" in suburban Houston, but usually only average $500-ish per month (heavily loaded toward a couple of times of year - Mid Spring, Back to School, Christmas).

1: https://www.icloud.com/photos/#/icloudlinks/08c7DUB5txbSRiCs...
by Latty | 2025-04-16 13:30:40+00:00
I'm British, but I think to expect free and fair election in the US in two years is to stick your head in the sand.

I don't see them preventing elections, but just rejecting or altering results that don't support them: the litmus test is already triggered: the special election in North Carolina has an ongoing court case trying to throw out ballots to allow the Republican to win.

They have also pushed a executive order claiming sweeping powers over elections which they will use as pretext to do this nationally. Blatantly illegal, but they have already shown they are ignoring the courts, so who will hold them to account? Mass civil unrest is the only thing left.
by flohofwoe | 2025-04-16 13:31:05+00:00
Unfortunately UB is an umbrella term for all sorts of things, and some of those can be very harmful/unexpected, while others are (currently) harmless - but that may change in new compiler versions.

The typical optimization showcase (better code generation for signed integer loop counts) only works when the (undefined behaviour) signed integer overflow doesn't actually happen (e.g. the compiler is free to assume that the loop count won't overflow). But when the signed integer overflow happens all bets are off what will actually happen to the control flow - while that same signed integer overflow in another place may simply wrap around.

Another similar example is to specifically 'inject' UB by putting a `std::unreachable` into the default case of a switch statement. This enables an optimization that the compiler omits a range check before accessing the switch-case jump table. But if the switch-variable isn't handled in a case-branch, the jump table access may be out-of-bounds and there will be a jump to a random location.

In other situations the compiler might even be able to detect at compile time that the UB is triggered and simply generate broken code (usually optimizing away some critical part), or if you're lucky the compiler inserts an ud instruction which crashes the process.
by stetrain | 2025-04-16 13:31:05+00:00
> Democrat voters didn’t want anything to do with her during the 2020 primaries and didn’t turn out as much for her in 2024 as they did for Biden in 2020, so who are the real misogynists here?

Are you talking about Harris? I'm pretty sure she wasn't in the republican primaries so that isn't who the previous comment was talking about.
by bayindirh | 2025-04-16 13:31:25+00:00
Actually, there's a distinct level up in camera sensors starting with Sony A7-III and onward (incl. Fuji, Canon, Nikon). Having IBIS with a standard lens (like 28/2) allows you to take unbelievable shots at dusk and night.

Moreover if you have a stabilized lens, they work in tandem to improve things even further.

Many shots you think which would gonna be blurry comes out perfect. e.g.: https://www.flickr.com/photos/zerocoder/49047642802/in/photo...
by arnsholt | 2025-04-16 13:31:37+00:00
To take an example from the post: in some cases a value was computed that could overflow, but it was not used because of a later overflow check. I think the optimizer would be fully within its rights to delete the code inside the overflow check, because the computation implicitly asserts that it won't overflow (since overflow is undefined). I think this is a more or less useful way of thinking around UB: any operation you put in your program implicitly asserts that the values are such that UB won't happen. For example, dereferencing a pointer implicitly means it cannot be NULL, because derefing NULL is UB, and anything downstream of that deref which checks for NULL can be deleted.
by williamcotton | 2025-04-16 13:31:37+00:00
We’re in the nineties, okay?

Whee!

#!/usr/bin/perl $ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/; if ($ENV{'REQUEST_METHOD'} eq "GET") { $buffer = $ENV{'QUERY_STRING'}; } print "Content-type: text/html\n\n"; $post_id = $buffer; $post_id =~ s/&.*//; # Get first parameter (before any &) $post_id =~ s/[^a-zA-Z0-9\._-]//g; # Sanitize input $truncate = ($buffer =~ /truncateContent=true/) ? 1 : 0; $title = `mysql -u admin -p'password' -D blog --skip-column-names -e "SELECT title FROM posts WHERE url='$post_id'"`; chomp($title); $content = `mysql -u admin -p'password' -D blog --skip-column-names -e "SELECT content FROM posts WHERE url='$post_id'"`; chomp($content); if ($truncate) { # Extract first paragraph (everything before the first blank line) $first_paragraph = $content; $first_paragraph =~ s/\n\n.*//s; print "<h3><a href=\"/$post_id.html\">$title</a></h3>\n"; print "<p>$first_paragraph [...]</p>\n"; } else { print "<h1>$title</h1>\n"; print "<p>\n"; print "$content\n"; print "</p>\n"; }