skysight-inc/HackerNews huggingface dataset:
Ask HN: Books covering best practices in advanced multithreaded design in C++
I'm looking for books or online resources showing best practices in use of atomics, barriers and locks in the design of multithreaded realtime applications in C++. I am specifically looking for actual implementation examples and architecture examples and not just covering the basic theory or use.

Background/context:

I am working on an application where I need to share various datastructures between threads. I've been using atomics but as the complexity grows it becomes hard to review code for "correctness". My goal is to avoid holding locks for long periods of time. Since this is a realtime application I also want to avoid waiting. So lock-free, wait-free is preferred.
It continues to baffle me how a newsboard called hackernews has countless people who are incapable of seeing the value in making something for the sake of making it.
Have you looked at the Tesla share price history, or SpaceX valuation?

Elon makes his equity-compensated employees rich. You don't need complex psychology to explain the appeal.
Twitter isn't just for journos, it's more importantly for all their sources too.
Google does not allow trademark infringement in ads [1] and provides tools for trademark owners to prevent their trademarks from being used improperly.

The issue here seems to be that the Gimp team does not have a registered trademark for "Gimp" (at least not in the U.S). This can be verified at the USPTO website [2].

[1] https://support.google.com/adspolicy/answer/6118

[2] https://www.uspto.gov/trademarks/search
That map doesn't really contradict the "Texas is flat" proposition: it takes over 400 miles to rise 3000 feet. OK sure they could have decent hydroelectric near El Paso, if it ever rained there, but the dams listed at your link for the other 95% of the state have less generating capacity together (even if we count the capacity that rightfully belongs to Mexico or Oklahoma) than Wilson Dam in Alabama, which was built in 1924.
Just ordered a copy. Looks like a great read.
I love them when they let me pay at the end and there's still staff around to ask questions if needed. Waiting to flag down someone busy to ask to pay so I can leave if I'm not carrying exactly the right cash amount is not helpful for anyone.
Ask HN: Have you ever been ripped off?
I have been majorly ripped off twice previously while taveling.

1.) In Mexico by a "doctor" held my ID hostage and pre-emptively wrote a prescription for an over-the-counter medication, then demanded payment.

2.) Thieves in Spain stole $7,500 of luggage while we were waiting to board a ship.

What have you experienced?
Largely the ones I’m regularly already exposed to, though.
Elon taking over Twitter given his promises to dismantle what meager content moderation policies it has, means it becomes a more amplified platform for political misinformation and hate speech, further radicalizing large portions of the population to partake in even more violent acts, such as the recent assassination attempt on the speaker of the house, armed vigilantes stalking voting locations as we have seen in Arizona looking for supposed "mules", things like that. Lax content and moderation policies will enhance the platform's capability to be used as a tool for online stalking, harassment, death threats, etc. so that non-right-wing voices will probably need to abandon the platform ( a "cancel culture" of sorts indeed, where people who don't silence themselves will be in danger of being literally cancelled).

Beyond that, there is then his massive conflicts of interest and his personal political opinions such as those involving Ukraine, which he would be able to amplify in the same way as any nation-state seeks to spread propaganda regarding their political agendas. The Pentagon literally had to negotiate with him, as though he were his own nation state, regarding his maintanance of the Starlink system that Ukraine depends upon in their current war with Russia. If Musk is essentially rich and powerful enough to be treated as a diplomatic entity, it's pretty scary he'd have full privatized control over the most influential social network in history, not any less frightening than if Twitter were a state controlled entity by the US government, the Saudi government, etc.
I don't think so. I couldn't tell you the inventor of the transistor or the operating system but I'm familiar with Grace Hopper and Eda Lovelace. The important people in a field's history are more or less remembered for reasons that may be arbitrary like a catchy name or funny story.
Bit of a curveball mention of Warren and Sanders there, the latter of whom is certainly focused on what he sees as far bigger issues.

