News for hackers. Stuff that matters.
Re:10 KB Club: With links to popular HN, Reddit, Lobsters th... by susam on Monday December 28, 2020 @05:56AM (#25558234)
I appreciate the attention to detail. This is something I wondered about too while deciding the transfer size limit. Finally, I decided that this website is neither 10 KiB Club nor 10 kB club but instead 10 KB Club where "KB" colloquially means 1024 bytes.

From https://en.wikipedia.org/wiki/Kilobyte,

  ---------------------------------------------------------
        Decimal       ||              Binary
  ---------------------------------------------------------
  Value |   Metric    || Value |     IEC      |    JEDEC
  ---------------------------------------------------------
  1000  | kB kilobyte || 1024  | KiB kibibyte | KB kilobyte
Also,

"In the International System of Units (SI) the prefix kilo means 1000; therefore, one kilobyte is 1000 bytes. The unit symbol is kB."

"The binary meaning of the kilobyte for 1024 bytes typically uses the symbol KB, with an uppercase letter K."

"In December 1998, the IEC addressed such multiple usages and definitions by creating prefixes such as kibi, mebi, gibi, etc., to unambiguously denote powers of 1024. Thus the kibibyte, symbol KiB, represents 210 bytes = 1024 bytes."

Re:10 KB Club: With links to popular HN, Reddit, Lobsters th... by knorker on Monday December 28, 2020 @02:47PM (#25562502)
In my opinion you're hurting clarity. Continuing to use 1024 is to me clearly being on the wrong side of history.
Re:10 KB Club: With links to popular HN, Reddit, Lobsters th... by susam on Tuesday December 29, 2020 @05:01AM (#25568356)
Point taken and I will reconsider the choice of the unit. By the way, I got curious about how various tools deal with the KiB vs. kB vs. KB situation.

On macOS Catalina 10.15.7:

  $ head -c 92160 /dev/urandom > foo

  $ ls -l foo
  -rw-r--r--  1 susam  staff  92160 Dec 29 15:04 foo

  $ ls -lh foo
  -rw-r--r--  1 susam  staff    90K Dec 29 15:04 foo
On Debian GNU/Linux 10.6 (buster):

  $ head -c 92160 /dev/urandom > foo

  $ ls -l foo
  -rw-r--r-- 1 susam susam 92160 Dec 29 09:35 foo

  $ ls -lh foo
  -rw-r--r-- 1 susam susam 90K Dec 29 09:35 foo

  $ ls -lh --si foo
  -rw-r--r-- 1 susam susam 93k Dec 29 09:35 foo

  $ sudo cp foo /var/www/html/foo

  $ wget http://127.0.0.1/foo -O /dev/null
  --2020-12-29 09:41:05--  http://127.0.0.1/foo
  Connecting to 127.0.0.1:80... connected.
  HTTP request sent, awaiting response... 200 OK
  Length: 92160 (90K) [application/octet-stream]
  Saving to: '/dev/null'

  /dev/null           100%[===================>]  90.00K  --.-KB/s    in 0s

  2020-12-29 09:41:05 (845 MB/s) - '/dev/null' saved [92160/92160]
This 90 kB (92 KiB) is also hosted temporarily at http://172.105.48.21/foo . When Firefox downloads it shows 90 KB in the Developer Tools > Network tab as well as in the download box [1]. However, after the file is downloaded, macOS Finder shows the file to be of 92 KB [2].

[1] https://i.imgur.com/Y0q5anu.png

[2] https://i.imgur.com/muZKcZa.png

Re:10 KB Club: With links to popular HN, Reddit, Lobsters th... by knorker on Tuesday December 29, 2020 @11:45AM (#25571668)
Some tools would break compatability if fixed. That doesn't mean new tooling should also be broken.

Note that on OpenBSD "df" shows space in "blocks" by default, which pretty much nobody wants.

Hard drives are sold in real units for decades.

And floppies of "1.44MB" were always 1000 times 1024 times 1.44 bytes. Madness, eh?