• (cs) in reply to APH
    APH:
    I remember my Operating Systems instructor was always careful when he spoke about Unix. "Forking Children" was a particularly difficult subject.
    It didn't occur to him to say "Spawning children", I guess.
  • (cs)

    Back during the dot.com boom I wrote a program for a search system, which added search terms to a list that would then be used by the next pass of an indexer. Each of the load balanced servers produced one of these lists, which were periodically locked by my program, sorted, had the duplicates removed, the results sent to the indexer and the file truncated back to zero before the lock was released. The trouble started when I noticed that the files had a "dic" extension.

    Removing a file from service was accomplished by withdraw_dic(). The duplicates were then sorted to the top of the list - this was not the most efficient algorithm, but allowed me to then remove the duplicates with clean_tip_of_dic(). Putting the file back into service, rather than just junking the file once I was done, was accomplished by reinsert_dic().

  • (cs) in reply to Not Wtf
    Not Wtf:
    These stories are pants.

    Some of them are. At least one of them is a three-piece suit.

  • (cs) in reply to java.lang.Chris;
    java.lang.Chris;:
    Back during the dot.com boom I wrote a program for a search system, which added search terms to a list that would then be used by the next pass of an indexer. Each of the load balanced servers produced one of these lists, which were periodically locked by my program, sorted, had the duplicates removed, the results sent to the indexer and the file truncated back to zero before the lock was released. The trouble started when I noticed that the files had a "dic" extension.

    Removing a file from service was accomplished by withdraw_dic(). The duplicates were then sorted to the top of the list - this was not the most efficient algorithm, but allowed me to then remove the duplicates with clean_tip_of_dic(). Putting the file back into service, rather than just junking the file once I was done, was accomplished by reinsert_dic().

    You needed a routine that scanned these files for viruses: "disinfect_dic".
  • Some Jerk (unregistered)

    LOL... KillAllChildren does nothing... and I am utterly amazed that this went unnoticed. That by itself is a WTF. If it did what the programmer intended... then it would create a collection of null references. That would be sooooooo much better!

    capcha: aptent (a new microsoft objects that let your applications sleep peacefully under the stars, only $99 USD or $139 in Canada)

  • Anders Wegge Keller (unregistered)

    OBKillTheChildren

    In the codebase I maintain, there is a generalized TCP transport manager. I'ts pretty simple, with a master thread, that communicates with the rest of the system, and two threads for reading and writing. Now, the funny thing is one of the debug messages:

    Parent finish killing children, now comitting suicide.

  • Patrick (unregistered)

    That KillTheChildren sub does nothing. It's setting a variable to an item in the collection, then setting it to nothing, leaving the original item untouched. He may as well be counting to ten through a for-loop and then setting the value back to zero again on the very next line.

  • (cs) in reply to Fra Diavolo
    Fra Diavolo:
    What really mystify me is that GUID 1 and 7 are the same...
    Aha, you've just fallen victim to the cleverness of the schema. They are in fact Unicode GUIDs, and you've merely been tricked by the font using the same glyphs for 'E' and 'E'.

    (After all, 128 bits would never be enough to enumerate all our employees.)

  • (cs)
    Jonathan:
    (Condensed for your sanity.)

    C'mon! I want to see all 36 levels! I want to have the same awful experience as the OP! The more my head hurts the bigger the WTF!

  • IV (unregistered)

    All of these comments about language that appears innapropriate out of context, and no one has yet mentioned the classic OOP one - public and private parts. Certainly a fun conversation to have with a small group in an area with multidisciplinary eavesdroppers.

  • Da' Man (unregistered)
    Function KillRetardedProgrammers(&p)
    Dim CodeCollection = p->EnumerateCodeSnippets()
    For Each snippet in CodeCollection
      If (getMaximumNestingLevels(snippet)>kMaxSensibleDepth) then
        SendNotice(p)
        Exit
      End If
    Next
    End Function
    
  • (cs)

    Yep, AFAIK, KillAllChildren does nothing more than waste resources...

    The m in mcolItems suggests to me that it is in fact a property of a class (i.e. not global) because in college our VB.NET textbook used a similar naming scheme. IIRC, the 'm' stood for "module scope" and was used for class members.

    AFAIK, VB6 and all variants (VBA, VBScript, etc.) don't support "short circuiting" so if you had a logical expression with 20 operations they would all be evaluated, even if the result was determined by the first. So the second snippet might be an example of premature "optimization"... VB.NET added special operators that do short circuit instead of just making the regular operators short circuit (you know, in case you want to waste cycles) so if the programmer wasn't aware of the alternative operators he might have still thought of it as an "optimization". Whether those values should have all been stored in a single variable depends on the application, but I think it's still safe to assume there was a much better way. :P

  • Nodody (unregistered)

    The KillTheChildren function really begs for a comment with a quote from A Modest Proposal.

  • Steve (unregistered) in reply to Steve
    Steve:
    Konstantin Guryanov:
    Yeah. KillTheChildren is awesome. However a friend of mine has a favorite functionnam ehe uses in many projects he supports. The name is KillKenny.
    Does it have a return value of three cats?
    I mean two cats.

    I give up. My brain has finally completely turned to mush.

    Alzheimer's, here I come.

  • Peej (unregistered)

    A long long time ago (the code was on a PDP-11, it was that long ago), I was going through some code written by a coworker and found a routine called "birth()". Intrigued, I took a look, and saw the comment

    /* Birth - prevents abortion */

  • (cs)

    I am aware of one company that arbitrarily changes one character of their product's GUID with each release, rather than generating a new one. So whereas a new GUID would be guaranteed uniqueness (uniquity?), that group is settling for a small but unknown chance of conflict.

    I can understand that when something takes a lot of work, but generating a GUID? I just checked; it's all of four mouse clicks. Why would you accept ANY chance of an undoubtedly hard-to-identify bug to avoid four mouse clicks a month?

  • (cs)

    I wrote a letter to my grandma on my TRS-80 Model 100 computer. It allowed six-letter file names so I named the file "grandma". When I went to delete the file, I had to type "kill grandma".

  • J (unregistered) in reply to Simon

    Yes, you are correct.

    All KillTheChildren does is waste time.

  • Filini (unregistered)

    A common GUID generator would not create GUIDs so similar to each other, even with a short time difference.

    On the other hand, a Sequential GUID generator creates GUIDs similar to each other on purpose (sorting, indexing...).

    The non-hex characters are cute, though :)

  • (cs) in reply to glassx
    glassx:
    The GUID idea is more common than we think.

    So, it is more common than you think, you think?

  • J (unregistered)

    Traditionally, GUIDS tend not to include 'Q' 'T' 'N' etc....

  • Worf (unregistered) in reply to xorsyst
    xorsyst:
    Try getting new GUIDs using SQL server 2000 - they will be that close together. It uses the MAC address followed by the timestamp (or something like that).

    Except in GUIDs that use a timestamp, there are two fields - one is the timestamp itself, which is based on the number of 100ns periods that have elapsed (yes, 100 nanosecond periods). And just in case you had a fast machine, there's a small counter that resets every 100ns and increments per-GUID so if you manage to generate two in 100ns, they'd still be unique. (Yes, you can temporarily run out of GUIDs if you try to make enough in 100ns to overflow the counter).

  • jmucchiello (unregistered)

    Where's the short version?

    If blnContinue and CreateConnection and DeleteData and CreateLocations and SaveServiceProviders and LoadServiceProviders and LoadCategoryNames and LoadFiveServiceProviders and CalculateAllActivations and UpgradesCalcNoExchange and UpgradesCalcExchangeReturns Then ' (25 more levels here) End If

    Look at all the space saved!

  • (cs) in reply to Richard
    Richard:
    We had a process in our logistics product, years ago, that was called "Batch order maintenance." The second part of it became "Batch Order Maintenance - B" or "The Bomb."

    Tons of fun until our CEO got detained in an airport (pre 9/11) for discussing it over the phone, and one of our services guys left a voicemail on an old woman's phone (mis-dialed and skipped the outgoing message) about "... getting the bomb queued up to go in Orlando." Actually brought us a visit from the FBI. After that, we all agreed to stop using the term.

    Still makes me chuckle, though.

    Captcha: laoreet

    You including your captcha makes me not like your story.

  • sf (unregistered)

    Could have been worse:

    Public Sub KillTheChildrenWhileTheySleep()
    
  • (cs) in reply to drach
    drach:
    Yazeran:
    Fra Diavolo:
    What really mystify me is that GUID 1 and 7 are the same...

    Shouldn't it be a Key??

    Yea I noticed that too.. makes them not quite so unique eh? :-)

    Yours Yazeran.

    The saddest part to me is seeing just how far down I had to read to find someone else spotted it also. Perhaps these are records related to employees from some other table besides the master employee lookup table?
    So the tenth comment is far down?

  • (cs) in reply to Mike Dimmick
    Mike Dimmick:
    Aaron:
    xorsyst:
    Try getting new GUIDs using SQL server 2000 - they will be that close together. It uses the MAC address followed by the timestamp (or something like that).
    Maybe you should actually test your theories before posting them.

    Up until Windows 2000, the UuidCreate API used the GUID v1 as specified in RFC 4122. That has a timestamp and uses one of the computer's network card's MAC address. There were privacy concerns surrounding the use of this MAC address. From Windows 2000 onward they changed to use the random number generation system (version 4 GUID) in section 4.4. The old algorithm is still available by calling UuidCreateSequential.

    Perhaps xorsyst is running SQL Server 2000 on NT 4.0?

    Yes, and with the 30-hexadecimal extension loaded, apparently.

  • gregmac (unregistered)

    the nested if's are likely an offshoot of old VB code.. in VB "and", unlike in almost every other modern language, is not short-circuited. That is, if you do:

    If Foo() and Bar() Then ... End If

    Where Foo() and Bar() both return booleans, even if Foo() returns false (thus it doesn't matter what Bar() returns, the statement will never evaluate to True), Bar() will also execute.

    "Or" works the same way - if you have (Foo() Or Bar()) even if Foo() returns true (again, it doesn't matter what Bar() returns, the statement evaluates to true) it will run Bar() anyways.

    They do have a way around this: "AndAlso" and "OrElse". OrElse you can just use a crazy set of nested ifs, AndAlso get yourself on thedailywtf..

  • (cs)

    All this talk about functions like KillTheChildren() and disinfect_dic() prompted me to dig up my source code for the first game I tried to make 10 years ago, called "Splatter Mario". It's VB6, with DirectX, and naturally full of WTFs with function names including:

    MakeSomeLists()
    AlignThemWindows()
    MakeADreamReal()
    GetSourceRectUsingTexturePropertiesAndWhatNot(...)
    MonsterPlayTime()
    RemoveDudesFarAway()
    HashPipe(Optional DoesntNeedToBeOnFloor As Boolean)
    LettingGo()
    MafiaBump()
    StarryEyes()
    SuddenRemoval()
    Bleed()
    RemoveBlood()
    OccupiedByBlood(Optional keepGoing As Boolean)

    Made me laugh, anyway. I'll leave you with this horrible yet poetic function used in many places throughout the source code:

    Private Function Sluck(Strap As String, Sleng As Integer)
        If Len(Strap) < Sleng Then
            Slice = ""
            Exit Function
        End If
        Slice = Left(Strap, Sleng)
        Sluck = Right(Strap, Len(Strap) - Sleng)
    End Function
  • I don't feel like logging in (unregistered) in reply to jmucchiello
    jmucchiello:
    Where's the short version?

    If blnContinue and CreateConnection and DeleteData and CreateLocations and SaveServiceProviders and LoadServiceProviders and LoadCategoryNames and LoadFiveServiceProviders and CalculateAllActivations and UpgradesCalcNoExchange and UpgradesCalcExchangeReturns Then ' (25 more levels here) End If

    Look at all the space saved!

    IIRC, VB doesn't do lazy evaluation.

  • PublicLurker (unregistered) in reply to ha
    ha:
    I have used phrases about killing the children a few times while solving mathematical problems in graph theory about trees. I stopped do so when my friend noticed that we are talking quite loudly about this on the street and others can hear us.

    Our product managers had to come up with a new term for "Bill Of Materials" when talking about what will go into our shrink wrapped boxes. For some reason talking about a BOM in public attracts a lot of attention.

  • (cs) in reply to newfweiler
    newfweiler:
    I wrote a letter to my grandma on my TRS-80 Model 100 computer. It allowed six-letter file names so I named the file "grandma". When I went to delete the file, I had to type "kill grandma".
    "Grandma"? Instant 6-letter FAIL...
  • Dekker3D (unregistered) in reply to IV
    IV:
    All of these comments about language that appears innapropriate out of context, and no one has yet mentioned the classic OOP one - public and private parts. Certainly a fun conversation to have with a small group in an area with multidisciplinary eavesdroppers.

    yup. but why did you forget to mention that a class' friends have access to it's private bits?

  • Shinobu (unregistered)
    Select Case False
    Case blnContinue, CreateConnection, DeleteData, CreateLocations, SaveServiceProviders, LoadServiceProviders, LoadCategoryNames, LoadFiveServiceProviders, CalculateAllActivations, UpgradesCalcNoExchange, UpgradesCalcExchangeReturns '25 more items here
    Case Else
        DoStuff
    End Select
    Who said Visual Basic doesn't do short circuiting?
  • (cs) in reply to CDarklock
    CDarklock:
    I am aware of one company that arbitrarily changes one character of their product's GUID with each release, rather than generating a new one. So whereas a new GUID would be guaranteed uniqueness (uniquity?), that group is settling for a small but unknown chance of conflict.

    I can understand that when something takes a lot of work, but generating a GUID? I just checked; it's all of four mouse clicks. Why would you accept ANY chance of an undoubtedly hard-to-identify bug to avoid four mouse clicks a month?

    You do realize that if you use Guidgen, you aren't guaranteed to generate a globally unique ID? Not to mention someone could maliciously use your GUID as their own.

  • slapout (unregistered)

    if guidInUse(8B6AA623-F413-4A93-8703-4D76996E632E) then if guidInUse(8B6AA623-F413-4A93-8703-4D76996E632Q) then if guidInUse(8B6AA623-F413-4A93-8703-4D76996E631E) then if guidInUse(8B6AA623-F413-4A93-8703-4D76996E632O) then if guidInUse(8B6AA623-F413-4A93-8703-4D76996E632T) then //What was I suppose to do here? end if end if end if end if end if

  • pie (unregistered) in reply to newfweiler

    if Bored then if AtComputer then if InternetWorking then if TheDailyWTF then if NewArticle then if AnythingToSay then '...25 more levels here... PostComment("captcha", "feugiat") end if end if end if end if end if end if

    newfweiler:
    I wrote a letter to my grandma on my TRS-80 Model 100 computer. It allowed six-letter file names so I named the file "grandma". When I went to delete the file, I had to type "kill grandma".
  • Jake (unregistered)

    The WTF here is a lack of knowlege of SQL Server by the operators of this site.

    NEWSEQUENTIALID() is built in to sqlserver and causes new sequential GUIDs to be created. This is used when the privacy of the GUID is not an issue and improves perforamnce when GUID is being used in an index.

    http://msdn.microsoft.com/en-us/library/ms189786.aspx

  • (cs) in reply to Mike Dimmick
    Mike Dimmick:
    Up until Windows 2000, the UuidCreate API used the GUID v1 as specified in RFC 4122. That has a timestamp and uses one of the computer's network card's MAC address. There were privacy concerns surrounding the use of this MAC address. From Windows 2000 onward they changed to use the random number generation system (version 4 GUID) in section 4.4. The old algorithm is still available by calling UuidCreateSequential.
    Yes, this is all true, but (a) it has almost nothing to do with SQL Server, and (b) the NT 4 system did not generate duplicate IDs or IDs ending with the letters "N" and "Q". So for someone to suggest that the IDs in that screen shot could possibly have been generated by SQL Server 2000 is, well...
  • (cs) in reply to Jake
    Jake:
    The WTF here is a lack of knowlege of SQL Server by the operators of this site.

    NEWSEQUENTIALID() is built in to sqlserver and causes new sequential GUIDs to be created. This is used when the privacy of the GUID is not an issue and improves perforamnce when GUID is being used in an index.

    http://msdn.microsoft.com/en-us/library/ms189786.aspx

    See above reply.

  • Ahox (unregistered)

    And this, ladies and gents, is why GOTO's are so important to teach at college.

    If not blnContinue GOTO 1 If not CreateConnection GOTO 1 If not DeleteData GOTO 1 If not CreateLocations GOTO 1 If not SaveServiceProviders GOTO 1 If not LoadServiceProviders GOTO 1 If not LoadCategoryNames GOTO 1 If not LoadFiveServiceProviders GOTO 1 If not CalculateAllActivations GOTO 1 If not UpgradesCalcNoExchange GOTO 1 If not UpgradesCalcExchangeReturns GOTO 1 call comment("The importance of GOTO's") 1:

    Todays kids don't even know about all the powerful programming techniques anymore. How sad.

  • Sigivald (unregistered) in reply to Jim
    Jim:
    And we must abide by your ID conventions because?

    Because GUID is a type defined in RFC 4122 (actually UUID, which GUID is an implementation of)?

    It's like asking why an integer can't contain ".5" or a decimal can't contain "j".

    "Because then it's not an integer, a decimal, or a GUID."

    Nobody says you have to use GUIDs - by all means, you can make some looks-like-a-GUID-at-a-glance-but-isn't format.

    But you shouldn't call it a GUID, precisely because it isn't one and if you (or, worse, some other poor bastard) later try to treat it as one, it'll bite you. Hard.

    (Think of the fun a later programmer will have trying to cast those non-GUID values to a GUID type (or use them in a constructor).)

  • Ben (unregistered)

    One of my favorite function names I ever got to use (at least in a way that actually described its operation) was ReapZombieChildren.

  • Jake (unregistered) in reply to Aaron

    Aaron, the WTF isn't the exact contents of the GUIDs, those were probably manually changed to protect privacy, and probably by someone who didn't really understand what a GUID was. In both the name of the post and the comments in the post, the claimed problem was the sequential nature of the GUIDs. I'm saying that creation of sequential GUIDs are is a feature built in to SQL Server and used for valid reasons.

  • http://109.livejournal.com (unregistered)

    author must die

  • Access boy (unregistered)
    I don't want to point any fingers at any one so I'll just quote:
    KillAllChildren does nothing
       For Each objIntegrationAccount In mcolItems
          Set objIntegrationAccount = Nothing
       Next
    

    mcolItems is not defined in the code snippet. From the code we can see that m_col_Items is a Collection of Items. Each object in that collection is set to Nothing. So we start with a collection like this:

       {
         object1 is fred
         object2 is jane
       }
    

    and we finish with a collection like this

       {
         object1 is nothing
         object2 is nothing
       }
    

    or like this

       {
       }
    

    (I make no assumptions about the what a collection is or how it works)

    There is an extra line at the bottom of the routine:

       Set objIntegrationAccount = Nothing
    

    This is a WTF. It indicates that the original author is a C code weaner (I must always set my objects to nothing) or an ASP code weaner (I must always set my objects to nothing), or has simply learned his coding from documentation code snippets (I must always set my objects to nothing).

    Or, to be generous, perhaps it was just an A/R coding standard which insisted (You must always set your objects to nothing).

    Maybe a policy like that is sensible if there are a lot of coders out there who can't read even a simple 3 line code snippet without an egregious misunderstanding.

  • Fred (unregistered) in reply to xtremezone
    xtremezone:
    AFAIK, VB6 and all variants (VBA, VBScript, etc.) don't support "short circuiting" way.

    "The fault, dear Brutus, is not in our stars," [Julius Caesar(I, ii, 139)]

    "Our remedies oft in ourselves do lie, Which we ascribe to Heaven." [All's Well That Ends Well (I, i, 231-232)]

  • twoja stara (unregistered)

    Looks like someone f*cked UUID three times over. Give it some Q's and some J's, why not?

  • da leet (unregistered)

    Now that's some bad-ass VBScript

  • (cs) in reply to CDarklock
    CDarklock:
    I am aware of one company that arbitrarily changes one character of their product's GUID with each release, rather than generating a new one. So whereas a new GUID would be guaranteed uniqueness (uniquity?), that group is settling for a small but unknown chance of conflict.
    Actually, a properly generated GUID isn't guaranteed to be unique either.

    As long as the first GUID they started the sequence with was properly generated, simply incrementing from there doesn't strike me as particularly increasing the chance of a conflict.

    Addendum (2008-11-01 00:42): (Well, okay, I suppose it does reduce the randomness by a factor of 16 or 256, since you're essentially removing the randomness of the last one or two digits, but that doesn't seem like a big deal when you're dealing with a range of 340282366920938463463374607431768211456.)

Leave a comment on “One In 3.4*10^38”

Log In or post as a guest

Replying to comment #:

« Return to Article