[zypp-devel] Binary multiplication prefixes and zypp ByteCount
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 What about the attached diff to ByteCount.cc as part of fixing https://bugzilla.novell.com/show_bug.cgi?id=471335 ? Note the empty 'symbol' for Byte - this way users can just do: ByteCount bytes; cout << "Size: " << bytes << "B" << endl; // OR cout << str::form("Size: %sB", bytes.asString(0,1,1)) << endl; //OR cout << str::form("Size: %sbit", bytes.asString(0,1,1)) << endl; // etc. to get "Size: 13 B" "Size: 13 KiB" "Size: 13 MiB" "Size: 13 Mibit" (plus the decimal variants) etc... without need for if (bytes.bestUnit().factor() == ByteCount::B.factor()) cout << str::form("Size: %s", bytes.asString(0,1,1)); else cout << str::form("Size: %sB", bytes.asString(0,1,1)); - -- cheers, jano Ján Kupec YaST team - ---------------------------------------------------------(PGP)--- Key ID: 637EE901 Fingerprint: 93B9 C79B 2D20 51C3 800B E09B 8048 46A6 637E E901 - ---------------------------------------------------------(IRC)--- Server: irc.freenode.net Nick: jniq Channels: #zypp #yast #suse #susecz - ---------------------------------------------------------(EOF)--- -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkmK/38ACgkQgEhGpmN+6QEyHQCfRNz+fo4ICWNlTlo1MSfM5LpF fUQAn2L8yBOoItnFtHLCTNt8qU23v87L =AjsE -----END PGP SIGNATURE-----
On Donnerstag, 5. Februar 2009, Jan Kupec wrote:
What about the attached diff to ByteCount.cc as part of fixing https://bugzilla.novell.com/show_bug.cgi?id=471335 ?
That bug is a request by a community member to do something which I think is
utterly stupid. Why would we want to do that? And why would we rush ahead to
do it when there is one single person requesting it? Did we ask anybody else?
Do we know what the majority of our user base thinks about it?
CU
--
Stefan Hundhammer
On 2/5/2009 at 5:53 PM, Stefan Hundhammer
wrote: On Donnerstag, 5. Februar 2009, Jan Kupec wrote: What about the attached diff to ByteCount.cc as part of fixing https://bugzilla.novell.com/show_bug.cgi?id=471335 ? That bug is a request by a community member to do something which I think is
utterly stupid. Why would we want to do that? And why would we rush ahead to
do it when there is one single person requesting it? Did we ask anybody else? Do we know what the majority of our user base thinks about it?
I would be highly confused if anything on my system starts to use KiB and GiB... I know hardware vendors always did it... not out of lack of knowledge, but the figures just sound better... IF this ever get's enabled, please only with very sane and simple way to switch to 'normal' display. The 'standardization' went the wrong way in my opinion. Dominique -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Hi, On Thu, 5 Feb 2009, Dominique Leuenberger wrote:
do it when there is one single person requesting it? Did we ask anybody else? Do we know what the majority of our user base thinks about it?
I would be highly confused if anything on my system starts to use KiB and GiB... I know hardware vendors always did it... not out of lack of knowledge, but the figures just sound better... IF this ever get's enabled, please only with very sane and simple way to switch to 'normal' display.
You are one of the results of the unsuing confusion. [kK]B always was "wrong" for 1024 Bytes. Now "they" decided to fix it for good by introducing new binary prefixes for sizes. "Ki" for instance for 2^10, "Mi" for 2^20 and so on. So, the only thing which would change would be the strings, not the multiplier (1024). Ciao, Michael. -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Fri, Feb 6, 2009 at 3:08 AM, Dominique Leuenberger
I would be highly confused if anything on my system starts to use KiB and GiB...
For most people, if they don't understand it -- they just relate it to the base-10 unit. And that's a very accurate assumption as half the time when the base-10 unit is used it means the base-2 anyway. ;D
I know hardware vendors always did it... not out of lack of knowledge, but the figures just sound better...
I take it you don't work in marketing, as most of them would think 200GB sounds better than 185GB. ;D The move is purely motivated by people trying to get rid of confusion and ambiguity. Have you ever bought a harddrive or USB stick and found your system recognizes it smaller than what you paid for? That's because it was sold to you as GB and your system is displaying it in GiB (Although inappropriately labeled: GB in some poor programs).
IF this ever get's enabled, please only with very sane and simple way to switch to 'normal' display.
The 'standardization' went the wrong way in my opinion.
That, or your understanding of it =) http://en.wikipedia.org/wiki/Orders_of_magnitude_(data)
Dominique -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Fri, Feb 6, 2009 at 2:53 AM, Stefan Hundhammer
On Donnerstag, 5. Februar 2009, Jan Kupec wrote:
What about the attached diff to ByteCount.cc as part of fixing https://bugzilla.novell.com/show_bug.cgi?id=471335 ?
That bug is a request by a community member to do something which I think is utterly stupid. Why would we want to do that?
I think you're confused. When I say "this package is a MB", what do you think? 1024 KB, right? Well other people (*cough* hardware manufacturers *cough*) use it to mean mega (as in million) bytes. 1 million bytes. As it's around 5% smaller. So to avoid the confusion, people have adopted the term KiB, MiB etc to denote it's base 2 not based 10. You'll notice many projects have adopted the standard. I have KDE telling me a particular file is 106.7MiB not 106.7MB. Most partitioning tools have adopted it too. And also in computer science we exclusively use the KiB, MiB etc. scheme as it's not good enough being ambiguous. I agree with you, that it's utterly stupid that we need two sets of units for describing computer storage. But I also think it's become essential. If zypper is telling me, that I'm installing 1 GB of software -- is that 1,073,741,824 bytes or is it 1,000,000,00 bytes? It's a non trivial difference :)
And why would we rush ahead to do it when there is one single person requesting it? Did we ask anybody else? Do we know what the majority of our user base thinks about it?
CU -- Stefan Hundhammer
Penguin by conviction. YaST2 Development SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Nürnberg, Germany -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Thursday 05 February 2009 16:02:23 Jan Kupec wrote:
What about the attached diff to ByteCount.cc as part of fixing https://bugzilla.novell.com/show_bug.cgi?id=471335 ?
Note the empty 'symbol' for Byte - this way users can just do:
No please. The class is named ByteCount and that's why prints per default "B" as unit. You should not change this semantic. Feel free to enhance the class to support different units like 'bit', but don't change the default behaviour. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Michael Andres wrote:
On Thursday 05 February 2009 16:02:23 Jan Kupec wrote:
What about the attached diff to ByteCount.cc as part of fixing https://bugzilla.novell.com/show_bug.cgi?id=471335 ?
Note the empty 'symbol' for Byte - this way users can just do:
No please. The class is named ByteCount and that's why prints per default "B" as unit. You should not change this semantic.
OK, but then why not adding the B also to the multiples (K -> KB, M -> MB, ...). Currently it prints B for bytes (OK), but only M for megabytes (i would expect MB).
Feel free to enhance the class to support different units like 'bit', but
E.g. by allowing the class to set the unit name and append that name to the K/M prefix (and use B as the default)?
don't change the default behaviour.
ok - -- cheers, jano Ján Kupec YaST team - ---------------------------------------------------------(PGP)--- Key ID: 637EE901 Fingerprint: 93B9 C79B 2D20 51C3 800B E09B 8048 46A6 637E E901 - ---------------------------------------------------------(IRC)--- Server: irc.freenode.net Nick: jniq Channels: #zypp #yast #suse #susecz - ---------------------------------------------------------(EOF)--- -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkmQOVgACgkQgEhGpmN+6QEYEwCfdvkHwJT29fCl6lwCYhaIK4t2 haEAn26MFZOZlCgBQSvSETeErT+9azCA =tNEe -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Monday 09 February 2009 15:10:32 Jan Kupec wrote:
No please. The class is named ByteCount and that's why prints per default "B" as unit. You should not change this semantic.
OK, but then why not adding the B also to the multiples (K -> KB, M -> MB, ...). Currently it prints B for bytes (OK), but only M for megabytes (i would expect MB).
Because it followes the convention used by commands like du/df. Manual page df(1) ... SIZE may be (or may be an integer optionally followed by) one of following: kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y. That's why you can't simply append a 'B' to 'M' but need the 'i' inbetween. From an intellctual POV it might appear right to write 'MiB' instead of 'M', but I suppose most people are as well fine with a simple 'M'. I actually don't mind, as long as the computed values are correct, and ByteCount per default prints byte as unit. If we do it, we should check sw_single dialogs (esp. ncurses) to make shure the enlarged size fields don't get clipped. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Tue, Feb 10, 2009 at 7:56 PM, Michael Andres
On Monday 09 February 2009 15:10:32 Jan Kupec wrote:
No please. The class is named ByteCount and that's why prints per default "B" as unit. You should not change this semantic.
OK, but then why not adding the B also to the multiples (K -> KB, M -> MB, ...). Currently it prints B for bytes (OK), but only M for megabytes (i would expect MB).
Because it followes the convention used by commands like du/df.
Manual page df(1) ... SIZE may be (or may be an integer optionally followed by) one of following: kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.
Interesting. Never knew up that the single letter convention notation was designed to be explicit like that . All of this is really making the decimal (kB, MB etc.) system a little unusable, as there's just no way of knowing which convention they're following. And it is really getting exploited, like my ISP (optus) who actually use both (metric for quotas and decimal for download size, funny huh). Even the 8GB flash drive I bought is only 7.6GiB.
That's why you can't simply append a 'B' to 'M' but need the 'i' inbetween. From an intellctual POV it might appear right to write 'MiB' instead of 'M', but I suppose most people are as well fine with a simple 'M'. I actually don't mind, as long as the computed values are correct, and ByteCount per default prints byte as unit.
I like the 'MiB' because it's easier to look-up and more common. I remember the first time I stumbled upon MiB. I googled it -- and I've been enlightened ever since. While if it was just an 'M' I'd have assumed it was someone being lazy and far far more difficult to look up.
If we do it, we should check sw_single dialogs (esp. ncurses) to make shure the enlarged size fields don't get clipped.
--
cu, Michael Andres
+------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Tuesday 10 February 2009 17:12:17 Eric Springer wrote:
I like the 'MiB' because it's easier to look-up and more common. I remember the first time I stumbled upon MiB. I googled it -- and I've been enlightened ever since. While if it was just an 'M' I'd have assumed it was someone being lazy and far far more difficult to look up.
Convinced - as far as libzypp is affected. We'll change the unit to iB's (for FACTORY). -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (6)
-
Dominique Leuenberger
-
Eric Springer
-
Jan Kupec
-
Michael Andres
-
Michael Matz
-
Stefan Hundhammer