HNHacker News
TopNewBestAskShowJobs

mleonhard

4,067 karma · joined February 26, 2008

Michael Leonhard. San Francisco. Software engineer and entrepreneur. Interested in many things.

michael206@gmail.com

http://www.tamale.net/

submissionscomments
mleonhard··on Using lots of little tools to aggressively reject the bots
The website blocks the privacy proxy (VPN) service I use.
mleonhard··on A new class of materials that can passively harvest water from air
Looking at the paper, it seems like they put some silicon-dioxide nanoparticles on a substrate, then add a plastic (poly-ethylene) layer on top and melt it (annealing). The spaces between the nanoparticles gets partially filled with plastic. The ratio of plastic to particles is the poly-ethylene volume fraction (ϕPE). They tested different fractions and found that a certain range caused the wetting behavior.

Their experiments suggest that tiny water droplets appear inside the material at 70% RH (relative humidity). If this is true, then I expect there is a way to extract the droplets using very little energy. Ideas:

- make open collection points on the film

- use ultrasound to bounce the droplets around and consolidate them

- make the film on a material that can be saturated with water so the new droplets can easily join the flow

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

mleonhard··on Alberta separatism push roils Canada
Qatar donated to universities with branches in Qatar. That is a government funding its local universities. This is a normal thing to do.
mleonhard··on Writing into Uninitialized Buffers in Rust
> without doing anything hugely inefficient, such as initializing the full buffer

Is this so inefficient? If your code is very sensitive to IO throughput, then it seems preferable to re-use buffers and pay the initialization once at startup.

Some years ago, I needed a buffer like this and one didn't exist, so I wrote one: https://crates.io/crates/fixed-buffer . I like that it's a plain struct with no type parameters.

mleonhard··on European Investment Bank to inject €70B in European tech
EIB has EUR 500B of capital, invests about 80B/year, and makes about 2B/year profit [0]. European states buy EIB bonds which pay interest [1].

This new 70B will come from bonds sold to EU member states. The states need to approve purchasing the bonds.

EIB earns about 3% profit. Private banks earn about twice that [2]. EIB is a non-profit organization.

EIB makes about 10% of its loans outside of the EU.

[0] https://www.eib.org/attachments/lucalli/20240237_070525_fina...

[1] https://en.wikipedia.org/wiki/European_Investment_Bank#Fundi...

[2] https://www.bankingsupervision.europa.eu/press/speeches/date...

mleonhard··on What do wealthy people buy, that ordinary people know nothing about? (2015)
The microwave in my apartment also has bad firmware. It beeps four times when the timer runs down and it turns off. Unfortunately, the beeping continues unnecessarily after opening the door. I believe Frigidaire (the brand) contracted a manufacturer to build the model, but they have their own people install the official firmware. Then the manufacturer produces extras, installs their own firmware, and sells them, cutting out the brand. And that's how I end up with a "Frigidaire" microwave that beeps when it shouldn't and says "GOOD" instead of "DONE". At least that's my theory.

Firmware is an important part of the appliance. An appliance with Frigidaire hardware and third-party firmware is counterfeit.

Maybe the same thing happened with your Miele appliances?

mleonhard··on Rust’s dependencies are starting to worry me
1. Async Rust is extra stuff for engineers to learn and maintain in their heads.

2. Async Rust has a lot of papercuts.

3. Very little code actually needs async. For example, in an API server, every request handler will need a database connection so the concurrency is limited by the database.

I wrote the Servlin HTTP server in async rust, to handle slow clients, but it calls threaded request handlers.

mleonhard··on Rust’s dependencies are starting to worry me
I love this idea and I hope I get to work on it someday. I've wanted this ever since I was a starry-eyed teenager on IRC listening to Darius Bacon explain his capability-based OS idea, aptly called "Vapor".

I think it could be possible in Rust with a linter, something like https://github.com/geiger-rs/cargo-geiger . The Rust compiler has some unsoundness issues such as https://github.com/rust-lang/rust/issues/84366 . Those would need fixing or linter coverage.