But the Norwegian Sovereign Wealth Fund, which he has mentioned favorably as a potential model for the US, does recommend against investing in companies with these types of share arrangements unless they have a sunset date (their analysis is that there is a benefit to giving founders control but that it diminishes and becomes a detriment over time). Matt Bruenig/People’s Policy Project has written on the topic also.
We don't know who they people he brought over are. It's doubtful that they are people who've never done anything but write code for Tesla. Were I in Elon's shoes, I could easily imagine digging up some employees with prior relevant experience and asking them to just browse through the codebase and give a rough appraisal of how tight it is. You can tell a lot by looking at basic things like coding standards, state of source control, development environment, testing strategies, what kind of code reviews are happening, how modular the code base is, what the service architecture looks like, etc. I've worked in a number of industries and good code and tight systems look different from bad code and sloppy systems. He's probably not looking for anything specific, but rather to get some understanding of the state of engineering there.
Or they can join a competing social network.
Ukraine Unleashes Mass Kamikaze Drone Boat Attack on Russia’s Black Sea Fleet HQ
QR Code menus are the absolute worst. They're a serious pain to use on the phone, and they encourage people to take their phones out when they should be put away.

So far, every restaurant I've been to also has paper menus. I'm not sure what I'd do if online was the only way to look at the menu. I'd likely find another restaurant.
So you think if we don't paint our son's room blue and dress him in nothing but camo he'll want to chop his balls off later?

No, you Americans just have ridiculous views (left and right).
The difference is that speech, even unpopular, controversial, insulting, and dehumanizing speech, isn't violence. There is no legitimate claim to self-defense aside from direct threats to one's own life or property.
You could’ve made 1000x on GME or bitcoin!
It is with a trademark lawsuit. You don't need to fight, you just need to file the lawsuit.
I drive a Mercedes and Apple CarPlay works fantastic (Tesla’s driving OS would probably be a sidegrade at best). And I get all the fit and finish of a Mercedes instead of Tesla..
It's utterly amazing how flagrantly these posh-dole recipients will shamelessly gaslight us. The sine qua non of capitalism is that it's distributed. What has destroyed and continues to destroy capitalism is the Fed keeping interest rates ridiculously low, going on (at least) three decades now. All of those artifically-cheap "loans" are newly created money being given to the financial industry and handwaved away as "value neutral", while it's anything but. The real estate bubble, the stock market bubble, the auto loan bubble, the college bubble. Everywhere individuals are priced out of transacting directly and banks have stepped in to financialize our lives - it's all been fostered by these central-planning puppet masters, giving us a Potemkin village of "growth" while the real distributed economy gets more hollowed out as its wealth is sucked into the cancerous financial industry with much ultimately wasted on make-work jobs.

And then to have the gall to say that rates going up ever so slightly is "destroying capitalism" ? If you want to know where the blind populist rage driving support for burn it all down candidates comes from, it's right here. If you want to know why "young people" are rejecting "late stage capitalism", it's right here. Heads they win, tails you lose.
With TSLA in the S&P 500 it's difficult to avoid being a shareholder
Maybe it’s an opportunity to spot Twitter employees who could be adding more value working at Tesla instead?
Presumably only one of them was in there at once. ;)
This isn't an Android vs Apple thing. Both of them introduced native QR code scanning in the same year -- 2017. That's five years ago. So I don't know what version of Android you're using, or what camera app.

But honestly, in 2022 it's kind of up to you to know how to scan a QR code, the same way you're expected to know how to type a domain name into a web browser. If someone has to teach you the first time then that's fine, there's a first time for everything, but the idea that there are people who haven't done it before isn't a reason to hold us back. And if you have a phone with a pre-2017 operating system or that otherwise doesn't support it in its native camera app, you can install an app for it.

