skysight-inc/HackerNews huggingface dataset:
It may be better to ask yourself what does await do?

I am no longer familiar enough with C#, so I will take NodeJS as an example.

In NodeJS everything that you do happens on one thread, which is great because you will never, ever, need to worry about locks and threads.

The downside is that you can only serve one client at a time. To avoid this, whenever you start reading a file, or send a network package, or something else that takes a long time where you are not doing anything, Node stops running your code and runs some other code for a while. Then it will come back to you when it has a result and start running the code again.

It is easy to understand for us what come back means, but how to express that in an language? First attempt was with callbacks - node would come back to whatever you put in the callback. The downside of this is that you get very nested code, you have to repeat code to handle errors and it becomes a mess fast, especially if you have to deal with collections.

The next attempts are promises. These are a lot easier to deal with than callbacks, because you get some value back than you can treat like just another object (put in containers, etc) but in practice your code still ends up having to stop and pass values through functions all the time, which puts in visual noise and is a pain to deal with.

Next step then is async/await. Instead of coming back by executing a function, you use the keyword 'await' to tell the compiler where to await to. As for why this can't be used inside a function, await is a legal identifier in plain Javascript - await(someValue) - has a very different meaning if you have your function marked as async vs if you don't.

I use await a lot at work, and my mental model is just that it is the same as promises, except that instead of having to write an annoymous function, invent a new name for the result of the promise and showel my code into the anonymous function, the compiler does so for me.

Thus I get to write:

let a = await fs.readFile....
let dirContent = await fs.readDir(...
return dirContent.contains(a)

Instead of:

return fs.readFile....then(fileContent => fs.readDir(...).then(dirContent => dirContent.contains(a)))

Which is, to me, borderline unreadable.
Show HN: I made a site to visualize Ukraine's Ethereum donations in real time
>It depresses wages, mostly for internal employees who aren't paying attention bc they're content with their jobs.

It is just wild to me that this is where society landed. Imagine you are a business owner. Wouldn't employees who are loyal and happy to come to work be the exact people you want to keep long term? These are people who know your industry, your business, your customers, and your product. They are your institutional knowledge. They are drastically more valuable than a new hire who has to spend years learning this all. But instead of rewarding that loyalty, we use it to squeeze out an extra few dollars of profit regardless of the consequences. It is bizarre.
Not a lot of people realise that Windows 1 through to Windows XP was written by Bill Gates alone from his bedroom. Wasn't until Longhorn that he brought in Steve Ballmer to help out.
Ask HN: What is the oldest, still supported OS?
I recently discovered that TSOS, an old Univac OS that I used (and loved!) in the mid 1970's and first released in 1968 by RCA, is still supported (although the name has changed) as Fujitsu's BS2000 OS. Unix was released a year after that (1969). Is there something that beats these?
There are two options for doing things in JavaScript: 1) do it now, or 2) start it now and get back to me when you're done.

JavaScript makes (1) the default. For any kind of object access (dog.legs[1].paw), assignment (const q = 5), math (Math.floor(4.2)), or DOM access in a browser (document.write('yay')), the interpreter will run each statement in sequence, completing each one before running the next.

Historically, the way ask the interpreter to "get back to me when you're done" was to use the "callback pattern," which was little more than passing in a function:

setTimeout(4000, () => console.log('second'));
setTimeout(5000, () => console.log('third'));
setTimeout(3000, () => console.log('first'));

When it came time to construct sequential-looking programs that involved lots of these calls, things could quickly get messy:

http.get(catalogUrl, (err, catalog) => {
if(err) {
handleError(err);
}
http.get(catalog.products[0].url, (err2, product) => {
if(err) {
handleError(err);
}
document.write(product.name);
});
});

Promises flipped this callback style into an object. Async/await morphed those promise objects and methods into language syntax that looks like one thing happening after another:

catalog = await fetch(catalogUrl).catch(handleError)
product = await fetch(catalog.products[0].url).catch(handleError)
document.write(product.name)

If the original question were "why are some APIs async and some not?" the answer would be: "JavaScript engine authors (web browsers, node) have decided that some things like network access are inherently too slow to pretend they happen instantly, and waiting on them would mean that the UI would have to become unresponsive, which would make users think something is broken. Other APIs like DOM access are fast enough to get away with freezing the UI and nobody notices."

But the question was, "why can't you call an async function from a synchronous (non-async) function?" The answer there is more like, "Because synchronous functions are expected to return a result without waiting, and if you could call an async function but pretend you didn't, there's not a good solution for what should happen in composition with other non-async functions. Would you proceed without having a result? Would you force a wait anyways? None of those are acceptable answers because they break the model of 1) some things are nearly instantaneous and 2) some things take longer. We still need a mechanism to work with things that take a long or unknown amount of time, without making the UI freeze."

