• Cakewalker (unregistered) in reply to Vagary

    Beaten me to it. Just as well, really - I'd read yi-shi to mean ten (yi is one, er is two, san is three, er-shi is twenty, san-shi is thirty but shi by itself is ten, not yi-shi).

  • me (unregistered) in reply to Cakewalker
    Anonymous:
    Beaten me to it. Just as well, really - I'd read yi-shi to mean ten (yi is one, er is two, san is three, er-shi is twenty, san-shi is thirty but shi by itself is ten, not yi-shi).


    as someone posted much earlier, yi shi probably means TEMP.
  • (cs) in reply to me

    I also though first, that yi shi would mean ten, but temp sounds more reasonable. The problem is that both are pronounced the same way (yi1shi2), but are written differently (?? vs ??). If this was Java code, it would be possible to use *any* Unicode characters in the variable names, which might create interesting WTFs. :)

    /*Added by ? W */
    void ?? (int ??)
    {
    int ?? = 0;
    // ?? = 3 /*erase by ? K */
    ?? = 3;
    return;
    }
    (let's hope this works in Community Server)
  • Diep-Vriezer (unregistered)
    Alex Papadimoulis:

    As a programmer for military contractor, Alex didn't quite expect to find this in the code for a weapons launch system ...

    private static final Logger logger 
         = Logger.getLogger("DickBagMcButtMunch");

    I thought it was illegal to use Java in military or real-time applications..?

  • Zarel (unregistered) in reply to me

    Anonymous:
    Anonymous:
    Beaten me to it. Just as well, really - I'd read yi-shi to mean ten (yi is one, er is two, san is three, er-shi is twenty, san-shi is thirty but shi by itself is ten, not yi-shi).


    as someone posted much earlier, yi shi probably means TEMP.

    As a native Chinese speaker, I was puzzled by this for a while. The only common meaning of "yi shi" is ??, which means "meaning". ??, which means "temporary" or "immediately", is a pretty archaic term.

    (ironically, the CAPTCHA for this post is "stfu") 

  • (cs)
    Alex Papadimoulis:

    Brandon strapped on his seatbelt and braced himself. He was prepared for return ...

      ...

    /* Prepare for return. */
    return;
    }

     

     Why are we always preparing? Just go!
     

  • AdT (unregistered) in reply to gl
    cwolves:
    If I actually were to use the language's built in "INFINITY", I would get errors all over the place when I do "Infinity/Infinity" math (I want 1, but get an error).

    Err, whyTF would you divide infinity by infinity and expect a meaningful value? And why would you want to preserve precision when adding finite values to infinity? Infinity plus any finite value is infinity, simple as that. Total loss of precision is not only possible, it's expected. If you use infinity as a substitute for "very large finite value", it does not make any more sense. If you divide one very large finite value by another very large finite value, the correct result could be about any positive value.

    /*Added by Jiang W */

    void ji_suan (int ni_hao)
    {
    int yi_shi = 0;
    // yi_shi = 3 /*erase by Li K */
    yi_shi = 3;
    return;
    }

    Well, if this is Java I guess the "yi_shi = 3;" line is to satisfy the anal javac which hilariously reports variables that aren't used after initialization as freaking errors rather than warnings.

    Anonymous:

    Now this is a real wtf.

    Does anyone think that they can come up with an algorithm that will convert names to 'proper' case?

    DickBag McButtMunch would not like to see his name miscapitalized.

  • AdT (unregistered) in reply to Igor
    Anonymous:
    Nikita Zhuk is definitely a "he", not "she"

    The horror! The horror! The HORROR! Can it be true?

    The prominent cheekbones and jaw. The musculous calves. Please say it's not true, Miss Peta Wilson!

    One moment... Peta Wilson... could that be "Peter, son of William"? Noooooooooooo! Must... fight... the... thought!

    Miss Wilson, if you are reading this... you cannot possibly imagine how we all had hoped that you just might, well, uncross those legs, but now, I never thought I would say this, I beseech you, I beg you: Please, please, please, keep your thighs together! Don't spoil the illusion. Don't destroy all that we ever believed in. Thank you for your compassion!

    Yours truly,
    Alexis

  • Tei (unregistered) in reply to AdT

    Anonymous:
    Anonymous:
    Nikita Zhuk is definitely a "he", not "she"

    Theres a "In Soviet Russia, Nikita is male" joke somewhere.  

     

     

     

     

     

  • ASDF (unregistered) in reply to PlasmaHH
    PlasmaHH:
    Alex Papadimoulis:

    From the Jan-Feb 1982 of Computer Gaming World (as discovered by Jaliya Jayawardena), here's how we used to patch games before that whole Internet thing was around ...

    [image]

    Full Size: https://thedailywtf.com/images/200611/1982_0102_issue2.gif

    I cannot find much of a wtf here. Maybe it should better say IF RG<1 THEN RG=1. Really, preventing div by zero is so often done in a "lets use the smallest value near to 0 that makes sense" way, that even if it is wrong to do so (often enough its not) is not a wtf anymore.

    But some of the others taught me to not drink while reading this site. Anyone knows how to get coke out of a laptops tft and keyboard?

     

    Umm.... I think the WTF is that people used to have to patch programs manually, instead of double clicking on something... 

     

    captcha = clueless 

  • Om (unregistered) in reply to cwolves
    cwolves:

    I'm currently writing an app that, put simply, simulates an electrical diagram.  I have almost the exact same "#define INFINITE 10000" line, except I defined it as 1M.  Put simply, the number represents a resistance and is dropped into a matrix to calculate the voltage at a node.  With a high enough resistance, no electricity goes through the node, due to the other nodes having a resistance of around 10 ohms.  1,000,000 is a high enough number to effectively take the node out of the calculations, but not high enough (>= ~ 1*10^9) to screw up the floating point math so much that the rest of the numbers get thrown off (1000000000000000000+123.456789 = 1000000000000000100).

    If I actually were to use the language's built in "INFINITY", I would get errors all over the place when I do "Infinity/Infinity" math (I want 1, but get an error).  Also, I actually need the extra numbers to be in the matrix, ie I need the number 1,000,015 to have the 15 in it, which Infinity would just drop.

    Well then thats a valid use, but you're using the wrong name.

    You should have called your constant "HUGE_RESISTANCE" instead of "INFINITY" because obviously it isnt actually infinity (use IEEE floating point infinity if you really need true infinity... float inf = 0/0.0f)

  • LUkeRazor (unregistered)
    Alex Papadimoulis:

    Bryan Ross really wanted to make sure that it was not a PostBack ...

    If Not IsPostBack Then
      If Not IsPostBack Then
        LoadReport()
      End If
    End If


    This could feasibly be "correct". IsPostBack could be a function with side affects (since VB6 doesn't require () if there are no params)

    It probably still points to some really lousy code though :-)

    If we knew that they used hungarian variable notation then it would be obvious if it was a function or not

     

     

  • Om (unregistered) in reply to Diep-Vriezer
    Anonymous:
    Alex Papadimoulis:

    As a programmer for military contractor, Alex didn't quite expect to find this in the code for a weapons launch system ...

    private static final Logger logger 
    = Logger.getLogger("DickBagMcButtMunch");

    I thought it was illegal to use Java in military or real-time applications..?

    Yes, it is punishable by death.

    Suffice to say, the programmer who wrote this code is no longer with us... 

  • (cs) in reply to ASDF
    Anonymous:

    Umm.... I think the WTF is that people used to have to patch programs manually, instead of double clicking on something... 

     

    It's hardly a WTF, considering that there's a good chance the computer this program was for didn't even have a mouse.  It's just amusing to think how far we've come since then. 

  • (cs) in reply to iwpg

    You probably used a cassette to store and load the source as well, and it made a sound similar to a fax machine.

     

  • qbolec (unregistered) in reply to iwpg
    iwpg:

    It's hardly a WTF, considering that there's a good chance the computer this program was for didn't even have a mouse. 

    Maybe not a mouse, but I'll bet there was a hamster inside<font size="4">™</font>

  • FIA (unregistered) in reply to Om

    Anonymous:
    Anonymous:

    [Snip] 

    I thought it was illegal to use Java in military or real-time applications..?

    Yes, it is punishable by death.

     Surely it's punishable by non death... of your enemies...

    oh... no... hang on... the JVM's started now.... (Ooooh, there's an update...)

    Right, now it's punishable by death, so long as it doesn't take longer than 3 days as I have to reboot to install this update.

    CAPTCHA=null;

    java.lang.NullPointerException
        at com.thedailywtf.captcha (formsubmission.java:101)
    ...
     

  • Ownage Personified (unregistered) in reply to Om
    Anonymous:
    cwolves:

    I'm currently writing an app that, put simply, simulates an electrical diagram.  I have almost the exact same "#define INFINITE 10000" line, except I defined it as 1M.  Put simply, the number represents a resistance and is dropped into a matrix to calculate the voltage at a node.  With a high enough resistance, no electricity goes through the node, due to the other nodes having a resistance of around 10 ohms.  1,000,000 is a high enough number to effectively take the node out of the calculations, but not high enough (>= ~ 1*10^9) to screw up the floating point math so much that the rest of the numbers get thrown off (1000000000000000000+123.456789 = 1000000000000000100).

    If I actually were to use the language's built in "INFINITY", I would get errors all over the place when I do "Infinity/Infinity" math (I want 1, but get an error).  Also, I actually need the extra numbers to be in the matrix, ie I need the number 1,000,015 to have the 15 in it, which Infinity would just drop.

    Well then thats a valid use, but you're using the wrong name.

    You should have called your constant "HUGE_RESISTANCE" instead of "INFINITY" because obviously it isnt actually infinity (use IEEE floating point infinity if you really need true infinity... float inf = 0/0.0f)

    Actually, 0.0f/0.0f gets you NaN (Not a Number).

    1.f / 0.f is Infinity.

     capthca = clueless, how fitting!

  • (cs) in reply to Dazed

    Even more interesting...  my cousin-in-law is Russian, both he & his daughter are named Nikita. :)  Great stuff!

  • Transcendor (unregistered)

    #define ZERO -1

    That's not funny.

    browse the libmesa example codebase:
     

    #define ZERO 0.00001
    Mesa/src/glu/sgi/libnurbs/internals/slicer.cc<font size="-2"> </font><font size="-1"> - 3 identical</font>
     
     
    and while this makes nearly some kind of sense in its context
    #define ZERO 1.0e-8
    in the gentoo grass codebase is quite a strange sight, even though it's way closer to zero than mesa's ZERO
  • Anonymous (unregistered)
    Alex Papadimoulis:
    function castration($willy) { ... } 

    The WTF here is that castration is being applied to the frank instead of the beans...
     

  • Nikita Zhuk (unregistered) in reply to Solarcanine

    It has been a great fun reading the discussion about my name, and believe me, as I'm living in Finland I face these discussions all the time. So, the prize goes to.... reinis and Solarcanine, for finding my (old and outdated) cs.helsinki.fi pages and finding our that Zhuk == ???. So the correct answer is that Nikita is indeed a male name in Russia and Eastern European countries.

  • jondr (unregistered) in reply to Om
    Anonymous:
    Anonymous:
    Alex Papadimoulis:

    As a programmer for military contractor, Alex didn't quite expect to find this in the code for a weapons launch system ...

    private static final Logger logger 
    = Logger.getLogger("DickBagMcButtMunch");

    I thought it was illegal to use Java in military or real-time applications..?

    Yes, it is punishable by death.

    Suffice to say, the programmer who wrote this code is no longer with us... 

     Yes, He was killed during a live test: Got clobbered during Garbage Collection, waiting for the acquire_target prompt:>

    --

    jondr

  • Luke Dawson (unregistered) in reply to GettinSadda

    GettinSadda:
    Anonymous:
    Hehe... yeah Elton John confused that whole issue when he made a song called 'Nikita' and then filmed the video with a very hot blonde woman. But doesn't everybody know that Elton John is gay? Clearly the song was about a man. Also, Kruschev was a 'Nikita', and he's definitely a man.
    Um, the song is actually about Nikita Kruschev

    Not to mention that Elton John doesn't write lyrics...Bernie Taupin does. 

  • jim (unregistered) in reply to iwpg
    iwpg:
    Alex Papadimoulis:

    Oscar found this during a recent, and apparently much needed, clean up of the codebase for an application. Good for when the number line reverses itself I suppose?

    if (Math.max(1, 2) == 2) return; 

    [snip] 

    I guess in Ryan Patterson's company, use of equipment changes the basic laws of mathematics?

    IF 0 > 0
    BEGIN
    SELECT 'Equipment is in use'
    RETURN
    END

    Maybe both of those were slightly "creative" ways to "temporarily" comment out the block/rest of the function?  Perhaps the JavaScript one already had /* */ comments, so the programmer couldn't have used those (since they don't nest), and maybe that SQL dialect didn't have block comments at all - and both programmers were too lazy to figure out how to make their editors add end-of-line comments to each line (that's not much of an excuse with the SQL one, since it's so short, but that's hardly the worst thing that's ever been on this site).

    Actually, I've used code such as that while developing code. Sometimes I want to get the stored procedure fully written before actually incorporating it into the front end.

    Write the code to handle each result set, and uncomment the code in the stored proc.

    It's also useful for debugging purposes. Have it return something to verify that the asp code is actually hitting the right sql database.

    Generally you don't want to leave that code in after completing it, except for debugging perhaps, but things get missed.

  • DickBagMcButtMunch (unregistered) in reply to A chicken passeth by
    Anonymous:

    Translation (programmer names omitted):

     void calculate (int hi_there)

    {

        int meaning = 0

        //meaning = 3 /* erased by .. */ 

        meaning = 3

        return

    }

    ...this looks like someone coding in Java for the first time or is trying out something, and is a function that does nothing (after all, it returns nothing despite it being void - god knows why it doesn't generate a compiler error).

     

    wow! you created your very own WTF there. the definition of a void function is that it returns nothing. so it shouldn't yield a compiler error because "it returns nothing despite it being a void" 

    the "IF 0 > 0" thing is probably some weird kind of commenting.. probably was something like "IF RunningProcesses > 0" and then got changed to never produce that error without removing the code so you can still easily re-enable it.

    DickBagMcButtMunch signing off...

     

  • (cs)
    IF 0 > 0
    BEGIN
      SELECT 'Equipment is in use'
      RETURN
    END
    That line almost killed me!
  • James (unregistered) in reply to iwpg
    iwpg:
    Alex Papadimoulis:

    Oscar found this during a recent, and apparently much needed, clean up of the codebase for an application. Good for when the number line reverses itself I suppose?

    if (Math.max(1, 2) == 2) return; 

    [snip] 

    I guess in Ryan Patterson's company, use of equipment changes the basic laws of mathematics?

    IF 0 > 0
    BEGIN
    SELECT 'Equipment is in use'
    RETURN
    END

    Maybe both of those were slightly "creative" ways to "temporarily" comment out the block/rest of the function?  Perhaps the JavaScript one already had /* */ comments, so the programmer couldn't have used those (since they don't nest), and maybe that SQL dialect didn't have block comments at all - and both programmers were too lazy to figure out how to make their editors add end-of-line comments to each line (that's not much of an excuse with the SQL one, since it's so short, but that's hardly the worst thing that's ever been on this site).

     

    I agree.  I just reivewed some code here that looked like:

     

    foo(); 

    #if 0

    /* Lots of debug output

    */

    #endif

    bar();

     

    I guess that's better than trying to block-comment, if you already have block-comment comments inilne with your code...

     

    Bonus: CAPTCHA is "random".  Heh. 

  • (cs) in reply to Nikita Zhuk

    Anonymous:
    It has been a great fun reading the discussion about my name, and believe me, as I'm living in Finland I face these discussions all the time. So, the prize goes to.... reinis and Solarcanine, for finding my (old and outdated) cs.helsinki.fi pages and finding our that Zhuk == ???. So the correct answer is that Nikita is indeed a male name in Russia and Eastern European countries.

    Someone said that was an ugly woman.  I don't know about that, but you're not a bad-looking man!

  • mariush (unregistered) in reply to yazow
    Anonymous:
    Alex Papadimoulis:

    From A, I guess this just gives a whole new meaning to "Infinity Plus One" ...

    #define INFINITE	10000

     

    Not a WTF at all. Let say you are writing a simple router or something, you need some value that is agreed as "infinite" that can be counted up to for the max delay (that is smaller than the max of whatever data type you are using). Without the rest of the code it's hard to say it is a wtf when it is out of context. The one after baffles me though.. I can't think of a single time when I'd want ZERO to be -1.

     

    In some programming languges , Boolean's False is -1 and True is 0 , on other languages Boolean's False is 0 and True is 1.

    A lot of API functions return -1 when error found , other return 0, most return a positive value if no errors occured.

    It's a stupid way to write it though .. however, you should check the source code of various Linux application and see defines for various platforms ..     

    captcha : wtf

     

  • Jez (unregistered) in reply to Element

    Well I've never heard of an Indian called Nikita in my life, nor the surname Zhuk, and I live there.

    Anyway, it's a man: http://nikitazhuk.net/blog/
     

  • sla (unregistered)

    Bryan Ross really wanted to make sure that it was not a PostBack ...
    If Not IsPostBack Then
    If Not IsPostBack Then
    LoadReport()
    End If
    End If

    This is correct and can be used in microcontroller soft, for example, to double check of data bus with high electrical noise level.

  • annoynimous (unregistered)
    Alex Papadimoulis:
    Nikita Zhuk thought ... when <stron>she came

    "?????? ???" is a male name :-(

  • Kodt (unregistered)

    Alex Papadimoulis:

    Nikita Zhuk thought there might be a deeper, more fundamental lack of understanding when she came across this question posted on Experts Exchange ...

    WTF, oh sorry, BTW, Nikita is a Russian man's name. Particularly with Russian surname.
    Don't tell me about 'La femme Nikita' movie: it's an intrigue of enemies :))

  • annoynimous (unregistered) in reply to Kodt

    yet afterall, would we assume that the told function castration($willy) { ... } was used over Nikita, then we would have no controversion there.

    BTW, "Zhuk" stands for "beetle" in slav languages. That is not "bug" yet, but somewhere near :-)

  • ulmo (unregistered)

    The "prepare for return" made me laugh for 2 weeks .. the funniest comment in a code piece ever seen. Thank you so much for submitting this little piece of fun

Leave a comment on “Coded Smorgasbord: Prepare For Return”

Log In or post as a guest

Replying to comment #:

« Return to Article