Most active commenters
  • bqmjjx0kac(3)
  • bspammer(3)

←back to thread

303 points zdw | 24 comments | | HN request time: 0.442s | source | bottom
Show context
robin_reala ◴[] No.44500076[source]
If you’re one of today’s lucky 10,000 and haven’t heard the original 500-mile email story, you can read it at https://web.mit.edu/jemorris/humor/500-miles.

(discussed previously on HN 5 years ago – https://news.ycombinator.com/item?id=23775404 – and 10 years ago – https://news.ycombinator.com/item?id=9338708)

replies(10): >>44500186 #>>44500188 #>>44500324 #>>44500388 #>>44500395 #>>44500505 #>>44500890 #>>44504294 #>>44504475 #>>44504728 #
1. jeffhuys ◴[] No.44500505[source]

   > units
   751 units, 62 prefixes
   You have: 10 miles
   You want: meters
    * 16093.44
    / 6.2137119e-05
Huh. Never knew that was a thing!
replies(2): >>44500625 #>>44501068 #
2. bqmjjx0kac ◴[] No.44500625[source]
I always want to reach for `units`, but I'm perennially baffled by the output! What's up with the * and /?
replies(3): >>44500696 #>>44500752 #>>44501101 #
3. Arnavion ◴[] No.44500696[source]
The * value is the result of converting 10 miles to meters, as requested.

The / value is the inverse of that in case you wanted that, ie 0.1 meters in miles.

It's explained in `man 1 units`

replies(1): >>44500998 #
4. barnas2 ◴[] No.44500752[source]
the * is denoting the conversion from your first unit to your second, the / denotes the other way.

You have: 1 miles You want: feet * 5280 / 0.00018939394

In the above example, 1 mile is 5280 feet, and 1 foot is 0.00018939394 miles

If I do 2 miles to feet, the values are doubled (or halved for the reverse conversion)

You have: 2 miles You want: feet * 10560 / 9.469697e-05

5. bqmjjx0kac ◴[] No.44500998{3}[source]
Oh, I know it's explained in the man page. I read it every time and promptly forget because I can't internalize the choice of notation.
replies(2): >>44501018 #>>44501074 #
6. jagged-chisel ◴[] No.44501018{4}[source]
* multiply

/ divide

replies(1): >>44504720 #
7. bspammer ◴[] No.44501068[source]
It's one of my most used utilities, as someone who can't help but nerd-snipe myself on the regular. Example questions that I've used it for, just in the last week:

If I work 42 hours/week, how many minutes is that per year?

I've downloaded 4.91GB in the last minute, what's that in Mbps? How long will it take to download a 76GB game?

This AWS feature costs $0.045/hour, how much is that per month?

This guy I read about traveled 58,000km in 27 years, what's his average speed in m/s?

How much would a 10cm sphere of gold be worth in GBP?

If a 36 inch pipeline can deliver 25580 acre-feet of water in a year, how fast is the water flowing in m/s?

replies(3): >>44501691 #>>44505460 #>>44507131 #
8. spacepotato ◴[] No.44501074{4}[source]
If you find the output a bit hard to parse at times (as I do), you might want to try qalc instead, I use it all the time from the terminal to do conversions:

    $ qalc 
    > 3 millilightseconds to miles

      3 milliLightSeconds ≈ 558 mi + 1491 yd + 0.1692913386 ft
I'm not sure if it has all the same units as `units` does, but it replaced my use of it entirely as it can do other useful operations as well
9. Symbiote ◴[] No.44501101[source]
I usually call it non-interactively:

  $ units 1500DKK USD
      * 236.76653
      / 0.00422357
in which case it's always the first line I want.

(The second line is telling me 1USD is 0.00422357 of 1500DKK.)

Note if you use the currency conversions,

  systemctl enable units-currency-update.timer
is needed to keep them up-to-date.
replies(1): >>44509488 #
10. jmoggr ◴[] No.44501691[source]
> How much would a 10cm sphere of gold be worth in GBP?

Is there some trick to this? Or do you have to input it like:

You have: 4/3pi(10 cm)^319320 kg/m^345000 GBP/kg

(What ChatGPT gave me)

replies(2): >>44501862 #>>44503035 #
11. bspammer ◴[] No.44501862{3}[source]
units has (I assume room temp/pressure) densities for all elements, as well as some precious metal prices and currency exchange rates (you need to run the units_cur program regularly to update the database for these). It also has tab completion to make discovering these a bit easier.

The invocation is

You have: goldprice * golddensity * spherevol(10cm/2)

You want: GBP

replies(2): >>44502077 #>>44503864 #
12. jmoggr ◴[] No.44502077{4}[source]
Neat! Thank you!
13. sneak ◴[] No.44503035{3}[source]
You can just save a step and ask ChatGPT the answer. It can google the current spot price of gold.
replies(4): >>44503533 #>>44505002 #>>44506751 #>>44506778 #
14. lazide ◴[] No.44503533{4}[source]
Sure, but then I need to do all the math to verify the answer it gives me isn’t gibberish anyway.
replies(1): >>44505054 #
15. thedrexster ◴[] No.44503864{4}[source]
TIL -- thank you, brother!
16. bqmjjx0kac ◴[] No.44504720{5}[source]
I am familiar.
17. lionkor ◴[] No.44505002{4}[source]
What if its wrong
18. ◴[] No.44505054{5}[source]
19. schoen ◴[] No.44505460[source]
Also check out Kragen's examples from a thread a couple of years ago!

https://news.ycombinator.com/item?id=36988917

replies(1): >>44507227 #
20. ◴[] No.44506751{4}[source]
21. kirici ◴[] No.44506778{4}[source]
You can just save a step of double-checking everything by using WolframAlpha

https://www.wolframalpha.com/input?i=%2810cm+sphere+of+gold+...

22. ThePowerOfFuet ◴[] No.44507131[source]
>25580 acre-feet of water

This is why we can't have nice things.

23. bspammer ◴[] No.44507227{3}[source]
Wow, that’s an awesome resource actually. Thanks!
24. tmtvl ◴[] No.44509488{3}[source]
If you only need the first line you can invoke units with --terse.

  $ units --terse 2.4kWh megajoules
  8.64