News for hackers. Stuff that matters.
Re:GNU Units by typhonius on Wednesday January 06, 2021 @09:20AM (#25657949)
My first exposure to GNU Units was when I read the story about emails failing if they were to be sent more than 500 miles.

I’m sure it’s popped up here before but here’s a link for those who haven’t come across it: https://www.ibiblio.org/harris/500milemail.html

Re:GNU Units by lozf on Wednesday January 06, 2021 @09:38AM (#25658113)
Same here back in the early aughts, but it took me a while to really dig in and discover that units also handles times too.

e.g. units "sec $(echo $SECONDS)" "day;hr;min;sec"

Re:GNU Units by philjackson on Wednesday January 06, 2021 @09:43AM (#25658145)
Useless use of echo there.
Re:GNU Units by x0 on Wednesday January 06, 2021 @05:56PM (#25663860)
It's very important to watch out for useless uses of echo/cat. What is cat, a few megabytes now? Fine for those of us on modern hardware, but you never know what PDP-11 user is going to copy paste your comment into their terminal.
Re:GNU Units by ttul on Wednesday January 06, 2021 @10:01AM (#25658312)
Not unless you’re also trying to demonstrate the magic of fork.
Re:GNU Units by techbio on Wednesday January 06, 2021 @12:28PM (#25659934)
Extraneously strenuous use of "useless" when using "redundant" would have done...unless useless has another usage.

EDIT: The commenter echoed, duckly.

Re:GNU Units by watersb on Wednesday January 06, 2021 @11:38PM (#25667332)
I use a construct like this to ensure that the value ends with a newline.
Re:GNU Units by smorrow on Thursday January 07, 2021 @03:37PM (#25677108)
$() chomps the newline though...
Re:GNU Units by lozf on Wednesday January 06, 2021 @10:12AM (#25658400)
noted, thanks
Re:GNU Units by dheera on Wednesday January 06, 2021 @09:29PM (#25666550)
First time user. Failed on me.

    You have: 25 C
    You want: K
    conformability error
        25 A s
        1 K

    You have: 1 cup flour
    Unknown unit 'flour'
I think I'll stick with Google.
Re:GNU Units by gsk22 on Wednesday January 06, 2021 @10:22PM (#25666888)
Well, flour isn't a unit...
Re:GNU Units by AlotOfReading on Wednesday January 06, 2021 @11:02PM (#25667152)
It's relevant information if you're converting to mass, which was probably the intention. Google will return the correct result for "mass 1 cup flour", by comparison.
Re:GNU Units by greydius on Friday January 08, 2021 @12:44PM (#25687377)
There is no correct way to turn "1 cup flour" into a mass. For one thing, you can fit more into the same volume by compressing. But more importantly, the material is ambiguous. There are many different kinds of flour with varying physical properties.
Re:GNU Units by mkesper on Thursday January 07, 2021 @08:12AM (#25670593)
Neither is cup...
Re:GNU Units by klyrs on Thursday January 07, 2021 @10:52AM (#25672373)
Re:GNU Units by generalizations on Wednesday January 06, 2021 @02:45PM (#25661382)
Last time this showed up on here, a poster claimed to be the consultant who did the upgrade and caused the problem.
Re:GNU Units by cgranier on Wednesday January 06, 2021 @02:49PM (#25661420)
Same here... And I think it was quoted here a week or so ago again. Great story.
Re:GNU Units by blauditore on Wednesday January 06, 2021 @12:19PM (#25659815)
Fun story, but the numbers don't add up for me:

Wouldn't the signal have to do a full round trip within the timeout of 3 ms, meaning it could not go beyond 580 / 2 = 290 miles?

Additionally, the connection from A to B is usually not a straight line, and at that time fiber lines were much less widespread. All these factors combines make it unlikely that even 200 miles could be reached...

Re:GNU Units by mulmen on Wednesday January 06, 2021 @12:24PM (#25659891)
The FAQ [1] addresses both of these questions. See numbers 8 and 15, respectively.

[1]: https://www.ibiblio.org/harris/500milemail-faq.html

Re:GNU Units by blauditore on Thursday January 07, 2021 @04:25AM (#25669034)
Thanks for that link.

> Well, to start with, it can't be three milliseconds, because that would only be for the outgoing packet to arrive at its destination. You have to get a response, too, before the timeout will be aborted. Shouldn't it be six milliseconds?

> Of course. This is one of the details I skipped in the story. It seemed irrelevant, and boring, so I left it out.

I don't understand, so it was in fact 6 ms?

Re:GNU Units by YesThatTom2 on Wednesday January 06, 2021 @04:10PM (#25662538)
I remember chatting with Trey about this as it happened in real time.

I love that every time this link gets posted to HN someone says it looks like a hoax.

Re:GNU Units by blauditore on Thursday January 07, 2021 @04:23AM (#25669016)
I never claimed it was a hoax, I just didn't agree with the math, that's all. No reason to get upset.
Re:GNU Units by saagarjha on Wednesday January 06, 2021 @05:02PM (#25663224)
I love that every time someone says something is a hoax a person who was there shows up to correct the record :)
Re:GNU Units by YesThatTom2 on Wednesday January 06, 2021 @08:49PM (#25666214)
I wanna see that happen for The Loch Ness monster!
Re:GNU Units by coffeemaniac on Wednesday January 06, 2021 @12:36PM (#25660035)
This is addressed in the FAQ[1].

> That three millisecond time doesn't make sense as the timeout for a connect() call.

> Yes, I know. And it wasn't the timeout, actually. In the story, I make it sound like it took all of ten minutes from being made aware of the 500-mile email limit and determining a 3 ms light-speed issue. In fact, this took several hours, and quite a bit of detective work. The point is, eventually I came up with that figure, ran units, and gagged on my latte. (I'm fairly certain it was a different latte from the one I started with.) So what, in particular, is your question about the 3 ms figure?

[1] https://www.ibiblio.org/harris/500milemail-faq.html