skysight-inc/HackerNews huggingface dataset:
I can't wait to repeat this story at parties! I once tried to dig into the source of a game in Java witten by a French programmer while I was in Highschool. I was able to glean how to use Image APIs from it but the code as a whole left me mystified.

It's been 10 years, I wonder if I could crack it now.
Is it too late to fix Facebook? Part Deux
It's ambiguous in the article, and it's not specifically mentioned in the Google C++ Style Guide, but during code review at Google it's likely that a reviewer will object to this code:

std::vector<int> v;
v.resize(10, 42);

That form of std::vector::resize is discouraged because nobody can remember which argument is which. A reviewer would probably prefer:

std::vector<int> v(10);
std::fill(v.begin(), v.end(), 42);

Or even

std::vector<int> v{42, 42, 42, 42, 42, 42, 42, 42, 42, 42};

I have some other quibbles with this article

* "Not marking it inline is a sure way to prevent inlining" is totally wrong)
* The bit about using-directives is also pretty wrong. See https://abseil.io/tips/153 for why. And the example the author gives is terrible:

void foo() {
using namespace std::placeholders;
std::bind(bar, _1, 2);

This doesn't even need a using-directive.

void foo() {
using std::placeholders::_1;
std::bind(bar, _1, 2);

It's shorter, even.

To summarize, the Google C++ Style Guide is there to assist reviewers in reviewing new code. Contrary to what the author thinks, the guide doesn't prescribe anything. At Google decisions are always left to the reviewer. Read the Abseil libraries to see how the style guide applies and when it is ignored.
Having written C++ at Google using these (strictly enforced) style guidelines, I actually kind of likes Google's subset of C++.

It should be noted that any reasonably sized shop uses a subset of C++. It's insanity not to. It's just a question of what to allow and what not to.

Google C++ uses a style of error-handling that's akin to how Go handles errors. Many functions return a util::Status (which would be OK or an error) or, when you needed to return a value, return a util::StatusOr<T>.

Some people who write Go rail against the verbosity of this. I actually like it because it makes it pretty easy to reason about what your code is doing without the flow control you can get from exceptions.

There are definite warts in the codebase. One big one I remember was that one of the early developers (which might've been Craig Silverstein) didn't believe in unsigned types so there are a bunch of size functions that return an int and this has caused no end of problems.

I'm no C++ expert so I can't speak to some of the author's gripes (eg pragma-once vs #define/#ifndef) but a lot of the criticisms suggest that the author hasn't worked on large codebases.

Take operator overloading. This is fine, in theory, if used judiciously. The problem is engineers differ on what's reasonable and this may lead to unexpected behaviour, particularly when you start factoring in automatic type conversions. You see this in Scala, for example, where people go nuts, basically because they can and for no other reason.

There's a certain type of engineer who gets trapped in a mindset where they start considering complexity a virtue. I once got into a discussion with someone where he was shocked that I didn't know what perfect forwarding was. After looking it up I was like "why do I need to know this (unless I'm writing a templated library)?" and the answer is I don't.

Google's C++ style guide is largely about avoiding these flights of fancy making it into codebases that other people rely on, may need to debug, etc. And it achieves that goal as I found Google C++ code quite readable on the whole.

There's still a lot of code that doesn't, say, use smart pointers, so you can get dereferencing errors if you're not careful or if you don't understand who owns what. And this isn't something that C++11/14/17 smart pointers are perfect at anyway (something I'm quite bullish about for Rust, in comparison).

Another example: the complaint about no reference arguments. The point of this is so you can't tell what function arguments might be mutated if you allow non-const reference function arguments whereas with pointers it's obvious. To be clear:

foo(c); // could be pass by value or reference (const or non-const)
foo(&c); // clearly mutable

I also believe the C++11 thing is outdated. Even when I still worked there some features were allowed from C++14 and some code was obviously going to be migrated to the C++14 equivalent once the issues with that were resolved (IIRC std::make_shared had an equivalent).
I once joined a small company in which the CEO's son, a "7th year CS PHD" (He had to retake some classes), wrote the entirety of an iOS app using obfuscated C++ templates/macros (!)

During development a number of requirements changed and they had already burned through multiple other devs before hiring me. Eventually Xcode updated and it was required to use the new version to deploy against the latest version of iOS, this version of Xcode was not able to process his pile of macros in the same way as the old version. The QA team had already updated all of their test devices leaving us with no way to test the existing code.

This, combined with the CEO's son's unwillingness to sit down and walk anyone through the code, led to me sitting in a face to face with the CEO alone in which I explained all of this to the best of my abilities in layman's terms. He asked me for a solution and I said have your son fix it as he is unwilling/unable to walk anyone through it and being the 5th dev they had hired trying to figure it out, I put in my resignation. It was a fun 3 weeks.

I later found out through a friend who did media work for the company they were selling this product to, that they were never able to deliver and ended up getting sued for breach of contract.
Submitting a university assignment on time
> I can already hear an argument that there’s a difference between “library writers” and “everyone else”. Maybe GSG should be waived for “library writers” who are expected to be language experts. This is a dangerous world view. We should not bifurcate developers into two camps as the reality exists in a continuum between these two extremes. Every developer should be a “library writer” as it is the only way to decompose the code into manageable, testable and reusable units.

When I started at Google out of college, I came in writing clever, elegant code, and had to learn that, in large systems that will be touched by lots of people over large periods of time, readability is often more than worth sacrificing the maximally performant, concise, or elegant system. One of the ways to maintain this across a large organization is by limiting the set of available footguns, and granting exceptions when needed (eg, for "library code"). The latter type of code absolutely is bifurcated from generally-accessible and modifiable systems. The cost of doing the latter is increasing the hurdles to requires to modify the code, which already is and should be the case for widely-used library code. This seems obvious enough to me that I'm not sure how the author is misunderstanding it so badly (either that or I am).

Now, the author isn't completely wrong: another thing I've noticed is how much cargo cult, "Google does it" behavior there is among startups. Creating such an large-org-safe subset of C++ usage may not be appropriate for every type of organization, and if you don't understand why you're using GSG, it's probably worth figuring out whether it's a good fit. But the author utterly fails to make the claim that it's "no good", or even that it isn't appropriate in plenty of situations.
Most users do not understand the “necessary but not sufficient” condition. They need a “if (condition) { SAFE; } else { NOT SAFE; }” test, not an endless checklist, and the security community has continuously failed to deliver on this.
It does on Ubuntu. /home/* is readable and executable to everyone.
Using MailChimp mailing list to communicate with your app subscribers
Glad it's not just me.

Elsewhere they say something like "But it works like a database! You do queries and everything!"

Ok. So sign a database.

It's like they're expecting developers to not know a damned thing about blockchain, but know they want a secure database and something with cool buzzwords in the name and AWS has one for them as long as they have a credit card.

AWS needs to provide clear and compelling places where AWS is not the answer to everything. I am not hearing that, and it indicates to me a lack of appropriate executive direction. Yeah, sure, build a cult. But build a cult with guardrails.

I'm not sure that this is the "Make stuff people want" that I would be comfortable pumping to others. I don't know. I must be missing it.
> just as bad of an earthquake zone

As much as people living in California would like to believe that, it's not true. I was born in Chile, a place that's actually as equally-prone to earthquakes than Japan, and I've been living in California for about 8 years now. In here, I almost forgot what is like to feel an earthquake. In Chile/Japan is common to feel at least a magnitude 5 earthquake a couple of times a year (they are actually called "tremors"). California is in an unstable zone, but nothing compared to Chile/Japan.

Anecdotally, right before moving to SF, we had the 2010 earthquake[0] (8.8), I'm pretty sure with an earthquake like that in SF, there would be no city left behind.

[0]: https://en.wikipedia.org/wiki/2010_Chile_earthquake
> There are a bunch of solutions to this, but adversarial models do a good job of approximating a probability distribution like this.

The problem is GANs on sequence data still stink compared to max-likelihood: they train far more slowly, more unstably, and still don't generate decent sequences compared to a char-rnn with a bit of temperature tuning & beam search. They should be better for precisely the reason you say, but they aren't.
I believe it comes from DIGITAL systems, eg VMS.
Pre-public education America was also more rural.

The rise of public education is tied to some degree to industrialization and urbanization in the 19th to early 20th century. (https://link.springer.com/chapter/10.1007/978-1-4020-6403-6_...). This makes sense as industrialized jobs (even the industrialization that occurred in rural areas) often require more complex skillsets.

As I see it, our society requires more complex skillsets than ever. So the need for an educated population is actually greater today compared even to when public education first rose up.

I'm fine exploring many ways to increase educational opportunity (which may include the inclusion of private firms). But based on the private college market (think diploma mill scams), I'm very distrustful of any politician who thinks that completely dumping education onto the private market with zero oversight is a good idea.
"The FDA certifies the entire formulation, which includes everything from the binding/filler chemicals, anti-caking agents, the pill coatings, and even the ink used to mark the pill (which is why imprinting is very popular)."

Sometimes the FDA certifies a dosage of a generic based on a different dosage. This caused a problem not long ago when the dosage they assumed was fine didn't dissolve right, hence the absorbed dosage varied and was sometimes way too low. To add insult to injury, it was a psychotropic drug, so everyone assumed patients complaining were "just imagining things" for a long time.
iOS UITableView with images and performance issues
I did once work on such a thing, deep in the rotten heart of finance in a life insurance company. The design was more than 20 years old and was the result of a port of a previous codebase to a new language. The previous codebase was also a port from an even older language. And legend had it that the thing started out as a Paradox database in the 1980s. Along the way, the code had been translated without significant refactoring, so idioms from the older systems had been brought forward without consideration as to whether they were sane in the new one. The overall flow of the process was still based on the original design, even though you would do it entirely differently in the modern toolset (for example, intermediate results were written out to files, then read back in in the next step because the original system didn’t have the concept of functions that could pass data around).

Subtle bugs had crept in over the years, usually relating to the different sort orders or rounding rules of the different platforms. Some minor bugs had become features (the users didn’t want the bugs fixed because they had become reliant on the incorrect version and didn’t want to have to restate their results with the correct version - the idea being that having to explain and account for the change was more trouble than accepting the minor defect).

The codebase had been altered regularly with minor changes over the years, by a succession of contractors whose names appeared like biblical king lists in program headers. The changes were usually minor, and the approach had always been to graft on some new functionality or extra edge case, rather than redesign anything. Many of the contractors had been actuaries rather than professional programmers, so there were hair-raising sections of code that achieved the required result in extremely obtuse ways. Real outsider art.

There were huge vestigial sections of code and redundant outputs that nobody ever used, but because it was part of a bigger end-to-end process that was also poorly understood and onerous to test, those sections and outputs were always kept just in case they were significant.

In a way, this was a relief. It meant you didn’t need to understand a lot of the code, as long as it kept producing the outputs everyone expected it to.

I was part of a project to migrate all this code onto yet another new platform. Did I take the opportunity to do a grand refactoring? Heck no. The project was already overdue when I arrived, and I had two other projects to work on at the same time. So I did what all those contractors had done before me. I lifted-and-shifted with the least invasive changes possible, ran just barely enough tests to convince the users it was good, and moved on.

I still work for that company. The codebase is now more than 30 years old. It’s had another platform migration since, as well as the same old stream of minor change requests. Bolt-ons on top of bolt-ons on top of tactical kludges.

The thing is ugly and horrifying. Ramshackle and arcane. Congealed, not designed. And yet... it’s managed to carry on producing the outputs that this business needs it to. So is it really all bad?
truthout is not a great source for actual information, it's like a left-handed FOX.
If you can put together a good AML (Anti-Money Laundering) tool, especially one that will automate all of the required paperwork for Federal filing compliance, you'll never go broke again.
You just accidentally summarized why growth obsessed global capitalists are completely delusional.
You could also have differences in the manufacturing conditions, quality control, and such.
In this case I can assure you that these "few lines of code" were much easier to understand, and more correct than the code that was being replaced. Basically, someone was trying to fix an IO error that they did not understand by writing a complex retry mechanism, even though the system already had a better and more correct retry system that wasn't being used for this.

It wasn't a hack, so much as removing someone elses (unnecessary) hack that fixed the problem.
They've actually turned this decision around. In a few months (not sure why it's going to take so long) us Aussies will be able to buy from Amazon US again.
It results in slower generated code and much larger binaries, neither of which would be acceptable to Google (some of their binaries are already on the brink of being unbuildable, so a bunch of junk to enable exceptions is not possible.)
Strangely, the announcement that AWS is making their own machine learning inference chip got flagged and removed.

https://aws.amazon.com/machine-learning/inferentia/
It is not uncommon knowledge that California has Proposition 65, and that many products bear this warning even if sold outside of California because they are are also sold unaltered in the state and must follow the appropriate labeling rules. So many people are already aware of this “meme”.
Ricky Jay & His 52 Assistants is truly amazing.

https://www.youtube.com/watch?v=FtgUSUHnzLI
Very true, same manufacturer could also have a bad batch for these reasons even.
It's really not that implausible a thing to do, you know. People have been editing human embryos with CRISPR since at least 2014. And He has past experience, it seems, and had networked a fair amount and seemed to know what he was doing. George Church also has said that he's seen some of the data and it looks right to him. Combine that with all the data on the slides, and while you can debate the ethics or how useful it would be or how well it actually worked, it seems increasingly plausible that he did something like what he claimed, and he's not simply faking it all.
Pentest Tool LITE
I didn't believe you, but then I looked online and I saw that you were right!
Here's a perfectly reasonable house in Detroit for about 4000 USD

https://www.redfin.com/MI/Detroit/15285-Manning-St-48205/hom...
In a western Chicago suburb, I was going to four or five meetups a month back when I was single and had a bit more time. I still go to one pretty religiously. Most meetups I've gone to were popular enough to have venue issues. (Two of them were hosted at a restaurant that regularly had challenges seating us in adequate space.)
A few years back, here in Vienna bars didn't turn on TVs for a whole year (there was a notice on the TVs about how they can't turn them on for some reason, and to complain to $WHOEVER, not sure of the details). It was magnificent.

Even better, one pub didn't have music at all. It was the best pub in town, and that's not just my opinion because it was one of the busiest pubs.

I wish it were like that again.
There was even such a thing as "MkLinux", once upon a time! It was the first Linux variant I ever used.
CA quakes range under M7. while japan over M8 is relatively common.

also japan have snow and hot+humid summers. CA is mostly dry warm weather year around. timber will decay much, much faster in the former. if japan had low quality housing materials like used in CA, the houses would need to be redone every 10 years or less.
These are great. Not sure if I am more impressed by some of the artwork or that it users actually let the artists create it without ruining it. All around a pretty neat project.
> Template libraries that have to deal with stuff that could throw vs couldn't end up with lots of nearr duplicate code, twice as much needed test coverage, and/or less efficiency if you just cover the could-throw case. And you will still probably get it wrong.

Highly-generic container libraries constitute a tiny minority of all code, and even in this kind of code (of which I've written plenty), the tiny local optimizations that we can do if we, say, know we have a nothrow move constructor do not constitute anything near a 2x code size penalty.

You should be grateful that C++ lets you specialize code for can-fail and cannot-fail cases. Try doing that in a sloppy-exceptions language like Java.

> Exceptions can work ok in a GCed language, but I haven't seen them work well otherwise.

I have hundreds of thousands of lines of my own C++ code that say otherwise. BTW: ever hear of this weird startup called "Facebook"? All of their C++ code uses exceptions. Nevertheless, contra certain prominent C++ influencers, rivers have not flowed with blood, locusts have failed to eat the crops, and the firstborn of the nation are safe in their beds.
Ask HN: What questions would you ask to ensure company's future?
If you were interviewed by a startup that is only about 3 to 5 years old, what questions would you ask the ensure that their financially sound and the company operation is sustainable?
Interesting that they're being singled out but not unexpected. Does AirBnB operate in China, Saudi Arabia, or Turkey or do they just consider their atrocities less severe?
Billy, a man pardoned for treason on the grounds he was a slave
PostgreSQL vs. MySQL, the relational battle
I preferred chess.com's Twitch stream[0]. They do the same but have various GMs and other's come on to discuss.

0: https://www.twitch.tv/chess
This is very competitive space.
Hiking the price will make competitors happy and customers not.
Space travel will disappoint you
>People also need better tools for analyzing and making sense of large quantities of information, especially as it evolves over time. Right now, all we have are search engines and excel spreadsheets, and it's clearly not enough.

Interfaces don't seem to get designed, they just accumulate concretions.
Usually the land they are on is appreciating. The houses themselves depreciate.

Sometimes the distinction doesn't matter - but here one of the things we are talking about people knocking down serviceable houses to build new ones. This approach can sometimes even be compelling if land prices rise to a degree completely out of character with the homes originally built on them. See, for example, SF bay and Vancouver.
”It's currently +3-18=14. That's 3 wins for Caruana's position, 18 wins for Carlsen's, and 14 draws. That's about as decisive a position as you can get in high-level chess.”

Today’s games stand at +3-0=0 or, taking the last game as the draw it would have been if Caruana didn’t have to win, at +2-0=1.

I haven’t done the math, but I’m sure taking a “best of four” sample from the distribution that was taken from gives you better odds than taking a n=1 sample from the distribution that gave you +3-18=14 (about 9% chance of losing, about 50% of winning’, followed by (if that draw is a tied game) that n=4 sample.

And that’s ignoring the fact that that +3-18=14 is from machines that are way different from humans. When given a chess position that’s like a minefield, with a single winning sequence of 40 moves, and all other moves a loss, a computer will happily declare the position a certain win, but chances are no human will find that winning sequence.
In belgium the government sets the maximum price of drugs. The drug company has to submit a dossier explaining objectively why a particular price that they propose is reasonable.
Absolutely. The most fun was a program that embedded Gecko to render web pages. There was nothing particularly wrong with the code, but it was quite complex. I handled this simply by being the specialist who did understand the code. Of course, the problem was fractal: the build system used Automake and Autoconf, and nobody understood it either. That was fun.
Or, a government could just say:

If you want to operate as a pharmaceutical producer / seller in this country, you have to supply this list of emergency medicines at 10% above the price we can import from China / India.”

And be done with it.

Edit: fixed a typo
There's been a definite surge the past 4 years [1] however I think at least part of that is due to growth of extremely capable MySQL forks (MariaDB and Percona) [2].

[1] https://www.hntrends.com/2018/oct-react-holds-off-python.htm...

[2] https://trends.google.com/trends/explore?date=2012-01-01%202...
sounds like a dream. what am I doing in this small room in London? I'd like to do it...