But yes, places generally always have a backup option, whether a paper menu or tablet. I mean, people's cell phones run out of battery all the time. It's not just the elderly or non-tech-savvy ;)
I didn't say CA was small, just the TX has a lot more available land (CA is .6 the size of TX). CA pop density is 2.5x TX's. And unlike TX, nearly half of CA is covered by mountains.
I once got 35x by betting on a zero
It's PubMed, if you select everything health is the primary context, so your theory is automatically correct. A more interesting context would be evolution, sexual function or culture. There shouldn't be significant disparities between research on penis and clitoris there, but there are.
Honestly, this seems like the second best time for twitter engineers to unionize. Best time would have been a couple weeks ago.
> looking like a communist

What does a communist even look like?
He thinks he's being ironic, but that isn't enough.
Hacker News is a recruiting website for those capitalists' employees. (Look at the only ads that ever appear on HN).
Twitter execs fired by Musk may not get their “golden parachutes”
That's cute. You think the NSA and the CIA care about the constitution.
That is interesting. I wondering how the 15 people that had created the ~600K c++ codebase I’m talking about compares to the FB headcount on android Messanger, does anyone know how big that team is? loc/head is a curious measure.

Regardless it’s a bit concerning that it takes 10M loc for a messaging app.
You don’t think these companies have produced meaningful change? They’ve meaningfully changed the world far far more than Musk companies. Clearly you are a fan of the Musk companies more, but who cares?
Everything the west has done is a huge failure

They failed to shut down russia

They failed to become the voice of reason

They failed to become the peace actor

They failed to provide assistance to Ukrainian population

They failed to provide help to their own citizens due to rising price of energy and inflation

And worse, their secret service and intelligence team failed at hiding their mission and they suffer from massive leaks from their own employees

They are now trying to save the face by trying to slow down their escalation, since the nuclear threat propaganda flopped hard

This generation of western leaders are no match with their predecessors (wich were already no match with their own predecessors), this current batch should be replaced asap, specially considering that China, Pakistan and Brazil are next, and that doesn't look good at all
I'm not a fanboy, and there are many things you could call Elon Musk, but incompetent isn't credibly one of them.
Well you're not getting an appointment within the next year here in Canada...
For sure the tesla stock is going to plunge because a few guys took time off to come assess twitter...
Huh, maybe that explains why living in Australia, I don't understand the hate for QR code menus. Basically everywhere that has a QR code menu over here these days also lets you order and pay via the same QR code.
How does it benefit the tipper to help someone else evade taxes?
The only thing that matters is who you know. Business plans and financial models don't matter. If you know people with money and have a relationship with them going back a long time, that is how you raise money. I've come to learn this after spending 1000s of hours making business plans and pitching in europe and silicon valley. People often think that with a good idea, prototype and plan you can raise. We were not able to do that. Meanwhile, other people with a much shittier prototype in the same problem space, but with connections, were able to raise money. They went bankrupt and we are still around, bootstrapped.
I know, right? It seems so dumb that it's hard to believe. They're free to the right sort of people:

Applicants need to be notable in fields such as government, entertainment, sports or political activism, and they need to abide by Twitter's rules including a ban on the glorification of violence. [0]

Which probably means one can get a checkmark if one pays the right PR firm, who kick back to the right twitter middle manager, but twitter shareholders don't get a cut. Twitter has completely ignored an obvious source of revenue for its entire existence.

[0] https://www.nbcnews.com/tech/social-media/twitter-verificati...
On the fly conversion of 2d video to 3D
Except you have to tip before you get any service
Why timeout? Point them to 0.0.0.0 and there will be an instant failure. This is precisely what NextDNS does when not using their blocking page.
If you’re looking for a comprehensive, accurate diagnosis you’ll want to find a good neuropsychologist. They aren’t cheap, but if you find a good one they can really help you uncover specific issues.
I hate QR code menus as they are often poorly implemented.

However, I just experienced a QR code check for the first time. That was really nice .. I scanned the QR code with my iPhone, it downloaded the Toast "app clip", which allowed me to pay the bill with Apple Pay. It was totally seamless and far better than handing my credit card to a server to get lost or cloned.
It doesn’t seem very hard to build a space ship if you are a motivated billionaire
I wrote an article recently trying to put across my thoughts that debt isn't actually a very good analogy for maintainable code, basically because it doesn't really fit in with the opportunity cost calculating that real debt has: https://dev.to/aha/technical-debt-isnt-technically-debt-4oke
"Sun Ra" might not be the sun god you are thinking of .....

