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?"
Re:Not sure if this is a bug... but (Score:5, Informative)
Second Life camera (Score:5, Informative)
mertz (Score:2, Informative)
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: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.
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.
Re:Nameless Firefox Bookmarks (Score:5, Informative)
https://addons.mozilla.org/en-US/firefox/addon/3 176
Re:Perl versus Python (Score:1, Informative)
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:Skiing in Starsiege: Tribes (Score:3, Informative)
i'll be there still are. i wanted to play around for old time's sake a couple of years ago (popping the heads off some spoonbots) and a few people dropped into my server.
renwerx [renwerx.com], the guys who made the renegades mod, is making it's own game [ascension-game.com] called ascension. it's going to be free to the community and since it was made by the renegades, i figure they will be true to the original spirit of gameplay.
Re:BMW MINI CD player as burglar alarm trigger (Score:3, Informative)
It does, but the MINI Cooper dates from about 2002 I think. I also owned original Minis and I'm quite careful in the distinction between them - note the capitlisation. As for the condensation on them - yep, and particularly the distributor. I used to use the washing-up glove trick - cut the tips off the fingers, thread the HT leads through and then wrap the distributor in the rest of the glove. Helped a lot, though it wasn't perfect.
Cheers,
Ian
Re:GPOW (Score:3, Informative)
I personally found a Staff of the Apocolypse with 3 charges. Once you have that, you can dupe it up and pretty much just clear every level by casting 3 times, then portaling and repairing it.
Once people got item editors which allowed you to change the amount of charges to 99, it was even more useful.
Re:Perl versus Python (Score:0, Informative)
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:telnet -l "-froot" (Score:3, Informative)
Re:QW strafejumping (Score:3, Informative)
This is the only related link [google.ca] that I could find.
Re:Nameless Firefox Bookmarks (Score:2, Informative)
Re:rm (Score:2, Informative)
Re:Perl versus Python (Score:5, Informative)
Re:rm (Score:5, Informative)
Re:One of my favorites, from console gaming... (Score:3, Informative)
Speaking of hyperjumps and documented bugs, in Frontier - Elite 2 (and possibly the original Elite as well) you could jump to solar systems with your warp drive, and you could normally jump between 5 to 10 light years at a time. If you scrolled away so the distance passed 655.35 light years, the limit comparison wrapped around and you could jump 655.36 + 5 to 10 light years. If you knew your maths, you could do some simple trigonometric calculations to jump anywhere you liked in a 1310 light year radii with only two short jumps.
I don't have the manual right here, but I strongly recall that this was described vaguely in the manual.
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: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.
Not my favorite, but definitely one with impact: (Score:1, Informative)
Automotive Bug (Score:5, Informative)
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.
Re:The Easy to Interpret Save Files in X-COM (Score:3, Informative)
If you told them to pick up something heavy then they would say "too heavy"
If you had something ungodly heavy you could pick it up and move it to them, no problem.
I always had a skiff at my disposal because of that bug.
-nB
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:Software developer here (Score:3, Informative)
#include "stdio.h"
int main () {
char str = '4';
printf ("%i\n", (int) str);
return 0;
}
'4' is obviously 52. No problems comparing it to (int) 4.0 here!
[ed: stupid
Re:telnet -l "-froot" (Score:2, Informative)
That's just Sun being late to the party. Everyone else had that bug in the "r" commands back in the early 90s; 'rlogin -l -froot hostname' was great when you got spam from an unpatched server. (Which was rare enough to be entertaining.)
I think it was the Linux port of the "r" commands that had someone say, "Hey, these things have been broken _forever_!"
Re: init=/bin/sh (Score:3, Informative)
Re:404 (Score:1, Informative)
Re:aMSN (Score:3, Informative)
or try this example too. (Score:3, Informative)
create identical sets in different orders.
x = set((1,2,4.0+0.0j, 4))
y = set(( 1,3,4, 4.0+0.0j))
a = y | x
b = x | y
a == b
# result is TRUE
yx = list(a)
xy = list(b)
xy == yx
# result is TRUE
sorted(xy) # not an error
sorted(yx) # is an error
The funny thing is that you are not even guarnteed which of those will work and which will be an error. This is because the storage order of the set is not stable so it can change the order of the underlying lists.
oddly enough for some reason the lists come out of the set the same order they went in. This is appropos the topic of this discussion of a non-guarentteed feature that I am relying on.
Re:Air-cooled VW transmissions. (Score:3, Informative)
Re:Did you clean up the code or break the code? (Score:3, Informative)
A lot of what I was doing was requested by the management to stop people from taking advantage of poor deadline calculations and to break certain workarounds discovered by the employees.
In the process of locking up some of these holes, there were some actual unintended behaviors (per the original documentation, they were prohibited) which became a vital part of the work flow process.
Although I'll cop to breaking a few things in the interest of cleaning them up, then immediately having to revert my changes, a lot of these bugs-as-features were in fact bugs which later became vital to the process.
Re:ModeX graphics? Buffer overflows? (Score:1, Informative)
The z80 even had undocumented hardware features that got used in some computers. For example, the contents of the A register would appear on the upper 8 bits of the address bus for some port operations, which were occasionally used to do weird and wonderful "magic". For example, on a microbee 256 the clock rate of the CRTC could be changed using the following code:
LD A,1 - load the A register with 1
IN A,(9) - load the A register from port 9
which makes absolutely no sense until you realise that LD A,1 actually sets bit 8 of the address bus during the the IN instruction, and putting 9 on the lower 8 bits would cause bit 8 to be latched.
Re:rm (Score:3, Informative)
The -f argument overrides -i at least in the Solaris and Ubuntu boxes I frequent, so not so much of a pain.
A personal preference in the end.
Re:aMSN (Score:2, Informative)