skysight-inc/HackerNews huggingface dataset:
In one of my projects the "additional layer of code to automate this checking" looks like this:

def ok(a, b): assert a == b, (a, b)

from .util import ok

ok(Parse(b'.25').do(0, real), (3, ('real', 0.25)))
ok(Parse(b'1.5').do(0, real), (3, ('real', 1.5)))
ok(Parse(b'-1.5').do(0, real), (4, ('real', -1.5)))
ok(Parse(b'+1.5').do(0, real), (4, ('real', +1.5)))

If this results in an exception at import time, I sometimes have to comment out one or more of these tests while I fix parts of the bug.

I mean, I do do some manual testing. Sometimes it's easier to bang on a function and decide whether the output looks right than to figure out what the results should be from first principles. But it doesn't take very many repetitions of a manual test of something like the above before it's the manual testing inflating the time needed, not adding another ok() line.

This is especially true for debugging. Adding automated tests is often a faster way to debug than to add print statements or to step through things in a debugger. Sometimes I take the tests out afterwards, but more commonly I leave them in. And with things like Hypothesis and QuickCheck, tests can have a much higher strength-to-weight ratio than simple tests like the above.

It's also a breath of fresh air when I'm trying to understand what some code is supposed to do, or how to call it, and I come across a one-line test like the above.

Speaking of how to call things, sometimes I do test-driven development so that my internal APIs don't suck. And sometimes I don't and wish I had. There are a couple of lines of code in the same project that say this:

array = Thunk(lambda: drop_ws(b'[') + Any(pdf_obj) + drop_ws(b']'))
array.xform = lambda d: ('array', d[0][1])

And, you know, that's just shitty, shitty code, because that was a shitty way to design that interface. And maybe if I'd written that code test-first, instead of just charging ahead madly implementing the first thing that came to mind, I would have realized that when I was writing the test, before writing the implementation. Now, if I want the interface to suck less, I have 700 lines of crap to refactor to the new interface, which probably means either throwing it away and starting from scratch, or incrementally refactoring it while maintaining both interfaces for a day or two. And that's inflating the time I need to get the thing done.

It would have been less work to fix it at design time, the way my friend Aaron taught me: first, write some application code as if the ideal library existed to write it with; then, write the library code that makes it run. And that's just so much easier when that application code is just a unit test.

However, as with most things, I disagree with Robert Martin's point of view on this. I can easily conceive of writing software without TDD, or even without tests. In fact, I do it frequently. Tests are often valuable, and TDD is sometimes valuable, even in weekend personal projects. But they aren't always worth the cost.
Ask HN: Widget Toolkit for Electron Apps?
I want to create pretty simple Electron GUI (think TODO list) and want to concentrate on functionality rather than HTML and CSS. Looking at the source code of Electron applications looks like everyone comes up with their own custom widget system and set of styles. Is there anything like QT, GTK, or wxWidgets, but for Electron applications? Something that has rich set of pre-coded GUI components where I can concentrate more on functionality than mucking around CSS.
It means Chinese Communist Party and is usual used as synonym for China if the focus is on the authoritarian regime rather than the people or the land. Only like 6% of the people in China are part of the CCP.
I think OP meant "Building Microservices" by Sam Newman.
cute citation but it is a sweeping generalization. There are plenty of small businesses that take care of their employees. Yes they have challenges but so does large businesses and "unicorns". There is no perfect business to work for. You just need to avoid shitty ones and especially shitty bosses/managers.
I'm taking bets on how much time elapses between now and when Mattel comes out with a transgender line.
Obviously someone decided to program in a literal line noise language.
Of course he doesn't, as it's complete nonsense.
Thank you for fighting the good fight.

Apple is making it impossible to have real customers and real businesses. They're turning us into serfs of their unfair ecosystem.

It's one thing to build interconnected products, but to grow the pie so large that all commerce and communication with 50% of Americans goes through their polished gates, to be stripped, taxed, and even cloned, is an abuse of power and position. It's a strip mining of our industry. An over fishing that has greatly decreased the probability of success for small, independent players.

