What is the Best Bug-as-a-Feature? 861
Bat Country wonders: "The workflow system, at the department I develop for, was hand-coded by my predecessor in a rather short amount of time, resulting in somewhat unreadable code with a number of interesting 'features.' When I took over maintenance of the code base, I started patching bugs and cleaning up the code in preparation for a new set of features. After I was done, I got a pile of complaints about features that had disappeared, which turned out to be caused by the bugs in the code. So, that leads me to ask: what is your favorite bug that you either can't live without or makes your life easier?"
The best (Score:5, Funny)
Re:The best (Score:5, Funny)
>Windows Genuine Advantage
No, that's a feature that acts like a bug. ;-)
Perl versus Python (Score:5, Interesting)
it's nuts. And the origin of the nutty ness is an obsessive desire not to have default behaviours. Whereas perl is all default behaviours. In the end perl does what you really meant, and python does what you told it.
in case you think I'm python bashing google what python evangelist david mertz says about python warts.
Re:Perl versus Python (Score:5, Funny)
Re:Perl versus Python (Score:5, Funny)
Re:Perl versus Python (Score:5, Funny)
Re:Perl versus Python (Score:5, Informative)
4 and 4.0 are equal by value but not in precision. 4 has one significant digit, while 4.0 has two. This is important because multiplying it by 1200 (which has two significant digits), yields two scientifically different answers. 4*1200 yields 5000 (5 x 10^3) while 4.0*1200 yields 4800 (4.8 x 10^3).
So, in the end, it depends, just like everything else.
IMarv
Re:Perl versus Python (Score:5, Insightful)
4.0 is definitely a 2 sig dig number, but 4 could be 1 sig dig or it could be "exact." You wouldn't say the 2 in 2*pi*r is only one significant digit, would you? Of course not, it would render any precision in pi or r meaningless.
Also, 1200 could have 2, 4, or be exact depending on the context. It's best to always use a notation that includes the fraction mark for non-exact quantities.
Re:Perl versus Python (Score:5, Informative)
Re:Perl versus Python (Score:5, Funny)
Re:Perl versus Python (Score:4, Insightful)
Re:Perl versus Python (Score:5, Insightful)
If that isn't a bug, I don't know what is.
Re:Perl versus Python (Score:5, Interesting)
The rule in his example is:
4(1 sig fig) * 1200 (2 sig figs) = 5000 (1 sig fig & rounded up since 4800 is closer to 5000 than 4000)
4.0(2 sig figs) * 1200 (2 sig figs) = 4800 (2 sig figs)
As far as software using sig figs, well...if you are using real world measurements, you should be using sig figs. You can not tell from a general ruler if you are at 0.526876". You can tell that you are between 0.5" and 0.6", so you say 0.56" Past two sig figs, you would really be pulling that out of your bum. Therefore in all the calulations that use the 0.56", you can only have a max of two sig figs in the result. Anything more would rely on you knowing up to say 3+ sig figs in all the numbers used to get the result.
Point: The number of sig figs you have makes a difference in your result. Sig figs are generally used with real world measurement systems. Computer calculations may not fall into this category, but it would depend.
Re:Perl versus Python (Score:5, Informative)
4 * 1200 = 4800 +/- 600, since 4 could represent 3.500000000000001 or 4.4999999999999.
For that matter, 1200 could represent 1249.9999 or 1150, so
4 * 1200 = 4800 +/- 625.
We just don't know how accurate the initial measurement was, so it is completely inaccurate to say that 4 * 1200 is equal to exactly 4800.
Re:Perl versus Python (Score:5, Insightful)
Quite often calculations are performed where the various values are known to have a certain amount of uncertainty. If I take a reading of "4", what is really meant is that the value is between 3 and 5. If I specify "4.0", then the value is between 3.9 and 4.1. The amount of precision is given by the number of significant figures. Thus, a value of 4.0000 implies a fairly high degree of certainty.
Given that "4" has only a single significant figure, multiplying it by an exact 1200 yields 4800. However, if you round that off to a single significant figure, then the result is 5000.
As has been discussed already, however, the "4" may be exact, in which case you need to know the uncertainty in the "1200" before the uncertainty in the result of the calculation can be determined.
Software developer here (Score:5, Funny)
Multiplying it in silly ways will not help you either.
Re:Software developer here (Score:5, Funny)
Comment removed (Score:5, Funny)
Ah, Units (Score:5, Insightful)
Re:Perl versus Python (Score:4, Insightful)
Moreover, since 4.0 is a floating point number, it's not even a very helpful abuse of notation to allow 4 and 4.0 to be 'mathematically' equal, since you can demonstrate that mathematically all floats are equal to each other: there's some nonzero epsilon small enough that epsilon + x is 'equal' to x. It is not helpful to then apply normal mathematical reasoning and conclude that all integers are equal - that is, it's nice to maintain some part of a programming language that is actually consistent, and if we're going to use the symbol '=' for both types, it's helpful at least to maintain that these are distinct overloads!
Really, any programming language for the mathematically savvy would issue a warning whenever you used a floating point type for anything; floating point support is a somewhat lame compromise for hardware compatibility. If on the other hand we had the habit of using constructive real numbers (which, unlike classical real numbers, are implementable), we would, quite rightly, be forced to reconsider the notion of equality globally.
Re:Perl versus Python (Score:5, Informative)
WTF?!? Which particular python version are you talking about?
Python2.4 and later:
>>> x0 = int(4)
>>> x1 = long(4)
>>> x2 = float(4)
>>> x3 = complex(4, 0)
>>> x0 == x1 and x0 == x2 and x0 == x3 and x1 == x2 and x1 == x3 and x2 == x3
True
>>>
Or, are you talking about inequalities (<, <=, > >=) which are required for list sorting?
In this case, it's not a python issue but a mathematical issue. You shouldn't be trying to use inequality operators on complex numers. Inequalities with scalars such as floats, ints, longs etc are a mapping (S1,S2)=>(Bool), where S1 and S2 each can be one of float, long, int, bool, string, but such mapping is not defined if S1 and/or S2 is the field 'complex'.
Your question is interesting though - a matter of whether a sort of a list of containing complex numbers should work if all the complex numbers have a zero imaginary part. I wouldn't think so. But if you're desperate, you could try something like:
x0 = int(4)
x1 = long(4)
x2 = float(4)
x3 = complex(4, 0)
list1 = [x0, x1, x2, x3]
list2 = [x3, x1, x2, x0]
def compare(x, y):
if isinstance(x, complex) and x.imag == 0:
x = x.real
if isinstance(y, complex) and y.imag == 0:
y = y.real
return cmp(x, y)
list1.sort(compare)
list2.sort(compare)
As for the 'problem' of list sort results depending on order of the original list, this only happens where there is computational equality between members of the original list, so what's the problem really?
Re:The best (Score:4, Funny)
Re:The best (Score:5, Interesting)
This has made it very convenient when running Windows under an emulator and yet be able to talk over TCP/IP to the host OS. VMWare and other advanced emulators solve this problem by setting up extra local networks and patching directly into the networking stack, but with Windows that's not strictly necessary, as you can bounce packets of a gateway that the emulated OS really shouldn't be able to reach.
Re:The best (Score:4, Insightful)
Re:The best (Score:4, Insightful)
what if one of the bugs was that authentication wasn't checked when it should be? Users hate entering passwords, and fixing that bug would REALLY annoy them.
Some UAT would have helped on that, though. The OP wasn't clear if the complaints happened after release, or during pre-release user acceptance testing.
404 (Score:5, Funny)
"404 File Not Found
The requested URL (askslashdot/07/03/30/0116246.shtml) was not found."
That little error saved me from having to read a bunch of replies.
Re:404 (Score:5, Funny)
Keyboard not found.
Press to continue.
Whenever I boot my windows machine (Score:5, Funny)
Re:Whenever I boot my windows machine (Score:5, Funny)
Windows? (Score:5, Funny)
rm (Score:5, Funny)
Re:rm (Score:4, Funny)
Yes, this was done on my first slackware box. Not sure what version it was exactly, but it was somewhere between 96-98, and i installed by downloading about 15 or so floppies...
The first command I typed on that box was 'help.' It wasn't.
Re:rm (Score:4, Funny)
The worst part is the ice cold blood running through your veins as you stare at the screen, desperately hoping that you are misreading the command line.
Re:rm (Score:5, Informative)
Re:rm (Score:5, Insightful)
Re:rm (Score:4, Informative)
Convention states that the way a program knows that no further arguments should be interpreted as command switches is by means of the -- switch. If no -- has been found, then anything which looks like a switch is generally interpreted as one.
The alternative would be to look to see if there is a -i file and if there is assume that you meant "delete file called -i" rather than "delete interactively", which runs completely contrary to another common Unix convention - specifically, that the program shouldn't try to second-guess the user.
Re:rm (Score:4, Funny)
Re:rm (Score:4, Interesting)
Re:rm (Score:5, Informative)
I have a script "lrm" which does this: ls the files, ask for confirmation, and then delete (if confirmed).
Re:rm (Score:5, Informative)
I do that as well, but there is a danger if you start working in someone else's account, where rm is not aliased as expected. It may be better to alias del='rm -i' (for example) and train yourself to type del.
Also, "rm -i" is a pain when you're deleting a large number of files at once.
Re:rm (Score:5, Informative)
In any event, you should be using "$@" (with the double-quotes)instead of $*, so you can properly preserve arguments with spaces. If you try to remove a file with a space in it with your script, it will not work as expected.
I'd also suggest adding a typeset -l yesno before the read, so you force the input string to lowercase before comparing it. Heck, let's see if it starts with a y, too. That way, y, yes, YES, and even YePaRoonIe will work...
I like ls -dF, so it doesn't show the contents of directories (-F appends a slash to the end of the filename, though, so you could add a "grep '/'" and fail if directories are present - hint: put the ls -1dF output in a variable using var=$(ls -1dF "$@"), test $?, then test inside the if block to see if the variable contains any lines that end with a slash).
Finally, you could use the ls command as your conditional statement instead of having to run ls twice. PS - the two hyphens protect you from arguments which start with a hyphen...
Email cloudmaster@cloudmaster.com with questions - I don't check replies on the dot very often.
The money lender bug in Taipan (Score:5, Interesting)
The guy who wrote the Windows version actually allows you to turn it on! Overpay the money lender and your money grows at 10% a month! The bug was in the original Apple 2 version and then subsequent ports, like the one to Palm, removed it.
The Easy to Interpret Save Files in X-COM (Score:5, Interesting)
By ordering a bunch of equipment and saving your game just before it was due to arrive (call that save game A) then saving again immediately after it arrives (call that save game B), and then copying this file from save game A to save game B, you could get whatever equipment you had ordered to arrive again. And again, and again. And you could turn around and sell all the extra stuff for cash.
Lather, Rinse, Repeat. I used to start off a game by repeating this trick until I had maxed out my cash. I found the corresponding file that allowed you to improve your tech without actually performing the research, but that was less of an advantage, since the game used your tech-level to decide how difficult the scenarios it gave you should be.
GPOW (Score:4, Funny)
Re:GPOW (Score:4, Interesting)
How about that great bug in many 8-bit ninendo games where you could "scroll" and enemy off the screen instead of killing it. I think SMB had this bug, bug-turned-feature, but many other games had it as well.
buffer overflow (Score:5, Insightful)
Re:buffer overflow (Score:5, Funny)
Not sure if this is a bug... but (Score:4, Interesting)
This allows us to deploy our java Jar's to our Folders on our network where the users launch the app from.
Yay.
Re:Not sure if this is a bug... but (Score:5, Informative)
Re:Not sure if this is a bug... but (Score:5, Informative)
That's not a bug, it's a feature. It's the reason why you don't have to reboot Unix machines after a software update, as you do for Windows.
IE6 is packed with 'features' (Score:4, Interesting)
I'll leave the provision of an exhausitive list to somebody else, but suffice to say if you're looking for a sizeable seam of bugs-which-simultaneously-screw-you-over-and-help
Easy! (Score:5, Funny)
Personally, I like... (Score:5, Funny)
Error
Nothing for you to see here. Please move along.
Nothing beats a good dose of pot-kettle interaction.
Re:Personally, I like... Actually... (Score:4, Funny)
Re:Personally, I like... Actually... (Score:5, Funny)
ModeX graphics? Buffer overflows? (Score:5, Insightful)
I've heard the 6502 (or, more specifically, RP2A03) had some useful undocumented opcodes. I think they weren't intentional, so they might count.
On the software side...how about exploitable buffer overflows on the Xbox and PSP to enable execution of arbitrary code?
Re:ModeX graphics? Buffer overflows? (Score:5, Informative)
The Rockwell 6502 was a hard-wired processor; there was no "illegal instruction" check. So, any bit-patter you loaded as an instruction would try to do something. Sometimes, because of the internal open-collector busses, you'd get neat "something OR something" that wouldn't normally happen.
Here's the I'm Feeling Lucky hit on it: 6502 Opcodes [s-direktnet.de].
Thing is, the results might vary from implementation to implementation. So they might not work usefully on the 6510, which was otherwise a 6502 with an I/O register at $0000-$0001.
Ping of Death (Score:4, Funny)
Not a software bug but a design flaw (Score:5, Funny)
The Vauxhall Astra Mk.2 (Opel Kadett E) had a design flaw in the steering column. Specifically, the steering column was rather weaker than the steering lock.
The upshot of it was when some little scrote decided to try and steal my car (this was way before cars were fitted with immobilisers), when he tried to break the steering lock the steering column snapped and the steering wheel came straight off in his hand.
Linux (Score:5, Funny)
"Subscribe to view" pages visible to Googlebot. (Score:5, Interesting)
User agent switcher extension [chrispederick.com] + Browse pretending to be GoogleBot = Annoying "register/pay to see me!" pages go away. I have no idea how many sites it works on now, but I think it still gets into a lot of archived newspaper articles and suchlike.
Re:"Subscribe to view" pages visible to Googlebot. (Score:5, Interesting)
Of course, both are examples of why you shouldn't use "User-Agent" to try and detect what browser or bot is using your webpage. The first allows "illegitimate" users access, and the second blocks legitimate users.
In fact, you shouldn't trust headers for anything unless you have a secure session. To control access to your webpage to robots, use ROBOTS.TXT or a meta tag, and to control access to other users, password protect. But the trouble is that sites are trying to eat their cake (be crawled and indexed) and have it too (control access to ordinary users).
Skiing in Starsiege: Tribes (Score:5, Interesting)
A description of skiing is here [wikipedia.org].
My Karma isn't low enough... (Score:5, Funny)
Nameless Firefox Bookmarks (Score:5, Interesting)
In Firefox, when you make a new bookmark, you need to give it a name. FF grays-out the OK button until you do. This implies that bookmarks weren't meant to be nameless. Here's the "bug": if you go to rename the bookmark, you can make it blank and the OK button remains active.
So what good is a nameless bookmark? I place all of my frequently-visited bookmarks on the menu bar, to the right of the menus (it's normally wasted space). I have over 25 bookmarks marks there, and if they had names (even one-letter names), they wouldn't fit by a long-shot. The favicons are all I need, so this ability is pretty helpful, and isn't likely to be fixed.
Re:Nameless Firefox Bookmarks (Score:5, Informative)
https://addons.mozilla.org/en-US/firefox/addon/3 176
Second Life camera (Score:5, Informative)
Re:Second Life camera (Score:5, Funny)
VW close the sunroof bug (Score:5, Interesting)
(1) You needed the key to close the sunroof.
(2) But.. a sneak path in the headlight wiring meant you could instead just turn on the headlights and pull on the high-beam flasher (on the turn-signal lever). Enough electricity would flow backwards through the sneak path to operate the sunroof motor.
Re:VW close the sunroof bug (Score:5, Funny)
telnet -l "-froot" (Score:5, Interesting)
A related "bug" is the ability to boot Linux "fail safe" with the notation 'initrd=/bin/sh' on the boot line. As MVS would say, "Thou art God!"
One of my favorites, from console gaming... (Score:5, Funny)
-JDF
Quake2 strafe jumping (Score:5, Interesting)
I dunno (Score:5, Interesting)
That's about it. Most of my bugs just break shit.
Re:I dunno (Score:4, Interesting)
Re:I dunno (Score:5, Interesting)
Years later I started learning about chaos theory and fractals, and something in my head clicked. I instantly had a vivid memory of that bugged screen and realized that it was a fractal. I had accidentally created a rather complex fractal. Blew my mind clean up.
Re:I dunno (Score:4, Funny)
So he rendered it out the way it was, and we gained another happy customer.
Physics bugs in video games are the best (Score:5, Interesting)
When the developers saw the potential it gave the game, they left it in. They realized how it made the game unique and exciting, and this bug became the standard feature that sets Tribes far apart from almost all FPS games out there, even to this day. This bug resulted in probably the closest simulation to virtual athleticism that I have ever seen, which was responsible for the fanatical, but small fanbase the Tribes series had.
If You Can't Fix It, Feature It (Score:5, Funny)
Date library (Score:5, Interesting)
January -6th
meaning december 24th the previous year.
My colleague had to remove the input validation again and keep the features.
BMW MINI CD player as burglar alarm trigger (Score:5, Interesting)
Anyway, at roughly 2:00am every morning the car alarm would go off, much to the 'delight' of myself, my neighbours and everyone in the vicinity. I'd go out, stop the alarm and then try to sleep. After which it would go off again, every hour or so.As if we weren't losing enough sleep with our then new-born daughter.
The cause was eventually traced, and it's one of the more obscure bugs I've ever come across. Turns out that the car had a low-power rather than completely off mode, and the CD player retained a tiny amount of power going through it. When it was cold, say at 2:00am on an autumn morning for example, the CD player would detect that condensation was forming and would wake up the car's electrics to create some warmth to clear the condensation. This is deliberate, and quite clever I think.
However, the problem came in that it did this too often and started causing a big drop in battery reserves. The security system interpreted this as an attempt to start the car by hotwiring it, and so the alarm would be set off. I'd come out to switch it off, then go back to bed on the cold autumn night at which point condensation would form again, the CD player would switch itself on again, the security system would sound the alarm again and a bleary-eyed version of me would stagger out to turn the alarm off again. At which point condensation would start to form again and...
Bah.
Cheers,
Ian
Re:BMW MINI CD player as burglar alarm trigger (Score:4, Funny)
The Mini Cooper dates from about 1968, very considerably before the advent of the CD player, and furthermore had even less security than Windows ME. Even if the doors were locked, you could still open them by pushing hard, because the entire door would bend such the lock mechanism no longer held the door shut! It certainly did not have an alarm.
Not only that, the electrics were so poor, it was not unknown for condensation to completely flatten the battery overnight.
Template Metaprogramming? (Score:5, Interesting)
Elevator bug (Score:5, Funny)
The only misfeature of this bug was that the bell would briefly ring alerting those waiting that they had been skipped. One time, some second floor residents heard us skip their floor and we heard them running down after us. We skipped the lobby and went back to the fourth floor. We could have kept it going all night if they tried chasing us, but they didn't. Anyone too lazy to walk to the lobby from the second floor sure isn't going to race up to the fourth floor.
Eventually, they upgraded the elevator and we had to stop for the second floor whenever they wanted.
Open Office Find&Replace to reformat Cells (Score:4, Interesting)
If you do a regex search and replace in Open office and replace all contents of cells with themselves (search for .*, replace with &, or something like that) the contents of the cells will be reformated to whatever default you set for the columns. You can use it to change a column of numbers into a text field (to sort alphanumerically) or vice versa,, (if you have a spreadsheet that imported numbers as text and and you want to change them back into numbers)
This trick is even included in the help documentation.
aMSN (Score:4, Funny)
it's fun to pre-empt conversations with girls:
me: hey how's it goin?
her: OMG I was just thinking about you
me: ya right
her: I'm serious!
me: *gush* (L)
My favorite bug (Score:5, Interesting)
How do you do it? Well, here is one reasonable way.
Sort the items in the list.
Duplicate items will be adjacent, so scan through the list and add items when they aren't equal to the last item.
Since it was lisp, I naturally started writing a recursive quicksort.
My code looked something like.
quicksort (list)
if list has size less than 2, return list
Pick pivot from list
L = filter items in list < pivot
G = filter items in list > pivot
return quicksort(L) + pivot + quicksort(R)
However, my quicksort had a bug in it.
Look closely.
It didn't append copies of pivot to the returned sorted list. Thus, it removed them. Since every item eventually ends up as the pivot, all duplicates are removed. It's the only bug that has ever ended up saving me time.
Lesson here is: (Score:5, Insightful)
It is only refactoring if the users sees no change, with the sole exception of performance gains.
Intestinal flora (Score:5, Insightful)
Automotive Bug (Score:5, Informative)
Triple Faulting the 80286 processor (Score:5, Interesting)
Did you clean up the code or break the code? (Score:4, Insightful)
Before committing any changes to a production system, I would expect that a developer would test the functionality before making change and compare the results after changes were made. This would have uncovered that you changed functionality. Another tact would have been to create unit tests before making your changes, and then run those test as you were making changes. You have have discovered that you changed functionality. Instead, you did neither, and you broke a feature.
I'm a little long in the tooth, working 18 years as a programmer. I've seen this situation many times. Every young new hire thinks that they are smarter than the people hired before them and that all of the existing code is crap. It all needs to be rewritten because the previous coders were bad programmers and if it were redone, it would be cleaner. So they rewrite existing code and they break things. I can only assume that you work for a PHB.
Any manager worth their salt would initially halt a rewrite of WORKING code. If you want to modify something that is working and has been working and has had the bugs worked out, you will really need to prove that there are benefits to doing so. And as a manager of a development group, anytime someone who is still wet behind the ears wants to rewrite code, I tell them to step back and look at the code again. Is the code really crap or is it that you just don't understand what it is doing? Perhaps having an older coder walk through some of the code, maybe explain why the code was written a certain way, might shed some light on how it is really functioning. The fact that in your case you changed functionality, it shows that you didn't understand what was going on in the first place.
Re:Yes (Score:4, Funny)
Re:Yes (Score:5, Insightful)
Re:OOB Windows bug (WinNuke) (Score:4, Funny)
Back in the modem days.... (Score:5, Funny)
Clued in 1: Try +++ATH
N00B: Than......(N00B has left the chat)
-Charlie
Re:QW strafejumping (Score:4, Interesting)
For example, in Quake 3, the sampling of the position of the player in 3 dimensions is tied to the frame rate. When the player jumps, in the physics model, the player appears in successive, discrete position along a pre-computed parabolic trajectory. Only at key frame rates, a position sample appears at the peak of the parabola. Players running at these key frame rates are thus able to jump higher. Some custom maps feature areas that are accessible only to players knowing this trick.
There is also a Quake 3 mod (Defrag) which was created to facilitate finding map bugs (e.g. rebounds, which happen when you can fall with absolutely no x or y speed component on some surfaces, happens when the z velocity gets reversed). This leads to impressive "trick jumps" which do not violate the rules of the game (since they are done without modifying the game engine). A quick look in Google and you can find many trick-jumping videos based both on synchronisation and on physics model bugs.
Re:QW strafejumping (Score:4, Interesting)
A player could be launched all the way across an outdoor map by a teammate with a fully loaded rocket launcher shot to the legs or ground immediately next to the player. Combined with some sloping surfaces, such launches could be easily performed while being very accurate. On AS-Mason such rocket launch could get a player all the way over all defenses and just an elevator ride to the final goal. That is, unless the other team is aware of the launch and has people waiting there.
It's also possible to launch players with the impact hammer, but from experience it's a little harder to perform with people who aren't familiar with the technique. While looking for some illustrations, I noticed that the wikipedia has a few paragraphs [wikipedia.org] about launching, so I won't go into more details here.
What the wikipedia article doesn't seem to mention is that it's also possible to launch your translocator pretty far with the impact hammer, for example from the top of one of the towers on CTF-Face to one of the balconies on the opposite one. Another one, which I never actually mastered, was book launch/jump. It involves standing on a book object, like those lying around on the floor in libraries, and then either hitting it with the hammer, or having someone else shoot it (I think). This, of course, also resulted in a huge jump, and is probably more of a bug than the other methods.
Most of these methods seem to be just exaggerations of standard physics, since both the impact hammer and rocket launcher are supposed to throw stuff around. At first, I found these tricks frustrating, but IMO they add a lot to the game. Especially Assault, which otherwise becomes a spam-fest with everyone camping the choke points like it's some kind of counterstrike. Epic probably recognized this, so they never changed this in UT99, but all of this is sadly gone in UT03/04.
Re:QW strafejumping (Score:4, Interesting)
Re:Not sure if youd call it a bug but... (Score:5, Interesting)
This is faster than logging off and back on, leaves the users programs open, but gives you the full admin desktop, not just a shell or explorer window.
It's too bad gksudo doesn't work on Windows...