skysight-inc/HackerNews huggingface dataset:
> You need tests because you're using a dynamically typed language?

I don't really understand the connection between a dynamically typed language and the need for (or lack of) testing. Can you explain what you mean? I've never once felt like the type of language I used defined how important tests were.

When I write a unit tests, I'm not looking for syntax errors or a scenario where I'm passing the wrong type in, I'm verifying that the business rules of my domain are being properly enforced.

If your unit test is brittle, I'd say that's a pretty awful unit test. You should be isolating the component you're testing and eliminating all external dependencies like in the example below.

class ItemRecommenderGuardTest extends TestCase
{
public function setUp()
{
$dependency = Phake::mock(Dependency::class);
$this->recommenderGuard = new ItemRecommenderGuard(
$dependency
);
}

public function testGuardsInvalidItem()
{
// business rules deem this item un-recommendable. This unit
// test verifies that the guard class properly enforces these rules
$item = /* ... */;

$this->assertFalse($this->recommenderGuard->isRecommendable($item);

}
}

This test isn't brittle, and it's asserting that an item which does not meet recommendable standards is never recommendable. If someone comes along and modifies the guard class incorrectly, these unit tests are here to maintain the integrity of the system
My New Years resolution this year was to stop taking jobs at places where I spend so much of my time trying to wrangle my coworkers toward my model of what constitutes sane processes. Worked with a lot of people who think like OP and I am just done.

Also I think you’re being very generous with that 2:4 ratio. Malleability isn’t a multiplier, it’s an exponent. The number of interactions is factorial, and the overhead for managing all of that state is more complexity on top.
Looking at a protocol such as ActivityPub is actually the wrong analysis and will mislead you with false hope. I'm not against decentralization but if we techies want to raise the bar discussing realistic outcomes, we need to break out of the unproductive loop of focusing on technical protocols.

I'll copy&paste a previous comment here:

>We need a protocol, a specification for completely decentralised, carry-with-us social networks.

I know it seems logical that a "social network protocol" is the answer to replace Facebook but after studying the mechanics of social networks, I've concluded that focusing on technical protocols is incorrect.

My suggestion to programmers seriously thinking of new solutions in the social networking space: don't get sidetracked into thinking about the protocol because if you do, your new social network will end up in the graveyard of previous failed projects like Diaspora. Instead, think about the database of real names.

Also, another previous comment on how focusing on protocols is (inadvertently) analyzing the wrong drivers for success: https://news.ycombinator.com/item?id=20231960

Another comment explaining why the free protocol "Signal" didn't solve the funding dilemma: https://news.ycombinator.com/item?id=20232499

My previous comment on why protocols like ActivityPub & Mastodon are not the answer for a general purpose social network adopted by the masses: https://news.ycombinator.com/item?id=18727230
> but buying ten N95 masks is as good as buying zero

Depends on the situation. N95 masks can be decontaminated and reused pretty easily (IIRC 150C for 10 minutes). If you're only using them once or twice per week, letting the mask sit for 3-4 days is enough for most of the viral material to be destroyed by exposure to the normal environment.
China is not really communist. It is just a really big corporation that treats its employees like crap, and sells their organs to rich Saudis and Westerners.
It would be! But DuPont is closed by the state and the Forest Service has closed some of the trailheads in Pisgah, so :/

If you ever head out this way to ride, let me know! I'm on Twitter @ my HN username -- hit me up!

(I live in central NC right now)
In Node.js (curious to hear about other ecosystems), HTTP/2 hasn't even caught on yet. Sure, it's technically supported by Node core and various frameworks, but hardly anyone is really using it. Most of the benefits that HTTP/2 brings to the table require a new model that doesn't map cleanly to the traditional request/response lifecycle. It seems harder to program applications using HTTP/2 because of that. Perhaps some of it is what we are used to and the burden of learning something new, but I don't think that's the whole story. I wonder if future HTTP versions will address this in some way or if it is going to continue to be the new normal. It will be interesting to see what the adoption curve looks like for HTTP/3 and onward. I'm still building everything on HTTP/1.1 (RFC 7230) and have no plans to change that any time soon, even though I can appreciate the features that are available in the newer versions.
Ask HN: State of intelligent agents for content curation?
I was just reading another post on HN about William Gibson's latest novel. It just dawned on me that I did not even realize it was released in January.

I experience this same idea with a few tv series that I follow. I never quite keep track of when a new season is released.

Years ago, there was this idea of intelligent agents that would track and curate content for you.

Is there any great system that does this now?
Yes and no.

The thing I am describing is when you link a compilation unit using:

struct internal_state { int dummy; } state;

with another compilation unit that defined the same state differently:

struct internal_state {
int actual_meaningful_member_1;
unsigned long actual_meaningful_member_2; } state;

As far as I know, BSD socked do not do this. Zlib was doing this (https://github.com/pascal-cuoq/zlib-fork/blob/a52f0241f72433... ), but I have had the privilege of discussing this with Mark Adler, and I think the no-longer-necessary hack was removed from Zlib.

BSD sockets probably have a different kind of UB, related to so-call “strict aliasing” rules, unless they have been carefully audited and revised since the carefree times in which they were written. I am going to have to let you read this article for details (example st1, page 5): https://trust-in-soft.com/wp-content/uploads/2017/01/vmcai.p...
Your statement is 100% correct but misses the entire point

https://news.ycombinator.com/item?id=22854475
I think the idea isn't that you don't thoroughly test, but that types are sufficient tests of certain functionality, and they're significantly more expressive and efficient than their runtime equivalents.
To someone else that has programmed for a good 2 decades or more, the above sounds like cowboy programming that leads to unmaintainable systems.

Unit and integration tests are not "substitutes" for good and modular design. Good and modular design work hand in hand with tests to produce reliable, well understood, and maintainable code. The most testable code is usually often the most well separated code.

A strong type system provides the third leg of the tripod. It's not replaced by or a replacement for either of the other two.

Stop thinking that you're too good for test code. Your future senior dev self will thank you.
Buying booze and drinking it isn't an investment.
The problem is that if the checks are always performed, the object code is significantly slowed down. If all computers supported the checking in hardware, then we could do it. You don't really want the current C approach (signal) to trigger except in an emergency, because there is no way to insert cleanup/retry/etc. recovery code via a signal handler.
AWESOME! Thanks so much, I'll look into that. I think it was the Instapaper service I was using back in the day.
> You can't be tied to the dollar without backing your coin with dollars.

Not exactly. There are projects like Maker and sUSD which create synthetic dollar equivalents via collateralization with native crypto assets. (Caveat here, Maker did recently add USDC, an IOU backed stablecoin, as collateral as an emergency measure. Unclear if that change will be permanent or not).
Hope! There isn't much other reason to be excited about it at this point, tbh. Almost all such efforts fail before getting to 20k units of production.
I/we understand the optimization, and I'm sure you understand the problem it brings to common procedures such as DSP routines that multiply signed coefficients from e.g. video or audio bitstreams:

for (int i = 0; i < 64; i++)
result[i] = inputA[i] * inputB[i];

If inputA[i] * inputB[i] overflowed, why are my credit card details at risk? The question is: can we come up with an alternate behaviour that incorporates both advantages of the i<=N optimization, as well as leave my credit card details safe if the multiplication in the inner loop overflowed? Is there a middle road?
> If the government wants to prevent you from getting a job that pays less than minimum wage it has to provide you with a job that actually does pay minimum wage.

I like this way of putting it. I'll use it in the future.

Similarly here, if the government wants to make it illegal to sell hand sanitizer at $5/bottle, they should provide hand sanitizer at $1/bottle.
Amazon Prime Chrome Extension
This is a subjective question. From the array of tools in your belt, when do you personally/professionally reach for C, or maybe more interestingly, when do you not reach for C?
Sorry. That's not what I'm suggesting. Many local news stations are having their reporters work from home using whatever crap home equipment they happen to have.

I'm suggesting the station help them with better webcams and mics, and tips/help for their setup, like where to put the table lamp.

There's clearly room for improvement, as some of the reporters have decent audio and video (for home equipment), and others don't. Some are barely audible, pixelated, washed out / overlighted, etc.

In short, I mean "higher quality home/consumer gear plus some training".
It always seemed a contradiction to me the Fremen, who worshiped the worm and spice, would want to terraform the planet and make it less hospitable for spice.
Investing in Roam Research
Did Bloomberg change his opinions on China when they OK'd the
"The Big Hack" in 2018?

https://www.bloomberg.com/news/articles/2018-10-04/the-big-h...

The controversy that unfolded from that was massive.

https://www.washingtonpost.com/blogs/erik-wemple/wp/2018/10/...
I mean, this is C so "fantastic shoe-gun" is part of the territory. But in C you can wrap this vector struct in an abstract data type to try to prevent callers from breaking invariants.
I would suggest trying headphones. Noise canceling ones if you have them. Makes it easier to ignore the distractions around you.
I wouldn't go with AWS or anything that advanced for just running a Mastodon server.

I personally like Vultr for VPS's, DigitalOcean is okay too.

If you want managed Mastodon hosting, I can vouch for https://masto.host/ - it's really good, have rarely had issues, and if ever I did, the support is amazing.
The distributed newsroom is proof that good quality video is pretty easy, but good quality audio is really hard.
It's hard to under-emphasize the long term impacts of the Fed's actions to print (not literally print but buy assets (treasuries, corporate bonds, and even amazingly public EQUITY) in exchange for cash), and the impact it will have on the USD - the global reserve currency.

Anyone who claims to know for certain what the impact will be, is a fool or a liar. We are in unprecedented monetary policy times.

Maybe USD is cementing it's position as the global currency standard, maybe this will spell the demise of the USD and the US' economic collapse, or maybe not much will change at all. There are arguments for all three to be true.
You will see mentalities lean more towards a cell based distrubution system over a global one and by that, production spread more with many countries waking up to being dependant upon others and looking at it as if they are at war with a country that makes all the guns in the world style thinking will play out politicaly more.

So a shift away form outsourcing, at least outsourcing out of country in full as has been the case in many area's of production alone.

Equally, resource/asset stripping may well be rife in the fallout with the ability to buy up companies cheaper and be instances in which those value of assets changing quicker than the company values them. They may own some unused warehouses that on the books been almost written off and yet perfect venue for manufacturing boom.

But so many things so high up in the air, you can never see a true picture of tomorrow, but can get some idea's and those ideas will change and flesh out in the long-run. But it's the overall trends and psychology is probably as useful a skill in predicting the markets than maths in today's times. Which kinda shows how up in the air everything is.

Only thing for sure, soon as one company comes up with a cure, you will see a jump in that companies share price, even if they was to do it all for free.
A bit off topic, but what are your views on Golang? I'm leaving this pretty open-ended, but I'm curious how you see it interacting with the C/C++ ecosystem in the future.
> "I would recommend musl, although the style is a bit idiosyncratic in places: https://www.musl-libc.org"

Opened a random part of musl out of sheer boredom. Here's what I see:

https://git.musl-libc.org/cgit/musl/tree/include/aio.h

A bunch of return codes #defined like so (see https://git.musl-libc.org/cgit/musl/tree/src/aio/aio.c):

#define AIO_CANCELED 0
#define AIO_NOTCANCELED 1
#define AIO_ALLDONE 2

#define LIO_READ 0
#define LIO_WRITE 1
#define LIO_NOP 2

#define LIO_WAIT 0
#define LIO_NOWAIT 1

Why weren't they using an enum instead? I wouldn't sign off on this code (and I don't think it lives up to best practices).
Also, check out Isotope. Seems to handle different-sized "cells" fairly neatly - https://isotope.metafizzy.co/layout-modes.html
Have you looked at the Aardvark spec?

https://www.joelonsoftware.com/2005/08/17/the-project-aardva...
Through the grape vine I've heard this is "very much like Stephen Wolfram"
The inflation target is still 2% despite the easing. I'm not aware of any indicators showing it'll exceed that, but it's easy to funnel your cash into TIPS or similar if needed. If the lockdown continues and the recession deepens the more valuable cash will be. If it ends soon and the economy rebounds you're out the opportunity cost.
But the Fremen were partly responsible because they hoarded vast amounts of water underground, contributing to desertification.
2.5x?? There is absolutely no way a car uses 250w on average in city driving, even with regen. If that was the case, some Teslas would have an autonomy of 400 hours(!) in city driving.

More like 25-100x more energy. And that's quite generous still.

In a city, bikes are indeed multiple orders of magnitude more efficient than cars for personal transportation.
Lego making 13,000 face visors a day for frontline healthcare workers
I don't know what is true and what isn't, but it is funny that you used Google to research whether Google did something wrong. In this case, they might not be the best search engine to use....
"Buying for resale" could include buying up now-useless stocks of institutional TP/hand sanitizer and re-packaging it for consumer purchase. Supply increased and value added.
Is HN really so fragile that two minutes after this is #1 on the front page its already been flagged spammed to death with no discussion?
Exactly. Not sure how one could write this article without mentioning the risks of so-called stable coins. Quite simply, the huge existential risk is that the currency peg isn't maintained, for all sorts of reasons relating to trust, actual $ supply, regulation, centralization, politics, etc.

Simply proclaiming the stability of something doesn't guarantee it, or absolve one of tackling all the same problems of currencies in general. Else, a nation would simply call their own currencies "stable" and back them with $ reserves, which they already try to do.

Also, it is extremely stupid to say that a real-asset backed "crypto" somehow eliminates censorship. The "backing" is the only real item of value in this equation, and getting ones hands on that asset is of course vulnerable to censorship.
Relevant: http://bactra.org/reviews/wolfram/

"A New Kind of Science: A Rare Blend of Monster Raving Egomania and Utter Batshit Insanity" (2002)
Thank you for your clear explanation, indeed Specificity instead of Type I errors, and Senvisity for Type II errors, make a lot more sense!
I believe C will continue to be used as lingua franca after no one uses it to write software, and we're decades from even that point.

You need to know enough C to interface with the OS, and enough C to talk about memory layout, memory management, dynamic libraries, ABI, etc.

Most higher language runtimes need C, even with a self hosting compiler. Not being able to work on the C parts is limiting.

You also need to know enough assembly to be able to understand what the compiler did with your own code, even if you never write assembly yourself. Not being able to compare the disassembly to the high level language to understand why it doesn't work (or is order of magnitude slower than expected) is limiting.
Because people want `c = a << b` to compile into `shl c, a, b` and C89 made the giant mistake of calling it ‘undefined’ instead of ‘implementation-defined, possibly fatal’.
We've changed the title above to that of the HTML doc, which fits the 80 char limit.

(Submitted title was "Bloomberg Killed Investigation, Fired Reporter Then Tried to Silence His Wife", which I'm sure was cut to that to try to fit the limit.)
Does the following code fragment cause undefined behaviour?

unsigned int x;
x -= x;

There's a lengthy StackOverflow thread where various C language-lawyers disagree on what the spec has to say about trap values, and under what circumstances reading an uninitialised variable causes UB. I'd appreciate an authoritative answer. Thanks for dropping by on HN!

https://stackoverflow.com/q/11962457/
Grocery Workers Say Inconsiderate Shoppers Are Endangering Them in the Pandemic
> To me, the question that springs to mind then is: does that kind of attitude work as well for “lesser” mathematicians/people?

My grades shot upwards when I stopped caring about them and decided to focus on what interested me (i.e. I like subject X and want to learn it well and will not use the grade as a metric of how well I learned it).
Valve and HackerOne: how not to handle vulnerability reports
I am in the same position. I also wish I'd gone to university, taken my education seriously, and done something other than CS (all easy to say in retrospect). There's still time :)

There are plenty of careers out there that are open to smart but unqualified people though. Once I looked around I realised my options aren't so bad (and some of the options I found may tempt me yet).
Learn functional programming or different programming paradigms. For example learning Elm brought me a lot of joy and wanted to implement stuff like tetris, snake, other little apps and toys.
NetKotH: King of the Hill for Cyber Security Enthusiasts
You've just made a Type I error because you've lacked 'specificity' in your mind by swapping the two! :O
Most of us on the committee would like to see more participation from other experts. The committee's mailing list should be open even to non-members. Attendance by non-members at meetings might require an informal invitation (I imagine a heads up to the convener should do it).
Predict every crisis to the tee? Citation needed. Reminds me of the economists have "predicted nine of the last five American recessions."
Web Pioneers Launch Identity Startup That Ditches Passwords
20 years of anything is enough to evaluate other options. That's perfectly normal and expected. Congratulations on reaching this milestone! While you no longer find joy in programming, aren't the broader goals of why you're programming clear? Working without a sense of mission or purpose is a sure way to hate what one is doing. Are you getting that at your job?
Exotic materials, other than maybe SiGe use fabrication techniques less advanced than Si, and the transistor counts are much less.

The department of defense funded an SBIR grant in the late 1990s to produce an InP based microprocessor, given the limits of the time it would have been closer to a 6502 than a Pentium. There has not been word of such a thing since which leads me to conclude that the topic is classified.

The worst limitation a 6502-era chip has is that it has no instruction cache so instruction reads are fighting with data for memory bandwidth. You might even consider a Harvard architecture where the instructions go on a different bus. Without an I-Cache there is no point in pipelining, but there is a lot of pressure to implement CISCy instructions such as the string copy operation from the 8086 line.

The other issue is that there is no DRAM replacement with exotic materials, and all the difficulties with interconnect latency get a lot worse than they already are. It's more clear how to make SRAM, so having somewhere between 64K to 1Mbytes of SRAM on die seems likely for an exotic material CPU.

Of course, armchair CPU designers are more likely to make progress with transition triggered architectures and FPGAs in 2020.
> Do you think involuntary psychiatric committment and forced drugging is a reasonable reaction by the government to a protester/activist who is paranoid about surveillance in an age of ubiquitous surveillance?

Yes. She might have followers, you know.
This has been going on a while. I have helped my less technical folks with equipment, like laptops, mics, webcams. And pointers to webcam software, how to test/adjust the mic, etc. And that's just to make our team meetings better.
Amidst Covid-19, RapidDeploy Makes Virtualization of 911 Dispatch a Reality
Try explaining the concept of "scope", starting with nested blocks. It does require some practice. I suggest not unnecessarily reusing identifiers associated with different objects.
One feature of C which I do not use often is enums.
Support for constants beyond the range of an int is not portable.
And I also try to avoid is putting enums inside structs,
because there is no portable way to enforce the size or the alignment of the enum's base type.

Will this be addressed in future revisions of the C standard?
I suspect it was probably because of trust. An openly gifted reviewer gives more trustworthiness than just video ads or underhanded shills.

Given that you were probably smaller and not commodity priced to move I guess that sort of "honesty" helped move it better if people could closer to try before they buy.
Further to the $EDITOR thing, I hope people don't actually use `-b "entire contents of issue right here on the command line"`. Small doesn't necessarily mean content-free, but I find the good issues tend to have a bunch of information and investigation in them. That's a way you can contribute to open source; otherwise, you're just creating a poor quality support ticket.

It's not like `hub` doesn't have the `-m` flag, but opening up EDITOR by default, without even asking "press e for nano", helps. In the same way issue templates tend to. It's a nudge in the right direction.
It was “No more Mr Passive Resistance” that did it for me!