Better HN
topnewbestaskshowjobs
Log inSign up

twic

22,720 karma · joined Feb 19, 2013 (13y ago) · 7,302 submissions

https://stackoverflow.com/users/116639/tom-anderson?tab=profile
Submissions

comment 1mo ago · link · parent

    $ echo 'class Hello { public static void main(String[] args) { System.out.println("Hello, world"); } }' >Hello.java
    $ javac Hello.java 
    $ java --version
    openjdk 21.0.7 2025-04-15 LTS
    OpenJDK Runtime Environment Zulu21.42+21-CRaC-CA (build 21.0.7+6-LTS)
    OpenJDK 64-Bit Server VM Zulu21.42+21-CRaC-CA (build 21.0.7+6-LTS, mixed mode, sharing)
    $ time java -cp . Hello
    Hello, world
    
    real 0m0.026s
    user 0m0.010s
    sys  0m0.018s
For some reason this machine is still on 21. Anyway, the overhead of the JVM itself is pretty low.

For small tools it's fine:

    $ echo 'class Dig { public static void main(String[] args) throws Exception { var addr = java.net.InetAddress.getByName(args[0]); System.out.println(addr); } }' >Dig.java
    $ javac Dig.java
    $ time java -cp . Dig news.ycombinator.com
    news.ycombinator.com/209.216.230.207
    
    real 0m0.047s
    user 0m0.026s
    sys  0m0.021s

    $ time host news.ycombinator.com
    news.ycombinator.com has address 209.216.230.207
    news.ycombinator.com has IPv6 address 2606:7100:1:67::26
    
    real 0m0.052s
    user 0m0.005s
    sys  0m0.004s
Java startup gets slow when you use some massive framework like Spring. If you need a program to start fast, don't use one!

comment 1mo ago · link · parent

Have you tried being Queen of England by grace of God?

comment 2mo ago · link · parent

Can I interest you in Jesus also being Emperor Andronikos I? https://en.wikipedia.org/wiki/New_chronology_(Fomenko)

comment 3mo ago · link · parent

Is there a dataset for this? Maybe a Bloomberg ticker?

comment 3mo ago · link · parent

The terminology is all a bit loose. Proteins are peptides, but we don't usually call them that. But when a hormone is a protein, rather than a small molecule, then we call it a "peptide hormone". I suppose because we're making a chemical point, that the hormone is in the family of peptides rather than steroids or eicosanoids or whatever?

As you say, insulin is a fully fledged protein, albeit a small one, and i wouldn't call it a peptide myself. But then, insulin is 51 residues, whereas tirzepatide (Mounjaro) is 39; is that such a big difference? FWIW i think a lot of other "peptides" are even smaller, eg CJC-1295 is about 30 residues.

comment 3mo ago · link · parent

Logs and metrics are both derived from events. A log takes the whole event and records it somewhere. A metric takes some numeric value from the event, aggregates it over time, and records it periodically. You can reconstruct a metric from logs for the underlying events.

A trace is a period of execution between two events. You could record a trace as a pair of log entries, or one log entry at the end. You can then reconstruct a trace from those log entries. If you want to associate multiple spans, and separate log entries, within a trace, you use a shared ID, which is just the same as a context entry for logging.

All three of these pillars are just ways of looking at events. They are not fundamentally different at all. This is a mistaken idea in "Observability 1.0" whose correction is the basis of "Observability 2.0".

The pillars still have their uses, but the choice between them is really a non-functional one - storing a log entry for every event might be too expensive, so just store metrics instead, and index every log entry so it can be correlated with nearby ones might be too expensive, so just store specific traces instead.

comment 3mo ago · link · parent

Pretty sure you've been able to interrupt a thread blocked on IO in a normal InputStream since 1.0.2 in 1996.

There is a significant caveat to this, which is that if the underlying blocking IO operation isn't natively cancellable (and the JDK doesn't use the trick Zig uses here), then the interrupt is allowed to close the IO resource as a way of ending the operation early. In practice this is usually fine, as you're interrupting the thread precisely because you want it to give up on whatever it's doing, but it precludes some particularly subtle possible IO designs.

Not sure if this changes under virtual threads, where the thread is much more loosely coupled to the syscall.

comment 3mo ago · link · parent

> IOException and InterruptedException are both checked and unrelated

https://docs.oracle.com/en/java/javase/25/docs/api/java.base...

comment 3mo ago · link · parent

Grimsey was boss of Iceland, but also, Grimsey is in Iceland:

https://en.wikipedia.org/wiki/Gr%C3%ADmsey

comment 3mo ago · link · parent

Mild counterpoint: a friend of mine, a professional woman, started on GLP-1 drugs some time ago. She has lost weight, but she also says she's had significant cognitive improvements, more focus, better sleep, etc. It would be great to have research which explicitly teases out these various effects.

comment 3mo ago · link · parent

> A well done monorepo is a huge force multiplier on a large organization

How so?

I work at a company which uses a monorepo, and I haven't seen any upside to it yet. We have a tools team that's invested a vast amount of work in it. Still seems strictly worse than a 'normal' polyrepo setup. I haven't understood why so many people are so enthusiastic about it.

