skysight-inc/HackerNews huggingface dataset:
Signed to unsigned conversion is fully defined (and does the two's complement thing):

> Otherwise, if the new type is unsigned, the value is converted by repeatedly adding or subtracting one more than the maximum value that can be represented in the new type until the value is in the range of the new type (6.3.1.3 Signed and unsigned integers)

Unsigned to signed is the hard direction. If the result would be positive (i.e. in range for the signed type), then it just works, but if it would be negative, the result is implementation-defined (but note: not undefined). You can further work around this with various constructs that are ugly and verbose, but fully defined and compilers are able to optimize away. For example, `x <= INT_MAX ? (int)x : (int)(x + INT_MIN) + INT_MIN` works if int has a twos-complement representation (finally guaranteed in C2x, and already guaranteed well before then for the intN_t types), and is optimized away entirely by most compilers.
Monitor your web page's total memory usage with performance.measureMemory()
There are deficiencies in almost all proposals. Two new functions which avoid the problems are supposed to be published in C202x: strcasecmp and strncasecmp, added in header strings.h (note: not string.h).
What the parent comment probably meant is that support for VLA was required in C99, but is no longer required in C11, so while code written for C99 could use VLAs without any special consideration, code written for C11 cannot depend on VLAs since it might not be present in all compilers.
> And with cheap renewables, renewables + batteries + hydrogen would be cheaper than a system including nuclear

* Definitely not. Looking at France, Solar and Wind are "cheap" because producers can sell on the grid, and the national operator _must_ buy it, at a higher cost than its own electricity, in a move to prop it up.

* Water electrolysis + electricity generation from hydrogen hasn't been proven to work cheaply at scale, what's the biggest project in existence ?

* Batteries are already not cost-effective at high scales

* All of those imply that storage will be on the same site as production; if not, the grid needs to be overhauled (it is built for few stable sources, not for numerous variable sources) and that cost is never taken into account by those who root for this kind of solutions
>I don't see this as a pathetic premise.

You might agree with the politics of it which could be clouding your vision (I'm not intending that as anyway critical). Sometimes it's helpful to view it from another angle:

Imagine if back in 2015 I told you my big book idea was set in 2200 and was about a group of renegade patriots who traveled back in time to stop Obama getting elected because 80% of the population had been killed in the FEMA camps he set up....

Would you think that was somehow a profound idea? Or would it strike you as pathetic attempt of me shoehorning politics into my work? Wouldn't that come across as hysterical and insulting to the future?

The notion that 120+ years in the future the world will have changed so little that its still follows the same MSNBC vs Fox News script of today borders on hubris.
We are actually in the Mike Judge Idiocracy cyberpunk future and it terrifies me. Our president is a reality TV freak, the citizens are so science-retarded that they think Covid is a hoax, the population all sit in our homes watching testicle-kicking videos on huge TVs while drinking Mountain Dew and eating Cheetos while the world melts down outside.
char effectively behaves as a signed type, making it unsuitable for binary operations (e.g. UTF-8 manipulation). I/O functions deal with char pointers, so using unsigned type like uint8_t requires casting back and forth. Is there any way out of this problem, and am I already breaking the aliasing rules with that cast?
I'm about a mid-level experienced developer, and have been attempting to learn C via a few side projects. I come from mostly Python and Go, which both have very robust standard libraries, so I was quite surprised to find that string parsing is very poorly supported in C. Is there a reason that very common string parsing cases are missing from the C stdlib?
Yeah I don't think it's a flaw with NextDNS. Just means my existing setup is already doing a decent job. Another layer is always good though

I did have a look at additional blocking lists on there though - some good options there. Added "Block Child Sexual Abuse Material" and gambling.
I'm not here to gain karma ... and I'm willing to have a discussion with Alex Jones fans too so long as they stick to facts and avoid hyperbole, mis-truths, etc.
What spot are you looking at? Asking as a mountain biker.

Itching to get out on a road trip once it’s possible.
You have a higher need for social stimulation than some people.

My productivity has gone up measurably. In normal times, I get plenty of social stimulation outside work so I don't need any from work.

While I think many organizations will retain remote work for some percentage of their workforce when the crisis is over I don't think we're about to have a revolution. The generations in charge came of age with face-to-face being the way people got things done. They aren't going to change.
In my case, the current situation adds 10 hours to my personal time. Thinking hard about moving to a remote-only position next. Sadly, moving closer to the workplace is out of the question because no force on earth will bring me to live in a densely built up city ever again; I reject urbanization for myself. I'd rather enjoy a green, quiet countryside.
Because Quiche, our HTTP/3 library, only supports CUBIC for congestion control, not more modern algorithms like BBR. Even without modern congestion control, HTTP/3 performs close to as fast as HTTP/2. We expect it’s performance will improve significantly when we implement BBR and other enhancements already in more mature protocols.
Note that among the C experts participating in this AMA, I am not one who is in the standardization committee. At 14:59 EDT, just before the AMA was posted, we were joking between ourselves about me having to post this disclaimer but I guess there was a hidden truth in the joke.
> or are unable to maintain good work/life balance

Happens to me in an absurdly trivial way: pre-antiviral-WFH I was taking my main meal of the day as lunch at the office, now it's dinner at home. After lunch it was easy for office life (and caffeine) to get me back to speed. But evening side projects don't stand a chance against the digestion passivity of a full dinner. A full lunch at home isn't possible for me because at that time of the day I'm just not hungry enough unless the food is prepared for me.
That's how National Geographic has been run for decades. Wrap up fluff journalism in a mystique of authority and strangeness to distract from the overall shallow nature of the writing.

Facile views wrapped up in easily digestible photo journalism essays, then never reviewing the topic again.

It's always been fluffy pap.
The difference is from compression. For example the big stylesheet goes from 12kb side to 3.5 over the network.
I agree with you but the high number of unemployment claims is also a feature of the bailout plans. Let’s hope people will get hired back quickly.
The Wolfram Physics Project
Why isn't there a binary prefix in the standard? Like 0b0111010?
This entire project is built from basically 95% contrarianism.

It is contrarianism, pure and simple.
There are "projects" underway to clean up the spec where it's viewed as either buggy, inconsistent, or underspecified. The atomics and threads sections are a coupled of example.

There are efforts to define the behavior in cases where implementations have converged or died out (e.g., twos complement, shifting into the sign bit).

There have been no proposals to add new array types and it doesn't seem likely at the core language level. C's charter is to standardize existing practice (as opposed to invent new features), and no such feature has emerged in practice. Same for modules. (C++ takes a very different approach.)
I think we are always looking at ways to "clean up C" but that this has to be done very carefully not to break existing code. For example, the committee recently voted to remove support for function definitions with identifier lists from C2x http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2432.pdf At least one vendor was not very happy with this decision.

Undefined behaviors tend to be undefined for a reason and shouldn't be thought of as defects in the standard. In my years on the committee, I have always argued to define as much behavior as possible and to as narrowly define undefined behaviors as possible.

We also had a recent discussion about adding additional name spaces (when discussing reserved identifiers), but it didn't gain much traction.
Speaking from a country that may have one of the best worker protection (France) in the world, it's all smokes and mirrors. If your small-medium business is in trouble, the only sane thing to do for your employees is to layoff as quickly as possible, so they can register to unemployment benefits (and count in statistics).

You think any government is going to give you money as a business owner? Maybe if you're lucky but how much time and paperwork is it gonna take? You're not guaranteed to see any of it or when. Meanwhile, you're accruing significant debt from each employees and suppliers day over day, with no end in sight.
Just because I was doing my own hobbyist research on power switching, and encountered the IGBT vs power MOSFET tradeoff:

The current path for an IGBT looks largely like a diode; it has a fixed voltage drop (0.6V in silicon), so the losses in the "On" state are linear with current. A MOSFET, however looks largely like a resistor in the "On" state, so the losses are quadratic with current.

There are also switching losses, which are a bit more complicated, but largely scale quadratically with frequency (for IGBTs there usually aren't actual formulae but just a curve from the datasheet; MOSFETs are a bit more amenable to calculation). For relatively low-frequency and high-current switching like a high-power permanent magnet motor, you will tend try to keep switching losses low relative to conduction losses; in any event IGBTs are low-frequency devices so if IGBTs are in discussion typically switching losses will be low.

As anyone who has studied asymptotic performance will know, for low-frequency applications, as current goes towards infinity, IGBTs are better. At low currents, however, MOSFETs trounce IGBTs; A resistor that drops 0.6V at 1A would have 600mOhms of resistance, and a $0.10 Power MOSFET can beat that in low voltage (<120V) applications, with on resistances on the order of 1mOhm. At 100A there are similar conductive losses.

As you design power MOSFETs for higher voltage handling though, the on resistance goes up. There are ways to design power MOSFETs with lower on-resistance, but they will make them much harder to switch and increase the switching losses to the point where that bit I said earlier about conduction losses dominating becomes not true. For switching 900V you will want a MOSFET rated for at least 1200V and now you are looking at 100s of mOhm of on resistance, so even at say 2A, the IGBT is looking quite good.

Enter SiC. I know absolutely nothing about semiconductor design, but the way it was explained to me is that the design parameters of an SiC MOSFET are such that it can block a larger voltage than a silicon MOSFET, so that the envelope shifts "up" for working voltage at any given amount of on-resistance ant gate-charge (which relates to switching losses).

Lastly, if you aren't a racecar driver, most of the time the power draw will be far below the max, so even if an IGBT beats an SiC MOSFET handily under hard acceleration (it almost certainly does), for highway cruising there is a good chance the MOSFET will win.
Conversely for me, meetings have reduced because more people are using slack and email to communicate more frequently, and the quality of their communications has gone up. While i know that sounds like hell for some people, it’s where I thrive since I’ve always worked at multi site companies before, and it was the only effective way to scale communication.

So I’ve gone from having meetings all day, every day, to having half that amount.

When we do have meetings, I’m also able to attend without having to do as many context switches as before. I’m not having to leave my desk, put down my work and move somewhere else. I can work through the meeting without distracting anyone else.

I’d say my productivity is at least 2-3x what it was before this.

At the same time, I’ll also fully admit that this is entirely subjective to myself and everyone has different ways of working. I thrive with lots of simultaneous communication and parallel tasks, so having everyone talking in slack and email and meetings at once is my ideal situation because the information now actively makes it way to me, and my time spent having to wrangle things is very much reduced.
Google may just want to adjust their "acceptable waste" tolerance imho, they seem to be one of the most egregiously miserly companies at present. I understand the need for them to correct from a prior extreme on the other end but this is an over-correction when you're collecting the rents from your most stable income stream...
How about a Sudoku solver? Send me a request via e-mail.
Antibody points to possible weak spot on coronavirus
I'm skeptical of the 19% who can't work from home.
BLS says that food prep, transportation, production, healthcare practitioners are the 3rd, 4th, 5th, & 7th most common jobs. This totals 43 million, most of whom probably can't work from home.
https://www.bls.gov/oes/current/oes_nat.htm

Edit: Another commenter claims the author sampled workers through Mechanical Turk. WTH.
What, no comics?
C is indeed a very small language. But the expressive power of C for real-world problems brings a huge learning curve in terms of organization, tracking, and understanding.
Have you considered setting up NAS for your MP3 collection and streaming with Subsonic or VLC? I've never done this so maybe it's more complicated than I understand, but that's where I would be looking first.
When Comets Break Up, the Fragments Can Be Devastating If They Hit the Earth
The key point in the article is that crypto (not BTC, but stablecoins pegged against dollar, euro, and/or yen values) offers a way for people who normally have few ways to access dollars to get their hands on them. It's not about the dollar-using world moving to crypto---it's about the citizens in world that doesn't use a currency strong enough to print their way out of a market implosion moving to the dollar via crypto.
Ask HN: Why Game of Life automata always ends with Still life?
Hello everyone, I've been playing with Conway's Game of Life[1] lately and I noticed that most of the times when generating random grids in a terminal emulator or web apps almost always the output[2] ends with Still life and Gliders.
Is there a mathematical reason why this scenario happens and why Gliders are more prone to be generated?

[1] https://copy.sh/life/

[2] https://i.imgur.com/CLMjFxe.png
Building FizzBuzz in Fractran from the Bottom Up
Right - it is not a rational response to the situation on my part, and this will be the natural consequence for many I’m afraid. The American workforce in particular will never be the same.
Sandboxing should be left to the OS/User and not part of the "binary" distribution method imo
You only need two!

like this
> It was no fault of our own because the circumstances of COVID were impossible to foresee.

This is one of the biggest fallacies in modern finance. COVID was merely the catalyst which exposed terrible finances. The idea of unforeseeable black swans has become nothing more than a trope of an excuse that it's lost all meaning. Sure, the pandemic itself is a "black swan" but the subset/collection of events that lend itself to economic disaster is actually not that rare. Case in point: 9/11, Tech Bubble burst, Financial Crisis, Covid-19. This was all in a span of ~20 years.

So let's revisit this: Is economic collapse really that rare? No. But people construct their businesses as if they are, and we always see these house of cards tumble. The other group of businesses who acknowledge the possibility of an economic collapse subscribe to the false pretense that THEIR company is immune because they're so "essential." In both cases, growth at all costs seems to be the mantra. How is this sustainable beyond the Fed Lottery? At this point, it hasn't become a Lottery anymore.
If the network of decentralized social websites grows large enough, then it can overtake Twitter and even Facebook. Just as the World Wide Web won over AOL in the early days.

The network effect is powerful.
Show HN: Vuforia Spatial Toolbox, a platform for spatial computing
Giving the benefit of the doubt; it’s entirely possible they have that setup, with the tacit assumption that if their machine died they could buy another same day.

Now, you really can’t buy another laptop same day.
Not a question, a request: Please make __attribute__((cleanup)) or the equivalent feature part of the next C standard.

It's used by a lot of current software in Linux, notably systemd and glib2. It solves a major headache with C error handling elegantly. Most compilers already support it internally (since it's required by C++). It has predictable effects, and no impact on performance when not used. It cannot be implemented without help from the compiler.
it increases the reward for being wealthy, which promotes more productive behaviour from society at large.

It encourages rent-seeking behaviour, which is not necessarily productive, and in times of crisis, demonstrably not so.
Economists dont agree with you.

https://www.econlib.org/archives/2017/09/a_poll_of_econo.htm...
Tech Startup Layoffs: What, Where, Who and the Impact on Freelancers
The election probably hinged on the handling of “her emails” by the FBI Director. I don’t see how anyone could have predicted the extent to which he would bungle that. His investigation found no wrong-doing, but he publicly excoriated her anyway. Then, he opened a new investigation, which again found nothing.

https://fivethirtyeight.com/features/the-comey-letter-probab...
Yeah. Massive, massive sampling bias.
Digital surveillance is a violation of human rights in the same way a policeman cannot enter your house without warrant to observe you and search you. This is one of the oldest principles in modern political thought and it stretches back to at least Semayne's Case in 1604.

Your neighbor has a right to sleep in his home. If you blast music, you are disturbing the serenity of his home. That is a different question than the government coming into your private affairs to spy on you.

If you really believe that your assertion is applicable, apply it to this circumstance (digital surveillance), rather than setting up a different argument (music and sleep) where your assertion better applies.

Your assertion essentially amounts to "all clear principles are bad because they obscure exceptions." First, this is reflexive -- it applies to itself. Second, it is the burden of the exception to prove itself, not the burden of the rule to prove all of its own exceptions; the government needs a reason specific to me in order to observe my private affairs, and in absence of such a warrant I have a blanket protection from those observations.
At guess, "No"

https://en.wikipedia.org/wiki/Betteridge%27s_law_of_headline...

after reading the article ... still "No".
> I'm suggesting to buy the best value for money wherever it may come from

Many EU citizens see a lot of value in buying from inside the EU rather from any far-off country. When Greece's economy went bad all of the EU suffered a bit. Not so much if the economy of Chile goes bad. The more customers your "local" (national or EU) business loses to foreign producers that may have far lower production costs and quality, the more likely it is it will downsize or drop quality.

> No, it does not necessarily do that.

You followed this up with a very particular corner case which is not applicable here. The reasons EU olives are more expensive are because cost of living/production are higher, and standards are observed more closely. And the reason someone may prefer them are that standards are observer more closely and the choice to support local businesses. None of the are really something to argue with arguments of trade helping some other country that receives immigrants.

> But that's not what I'm saying at all.

Perhaps if next time you make your point clearer from the first attempt and not issue just a blanket, generic statement supported by an appeal to pity there would be no need to come back repeatedly to bring clarifications that in no way are obvious from your original comment. Especially when that comment was supposed to counter someone's personal opinion about what they prefer doing. Maybe you had the right idea but left too much of it out to the point where it becomes a frustrating puzzle of a discussion where you keep getting new pieces, some are the wrong size, some from another box, and some are actually onions.
Interview with Djanis Mitchell(TH Express)
I can't live without it.
Or... deprecating unsafe or not-well-designed (but this is a bit subjective) ideas. Like... deprecating locales. (For why locales aren't well-designed ideas: https://github.com/mpv-player/mpv/commit/1e70e82baa9193f6f02...)
I'm teaching C to high schoolers as their first language, which is quite the adventure. Do you have any good advice or resources on how to introduce the way C treats the function stack and heap allocated memory? Most of my students struggle (naturally) with making sense of function scoped identifiers and pass-by-value semantics.
We would need a specific proposal and assurance that nearly all computers can efficiently provide that service. It is more likely in the POSIX standard.
FRACTRAN is, of course, the delightful esoteric language designed by the recently deceased John Horton Conway.

This blog post writes FizzBuzz in FRACTRAN, but that's just an excuse for an intriguing exploration of the language itself and how to write programs in it in a structured way, then how to write compilers that target FRACTRAN.

[discussion from four years ago: https://news.ycombinator.com/item?id=11894141]
The lockdown isn't the only reason for the current economic crisis. Look at what was happening in the repo market a few months back before Coronavirus was even a thing.
It would be wonderful (IMO) if we could get to that point, but that would leave implementations with too great of a burden because many forms of UB can only be caught at runtime (without a considerable number of false positives). Generally, the C committee makes things a "constraint violation" (aka, we would like implementations to err) whenever something can be caught at compile time, and we leave the undefined behavior hammer for scenarios where there is not a reasonable alternative.

Thankfully, there are a lot of tools to help developers catch UB these days (UBSan, static analyzers, valgrind, etc). I would recommend using those tools whenever starting a new project in C (or C++, for that matter).
I'm trying to learn C during this quarantine times. I'm looking for good beginner-friendly opensource projects to learn from.
Can you please suggest some repositories to look into?
What happens when you ask a virtual assistant to do something?
Distinguished Professor of Economics at the Graduate Center of the City University of New York and winner of the Nobel in Economic Sciences Paul Krugman would disagree with you. He's full of economic pronouncements going as far as when markets are going to crash (immediately) and their specific cause (Trump elected).

You can make the case that as a columnist, he's encouraged to make predictions but most Keynesians believe in direct cause -> effect of policy decisions based on a handful of metrics that properly describe the economy as a whole.