https://www.youtube.com/watch?v=H1ToFXHW5pg
That is true. They were definitely a skilled team that had written the system. However I still think most large systems can be reverse “design” engineered fairly easily by someone who is experienced.
With a standard Node project, you'd need the Node configuration AND the Docker configuration. If I can do without Docker, why not?

> my generic Makefile is probably easier to read and understand than any standard that you have probably achieved

That sounds fairly rude for HN
I’ve been coding for 39 years. I know how the process works. And yes, it does take time to get the deep understanding of any system. But it is not on the scale of impossible for a squad of 10x engineers to answer and/or develop some basic questions in a short time frame. And much more reliable than trusting the existing crew who has been quite publicly represented by persons hostile to their new boss. I do not in any way mean to cast ALL engineers at Twitter in this light. But it is quite clear the bullies there have grown quite accustomed to their pulpit.
The US is generally too smart, and powerful enough, to not get its/our hands dirty. We need plausible deniability at least.

Even when we commit the most severe war crimes (Iraq), nobody can do anything anyways -- but we don't want to give up that soft power when we can so easily get other folks to do our bidding.

If all else fails, we send in the CIA.

Israel does a lot for us, but in this case they were probably too close to Russia.

Who else could have enough sophistication to make it happen? UK would be a good choice, and they made a strategic decision long ago to stick with the US no matter what -- e.g. Iraq.

I find it hard to believe the UK would be stupid enough to do it directly, as opposed to some hired third party, at least, but you never know. They were already out of the EU, so maybe this was a parting gift to the Continent for all the Brexit-induced suffering.
Really surprised there hasn’t yet been a reckoning with QR code substitution attacks. Duplicate the menu, put up a “type your credit card details” form, and you could probably automate the actual order with the real menu site in the background. Boom—-skimmed.

There’s just no way for laypeople to evaluate the provenance of random QR codes. The restaurant industry often uses random third party sites for their menus, so even that is a poor signal.

EDIT: Adding second paragraph that was accidentally deleted before submission
Agreed, why don't poor people just buy more money.
That’s probably the goal here. Elon is following the cult leader playbook. Make the followers do strange and humiliating rituals.
Suppose you have an Android device for which you want to see all traffic. You could configure an HTTP proxy in your system settings, but this does not capture any UDP-based protocols. Additionally, apps may choose to ignore the proxy settings and it's hard to tell if they do. To overcome these shortcomings, we now have WireGuard mode: Mitmproxy spawns a WireGuard server on startup (instead of an HTTP proxy listener). Now you don't set a proxy on your device, but you configure your device to use WireGuard with a config that sends all traffic to mitmproxy. mitmproxy then transparently intercepts all requests that are coming through that WireGuard tunnel (the device still needs to trust the mitmproxy CA). Put differently, instead of using an explicit proxy configuration or something like iptables to route packets to mitmproxy, you use a VPN (WireGuard). The benefits are:

- You can intercept/modify UDP, in particular DNS.
- You avoid the "apps ignore proxy settings" problem.
- On Android specifically, the WireGuard app allows you to only proxy specific apps (not possible with a global proxy config)

Does that make more sense now? We also have a bit more documentation at https://docs.mitmproxy.org/stable/concepts-modes/#wireguard-....
I don't use any build packs in Heroku? Since a while back Heroku just recognizes the Node project and automatically works with it, no need for any extra file.

Or do you mean it's the same in Fly.io? If it auto-detects Node.js (through package.json), or at most allows for a dropdown to say "Node.js project", then that sounds about right for me.
If you read his original post it was mostly about how long it takes for apps to get reviewed by Apple, sometimes weeks. The argument was Telegram was one of the biggest apps in the app store so if they get poor treatment it must be even worse for smaller apps. The commission comment was just to say they should already have the money to handle it
And so are the fan boys!
Oh I 100% agree with everything you said here. You do due diligence before. You don't just blindly cut 70%.