comment 3mo ago · link · parent

Frustrating that these aren't labelled! What's this NASA-ish one from? https://64.media.tumblr.com/75c79a0906e422a7072b9148b52d9501...

I didn't spot any of the weirdpunk machinery from Wings of Honneamise:

https://www.inetres.com/gp/anime/woh/woh07.jpg

https://www.instagram.com/reel/DaYuAvpp7S6/

Or Golden Boy's computer made out of paper: https://youtu.be/A1R1Du2PsZ4?t=610

Or its Japanese-phonetically-respelled SunOS rc script: https://youtu.be/A1R1Du2PsZ4?t=1196

Or any of the computer bits in that episoder really. By the way don't watch Golden Boy if there are any people who are not, uh, extremely cultured around.

comment 4mo ago · link · parent

An Italian friend was excited to visit a castle, and on arrival disappointedly exclaimed "but this is a "fortezza!".

comment 4mo ago · link · parent

See? Immortality through memes!

comment 4mo ago · link · parent

It's not just that they aren't free of bias. They appear to incubate truly wacky stuff - Leverage Research [1], the Zizians, all the AI/x-risk stuff. I am not the only person to have noticed this [2]. There's something about their approach that appears to actually make people more susceptible to nonsense, not less.

[1] https://lydialaurenson.substack.com/p/the-inside-story-of-le...

[2] https://asteriskmag.com/issues/11/why-are-there-so-many-rati...

comment 4mo ago · link · parent

> Timecube was an incoherent stream-of-consciousness website filled with bizarre cosmological claims.

Was? Timecube.net will outlive any and all faddy Silicon Valley cults.

comment 4mo ago · link · parent

Reviving? I'm still running a 2007 EeePC 1001HA on Fedora.

comment 4mo ago · link · parent

Terrible, the cytoskeleton is the best bit of the cell!

(not just grumpy because that's what I did my PhD research on)

comment 6mo ago · link · parent

Reminds me more remotely of scoops used in coal mining, in very low-ceilinged seams:

https://www.komatsu.com/en-us/products/equipment/room-and-pi...

comment 6mo ago · link · parent

> The worst part, by far, was the emptying / prepping.

As described in one of the great modern tales of legend:

https://singletrackworld.com/2009/02/the-picolax-thread-retu...

comment 6mo ago · link · parent

Where does that come from though? I don't see any flow control or anything else compute-y in the bytecode itself. I know unpickling can run Python code, but i wouldn't say that makes the bytecode itself Turing-complete.

comment 6mo ago · link · parent

The Python pickle format is a bytecode [1], although not a Turing-complete one, I think.

[1] https://formats.kaitai.io/python_pickle/

comment 6mo ago · link · parent

If a tool had been replaced by a better tool, wouldn't it be natural to discuss that?

comment 6mo ago · link · parent

Perl is what I've spent the last thirty years running away from.

comment 6mo ago · link · parent

Not bad, but the subprocess invocation is too verbose given this is a staple of shell script type work, and the string mangling is a bit painful.

comment 6mo ago · link · parent

Not sure if this is related, but i'd love to see more scripting languages (mostly Python) offer facilities which let them take over from shell script for more scripts and one-liners.

Think about what it would take to write this in Python right now:

  for wmv_file in $(find $1 -name '*.wmv'); do
    echo -n "${wmv_file} "
    ffmpeg -i $wmv_file ${wmv_file%.wmv}.mpg 2>&1 | grep kb/s: || echo "ERROR $?"
  done
With a few handy variables and functions predefined, this could be something like:

  for wmv_file in find(argv[1], glob="\*.wmv"):
    print(wmv_file, end=" ")
    result = do("ffmpeg", "-i", wmv_file, basename(wmv_file, ".wmv") + ".mpg")
    if result: print(grep(str(result), "kb/s:"))
    else: print("ERROR", result.status)

comment 6mo ago · link · parent

Swatch Internet Time! https://en.wikipedia.org/wiki/Swatch_Internet_Time

comment 6mo ago · link · parent

The article mentions:

> the German and Japanese point is 0.250 mm

It's probably the sanest adaptation of the point to the metric system. A traditional point is close to a third of a millimetre, but that's too weird.

Since the Q is close to 3/4 of a traditional point, it's also quite easy to convert from traditional multiple-of-three point sizes: 9 pt -> 12 Q, 12 pt -> 16 Q, etc.

Although it's even easier just to call those 3 mm and 4 mm!

comment 6mo ago · link · parent

This is pretty much what GL.iNet does. A nice slick interface for normal people, full OpenWRT nerd power a couple of clicks away for HN readers.

comment 6mo ago · link · parent

If anyone is curious and near South Kensington, there is now a little exhibition on urushi at the V&A [1], which includes a film of a guy who harvests his own sap, processes it into lacquer, and then makes things with it.

That video is not online AFAICT, but there is another one about another artist, which includes some footage of an urushi workshop preparing the stuff, and her using it: https://www.youtube.com/watch?v=xeult7lZtbg

[1] https://www.vam.ac.uk/exhibitions/urushi-now-contemporary-ja...

12345
244