As lolinder points out in a sibling comment, this decision to split things into 1) fast and 2) not fast was ultimately a semantic decision of JavaScript engine/API designers. The downside of this decision is that it takes programmers some time to be comfortable with the unintuitive model. The upside is that it enables programs to be written by (fallible, mortal) programmers and not freeze up all the time.
I think:

> Putin instead recognizing the breakaway regions as independent sets a bad precedent from China's point of view.

and:

> China presumably really wishes Russia had set a wargoal of annexing Donbas / Crimea / all of Ukraine to be part of Russia.

are just part of the same process:

https://en.wikipedia.org/wiki/Declaration_of_Independence_of...

> Russia recognised the Republic of Crimea's declaration of independence[8][9] and agreed to incorporate the Republic into the Russian Federation following a referendum.

Agnostic to the outcome of the conflict, they were / are probably just planning on the same approach.
Voting somebody out is not a coup.
Please read this comment as pure speculation, as I don't have any more information than anyone else.

I was initially surprised Russians forces haven't steamrolled Ukraine, BUT, I think that's intentional move by Russian Military leadership. Throwing your hot hand in immediately at country that recently received large shipments of [known effective] Western ATGM's... probably isn't the best move. Essentially: Putin sent green 18 year-old recruits to the slaughter to see what would happen. Ukraine repels the first wave using valuable ATGM munitions, letting Russia send experienced tank crews come later when Ukraine ammunition is spent.

No matter the scenario, the real loser is again Russia. Do you think the CIA is going to let a bunch of top secret Russian armor sit on the battlefield untouched? IMHO, probably not. A lot of Russian military secrets are going to be revealed to the west.
> In LA at least, some of the best tasting meat, specialty stuff like birria with actual goat stewed for hours with love with traditional techniques perhaps, is not going to be easily found in any restaurant. You will find it served in tin foil or styrofoam off a folding table under a canopy tent on the sidewalk. They start stewing the meat on site hours before even making their first sale, which might even be well after the sun has set. The restaurant model cannot afford this overhead

Huh? Are you under the impression that restaurants don't spend hours prepping their food? It takes a good pizzeria three days to make their dough. You couldn't do that at a roadside stand.

I can't think of a single dish that you can make at a roadside stand but not in a restaurant with significantly better facilities. You're making a correlation vs causation error here -- yes, there are some types of food that you will more typically encounter in food-truck-type situations (e.g. in NYC that'd be something like lamb over rice with white and red sauce), but that's not because restaurants can't do it. There's just market segmentation.
What time do you go to bed? I might want to try this but I also still like being a nightowl who goes to sleep at 1 or 2am
> That seems to leave Putin off the hook, unless you're implying that the military is corrupt because of Putin, which I think is obvious because he corrupts everything he touches.

By no means am I implying that Putin is off the hook for this. He's been the leader of that country for decades now.

> Putin is a bully who likes to pick on smaller enemies. He did it when he was KGB, he did it against Georgia, he did it in Chechnya, he did it in Syria, and of course Crimea. Russia came out on top in those conflicts because they were punching down.

This is true to an extent, but it also ignores the geopolitical influences that led him to strike those particular targets. He's been very aggressively countering western expansion in eastern Europe, which is a major reason why he chose to strike Ukraine. Ironically, this move may wind up backfiring in the long run.

> For instance they brought tanks into Ukraine but they didn't establish supply lines as you say. Is that due to a corrupt military, or because they didn't even comprehend they'd need to establish and defend supply lines? Their previous conflicts didn't necessitate doing so, and they didn't here either.

Yes, establishing supply lines is military strategy 101. Tanks are not exactly fuel-efficient and require lots of logistics and service to remain battle-ready. The failure of Russian armor in Ukraine feels way more like inept leadership than it does pure hubris. Surely they knew how big the country was before they decided to invade, I have a hard time seeing them being intentionally so ill-prepared as to think they wouldn't need to refuel these multi million-dollar tanks.

> he attacked Crimea and then used the experience to inform his opinion about how the Ukrainian military would fare. What happened was that the Ukrainians learned from Crimea and they prepared. What he's seeing right now from Ukrainians is the antibody response of his invasion in 2014.

I think is this way oversimplifies and glosses over many key facts around the geopolitics of the situation.

Crimea was mostly ethnic Russian and the annexation has remained fairly popular in that part of the country. The reality is that Ukraine is a poorly segmented country that still sees major Russian support in its eastern half. It's really only the western half of Ukraine that consistently votes to join the EU and NATO.

Keep in mind that Crimea happened right after president Yanukovich was removed via a coup for being a Russian sympathizer himself, so Ukraine was in a leadership transition at the time. Zelensky OTOH has rejected many offers by the Kremlin to align with Russia, which makes him far more dangerous to Putin.

I think Putin surrounded himself with yes men that promised a swift and powerful invasion and failed to deliver because they're fundamentally corrupt and have no real idea how effective their military resources are. The Russian economy is much worse today than it was when Crimea was annexed, which in turn fuels corruption.
"Asks" at the top switches to "Demands" further down. A bit jarring.
There can indeed be lots of magic going on in a backend and various ways GDPR violations may or may not be discovered.

Here's an amusing 320k euro fine
https://ico.org.uk/media/action-weve-taken/enforcement-notic...

On 24 July 2018 the MHRA had executed a search warrant at the premises of
Doorstep Dispensaree under the Human Medicines Regulations. In
the course of its search, the MHRA discovered, stored in a rear
courtyard, 47 crates, 2 disposal bags and 1 cardboard box full of
documents containing personal data. MHRA estimated
approximately 500,000 documents but cannot estimate the
number of data subjects.

MHRA have inspected the crates and the information contains:
a. Names
b. Addresses
c. Dates of Birth
d. NHS Numbers
e. Medical Information
f. Prescriptions

The dates on the documents range from January 2016 - June 2018.
The documents were not secure and they were not marked as
confidential waste. Some of the documents were soaking wet,
indicating that they had been stored in this way for some time.

I doubt there is a purely technical solution to finding this kind of problem :)