I was just saying if I had to (because I was being asked to) cut 70% or even 10% immediately that's what I would do. But I'm also not sure I'd take that job.

I'm just enjoying the popcorn cause no one seems to know what's going on.
My phone doesn't have a smudge of ketchup and a spot of sticky dried Coca-Cola on it that get on my thumb.

Also... I can imagine why it could be reasonable to assume my phone might have the same number of germs as the menu... but how on earth do you guarantee it has far more?
Yes I think the point is that no physical menu can match the uselessness of a poorly scanned PDF on a small screen.
Show HN: Shell Of A New Machine: Quickly configure new environments
I think more different kinds of organizations have started doing SAFe than you think!

I agree that both real priority shift / additional information based changes and also politically and paranoia motivated changes occur, but I don't think it's as straightforward or obvious how to differentiate one from the other as you seem to be implying. I'm sure many of the clear cut priority shifts based on new information to me have been the obvious politically or fear motivated changes to other people with different context than me.

Personally, I just think a better solution is to prioritize detailed work immediately before it is done, whenever possible.
I haven't really listened to Watts seriously in any capacity, but can you explain what you don't like about him? If I had to guess I'd wager that you explaining it might undo your own philosophy, which is something I'm sympathetic to, as expressing what's 'wrong' can often fall short of grace
> It was totally seamless and far better than handing my credit card to a server to get lost or cloned.

In most countries I've been the waiter brings the PoS terminal to you and you pay at the table.
It's not a bribe if you get nothing in return.
Because people use their phones on the shitter, always.
This is almost certainly going to be a lawsuit, one that I suspect he’ll lose because it’s unlikely he would have had justifiable cause within the first few days as owner.

This is all because he knows he overpaid and is trying to reduce the insane amount of debt the company has now taken on as part of the sale.

This coincides cleanly with him trying to fire most employees before their stock (now cash?) packages vest. Which I suspect will also end up in a class action lawsuit unless there was some arbitrage agreement.

He needs to reduce his self inflicted bleeding immediately to have any hope of it not being a weight around his legs.
For a $2.99 app? 90c to cover payment processing fees, hosting, and distribution sounds reasonable.

For a $29.99/month subscription? No way.
Thanks for sharing. I was legitimately curious. This is very interesting. I still have a healthy dose of skepticism, but it’s not like you’re stack ranking based on PR frequency or size, and the fact it’s not an input to your function might be why it has the signal you see. Kind of a catch-22 for lazy managers.
I would guess anyone calling someone out 48 hours into a huge codebase is themselves the bullshitter. Maybe if that 48 hours is work time and presentations/walkthroughs and the person catching up is a seasoned director (they tend to have to do this quick ramp of huge projects more often than an engineer). But no one is going to look at Twitter's code base and make any meaningful conclusions in 48 hours.
What do you mean by push? Tesla already doesn't run ads, this would be a strange way to start.
Fully agreed on both points.

QR code menus 99% of the time just link to the website menu (which existed before the QR code for menus became popular, and is still wack). And it usually sucks just as much as it did before.

QR for a check is a beauty. Exact same experience as yours, there is a local restaurant that did it, and I was prepared for the worst. But I scanned the code, it did the Toast app clip, and the entire process was extremely smooth. I went to that restaurant multiple times since then, and I would be lying if I said that the "qr to pay the check using the app clip" didn't at least partially contribute to that.
> My phone doesn't have a smudge of ketchup

No, more likely it has particles of feces. Bon appetit!
We are getting closer and closer to a nuclear confrontation. The longer this goes on the higher the probability of a nuclear strike which can escalate into a global disaster that no one will recover from.
True, I just got robbed.
NASA caught the sun smiling down on us, but the grin could signal a solar storm