• (cs) in reply to Re: Try More Random
    Re: Try More Random:
    Coyne:
    Their are a lot of anti-social people in society. That's why we have to have locks on our doors and windows; to keep those anti-social people out.

    "That person doesn't want to socialize with me? I need to be damn sure he can't get into my house!"

    You seem to be confusing anti-social with criminal.

    I'm kinda anti-social. It means I don't like to be around others and I socialize "less than normal". Going to the bar after work is not my idea of a good time. I do most of my socializing on a headset connected to my PC, and maybe a glass of wine. I prefer to be left alone and not bother anybody.

    It in no way makes me a criminal who wants to break into your house. On the contrary, I actually have locks on my doors to keep both the social, anti-social, and criminal people out. I'm to busy being anti-social hiding in my room in front of my code and my games to give a shit about breaking into your house.

    Maybe you were thinking of Psycho.

    TL;DR: I'm not gonna rob you! GO AWAY! I don't wanna talk to you!

    Addendum (2013-03-21 15:24): Damn... that word doesn't mean what it did when I was in grade school. Ok so I'm asocial, not anti-social, with anti-social being the opposite and asocial being near the middle of the scale.

  • drake (unregistered) in reply to chubertdev
    chubertdev:
    Of course the most random, secure method would be to have each user write the first 50 digits that they can think of in Sharpie on a busted BMW E46 window regulator (those are not in short supply) and mail it to "Secure Connections, Box 3500 Harvard Square, Cambridge, MA 02238" and wait 6-8 weeks for the other device to be paired.

    And once the device is paired you have the answer to next week's puzzler?

  • (cs)

    Not that I don't believe it but it seems like the "Experts" (or Highly Paid Consultants) are ALWAYS totally incompetent. I can think of only one story here where it was the reverse (stupid in-house guys, smart consultant).

  • uxor (unregistered) in reply to drake
    drake:
    chubertdev:
    Of course the most random, secure method would be to have each user write the first 50 digits that they can think of in Sharpie on a busted BMW E46 window regulator (those are not in short supply) and mail it to "Secure Connections, Box 3500 Harvard Square, Cambridge, MA 02238" and wait 6-8 weeks for the other device to be paired.

    And once the device is paired you have the answer to next week's puzzler?

    Just remember: You can't do it, unless the answer is 2.

  • (cs) in reply to drake
    drake:
    And once the device is paired you have the answer to next week's puzzler?

    Exactly!

  • (cs)

    So-so WTF? Why not spice it up by linking to a snoofle post in the forum?

    Nice save.

  • Anonymous Coward (unregistered) in reply to Valued Service

    How about displaying the GUID as a QR code on Device A, and then have Device B read the QR code and send the GUID back to the server? Would this be good for both user-friendliness and security?

    A harsh word stirs up anger, friends. Give a gentle answer, turn away wrath, work together, and find a solution!

    Captcha: gravis - the gravity of the situation, is.

  • (cs) in reply to chubertdev
    chubertdev:
    Re: Try More Random:
    Coyne:
    Their are a lot of anti-social people in society. That's why we have to have locks on our doors and windows; to keep those anti-social people out.

    "That person doesn't want to socialize with me? I need to be damn sure he can't get into my house!"

    You're confusing anti-social with non-social.

    Well, I hyphenated it...and shouldn't have.

    Otherwise, I meant exactly what I said. FreeDictionary.com defines "antisocial" as, "Hostile to or disruptive of the established social order; marked by or engaging in behavior that violates accepted mores." Thesaurus.com notes that, "to be antisocial is to be hostile to or disruptive of the established social order, marked by or engaging in behavior that violates accepted mores."

    But, okay, how about, "There are a lot of people in society that are prone to criminal behavior." Oh, wait, that requires a law.

    No, they're just plain antisocial.

  • El Ka-Ben (unregistered)

    Why be random?

    I'd think it would be easier to find something both devices had access to, some unique name they were using or serial number and have them do something as simple as a MD5 hash.

    Put the first X digits on the screen of device A.

    If the first X digits entered in device B are the same as the generated hash, connect.

    Since it doesn't seem that they should be time sensitive or change why store the value?

    I'm sure there would be refinements needed based on security and such, but the point is if you're generating and storing a random value you have to ask why.

  • Adrian (unregistered)

    Here is an idea

    I am going to assume the user accesses the server via a username/password.

    Go to Device 1 enter your username/password and a "Friendly" name for this device. Device send this info with request to Pair to server.

    (you have 3 minutes from here) Go to Device 2 enter your username/password and a "Friendly" name for this device. Device send this info with request to Pair to server.

    Server sends all requests to pair in last 3 minutes to device 2 you select the device based on Friendly name

    once selected request goes back to server

    Device 1 pops up with a message saying "Device 2" is trying to Pair with you do you accept

    Device 2 pops up with a message saying "Device 1" is trying to Pair with you do you accept

    While setting up is a little more work, it's more secure. while you could flood the server with requests to random machines and prevent people pairing you wouldn't easly be able to pair with someone elses device without them knowing. also no long numbers for users to type in and get wrong.

  • Bill C. (unregistered)

    We didn't need a server when we paired. We used all our digits. Even the seed is plain to see.

    Try more random? Sure I'm up for it, just make sure she's a Math.qtPI.

  • wtferswtf (unregistered) in reply to verisimilidude

    I'm trying to visualize the distribution of that function. It's not flat. it's range is [0,1.5). It's got binomial properties, but there is a uniformly distributed section in the middle [0.5,1)

    I think...

  • wtferswtf (unregistered) in reply to wtferswtf

    this:

    wtferswtf:
    I'm trying to visualize the distribution of that function. It's not flat. it's range is [0,1.5). It's got binomial properties, but there is a uniformly distributed section in the middle [0.5,1)

    I think...

    was directed at this:

    verisimilidude:
    Reminds me of rvar = rand() + rand() / 2; which was justified as twice as random as calling the function once.
  • napillo (unregistered) in reply to Christian

    seems dumb to me to even have a pairing code stored in the database at all. Just store it temporarily, generate a random number from 100000 to 999999 and as soon as the devices are paired, insert into the 'paired devices' table both the devices IDs only. no key needed.

  • napillo (unregistered) in reply to napillo
    napillo:
    seems dumb to me to even have a pairing code stored in the database at all. Just store it temporarily, generate a random number from 100000 to 999999 and as soon as the devices are paired, insert into the 'paired devices' table both the devices IDs only. no key needed.

    That will also ensure that random hacker can't just randomly pair up with someone else after they are already paired. Before they are paired, perhaps.

  • Taco (unregistered) in reply to Isikyus

    My Opel Ampera has a battery, wires AND plugs into mains...

  • (cs)

    This code makes me want to cry. Literally. Slapping my forehead does not seem to do the trick.

  • The Recursion King (unregistered)

    There is NO SUCH THING AS RANDOM anyway.

    Computers are pseudorandom and have seeds that control the resulting number sequences. From the same seed start point you get the SAME SEQUENCE.

    Dice that you throw are moved by the grip of your hand, the speed of your throw, what obstacles they hit, it's basic physics in action. From the exact same start point with the same factors all interacting in the same way you get the SAME RESULT.

    Randomness is an illusion, an idea. When we say random we really mean unpredictable because we cannot replicate the starting parameters (the seed) because we do not know what it was.

    NOTHING IN THE UNIVERSE IS RANDOM.

    Rant over. Good WTF though. Bad code there.

  • IN-HOUSE-CHAMP (unregistered) in reply to drake
    drake:
    chubertdev:
    Of course the most random, secure method would be to have each user write the first 50 digits that they can think of in Sharpie on a busted BMW E46 window regulator (those are not in short supply) and mail it to "Secure Connections, Box 3500 Harvard Square, Cambridge, MA 02238" and wait 6-8 weeks for the other device to be paired.

    And once the device is paired you have the answer to next week's puzzler?

    Don't code like my brother!

  • (cs) in reply to IN-HOUSE-CHAMP
    IN-HOUSE-CHAMP:
    drake:
    chubertdev:
    Of course the most random, secure method would be to have each user write the first 50 digits that they can think of in Sharpie on a busted BMW E46 window regulator (those are not in short supply) and mail it to "Secure Connections, Box 3500 Harvard Square, Cambridge, MA 02238" and wait 6-8 weeks for the other device to be paired.

    And once the device is paired you have the answer to next week's puzzler?

    Don't code like my brother!

    And don't code like my brother!

  • jay (unregistered)

    On the serious side:

    What was the purpose behind the number-generation requirement? If it was to provide security for the connection, then the suggestion of assigning sequential numbers wouldn't work. You could start a connection, see the number assigned, and then just pick a number that's 2 or 3 more than that and catch someone else's connection.

    If it was just to uniquely identify the machine that you want to connect to, then why bother with generating numbers at all? Just assign each machine a number, which could then easily be just a few digits, and use the same number for every connection to that machine. You could then write it on a post-it and stick it to the monitor and life would be simpler for everyone.

  • jay (unregistered)

    I guess the whole point of this story was to say that these people were idiots, so maybe this goes without saying, but: Didn't it occur to anyone that if you have a requirement to generate a unique random number, that if the number you generate turns out to be a duplicate, blowing up is not an acceptable response? Like, here's a radical idea, maybe you could have a loop around the number generation that keeps retrying until it gets a non-colliding value?

  • jay (unregistered)

    Reminds me of a co-worker years ago who was assigned the task of selecting some "random" records from a database for testing purposes. He figured he would pick some number n and then take every n-th record until he had the required number. Reasonable enough. And then he told me that to be sure that the n he selected was truly random, he used the random number function on his calculator. For of course, if he had just picked a number off the top of his head, that wouldn't have been "really random".

  • JimTheJam (unregistered) in reply to The Recursion King

    Nobel Prize in Physics Winner!!!

    The Recursion King:
    There is NO SUCH THING AS RANDOM anyway. ... Randomness is an illusion, an idea. When we say random we really mean unpredictable because we cannot replicate the starting parameters (the seed) because we do not know what it was.

    NOTHING IN THE UNIVERSE IS RANDOM.

    Remember to submit to a peer reviewed physics journal!

    You have just revolutionized modern Physics. Quantum Mechanics, QED, and more will never be the same. Einstein right and Bohr, Heisenberg, et. al. wrong! Bell's [Inequalities] Theorem experiments invalidated! WOW!

    Thank You, Thank You, Thank You.

  • bambam (unregistered) in reply to ben
    ben:
    you're missing these: ()
    Did you just invent a new emoticon? Looks like a sock monkey to me.
  • (cs) in reply to wtferswtf
    wtferswtf:
    verisimilidude:
    Reminds me of rvar = rand() + rand() / 2; which was justified as twice as random as calling the function once.
    I'm trying to visualize the distribution of that function. It's not flat. it's range is [0,1.5). It's got binomial properties, but there is a uniformly distributed section in the middle [0.5,1)

    I think...

    COrrect, the PDF has a trapezoidal shape; it's 2x between 0 and 0.5, 1 between 0.5 and 1, and 3 - 2x between 1 and 1.5.

  • chris (unregistered) in reply to faoileag
    faoileag:
    Isikyus:
    To clarify: I know a car has wires; but it doesn't plug into mains power.
    You are so 20th century! In this day and age cars plug into some sorts of mains as well. I mean, if not, how would you get them recharged?
    A traditional car includes a generator to recharge the battery, so it clearly *is* a kind of mains.
  • the beholder (unregistered) in reply to Scarlet Manuka
    Scarlet Manuka:
    wtferswtf:
    verisimilidude:
    Reminds me of rvar = rand() + rand() / 2; which was justified as twice as random as calling the function once.
    I'm trying to visualize the distribution of that function. It's not flat. it's range is [0,1.5). It's got binomial properties, but there is a uniformly distributed section in the middle [0.5,1)

    I think...

    COrrect, the PDF has a trapezoidal shape; it's 2x between 0 and 0.5, 1 between 0.5 and 1, and 3 - 2x between 1 and 1.5.
    What? I don't know what you guys have been thinking, but there's clearly no "uniformly distributed section in the middle". This thing is exactly the same as rolling two die and adding the results. As with that case the distribution function is triangular-shaped. (In the die example the central and most-likely result is the 7).

  • JimTheJam (unregistered) in reply to the beholder
    Scarlet Manuka:
    What? I don't know what you guys have been thinking, but there's clearly no "uniformly distributed section in the middle". This thing is exactly the same as rolling two die and adding the results. As with that case the distribution function is triangular-shaped. (In the die example the central and most-likely result is the 7).
    Similar to rolling a 10 sided dice and a 5 sided dice (I Just happen to have a program that can do that). The percent chance of rolling each number is:

    Nr: 2___3___4___5___6___7___8___9__10__11__12__13_14__15 %: 2___4___6___8__10__10__10__10__10__10___8___6__4___2

    Yes, the distribution is indeed flat in the center.

    The problem with your analogy is that you compared two dice with the same characteristics. Different situation, different distribution characteristics.

    NOT: exactly the same as two 6-sided dice. In fact, very different.
    Similar to a 5-side dice and a 10 sided dice.

Leave a comment on “Try More Random”

Log In or post as a guest

Replying to comment #:

« Return to Article