Until the DOJ forces them to open up (or break up), we're stuck in this war zone.

I'm going to follow in your footsteps. Hopefully many more do as well.
Despite ‘Delta’ Alarmism, US Covid Deaths Are at Lowest Level Since March 2020
That's what I thought. I thought that the character of one would balance the other out in this case. (Not that there is any guarantee, of course.) I was wrong.

Bad leadership drives out good.
Early Retirement (2006)
> "Unrestricted Upload of File with Dangerous Type"

You are confusing "type" with "static type". This is user input. You are not going to statically typecheck your users.

(See other comment for stringly-typing).
In theory a cheaper reform is not hiring prosecutors who pursue cases with weak evidence, or who don't throw kids in jail for crazy things like taking pictures of each other, or who ask for lower sentences.

The prosecutor has a much bigger influence on outcomes than a public defender.
Dude, apps small and large still send personalized emails. If you want your users’ names so bad, just ask. It seems like you would just prefer to do name = google_data_json.name rather than ask your users for their name and let them decide if they want to give it to you. This is exactly why I love that Apple introduced Sign In with Apple; it gives the user more control over what they want to give out since it’s their data.

Also your revenge is not on Apple. They’re a behemoth and won’t notice. You pointed this out in your post so you are obviously aware of it but the only people you are hurting are yourself and your users. If you know this and willingly charge along, all I can say is that says a lot more about you than it does about Apple. Good luck.
But the question is, is the 13 manned ship still simpler than one that requires people doing all of those jobs? ie. is maintaining the machinery less complicated than maintaining the equivalent number of people that would be required to do the same jobs? Arguably yes.
Connettiti al tuo Raspberry Pi zero via USB
Stai cercando un modo per connetterti al tuo raspberry pi zero senza wifi? guarda qui! https://www.youtube.com/watch?v=v1i6rfSVV30
Use Phoenix Channels
Surely you would expect a firm like that to have access logs, and scan them periodically? You'd be caught if you tried to look at stuff you weren't supposed to, without a doubt? Why would someone even try?
Ironically, I think that in this case, an RSS reader being an electron app wouldn’t be so unreasonable. Especially if the content is on the more interactive side. Although, a bigger focus on security would be required toward the scripted content.
> I just want to point out that supposed cancelling hasn't done a blessed thing in the instances that celebrities who say actual bad things publicly.

Huh?! Gina Carano was fired by Disney earlier this year because she had the audacity to draw a parallel between today's political vitriol and the Holocaust [1]. This happened precisely because of the power of the current outrage mob.

If you don't see the effects that the outrage mob is having on the rest of us, it's because you aren't looking [2].

[1]: https://www.msn.com/en-us/news/politics/supernumberfireginac...

[2]: https://www.cato.org/survey-reports/poll-62-americans-say-th...
The mysterious insects are oak mites, whose numbers have swelled from feeding on the cicada brood.
Working in a company where I deal with equal amount of Macs an Windows, we spend a lot more time dealing with Mac issues that simply cannot be solved due to either hardware or software limitations Apple have put in place.

Windows is very solid and we rarely see issues with it on decent hardware which still costs 1/2 of what a lower spec Mac equivalent.
Nice, I like the way you think about it. And take my comment with a grain of salt, please. It's impossible to judge the full context over an internet discussion with a stranger. :-)
I don't know whether to feel disgusted or fascinated by this. I find the concept of prototype-based inheritance quite elegant, but this is a bit too much insane.
Meanwhile in America: https://www.universityworldnews.com/post.php?story=201908301...
You are out of touch. Large parts of the country do not believe that COVID is 'not real'. Such characterizations are wild exaggerations.

And IIRC, in the last administration, large swaths of the country had no trust in anything they did. For example, the current VP said she would not take a vaccine developed under the previous administration.

