• Yazeran (unregistered) in reply to maweki
    maweki:

    So where is the Problem? There are two mails sent which were not written yet. I don't see the Problem


    But where do you get an email client that can look far enough into the future to know that you will write 2 emails later in the afternoon but which has to be sent right now??
    I whoud REALLY like one of those.. :-)

    Yours Yazeran

    Plan: To go to Mars one day with a hammer.
  • Pummi (unregistered) in reply to Anonymous

    (moderator's note: changed code section to <pre>)

    Here's one way to do it:

    BITMAPINFO bmiDIB;
    HBITMAP hDIBSection;
    unsigned char *pDrawBuffer;
    HDC hDC;
    
    memset(&bmiDIB,0,sizeof(BITMAPINFO));
    
    bmiDIB.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
    bmiDIB.bmiHeader.biWidth = 320;
    bmiDIB.bmiHeader.biHeight = 0;
    bmiDIB.bmiHeader.biPlanes = 1;
    bmiDIB.bmiHeader.biBitCount = 24;
    bmiDIB.bmiHeader.biCompression = BI_RGB;
    
    hDC=GetDC(NULL);
    
    hDIBSection = CreateDIBSection (hDC, &bmiDIB, DIB_RGB_COLORS,(void**)&pDrawBuffer, NULL, 0);
    
    if(hDIBSection == 0)
    {
        LPVOID lpMsgBuf;
        FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
            NULL,GetLastError(),MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
            (LPTSTR) &lpMsgBuf,0,NULL);
        MessageBox(NULL,(char *)lpMsgBuf,"Error",MB_OK|MB_ICONWARNING);
        LocalFree(lpMsgBuf);
    }
    
  • (cs)

    Hey, I know that Password Manager with the "Never click here" box! In fact, I was told that although it is powered by a software package (IBM's Tivoli Identity Manager), actually setting it up on our system was a custom job and I always thought that if anything was non-standard about it, it was that "Don't click" label.

    So there's the slight chance this is actually the system we use here. Or alternatively, TIM (odd coincidence, unless you chose "Tim" as a pseudonym) was actually shipped with the part German, part English don't-click admonition.

  • anon (unregistered) in reply to capcha=perfection
    Anonymous:
    Anonymous:
    Anonymous:

    Anonymous:
    That or idiots who think checking GetLastError() in the UI thread is a brilliant idea, or using any of the singleton/static variable paradigms to hold on to the message. (It works when run on a single cpu! It must be the customer's imagination!)

    What's wrong with GetLastError() in the UI thread?  Or any thread?  GetLastError() retrieves the per-thread error value.

    And thus checking it for the processing thread's error is a WTF, no? And yet I've seen that done at least twice! (Once by a newbie though, so it doesn't count.)



    While you are speaking English, I do not understand your statement.

    This is simple.

    Process Thread barfs on some error.  It sends a message to the UI thread saying "I barfed all over" and then dies.

    UI Thread receives the message and wants to display an error message.  It then calls GetLastError() to get the last error.

    Oops.  GetLastError() is per-thread, so now the UI has the last error that occured in the UI thread - most likely, "no error", but quite possibly something completely unrelated.

    The user then gets a completely worthless error message informing them that the process failed: success.

    The "it works when run on a single CPU!" statement up there is a WTF of its own, though, since GetLastError is per-thread, and such logic wouldn't work on a single processor just like it wouldn't work on multiple processors.
  • Confused of Birmingham (unregistered) in reply to foxyshadis
    foxyshadis:
    Anonymous:

    What's wrong with GetLastError() in the UI thread?  Or any thread?  GetLastError() retrieves the per-thread error value.

    And thus checking it for the processing thread's error is a WTF, no? And yet I've seen that done at least twice! (Once by a newbie though, so it doesn't count.)

    Ah!  I didn't think anyone could be that retarded.  But what am I saying...

  • (cs)
    Anonymous:
    The 120% Alcohol thing is probably 120% Proof, which is perfectly possible.

    http://en.wikipedia.org/wiki/Proof_%28alcohol%29

    Of course, I only know this because I grew up in Hastings, a well known smuggling town back in the day and you had to smuggle anything that caught fire when mixed with gunpowder (no joke - read the article!) because that was a spirit and therefore taxable.


    While "120% Proof" is certainly possible, strictly speaking that would be 1.2 proof, very weak, not 120 proof, very strong.
  • Loren Pechtel (unregistered) in reply to Xepol
    Xepol:

    Has anyone ever actually seen a Lexmark in service 8 months after installation, let alone 8 years?  I mean, come on, that's gotta be a hoax.

    No way a lexmark survives the first ink cartridge change.  Never seen it happen, ever.  They might as well glue the cartridges right in, who would notice the difference?



    Actually I have actually changed the cartridge on one.  (*NOT* my printer!)  I'd say it's more than 8 months old, also.  It gets *VERY* little use, though.
  • (cs)
    ! a programmer:
    Alex Papadimoulis:

    [image]

     

    4,294,967,294 + 2 = 2^32 = 4,294,967,296...

    Alex Papadimoulis:

    17,179,869,123.89 is kinda sorta close to 2^34=17,179,869,184

    17,179,869,123.89

    +                   68.11

    17,179,869,184=2^34

    so your assumption was spot on.

    ! a programmer:

     
    Alex Papadimoulis:

    and for the threepeat, 7FFF FFFF = 2,147,483,647

    or 2^31 - 1.  your choice.

    do i smell a pattern?

    yes you do...
  • Adder (unregistered)

    Did you also notice RECEIVED is spelt incorrectly?

    I suppose running all error messages thru a spell-checker at run-time would improve the situation ..

  • (cs) in reply to Adder
    Anonymous:
    Did you also notice RECEIVED is spelt incorrectly?

    I suppose running all error messages thru a spell-checker at run-time would improve the situation ..


    Sure... what the world needs most are message boxes like this:


    [image]
  • anonymous (unregistered) in reply to ammoQ

    How to Givin' It 120%

    Create some stats for bugs:

    a) fatal 10
    b) non-fatal 100
    c) non-fatal, or comestic 150
    TOTAL REAL:  160 errors  (yea, some errors are repeated on B and C)
    TOTOL VISIBLE:  260

    you solve all "non-fatal" and comestic errors:

    SOLVED:  250
    REAL ERRORS: 160
    PERFOMANCE: 156 %

  • (cs) in reply to ammoQ

    ammoQ: haha! :)

  • (cs)

    These DailyWTF are my favourite type.... I particularly like the one saying not to click the checkbox ever... so many WTF's within that one screenshot :)

  • (cs)
    Anonymous:
    maweki:
    Alex Papadimoulis:
    I doubt that most of us have the 4,294,967,294 unread messages that Ross Gouldthorpe does, but still, a folder with negative two emails would be a nice relief ...

    [image]

      

    So where is the Problem? There are two mails sent which were not written yet. I don't see the Problem



    Yup.  No problem.  Just a superfast system that sends messages so fast they're gone before you even start to write them.

    How many ghz??


    The best bit is that I now have 2 other folders with -2 and -1 emails in them, you gotta love MS exchange.
    Outside is also just a folder to filter messages that arrive from outside of the company.
  • (cs)
    Anonymous:
    maweki:
    Alex Papadimoulis:
    I doubt that most of us have the 4,294,967,294 unread messages that Ross Gouldthorpe does, but still, a folder with negative two emails would be a nice relief ...

    [image]

      

    So where is the Problem? There are two mails sent which were not written yet. I don't see the Problem



    Yup.  No problem.  Just a superfast system that sends messages so fast they're gone before you even start to write them.

    How many ghz??

    <FONT face=Tahoma>"Hey buddy, you owe me 2 mails and I got 240 mails for ya, of which 4294967294 are still unread..."

    "..."

    "(did I just say that? oops! my bad... it really is hard to be this uber fast...)"



    </FONT>

  • (cs)
    Loren Pechtel:
    maweki:
    Alex Papadimoulis:
    I doubt that most of us have the 4,294,967,294 unread messages that Ross Gouldthorpe does, but still, a folder with negative two emails would be a nice relief ...

    [image]

    So where is the Problem? There are two mails sent which were not written yet. I don't see the Problem
    Yup.  No problem.  Just a superfast system that sends messages so fast they're gone before you even start to write them.

    Not necessarily fast, just clever.  The e-mail client analyzes your e-mail sending patterns and tries to predict which messages you're going to send today.  If you fail to actually type and send a message it has already sent out for you, it will recall that message.

  • foonly (unregistered)

    The Typedef message would make slightly more sense if it had said:

    The TypeDef structure "recieved" does not match the TypeDef structure "received"

    but, oh well,  better to be consistent.

  • (cs)

    Now that's some overclocking! If only Indrek know how he was able to get 20 THz out of his AMD Turion CPU ...

    [image]

      ...it's funny, though, that this still rates a '2' in Vista's performance rating, and yet my computer which is apparently slightly less than 1,000 times slower, rates a 3...Microsoft must really hate AMD..

  • JL (unregistered) in reply to anon
    Anonymous:
    The "it works when run on a single CPU!" statement up there is a WTF of its own, though, since GetLastError is per-thread, and such logic wouldn't work on a single processor just like it wouldn't work on multiple processors.
    The statement doesn't make sense if you connect it with the "GetLastError" problems that the author mentions, but the author also mentions static/singleton errors, which aren't necessarily thread-local and could thus cause the "it works when run on a single CPU" complaint.
  • Worf (unregistered) in reply to Pummi
    Anonymous:
    (moderator's note: changed code section to <pre>)

    Here's one way to do it:
    BITMAPINFO bmiDIB;
    HBITMAP hDIBSection;
    unsigned char *pDrawBuffer;
    HDC hDC;
    
    memset(&bmiDIB,0,sizeof(BITMAPINFO));
    
    bmiDIB.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
    bmiDIB.bmiHeader.biWidth = 320;
    bmiDIB.bmiHeader.biHeight = 0;
    bmiDIB.bmiHeader.biPlanes = 1;
    bmiDIB.bmiHeader.biBitCount = 24;
    bmiDIB.bmiHeader.biCompression = BI_RGB;
    
    hDC=GetDC(NULL);
    
    hDIBSection = CreateDIBSection (hDC, &bmiDIB, DIB_RGB_COLORS,(void**)&pDrawBuffer, NULL, 0);
    
    if(hDIBSection == 0)
    {
        LPVOID lpMsgBuf;
        FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
            NULL,GetLastError(),MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
            (LPTSTR) &lpMsgBuf,0,NULL);
        MessageBox(NULL,(char *)lpMsgBuf,"Error",MB_OK|MB_ICONWARNING);
        LocalFree(lpMsgBuf);
    }
    


    I suppose the WTF there is that FormatMessage requires that many parameters just to convert an error number to a string! There's a lot to be said for the simplicity of strerror()... (which if it is an API call, can return a string pointer to the localized string).

    Or, perhaps even that so much code is needed to display an error message instead of a number. Ugh. I prefer my printout of windows API error numbers...

    captcha: bedtime (?!!?!)
  • (cs)

    I'm always skeptical when things are greater than 100%, but from what Graham shows me here, it looks like Alcohol 120% is really giving it 120% by stuffing all that stuff in eight gigabytes ...

    [image]

    To use a tired cliche, the real WTF here is that there's a program called "Alcohol 120%".  Their website is full of statements like "This is what Alcohol allows you to do and much more."  Ha.

    http://trial.alcohol-soft.com/en/alcohol_info.php

    (my first post, woo)


  • maths?? (unregistered) in reply to Steeldragon

    steeldragon:

    > 17,179,869,123.89

    > +                   68.11

    > 17,179,869,184=2^34

    > so your assumption was spot on.


    what the hell? did you even use a calculator? add those numbers in your head. it's trivial to see that they do NOT add to 184.

  • Anony Moose (unregistered) in reply to anon

    Anonymous:
    The "it works when run on a single CPU!" statement up there is a WTF of its own, though, since GetLastError is per-thread, and such logic wouldn't work on a single processor just like it wouldn't work on multiple processors.

    Only if you're talking about the Microsoft Windows 32 API.

    If some moron uses a similar style with a true global (ie not thread local) variable, then there's a very good chance that the race conditions will work out differently, and it could be either more frequent or only occur on true multi-processor machines.  GetLastError() is only one of many ways this error can occur, even if it's probably more common due to being built into Windows.

    I bet more than a few bugs have been caused by badly re-implementing an idea that made sense 20 years ago but could be replaced with more modern ideas.

  • Arioch (unregistered) in reply to Anony Moose

    O! i'd like to give a link to one russian site. It is dead for about 4 years now, but it used to gather the same kind pictures.

    http://www.marazm.ru/marazm/mar_pics/main_type2.html

    Some of those owuld be hard to understand without some knowledge of Russian. For other ones it would be enough to translate title and comments with something like www.translate.ru An some of the pictures are 100% internationsl, like this one: http://www.marazm.ru/marazm/mar_pics/det765.html :)

  • (cs) in reply to Anonymous
    Anonymous:
    Those are easy to create, though.  It comes from the UNIX errno practice.  Windows does something similar with "getLastError".

    A function will return with either the right data or 0 to indicate an error.  Then you check the last error code to find out what the error was.

    So what happens is something like this:

    setLastError(SUCCESS); // clear the error
    if (doSomething() == 0) {
        // It failed
        showErrorMessage("Operation failed: %s", getLastError());
    }

    All that has to happen is for doSomething() to cause an error and then fail to reset it.  Then when showing the error message, you'll get something like "Operation failed: the operation completed successfully." since the error code was never updated.

    Generally speaking messages like that are bugs in the OS API.  Several Windows API neglect to set an error code on all errors.  Smart programs (or at least ones expecting getLastError to be capable of returning junk) special-case "successful" error codes, changing them to "unknown error" before displaying the message to the user.


    There's the other practice where the return value is always an error code, and any results are written to some memory. But an obvious way to get strange behaviour would be to do something that clears the error (e.g. reading it, or performing another system call).

    "There is no error." sounds like a play on "There is no spoon." to me. Personally, I'd go for "This is not the error you are looking for." which is funnier and probably true : )
  • (cs) in reply to ammoQ
    ammoQ:
    Anonymous:
    Did you also notice RECEIVED is spelt incorrectly?

    I suppose running all error messages thru a spell-checker at run-time would improve the situation ..


    Sure... what the world needs most are message boxes like this:


    [image]



    You missed the extra space before the .!

  • STOGIE (unregistered) in reply to cconroy

    My favorite error ever was in win98...   "Keyboard Error: Press F1 to continue."

  • wolfy (unregistered)

    the email-count of -2 shows a simple way of explaining substraction and negative numbers to the mathematically inept.

    for everything greater zero it's easy: you have got 4 mails in your inbox. if you delete 2, how many are left in your inbox?

    for negative numbers it's harder, but you can use this: you have got 2 mails in your inbox. if you delete 4, how many emails have to arrive so that you've got no email in your inbox? ;o)

    captcha: creative

  • (cs)
  • KittyKatKoder (unregistered) in reply to Str8Line

    I belive this is to combat spam bots, as they check every box to make sure they catch liscence agreements

  • Kir Birger (unregistered)

    puzzle pirates... that % bar happens to read 2^31 - 1 ... curious

Leave a comment on “Pop-up Potpourri: Givin' It 120%”

Log In or post as a guest

Replying to comment #:

« Return to Article