- 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
For crying out loud; RDN is still not free, and has never been. That is, my dear watson32.exe, the true wtf in this story.
Admin
Is there any reason at all to use Random in business software?
Admin
This is a Bohr bug, the most dependable kind.
heisenbug: /hi:'zen-buhg/ n. [from Heisenberg's Uncertainty Principle in quantum physics] A bug that disappears or alters its behavior when one attempts to probe or isolate it. (This usage is not even particularly fanciful; the use of a debugger sometimes alters a program's operating environment significantly enough that buggy code, such as that which relies on the values of uninitialized memory, behaves quite differently.)
Bohr bug: /bohr buhg/ n. [from quantum physics] A repeatable bug; one that manifests reliably under a possibly unknown but well-defined set of conditions.
mandelbug: /man'del-buhg/ n. [from the Mandelbrot set] A bug whose underlying causes are so complex and obscure as to make its behavior appear chaotic or even non-deterministic. This term implies that the speaker thinks it is a Bohr bug, rather than a heisenbug.
schroedinbug: /shroh'din-buhg/ n. [MIT: from the Schroedinger's Cat thought-experiment in quantum physics] A design or implementation bug in a program that doesn't manifest until someone reading source or using the program in an unusual way notices that it never should have worked, at which point the program promptly stops working for everybody until fixed. Though (like bit rot) this sounds impossible, it happens; some programs have harbored latent schroedinbugs for years.
Admin
Sorry, couldn't resist.
from random import random L = [int(random() * 100) for _ in range(int(random() * 100))] print L
Admin
Calling it a "fluke" should tell management that the developer has ... a whale of a problem.
Admin
If you really believe that, do not bother to seek employment in my department. there is always a reason for 'data flukes'.
A coder turned dev manager
Admin
yeah. It's handy for spreading load over time. Use it for some scheduled processes and during startup in high throughput environments.
Admin
Your irony detector needs to be adjusted. Or turned on. Or you need to get one.
Admin
Care to elaborate, or give a reference? I'm at CMU and of course AFS is still very common around here. People are always saying how horrible and buggy AFS is, so anything I can read about it I'm interested in.
(It's not that I don't believe you, I'm just curious. A quick google didn't turn up anything.)
Admin
OMG! I haven't programmed in 10 years, and yet even I recognized the flaw due to the "psuedo-random" numbers. How clueless can these developers be?
And I have to agree with operagost. If anyone pulled that "fluke" explanation working under me, they'd be working late developing a thorough understanding of the term "fluke".
Admin
Admin
Another WTF here is that anyone is arguing that using PRDs is somehow acceptable.
Admin
In any case, GUIDs are still generally a bad idea for primary keys. Not always, of course, but most databases have data added a row at a time. In that case, a simple sequence makes much more sense than GUIDs.
Admin
But the "reason" could be something completely unpredictable and unreproducible, like an alpha particle ("cosmic rays") switching a bit in memory from 0 to 1.
It happens, more and more as transistors get smaller. That's why they have ECC memory.
Admin
The REAL WTF is that Dan did NOTHING after the first bug was closed.
It is one thing if Dan is busy and trusted his developer. BUT Dan claimed he had his suspisions what the problem was... AND yet still trusted the dev, when the dev said there wasn't a problem.
Admin
Actually there ARE bizzare data flukes. A computer CAN decided to simply do something different in rare cases. Faulty memory, bad voltage, faulty disk drives.
Admin
If you want to try to reproduce every bug yorself, you'll never get any work done (given a sufficiently large application). Rather, have the reporter provide you with a reproducible example. That way, you can be sure that it is a bug and not a user being too stupid and not admitting it.
Admin
Admin
Admin
Admin
I find it funny that he actually said "OK" to the resolutions...
I have NEVER had a manager who assigned me a bug and would accept anything other than: "The issue is caused by xyz" and MAYBE we may decide that we can fix it later or its not something major and we don't have time to fix it...
Admin
Admin
Dude...
Blame the computer as a LAST result. Run Prime95 for 10 min once on each of the 3 stress test settings to check the memory processor. If any errors come up THEN you can CONSIDER that being the cause.
Randomly switching registers or memory is all BS... But I would love to see someone accept that explanation.
Admin
"the importance of reading the documentation"
Now there's the real WTF. The documentation has nothing to do with the code. If you want to know what the code is doing, you read the code. If you read the documentation, you add code that depends on the documentation, you add bugs. RTFD? FOAD.
Admin
Bullshit - You may be a coder, but this does not mean you thusly become a super-coder, omniscient and omnipotent, and know everything - if you did, you would be called an "owner" - you know, the guy (or gal) you work for.
Admin
I find it amusing that people actually refuse to learn, and refuse to be taught. If the dipwad developers had no clue, they deserved a lecture. It's not patronizing, it's pragmatics. That, or essentially "WTF did you during your CS education (whether formal or self-taught)"?!
I wish I had a "boss" who would be better than I am at things that I do and could teach me new tricks. He's a great mech. engineer, and I've learned most what I know from him in that area, but software and electronics isn't his background, and that's what I always need to learn more of.+
Admin
Nah, that's not enterprisey enough. You ought to deploy an application server, which serves an increment-per-request counter value. Then your DB application issues a SOAP call to the server to get the updated counter value.
Cheers!
Admin
I second that. memtest86 and prime95 are my tools of choice when someone complains of flaky hardware.
Admin
GUIDs are useful too if you're returning the ID number back to the customer.
It adds one more layer of difficulty for a malicious user to look at someone else's order/reservation/whatever.
Say the customer's status page is http://foo.com/status.php?id=4392.
If they can just increment the id and see someone else's data, that's bad.
If it's http://foo.com/status.php?id=439fa2e8c8d8e, they're going to have a harder time finding the next URL to try (obviously this can't be the only layer, but it can be a layer.
Admin
Admin
Admin
Admin
Oh and don't feed me the line about using GUIDs for spanning databases across machines. Saying "there's a really small chance of GUIDs colliding, so let's just use it" is logically the same as saying "we did not bother to eliminate the possibility of failure".
Admin
The generation of random numbers are to important to be left to chance:
#define actual_random 7
int random_int(int seed){ return actual_random; }
Admin
Actually, I believe RFC 1149.5 specifies 4 as the standard IEEE-vetted random number.
int getRandomNumber() { return 4; // chosen by fair dice roll. // guaranteed to be random. }
Admin
I guess it's gone down in recent years. Used to be higher. ;)
Admin
The real HTF is to get Joe Rnd User to provide you with said reproducible example. I would expect Joe to provide me with about half the variables I would need to reproduce the bug, and probably give me wrong values on 5% of those.
Admin
corrected your typo
Admin
But the way the story is written, there was one dipwad developer (who the dev manager kept giving the problem back to) - but he gave the lecture to the entire development team. A really efficient way to patronise lots of people at once.
Admin
The real WTF is all the heated debate on here about whether or not it was the seed and how GUIDs may or may not be a useful way of guaranteeing uniqueness when every relational database provides, and depends upon, a way of making every inserted row unique.
The problem was the coder did not know how to get the defined as unique ID just created by the database back out of the database session.
It's encouraging the number of people who have said "one in a million is next Tuesday" but depressing the number of others who continue to think that "think of a number between 0 and 9, twice," is a good-enough solution to the problem of making an atomic insert-and-read-id!
Admin
With a long enough ID you can make collistions arbitrarily unlikely. As in, more unlikely than the building the servers reside in being destroyed by a meteorite.
In the real world, a theoretical certainty that a failure cannot happen is NOT more valuable than sufficiently small likelihood.
Admin
heh, yes I was being disingenuous there. I'm coming from a world of 16-bit hardware running up many millions of hours' unattended runtime, and failure consequences involving bent hardware and broken people. In my real world, the guaranteed is usually worth more than the highly unlikely.
Admin
I agree.
Who in his right mind would use random numbers to generate an ID??? Developers like that definitely did not have an education whatsoever, and I'm seeing more and more of those in the undustry. People that have had no education in Computer Sciences and think they can do it just as well. Yeah...Right! Ok, there are exceptions of course.
CAPTCHA: Booyakasha
Admin
We are a truly global product development firm that partners with software product companies ranging from start-ups to established ISVs to provide software product life cycle solutions. We have worked with more than 50 software product companies in various domains like Education, Healthcare, Retail and Finance. Our wide-ranging experience has enabled us to build a strong product environment within the company that remains unmatched in the industry. If you are looking for any software development services, let us know, click link and just fill up the form. Our experts will get back to you within 1 business day.
Admin
Yes. Random values are predictable. More specifically, you can easily write statements that return false 99 % of time, but true 1 % of time.
We use this property of random numbers to run occasional cleanup tasks and like. (Wipe data directories clean of old files.)
Admin
We also have eggs beans and spam
Admin
Why test #7432a your hair looks especially nice today. Have you lost weight?
Admin
All very well if you are working with C in linux. But as far as I know Microsoft don't publish the source for Rnd()?
Admin
RDN is a free magazine IF YOU LIVE IN THE US
Believe me, there are people who don't live there.
Admin
Or they may be competent and doing the right thing (not in the given example, though). In a distributed system, performance considerations or architectural limitations or a requirement to allow offline operation may result in a random ID being your only choice. If it's done right, there's a hundred things that are more likely to go wrong and break your app than two large random numbers being identical.