Ultimately, CDC knows that the country is incredibly divided politically and should adjust its message accordingly. That was true for the previous admin, and it's true for this one.
I agree that TypeScript leaves something to be desired, but it is far and away a better alternative to pure JS. TS may not be total, but it comes close enough to get the job done for the dynamic environment it's meant to target assuming operators competent enough to lean on what it offers.

I should also note, I've attempted OOP in TS and it wasn't pretty. It is much more suited to a functional style IME,
although I will concede I have seen some open source projects that use it in a Java-esque OOP style presumably to good effect. Personally it wasn't my cup of tea.
It's a quote from the 80s movie WarGames, about an AI trying to solve the "game" of nuclear war.
Compare 'n' Save glyphosate concentrate with your choice of surfactant added.
I think parliamentary politics works a lot like this too. All the important decisions are made in off-the-record, arm-around-shoulder, hallway conversations and horse-trading. Then the plenary sessions and votes are just to formalise what has already been decided.
I can't wait until more HN commenters get the 2nd & 3rd rounds of vaccines.
Limitation on legal punishment is one of the critical foundations of any society that could be defined as civilized, so I have trouble agreeing that the morality or consequences of people supporting specifically unjust instances of social shunning begins to approach that, even giving you all the benefit of doubt within reason as to what qualifies as "unjust".
That’s when you explicitly ask the user for their real email address. This is not difficult unless you want to make it so for the purpose of raging at apple.
Vulnerability in dating site OkCupid could be used to trick users into ‘liking’
Is there any place for monoliths in 2021? (2020)
For a more professional notice, I'd try something more like "Apple required us to choose between either supporting Sign-in with Apple in the iOS app, or disabling the logins of all existing users who had signed in with Google and Facebook. In protest of these abusive requirements, sign-in with Apple will not be supported online."
How to Protect Your Car from Damage
He doesn't explicitly say he knew of his notoriety when he joined and could very well have only discovered after. Alternatively given the economic circumstances he could have needed the job enough to take the risk. To be honest, your comment seems unnecessarily snide and mean spirited for no reason.
If you want a protection layer on your car which is a layer of chemical polymer in solution form you can go for ceramic paint protection in Glasgow. This layer will protect your car paint and doesn’t harm your car’s real texture. It is used to apply externally on the car to save its color and original texture.
Occasionally the status thing will come up regarding jobs and I find it interesting. I suppose HN tends to view software developers as high-status, probably because of its roots in the bay sate startup scene, where to imagine, yeah.

But when I tell people what I do. A large number still don’t know what the fuck it actually is, outside “something with computers”.
Apple Magic Keyboard with Touch ID
>Typescript ain't it.

Expand please?
Sorry about that. I wrote the style sheet in a hurry and forgot to test it on mobile, although zooming out worked for me.
Mmaping directly readable data is certainly a way of avoiding the problems PHK is talking about, and can be reasonably efficient. Sendfile can be even better if you can structure things to have a metadata index that's in memory or mmaped, and never need to read the actual sent data.

But mmap is no panacea. It's big flaw is that the kernel scheduler often doesn't know as much as your app about what you're doing. So when you touch an out of core page and it page faults, your thread just gets locked up. Worse, the kernel's read ahead logic may make the wrong guess about how many pages you're going to read, or when you want data written back out. You can try to mitigate this using madvise and msync, but in practice it's kinda brittle.

Some systems use blocking io with a dedicated thread pool to wait on the block. This way the main threads can move on to other useful work rather than sitting stalled on a page fault. Golang's runtime does something like this for you automatically.

Databases for the most part do their own scheduling, and may even use async io. This is because they know far better what they're actually doing than the kernel can guess. Another reason is the database's buffer cache is usually tightly coupled with the consistency control algorithm, so again, you don't want the kernel guessing, you want total control. Databases often use direct io and take on the burden of scheduling everything themselves precisely for this reason.

LMDB uses mmap, but should not really be considered a database. It's just an embedded CoW btree, though a fine one.