mleonhard··on Rust’s dependencies are starting to worry me
> I can't rewrite the world, an async runtime and web server are just too difficult and take to long for me to justify writing for a project like this (although I should eventually just for a better understanding).

I did this and it only solved half of the bloat:

https://crates.io/crates/safina - Safe async runtime, 6k lines

https://crates.io/crates/servlin - Modular HTTP server library, threaded handlers and async performance, 8k lines.

I use safina+servlin and 1,000 lines of Rust to run https://www.applin.dev, on a cheap VM. It serves some static files, a simple form, receives Stripe webooks, and talks to Postgres and Postmark. It depends on some heavy crate trees: async-fs, async-net, chrono, diesel, rand (libc), serde_json, ureq, and url.

2,088,283 lines of Rust are downloaded by `cargo vendor` run in the project dir.

986,513 lines using https://github.com/coreos/cargo-vendor-filterer to try to download only Linux deps with `cargo vendor-filterer --platform=x86_64-unknown-linux-gnu`. This still downloads the `winapi` crate and other Windows crates, but they contain only 22k lines.

976,338 lines omitting development dependencies with `cargo vendor-filterer --platform=x86_64-unknown-linux-gnu --keep-dep-kinds=normal`.

754,368 lines excluding tests with `cargo vendor-filterer --platform=aarch64-apple-darwin --exclude-crate-path='*#tests' deps.filtered`.

750k lines is a lot to support a 1k-line project. I guess I could remove the heavy deps with another 200 hours of work, and might end up with some lean crates. I've been waiting for someone to write a good threaded Rust Postgres client.

mleonhard··on Vagus nerve stimulation therapy for treatment-resistant PTSD
In my experience, vipassana meditation also stimulates the vagus nerve and includes a kind of exposure therapy when practiced properly. It seems much safer than surgery. Also, the meditation skill can be useful later in life, helping one to be more resilient against adversity.
mleonhard··on NotebookLM Audio Overviews are now available in over 50 languages
The ability to recognize sociopaths and manipulation is an important life skill which may not be obtainable at your church activities or with trusted families. People without these skills may be manipulated in the workplace and suffer avoidable career setbacks, stress, and attending health problems.
mleonhard··on NotebookLM Audio Overviews are now available in over 50 languages
> for my homeschooled kids

Learning requires making mistakes. Kids need to learn social skills in low-stakes environments. School is the best environment for this. When a person misses this part of their childhood education, they may struggle to learn these skills later in life.

mleonhard··on Computer Architects Can't Find the Average
The linked paper has some tables that explain why this matters: How not to Lie with Statistics: The Correct Way to Summarize Benchmark Results https://dl.acm.org/doi/pdf/10.1145/5666.5673
mleonhard··on Apple and Meta fined millions for breaching EU law
From the article:

> The EU regulator also dropped Meta's Marketplace's designation as a DMA gatekeeper because the number of users fell below the required threshold.

The EU government explains this in their press release: https://ec.europa.eu/commission/presscorner/detail/en/ip_25_...

> Today, the Commission also found that Meta's online intermediation service Facebook Marketplace should no longer be designated under the DMA. The decision follows a request submitted by Meta on 5 March 2024 to reconsider the designation of Marketplace. Following a careful assessment of Meta's arguments and as a result of Meta's additional enforcement and continued monitoring measures to counteract the business-to-consumer use of Marketplace, the Commission found that Marketplace had less than 10,000 business users in 2024. Meta therefore no longer meets the relevant threshold giving rise to a presumption that Marketplace is an important gateway for business users to reach end users.

mleonhard··on A Postmortem of a Startup
> We want to stress from the start that the ultimate failure of the company lies with us.

This statement discounts how much random chance contributes to success & failure. Could the world's best founding team find and build a successful business in that field? Maybe. And even if they could, is it failure to be less good than the best? Not at all.

> Stay lean until you have proven revenue.

They raised a pre-seed round and used it to search for business opportunities. This seems like the normal way of doing a startup.

