• (cs)

    Is anyone else finding the basic stats discussions in this thread extremely disturbing? Especially considering that this is allegedly a site aimed at programmers?

  • (cs) in reply to Lies, Damn Lies
    Lies:
    Reynoldsjt:
    For the love of all that is holy, just spell it out for people. Total number of combination - duplicates divided by total number of combinations 16^2 - 16*15 / 16^2 = 1/16

    No. For the thousandth time, this is wrong.

    The GUID in the story starts with "66" the chances of getting a 6 are 1/16 followed by another 6 is another 1/16. So when Andy asked "what are the chances of that happening?" the chances of getting that GUID are 1/16 * 1/16 = 1/256.

    If you still don't get it, just do it on your fingers.

    00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF

    Are all the possible doubles for two hex characters. There are quite clearly 16 duplicates, not 256. If there are a total of 16 possible outcomes(THAT WE CARE ABOUT) And you can only get one of them. Then its a 1 out of 16 chance.

  • moz (unregistered) in reply to Smith
    Smith:
    You missed one important sentence:
    The tricky part in all this was that the processing application would never know how many IDs were issued or what IDs had been issued: It would somehow have to provide an ID that was always unique.
    The processing application may not keep track of this stuff, but the consuming application probably does. Similarly, the processing application has a reliable means of communicating with the consuming one here, as it needs to tell it the ID in the first place. If only the consuming application had pulled the next ID from its pile instead of leaving things to luck, Jeremy would have had a way of generating unique IDs without any of those nasty collisions Andy experienced.
  • too lazy to reg (unregistered) in reply to Lies, Damn Lies

    You are correct that the chances of getting two sixes in a row is 1/256. However, the chances of getting two identical characters in a row is 1/16.

    There are 256 possible combinations of characters. Two sixes in a row is one of those 256 combinations - hence, 1/256. However, there are 16 combinations where the two characters are identical. 00, 11, 22, ..., DD, EE, FF. Thus, there is a 16/256 chance of getting two identical characters. 16/256 reduces to 1/16.

  • meet buug (unregistered) in reply to boog
    boog:
    Wow. Reading through some of the comments here, I'm thinking this roughly characterizes what many of the commentators on this site are feeling right now.

    Was that really necessary?

  • Hortical (unregistered) in reply to ThingGuy McGuyThing
    ThingGuy McGuyThing:
    Is anyone else finding the basic stats discussions in this thread extremely disturbing? Especially considering that this is allegedly a site aimed at programmers?
    And supposedly populated by people who know better?
  • Hortical (unregistered) in reply to Lucas
    Lucas:
    Hortical:
    Prison coder #19232132:
    boog:
    Lies:
    the code switches the first 2 chars and then appends them in the original order to itself...
    Which code snippet did you read?

    some of us can read code, others can only read comments: it says:

    // Swap two chars of dataset ID // to create processed ID

    but it does (i added comments so you can read it ;) ) : //get a sting out of a mysterious guid var dsID = dataSetGuid.ToString(); //create a string builder to perform transform var pdsID = new StringBuilder(); //append second char from dsID pdsID.Append(dsID[1]); //append first char from dsID pdsID.Append(dsID[0]); //append the first chars from ID (in their original order) pdsID.Append(dsID.Substring(2)); //create a guid from the 4 char string called pdsID return new Guid(pdsID.ToString());

    dsId.Substring(2); returns the chars of the string from index 2 (inclusive) and on, not the first two chars.

    And some can read code, comments and documentation.

    I've been made a fool many times by not knowing what something is or how is works. RTFM. Always.

  • confused (unregistered)

    OK ok.

    But why is the processed set kept with the unprocessed set.

    If they were kept separate they could have the same id, making it easy to tell which belongs with which.

  • Marvin the Martian (unregistered) in reply to Hortical
    ThingGuy McGuyThing:
    Is anyone else finding the basic stats discussions in this thread extremely disturbing? Especially considering that this is allegedly a site aimed at programmers?
    It's not stats, it's combinatorics or probability (whatever you prefer); it requires actually knowing vaguely what you're doing as opposed to stats that's just button-mashing -- insert data, get low P-value, be happy.
  • Jem (unregistered) in reply to boog
    bogy:
    Jemi:
    Are you all seriously spending the night no-clothes wrestling at bo0g's?
    What else are 8th grade math nerds to do during summer break?
  • Dan (unregistered)

    For a very brief time I helped a coworker maintain a client's web application. It had a GUID generator routine that simply chose the correct amount of letters/numbers at random and put dashes in the right spots.

    I'm hoping that was the only time I'll ever see GUIDs with Xs and Zs in them.

  • (cs) in reply to meet buug
    meet buug:
    boog:
    Wow. Reading through some of the comments here, I'm thinking this roughly characterizes what many of the commentators on this site are feeling right now.
    Was that really necessary?
    Discussing statistics (or just-plain-math) with programmers who simply refuse to understand on even a fundamental level can be quite maddening. I find reading and relating to another programmer's thoughts on the subject to be therapeutic.

    Hell, are any of the articles on this site really necessary?

  • Marvin the Martian (unregistered) in reply to Coyne
    Coyne:
    At our location, one of the programmers was going to generate a pin for each employee: His proposal called for 4 digits, with no two employees having the same pin.

    When I pointed out that we had 40,000 employees, and a 4-digit pin has 10,000 unique pins, his response was, "So, what?"

    I'm sure that by now you've figured out that the guy was right, as a 4-digit hex pin gives you 16^4=2^16=65536 possibilities.

    A bit awkward, as if you also need pins for interns etc so it gets a bit tight... Whenever someone's retired or fired, immediately assign their pin to the new employee -- that may be a security concern with recently-fired disgruntlees.

  • meet buug (unregistered) in reply to boog
    boog:
    meet buug:
    boog:
    Wow. Reading through some of the comments here, I'm thinking this roughly characterizes what many of the commentators on this site are feeling right now.
    Was that really necessary?
    Discussing statistics (or just-plain-math) with programmers who simply refuse to understand on even a fundamental level can be quite maddening. I find reading and relating to another programmer's thoughts on the subject to be therapeutic.

    Hell, are any of the articles on this site really necessary?

    Heh heh heh. Someone you know knows something you don't know.

  • the beholder (unregistered) in reply to Hortical
    Hortical:
    the beholder:
    I think I do not need to explain why the system barfed when the 1st and 2nd chars were the same, do I?

    No, you don't, because you don't know what I was referring to...

    Not for you anyway, it seems. But I targeted other readers with my post as well.

  • meet buug (unregistered) in reply to Marvin the Martian
    Marvin the Martian:
    Coyne:
    When I pointed out that we had 40,000 employees, and a 4-digit pin has 10,000 unique pins, his response was, "So, what?"
    I'm sure that by now you've figured out that the guy was right, as a 4-digit hex pin gives you 16^4=2^16=65536 possibilities.
    If the guy was thinking hex, wouldn't he have pointed it out when Coyne said "that's only 10000" combinations?
  • Now I need to burn my eyes (unregistered) in reply to boog
    boog:
    meet buug:
    boog:
    Wow. Reading through some of the comments here, I'm thinking this roughly characterizes what many of the commentators on this site are feeling right now.
    Was that really necessary?
    What? I love this stuff!
    The characterization is, indeed, rough.
  • (cs) in reply to Marvin the Martian
    Marvin the Martian:
    ThingGuy McGuyThing:
    Is anyone else finding the basic stats discussions in this thread extremely disturbing? Especially considering that this is allegedly a site aimed at programmers?
    It's not stats, it's combinatorics or probability (whatever you prefer); it requires actually knowing vaguely what you're doing as opposed to stats that's just button-mashing -- insert data, get low P-value, be happy.
    Yeah, that's all statistics is, button-mashing. Not. Combinatorics & probability are a huge part of statistics surely. Anyway, most people seem to think that statistics is just summarised data, with perhaps an arithmetic mean thrown in for giggles, whether its meaningful or not
  • (cs) in reply to method1
    method1:
    Combinatorics & probability are a huge part of statistics surely.
    It is, but don't call me Shirley.
  • (cs) in reply to meet buug
    meet buug:
    boog:
    Wow. Reading through some of the comments here, I'm thinking this roughly characterizes what many of the commentators on this site are feeling right now.

    Was that really necessary?

    Yes, indeed, that was unforgivable. That really was a horrible noise coming from my speakers, quite drowned out Rachmaninov's 1st Suite for 2 pianos (Previn & Ashkenazy).

  • (cs) in reply to method1
    method1:
    Marvin the Martian:
    ThingGuy McGuyThing:
    Is anyone else finding the basic stats discussions in this thread extremely disturbing? Especially considering that this is allegedly a site aimed at programmers?
    It's not stats, it's combinatorics or probability (whatever you prefer); it requires actually knowing vaguely what you're doing as opposed to stats that's just button-mashing -- insert data, get low P-value, be happy.
    Yeah, that's all statistics is, button-mashing. Not. Combinatorics & probability are a huge part of statistics surely. Anyway, most people seem to think that statistics is just summarised data, with perhaps an arithmetic mean thrown in for giggles, whether its meaningful or not

    Statistics is applied probability theory.

  • Some damn Yank (unregistered) in reply to Ace
    Ace:
    Why haven't anyone pointed out that using a guid in the first place is kind of silly? Why not just use a counter? Using a guid was kind of wtf in the first place if you ask me..
    Because GUID or counter, it doesn't matter. The real WTF is swapping the first two characters and assuming the result is unique. In fact, a counter would be worse! For the vast bulk of the identifiers generated by a counter the first two characters are zero. The longer the counter, the more you have to generate before the first two characters are NOT zero. Not to mention the long runs of counters beginning "11", "22",..."FF".
  • Now I need to burn my eyes (unregistered) in reply to Matt Westwood
    Matt Westwood:
    meet buug:
    boog:
    Wow. Reading through some of the comments here, I'm thinking this roughly characterizes what many of the commentators on this site are feeling right now.

    Was that really necessary?

    Yes, indeed, that was unforgivable. That really was a horrible noise coming from my speakers, quite drowned out Rachmaninov's 1st Suite for 2 pianos (Previn & Ashkenazy).

    Sounds like nothing else that popped up would have been foreign to you. Aren't you a Brit? (why do I bother asking?)

  • (cs) in reply to meet buug
    meet buug:
    boog:
    meet buug:
    boog:
    Wow. Reading through some of the comments here, I'm thinking this roughly characterizes what many of the commentators on this site are feeling right now.
    Was that really necessary?
    Discussing statistics (or just-plain-math) with programmers who simply refuse to understand on even a fundamental level can be quite maddening. I find reading and relating to another programmer's thoughts on the subject to be therapeutic.

    Hell, are any of the articles on this site really necessary?

    Heh heh heh. Someone you know knows something you don't know.

    mouse over the link, glancing at status bar

    Oh, you changed the URL. That's absolutely hilarious and clever.

  • Some damn Yank (unregistered) in reply to Dan
    Dan:
    For a very brief time I helped a coworker maintain a client's web application. It had a GUID generator routine that simply chose the correct amount of letters/numbers at random and put dashes in the right spots.

    I'm hoping that was the only time I'll ever see GUIDs with Xs and Zs in them.

    You have to admint, GUIDs with Xs and Zs in them are truly unique, in every sense of the word.

  • Matt (unregistered) in reply to boog
    boog:
    What kind of ass-backwards language has a substring form that takes a length with no start index?
    This is C# and you have it ass-backwards. The single argument version of substring takes a start index and not a length. It means find the substring starting at this index and extending to the end of the string. Of course C# also has a two argument version that requires start index and length.
  • can you read this? (unregistered) in reply to boog
    boog:
    Oh, you changed the URL. That's absolutely hilarious and clever.

    I thought it was funny as hell, even if no one else does.

    And no, I'm not clever at all. I still haven't managed to slip ANYTHING past your GeniusMonkey script. Guess I'm just too dumb.

  • (cs) in reply to vindico
    vindico:
    Andy is one of the many dicky wannabe programmers that are out there producing shitty software. There should be a law and a minimum 5-year sentence for stupid programmers.
    HELL YEAH! I have a former employee who needs to be imprisoned. He has two published WTFs on this site already.
  • can you read this? (unregistered) in reply to boog
    boog:
    meet buug:
    boog:
    meet buug:
    boog:
    Wow. Reading through some of the comments here, I'm thinking this roughly characterizes what many of the commentators on this site are feeling right now.
    Was that really necessary?
    Discussing statistics (or just-plain-math) with programmers who simply refuse to understand on even a fundamental level can be quite maddening. I find reading and relating to another programmer's thoughts on the subject to be therapeutic.

    Hell, are any of the articles on this site really necessary?

    Heh heh heh. Someone you know knows something you don't know.

    clicks link, gets horny, jerks off, licks up the cum, fixes clothes, claims to have avoided seeing and to being totally straight

    Oh, you changed the URL. That's absolutely hilarious and clever.

  • (cs) in reply to Matt
    Matt:
    boog:
    What kind of ass-backwards language has a substring form that takes a length with no start index?
    This is C# and you have it ass-backwards.
    If any language had a substring form that took a length with no start index, that would be entirely at odds with every other programming language I've ever seen. So how exactly do I have it backwards?
    Matt:
    The single argument version of substring takes a start index and not a length.
    Exactly my point. Perhaps you overlooked the context of my post, which was pointing out how somebody else got it wrong.
  • (cs)

    Do you want me to send a few GUIDs? I have some spare ones.

  • (cs) in reply to Carl
    Carl:
    Anon:
    So, what would the solution be? Append U to GUID to make the unprocessed one, and then replace the first U with P to make the processed one?
    Ahem... you put data in a data column. The ID is just for the ID, not the ID+Status. So the requirement for the ID to change when the status changes is TRWTF.
    This.
  • (cs) in reply to DWalker59
    DWalker59:
    Do you want me to send a few GUIDs? I have some spare ones.
    LOL. But seriously - never publish your GUIDs online. Some idiot will use them.
  • (cs) in reply to boog
    boog:
    Matt:
    boog:
    What kind of ass-backwards language has a substring form that takes a length with no start index?
    This is C# and you have it ass-backwards.
    If any language had a substring form that took a length with no start index, that would be entirely at odds with every other programming language I've ever seen. So how exactly do I have it backwards?
    Matt:
    The single argument version of substring takes a start index and not a length.
    Exactly my point. Perhaps you overlooked the context of my post, which was pointing out how somebody else got it wrong.
    I'm envisioning you swatting away at a giant cloud of stupid, trying to disperse it.

    In vain.

  • (cs) in reply to Nexzus
    Nexzus:
    It's fun to ask people the chance of being born on the same day of the week as yourself. Assuming they at least know the bare minimum about odds and multiplication, about 90%* will say 1 in 49.

    Yes, I have a strange definition of fun.

    *number pulled out of my ass.

    I like the one where you ask them to calculate the odds when you randomly stuff a hundred letters into a hundred envelopes that only one of the letters gets into the correct envelope.

    Then you ask them what the odds are that 99 out of a hundred get into the right envelope.

  • Joe (unregistered)

    Why is this so difficult, people? The probability of a collision is 1/2.

    There are 2 possible outcomes of the experiment. Either a) the first to hexadigits are the same, or b) the two hexadigits are different.

    One of those 2 outcomes is the one we want to calculate the probability of, so the probability is, by definition 1 out of 2, or 1/2.

    Simple math.

    Now, does anybody want to buy a lottery ticket from me? They have a winning probability of 1/2 as well. In fact, if you buy 3 tickets, you're assured of a win, since 1/2 + 1/2 + 1/2 > 1.

    --Joe

  • (cs) in reply to can you read this?
    can you read this?:
    boog:
    Oh, you changed the URL. That's absolutely hilarious and clever.
    I thought it was funny as hell, even if no one else does.
    The best kind of humor!
    can you read this?:
    I still haven't managed to slip ANYTHING past your GeniusMonkey script.
    No more than were expected. I'll just make a couple quick changes... and... there! Even less noise. :)
  • (cs) in reply to hoodaticus
    hoodaticus:
    boog:
    Matt:
    The single argument version of substring takes a start index and not a length.
    Exactly my point. Perhaps you overlooked the context of my post, which was pointing out how somebody else got it wrong.
    I'm envisioning you swatting away at a giant cloud of stupid, trying to disperse it.

    In vain.

    At least I'm getting some visualized exercise.

  • (cs) in reply to da Doctah
    da Doctah:
    Nexzus:
    It's fun to ask people the chance of being born on the same day of the week as yourself. Assuming they at least know the bare minimum about odds and multiplication, about 90%* will say 1 in 49.

    Yes, I have a strange definition of fun.

    *number pulled out of my ass.

    I like the one where you ask them to calculate the odds when you randomly stuff a hundred letters into a hundred envelopes that only one of the letters gets into the correct envelope.

    Then you ask them what the odds are that 99 out of a hundred get into the right envelope.

    I'd answer that, but exclamation points scare me. Plus, nothing should ever be subtracted from 1.

  • Normal WTF moron (unregistered) in reply to trtwtf
    trtwtf:
    You keep using the word "unique". I do not think it means what you think it means.
    I'm unique, just like everybody else
  • (cs) in reply to boog
    boog:
    hoodaticus:
    boog:
    Matt:
    The single argument version of substring takes a start index and not a length.
    Exactly my point. Perhaps you overlooked the context of my post, which was pointing out how somebody else got it wrong.
    I'm envisioning you swatting away at a giant cloud of stupid, trying to disperse it.

    In vain.

    At least I'm getting some visualized exercise.
    Nice!

  • AWO e (unregistered)

    I'm not sure I see the problem...

    I can see that the first two characters get swapped, but I don't understand how this makes a difference....viz:

    108 109 110 111 112 113

    produces: 018 019 110 112 113

    still no duplicate....or am I totally missing the point?

  • (cs) in reply to Now I need to burn my eyes
    Now I need to burn my eyes:
    Matt Westwood:
    meet buug:
    boog:
    Wow. Reading through some of the comments here, I'm thinking this roughly characterizes what many of the commentators on this site are feeling right now.

    Was that really necessary?

    Yes, indeed, that was unforgivable. That really was a horrible noise coming from my speakers, quite drowned out Rachmaninov's 1st Suite for 2 pianos (Previn & Ashkenazy).

    Sounds like nothing else that popped up would have been foreign to you. Aren't you a Brit? (why do I bother asking?)

    From the fact that I have a sense of humour, I thought that was obvious.

  • Bingo (unregistered) in reply to Lies, Damn Lies and Probability
    Lies:
    Anon:
    For each of the 16 characters, there is a 1/16 * 1/16 chance to have that character repeated.

    Add all those probabilities up (1/256 + 1/256 ..., 16 times) and you get 1/16.

    For all of you who are confused:

    let's assume that there are only 3 letters in the alphabet - A ,B and C, the options are:

    AA AB AC BA BB BC CA CB CC

    or 3^2 = 9 options. the fact that the second character is identical to the first one is not relevant.

    the code switches the first 2 chars and then appends them in the original order to itself, so that:

    AA = AAAA AB = BAAB AC = CAAC BA = ABBA BB = BBBB BC = CBBC CA = ACCA CB = BCCB CC = CCCC

    you still have the orig 9 options so you get 3^2 alternatives, which gives you a 1/9 chance for each of these.

    the calculation remains n^2 where n is the number of letters in the alphabet.

    What drugs are you on? A) the number of repeated starts is still 3/9 or 1 in 3 B) why are you appending the original string? C) WTF is your point?
  • Bingo (unregistered) in reply to Prison coder #19232132
    Prison coder #19232132:
    boog:
    Lies:
    the code switches the first 2 chars and then appends them in the original order to itself...
    Which code snippet did you read?

    some of us can read code, others can only read comments: it says:

    // Swap two chars of dataset ID // to create processed ID

    but it does (i added comments so you can read it ;) ) : //get a sting out of a mysterious guid var dsID = dataSetGuid.ToString(); //create a string builder to perform transform var pdsID = new StringBuilder(); //append second char from dsID pdsID.Append(dsID[1]); //append first char from dsID pdsID.Append(dsID[0]); //append the first chars from ID (in their original order) pdsID.Append(dsID.Substring(2)); //create a guid from the 4 char string called pdsID return new Guid(pdsID.ToString());

    Fuck me drunk you're stupid.

    String temp = "YOU ARE A DICKHEAD";
    Console.WriteLine(temp.Substring(2));
    

    Output:

    U ARE A DICKHEAD
    

    HoHum.

  • SomeGuy (unregistered) in reply to nosliwmas

    Well played.

  • JustSomeGuy (unregistered)

    Obviously, the answer is to interject your own getguid function along the lines of:

    def myguid(): ....guid = "aawhatever" ....while guid[0] == guid[1]: ........guid = getGUID() ....return guid

    Viola! No duplicate first characters. Of course, it reduces your GUID-space by a fctor of 16 but there's still plenty of them out there, right :-)

  • AWO e (unregistered) in reply to AWO e
    AWO e:
    I'm not sure I see the problem...

    I can see that the first two characters get swapped, but I don't understand how this makes a difference....viz:

    108 109 110 111 112 113

    produces: 018 019 110 112 113

    still no duplicate....or am I totally missing the point?

    To clarify, I understand that input = output in this case, but what is the problem with that? If the issue is that all outputs have to be distinct from any input, then there will be plenty problems irrespective of repeated characters (although I guess you will guarantee a problem when the first two are teh same).

  • Jimbo (unregistered) in reply to ThingGuy McGuyThing
    ThingGuy McGuyThing:
    Is anyone else finding the basic stats discussions in this thread extremely disturbing? Especially considering that this is allegedly a site aimed at programmers?
    It's a site aimed at WTF programmers - and clearly, the audience appears to be the audience intended.
  • (cs) in reply to hoodaticus
    hoodaticus:
    DWalker59:
    Do you want me to send a few GUIDs? I have some spare ones.
    LOL. But seriously - never publish your GUIDs online. Some idiot will use them.

    I just generated a couple of GUIDs, and I was going to publish them (but never use them myself). Then I realized that someone, or several someones, might use them. Oh well.

    Want a random number? 4. Guaranteed to be random.

Leave a comment on “A More Unique Identifier”

Log In or post as a guest

Replying to comment #:

« Return to Article