Andy Pavlo's openly published course materials are a great resource for learning about database internels. He used to be emphatically against mmap for databases, but in the last couple years has moderated that position somewhat.

io_uring is looking like it will be the best overall solution moving forward, at least for linux only.
Adjunk, Sidebarjunk, Javascriptjunk, Popupwindowjunk, and the outlook that the most precious resource in the world are a few seconds when you are distracted are what motivates the Washington Post and most of the commercial web.

What you are doing stripping out the junk threatens those organizations at the core.
These look great! Can't wait to buy some for my son, he'll enjoy playing with them.
I'm not dismissing. If there is a reasonable chance that you unexpectedly need full-color-prints at saturdays 03:00, or often get the material for the final prints mere hours for a deadline: sure! cover your risks by buying expensive machineries. It's what they are for.

Obviously, you'd need to cross-reference with the actual risk: are you out of a job, failing class, or kicked out of the local church when you fail to deliver full-color-prints last minute: cover your risks by buying the machines that were made for this.

My point is that most people don't have those risks. And if they do, can cover those risks with little planning just as well as with buying equipment.

You only need to print your CV minutes before the job-interview when such job-interviews are planned minutes our hours ahead (and in my experience that is literally never the case). You only need to print your dissertation last minute if you spent the first 6 months of "writing the dissertation" procastinating. I definitely did that. And I definately found that my printer jammed at 05:50 the morning before I had to turn it in at 10:00. if only I had planned just a little better...
The only doubleplusungood thing being alleged about these BNPL scenes is that they are — checks notes — offering lines of credit. Shocking.
Interesting enough, though it's a little dickish to post this before giving the author a chance to fix the most important issues.

I also disagree with this point:

> Thus it's not end-to-end encryption; at best, it's trust-on-first-use

E2EE means little more than that the server can't see the contents of the messages while the clients can. This may not be a very common or secure method of E2EE, but it's still E2EE.
I don't think it's viable to defend institutions by saying that things are only obvious in hindsight when other countries did manage to implement sensible policies from the start.

For example Taiwan didn't pretend masks or travel bans are ineffective.

Reminder that this is what the official narrative looked like in feburary-march 2020:

https://twitter.com/UNGeneva/status/1244661916535930886
https://twitter.com/who/status/1243972193169616898
https://i.imgur.com/lGXf03w.jpg

Sure, public institutions can be wrong and should be allowed to course-correct, but some of this wasn't due to uncertainty but deception, perhaps well-intentioned but still a political decision and not a communication of facts. And once this comes to light (as it did) people will remember it and it'll undermine the credibility of their future decisions.
> Malbolge Unshackled - Malbolge Unshackled is a dialect of Malbolge from 2007 by Ørjan Johansen. It attempts to remove the arbitrary memory limits of Malbolge in order to create a language that is hopefully Turing complete, while keeping closely to the spirit of Malbolge in most ways.

> Malbolge - Malbolge, invented by Ben Olmstead in 1998, is an esoteric programming language designed to be as difficult to program in as possible. The first "Hello, world!" program written in it was produced by a Lisp program using a local beam search of the space of all possible programs. More practical programming methods have been found later. It is modelled as a virtual machine based on ternary digits.

Seems like a lot of fun to try to program a lisp in these languages, although I'm nowhere near as crazy as the author to actually sit down and do it. Kudos author!
Many of these mistakes were quite easy to recognize as mistakes when they were made. You can also call into question the decision making processes at the CDC without calling into question their intentions.

I sure hope we actually learn from this pandemic rather than being content to blame social media and anti-vaxers for all our problems.
That article should definitely be the OP here, as it's much, much more informative than the Reddit posts.
On the other hand: Count the CVE's.

An increasingly popular high-rel setup has two different SSL/TLS handlers in front of Varnish, each using a different SSL/TLS implementation.

That way a "ohh shit CVE" against either of those two implementations allow you to turn those of, and keep your site running.

