WOT: ARRGGHHH, i hate fixing someone elses code!, F%^$SH*&@@@ |
|
Porsche, and the Porsche crest are registered trademarks of Dr. Ing. h.c. F. Porsche AG.
This site is not affiliated with Porsche in any way. Its only purpose is to provide an online forum for car enthusiasts. All other trademarks are property of their respective owners. |
|
WOT: ARRGGHHH, i hate fixing someone elses code!, F%^$SH*&@@@ |
SirAndy |
Aug 15 2005, 07:33 PM
Post
#1
|
Resident German Group: Admin Posts: 41,815 Joined: 21-January 03 From: Oakland, Kalifornia Member No.: 179 Region Association: Northern California |
this was supposed to be a simple stripped down BASE64 decoder done in java.
i don't (can't) use a lot of standard libraries because this App will be run on PDAs and java enabled cellphones, so SIZE does matter. no problem, i get one of my contractors the BASE64 specs and some sample implementations ... he's been fighting with this for 3 days now so i get his sourcefile and have a look at it this morning. looks OK at first glance, but when you run it, it sporadically spits out wrong bytevalues while some decode just fine. wtf? so i spend all day going through his code (which is not that much) and i just can't figure out what's wrong. then finally, about 15 minutes ago it dawns on me, have a look at this: bReturn2[nn+2] = (byte)(iRes % 0xFF); bReturn2[nn+1] = (byte)((iRes >> 8) % 0xFF); bReturn2[nn+0] = (byte)((iRes >> 16) % 0xFF); bReturn2 is a byte array, iRes a integer, the purpose is to roll the lower 3 bytes of the integer into 3 sequential fields in the byte array. i had been staring at this for 6 hours and couldn't figure out what was wrong. all the while it was right in front of me, plain sight, right there ... (IMG:http://www.914world.com/bbs2/html/emoticons/headbang.gif) can you find the error? (IMG:http://www.914world.com/bbs2/html/emoticons/idea.gif) Andy PS: did i mention that i HATE going through someone else code? |
SirAndy |
Aug 15 2005, 08:32 PM
Post
#2
|
||
Resident German Group: Admin Posts: 41,815 Joined: 21-January 03 From: Oakland, Kalifornia Member No.: 179 Region Association: Northern California |
nope, nothing missing, syntax is just fine, compiles and runs without an error ... (IMG:http://www.914world.com/bbs2/html/emoticons/wink.gif) Andy |
||
Lo-Fi Version | Time is now: 27th September 2024 - 07:53 AM |
All rights reserved 914World.com © since 2002 |
914World.com is the fastest growing online 914 community! We have it all, classifieds, events, forums, vendors, parts, autocross, racing, technical articles, events calendar, newsletter, restoration, gallery, archives, history and more for your Porsche 914 ... |