HNHacker News
TopNewBestAskShowJobs

timmaxw

555 karma · joined July 25, 2011

submissionscomments
timmaxw··on Design for 3D-Printing
> Cut threads into printed parts with a thread tap for quick design of low-reuse joints.

I've found wood screws work well for this. The wood screw can cut its own threads without needing to use a tap.

It does put some stress on the part, though. I mostly print in PETG, which is strong enough; but PLA might split if the hole was parallel to the layers.

> A design limitation of threaded inserts is that they are not reliably usable for screws inserted from the back side. During insertion, heat-set inserts often push some molten plastic into the hole beneath them, preventing easy insertion of a screw from the back side.

A trick I sometimes use:

1. Before installing the insert, insert the screw from the back side

2. Screw the insert onto the protruding screw

3. Use a soldering iron to install the insert+screw together into the plastic

Because the screw is filling the hole, the molten plastic can't block the hole. Instead, the molten plastic forms itself around the screw, and it acts like a Nyloc nut.

timmaxw··on Coder wrote a bug so bad security guards wanted a word when he arrived at work
> refusing charge backs is too easy

That doesn't sound right...? Credit/debit card chargebacks are handled by the bank. If the merchant doesn't pick up the phone, the bank will take the money from the merchant and return it to the customer.

https://www.usatoday.com/money/blueprint/credit-cards/credit...

Were you using a different payment system with fewer consumer protections than credit/debit cards?

timmaxw··on Bankruptcy judge rejects sale of Infowars to The Onion
> If someone owes you $1B and they owe me $2B, and they've got an asset worth $500M, I can't just pledge $2B of bad debt to buy the asset. The only fair way is to sell it for $500M in actual cash

No, that's not the _only_ fair way. Suppose the $2B creditor bids $200M in cash and also agrees to forfeit their share of the proceeds from the sale. Then the $1B creditor would receive the entire $200M, which is more than the $167M they would have received from a $500M cash sale. The bid is effectively equivalent to $600M.

Isn't that what happened in the InfoWars case? The bankruptcy judge agreed that the structure of the Onion's bid was valid; he just said the auction would have continued for more rounds.

timmaxw··on Negative Temperature
Here's an intuition that might help: Suppose we define β=1/T, the reciprocal of temperature. (See https://en.wikipedia.org/wiki/Thermodynamic_beta.) As a system gets hotter and hotter, T gets bigger and bigger, so β falls closer and closer to zero. If β falls past zero and becomes negative, then T will also be negative.

(Also: If T=0, then β would be undefined/infinity. This corresponds to the fact that absolute zero temperature is impossible. β is arguably a more natural way of thinking about temperature than T is.)

timmaxw··on Medieval Bologna was full of tall towers
Really? I zoomed in on the Towers of Bologna and then used the "measurement" tool to draw a 97m line on the ground. The line seems about as long as the tower is high. If you try that, do you get the same result?
timmaxw··on Medieval Bologna was full of tall towers
Note, those pictures depict the towers as about 5x bigger than they actually were.

To get a true sense of scale, here's the same view on Google Earth: https://earth.google.com/web/@44.48152905,11.33820409,94.604... You can see the towers that are still standing. They visibly stick out from the shorter buildings, but they're nowhere near as big as in the picture.

timmaxw··on Ask HN: C/C++ developer wanting to learn efficient Python
Yes, Python dicts remember insertion order. This is different from C++ std::map, which maintains the keys in sorted order. For example, std::map::lower_bound(X) finds "the smallest key in the map which is greater than or equal to X" in O(log(N)) time. I don't think Python has any data structure in the standard library that supports this operation while also supporting insertion in O(log(N)) time.
timmaxw··on Ask HN: C/C++ developer wanting to learn efficient Python
In Python job interviews, I think the interviewer will only judge your code on asymptotic complexity, not absolute speed. I think Python engineers generally aren't expected to know how to micro-optimize their Python code.

Some general tips for algorithmic complexity in Python:

- Python's list is equivalent to C++ std::vector. If you need to push/pop at the head of the list, use Python's "collections.deque" to avoid the O(N) cost. Python's standard library doesn't have a linked list implementation.