If We bolted any particular TLS/SSL implementation into Varnish, you'd be down when that one got hit.
Justified or not, I'm more afraid of all the horror stories that say you can't unsubscribe than the $4 a month.
This gives Mattel way more credit than they deserve.

They're making these dolls because society has figured out that we need to value women's contributions, and everyone agrees. Mattel is lagging, not leading on this issue.

Go back a bit in time and when society had different values, Barbie had different professions.
Simplicity is simple to define for simple problems, but complex to define for complex ones.
That's not really relevant. The detrimental biological effects of lead pollution that the gasoline companies knew about and lied about to try to stop regulation have not been debunked, and in fact are rather firmly established.

The lead-crime hypothesis was formulated after the phase out of leaded gasoline started. Drops in crime seemed to correlate well with the phase out, with variations in the crime drop matching variations in the implementation of the phase out.
Eh, I'll take that bet. They're still a company, and by the numbers, I would think it represents a very small minority. The sales probably wouldn't make it worth it. It might be worth it as a marketing tactic though, who knows.
I'm sure the CDC could've done better, but even if they did the political benefits in terms of public trust likely wouldn't have actually materialized. I live in England, the country whose early warnings about the dangers of the Delta variant this article points to as proof the CDC and the US government should've known, and even here there's pervasive media-fuelled conspiracy theories about why the government didn't close off travel to India before the Delta variant got here (before it was even recognised as dangerous). Supposedly, the only reason was because they wanted a trade deal with India and we could've avoided the whole wave if not for that, and it even got nicknamed the "Boris variant" after our prime minister because of that.
There is always politics in public policy. Science tells you what the consequences of your actions might be, it doesn't tell you anything about the desirability of those consequences.

If your goal is to eradicate a virus, science tells you the correct policy choice is to ban all interpersonal interaction for several months, stop all transportation, and put locks on everybody's doors so they can't leave their houses.
> I like the angle of "Sorry, Apple ID only works on Apple devices."

Except it's inaccurate, it works on Android, Windows and in browsers https://support.apple.com/kb/HT211687

Agreed on all other points though, if you want to garner sympathy from your users, that's definitely not how to do it.
Agreed, and great point, LOL! This doesn't solve the actual problem at hand. It's more like a token like "hey you can do it too". It does not give you the skills you need, like spatial skills, for example, which you learn from playing with Lego, etc., which is crucial for success in engineering. If you don't have these skills, you will be in for a ride in formal engineering school. Yeah, you can learn it during your weed-out courses, but have fun!

I am female and I have a twin brother. Fortunately my parents were awesome and I didn't have to deal with as much gender bias as other people. I got to play with all of my brother's toys and I had no interest in dolls. I also got to play with computers, which was the best, LOL!

In order to actually help solve this issue, unlike Mattel, here are some useful tools (toys):

Here, if you have a child who is a girl, get her GoldieBlox in order for her to intuitively develop spatial skills. GoldieBlox is designed by a Stanford Engineer and has free virtual STEM Camps: https://goldieblox.com/

Here is a Wikipedia post about GoldieBlox: https://en.wikipedia.org/wiki/GoldieBlox

I also learned coding from Lego Mindstorms. It's spendy (expensive) but it's worth every penny. It also teaches you advanced interfacing in an intuitive manner: https://www.lego.com/en-us/product/robot-inventor-51515

Also look on Etsy for intuitive gender neutral STEM toys.
They are not scientists, they are doctors.

Four have an stethoscope, the other one looks the same but without the stethoscope and there is another one looking like a business woman.

So, where is the software engineer Barbie?
If non-newtonian mortar and bricks are too complex for robots, it's ok.

We did not come up with mechanical horses, did we? We came up with automobiles.

Let the robots build houses in their own radically different ways: for example, 3D printing on site. Or anything else, really.

Don't let's just get obsessed with bricks in particular.
They're even in Silicon Valley. Not every company can raise money. And even if they do, being able to raise money doesn't necessarily mean having the competence to run a software company well.
And I actually think the message is more biting with only the first sentence. It works better when you don't take it too far.