Edit: to be clear, the violation type here seems to have been "Insufficient technical and organisational measures to ensure information security"
A solution would be for the OS developers (Apple/Google) to provide a way to retrieve data from the backend. This would not fully prevent it to be hacked but would change the difficulty:

- wanna be GPS spoofers would need to emulate the whole OS/sensors to send spoofed data to Apple/Google

- the platform/OS developers would have more ressources and incentives to detect spoofed data

The cat&mouse game is harder when played against Apple/Google than against a single small developer.
So now it's just an arms race where everyone else has to get a newer car to avoid getting drawn into unprovoked accidents caused by bugs in other cars software?

Not really a world I'd prefer to live in.
"The Resource Curse" explains why its even worse than that.

If a dictator can get rich by letting foreigners come in and take your resources then they dont need to invest in the country beyond building a road to the nearest port.
Lots of people upvoting it in a short period of time and nobody flagging it?

The HN ranking algorithm seems to put a lot of weight into both velocity and flags.

A few factors that may have caught people's attention to upvote: it's about an HN company, the author is an HN regular, everything you need to know is in the title, it's written in first-person, and it's a bit unusual for someone to return as CEO.
"Pay everyone correctly" is a loaded statement. So is "valid wage." These things are determined by the market and what a candidate brings to the table -- not just by the job itself.
Any other PR suggestions you have?
For some reason I don't really understand, while I can't stand McDonalds in general, their fries are better than any of the "fast casual" places like Shake Shack, In-n-Out, etc. that I've encountered.
Was she encouraged to publish her thesis?

Lately I've been thinking about undergrad thesii and similar, and how tragic it is that so much research has been done but not published! Even just thorough surveys could be invaluable.
Then you post 2 different job listings. It’s not hard. You’d write 2 very different descriptions for someone those 2 hypothetical candidates anyway.

