- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
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.
Admin
And once the device is paired you have the answer to next week's puzzler?
Admin
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).
Admin
Just remember: You can't do it, unless the answer is 2.
Admin
Exactly!
Admin
So-so WTF? Why not spice it up by linking to a snoofle post in the forum?
Nice save.
Admin
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.
Admin
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.
Admin
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.
Admin
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.
Admin
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.
Admin
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...
Admin
this:
was directed at this:
Admin
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.
Admin
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.
Admin
My Opel Ampera has a battery, wires AND plugs into mains...
Admin
This code makes me want to cry. Literally. Slapping my forehead does not seem to do the trick.
Admin
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.
Admin
Don't code like my brother!
Admin
And don't code like my brother!
Admin
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.
Admin
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?
Admin
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".
Admin
Nobel Prize in Physics Winner!!!
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.
Admin
Admin
Admin
Admin
Admin
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.