> TIME AND MONEY SPENT ON NON-ESSENTIALS - These included an office, website and branding, a trip to America, contractors, and unnecessary employees.

Having an office can boost energy and productivity. Taking a trip to US to connect with new advisors, investors, and other founders seems like a pretty normal thing to do.

I think these founders are being too hard on themselves. They got an amazing education in entrepreneurship. They don't need to feel bad about it.

mleonhard··on Scientists: Protein IL-17 fights infection, acts on the brain, inducing anxiety
Related paper on the immune system triggering anxiety: "Stress-Induced Metabolic Disorder in Peripheral CD4+ T Cells Leads to Anxiety-like Behavior" https://doi.org/10.1016/j.cell.2019.10.001

Related: "N-acetylcysteine as a new prominent approach for treating psychiatric disorders" https://doi.org/10.1111/bph.15456 section "2.3 Regulation of inflammatory mediators".

N-acetylcysteine (NAC) is considered safe and is sold as a diet supplement in USA and many other countries. If you suffer from anxious feelings, 1200mg/day NAC may reduce them a lot.

mleonhard··on Dollar Dominance in Peril: China's Digital RMB Settlements Now for 200 Countries
A related article: https://www.economist.com/special-report/2023/05/15/could-di...

https://archive.md/IAyHH

mleonhard··on Ferron – A fast, memory-safe web server written in Rust
I'm also interested in looking at the benchmark code.
mleonhard··on Swiftly 1.0
Will this make it possible to run unit tests of code that needs to import UIKit, outside of Simulator?
mleonhard··on You might not need Redis
Yes, please write it. I will buy and read it.
mleonhard··on The power of interning: making a time series database smaller
Would it be simpler to use BTreeSet<Arc<Box<str>>>?

    use std::collections::BTreeSet;
    use std::sync::Arc;
    let mut set: BTreeSet<Arc<Box<str>>> = Default::default();
    let s = Arc::new("abc".to_string().into_boxed_str());
    if !set.contains(&s) {
        set.insert(s.clone());
    }
    let s = set.get(&s).unwrap();
mleonhard··on Upside Down Air Force
We are all so lucky that the EMP-hardening has not been needed.
mleonhard··on Show HN: Torii – a framework agnostic authentication library for Rust

    let plugin = state
        .plugin_manager
        .get_plugin::<OAuthPlugin<SqliteStorage, SqliteStorage>>("github")
        .unwrap();
What are the reasons for using a string to identify the plugin?

This pattern has some downsides: reduced code clarity (navigating to the plugin is hard), and it changes a class of errors from compile-time to run-time.

mleonhard··on Hedge Fund Created an Excel on Steroids
https://github.com/man-group/ArcticDB
mleonhard··on How do interruptions impact different software engineering activities
The study had only 20 people.
mleonhard··on Web page annoyances that I don't inflict on you
A couple more:

- She doesn't change the color of the scroll handle to make it invisible.

- She doesn't override my browser's font size, making the text too small to read.

- She doesn't configure the page to <expletives deleted> disallow pinch-zooming on mobile.

mleonhard··on Ask HN: Who is hiring? (January 2025)
How about adding salary information to the job posting? It seems to be required by New York state law [1].

[1] https://dol.ny.gov/pay-transparency-act-frequently-asked-que...

mleonhard··on Ask HN: How to learn marketing and sales as a solo entrepreneur?
The Founding Sales book is a good resource. It's written by a startup founder who built startup sales teams from zero to hundreds of ppl. It explains how sales is different at each stage of a company. It teaches what is important at each stage.

https://www.foundingsales.com

mleonhard··on AMD Disables Zen 4's Loop Buffer
It looks like they disabled a feature flag. I didn't expect to see such things in CPUs.
mleonhard··on Sol-Ark manufacturer reportedly disables all Deye inverters in the US
There is no such thing as "grey market". USA is a free market. Everyone is authorized to sell all safe items.
← PreviousPage 2 of 34Next →