You also don’t need put $50k-$5,000,000 just in case John Carmack applies. If he does happen to apply to your junior engineer position, you instead interview him for another position with a higher salary band.
Thanks! That's what I've been using, but some tables give pdftotext problems :-(
They are targeting users in Russia, not Russians.

Ultimately, people in Russia are paying taxes towards this war, and have some responsibility for their government.
Then those of us able to get more might be pushed into taking the risk of making our own company and competing against the major players who are currently controlling the market by paying more than God to keep talent focused on selling ads instead of creating value?
What's a "gm CEO" ?
Most of them, as far as I know.
Maybe github should use gravatar if the email doesn't match a github account. Not that that helps with old email address you no longer control but it does let you add an image to an arbitrary email you do control, separate from github.
Meanwhile we can do better than "every C program is a valid C++ program, so C++ can’t lose" defensiveness.

Look at the data tables published with that 2017 paper:

https://sites.google.com/view/energy-efficiency-languages/re...

There's an order of magnitude difference between the times of the selected C and C++ programs, for one thing — regex-redux. That is enough to explain all of the difference between the C and C++ time measurements shown in "Table 4. Normalized global results". (Seems like an outlier which could have been excluded.)
>I saw a video recently of a person who was denied boarding due to being visibly intoxicated. The process started with the gate agent offering to book them on another flight, and devolved into the person being banned from the airline. But they still received a full refund for their unused ticket.

More that a decade ago I was doing standards work in Amsterdam, after a long weekend of sitting in a conference room with 12+ people going over excel spreadsheets to edit a bunch of recurring text all over the place that was then used to generate the documentation / schema for the standards under discussion we were to catch a flight back to Copenhagen.

My coworker and I went to get a late lunch before heading back, I don't drink but he did so he took a big Heineken. Then we went to the airport. We checked in fine, and then we went to wait for the flight in the boarding area.

While waiting my coworker went to the bathroom. I decided what I really needed to do was some stretches because of how excruciatingly cramped up my muscles were from sitting for a whole weekend.

At the time I was in exceptionally good shape as I did Capoeira 3-5 times a week 3-4 hours a training, yoga classes, and weight training. So of course I was doing all sorts of funny stuff like balancing with one leg and the foot of the other held in my hand for several minutes, and going in a bridge pose, doing pushups, jumping jacks, standing on my hands, doing handstands and other stuff like that. My coworker was a long time in the bathroom, maybe there was a line.

While I was exercising one of the attendants from the flight we were supposed to get on came out and told me I would not be allowed to fly because I was obviously intoxicated.

Now I towered over the guy, I was in a bad mood from the weekend already, and frankly, he was just the most alcoholic looking Dane you could imagine, with a comical little pug nose red and purplish like the cartoon vision of a town drunk from the 1940s. So I nearly lost my temper at him, and was near to getting stranded in Amsterdam because of how irritated I was by the ludicrous assertion that anyone doing the things I was doing could possibly be drunk!

Just then my coworker came out and saved me, when he was told I was being accused of being drunk he started laughing because of course in Denmark a person who doesn't drink is already sort of funny.

So after some convincing I was let on to the plane. Later, after we lifted off, the little dipsomaniac steward came to apologize to me and as a way of making up for it said my coworker and I could have free drinks! He suggested a nice beer, or some wine, or some champagne. Anything I wanted! I said - I will have a Coke thank you. (but I was not able to do it without sounding annoyed)

My coworker took a red wine. He had laughing bouts several times on the flight back.
Crypto exchanges make a lot of money. Just from trading fees. Margin calls don't typically have their own special fees, although the perpetuals products (that one can get margin called on to begin with) typically have daily fees.

Coinbase did a direct listing of its shares at a $100bn valuation, with extremely low revenue numbers, which are still great numbers.

Anyone that:

A) Has similar volume

B) Has similar growth

C) Offers more ways of accruing value - such as perpetuals

D) Retains greater ownership of their own company

is simply going to have a lot of money. Its not that mysterious. Keeping a few $billion in crypto provides many opportunities for the same price appreciation as everyone else.

Alameda is also known as being quite a shark when it comes to deal making, if you don't get something in writing they are going to do the most profitable thing at you/your community's expense as soon as the opportunity arises.

Their OTC desk also likely has more volume than their lit exchange exchange, and OTC desks enjoy wider spreads in the trades.

And remember, they have nonstop trading sessions, 24/7, so more than 3x as many sessions as a stock or options exchange, and slightly more than futures and currency exchanges.
There was an article a while back talking about running a transmission line from Chile to China so summer, desert sun in Chile could be used to generate solar energy to heat China during the winter. I read (was an HN posted article) either within that article or in the comments that transmission losses would only be ~30%. I wonder if solar panels in North Africa could generate electricity to be consumed during German winter?
13 year old X5 and it still works? Either you paid fortune in service or keep it in big bathtub to catch all the leaks.
https://theanthrotorian.com/travel/2012/10/20/how-to-cross-t...
Quite true. One of the things Windows got very wrong was UCS-2 and, later, UTF-16. So did JavaScript.
To take this further. A world made of words and ideas, detached from real observation, must necessarily be completely psychotic.

We're talking Bosch's Garden here. Demons, skulls, fire and snakes.

Consider our modern nigh-solipsistic society. And videogames. And us, wrapped in an airtight bag of propaganda and entertainment.

Consider that excellent insulation. Consider the anaerobic ravioli.
Michelin restaurants can be good value from a certain perspective. I went to a 3 star place in Japan that cost $500 a seat, but there were only 8 seats and two rounds a night, with maybe 6 people behind the counter. You do the math and they're not making much money.
Scary stuff. I feel bad for anyone in Ukraine getting shot at by these.
> be more obviously related to them like hiring staff to various startups.

Those are inline ads, impossible to vote or comment on.
how many email addresses can a person associate with their account? is there the potential for me to develop a bot that scrapes every "unclaimed" email address and claim them? seems like a very poor design choice.
Are you asking about how to go about the actual task of writing an academic paper?
Apple Defends App Store Changes in the Netherlands as Fines Reach €30M
> Note that the world's biggest content site, Wikipedia, allows anonymous edits and always has.

Not really. You can't edit Wikipedia from a VPN (even with a user account!), and I think they ban most datacenters. The edits aren't really anonymous if they publicly associate with a piece of PII that, for most people, directly maps to their name and home address.
General Motors, the car company that owns Cruise, has a Chief Executive Officer, Mary Barra.
The CEO of General Motors.