Just In Case It's Needed

  • pete 2005-08-17 14:10
    It also contains a bug.  They divide by 1024 to get the number of
    (mega|giga|whatever)bytes, but if there are more than 1000 yottabytes
    they multiply by 999 to get back to Yb.<br>
    <br>
  • El Duderino 2005-08-17 14:13
    Note to self:&nbsp; Order more hard drives.
  • voyager 2005-08-17 14:15
    LOL ... I use yum all the time and I find it very good. It is an RPM
    based package management system for Linux, it comes as standard with
    Fedora Core.<br>
    <br>
    Basically if I want to install FireFox I don't go lookign round the web for it I just run:<br>
    <span style="font-family: courier new;"><span style="font-family: courier new;">yum install firefox</span></span><br>
    <br>
    Or, better still, if I want to update ALL the apps on my computer to the latest version I just run:<br>
    <span style="font-family: courier new;">yum update</span><br>
    <br>
    Yum is a very nice product, mind you this little snippet of code is
    exceptionally entertaining, I know it is good to future proof your code
    but I think yum will be LONG dead before we start needed yotta bytes of
    info from it!<br>
  • Jonathan &quot;Project X&quot; Thompson 2005-08-17 14:20
    <P>Well, I must say: this developer is optimistic when it comes to data sizes!&nbsp; While what was written in isolation isn't a WTF but rather an optimistic hope (or fear) for dataset size does bring up the likely WTF in regards to other issues within the application.&nbsp; What are these?</P>
    <P>1.&nbsp; What's the size manageable by the filesystem and file libraries used?&nbsp; Can it cope?</P>
    <P>2.&nbsp; Let's assume a very optimistic system will exist before this code is no longer used, that can transfer 1 terabyte of data per second (SATA1,000,000,000, anyone?) which will still require more than 31,688,087.814028950237026896848937 years to transfer 1000 yottabytes, which is alotta bytes. Somewhere or other, I'd expect file data stamps to be assigned, leading to the logical question: is the software Y20M compliant, and beyond?</P>
    <P>&nbsp;</P>
    <P>And of course, I had to pop out this question a woman might ask a guy:</P>
    <P>Is that a yottabyte of storage in your pocket, or are you just happy to see me?[:$]</P>
  • Mung Kee 2005-08-17 14:25
    Mmmmmmmmmmm, 1000 yottabytes of hot dogs.&nbsp; &lt;drool/&gt;<font color="#006400"></font>
  • marijne 2005-08-17 14:41
    Wow. That's a yotta data.
  • Mr Smith 2005-08-17 14:45
    Anonymous:
    Somewhere or other, I'd expect file data stamps
    to be assigned, leading to the logical question: is the software Y20M
    compliant, and beyond?
    <br>
    I think Y10K is the next big one... certainly that's where 4-digit
    dates die out. Maybe this app uses rfc2550 dates... it would be
    interesting to see a real world app which does.<br>
  • Sean 2005-08-17 14:58
    Forward thinking like this would have prevented the Y2K crisis.<br>
  • DZ-Jay 2005-08-17 15:02
    Alex Papadimoulis:
    <p>A stack of 3.5" floppy discs with
    1,000 yottabytes would be tall enough to make it to the sun. 14 Million
    times. But still ... just in case ...</p>
    <br>
    <br>
    Dude, wouldn't the floppies melt when they get close to the Sun?<br>
    <br>
    &nbsp;&nbsp;&nbsp; dZ.<br>
    <br>
  • Mike 2005-08-17 15:06
    It's a funny comment but the check itself is probably a good thing.&nbsp; If 'number' came from direct user input, a file, or some other untrusted source it needs to be checked rather than blindly running off the end of the symbol array.
  • Mung Kee 2005-08-17 15:08
    DZ-Jay:
    Alex Papadimoulis:
    <p>A stack of 3.5" floppy discs with
    1,000 yottabytes would be tall enough to make it to the sun. 14 Million
    times. But still ... just in case ...</p>
    <br>
    <br>
    Dude, wouldn't the floppies melt when they get close to the Sun?<br>
    <br>
    &nbsp;&nbsp;&nbsp; dZ.<br>
    <br>
    <br>
    <br>
    HAHA, dZ, you're pragmatism has no bounds.<br>
  • Ben Cooke 2005-08-17 15:09
    I think we should be more concerned about the various points in the not-so-distant future where various timestamp formats will overflow a 32-bit integer. UNIX timestamps only have 27 years left!
  • Eddie 2005-08-17 15:12
    I would write that in just for fun, just so I could type "yottabyte" in my code.
  • Gene Wirchenko 2005-08-17 15:16
    voyager:
    Yum is a very nice product, mind you this little snippet of code is
    exceptionally entertaining, I know it is good to future proof your code
    but I think yum will be LONG dead before we start needed yotta bytes of
    info from it!
    <br>
    <br>
    A large part of Y2K was that sort of thinking.<br>
    <br>
    <font size="2"><span style="font-family: courier new;">http://www.j-paine.org/singularity.html</span></font><br>
    <br>
    Sincerely,<br>
    <br>
    Gene Wirchenko<br>
    <br>
  • Anonymous Coward 2005-08-17 15:16
    Anonymous:
    It also contains a bug.&nbsp; They divide by 1024 to get the number of
    (mega|giga|whatever)bytes, but if there are more than 1000 yottabytes
    they multiply by 999 to get back to Yb.<br>
    <br>
    <br>
    Incorrect. This is so it'll overflow into the next unit of measure
    before hitting one -- they want you to see 0.99 GB instead of 1,023 MB.<br>
  • procyon112 2005-08-17 15:22
    Very nice.&nbsp; This programmer takes the "no arbitrary limits" philosophy seriously.&nbsp; I like it.<br>
    <br>
    As for neccessity:&nbsp; Moores law, although it doesn't directly apply
    to storage, has shown to parallell storage capacity pretty well as a
    general rule of thumb.&nbsp; Since 2^10=1024, we can expect to hit the
    next "depth" every 10 Moore's cycles, or 15 years.&nbsp; I regularly
    deal with terabytes of data now, in 2005.&nbsp; Using Moore's law as a
    rough guide, I can expect to be dealing with 1000 yottabytes (1
    nonabyte) in 60 Moore's cycles, or approximately 90 years.&nbsp; So, in
    2085 this software would most likely break occassionally if it had an
    arbitrary limit.&nbsp; By 2100 I would expect it to break fairly
    regularly.&nbsp; That is not to say that it won't break eventually, as
    word length seems to grow linearly, but I'd say he bought himself an
    extra 40 years or so with this adjustment.&nbsp; I would fully trust
    this code to operate until 2115.&nbsp; It's not THAT far away.<br>
    <br>
    And to put the storage into perspective, 1 yottabyte is about 2 moles
    of bytes, which given 1 molecule per bit storage would fit rather
    handily in something weighing 16-32 grams.&nbsp; And that is just
    conventional storage.&nbsp; We haven't even entered the world of
    overlapping quanta, so in reality, these sizes are not unbelievable...
    I just wouldn't try fitting them on a CD-R. :)<br>
  • Ulf 2005-08-17 15:28
    Is that assuming hydrogen (proton) storage? You may need to multiply those grams by a factor for different elements.

    All of this is moot, of course, as we know that in the future all computers and robots will be positronic.
  • Trev 2005-08-17 15:40
    1000 yottabytes is absurd.&nbsp; 640 yottabytes should be enough for anyone.<br>
  • Ran 2005-08-17 15:53
    Anonymous:
    It also contains a bug.&nbsp; They divide by 1024 to get the number of
    (mega|giga|whatever)bytes, but if there are more than 1000 yottabytes
    they multiply by 999 to get back to Yb.


    I think it's worse than that; I think they meant to write <pre>number = number * 1024**diff</pre> rather than <pre>number = number * thresh**depth</pre>
  • EvanED 2005-08-17 15:56
    It's something very small. One molecule of hydrogen per bit would yield about 16 grams.
    <br><br>
    By contrast 1 mole of iron is about 55 grams. Double that and you're at 110.
    <br><br>
    But that's if there was one iron atom for each BYTE, not bit. Multiply by 8 and you're at about 900 grams, or about 2 lb. (1.97 if you carry through all numbers accurately.
  • dubwai 2005-08-17 15:59
    <P>
    procyon112:
    Very nice.&nbsp; This programmer takes the "no arbitrary limits" philosophy seriously.&nbsp; I like it.<BR><BR>As for neccessity:&nbsp; Moores law, although it doesn't directly apply to storage, has shown to parallell storage capacity pretty well as a general rule of thumb.&nbsp; Since 2^10=1024, we can expect to hit the next "depth" every 10 Moore's cycles, or 15 years.&nbsp; I regularly deal with terabytes of data now, in 2005.&nbsp; Using Moore's law as a rough guide, I can expect to be dealing with 1000 yottabytes (1 nonabyte) in 60 Moore's cycles, or approximately 90 years.&nbsp; So, in 2085 this software would most likely break occassionally if it had an arbitrary limit.&nbsp; By 2100 I would expect it to break fairly regularly.&nbsp; That is not to say that it won't break eventually, as word length seems to grow linearly, but I'd say he bought himself an extra 40 years or so with this adjustment.&nbsp; I would fully trust this code to operate until 2115.&nbsp; It's not THAT far away.<BR><BR>And to put the storage into perspective, 1 yottabyte is about 2 moles of bytes, which given 1 molecule per bit storage would fit rather handily in something weighing 16-32 grams.&nbsp; And that is just conventional storage.&nbsp; We haven't even entered the world of overlapping quanta, so in reality, these sizes are not unbelievable... I just wouldn't try fitting them on a CD-R. :)<BR>
    </P>
    <P>Sure, conceptually we could address that much data but having a place to put that much data and actually having the data to fill it are two completely different matters.</P>
  • Johnboy 2005-08-17 16:05
    I find your analogies troublsome in helping me comprehend the size of a
    yottabyte, problably because my standards of comparison date from
    before the cdrom / 3 1/4" floppy disk. <br>
    <br>
    Can you translate your measurments into the much more standard 'pages of typewriten paper' and 'libraries of congress'?<br>
    <br>
    Thanks<br>
    Vic-20 Guy<br>
  • TheMuuj 2005-08-17 16:06
    This is the biggest Not-a-WTF posted yet.&nbsp; The extra code to make
    it support Yottabytes is minimal, and I do not think it would degrade
    performance (it's not likely to be the root cause of a lot of cache misses
    or page faults).<br>
    <br>
    I admit it is future-proofing to the extreme, but there's no harm from doing that.<br>
    <br>
    For those who disagree, where would be a better place to stop?&nbsp;
    Terabytes?&nbsp; We're almost there for common hard drive sizes (I give
    it three years), so it may be best to move on to Petabytes for a
    maximum theoretical number that will work for the forseeable future.<br>
    <br>
    But Petabytes is a rather arbitrary choice, isn't it?&nbsp; So why not
    just go as high as we have consistant names for and be done with it
    forever, and never have to revisit the code again.&nbsp; At least he
    acknowledges how silly such a number would be.&nbsp; And if a server
    reports a file that big, at least it won't overflow the space allocated
    to display the size.<br>
    <br>
    Admittedly I've become more fond of referring to such units as
    "Kibibytes" instead of "Kilobytes," but use of either style of unit is
    not a WTF unless you choose to mix 1000-based and 1024-based unites.<br>
    <br>
    Furthermore, I wish I could compare the YUM source code to the Windows Udpate code.<br>
    <br>
    What about the "feature" on Windows Update that causes it to bug me to install the
    same Outlook Express patch every 30 minutes, even though I've installed
    it 10 times already, and I don't even use Outlook Express for email anymore!!!<br>
    <br>
    Or how about the code that bugs you until you reboot, interrupting your
    workflow until you're forced to reboot and take an early break?<br>
    <br>Windows Update is a big WTF.&nbsp; My minimal experience with YUM
    has been quite pleasant, and if I saw an update that was 1000
    Yottabytes, I would think twice about downloading it, and then laugh
    because there's probably an error on the server side.&nbsp; At least
    the program won't crash.<br>
  • bugsRus 2005-08-17 16:08
    "Do or do not, there is no try." -- yotta<br>
  • emptyset 2005-08-17 16:16
    <P>
    TheMuuj:
    <BR>Admittedly I've become more fond of referring to such units as "Kibibytes" instead of "Kilobytes," but use of either style of unit is not a WTF unless you choose to mix 1000-based and 1024-based unites.<BR>
    </P>
    <P><FONT face="Courier New" size=2>a poodle whose hair has been died pink is appropriately called "kibi". [&lt;:o)]</FONT></P>
  • Ytram 2005-08-17 16:29
    <span id="PostFlatView">
    Or how about the code that bugs you until you reboot, interrupting your
    workflow until you're forced to reboot and take an early break?
    <br>
    <br>
    I assume you're talking about the nag dialog that pops up after an
    update is completed for Windows.&nbsp; You can increase the nag timer
    or completely disable it if you so choose.<br>
    <br>
    As for the code being a WTF, Alex was actually complementary on the
    code, but I think everyone can agree that by the time Yottabytes are
    spoken with respect to computer storage, Yum&nbsp; will have more of a
    chance to be in a computer history book than in actual use any more.<br>
    </span>
  • Kiriai 2005-08-17 16:31
    <P>
    TheMuuj:
    This is the biggest Not-a-WTF posted yet.&nbsp; The extra code to make it support Yottabytes is minimal, and I do not think it would degrade performance (it's not likely to be the root cause of a lot of cache misses or page faults).
    </P>
    <P>
    Alex Papadimoulis :
    Now, there's nothing really wrong with the code. It's actually researched, written well, and commented. But none the less, I found it pretty entertaining ...
    </P>
    <P>Read next time.&nbsp; We all make mistakes.&nbsp; </P>
    <P><BR>
    TheMuuj:
    I don't even use Outlook Express for email anymore!!!
    </P>
    <P>Perhaps this was the bug that Outlook was persistantly trying to fix?&nbsp; ;P</P>
  • JThelen 2005-08-17 16:32
    TheMuuj:
    This is the biggest Not-a-WTF posted yet.&nbsp; The extra code to make
    it support Yottabytes is minimal, and I do not think it would degrade
    performance (it's not likely to be the root cause of a lot of cache misses
    or page faults).<br>
    <br>
    I admit it is future-proofing to the extreme, but there's no harm from doing that.<br>
    <br>
    For those who disagree, where would be a better place to stop?&nbsp;
    Terabytes?&nbsp; We're almost there for common hard drive sizes (I give
    it three years), so it may be best to move on to Petabytes for a
    maximum theoretical number that will work for the forseeable future.<br>
    <br>
    But Petabytes is a rather arbitrary choice, isn't it?&nbsp; So why not
    just go as high as we have consistant names for and be done with it
    forever, and never have to revisit the code again.&nbsp; At least he
    acknowledges how silly such a number would be.&nbsp; And if a server
    reports a file that big, at least it won't overflow the space allocated
    to display the size.<br>
    <br>
    Admittedly I've become more fond of referring to such units as
    "Kibibytes" instead of "Kilobytes," but use of either style of unit is
    not a WTF unless you choose to mix 1000-based and 1024-based unites.<br>
    <br>
    Furthermore, I wish I could compare the YUM source code to the Windows Udpate code.<br>
    <br>
    What about the "feature" on Windows Update that causes it to bug me to install the
    same Outlook Express patch every 30 minutes, even though I've installed
    it 10 times already, and I don't even use Outlook Express for email anymore!!!<br>
    <br>
    Or how about the code that bugs you until you reboot, interrupting your
    workflow until you're forced to reboot and take an early break?<br>
    <br>Windows Update is a big WTF.&nbsp; My minimal experience with YUM
    has been quite pleasant, and if I saw an update that was 1000
    Yottabytes, I would think twice about downloading it, and then laugh
    because there's probably an error on the server side.&nbsp; At least
    the program won't crash.<br>
    <br>
    <br>
    Agreed, except on the point about this not being a WTF.&nbsp; I got to
    the point about yottabytes, and went 'WTF?&nbsp; who on earth would
    have a need to store data of that magnitude?&nbsp; Err. wait.. is it
    even possible to store that much?<br>
    <br>
    Now, with that said, just because you see something in code that makes
    you go WTF?, don't take that to automatically be crappy code.&nbsp;
    I've seen plenty of things that made me go WTF m8! but followed good
    coding practice and standards.&nbsp; <br>
    <br>
    Remember the tagline here:&nbsp; 'Curious Perversions in Information
    Technology'.&nbsp; It says nothing about all shitty code, all the time.<br>
  • EvanED 2005-08-17 16:32
    Ytram:
    <span id="PostFlatView">I assume you're talking about the nag dialog that pops up after an
    update is completed for Windows.&nbsp; You can increase the nag timer
    or completely disable it if you so choose.<br>
    </span>
    <br><br>Howhowhowhow? I too find that so annoying.<br><br>I generally drag it so that it's sitting with just a few pixels of the window sitting over the corner of the system tray, the rest off screen, but disableing it would be nicer...<br>
  • JThelen 2005-08-17 16:32
    Oh, and since I can't edit my posts, apt-get &gt; yum<br>
  • Ytram 2005-08-17 16:36
    Anonymous:
    Ytram:
    <span id="PostFlatView">I assume you're talking about the nag dialog that pops up after an
    update is completed for Windows.&nbsp; You can increase the nag timer
    or completely disable it if you so choose.<br>
    </span>
    <br><br>Howhowhowhow? I too find that so annoying.<br><br>I
    generally drag it so that it's sitting with just a few pixels of the
    window sitting over the corner of the system tray, the rest off screen,
    but disableing it would be nicer...<br>
    <br>
    <br>
    <p>Start -&gt; Run -&gt; gpedit.msc -&gt; Local Computer Policy -&gt; Computer
    Configuration -&gt; Administrative Templates -&gt; Windows Components -&gt;
    Windows Update -&gt; Re-prompt for restart with scheduled installations.<br>
    </p>
    <p>Credit for this info goes to one of the commentors in this Coding Horror blog post:<br>
    http://www.codinghorror.com/blog/archives/000294.html<br>
    </p>
    <br>
  • Icarus 2005-08-17 16:45
    DZ-Jay:
    Alex Papadimoulis:
    <p>A stack of 3.5" floppy discs with
    1,000 yottabytes would be tall enough to make it to the sun. 14 Million
    times. But still ... just in case ...</p>
    <br>
    <br>
    Dude, wouldn't the floppies melt when they get close to the Sun?<br>


    Depends on the Sun. At least the older SparcStations ran pretty cool. (Despite their name.)
  • Icarus 2005-08-17 16:52
    Alex Papadimoulis:
    Dude, wouldn't the floppies melt when they get close to the Sun?
    Depends on the Sun. At least the older SparcStations ran pretty cool. (Despite their name.)
  • Ytram 2005-08-17 16:53
    Anonymous:
    Alex Papadimoulis:
    Dude, wouldn't the floppies melt when they get close to the Sun?


    Depends on the Sun. At least the older SparcStations ran pretty cool. (Despite their name.)
  • Icarus 2005-08-17 16:56
    [Ok, something is wrong with the msg board code, sorry about the garbled posts (they showed up just right in the preview)]
    <br><br>
    > Dude, wouldn't the floppies melt when they get close to the Sun?
    <br><br>
    Depends on the Sun. At least the older SparcStations ran pretty cool. (Despite their name.)
  • DZ-Jay 2005-08-17 16:59
    Anonymous:
    [Ok, something is wrong with the msg board
    code, sorry about the garbled posts (they showed up just right in the
    preview)]
    <br><br>
    &gt; Dude, wouldn't the floppies melt when they get close to the Sun?
    <br><br>
    Depends on the Sun. At least the older SparcStations ran pretty cool. (Despite their name.)
    <br>
    <br>
    AVOID THE PREVIEW at all costs.&nbsp; Switching from "Design" to "HTML"
    and back also results in garbled output.&nbsp; Stick to the "Post"
    button and it'll be alright.<br>
    <br>
    &nbsp;&nbsp;&nbsp; dZ.<br>
  • Kiriai 2005-08-17 17:03
    <P>
    DZ-Jay:
    Anonymous:
    [Ok, something is wrong with the msg board code, sorry about the garbled posts (they showed up just right in the preview)] <BR><BR>&gt; Dude, wouldn't the floppies melt when they get close to the Sun? <BR><BR>Depends on the Sun. At least the older SparcStations ran pretty cool. (Despite their name.)
    <BR><BR>AVOID THE PREVIEW at all costs.&nbsp; Switching from "Design" to "HTML" and back also results in garbled output.&nbsp; Stick to the "Post" button and it'll be alright.<BR><BR>&nbsp;&nbsp;&nbsp; dZ.<BR>
    </P>
    <P>I find the Captcha for unregistered users (which this time arround is Register-- there is also a very&nbsp;limited set of them ) also changes when you preview, which is amusing.</P>
  • eagle 2005-08-17 17:06
    It's written in Python, and I don't know Python, but:<br>

    <br>

    From a Python Quick Reference:<br>

    Floats (type <code>float</code>) are implemented with C doubles.<br>

    Long integers (type <code>long</code>) have unlimited size (only limit is system resources).<br>

    <br>

    From Wikipedia:<br>

    Modern computers with 32-<a href="http://en.wikipedia.org/wiki/Bit" title="Bit">bit</a> stores (<a href="http://en.wikipedia.org/wiki/Single_precision" title="Single precision">single precision</a>) provide 64-bit double precision. <i>Double precision floating point</i> is an <a href="http://en.wikipedia.org/wiki/IEEE_floating-point_standard" title="IEEE floating-point standard">IEEE 754</a> <a href="http://en.wikipedia.org/wiki/Standardization" title="Standardization">standard</a> for encoding <a href="http://en.wikipedia.org/wiki/Floating_point" title="Floating point">floating point</a> numbers that uses 8 <a href="http://en.wikipedia.org/wiki/Byte" title="Byte">bytes</a>.<br>

    <br>

    Also from Wikipedia:<br>
    yottabyte &nbsp;&nbsp;&nbsp; YB &nbsp;&nbsp;&nbsp; 10^24 (or 2^80)<br>
    <br>
    Now even if the number passed in is a "long integer with unlimited
    size", after the first division by the float 1024.0 (see original code)
    it would have to fit into a 64-bit C double.<br>
    <br>
    So when exactly will it actually print out yottabytes? (Or even: when will the fallback with the funny comment ever be used?)<br>
    <br>
    Or did I miss something?<br>
    <br>
    cu<br>
    <br>
    ps: OK, I know what I missed: at the time we use zettabytes regularly we will have 256bit-CPUs. Sure?<br>
  • -E 2005-08-17 17:14
    Ytram:
    Anonymous:
    Ytram:
    <span id="PostFlatView">I assume you're talking about the nag dialog that pops up after an
    update is completed for Windows.&nbsp; You can increase the nag timer
    or completely disable it if you so choose.<br>
    </span>
    <br><br>Howhowhowhow? I too find that so annoying.<br><br>I
    generally drag it so that it's sitting with just a few pixels of the
    window sitting over the corner of the system tray, the rest off screen,
    but disableing it would be nicer...<br>
    <br>
    <br>
    <p>Start -&gt; Run -&gt; gpedit.msc -&gt; Local Computer Policy -&gt; Computer
    Configuration -&gt; Administrative Templates -&gt; Windows Components -&gt;
    Windows Update -&gt; Re-prompt for restart with scheduled installations.<br>
    </p>
    <p>Credit for this info goes to one of the commentors in this Coding Horror blog post:<br>
    http://www.codinghorror.com/blog/archives/000294.html<br>
    </p>
    <br>
    <br>
    <br>
    LOL - Now that's usability/user friendlyness in only 9+ easy steps ;)<br>
    <br>
    -E<br>
  • Maurits 2005-08-17 17:22
    eagle:
    <br>
    Now even if the number passed in is a "long integer with unlimited
    size", after the first division by the float 1024.0 (see original code)
    it would have to fit into a 64-bit C double.<br>
    <br><br>A 64-bit C double is perfectly capable of holding a number larger than 2^80 or even 2^1000 - don't see the problem you're referring to.<br>
  • procyon112 2005-08-17 17:29
    Maurits:
    eagle:
    <br>
    Now even if the number passed in is a "long integer with unlimited
    size", after the first division by the float 1024.0 (see original code)
    it would have to fit into a 64-bit C double.<br>
    <br><br>A
    64-bit C double is perfectly capable of holding a number larger than
    2^80 or even 2^1000 - don't see the problem you're referring to.<br>
    <br>
    <br>
    Not to mention that I doubt a yottabyte is even addressable in either
    memory or on file systems with current hardware.&nbsp; The reason for
    no arbitrary limits in software is so that when you port to larger word
    lengths and larger hardware accessability you won't have to go back and
    rewrite your code for the new platform.&nbsp; You just recompile and go.<br>
  • eagle 2005-08-17 17:33
    Maurits:
    eagle:
    <br>
    Now even if the number passed in is a "long integer with unlimited
    size", after the first division by the float 1024.0 (see original code)
    it would have to fit into a 64-bit C double.<br>
    <br><br>A
    64-bit C double is perfectly capable of holding a number larger than
    2^80 or even 2^1000 - don't see the problem you're referring to.<br>
    <br>
    <br>
    Shame on me. Haven't slept for &gt;36 hours, perhaps that explains it. <br>
  • cowbert 2005-08-17 17:34
    Every time I see "yotta" I think of those Japanese singers with the figleaf underwear that sing that song.<br>
  • Drew R 2005-08-17 17:44
    <br>
    Don't they mean... <a href="http://web.mit.edu/patil/www/media/video/yatta%20(economy).swf">Yatta?</a>
  • Joshua Norman 2005-08-17 17:45
    Anonymous:
    Wow. That's a yotta data.
    Oh God, I think my spleen just ruptured. ><<br>
  • welcor 2005-08-17 18:18
    <P>
    Anonymous:
    1000 yottabytes is absurd.&nbsp; 640 yottabytes should be enough for anyone.<BR>
    </P>
    <P>ROFLMAO!!!!</P>
    <P>Man, that one goes into my sig.</P>
  • Kannan Goundan 2005-08-17 18:26
    <span id="_ctl0_PostForm_Reply"><bockequote>
    It's actually
    researched, written well, and commented. But none the less, I found it
    pretty entertaining ...
    </bockequote></span><br>




    <br>

    Isn't the code wrong?  That last line should be:<br>

    <br>
    <br>   number = number * (1024**diff)<br>
    
    <br>

    <br>

    Also, the code would be a lot simpler if it checked for overflow while looping:<br>

    <br>
    <br>   depth = 0<br>   max_depth = len(symbols) - 1<br>
    

    <br>   while number > thresh and depth < max_depth:<br>      depth  = depth + 1<br>      number = number / 1024<br>
    <br>
  • Anon 2005-08-17 18:36
    Because it is an open source application, it is very likely that this
    code was put in there to "joke" with other programmers. It wouldn't
    degrade performance at all, and it is still funny to read. Inside jokes
    like this are common in many open source applications, it keeps
    developing a little more lighthearted.
  • joost 2005-08-17 19:46
    Am I the only one that thinks 'kibibytes', 'mibibytes', 'gibibytes' and
    what, 'tebibytes'(?) sound absurdly childish? It makes me think of the
    Teletubbies (HORROR!). I strongly object to this 10**x scheme of 'a
    kilobyte is 1000 bytes', no matter how many IEEE, ISO and marketing
    committees they throw at it. And the SI not an argument either. A bit
    has two possible values, not ten. <br>
    <br>
    1 km = 10**3 meter<br>
    1 kg = 10**3 gram<br>
    1 megaton = 10**6 ton<br>
    1 ml = 1/10**3 liter<br>
    &nbsp; :<br>
    &lt;insert your favorite unit here&gt;<br>
    &nbsp; :<br>
    1 KB = 2**10 bytes<br>
    <br>
    Notice a pattern? I think it's obvious, when we say byte, we mean base
    2, when we say any other unit (except for time), we're dealing in base
    10. It wasn't confusing until those KiBiBytes came along. Now you have
    to wonder whether a person would say KiBiByte to find out if they mean
    1024 or 1000 by kilobyte.<br>
  • Anonymous 2005-08-17 20:02
    Anonymous:
    Wow. That's a yotta data.
    <br>
    <br>
    Looks like Tim the Toolman Taylor just joined in...<br>
    <br>
  • richleick 2005-08-17 21:43
    I saw this wtf, had a great stack of CD's and yotta yotta yotta, I landed on the moon.<br>
    <br>
  • TheMuuj 2005-08-17 22:06
    joost:
    Am I the only one that thinks 'kibibytes', 'mibibytes', 'gibibytes' and
    what, 'tebibytes'(?) sound absurdly childish? It makes me think of the
    Teletubbies (HORROR!). I strongly object to this 10**x scheme of 'a
    kilobyte is 1000 bytes', no matter how many IEEE, ISO and marketing
    committees they throw at it. And the SI not an argument either. A bit
    has two possible values, not ten. <br>
    <br>
    1 km = 10**3 meter<br>
    1 kg = 10**3 gram<br>
    1 megaton = 10**6 ton<br>
    1 ml = 1/10**3 liter<br>
    &nbsp; :<br>
    <insert your="" favorite="" unit="" here=""><br>
    &nbsp; :<br>
    1 KB = 2**10 bytes<br>
    <br>
    Notice a pattern? I think it's obvious, when we say byte, we mean base
    2, when we say any other unit (except for time), we're dealing in base
    10. It wasn't confusing until those KiBiBytes came along. Now you have
    to wonder whether a person would say KiBiByte to find out if they mean
    1024 or 1000 by kilobyte.<br>
    <br>
    <br>
    That would be fine and dandy if bytes were <span style="font-style: italic;">always </span>measured
    in powers of 1024, but network transmission rates, for instance (like "gigabit"), are
    not.&nbsp; I believe harddrive manufacturers also got in trouble for
    misrepresenting their harddrive sizes because they used kilobytes (in
    the SI sense) and not kibibytes (traditional kilobytes).<br>
    <br>
    Now, in the few programs where I see "2.4 KiB", I actually know that it
    means 2.4*1024 and not 2.4*1000.&nbsp; All it takes is a little "i" in the
    symbol, and even if you choose to continue pronouncing it "kilobytes,"
    it still helps to know which is meant.<br>
    <br>
    And isn't it illegal in some jurisdictions for "kilo" to mean anything but 1000?<br>
    <br>
    And what about bits instead of bytes?&nbsp; A kilobit is generally 1000
    bits (because they are more often used in network transmission rates), while a kilobyte is 1024
    bytes.&nbsp; That makes no sense.<br>
    <br>
    I thought it was silly at first, but I have to constantly remind myself
    whether Windows Explorer means 1000 bytes or 1024 bytes when it says
    1KB, and I know for a fact that all programs are not consistant in this
    regard.<br>
    </insert>
  • Pax 2005-08-17 22:15
    I've calculatyed this before.  It's early January or February,
    2038 (hence the y2k38 bug) - unless you're posting from 2011, that's
    not 27 years.  If you are, can you please send through a few PDFs
    of sporting or lotto results for me?<br>
    <br>
    Pax<br>
  • Michael 2005-08-17 22:25
    Ok... I'm actually the programmer of this snippet.  I first heard
    of the daily WFT about two weeks ago, so when I got an email just now
    telling me my code was here, I kinda freaked out :)  I'm pleased
    to see that it's not so bad.<br>
    <br>
    As for why...<br>
      a) why not?  You'll note that the length of the "symbols"
    list doesn't affect how you get to a given formatting.  It could
    have 1000 prefixes long and you still get to "k" in one step.  The only cost is storing that list.<br>
      b) who says this is purely for addressing real data?  How
    much data do you need to describe the location of every atom in the
    solar system to within 1mm?  There are plenty of cryptographic
    examples as well.<br>
      c) yes, it amused me.  I actually trolled around for a
    while to find the prefixes out that far.  I sure didn't know them
    off the top of my head :)<br>
    <br>
    Also, new versions allow for SI-based scaling (1000 rather than 1024).<br>
    <br>
  • Juenemann 2005-08-17 23:32
    <P>
    Anonymous:
    I've calculatyed this before.&nbsp; It's early January or February, 2038 (hence the y2k38 bug) - unless you're posting from 2011, that's not 27 years.&nbsp; If you are, can you please send through a few PDFs of sporting or lotto results for me?<BR><BR>Pax<BR>
    </P>
    <P>Venkatesh, is that you?</P>
    <P>&nbsp;</P>
  • dance2die 2005-08-17 23:49
    I think there was this d00d, who was able to look 100 years into future.<br>
    <br>
    He was able to create highway system that's available right now in the U.S.<br>
    <br>
    Now, what about the guy who has created that piece of code that seems to be the subject of ridiculousness?<br>
  • Sten 2005-08-18 02:49
    I believe that a bit does have 10 possible values, namely 0 and 1.<br>
    <br>
    Fun,<br>
    <br>
    Sten<br>
  • Sten 2005-08-18 03:17
    A stack of CDs worth 1 Yottabyte is way larger than just four times the distance to the moon!<br>
    <br>
    1 Yottabytes are 1024^8 = 1.21*10^24 bytes.  A CD takes about 700
    MB = 7.34*10^8 bytes, so 1 Yottabytes would need 1.65*10^15 CDs. 
    At about 1mm per CD, this stack is about 1.65*10^12m high.  The
    moon is about 1 light second = 3*10^8m away, so the stack of CDs is way
    higher than just four times the distance to the moon, namely about 5500
    times that distance.<br>
    <br>
    The distance to the *sun* is about 8.3 light minutes = 8.3*60*3*10^8m =
    1.5*10^11m, which is about a tenth of the height of the CD stack, so a
    stack of CDs worth 1 Yottabyte would go to the sun, and back, and there
    again, and back again, and there again, and back again, and there
    again, and back again, and there again, and back again.<br>
    <br>
    Fun,<br>
    <br>
    Sten<br>
    <br>
    PS: I need to restore a file from CD #19327343264632.  Could you please go get it for me? I'll wait...<br>
  • Mic 2005-08-18 03:31
    <span id="_ctl0_PostForm_Reply">"""In terms of Compact Discs, we'd need to
    build a stack high enough to reach the moon ... and back ... and there
    again ... and back again ... just to have a yottabyte worth of data."""<br>
    <br>
    WTF?<br>
    <br>
    Let's do the math:<br>
    Average distance between moon and earth is 385000km, let's assume a
    double layer DVD, capable of holding 2* 4.7 GB (2*4.38GiB). A DVD is
    1.2mm thick. A yottabyte is 1024^8, so we end up with a stack of DVDs:<br>
    <br>
    ceil((B*1024^8) / (8.76B*1024^3)) * 0.0012m / 385000km<br>
    <br>
    = 400.60 times the average distance between earth and moon surfaces.<br>
    <br>
    </span>
  • Mikademus 2005-08-18 04:01
    /me too will continue to ignore the first-of-its-kind (?) event, that the actual author of the WTF'ed code appeared.<br>
  • meren 2005-08-18 04:17
    Hi Micheal,<br>

    <br>

    Micheal:
    Ok... I'm actually the programmer of this snippet.&nbsp; I first heard
    of the daily WFT about two weeks ago, so when I got an email just now
    telling me my code was here, I kinda freaked out :)&nbsp; I'm pleased
    to see that it's not so bad.<br>
    <br>

    <br>

    Actually i'm the one who responsible of this entry and it's nice to hear that you pleased to see your code here ;)<br>

    <br>

    OTOH, i think your code in YUM is pretty delicious.. Keep up the good work..<br>

    <br>

    <br>

    Ciao,<br>

    meren.
  • Welcome To The Machine 2005-08-18 04:30
    <P>
    Anonymous:
    Ok... I'm actually the programmer of this snippet.&nbsp; I first heard of the daily WFT about two weeks ago, so when I got an email just now telling me my code was here, I kinda freaked out :)&nbsp; I'm pleased to see that it's not so bad.<BR><BR>As for why...<BR>&nbsp; a) why not?&nbsp; You'll note that the length of the "symbols" list doesn't affect how you get to a given formatting.&nbsp; It could have 1000 prefixes long and you still get to "k" in one step.&nbsp; The only cost is storing that list.<BR>&nbsp; b) who says this is purely for addressing real data?&nbsp; How much data do you need to describe the location of every atom in the solar system to within 1mm?&nbsp; There are plenty of cryptographic examples as well.<BR>&nbsp; c) yes, it amused me.&nbsp; I actually trolled around for a while to find the prefixes out that far.&nbsp; I sure didn't know them off the top of my head :)<BR><BR>Also, new versions allow for SI-based scaling (1000 rather than 1024).<BR><BR>
    </P>
    <P>Hey there,&nbsp;good job&nbsp;writing this code, I don't have a problem with it and I fully support the use of these top-end multipliers, I would have struggled but could probably have named all of them - I've got a physics degree and although we just use 1 x 10^24 or whatever, we sometimes like to put a name on our numbers... it can be a yotta fun. :-P</P>
    <P>&nbsp;</P>
  • DZ-Jay 2005-08-18 05:13
    Anonymous:
    Every time I see "yotta" I think of those
    Japanese singers with the figleaf underwear that sing that song.<br>
    <br>
    <br>
    OMG! The weird thing is that i know *exactly* what you are talking about.&nbsp; Its so funny... but man, its weird.<br>
    <br>
    &nbsp;&nbsp;&nbsp; dZ.<br>
  • DZ-Jay 2005-08-18 05:25
    Anonymous:
    <br>PS: I need to restore a file from CD #19327343264632.&nbsp; Could you please go get it for me? I'll wait...<br>
    <br>
    <br>
    Sorry man, it melted... along with the floppy stack.<br>
    <br>
    &nbsp;&nbsp;&nbsp; dZ.<br>
  • Chris Brien 2005-08-18 05:34
    Anonymous:
    I believe that a bit does have 10 possible values, namely 0 and 1.<br>
    <br>
    Fun,<br>
    <br>
    Sten<br>

    Of course, by that logic, one kilobyte, should be 10^3 bytes - ie 8 bytes.
    kilobyte: 10^3 = 8 bytes
    megabyte: 10^6 = 64 bytes
    gigabyte: 10^9 = 512 bytes
    terabyte: 10^12 = 4096 bytes
    petabyte: 10^15 = 32,768 bytes
    exabyte: 10^18 = 262,144 bytes
    zettabyte: 10^21 = 2,097,152 bytes
    yottabyte: 10^24 = 16,777,216 bytes
    xennabyte: 10^27 = 134,217,728
    deabyte: 10^30 = 1,073,741,824
    vendekabyte: 10^33 = 8,589,934,592

    As you can see, current (32-bit) computer systems can address 0.5 vendekabytes. In only a few Moore-times, when we have 128-bit systems, we will be able to address substantially more than a googolbyte.
  • DZ-Jay 2005-08-18 05:45
    Anonymous:
    Ok... I'm actually the programmer of this snippet.&nbsp; I first heard
    of the daily WFT about two weeks ago, so when I got an email just now
    telling me my code was here, I kinda freaked out :)&nbsp; I'm pleased
    to see that it's not so bad.<br>
    <br>
    As for why...<br>
    &nbsp; a) why not?&nbsp; You'll note that the length of the "symbols"
    list doesn't affect how you get to a given formatting.&nbsp; It could
    have 1000 prefixes long and you still get to "k" in one step.&nbsp; The only cost is storing that list.<br>
    &nbsp; b) who says this is purely for addressing real data?&nbsp; How
    much data do you need to describe the location of every atom in the
    solar system to within 1mm?&nbsp; There are plenty of cryptographic
    examples as well.<br>
    &nbsp; c) yes, it amused me.&nbsp; I actually trolled around for a
    while to find the prefixes out that far.&nbsp; I sure didn't know them
    off the top of my head :)<br>
    <br>
    Also, new versions allow for SI-based scaling (1000 rather than 1024).<br>
    <br>
    <br>
    <br>
    Welcome, Michael!<br>
    <br>
    Do not be intimidated by the purile spirt of this thread.&nbsp; Most of
    us appreciate the elegance of your code and approach.&nbsp; Indeed, of
    those mocking it, most of them do it in order to be funny, and not to
    belittle its design.<br>
    <br>
    As Alex said in his introduction, your code is not really a <span style="font-weight: bold;">WTF</span> (as a matter of fact, it is the most <span style="font-style: italic;">un-</span><span style="font-weight: bold;">WTF</span><span style="font-style: italic;">-ish</span>
    entry we've had in a while), but it's amusing comments are entertaining
    to other developers as well.&nbsp; Maybe Alex's well of <span style="font-weight: bold;">WTF</span> submissions is running dry...?<br>
    <br>
    I hope you stick around this forum for a while.&nbsp; We could always
    use more smart people with a witty sense of humour, and I'm sure you
    can use the cynical amusement brought by laughing at bad code and
    stupid designs.<br>
    <br>
    &nbsp;&nbsp;&nbsp; Cheers!<br>
    &nbsp;&nbsp;&nbsp; dZ.<br>
    <br>
  • Dave 2005-08-18 05:46
    <span style="color: rgb(0, 0, 0);">On a serious note </span><br style="color: rgb(0, 0, 0);">
    <br style="color: rgb(0, 0, 0);">
    <span style="color: rgb(0, 0, 0);">whats the better statement</span><br style="color: rgb(0, 0, 0);">
    <br style="color: rgb(0, 0, 0);">
    <span style="color: rgb(0, 0, 0);">"640k (1/2 of a megabyte) </span><b style="background-color: rgb(255, 102, 255); color: rgb(0, 0, 0);">ought</b><span style="color: rgb(0, 0, 0);"> to be enough for anybody." Bill Gates 1981</span><br style="color: rgb(0, 0, 0);">
    <br style="color: rgb(0, 0, 0);">
    <pre><font color="#006400"><span style="color: rgb(0, 0, 0);">"just in case someone needs more than 1000 yottabytes!" - Unknown Programmer circa 2005</span><br><br></font></pre>
    Which one do we have to pay for every day of our programming lives <a href="">:)</a>
  • Dave 2005-08-18 05:50
    Anonymous:
    <span style="color: rgb(0, 0, 0);">On a serious note </span><br style="color: rgb(0, 0, 0);">
    <br style="color: rgb(0, 0, 0);">
    <span style="color: rgb(0, 0, 0);">whats the better statement</span><br style="color: rgb(0, 0, 0);">
    <br style="color: rgb(0, 0, 0);">
    <span style="color: rgb(0, 0, 0);">"640k (1/2 of a megabyte) </span><b style="background-color: rgb(255, 102, 255); color: rgb(0, 0, 0);">ought</b><span style="color: rgb(0, 0, 0);"> to be enough for anybody." Bill Gates 1981</span><br style="color: rgb(0, 0, 0);">
    <br style="color: rgb(0, 0, 0);">
    <pre><font color="#006400"><span style="color: rgb(0, 0, 0);">"just in case someone needs more than 1000 yottabytes!" - Unknown Programmer circa 2005</span><br><br></font></pre>
    Which one do we have to pay for every day of our programming lives <a href="">:)</a>
    <br>
    <br>
    Before you shoot me down in flames , the quote is not accurate i just googled for it and pasted it in<br>
  • DZ-Jay 2005-08-18 05:50
    Anonymous:
    [As you can see, current (32-bit) computer
    systems can address 0.5 vendekabytes. In only a few Moore-times, when
    we have 128-bit systems, we will be able to address substantially more
    than a googolbyte.
    <br>
    <br>
    Ah, Vendeka Bytes... the little known cousin of Veruca Salt, and
    Charlie's dearest love (after chocolate, of course).&nbsp; Last I heard
    she was arrested by W.W. security when trying to break into The Factory.<br>
    <br>
    &nbsp;&nbsp;&nbsp; dZ.<br>
    <br>
  • Someone Else's Name 2005-08-18 06:03
    TheMuuj:
    Or how about the code that bugs you until you reboot, interrupting your
    workflow until you're forced to reboot and take an early break?
    <br>
    <br>
    You know why it does that, right?  If you install a security
    update to some piece of code that you're currently using (esp. part of
    the OS), it's not secure until you reboot.  (or at least close and
    restart that code, but that's not always enough)  Some people
    would install the update and just ignore the request to reboot
    indefinitely.<br>
    <br>
    Personally, I just shove the window off-screen until the end of the day, but it's not just doing that to be annoying.<br>
  • Hugo 2005-08-18 06:08
    Hmms, lets see if we can simplify this code a bit:<br>
    Alex Papadimoulis:
    <blockquote style="margin-right: 0px;" dir="ltr"><pre><font color="#006400">...<br># just in case someone needs more than 1000 yottabytes!</font>
    diff = depth - len(symbols) + 1

    <font color="#0000ff">if</font> diff &gt; 0:<br> depth = depth - diff</pre></blockquote>
    <p></p>
    <br>
    <br>
    So the last assignment reads: depth = depth - (depth - len(symbols) + 1)<br>
    Which can be simplified to: depth = len(symbols) - 1<br>
    And as symbol appears to be a constant array (from this code snippet), this would be a constant...<br>
  • Rob 2005-08-18 07:18
    This may be a reaction to the versions of the UNIX 'df' command where
    the output formatting was messed up for values larger than a terrabyte,
    and so on.<br>
  • Magic Duck 2005-08-18 07:23
    <P>
    Anonymous:
    Anonymous:
    I believe that a bit does have 10 possible values, namely 0 and 1.<BR><BR>Fun,<BR><BR>Sten<BR>
    Of course, by that logic, one kilobyte, should be 10^3 bytes - ie 8 bytes. </P>
    <P>kilobyte: 10^3 = 8 bytes <BR>megabyte: 10^6 = 64 bytes <BR>.<BR>.<BR>.<BR>vendekabyte: 10^33 = 8,589,934,592 As you can see, current (32-bit) computer systems can address 0.5 vendekabytes. In only a few Moore-times, when we have 128-bit systems, we will be able to address substantially more than a googolbyte.
    </P>
    <P>Either one of 10 cases just happened:</P>
    <P>[*] Someone missed a binary joke or<BR>[*] I missed missed a joke about a binary joke</P>
  • dhromed 2005-08-18 08:12
    Anonymous:
    values larger than a terrabyte,
    and so on.<br>
    <br>
    <br>
    The terrabyte - the Earth's native byte.<br>
  • DZ-Jay 2005-08-18 08:15
    dhromed:
    Anonymous:
    values larger than a terrabyte,
    and so on.<br>
    <br>
    <br>
    The terrabyte - the Earth's native byte.<br>
    <br>
    <br>
    Yes, the terrabyte is the word-size of the successor of Deep Thought.<br>
    <br>
    &nbsp;&nbsp;&nbsp; dZ.<br>
    <br>
  • Nick Coghlan 2005-08-18 08:53
    I was concerned at one point about the lack of overflow handling on a
    particular counter in the program I was working on (given that the
    software assumed that the counter values were unique within any given
    invocation of the program).<br>
    <br>
    Then I actually spent five minutes doing the math: overflowing that
    counter would require running the software continuously for a few
    hundred thousand years (and thrashing it pretty hard for that entire
    time). So instead of adding overflow handling, I just put in a comment
    warning that the software shouldn't be run for half a million years at
    a time <a href="">8-|</a>
  • Alex Papadimoulis 2005-08-18 08:54
    <P>
    Anonymous:
    <SPAN id=_ctl0_PostForm_Reply>"""In terms of Compact Discs, we'd need to build a stack high enough to reach the moon ... and back ... and there again ... and back again ... just to have a yottabyte worth of data."""<BR><BR>WTF?<BR><BR>Let's do the math:<BR>Average distance between moon and earth is 385000km, let's assume a double layer DVD, capable of holding 2* 4.7 GB (2*4.38GiB). A DVD is 1.2mm thick. A yottabyte is 1024^8, so we end up with a stack of DVDs:<BR><BR>ceil((B*1024^8) / (8.76B*1024^3)) * 0.0012m / 385000km<BR><BR>= 400.60 times the average distance between earth and moon surfaces.<BR><BR></SPAN>
    </P>
    <P>But I was close! Just off by a couple magnitudes ... and the type of disc ;-). I corrected the post, thx for pointing that out.</P>
  • RayS 2005-08-18 08:55
    I think actually that this WTF brings a serious issue up. Nobody knows
    what all those mega this and giga thats mean. It's all greek.<br>
    <br>
    I hereby suggest that we move to a new standard in describing data
    storage, with the basic unit of measurement being "metres of floppy
    disks". Everyone knows how much you can get on a floppy, and how long a
    metre is.<br>
    <br>
    "Dude, I just got a new computer, and it has 300MFDs (metres of floppies) of storage!"<br>
    <br>
    "That's nothing. We've just set up our SAN at work, and we have a London-to-Paris worth of storage".<br>
    <br>
    <br>
    Ridding ourselves of the megagigayotta technobabble and embracing units
    of measurement that the layperson can understand is the best thing we
    can do for the industry.<br>
    <br>
    Next up - "Calculations of the nation debt per minute" to make CPU
    speeds make more sense, and "how well you can make out a cow from the
    space station" specifications for digital cameras.<br>
  • Eric the .5b 2005-08-18 11:48
    This is definitely a WTF. It's just a sort of happy, amused "WTF?" as opposed to the shocked, hair-pulling "WTF!" we're used to...
  • emptyset 2005-08-18 12:50
    <P>
    joost:
    </P>
    <P>1 km = 10**3 meter<BR>1 kg = 10**3 gram<BR>1 megaton = 10**6 ton<BR>1 ml = 1/10**3 liter<BR>
    </P>
    <P><FONT face="Courier New" size=2>1 slug = 14.59390 kg</FONT></P>
    <P><FONT face="Courier New" size=2>that's one big slug.</FONT></P>
  • OmnipotentEntity 2005-08-18 12:52
    JThelen:
    Oh, and since I can't edit my posts, apt-get &gt; yum<br>
    <br>
    <br>
    Quoted for truth.<br>
  • CarolSZ 2005-08-18 13:26
    <DIV>This snippet looks buggy to me. It is true that it is hard to hit the bugs during our lifetime even taking into account Moores law. I do not know the language it was written in but:</DIV>
    <DIV>WTF: depth=depth-diff -&gt;why obfuscate the code in such a manner instead of simply saying: depth=len(symbols)-1</DIV>
    <DIV>where, of course, len(symbols)-1 could be a constant</DIV>
    <DIV>Bug: number=number*thresh*depth is wrong. Correct would be: number=number*1024**diff,</DIV>
    <DIV>this assuming in the language this is written ** means integer exponentiation and is implemented fast and accurately unlike FP exponentiation and has a higher precedence than multiplication.</DIV>
    <DIV>It is amazing though that the language this was written in supports integers so big. I think that even 64 bit systems stop at 16exa.</DIV>
    <DIV>&nbsp;</DIV>
  • NancyBoy 2005-08-18 13:58
    "Not accurate" is one way of putting it.&nbsp; "Apocryphal" or "urban legend" are others.
  • JThelen 2005-08-18 14:06
    Anonymous:
    <div>This snippet looks buggy to me. It is true
    that it is hard to hit the bugs during our lifetime even taking into
    account Moores law. I do not know the language it was written in but:</div>
    <div>WTF: depth=depth-diff -&gt;why obfuscate the code in such a manner instead of simply saying: depth=len(symbols)-1</div>
    <div>where, of course, len(symbols)-1 could be a constant</div>
    <div>Bug: number=number*thresh*depth is wrong. Correct would be: number=number*1024**diff,</div>
    <div>this assuming in the language this is written ** means integer
    exponentiation and is implemented fast and accurately unlike FP
    exponentiation and has a higher precedence than multiplication.</div>
    <div>It is amazing though that the language this was written in
    supports integers so big. I think that even 64 bit systems stop at
    16exa.</div>
    <div>&nbsp;</div>
    <br>
    <br>
    I think you, as well as a few others missed the reasoning behind using
    the 'thresh' variable as opposed to hardcoding 1024.&nbsp; YUM isn't
    the only place you'll find that;&nbsp; I'm sure that if you looked at
    apt-get, you'd find it there too, as well as the Windows updater.&nbsp;
    The reasoning is to force it into the next higher measure earlier, so
    that you'll get .90GB as opposed to 1000MB, to use the earlier
    example.&nbsp; You <span style="font-style: italic;">have</span>
    noticed that, right?&nbsp; Well, doing it your way, as well as was
    mentioned in an earlier reply(which you and about 3 others appear to be
    overlooking) will keep that from happening, and won't roll the measure
    over until it's exactly 1.&nbsp; So, in short, it's not a bug, and is
    working as intended. <br>
    <br>
    As an addendum, I've said this before, as have 3-4 other folks.&nbsp;
    This code isn't a WTF in the sense that the board has come to be
    acquainted with.&nbsp; There's nothing wrong with YUM from a design
    standpoint, and I'd imagine the rest of YUM is similarly clean and well
    designed.&nbsp; The WTF here is that they built it all the way to
    yottabytes, which at this time don't really exist.&nbsp; In practice, a
    terabyte is about as large as you'll see in a single storage device,
    and even then, as I'm sure you know, you'll have to set up a rather
    large RAID array to achieve that.&nbsp; Even so, this isn't really a
    WTF in the sense of 'WTF was this moron thinking?'.&nbsp; To me,
    snippets like this that just make you go 'Huh?&nbsp; WTF?' and have a
    good laugh since there's nothing wrong;&nbsp; it's just something put
    in there to get a WTF rise and act as a little bit of a joke are good
    WTFs.&nbsp; And we could certainly use a few more of those around here.<br>
  • Boaz 2005-08-18 14:25
    I just started reading TheDailyWTF, and have been pretty impressed by
    the quality (or lack thereof) of the submissions. When I saw the first
    line of this, though, I went "WTF? yum has a WTF?" The rest was
    reassuring -- it is nice to know that the open-source software that I
    run does not come close to the scariness of the databases, web
    applications, and proprietary in-house apps out there. Maybe it's the
    OPEN SOURCE part of Open Source?<br>
  • neuro 2005-08-18 14:35
    dubwai:
    <p>
    procyon112:
    Very nice.  This programmer takes the "no arbitrary limits" philosophy seriously.  I like it.<br><br>As
    for neccessity:  Moores law, although it doesn't directly apply to
    storage, has shown to parallell storage capacity pretty well as a
    general rule of thumb.  Since 2^10=1024, we can expect to hit the
    next "depth" every 10 Moore's cycles, or 15 years.  I regularly
    deal with terabytes of data now, in 2005.  Using Moore's law as a
    rough guide, I can expect to be dealing with 1000 yottabytes (1
    nonabyte) in 60 Moore's cycles, or approximately 90 years.  So, in
    2085 this software would most likely break occassionally if it had an
    arbitrary limit.  By 2100 I would expect it to break fairly
    regularly.  That is not to say that it won't break eventually, as
    word length seems to grow linearly, but I'd say he bought himself an
    extra 40 years or so with this adjustment.  I would fully trust
    this code to operate until 2115.  It's not THAT far away.<br><br>And
    to put the storage into perspective, 1 yottabyte is about 2 moles of
    bytes, which given 1 molecule per bit storage would fit rather handily
    in something weighing 16-32 grams.  And that is just conventional
    storage.  We haven't even entered the world of overlapping quanta,
    so in reality, these sizes are not unbelievable... I just wouldn't try
    fitting them on a CD-R. :)<br>
    </p>
    <p>Sure, conceptually we could address that much data but having a
    place to put that much data and actually having the data to fill it are
    two completely different matters.</p>
    <br>
    <br>
    hehe, seems like you've never bought a new HDD. give me 1000 yottabytes
    and a month's time, and i'll be back wanting more space :p<br>
  • name 2005-08-18 14:50
    Anonymous:
    Ytram:
    Anonymous:
    Ytram:
    <span id="PostFlatView">I assume you're talking about the nag dialog that pops up after an
    update is completed for Windows.&nbsp; You can increase the nag timer
    or completely disable it if you so choose.<br>
    </span>
    <br><br>Howhowhowhow? I too find that so annoying.<br><br>I
    generally drag it so that it's sitting with just a few pixels of the
    window sitting over the corner of the system tray, the rest off screen,
    but disableing it would be nicer...<br>
    <br>
    <br>
    <p>Start -&gt; Run -&gt; gpedit.msc -&gt; Local Computer Policy -&gt; Computer
    Configuration -&gt; Administrative Templates -&gt; Windows Components -&gt;
    Windows Update -&gt; Re-prompt for restart with scheduled installations.<br>
    </p>
    <p>Credit for this info goes to one of the commentors in this Coding Horror blog post:<br>
    http://www.codinghorror.com/blog/archives/000294.html<br>
    </p>
    <br>
    <br>
    <br>
    LOL - Now that's usability/user friendlyness in only 9+ easy steps ;)<br>
    <br>
    -E<br>
    <br>
    <br>
    <br>

    and not very future-proof either - it'll keep interrupting my workflow every 1440 minutes at best! hell, what kind of number is 1440, anyway?
    <br>
    <img src="http://io.overmind.net/maximum.jpg">
  • dubwai 2005-08-18 15:16
    <P>
    Anonymous:
    <BR>and not very future-proof either - it'll keep interrupting my workflow every 1440 minutes at best! hell, what kind of number is 1440, anyway?
    </P>
    <P>1440 minutes =&nbsp; 24 * 6 = 1 day.</P>
  • dubwai 2005-08-18 15:17
    dubwai:

    <P>
    Anonymous:
    <BR>and not very future-proof either - it'll keep interrupting my workflow every 1440 minutes at best! hell, what kind of number is 1440, anyway?
    </P>
    <P>1440 minutes =&nbsp; 24 * 6 = 1 day.</P>
    <P>
    </P>
    <P>a 0 rolled off the screen and under my desk.</P>
    <P>1440 minutes =&nbsp; 24 * 60 = 1 day.</P>
  • dubwai 2005-08-18 15:18
    <P>
    Anonymous:
    <BR>hehe, seems like you've never bought a new HDD. give me 1000 yottabytes and a month's time, and i'll be back wanting more space :p<BR>
    </P>
    <P>That must be quite a porn collection.</P>
  • allanc 2005-08-18 16:55
    And anyway, 640Yb should be enough for anybody.<br>
  • eagle 2005-08-18 17:11
    JThelen:
    <br>
    <br>
    I think you, as well as a few others missed the reasoning ....<br><br>
    <br>
    <br>
    Dear JThelen, look again.<br>
    <br>
    Let's assume number is initially a Value of 1048576 yottabytes. Now after the loop the variables have these values:<br>
    <br>
    depth = 10<br>
    number = 1<br>
    <br>
    so diff will become 2, which is greater than zero, hence <br>
    <br>
    depth = 8<br>
    number = 1 * ( 999 ** 8 ) = 992027944069944027992001<br>
    <br>
    So the final output will be:<br>
    <br>
    992027944069944027992001 YB<br>
    <br>
    while it should be<br>
    <br>
    1048576 YB<br>
    <br>
    <br>
    Now, is there<br>
    <br>
    [&nbsp; ] no bug&nbsp; (neither thresh/1024 nor depth/diff)<br>
    [&nbsp; ] one bug (either thresh/1024 or depth/diff)<br>
    [&nbsp; ] two bugs (both, thresh/1024 and depth/diff)<br>
    <br>
    cu<br>
  • JThelen 2005-08-18 17:24
    eagle:
    JThelen:
    <br>
    <br>
    I think you, as well as a few others missed the reasoning ....<br><br>
    <br>
    <br>
    Dear JThelen, look again.<br>
    <br>
    Let's assume number is initially a Value of 1048576 yottabytes. Now after the loop the variables have these values:<br>
    <br>
    depth = 10<br>
    number = 1<br>
    <br>
    so diff will become 2, which is greater than zero, hence <br>
    <br>
    depth = 8<br>
    number = 1 * ( 999 ** 8 ) = 992027944069944027992001<br>
    <br>
    So the final output will be:<br>
    <br>
    992027944069944027992001 YB<br>
    <br>
    while it should be<br>
    <br>
    1048576 YB<br>
    <br>
    <br>
    Now, is there<br>
    <br>
    [&nbsp; ] no bug&nbsp; (neither thresh/1024 nor depth/diff)<br>
    [&nbsp; ] one bug (either thresh/1024 or depth/diff)<br>
    [&nbsp; ] two bugs (both, thresh/1024 and depth/diff)<br>
    <br>
    cu<br>
    <br>
    <br>
    And if you'd read the whole post that I was referring to, I wasn't
    addressing that issue.&nbsp; Here it is, since you apparently missed it.<br>
    <br>
    <span id="PostFlatView"><div>This snippet looks buggy to me. It is true
    that it is hard to hit the bugs during our lifetime even taking into
    account Moores law. I do not know the language it was written in but:</div>
    <div>WTF: depth=depth-diff -&gt;why obfuscate the code in such a manner instead of simply saying: depth=len(symbols)-1</div>
    <div>where, of course, len(symbols)-1 could be a constant</div>
    <div>Bug: number=number*thresh*depth is wrong. Correct would be: number=number*1024**diff,</div>
    <div>this assuming in the language this is written ** means integer
    exponentiation and is implemented fast and accurately unlike FP
    exponentiation and has a higher precedence than multiplication.</div>
    <div>It is amazing though that the language this was written in
    supports integers so big. I think that even 64 bit systems stop at
    16exa.</div>
    <div>&nbsp;
    <br>
    <br>
    Now, in the regards that this individual, among others is presenting the 'apparent WTF', it's not.&nbsp; <br>
    <br>
    W/r to what you're talking about, yes, it's likely there's a bug in
    what's there.&nbsp; The real question, IMO, is how much does it
    matter?&nbsp; The developer obviously put this in as an easter egg of
    sorts, and one accessible only to someone looking at the source.<br>
    <br>
    Cheers.<br>
    <br>
    </div></span><br>
  • Jim 2005-08-18 17:24
    This brings up a question that's always bothered me.<br>
    <br>
    Michael wrote:<br>
    <br>
    <span id="_ctl0_PostForm_Reply"><span style="color: rgb(255, 0, 0);">b) who says this is purely for addressing real data?  How
    much data do you need to describe the location of every atom in the
    solar system to within 1mm?  There are plenty of cryptographic
    examples as well.</span><br>
    <br>
    So, a real-world conundrum: there are approximately 10**120 possible
    chess games. There are approximately 10**115 atoms in the universe
    (estimate). Even assuming one could store one chess game per atom,
    we're still short. Who will decide which possible chess games never get
    stored?<br>
    </span>
  • eagle 2005-08-18 17:42
    JThelen:
    <br>
    <br>
    And if you'd read the whole post that I was referring to, I wasn't
    addressing that issue.<br>
    <br>
    <br>
    <br>
    I did, and here is what you wrote<br>
    <br>
    <br>
    <br>
    I think you, as well as a few others missed the reasoning behind using
    the 'thresh' variable as opposed to hardcoding 1024.&nbsp; YUM isn't
    the only place you'll find that;&nbsp; I'm sure that if you looked at
    apt-get, you'd find it there too, as well as the Windows updater.&nbsp;
    The reasoning is to force it into the next higher measure earlier, so
    that you'll get .90GB as opposed to 1000MB, to use the earlier
    example.&nbsp; You have noticed that, right?&nbsp; Well, doing it your
    way, as well as was mentioned in an earlier reply(which you and about 3
    others appear to be overlooking) will keep that from happening, and
    won't roll the measure over until it's exactly 1.&nbsp; So, in short,
    it's not a bug, and is working as intended<br>
    <br>
    <br>
    <br>
    So you talk about rolling over at .9# and that's the cause for using thresh=999. And yes you are right.<br>
    <br>
    Yes, it is ok to compare with thresh in the loop's condition. But in<br>
    <br>
    <br>
    <span id="PostFlatView"><div>This snippet looks buggy to me. It is true
    that it is hard to hit the bugs during our lifetime even taking into
    account Moores law. I do not know the language it was written in but:</div>
    <div>WTF: depth=depth-diff -&gt;why obfuscate the code in such a manner instead of simply saying: depth=len(symbols)-1</div>
    <div>where, of course, len(symbols)-1 could be a constant</div>
    <div>Bug: number=number*thresh*depth is wrong. Correct would be: number=number*1024**diff,</div>
    <div>this assuming in the language this is written ** means integer
    exponentiation and is implemented fast and accurately unlike FP
    exponentiation and has a higher precedence than multiplication.</div>
    <div>It is amazing though that the language this was written in
    supports integers so big. I think that even 64 bit systems stop at
    16exa.</div>
    <div>&nbsp;
    <br>
    <br>
    there is no reference to the loop condition, but to the expression used to convert from wtfbytes back to yottabytes.<br>
    <br>
    And in this expression it is<br>
    <br>
    a) wrong to use thresh=999 instead of 1024<br>
    <br>
    and <br>
    <br>
    b) wrong to use depth instead of diff.<br>
    <br>
    That's the bug pointed out by the other poster, but in your mission to
    educate everybody about why thresh=999 is correct (which nobody
    doubted) you missed that point.<br>
    <br>
    <br>
    <br>
    Now, in the regards that this individual, among others is presenting the 'apparent WTF', it's not.&nbsp; <br>
    <br>
    W/r to what you're talking about, yes, it's likely there's a bug in
    what's there.&nbsp; The real question, IMO, is how much does it
    matter?&nbsp; The developer obviously put this in as an easter egg of
    sorts, and one accessible only to someone looking at the source.<br>
    <br>
    Cheers.<br>
    </div></span><br>
    <br>
    <br>
    I agree.<br>
    <br>
    However, the original code produces always the same output for<br>
    <br>
    1024 yottabytes<br>
    1048576 yottabytes<br>
    1073741824 yottabytes<br>
    ...<br>
    1024**n yottabytes<br>
    <br>
    And that's a WTF, even if it actually is an easter egg.<br>
    <br>
    cu<br>
  • Michael 2005-08-18 19:40
    Yep.  You guys caught me.  There was indeed a bug in the
    code.  It's now fixed in CVS.  Thanks.  This is most
    certainly the strangest bug report I've ever had!  Fortunately, it
    was actually in the code that deals with the >1000 yottabyte case,
    so I rather doubt it ever caused any serious trouble for anyone.<br>
    <br>
    Oh, and I've thoroughly enjoyed this.  I have indeed taken any
    criticism as playful.  I figure if you emerge from here anything
    less than bruised, bloody, and limping, then you should take it as a
    compliment :)<br>
  • eagle 2005-08-18 20:48
    Michael:
    Yep.&nbsp; You guys caught me.&nbsp; There was indeed a bug in the
    code.&nbsp; It's now fixed in CVS.&nbsp; Thanks.
    <br>
    <br>
    And don't forget to change it here also:<br>
    <br>
    http://linux.duke.edu/~mstenner/misc/<br>
    <br>
    <a href="">:D</a><br>
  • Chili Joe 2005-08-18 22:30
    Anonymous:
    Yep.&nbsp; You guys caught me.&nbsp; There was indeed a bug in the
    code.&nbsp; It's now fixed in CVS.&nbsp; Thanks.&nbsp; This is most
    certainly the strangest bug report I've ever had!&nbsp; Fortunately, it
    was actually in the code that deals with the &gt;1000 yottabyte case,
    so I rather doubt it ever caused any serious trouble for anyone.<br>
    <br>
    Oh, and I've thoroughly enjoyed this.&nbsp; I have indeed taken any
    criticism as playful.&nbsp; I figure if you emerge from here anything
    less than bruised, bloody, and limping, then you should take it as a
    compliment :)<br>
    <br>
    <br>
    I wonder what fix you did. I like <span id="PostFlatView">Kannan Goundan's suggestion.<br>
    </span>
  • TheMuuj 2005-08-19 00:54
    Anonymous:
    TheMuuj:
    Or how about the code that bugs you until you reboot, interrupting your
    workflow until you're forced to reboot and take an early break?
    <br>
    <br>
    You know why it does that, right?&nbsp; If you install a security
    update to some piece of code that you're currently using (esp. part of
    the OS), it's not secure until you reboot.&nbsp; (or at least close and
    restart that code, but that's not always enough)&nbsp; Some people
    would install the update and just ignore the request to reboot
    indefinitely.<br>
    <br>
    Personally, I just shove the window off-screen until the end of the day, but it's not just doing that to be annoying.<br>
    <br>
    <br>
    I certainly do understand the implications of <span style="font-weight: bold;">not </span>rebooting,
    but "No means no."&nbsp; I'm not going to be attacked through a
    security hole during the hour I leave the software unpatched, as I
    generally do not even use the software being patched (in this case
    Outlook Express).<br>
    <br>
    If it were software I am actively using, I might save everything and
    reboot, but that's a hassle I do not normally want to deal with.<br>
  • Vasil 2005-08-19 05:48
    This reminds me of a funny situation that I had in my first year at the university.<br>
    <br>
    I think all of you know the classical Tower of Hanoi puzzle. <br>
    If not then check this link http://www.cut-the-knot.org/recurrence/hanoi.shtml.<br>
    <br>
    So a friend of mine showed me how to implement a simple program in
    Paskal that solves the puzzle (at these days I was not very good at
    programming espetially at some "exotic" concepts like recusion :) )<br>
    <br>
    Anyway our major mistake was to make it "user friendly". It prompted for a number of disks before starting moving them. <br>
    <br>
    So we implemented it, saw that it was running and then left. I came
    back in several hours and wanted to see it once again. But when I
    started it, it just dumped something like "Haha, what a stupid program
    it is - it does nothing"<br>
    <br>
    I knew that the only one who could do this was my room mate (only he
    had a key). When I aksed him why he did this he answered me "The
    program was doing nothing but just looping endless. I left it looping
    for hours and then I stopped it."<br>
    Beeing a little surprised to hear that I had a insight and asked him
    how many disks he entered. The answer was devastating: "100. I wanted
    to see how it works with large numbers. You see - you have a bug in
    there - it is just looping ..."<br>
    <br>
    So when I stopped laughing I explained him following;<br>
    The numbe of moves to solve the Tower of Hanoi puzzle is <span style="font-weight: bold;">(2^n) - 1</span> Where <span style="font-weight: bold;">n</span> is the number of the disks. <br>
    So to move 100 disks we need 1267650600228229401496703205375 moves. If
    we had a super PC that makes 1 000 000 000 moves a second (and mine was
    an old 386 and was not doing 2 or 3 per second with the dumps) then
    we'll need about 1267650600228229401496 seconds. Which makes
    21127510003803823358 minutes -> 352125166730063722 hours ->
    14671881947085988 days -> 40196936841331 years which is about 8000
    times more than the life of the solar system and 4000 times more than
    the existence of the whole universe. <br>
    <br>
    Well ... he was right for one thing - the program would be really looping "forever" :).<br>
  • Katja 2005-08-19 08:20
    How long ago was it again that someone claimed that 640 KB would have been more than enough?<br>
    <br>
    And how ago was it that people considered a gigabyte of harddisk space enormous?<br>
    <br>
    Let's see... Ten years ago, a megabyte was big. 5 years ago, a gigabyte
    was big. Nowadays, a terabyte is big. So, considering this pattern, a
    petabyte is big over 5 years. An exabyte in ten years. A zettabyte in
    15 years. A yottabyte in 20 years. But in 25 years, no one will be
    suprised about harddisks of 1000 or more yottabytes... [:D]<br>
    <br>
    So when in 25 years all other applications are crashing because they
    didn't keep these huge sizes in mind, this application will just be
    running perfectly well... [;)]<br>
  • Chris Brien 2005-08-19 09:41
    Magic Duck:
    <P>
    Anonymous:
    Anonymous:
    I believe that a bit does have 10 possible values, namely 0 and 1.<BR><BR>Fun,<BR><BR>Sten<BR>
    Of course, by that logic, one kilobyte, should be 10^3 bytes - ie 8 bytes. </P>
    <P>kilobyte: 10^3 = 8 bytes <BR>megabyte: 10^6 = 64 bytes <BR>.<BR>.<BR>.<BR>vendekabyte: 10^33 = 8,589,934,592 As you can see, current (32-bit) computer systems can address 0.5 vendekabytes. In only a few Moore-times, when we have 128-bit systems, we will be able to address substantially more than a googolbyte.
    </P>
    <P>Either one of 10 cases just happened:</P>
    <P>[*] Someone missed a binary joke or<BR>[*] I missed missed a joke about a binary joke</P>


    Actually, the 100th thing happened - someone made a binary joke, someone else made another binary joke in reference to the original joke, and then someone else missed that joke and tried to make another binary joke about missing a binary joke.

    And finally, the second person made a binary joke about the whole thing. :)
  • Suomynona 2005-08-19 09:46
    Anonymous:
    It's something very small. One molecule of hydrogen per bit would yield about 16 grams.
    <br>
    <br>
    A mole is defined as the number of atoms in 12 grams of carbon-12. So a
    mole of hydrogen molecules has a mass of ca. two grams. At 1 bit per
    molecule, 1000 yottabytes corresponds to ca. 16,060 moles. At 2 grams
    per mole, that's slightly over 32kg of hydrogen.<br>
    <br>
  • dubwai 2005-08-19 09:55
    <P>
    Katja:
    How long ago was it again that someone claimed that 640 KB would have been more than enough?<BR><BR>And how ago was it that people considered a gigabyte of harddisk space enormous?<BR><BR>Let's see... Ten years ago, a megabyte was big. 5 years ago, a gigabyte was big. Nowadays, a terabyte is big. So, considering this pattern, a petabyte is big over 5 years. An exabyte in ten years. A zettabyte in 15 years. A yottabyte in 20 years. But in 25 years, no one will be suprised about harddisks of 1000 or more yottabytes... [:D]<BR><BR>So when in 25 years all other applications are crashing because they didn't keep these huge sizes in mind, this application will just be running perfectly well... [;)]<BR>
    </P>
    <P>It's not neccessarily the case that the previous trend will continue.&nbsp; It reminds we of a Simpson's episode where Disco Stu has a chart of disco record sales up to 1979.&nbsp; Many of the biggest errors are made by preparing for the past.&nbsp; That is, looking at what happened before and assuming it will happen again.</P>
    <P>The reality is that 5 Megabytes was never that much data.&nbsp; There were huge banks of tape drives long ago.&nbsp; In the past we were memory poor.&nbsp; We are reaching a point where graphic resolution is as good as the human eye can appreciate.&nbsp; I bought a 100 GB had drive a while back.&nbsp; I don't expect to fill it up any time soon.&nbsp; When I had a 500 MB harddrive, I had to remove applications in order to install a new one.</P>
  • JThelen 2005-08-19 09:58
    eagle:
    JThelen:
    <br>
    <br>
    And if you'd read the whole post that I was referring to, I wasn't
    addressing that issue.<br>
    <br>
    <br>
    <br>
    I did, and here is what you wrote<br>
    <br>
    <br>
    <br>
    I think you, as well as a few others missed the reasoning behind using
    the 'thresh' variable as opposed to hardcoding 1024.&nbsp; YUM isn't
    the only place you'll find that;&nbsp; I'm sure that if you looked at
    apt-get, you'd find it there too, as well as the Windows updater.&nbsp;
    The reasoning is to force it into the next higher measure earlier, so
    that you'll get .90GB as opposed to 1000MB, to use the earlier
    example.&nbsp; You have noticed that, right?&nbsp; Well, doing it your
    way, as well as was mentioned in an earlier reply(which you and about 3
    others appear to be overlooking) will keep that from happening, and
    won't roll the measure over until it's exactly 1.&nbsp; So, in short,
    it's not a bug, and is working as intended<br>
    <br>
    <br>
    <br>
    So you talk about rolling over at .9# and that's the cause for using thresh=999. And yes you are right.<br>
    <br>
    Yes, it is ok to compare with thresh in the loop's condition. But in<br>
    <br>
    <br>
    <span id="PostFlatView"><div>This snippet looks buggy to me. It is true
    that it is hard to hit the bugs during our lifetime even taking into
    account Moores law. I do not know the language it was written in but:</div>
    <div>WTF: depth=depth-diff -&gt;why obfuscate the code in such a manner instead of simply saying: depth=len(symbols)-1</div>
    <div>where, of course, len(symbols)-1 could be a constant</div>
    <div>Bug: number=number*thresh*depth is wrong. Correct would be: number=number*1024**diff,</div>
    <div>this assuming in the language this is written ** means integer
    exponentiation and is implemented fast and accurately unlike FP
    exponentiation and has a higher precedence than multiplication.</div>
    <div>It is amazing though that the language this was written in
    supports integers so big. I think that even 64 bit systems stop at
    16exa.</div>
    <div>&nbsp;
    <br>
    <br>
    there is no reference to the loop condition, but to the expression used to convert from wtfbytes back to yottabytes.<br>
    <br>
    And in this expression it is<br>
    <br>
    a) wrong to use thresh=999 instead of 1024<br>
    <br>
    and <br>
    <br>
    b) wrong to use depth instead of diff.<br>
    <br>
    That's the bug pointed out by the other poster, but in your mission to
    educate everybody about why thresh=999 is correct (which nobody
    doubted) you missed that point.<br>
    <br>
    <br>
    <br>
    Now, in the regards that this individual, among others is presenting the 'apparent WTF', it's not.&nbsp; <br>
    <br>
    W/r to what you're talking about, yes, it's likely there's a bug in
    what's there.&nbsp; The real question, IMO, is how much does it
    matter?&nbsp; The developer obviously put this in as an easter egg of
    sorts, and one accessible only to someone looking at the source.<br>
    <br>
    Cheers.<br>
    </div></span><br>
    <br>
    <br>
    I agree.<br>
    <br>
    However, the original code produces always the same output for<br>
    <br>
    1024 yottabytes<br>
    1048576 yottabytes<br>
    1073741824 yottabytes<br>
    ...<br>
    1024**n yottabytes<br>
    <br>
    And that's a WTF, even if it actually is an easter egg.<br>
    <br>
    cu<br>
    <br>
    <br>
    Yup, not denying, never have.&nbsp; However, you were the first person
    to actually address that issue;&nbsp; everyone else was talking about
    999 instead of 1024, and why isn't len(symbol)-1 a constant.&nbsp;
    Neither of those things are bugs.<br>
  • dubwai 2005-08-19 09:59
    <P>
    Anonymous:
    Anonymous:
    It's something very small. One molecule of hydrogen per bit would yield about 16 grams.
    <BR><BR>A mole is defined as the number of atoms in 12 grams of carbon-12. So a mole of hydrogen molecules has a mass of ca. two grams. At 1 bit per molecule, 1000 yottabytes corresponds to ca. 16,060 moles. At 2 grams per mole, that's slightly over 32kg of hydrogen.<BR><BR>
    </P>
    <P>I'm not sure why everyone is assuming that we need at least one atom per bit.&nbsp; A qubit (quantum bit) can hold 2 values at the same time.&nbsp; A qubyte can hold 256 values at once.&nbsp; It doesn't take that many qubits to hold 1000 YB worth of data.</P>
  • w-ber 2005-08-19 11:58
    Programs expand to fill the available memory. Period.
  • dubwai 2005-08-19 13:03
    <P>
    Anonymous:
    Programs expand to fill the available memory. Period.
    </P>
    <P>Wow, that was so convincing. I'll have to change my view.&nbsp; 'Period' really was a great way to back-up your assertion.</P>
    <P>Do you think that Pac-Man on the Atari home system had the low grade graphics it did because they had no better ideas?&nbsp; Or do you think that they limited the graphics because of the contraints of the system?&nbsp; The desire for more memory has increased with capacity.&nbsp;&nbsp; The desire was already there, the capacity wasn't.&nbsp; This is why we still have a lot of analog systems that outperform digital systems.&nbsp; Digital systems have a lot of advantages over analog but they've been unable to match what we want.&nbsp; This is starting to change.&nbsp; Digital cameras are now able to meet the needs of what we want, so 35mm cameras are starting to disappear.&nbsp; It's not that the capacity for high resolution came about and then we decided we wanted higher-resolution cameras.&nbsp; The desire was already there and the technology allowed digital cameras to fufill it.</P>
    <P>The point I'm making is not that there's some knowable limit to the need for memory.&nbsp; It's that form follows function.&nbsp; People want more memory and that drives the technology.&nbsp; It's not the other way around.&nbsp; The extra capacity rarely (there are exceptions such as in software development) drives us to want to use it.&nbsp; If storage capacity outpaces our need for more storage, I don't believe that software developers will purposely bloat their programs to fill it (excepting Microsoft, perhaps.)</P>
  • dubwai 2005-08-19 13:46
    <P>
    dubwai:
    The desire for more memory has increased with capacity.&nbsp;&nbsp; The desire was already there, the capacity wasn't.
    </P>
    <P>Lest there be any confusion, the first sentence above should be:</P>
    <P>"The desire for more memory has&nbsp;<STRONG>not</STRONG> increased with capacity"</P>
  • foxyshadis 2005-08-20 06:45
    dubwai:
    <p>
    Anonymous:
    Programs expand to fill the available memory. Period.
    </p><p>The
    point I'm making is not that there's some knowable limit to the need
    for memory.&nbsp; It's that form follows function.&nbsp; People want
    more memory and that drives the technology.&nbsp; It's not the other
    way around.&nbsp; The extra capacity rarely (there are exceptions such
    as in software development) drives us to want to use it.&nbsp; If
    storage capacity outpaces our need for more storage, I don't believe
    that software developers will purposely bloat their programs to fill it
    (excepting Microsoft, perhaps.)</p>
    <br>
    I don't think microsoft intentionally bloats their apps, it's just that
    the office team throws in everything and the kitchen sink for
    marketing, differentiating, or just "well, someone asked" reasons. :p
    The other teams are better about cutting features to make do on
    hardware.<br>
    <br>
    Does anyone have a count of how many times every AOL CD and floppy ever made stacked up would go to the moon and back? =D<br>
  • Elvarg 2005-08-21 02:24
    <P>For comparison, what do you think is the size in bytes of all existing and past recorded digital&nbsp;data (that means ANYTHING that has EVER been saved in binary on an electronic storage medium)? That includes all possible computers, webservers, drives, floppies, CD's, DVD's, all sent e-mail (including all spam), all private network files, all TV signalls that have ever been digitally broadcast, EVERYTHING.</P>
  • Masklinn 2005-08-21 07:59
    Magic Duck:

    <P>
    Anonymous:
    Anonymous:
    I believe that a bit does have 10 possible values, namely 0 and 1.<BR><BR>Fun,<BR><BR>Sten<BR>
    Of course, by that logic, one kilobyte, should be 10^3 bytes - ie 8 bytes. </P>
    <P>kilobyte: 10^3 = 8 bytes <BR>megabyte: 10^6 = 64 bytes <BR>.<BR>.<BR>.<BR>vendekabyte: 10^33 = 8,589,934,592 As you can see, current (32-bit) computer systems can address 0.5 vendekabytes. In only a few Moore-times, when we have 128-bit systems, we will be able to address substantially more than a googolbyte.
    </P>
    <P>Either one of 10 cases just happened:</P>
    <P>[*] Someone missed a binary joke or<BR>[*] I missed missed a joke about a binary joke</P>

    <P>It's choice number 10, you missed a binary joke about a binary joke</P>
    <P>Anonymous wrote the power values as decimal and the powered values as binary, hence writing 2^3 as [0b]10^3, which is why it's 8 and not 1000</P>
  • Elvarg 2005-08-22 01:56
    Anonymous:
    Magic Duck:

    <P>
    Anonymous:
    Anonymous:
    I believe that a bit does have 10 possible values, namely 0 and 1.<BR><BR>Fun,<BR><BR>Sten<BR>
    Of course, by that logic, one kilobyte, should be 10^3 bytes - ie 8 bytes. </P>
    <P>kilobyte: 10^3 = 8 bytes <BR>megabyte: 10^6 = 64 bytes <BR>.<BR>.<BR>.<BR>vendekabyte: 10^33 = 8,589,934,592 As you can see, current (32-bit) computer systems can address 0.5 vendekabytes. In only a few Moore-times, when we have 128-bit systems, we will be able to address substantially more than a googolbyte.
    </P>
    <P>Either one of 10 cases just happened:</P>
    <P>[*] Someone missed a binary joke or<BR>[*] I missed missed a joke about a binary joke</P>

    <P>It's choice number 10, you missed a binary joke about a binary joke</P>
    <P>Anonymous wrote the power values as decimal and the powered values as binary, hence writing 2^3 as [0b]10^3, which is why it's 8 and not 1000</P>
    <P>
    </P>
    <P>Shouldn't he than have written it as 10^100?</P>
  • Elvarg 2005-08-22 01:57
    Elvarg:
    Anonymous:
    Magic Duck:

    <P>
    Anonymous:
    Anonymous:
    I believe that a bit does have 10 possible values, namely 0 and 1.<BR><BR>Fun,<BR><BR>Sten<BR>
    Of course, by that logic, one kilobyte, should be 10^3 bytes - ie 8 bytes. </P>
    <P>kilobyte: 10^3 = 8 bytes <BR>megabyte: 10^6 = 64 bytes <BR>.<BR>.<BR>.<BR>vendekabyte: 10^33 = 8,589,934,592 As you can see, current (32-bit) computer systems can address 0.5 vendekabytes. In only a few Moore-times, when we have 128-bit systems, we will be able to address substantially more than a googolbyte.
    </P>
    <P>Either one of 10 cases just happened:</P>
    <P>[*] Someone missed a binary joke or<BR>[*] I missed missed a joke about a binary joke</P>

    <P>It's choice number 10, you missed a binary joke about a binary joke</P>
    <P>Anonymous wrote the power values as decimal and the powered values as binary, hence writing 2^3 as [0b]10^3, which is why it's 8 and not 1000</P>
    <P>
    </P>
    <P>Shouldn't he than have written it as 10^100?</P>
    <P>
    </P>
    <P>Of course, I mean 10^11</P>
  • tim 2005-08-22 10:47
    richleick:
    I saw this wtf, had a great stack of CD's and yotta yotta yotta, I landed on the moon.<br>
    <br>
    <br>
    <br>
    <br>
    Nice Seinfeld reference.. :)<br>
  • Alex Papadimoulis 2005-08-22 11:40
    <P>
    Anonymous:
    I just started reading TheDailyWTF, and have been pretty impressed by the quality (or lack thereof) of the submissions. When I saw the first line of this, though, I went "WTF? yum has a WTF?" The rest was reassuring -- it is nice to know that the open-source software that I run does not come close to the scariness of the databases, web applications, and proprietary in-house apps out there. Maybe it's the OPEN SOURCE part of Open Source?<BR>
    </P>
    <P>You need to look no further than this&nbsp;forum software to see the typical quality of free open source software. I get quite a lot of submissions from FOSS; heck I'm sure the source code to this software would provide a wealth of goodies.</P>
    <P>No less, I generally don't post submissions from FOSS.&nbsp;I have once or twice, but it's a monumental effort to obfuscate it to&nbsp;be un-googleable. I don't like code that can be publically traced to the original author. </P>
  • frispete 2005-08-23 10:05
    In case, someone is interested in the code,
    here's my little function for that matter:

    def fquant(val, prec = 2):
    """ format data quantities in human readable form """
    v = ('', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y')
    d, i = 1024.0, 0
    while val > d and i < len(v) - 1:
    val /= d
    i += 1
    return '%.*f %sB' % (prec, val, v[i])

    Stopping his at 'T' is just lame, isn't it.
  • frispete 2005-08-23 10:08
    Anonymous:

    val /= d
    i += 1


    These lines need to be intended...
  • rbriem 2005-08-24 14:47
    DZ-Jay:
    Alex Papadimoulis:

    <P>A stack of 3.5" floppy discs with 1,000 yottabytes would be tall enough to make it to the sun. 14 Million times. But still ... just in case ...</P>
    <P>
    <BR><BR>Dude, wouldn't the floppies melt when they get close to the Sun?<BR><BR>&nbsp;&nbsp;&nbsp; dZ.<BR><BR>
    </P>
    <P>That's why we make the stack *at night*.</P>
    <P>Geez.</P>
  • rbriem 2005-08-24 15:02
    <P>
    TheMuuj:
    Furthermore, I wish I could compare the YUM source code to the Windows Udpate code.</P>
    <P>What about the "feature" on Windows Update that causes it to bug me to install the same Outlook Express patch every 30 minutes, even though I've installed it 10 times already, and I don't even use Outlook Express for email anymore!!!<BR><BR>Or how about the code that bugs you until you reboot, interrupting your workflow until you're forced to reboot and take an early break?<BR><BR>Windows Update is a big WTF.&nbsp; My minimal experience with YUM has been quite pleasant, and if I saw an update that was 1000 Yottabytes, I would think twice about downloading it, and then laugh because there's probably an error on the server side.&nbsp; At least the program won't crash.<BR>
    </P>
    <P>I get the&nbsp;Windows Update "Updates are available" notice on my laptop when it hasn't had the wireless card inserted for a week - there's a timer in there! </P>
    <P>"Whoops, it's been a week, the *must* be updates by now!"</P>
    <P>&nbsp;</P>
  • Trond M. 2005-08-25 08:58
    Anonymous:
    <span id="_ctl0_PostForm_Reply"><br>
    let's assume a
    double layer DVD, capable of holding 2* 4.7 GB (2*4.38GiB).<br>
    </span>
    <br>
    <br>
    Dual layer DVDs "only" holds 8.5GB of data. You need double sided, single layer discs to get 2*4.7GB. <br>
    <br>
    <br>
  • Walloon 2005-08-25 12:14
    But is it more than a googol?<br>
  • LucusLoC 2007-09-20 15:03
    dubwai:
    Anonymous:
    Programs expand to fill the available memory. Period.

    Wow, that was so convincing. I'll have to change my view.&nbsp; 'Period' really was a great way to back-up your assertion.
    Do you think that Pac-Man on the Atari home system had the low grade graphics it did because they had no better ideas?&nbsp; Or do you think that they limited the graphics because of the contraints of the system?&nbsp; The desire for more memory has increased with capacity.&nbsp;&nbsp; The desire was already there, the capacity wasn't.&nbsp; This is why we still have a lot of analog systems that outperform digital systems.&nbsp; Digital systems have a lot of advantages over analog but they've been unable to match what we want.&nbsp; This is starting to change.&nbsp; Digital cameras are now able to meet the needs of what we want, so 35mm cameras are starting to disappear.&nbsp; It's not that the capacity for high resolution came about and then we decided we wanted higher-resolution cameras.&nbsp; The desire was already there and the technology allowed digital cameras to fufill it.
    The point I'm making is not that there's some knowable limit to the need for memory.&nbsp; It's that form follows function.&nbsp; People want more memory and that drives the technology.&nbsp; It's not the other way around.&nbsp; The extra capacity rarely (there are exceptions such as in software development) drives us to want to use it.&nbsp; If storage capacity outpaces our need for more storage, I don't believe that software developers will purposely bloat their programs to fill it (excepting Microsoft, perhaps.)



    this tread is 2years old, im posting for the random person who, like me, decided to read to the end of this, just for the hell of it. my 2 cents, 2 years late.


    I agree: memory expands to fit demand, not vice versa. the issue is that demand keeps rising as we relies what can *almost* be done with the current hardware. 2d games were great when they first came out, they were a novelty. then the novelty wore off, and we wanted more. better graphics came next, more detail. then came 3d. then came realistic physics. then came near photo realism. then came destructible environments (some of these are a little out of order, since some of the ideas were developed in parallel with the others) we keep pushing for more "realism," that is, the desire for our dreams and fantasy to more accurately reflect what we are able to experience: the real world. as photos and pictures of the real world approach resolutions that surpass our ability to perceive them (even at magnified zoom levels) desire to have storage space for them will fall. same is true for holligrafic renderings. ditto for 3d polygon recreations. in a fully simulated environment. that is 100% destructible. and rebuild-able. so as we reach the capacity to handle that kind of info, the need for storage for that kind of info will taper off. we don't need atom by atom coordinates for everything, we just need a resolution that makes us believe its real at the scale were looking/feeling it. ergo storage demand is not infinite. its probably just really big.


    but what about fantasy worlds created with that kind of resolution? what if i want to recreate the star wars universe for a game (yes, the whole damned universe, with the plaster on the wall modeled in polygons (not textured) so that when i use the inch high cheat the world seems every bit as believable on that scale as it did on the larger one, and its all free roaming with no load times, and it has to be volumetrically modeled, so that when i _reach through the wall to strangle an evil guard i can feel the coarseness of the brick all the way though_ and is 100% destructible, mine-able/exploitable/reclaimable/rebuild-able with a physics engine that can be modified to fit my whim)? now you need that kind of data set for two universes (the real one and this one). and what about those other game developers who want to develop their own games? how many universes will we need to have storage space for? i hereby, and for the sole benefit of that poor lost sole who actually read to the end of this, propose lucus' law: human imagination is infinite, therefore storage needs are (dun dun dunnnnnn) infinite. period.
  • DonaldK 2010-06-17 10:00
    And now we jump ahead to middle 2010.

    The FIFA world cup is being hosted in here South Africa (gasp...!!), and we all have lotsa yottas on the cellphones in our pockets ...

    No, wait... it's only 32GB on a good day ... the yottas were all burn up during the trip to the sun ...

  • cindy 2011-01-11 08:04
  • TheCPUWizard 2014-08-03 21:16
    I know this is almost a decade old...but kind of relevant today....

    Consider (with an excellent sale) you can get 1TB for under $50 [USD]....My first harddrive [that I used, no owned] was $20K [USD] for a pair of 2.5MB removables...and that is back in 1971 when $20K could easily buy a (pretty darn nice) house..

    Petabyte systems are not uncommon, and datacenters regularly hit multi-exa byte levels of data....

    Is it actually possible that yotta-byte will become relevant in the real world before I pass on?????