- Python's dict is a fast unordered hashmap. However, if you need order-aware operations like C++'s std::map::lower_bound(), you're out of luck; Python's standard library doesn't have a tree implementation.

- Python has a "bisect" module for binary searching in a Python list, and a "heapq" module for using a Python list as a heap. However, neither one is nicely encapsulated in a data type.

If your Python program is seriously CPU-bound, the normal solution is to use a C/C++/Rust extension. For example, if you're doing large numeric calculations, use NumPy; it can store a vector of numbers as a single contiguous array, which is much faster than a list-of-Python-floats.

If you want to parallelize across CPU cores, it's important to understand the Python GIL (global interpreter lock). Often you need to use multiple Python processes. See e.g. https://superfastpython.com/multiprocessing-pool-gil/

Maybe also worth reading about __slots__ (https://wiki.python.org/moin/UsingSlots); it's a micro-optimization that helps when allocating a lot of tiny Python objects.

Hope some of that is helpful! Good luck with your job interviews.

timmaxw··on Python datetime pitfalls, and what libraries are (not) doing about it
Well done. It's horrifying that the Python standard library "+/-" operators don't handle DST correctly.
timmaxw··on A journalist goes undercover to reveal the absurdity of the art scene
> Non wealthy people are largely not willing to pay ... what it actually costs to make them

The general public pays enough money to pay the artists' salaries, plus the marketing budget and all the other costs. Otherwise Hollywood would go out of business.

timmaxw··on A journalist goes undercover to reveal the absurdity of the art scene
The reason people complain about "high art" is because we're told that everyone should aspire to appreciate high art, and that people who appreciate high art are somehow better than the general public, even though it's deliberately niche and opaque.

> There's an endless continuum libraries, languages, tools and machines out there which have trivial impact on the world but are absolute objects of beauty when you know what's inside.

Imagine if the SF MOMA were replaced with a museum full of those niche libraries and languages, showing these absolute objects of beauty to the general public, and (implicitly) saying "you ought to appreciate the beauty; if you can't appreciate e.g. the beauty of the Haskell programming language is, you're ignorant".

timmaxw··on A journalist goes undercover to reveal the absurdity of the art scene
The non-wealthy regularly pay for books, music, movies, video games, etc. Hollywood is a $40B/year industry. All these industries follow a model of "make a work of art, then sell infinite copies"; this makes it possible to sell the copies at reasonable prices. These prices are appropriate, and the non-wealthy pay them.

The "high art" world, on the other hand, fetishizes the original physical work of art. If an expert painter spends weeks on a painting, then they must sell it for enough money to cover "weeks of an expert's income"; so of course only wealthy people will be able to afford it. How is this price more "appropriate" than the prices that non-wealthy people pay?

timmaxw··on 'Energy independent' Uruguay runs on 100% renewables for four straight months
If Uruguay can run on 100% renewable energy, the unstated implication is "The US could do it too, we just lack the political will". (As opposed to the idea that "Renewable energy is a genuinely hard problem that will take time, effort, and technological advances to solve.") The implication that "we just lack the political will" can feel like a criticism of anyone who's not maximally-environmentalist. I think that's why people are getting defensive about it.
timmaxw··on The beautiful mind of Sam Bankman-Fried
Yeah. I agree with most of what David Gerard writes, but this attack on Scott Alexander was weak. The "54 billion lives" thing was obviously a joke.
timmaxw··on How many billions of transistors in an iPhone processor?
What are all those transistors doing?

I've heard the cache is the biggest part. Per https://en.wikipedia.org/wiki/Apple_A17, the A17 has 72MB of cache. Cache is typically SRAM. Per https://en.wikipedia.org/wiki/Static_random-access_memory, a single bit of SRAM typically uses 6 transistors, but it could be anywhere from 4 to 10. So that's between 2.3B and 5.7B transistors for the cache.

That leaves about 1B transistors for each of the 12 cores (6 CPU + 6 GPU). The instruction set is a few hundred instructions. Surely it doesn't take millions of transistors to implement each instruction. Other than the cache, which parts of the processor need millions of transistors?

timmaxw··on Beginners guide to building a hardware hacking lab
As a beginner, I've been a big fan of the Digilent Analog Discovery. This guide lists it under "logic analyzers", but it's also a passable oscilloscope if you don't need more than 30MHz bandwidth. Because the target market is undergraduates learning electrical engineering, it's designed to be inexpensive, doesn't take up much space, is easy to get started with, etc.
timmaxw··on I Will Fucking Haymaker You If You Mention Agile Again
haymaker (noun) a powerful blow with the fist.

etymology: "the punch probably so called for resemblance to the wide swinging stroke of a scythe"

timmaxw··on The FTC sues to break up Amazon over an economy-wide “hidden tax”
The latter seems plausible to me, but the former makes no sense. If the problem is that Amazon-retail has too much market power, how would splitting off AWS help with that problem? Amazon-retail would still have the same fraction of the retail market as before.
timmaxw··on The FTC sues to break up Amazon over an economy-wide “hidden tax”
This writeup has a lot more details: https://www.wired.com/story/amazon-antitrust-lawsuit-cuts-to...

DC AG Karl Racine filed a lawsuit over this in May 2021. The judge threw it out, supposedly for lack of evidence that it actually raised prices: https://www.jurist.org/news/2022/03/dc-trial-court-dismisses... I can't find details; it's unclear what the evidence or lack thereof was.

CA AG Rob Bonta filed another lawsuit over the same issue in Sept 2022. Some juicy quotes here (although only one side of the story): https://oag.ca.gov/news/press-releases/attorney-general-bont... The CA lawsuit is set to go to trial in 2026.

timmaxw··on I applied to 250 jobs and timed how long each one took
> People have families to feed.

People would submit fewer applications, but each individual application would have a higher chance of success, because everyone else would _also_ be submitting fewer applications. The number of job openings is the same either way, so the same number of people get hired in the end, right?

timmaxw··on Amazon used algorithm to test how much it could raise prices: FTC
yonron's comment made a specific claim: "Amazon will raise the price in the long run and capture monopolistic profits."

aga98mtl pointed out this isn't actually true in practice.

It sounds like you're describing a different form of potentially anti-competitive behavior, which is not the same as the one yonron accused Amazon of.

timmaxw··on I applied to 250 jobs and timed how long each one took
I think there's a dynamic where:

- Desirable job applicants get hired quickly, but people who can't get hired stay on the market

- People who can't get hired will keep applying to more and more jobs

- So every new job opening gets flooded with applications from people who couldn't get hired elsewhere

- Employers don't have time to read the flood of applications in detail, so they rely on cheap filters (keywords on resume, where they went to college, did they work at FANG, etc.)

- Which makes the process worse for everyone

What if there was some way to limit job seekers to e.g. 10 job applications per month, industrywide? Feels like that could cut down the noise and allow employers to consider each individual applicant more carefully.

(It would be hard to implement this limit, though. You could do it via data-sharing between Greenhouse, Lever, Workday, etc., but there are huge privacy concerns and it would run into the same sorts of issues as credit reports do.)

timmaxw··on I applied to 250 jobs and timed how long each one took
That still doesn't seem like very much time to me. Job hunting involves hours and hours of interviews; five minutes of paperwork is negligible by comparison, right? Are people mass-spamming applications or something?
timmaxw··on DOJ finally posted that “embarrassing” court doc Google wanted to hide
At tech companies I've worked at, when people use phrases like "the best product" or "product quality", they are in fact using those phrases to mean "the product that does the best job of giving users what they want".
timmaxw··on DOJ finally posted that “embarrassing” court doc Google wanted to hide
To clarify: what specific remedy do you want the court to impose on Google, and how would it make things better for everyone?
timmaxw··on DOJ finally posted that “embarrassing” court doc Google wanted to hide
The full quote from the trial exhibit is:

> When talking about revenue, we could mostly ignore the demand side of the equation (users and queries) and only focus on supply side of advertisers, ad formats, and sales. Sure, we had to build the best product, made smart marketing/distribution investments to get our product everywhere, but we could essentially tear the economics textbook in half.

They explicitly mention "we had to build the best product", so I'm not sure where you're getting the "not any product attributes" bit from. (Your linked article is paywalled.)

timmaxw··on The brain is not an onion with a tiny reptile inside (2020)
In _this_ case, the case of the human brain, I think it's fair to say that evolution started with the reptile brain and added something (even if that "something" is "new function and complexity" rather than "a completely new physical structure").

I agree there are other cases where evolution removes/simplifies things. Evolution is adaptation, and that adaptation can consist of adding, changing, and/or removing.

timmaxw··on The brain is not an onion with a tiny reptile inside (2020)
> evolution of the brain always happens by modifying the existing structure

Hmmm, my impression was that evolution took an existing structure and stuffed a bunch of new functionality into it, making it much larger and more complicated. Although the structure already existed in some form, it didn't have the same function. I think it's reasonable to think of this process as "adding" something, even if the structure itself is not entirely new. And human brains pretty clearly _are_ more intelligent than reptile brains!

Here's an analogy: Ancient organisms had light-sensitive "eyespots", and many of our distant cousins on the evolutionary tree (e.g. present-day flatworms) still have eyespots. Evolution gradually modified these existing structures into eyes. I think it's reasonable to think of eyes as a "new" organ that humans have and flatworms don't; and our eyes are clearly superior to flatworms' eyespots.

timmaxw··on When tech says ‘no’
> And these cases are the utter majority.

I think it's the opposite -- tech and politicians agree on the vast majority of things, but they're considered banal so the topic never comes up. But, you could imagine an alternate universe where tech did things differently, and then politicians wanted to regulate them. Here are some examples:

* Tech companies offer most of their services for free. You could imagine a world where Google charged for searches and Facebook charged for posting, and so "poor people being excluded from the Internet" became a political issue.

* Tech companies translate their services into a variety of languages. You could imagine a world where Google and Facebook were only available in English, and so "non-English-speakers being excluded from the Internet" became a political issue.

* Tech companies don't allow anyone to view DMs, private posts, etc. except law enforcement. You could imagine a world where Google and Facebook had a culture where it was normal for employees to snoop on other peoples' DMs, and it became a political issue.

* Conversely, you could imagine a world where tech companies refused to allow law enforcement access to peoples' DMs even with a valid warrant, and it became a political issue. (This is starting to happen.)

* Tech companies allow anyone to post by default. You could imagine a world where tech companies only allowed people to post if tech companies liked their political views (similar to how newspapers' biases affect which editorials they publish) and it became a political issue. (This is starting to happen: the left is pressuring tech companies to restrict certain right-wing content, and the right is talking about regulation to force tech not to do that.)

* Tech companies sometimes kick people off the platform for arbitrary procedural reasons, but not for personal pettiness reasons (with the notable exception of Elon Musk kicking people off Twitter). You could imagine a world where it was normal for e.g. Google to delete a journalist's GMail account if the journalist published something Google didn't like, and it becoming a political issue.

* Tech companies often contribute to open-source standards and software. For example, Google is heavily involved in defining web standards; and they made Chromium open-source, allowing rivals like Microsoft to build on it. You could imagine a world where the tech ecosystem was much more fragmented and closed-source than it is today, and it becoming a political issue.

This is what I was saying about a selection effect: You can easily think of ways that politicians want to regulate tech more, because those topics are controversial and make the news. But there are actually a ton of ways that tech _could_ be much worse than it is, but those topics never come up, so it takes some imagination to think of them.

timmaxw··on Tidal energy is not renewable
Yes, tides do naturally dissipate energy. The main source of tidal dissipation is friction between the moving seawater and the seabed. [1]

Current tidal generators work either by inserting a turbine into the moving water; or by a dam that captures the high tide, then releases it through a turbine at low tide. Depending on the exact details, it could slow down the rate at which the current later flows over the seabed, which would reduce the energy dissipated from friction with the seabed. But, there's no guarantee that this would compensate for the energy taken by the tidal power generator.

You could imagine a different type of tidal power generator: covering the seabed with a giant treadmill. As water flows past, it drags the surface of the treadmill, generating power. My guess is this would dissipate less total energy than the natural friction of the seabed does. But, it doesn't sound very practical.

(Anyway, all of this is a moot point. As other commenters have noted, if human energy consumption actually were to grow 2% annually for 1000 years, we'd have way bigger problems than the moon becoming tidally locked.)

[1] https://en.wikipedia.org/wiki/Tidal_acceleration#Angular_mom...

Page 1 of 5Next →