- Feature Articles
-
CodeSOD
- Most Recent Articles
- What a More And
- Hall of Mirrors
- Magical Bytes
- Contact Us
- Plugin Acrobatics
- Recursive Search
- Objectified
- Secondary Waits
- 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
Most don't make any assumptions (if designed correctly), but unfortunately, this one does make some assumptions. It assumes you won't do certain things involving pointers and typecasting - basically (as I understand it), that you won't have two pointers of completely different types pointing to the same bit of memory (with certain execeptions - see the gcc manpage). If you've enabled -Wstrict-aliasing or -Wall, it should warn you about the most obvious cases, though it can't catch them all. The warning usually seems to be "type-punned pointer breaks strict aliasing rules".
Admin
9600 was available on dedicated lines, not general lines, way back when.
Admin
Couldn't you have done either of the following:
Admin
8192 is 2^13. Unlucky for some, lucky for workarounds I guess
Admin
There is a small bug in Java TCP/IP on Windows, where you will get connection reset errors on a perfect and by-the-book teardown of the connection. This can cause all sorts of problems when you have a server on big iron (some Unix, all OS/390) that expects the connection to close gracefully and w/o error.
I found an obscure reference to this in the JVM "features" documentation that recommends sleeping the thread for a bit before sending back the final close. I wen whole-hog and made the sleep value a hidden property we could turn on or off as necessary.
Admin
One version of Photoshop (5.0 IIRC) had the same problem. Adobes workaround: Tell the user to select Help->About Photoshop after any operation involving the printer driver. Fortunately it was fixed in a patch some time later.
Admin
Um, no this action calls out the quoted poster's concern -- if the bit's already set, it can become unset by adding some values... + ain't ||
Admin
If the bit's already set there's no need to set it again, is there? *roll eyes*
Admin
My comment was about the "add" being a bad instruction to give a user because telling someone to blindly "add x to y" as the poster suggested, does not consider the current value of the magic bit, so it is no safer than telling them to just stuff 8192 into the box, wiping out any other bits that had been set (as suggested in the first post that the "add 8192" poster was commenting on)
The instructions seem to assume that the user either has no way of figuring out if the magic bit is set, or wouldn't be told that the purpose of "8192" is to turn on one bit...
(I'm presuming, based on considerable experience, that many people with problems will be told to "try this fix" or might be told to do it more than once
Admin
Well... the immediate WTF IMHO is that Notes used a ridiculously low ticks/second value of 100. Make that 2^64 and that problem is gone for good. Of course using time for a unique ID is still a problem, since even the server time can (and will) jump forward and backward (!) - e.g. when you synchronize with a time server. Jumping forward usually isn't a problem, and for small deltas jumping backward can be bypassed by slowing down the clock for a short time - but that still leaves us with jumping backward by a huge amount of time. In that case your unique IDs are gone, and so is the "sequence number" attribute of the timestamp.
That's a nasty problem in IT systems - and using pure sequence numbers doesn't solve everything. E.g. a transaction B that happened after some other transaction A can have the proper sequence number (B > A), but those transactions can still have timestamps A > B which is confusing at least. Users don't like such things, and programmers must be very aware of this when extending/maintaining the system.
Admin
My first programming courses were on a VM/CMS system (actually built by Siemens I believe), so we would spend a lot of time compiling and running our exercise programs. We were told to keep hitting the ENTER key while this was in progress; this would cause the scheduler to notice that the job, being "interactive", needed higher priority.
I never took the trouble to verify this. It does make sense; the population of the system was very diverse, mixing highly interactive use with very long term batch processing.
Admin
This sounds like you made your course at the "Spengergasse"?
Admin
This reminds me of the CGI script I wrote two weeks ago. It calls a commandline application for which I do not have the source code. The application works fine when called on the command line, but invariably crashed when called through the CGI script.
The fix: prior to invoking the application, set some arbitrary environment variable to a large enough value (the script uses "aaaaa(...)rgh" with a thousand "a"s).
I think we can all guess which language this application was written in. The WTF, as far as I'm concerned, is that people who should know better keep defending this language. Some even propagate it for entry-level programming courses.
Admin
Anyone read the entry in the Lotus Bug DB?
LOL! And this after Moore'sLaw and all :-)
Admin
I was making a file system for flash chip on an embedded system. After some changes the chip would start to lose all the data written to the file system after reprogramming the system. The problem was fixed by adding sleep(500) to the beginning of the file system initialization routine.
Admin
We've had a similar one, in PHP. A certain script would cause PHP to segfault every now and then, until we put in a line to send us an e-mail when it started up. Works fine now!
Admin
The .NET framework 1.x had/has some pretty hellacious bugs that could really sneak up on you. Take for example http://thedotnet.com/nntp/127816/showpost.aspx. Copying to the clipboard would throw an exception for no reason, and this behavior was completely random; would only happen on some machines some of the time with no apparent pattern. QA went nuts trying to reproduce, luckily google saved the day. The best workaround I could come up with was just to retry the copy operation N times and then fail gracefully, however it always ended up working on the 2nd or 3rd try....
Another horrible one was http://www.thescripts.com/forum/thread102504.html. Our testing servers in certain configurations were dying rather quickly due to being unable to open files/sockets/etc. Perfmon told me it was because there were too many OS handles open. Looking at the process with Sysinternals handle viewer showed 10,000 or so open registry handles...oops! The problem was, after a thorough audit of the code, there was no possible way that I wasn't Close()ing every registry key I was opening. Besides, even with previously experienced handle leaks, I had never seen anything happening this fast. However I resisted what now seems obvious because I couldn't believe that MS would ship a somewhat important class like RegistryKey that didnt implement Close() properly. Blech. When I finally decompiled the framework libraries I found this:
The problem was that when calling RegistryKey.OpenRemoteBaseKey, the key being returned was set such that GetSystemKey() returned true. Makes sense right, I mean HKEY_LOCAL_MACHINE is a *system* key. Why should it matter that this system key happens to reside on a remote machine?
My fix in this case was to implement my own RegistryKey class using the Win32 Reg* API.
Problems like this ended up being so common that I now ask any interviewee who claims to have worked with .NET to give me an example of a bug they've experienced in the framework/class libs. If they can't think of one then I become suspicious that they've lied about how much experience they have :p.
Admin
There were two levels to the workaround. Level 1 is this: every time you run the program, you go into Task Manager and set it to run only on one CPU. Level 2 involved downloading a program that would change something in the .exe file to bind the program to a single CPU. I don't remember the name of the program, though.
Admin
No that doesn't fix the bug. You must be having a memory leak somewhere, and the additional function calls to displaying the dialogbox has "stretched" the range of "valid memory".
Similiarly I notice sometimes an array declaration alleviates segfaults, e.g. int segfaultbuster[1024]; or int * segfaultbuster = (int*)malloc(1024); note that the previous one 'works' better if the segfaults are caused at load time.
Again, that's NOT a fix.
Admin
Damn! I finally get a WTF posted and I was on vacation that week ....
I was waiting for someone to say 'The real WTFis that he was using Access' but no one bit.
Admin
(It was the university of Nijmegen, actually.)
Admin
There is a good Microsoft Workaround for old Foxpro apps. Simply set the maximum memory to 128 MB in your boot.ini. Of course windows runs like a sloth on methadone, but the foxpro app will start!
Admin
Oh, yes, I've _done_ that workaround. I think that the apparently missing file fools the install into adding the required licence keys to the registry.
That said, Before I read the kb, I found where the keys were in the registry, using the old binary division method - Yes, export the entire registry on a working machine, and import bits of it untill it starts/stops working (Licence was misspelt license, for obscurity!) - , and did a small registry export and imported it whenever the problem occoured. Made me look real good when I emailed a .reg file to someone and had them working in 5 minutes!
CAPTCHA:awesomeness
Admin
This week's issue of "InfoWorld" has a cover story "Heroic Hacks and Inspired Work-arounds". They seem to think that they are good things. I think that they fail to separate making it go right and technical ugliness. The former is important; the latter is very unfortunate.
Sincerely,
Gene Wirchenko
Admin
I worked on a project that uses MSSql 2k and it's BULK-INSERT statement. The system initially deletes data from a bunch of tables and afterwards inserts data into these tables again. The statement spawns a lot of threads when executing - all of which are out of control of the caller.
We started experiencing deadlocks when runing jobs that deleted only a small amount of data. We consulted Microsoft PS but they could not identify the source of the lock. Our own analysis indicated, that some of the threads deleting data were not finished before BULK-INSERT started inserting data into the tables again. We tried to insert some delays in the code to "let the threads finish", but we could not determine exactly how long we should let it wait.
Due to some other errors we discovered that we had to let BULK-INSERT check for constraints when loading data - something it does not do per default. Since the system is performance-critical, we hesitated to deploy this feature since it greatly diminishes performance. However, we realized that when we had it check for constraints - and thereby slowed down the system considerably - the problem with dead-locks dissapeared.
We still don't know what caused the dead-locks ... but it has not shown it's ugly face since.
:o)
Admin
I haven't seen alot of javascript around here. So here is my hack/workaround for reading binary files in IE using the "Scripting.FileSystemObject".
For security reasons you are only able to open a file as a textStream. This ofcourse works perfectly except on images and the sorts. So i have written this function to work around the limitations the scriptingFileObject has. When you encouter a illegal ASCII value with your text stream it always returns some strange 2 byte value. It's not a unicode charcter it seems pretty random. But it is the same for the value you realy need.
And using this hackish function it seems you can actually read binary files. Have fun bashin it =P
Admin
It was not exactly that.
In fact, Ariane 5 had a larger drift range than Ariane 4. When the max drift angle is exceed, it means the rocket is starting to fall back to Earth.... To avoid any civil disaster, the Ariane rocket auto-desctruct itself in case of drift overflow.
The WTF was : Ariane 5 had phycically a larger drift range, but had programatically the Ariane 4 drift range (due to some WTF programmer). So when Ariane 5 started to drift and exceed Ariane 4 max drift angle, the software told the rocket to explode.
I think this WTF is a record since it is the most expensive WTF in the story of I.T. Billions of Euros returned to ashes juste because the wrong soft version has been deployed....
Admin
hihi,
can you please explain to me how this works?
lets say i am going to open a .jpg file, and i create a textstream object outta it by
var xxx = fso.openTextFile("C:\blah.jpg");
and then i parse xxx byte by byte to convert these numbers to a hexademical representation?
regards
damon
Admin
Hi,
I tried the given solution. but didn't solve the issue. I am using Access 2003. Can u suggest any othe solution?
Thanks,
Admin
Not exactly a "programming" workaround, but here goes..
There was this DOS-based game called Cyberia which didnt have an explicit save feature. The game however had checkpoints, and it auto-saved your progress at those checkpoints.
However, there were certain series of checkpoints which would always "dissapear" upon exiting the game.
This essential meant there was no way for me to complete the game unless I played it all at a stretch, without even exiting the game.
I knew the game had to be saving the progress in some sort of "savefile", so I noted down all files in the game directory before starting the game, and after exiting the game.
The solution?
>copy savefile1 savefile2
Oh, and I was only 12 years old then :P
PS: Thank you MS-DOS. Those years of tweaking config.sys/autoexec.bat, writing custom batch files, etc, sure helped train my young mind.
Admin
A-MEN to that PS. So much about learning in MS-DOS (actually first learned in Atari BASIC. Ugh.) has helped me think better about solutions.
Admin
Admin
We had to manually install a COBOL application, executed in a MSDOS prompt under windows xp, on three hundred PC, via remote control. For evry installation, the application had to import a very large amount of data, and the process took more than 2 hours for every PC. Then we found that we could drammatically speed up the import speed, if the MSDOS promt windows was the active windows and keeping pressed the space key. (please, don't ask) A futrther improvement to the installation process was blocking the space key in the pressed position using a coin stuck between the key and the keyboard.
...