HN user

mabbo

38,806 karma

Principal Developer at Aurora Solar

Formerly at Shopify and Amazon because I'm just a sucker for e-commerce.

mabbo.ca

[ my public key: https://keybase.io/morleyabbott; my proof: https://keybase.io/morleyabbott/sigs/_zqZaHJOt5-M36kkGhkW8q6Ofg81ISuaGZRKwGnBuns ]

Posts13
Comments3,542
View on HN

Many years ago, as an undergrad, I had a conversation with a grad student friend about the Selection algorithm (which will find the kth largest item in an unsorted list in O(n) time). I loved it, but when I tested it in practice it was slower than just sorting and selecting well into the billions of elements.

My friend said "that may be true, but consider the philosophical implication: because that algorithm exists, we know it's possible to answer the question in O(n) time. We once didn't know that, and there was no guarantee that it was possible. We might still be able to find a better O(n) algorithm."

I feel the same way about this. Sure, this might not be faster than Dijkstra's in practice, but now we know it's possible to do that at all.

Not all time spent interacting with a screen is "screen time".

The problematic thing is kids spending endless hours just absorbing rather than playing or interacting or doing stuff. It culminates in kids (and adults) who cannot mentally handle being bored- they must have the screen to relieve the horrors of the idle mind.

If achieving these same goals is easier without an app for you and your kids, then by all means, do that. But an app on a screen is a very powerful tool to structure and organize things. My daughter is still a bit young for this one, but I can see how useful it will be when she's a couple years older.

I got a sleep study at the age of 24 because my then-girlfriend (now wife) said "I got used to the snoring, but that thing where you stop breathing really freaks me out". The what now? In hindsight, I'd had signs of sleep apnea since I was in my teens despite being a healthy weight.

I was diagnosed with 'mild to moderate' sleep apnea and told to not drink, and to exercise more. No CPAP needed. And they were right- if I do those things, I don't have many problems. But then again, I can't always do those things.

What really helped though, and I'm loathe to even say it, was taking high absorption magnesium. I hate it because there are very limited studies that say it should work, and it's mostly promoted by absolute quacks. And yet, when I take it, I sleep really well without snoring or having apnea issues and if I stop, I sleep terribly.

I learned about the median-of-medians quickselect algorithm when I was an undergrad and was really impressed by it. I implemented it, and it was terribly slow. It's runtime grew linearly, but that only really mattered if you had at least a few billion items in your list.

I was chatting about this with a grad student friend who casually said something like "Sure, it's slow, but what really matters is that it proves that it's possible to do selection of an unsorted list in O(n) time. At one point, we didn't know whether that was even possible. Now that we do, we know there might an even faster linear algorithm." Really got into the philosophy of what Computer Science is about in the first place.

The lesson was so simple yet so profound that I nearly applied to grad school because of it. I have no idea if they even recall the conversation, but it was a pivotal moment of my education.

What I find interesting when comparing the US the Canada on topics like these is that in Canada, there is self-interest in demanding workers be protected. Like beyond the fact that it's a good thing you do.

Because we have a public health care system, funded by taxes, having a large number of young men out of the work force (not paying taxes) and using the health care system effectively means my taxes, everyone's taxes, are higher.

There's incentives for our government to protect workers from risks that will cost a fortune to fix.

In America, there's only the "because it's the right thing to do" reason, which is never enough for anyone to actually do anything.

When my wife was super pregnant and overdue, friends were consistently asking for updates. I made a website called "is<wife's name>stillpregnant.com" and put a very very minimal website there. It was literally just route53 and cloudfront in front of an S3 bucket.

But that meant I needed to make updates from the hospital with my phone. I mean yes there were probably better options but I was a bit busy at the time to think of them.

Let me just say that writing raw HTML files using textedit for Android was not a great experience. It's just not the right interface for making complex text.

Maybe LLMs will help with this, allowing us to describe what we want at a higher level, through voice or text. But God help me I do not want to try to write valid HTML on a phone (after being awake for 35 of the previous 36 hours).

At $110/h, 70 h/week, that's $7,700/week, so $23k for 3 weeks of hell.

That's about 1/3 of the median US household income in 3 weeks.

If I didn't have a family, had the skills, and lived in the area this would be an interesting way to put away some cash.

Make feature flags short-lived. Do not confuse flags with application configuration.

This is my current battle.

I introduced feature flags to the team as a means to separate deployment from launch of new features. For the sake of getting it working and used, I made the mis-step of backing the flags with config files with the intent to get Launch Darkly or Unleash working ASAP instead to replace them.

Then another dev decided that these Feature Flags look like a great way to implement permanent application configs for different subsets of entities in our system. In fact, he evangelized it in his design for a major new project (I was not invited to the review).

Now I have to stand back and watch as the feature flags are being used for long-term configurations. I objected when I saw the misuse- in a code review I said "hey that's not what these are for"- and was overruled by management. This is the design, there's no time to update it, I'm sure we can fix it later, someday.

Lesson learned: make it very hard to misuse meta-features like feature flags, or someone will use them to get their stuff done faster.

Many years ago when I was a junior dev at Amazon, there was a massive project internally to split up every internal system into regional versions with limited gateways allowing calls between regions. The reason? We had run out of internal IPv4 addresses.

The Principal PM in charge of the "regionalization" effort was asked in a Q&A "why didn't we just switch to IPv6?".

Her answer was something along the lines of "The number of internal networking devices we currently have that cannot support IPv6 is so large that to replace them we would have needed to buy nearly the entire world's yearly output of those devices, and then install them all."[0]

It's easy to presume malicious intent on the IPv4 front from Amazon, but with so many AWS systems being on the scale they are at, I find it easy to believe that replacing all of the old network hardware may just be a project too large to do on a short timescale.

[0] - At least, that's my memory of it. I'm sure that's not an entirely accurate quotation.

The moment that generative AI became something crazy for me was when I said "holy shit, maybe Blake Lemoine was right".

Lemoine was the Google engineer who made a big fuss saying that Google had a sentient AI in development and he felt there were ethical issues to consider. And at the time we all sort of chuckled- of course Google doesn't have a true AGI in there. No one can do that.

And it wasn't much later I had my first conversation with ChatGPT and thought "Oh... oh okay, I see what he meant". It's telling that all of these LLM chat systems are trained to quite strongly insist they aren't sentient.

Maybe we don't yet know quite what to do with this thing we've built, but I feel quite strongly that what we've created with Generative AI is a mirror of ourselves, collectively. A tincture of our intelligence as a species. And every day we seem to get better distilling it into a purer form.

Ontario built highway 407 in the early 2000s (late 90s?) with tolls that use license plate readers - no slowing down or stopping at all. Still a bit controversial, that, and especially controversial when the Conservative government sold it off to a private entity just to balance the budget for one year.

But in all that time, I literally do not know anyone who has gotten a bill from them for a bad plate read. We have blizzards here, torrential downpour rain, all kinds of weather that might make it hard. Still, nothing.

I wonder if the regulations on bad reads were simply made serious enough that the company handling it takes a very conservative approach to potential mistakes.

I think the above means (if I do get the point) that databases scale in terms of both requests per second and number of active connections.

Having 1000 connections doing 1 request per second isn't the same as having 1 connection doing 1000 requests per second.

But, and I could be wrong, the larger factor is the number of requests per second.

This is secretly about Types and misuse of values.

"NV" is a valid value for a plate. The officers were using that value to indicate an error, thus the chaos of error handling for a non-error.

When programming error cases, you should return something that cannot be a valid value. Excellent patterns exist in some languages where a sum type of either a return value or an error can be returned. Optional/Maybe monads to indicate something or nothing. Even, god forgive me for saying this, throwing an Exception is a good way to say "No, not a valid return value".

The traffic wardens paperwork/app needs an explicit field for "Not visible"- ideally one easier to use than writing "NV", rather than a free-form text field that lets them write a value that only they know means something other than a real value.

That's not on a per-host basis. Shopify's design is, quite fortunately, one that partitions really well, as each store is completely independent of each other.

Each store can be assigned to one pod, each pod can have as many hosts as it takes to optimize the use of a database instance, and then you can add more pods as the need arises.

Edit: to be clear, that's not to say Rails can't scale. It can. It's just that it doesn't need to- you can scale anything with enough partitioning.

Really, Khadr?

The guy was brainwashed as a child by his lunatic father and dragged to Afghanistan to resist American's invasion. There was some kind of firefight, he nearly died, and the Americans decided that since he survived he was guilty of all the crimes.

He was 15. A kid. A child soldier, by international law.

He was held for a decade in Guantanamo Bay, a US military facility, without any real trial.

The US already had him. They abused his rights and ignored international law. Why should Canada give him back to them?

To those saying "But Bill C-18" - it's not the Canadian government taking things down. It's the Indian government, taking down articles and posts that accuse them of assassinating a Canadian citizen on Canadian soil.

C-18 is a problem. We need to deal with it. That's not relevant to the issue at hand.

And to those saying "Well he was a terrorist..." we, in Canada, have something called the Rule of Law. You have to prove someone is guilty, in court, with real evidence. They serve time in prison for their crimes. They can be extradited to other countries to face court there.

If Bhai Hardeep Singh Nijjar was a terrorist, and there was sufficient evidence to convict him, the Indian government should have brought it to the Canadian Government. It's very simple really.

Murdering someone without trial because you don't like their political speech- why, I think there's a word for that.

A famous English name in expat in China circles is Rainy.

Funny that. A friend of mine since high school - who is white and has never been to Asia - has the first name Rainey. Not a nickname.

I've never met anyone else with the name!

Since you know more about this subject, I have a question on this topic that I've wondered for over two decades.

In 2001, I did a month long exchange program to Thailand. A group of eight Canadians stayed with eight Thais, and the year before they stayed with us. Incredible program.

All the Thais, as you mention, had nicknames. But many of the nicknames were English words that weren't really used as names in the West. I lived with a guy named 'Knight'. Another guy was 'Farm'.

Were these names Anglicized versions of Thai nicknames? Or were the actual nicknames just sometimes pulled at random from an English dictionary?

And this is why we need to really rethink the typical patterns on form inputs, which today usually presume a western style name pattern.

Just ask people for their full name, and what they would prefer to be called. (Unless you literally cannot provide your services' value without more detail).