• fjf (unregistered)
    Zylon:
    fjf:
    Surprise, software and physical objects are different things.
    Gosh, really? Wow fujufuh, whatever would we do without your keen insight?

    Post silly comparisons like your OP?

  • Zbyszanna (unregistered)

    Rule of thumb: if you need more than 100 labels - you are doing it wrong.

  • jaybird (unregistered) in reply to EmbeddedDork
    EmbeddedDork:
    This is actually standard practice on embedded systems where there is no file system.
    Blah:
    Most likely, the embedded system was never designed to handle more than 100 items. Not a WTF.

    It's been weeks and you're still making snide remarks? I guess your egos may never recover from not knowing how an EPROM is used.

    Boring, and I'm not even an embedded programmer. stfu n00bs.

  • pantsbadger (unregistered) in reply to blakeyrat
    blakeyrat:
    adiener:
    The multiplication by 1 makes it even better.
    Well, it only makes sense that somebody who wrote something like this wouldn't know about casting.
    Multiplication by 1 or adding 0 can return an int or a float depending on the content of the string. Sometimes that's desirable - it's called implicit casting. People who only use strongly types languages tend to be unfamiliar with this technique, but it's a lot nicer than counting the decimal places before casting.
  • pantsbadger (unregistered) in reply to pantsbadger
    pantsbadger:
    blakeyrat:
    adiener:
    The multiplication by 1 makes it even better.
    Well, it only makes sense that somebody who wrote something like this wouldn't know about casting.
    Multiplication by 1 or adding 0 can return an int or a float depending on the content of the string. Sometimes that's desirable - it's called implicit casting. People who only use strongly types languages tend to be unfamiliar with this technique, but it's a lot nicer than counting the decimal places before casting.
    Although there is only one numeric type in javascript, which means that that there's no reason to do it here.

    Well, that was a fail.

  • louisj (unregistered) in reply to Anon
    Anon:
    The obvious solution here would be to use a regular expressions to extract the numeric part.

    and convert it to XML of the output

  • Christopher (unregistered)
    Patrick:
    but the important question is, what happens when it gets ovER NINE THOUSAAAAAND!!!![...]?

    What? Nine thousand!?

  • (cs) in reply to CiH
    CiH:
    Bellinghman:
    ...the '#' has been spuriously added to the report by Mark B, under the impression that one has always to use '#' to warn readers that a number is coming.
    Hey! Here comes an 's.
    Now, now, you wouldn't want Bob getting angry with you.
  • Burpy (unregistered) in reply to Anon
    Anon:
    Coyne:

    Sigh. TRWTF is that people that write this kind of code are usually annoyed when their assumptions are falsified and the program fails. As in, "What do you mean the user added more than 99 labels? Why would they do that?"

    ...and then, more often than not, their proposed "solution" is to limit the number of labels to 99.

    Actually I think their response is most likely to be:

    "But the spec said up to 99 labels!!!"

    Or: "Wasn't specified. How was I supposed to know what 'n' labels was supposed to mean? 's not my job to know..."

  • bvfdshbgmnuyhrd (unregistered) in reply to Zbyszanna
    Zbyszanna:
    Rule of thumb: if you need more than 100 labels - you are doing it wrong.

    More generic rule: if you do something — you are doing it wrong.

  • Helix (unregistered) in reply to jaybird
    jaybird:
    EmbeddedDork:
    This is actually standard practice on embedded systems where there is no file system.
    Blah:
    Most likely, the embedded system was never designed to handle more than 100 items. Not a WTF.

    It's been weeks and you're still making snide remarks? I guess your egos may never recover from not knowing how an EPROM is used.

    Boring, and I'm not even an embedded programmer. stfu n00bs.

    Most embedded products use Nand or Nor flash, not eproms.

  • (cs) in reply to Helix
    Helix:
    jaybird:
    EmbeddedDork:
    This is actually standard practice on embedded systems where there is no file system.
    Blah:
    Most likely, the embedded system was never designed to handle more than 100 items. Not a WTF.

    It's been weeks and you're still making snide remarks? I guess your egos may never recover from not knowing how an EPROM is used.

    Boring, and I'm not even an embedded programmer. stfu n00bs.

    Most embedded products use Nand or Nor flash, not eproms.

    Many use both Flash memory and EEPROMs.

  • Helix (unregistered) in reply to frits

    EEPROM != EPROM

  • (cs) in reply to Helix

    If you're going to nitpick, flash memory doesn't usually replace EPROMs, since EPROMs can be only written once and are much cheaper.

  • (cs) in reply to Burpy
    Burpy:
    Anon:
    Coyne:

    Sigh. TRWTF is that people that write this kind of code are usually annoyed when their assumptions are falsified and the program fails. As in, "What do you mean the user added more than 99 labels? Why would they do that?"

    ...and then, more often than not, their proposed "solution" is to limit the number of labels to 99.

    Actually I think their response is most likely to be:

    "But the spec said up to 99 labels!!!"

    Or: "Wasn't specified. How was I supposed to know what 'n' labels was supposed to mean? 's not my job to know..."

    Q: Well uh, could you tell me what your job is? A: Right now my job is eatin' these doughnuts, or maybe... hey, wait a minute. Aren't you--

  • Cop Killa (unregistered) in reply to bjolling
    bjolling:
    Burpy:
    Anon:
    Coyne:

    Sigh. TRWTF is that people that write this kind of code are usually annoyed when their assumptions are falsified and the program fails. As in, "What do you mean the user added more than 99 labels? Why would they do that?"

    ...and then, more often than not, their proposed "solution" is to limit the number of labels to 99.

    Actually I think their response is most likely to be:

    "But the spec said up to 99 labels!!!"

    Or: "Wasn't specified. How was I supposed to know what 'n' labels was supposed to mean? 's not my job to know..."

    Q: Well uh, could you tell me what your job is? A: Right now my job is eatin' these doughnuts, or maybe... hey, wait a minute. Aren't you--

    Boom! Boom!

    Yep.

  • Helix (unregistered) in reply to frits

    err if you want to call someone a nit picker you should actually check your facts if you do not know them. EPROM can be reprogramed ....err hence the name .... erasable programmable read only memory.

    For cheap applications which only need to be programed once a OTP (one time programmable) technology is used, typically Mask ROM or eFuse. The traditional term for all of these devices is PROM (prgrammable read only memory) and sometimes NVM (non-volatile memory).

  • (cs) in reply to Helix

    I sould have been more specific. EPROMs can't be rewrtitten in the device, they have to be taken out and erased. Still makes them a different application than flash or EEPROM.

  • Helix (unregistered) in reply to frits
    frits:
    I sould have been more specific. EPROMs can't be rewrtitten in the device, they have to be taken out and erased. Still makes them a different application than flash or EEPROM.

    sheesh talk about developer from 1980

    MOST embedded products use Nand or Nor flash, not eproms.

    EPROM is very expensive in power consumption and much smaller sizes then flash. If you still want to take chips out and swap/reprogram then use a EEPROM, it's costs less (no window etc etc)

  • Shane (unregistered) in reply to Anon

    A more generic fix:

    setCount: function(label) {

        var pieces = label.split(' ');
        var count = parseInt(pieces.pop());
        var layer = pieces.join(' ');
    
        if (this[layer] < count) {
                this[layer] = count ;
        }
    

    }

  • vote by populus (unregistered) in reply to Herby
    Herby:
    This reminds me of a word processor for an 8 bit micro I "worked" on. It had a page number register (contained in 8 bits) that would be printed out. They did some work and had a routine that usually did decimal conversions but was limited to 2 digits (8 bits will go to 256). Since they wanted to accomidate numbers over 100, they first compared the number to 100 and if it was over they incremented to 100's digit, and decreased the "left over" by 100, and tried again (it could be 200). This worked OK, but then they sent off the remainder to the two digit converter, which worked quite nice, and if you had a number less than 10, it returned a single digit (can't have leading zeros you know!). The end result was that page numbers would have the sequence: ... 97, 98, 99, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 110, 111. (I suspect that the 200's were similar, but I never had a document that big!). I suspect that they never worried about it, because they never got to documents over 100 pages, but we did!! Oh, well!!

    Do all unreadable comments get tagged as featured comments?

  • iusto mucho gusto (unregistered) in reply to Maboule
    Maboule:
    Randolph Carter:
    Patrick:
    Maybe they should pass the labels through an MD5 generator. Or better yet, use GUIDs.

    Don't leave out the XML. It won't be truly enterprise-grade until there are many multiple levels of transforms and reformatting, with hidden nested schemas and DTDs.

    It was my understanding that a Web Service would be required for enterprise grade.

    Nonono! You need a web engine for enterprise grade. It is a higher level of professionalism to do it while not creating any web service.

  • yep, me too (unregistered) in reply to Cop Killa
    Cop Killa:
    bjolling:
    Burpy:
    Anon:
    Coyne:

    Sigh. TRWTF is that people that write this kind of code are usually annoyed when their assumptions are falsified and the program fails. As in, "What do you mean the user added more than 99 labels? Why would they do that?"

    ...and then, more often than not, their proposed "solution" is to limit the number of labels to 99.

    Actually I think their response is most likely to be:

    "But the spec said up to 99 labels!!!"

    Or: "Wasn't specified. How was I supposed to know what 'n' labels was supposed to mean? 's not my job to know..."

    Q: Well uh, could you tell me what your job is? A: Right now my job is eatin' these doughnuts, or maybe... hey, wait a minute. Aren't you--

    Boom! Boom!

    Yep.

    Which is sadder, making these references or getting them?

  • Nitpicknitpicker (unregistered) in reply to frits

    If you're going to nitpick on someone's nitpicks, you should preautonitpick:

    frits:
    since EPROMs can be only written once

    You're thinking of "PROMs",

    PROM = programmable (once) read-only memory EPROM = erasable (usu. via ultraviolet) programmable read-only memory. EEPROM = electrically-erasable (usu. via elevated voltages) programmable read-only memory

    sheesh. Nitpicking has hit a new low.

  • Andy Holyer (unregistered)

    Similarly, many, many, many years ago I worked on a stock control application which was coded in assembly code on a 6502 system (a PET, actually, though we did at least have floppy drives, rather than the cassette player).

    We had an issue when one of our clients was a quarry, where the minimum quantity they handles was in the range of thousands of tonnes (in fact it may well have been imperial tons in those days actually). The quantities kept overflowing the 16-bit registers in which things were stored.

    We had access to lay out the input and report screens, so in the end I simply put "000" (text) into all the relevant places on the report and data entry forms, and the client went away happy.

  • Gubatron (unregistered) in reply to Anon

    how about using regexps and solving it in a couple lines for all cases

  • xccx (unregistered)

    Dofus Kamas|Prix Moins Cher Dofus Kamas|Kamas par allopass|Dofus kamas audiotel|Dofus kamas par telephone sur Virstock.com

    Meilleur prix www.virstock.com dofus kamas stock de www.virstock.com dofus kamas

    Prix moins cher www.virstock.com dofus kamas vente www.virstock.com dofus kamas sur www.virstock.com

    www.virstock.com/jsp/comments.jsp dofus kamas vente www.virstock.com

  • eric bloedow (unregistered) in reply to Herby

    i saw a similar behavior when i tried to sort a report by page number...it came out, 1,10,11,12,13,14,15,16,17,18,19,2,20,21...i ended up changing the first 10 pages to 01,02,03,etc.

Leave a comment on “Almost Counting Past 100”

Log In or post as a guest

Replying to comment #:

« Return to Article