Uli's Web Site
[ Zathras.de - Uli's Web Site ]
Other Sites: Stories
Pix
Abi 2000
Stargate: Resurgence
Lost? Site Map!
 
 
     home | blog | moose | programming | articles >> blog

 Blog
 
 Archive
 
 Blog Topics
 

15 Most Recent [RSS]

 Less work through Xcode and shell scripts
2011-12-16 @600
 
 iTunesCantComplain released
2011-10-28 @954
 
 Dennis Ritchie deceased
2011-10-13 @359
 
 Thank you, Steve.
2011-10-06 @374
 
 Cocoa Text System everywhere...
2011-03-27 @788
 
 Blog migration
2011-01-29 @520
 
 All you need to know about the Mac keyboard
2010-08-09 @488
 
 Review: Sherlock
2010-07-31 @978
 
 Playing with Objective C on Debian
2010-05-08 @456
 
 Fruit vs. Obst
2010-05-08 @439
 
 Mixed-language ambiguity
2010-04-15 @994
 
 Uli's 12:07 AM Law
2010-04-12 @881
 
 Uli's 1:24 AM Law
2010-04-12 @874
 
 Uli's 6:28 AM Law
2010-04-12 @869
 
 Uli's 3:57 PM Law
2010-04-12 @867
 

More...

Denkste: Stupid mistakes that we keep on making

In German, there's the word "denkste". My dictionary says the English translation is "That's what you think!". This word precisely describes how I felt after fixing a bug in my web site. There was a bug in the PHP code for HTML-encoding the descriptions in my application lists, which caused every single line break to be turned into two <br> tags.

You may have noticed it, and it looked atrocious. So, after un-registering from my last exam today and finding out that they wouldn't need me at rehearsal tonight, I thought I'd finally squish that bugger. And what do you know, it was a typical case of denkste: I was using implode() to glue together the array of lines I'd read using file(). Now, I knew that file() returns each line as a new array item but doesn't remove the line breaks from the end of the array items. I also knew that calling implode("\n", $array) would insert a line break between the lines it glues together. What I'd failed to notice until checking things again today, was that line feed at end of array item + line feed inserted between array items = 2 line feeds.

So, I thought: "I know how this works, I wouldn't make that stupid mistake", and the computer said denkste!. It's the kind of mistake every person occasionally makes. When next you do it, feel free to remember denkste. It's too precise a word not to be popularized beyond this little European country.

 
Created: 2005-03-23 @730 Last change: 2005-03-23 @745 | Home | Admin | Edit
© Copyright 2003-2014 by M. Uli Kusterer, all rights reserved.