― Jon Williams (ex machina), Friday, 28 February 2003 14:40 (twenty-two years ago)
― Dan Perry (Dan Perry), Friday, 28 February 2003 14:44 (twenty-two years ago)
― Ed (dali), Friday, 28 February 2003 14:45 (twenty-two years ago)
― Dan Perry (Dan Perry), Friday, 28 February 2003 14:45 (twenty-two years ago)
I got a good VB one.... I had to maintain an application written using VBA and VB forms on top of Excel with something like 120 different forms. There was no good way to make each form subclass some base form class... .ugh
― Jon Williams (ex machina), Friday, 28 February 2003 14:46 (twenty-two years ago)
― Tracer Hand (tracerhand), Friday, 28 February 2003 14:53 (twenty-two years ago)
str1[strlen(str1)] = '';
(strlen gives the length of the string by finding the first '' character. the above therefore reads 'find the first '' and replace it with a '''.)
his excuse was that it was 4am when he wrote it.
we also have an isBoolean function which is very confusing (boolean isn't a Boolean, it's an int):
if (boolean == TRUE || boolean == FALSE) return TRUE;return FALSE;
andy
― koogs (koogs), Friday, 28 February 2003 15:02 (twenty-two years ago)
Best function EVAH!
― Dan Perry (Dan Perry), Friday, 28 February 2003 15:04 (twenty-two years ago)
I'm dealing with 40k lines of umcommented C written by ~5 programmers over the past 10 years with no Makefiles. No one ever though to #define the magic numbers used throughout the code (array sizes in databases, etc). It was originally Xenix code, ported to SCO and now Linux crap. Alignment issues all over the place too :(.
― Jon Williams (ex machina), Friday, 28 February 2003 15:07 (twenty-two years ago)
if ((*str > 96) && (*str < 123)) *str = *str - 32;
for magic number horribleness. and why bother rewriting tolower() anyway?
all the code here is in .h files and for each module there is one .c file that contains nothing but #includes of these files.
plenty of comments though. pity they don't always match the code...
― koogs (koogs), Friday, 28 February 2003 15:23 (twenty-two years ago)
Someone needs killing.
― Andrew Farrell (afarrell), Friday, 28 February 2003 15:29 (twenty-two years ago)
― caitlin (caitlin), Friday, 28 February 2003 15:42 (twenty-two years ago)
#include <stdio.h>#include <ctype.h>#include <cbase/dtypes.h>#include <cbase/dirio.h>#include <cbase/escape.h>#include <cbase/form.h>
/*VARIABLES ARE*/float v[40], yield, efficiency, cost;short i, wholenum2, wholenum3, wholenum1, wholenum;
main(argc, argv)int argc;char *argv[];{ if (argc < 7) { printf("Execute as yield $BLANKWIDTH $BLANKLENGTH $SHEETWIDTH $SHEETLENGTH $THICKNESS $PRICE\n"); return; }
i = 1; while (i < 7) v[i++] = atoreal(*++argv); i = 7; while ( i < 38) { v[i] = 0; i++; }
v[7] = v[1] + v[5]; v[8] = v[2] + v[5]; v[9] = v[3]/v[7]; wholenum = v[9]; v[10] = v[9] - wholenum; v[11] = v[10] * v[7]; if (v[11] > v[8]) v[12] = v[11]/v[8]; v[13] = v[4]/v[8]; wholenum = v[13]; v[14] = v[13] - wholenum; v[15] = v[14] * v[8]; if (v[15] > v[7]) v[16] = v[15]/v[7]; v[17] = v[3]/v[8]; wholenum = v[17]; v[18] = v[17] - wholenum; v[19] = v[18] * v[8]; if (v[19] > v[7]) v[20] = v[19]/v[7]; v[21] = v[4]/v[7]; wholenum = v[21]; v[22] = v[21] - wholenum; v[23] = v[22] * v[7]; if (v[23] > v[8]) v[24] = v[23]/v[8]; wholenum = v[9]; wholenum1 = v[13]; v[25] = wholenum*wholenum1; wholenum1 = v[17]; if (v[12] != 0) { wholenum = v[12]; v[26] = wholenum * wholenum1; } else if (v[16] != 0) { wholenum = v[16]; v[26] = wholenum * wholenum1; } v[27] = v[25] + v[26]; wholenum = v[21]; v[28] = wholenum1 * wholenum; wholenum1 = v[13]; if (v[20] != 0) { wholenum = v[20]; v[29] = wholenum * wholenum1; } else if (v[24] != 0) { wholenum = v[24]; v[29] = wholenum * wholenum1; } v[30] = v[28] + v[29]; if (v[27] > v[30]) v[31] = v[27]; else v[31] = v[30]; yield = v[31]; v[32] = v[3] * v[4]; v[33] = v[31] * v[1] * v[2]; v[34] = v[33]/v[32]; efficiency = v[34]*100;
v[35] = v[32]/144; v[36] = v[35] * v[6]; v[37] = v[36]/v[31]; cost = v[37];
/* i = 1; while ( i < 38) { printf("v[%d] = %s\n", i, realtoa(v[i])); i++; }*/ printf("Blank Width = %.3f\n", v[1]); printf("Blank Length = %.3f\n", v[2]); printf("Sheet Width = %.3f\n", v[3]); printf("Sheet Length = %.3f\n", v[4]); printf("Saw Blade Cut Thickness = %.3f\n", v[5]); printf("Square Foot Price/Sheet =%.3f\n\n", v[6]); printf("Yield = %.0f\n", yield); printf("Efficiency = %.3f\n", efficiency); printf("Cost per piece = %.3f\n\n", cost); if (v[31] == v[27]) { wholenum1 = v[16]; wholenum = v[17]; wholenum2 = v[12]; wholenum3 = v[21]; if (wholenum1 != 0 && wholenum != 0) { printf("Cut %d, %.2f inch strips from %.2f inch length.\n", wholenum1, v[1], v[4]); printf("Cross cut %d, %.2f inch pieces from these strips.\n", wholenum, v[2]); } else if (wholenum2 != 0 && wholenum3 != 0) { printf("Cut %d, %.2f inch strips from %.2f inch width.\n", wholenum2, v[2], v[3]); printf("Cross cut %d, %.2f inch pieces from these strips.\n", wholenum3, v[1]); } wholenum = v[9]; printf("Cut %d, %.2f inch strips from %.2f inch width.\n", wholenum, v[1], v[3]); wholenum = v[13]; printf("Cut %d, %.2f inch pieces from %.2f inch length.\n\n", wholenum, v[2], v[4]); } else if (v[31] == v[30]) { wholenum1 = v[24]; wholenum = v[9]; wholenum2 = v[20]; wholenum3 = v[13]; if (wholenum1 != 0 && wholenum != 0) { printf("Cut %d, %.2f inch strips from %.2f inch length.\n", wholenum1, v[2], v[4]); printf("Cross cut %d, %.2f inch pieces from these strips.\n", wholenum, v[1]); wholenum = v[17]; printf("Cut %d, %.2f inch strips from %.2f inch width.\n", wholenum, v[2], v[3]); wholenum = v[13]; printf("Cut %d, %.2f inch pieces from %.2f inch length.\n\n", wholenum, v[1], v[4]); } else if (wholenum2 != 0 && wholenum3 != 0) { printf("Cut %d, %.2f inch strips from %.2f inch width.\n", wholenum2, v[1], v[3]); printf("Cross cut %d, %.2f inch pieces from these strips.\n", wholenum3, v[2]); wholenum = v[17]; wholenum = v[17]; printf("Cut %d, %.2f inch strips from %.2f inch width.\n", wholenum, v[2], v[3]); wholenum = v[21]; printf("Cut %d, %.2f inch pieces from %.2f inch length.\n\n", wholenum, v[1], v[4]); } else if (wholenum1 == 0 || wholenum == 0) { wholenum = v[17]; printf("Cut %d, %.2f inch strips from %.2f inch width.\n", wholenum, v[2], v[3]); wholenum = v[21]; printf("Cut %d, %.2f inch pieces from %.2f inch length.\n\n", wholenum, v[1], v[4]); } else if (wholenum2 == 0 && wholenum3 == 0) { wholenum = v[17]; printf("Cut %d, %.2f inch strips from %.2f inch width.\n", wholenum, v[2], v[3]); wholenum = v[21]; printf("Cut %d, %.2f inch pieces from %.2f inch length.\n\n", wholenum, v[1], v[4]); } }
}
― Jon Williams (ex machina), Friday, 28 February 2003 15:43 (twenty-two years ago)
Do you work for Wernham & Hogg?
― Andrew Farrell (afarrell), Friday, 28 February 2003 15:48 (twenty-two years ago)
This is a great "programmers laugh like loons, non-programmers stare at them" moment.
― Andrew Farrell (afarrell), Friday, 28 February 2003 15:50 (twenty-two years ago)
... you are thinking of the number 6!
― Andrew Farrell (afarrell), Friday, 28 February 2003 15:52 (twenty-two years ago)
― cprek (cprek), Friday, 28 February 2003 15:52 (twenty-two years ago)
SessionRequest.iName[0] = NULL; const OLECHAR* polechPath = oleszServerName; int nBufSize = sizeof( SessionRequest.iName ); for( const WCHAR* pwchPosDot = polechPath + wcslen(polechPath) - 1; *pwchPosDot != L'.' && pwchPosDot != polechPath; pwchPosDot-- ); if( *pwchPosDot == L'.' ) { for( const WCHAR* pwchPosSlash = pwchPosDot - 1; *pwchPosSlash != L'\\' && pwchPosSlash != polechPath; pwchPosSlash-- ); if( *pwchPosSlash == L'\\' && (pwchPosDot - pwchPosSlash) <= nBufSize ) { pwchPosSlash++; // Copy over the substring for( char* pchPos = SessionRequest.iName; pwchPosSlash != pwchPosDot; *(pchPos++) = (char) *(pwchPosSlash++) ); *pchPos = NULL; } }
― RickyT (RickyT), Friday, 28 February 2003 15:54 (twenty-two years ago)
THIS CODE WAS MADE BY A MATH GRAD STUDENT
― Jon Williams (ex machina), Friday, 28 February 2003 15:54 (twenty-two years ago)
― cprek (cprek), Friday, 28 February 2003 15:58 (twenty-two years ago)
― Andrew Farrell (afarrell), Friday, 28 February 2003 15:58 (twenty-two years ago)
― Andrew Farrell (afarrell), Friday, 28 February 2003 15:59 (twenty-two years ago)
Does anyone see what i am getting at?
― Jon Williams (ex machina), Friday, 28 February 2003 16:00 (twenty-two years ago)
I see exactly what you're getting at. It's the same as the joke about the engineer/physicist/mathematician in a fire, where the punchline is the mathematician wakes up, lights a match, puts it out, says "clearly there exists a proof" and goes back to sleep.
― Andrew Farrell (afarrell), Friday, 28 February 2003 16:02 (twenty-two years ago)
You're wrong Andrew. Enjoy it while you can, but this is a historically persistent problem in software engineering. There will always be times when you have to work with someone else's old incompetence.
― cprek (cprek), Friday, 28 February 2003 16:03 (twenty-two years ago)
Er, about which bit?
― Andrew Farrell (afarrell), Friday, 28 February 2003 16:06 (twenty-two years ago)
it works when i wrote it
― Jon Williams (ex machina), Friday, 28 February 2003 16:07 (twenty-two years ago)
― cprek (cprek), Friday, 28 February 2003 16:15 (twenty-two years ago)
― Jon Williams (ex machina), Friday, 28 February 2003 16:18 (twenty-two years ago)
But it's the transitory nature of this that makes me love my job. Like sand in the wind...
― Andrew Farrell (afarrell), Friday, 28 February 2003 16:19 (twenty-two years ago)
beautiful.
― cprek (cprek), Friday, 28 February 2003 16:31 (twenty-two years ago)
― donut bitch (donut), Friday, 28 February 2003 17:54 (twenty-two years ago)
― Colin Saunders (csaunders), Friday, 28 February 2003 18:42 (twenty-two years ago)
― Jon Williams (ex machina), Friday, 28 February 2003 18:46 (twenty-two years ago)
This entire thread is as good as Greek to me. Though some of the lines of code make interesting visual patters if you scroll past them fast.
― I'm Passing Open Windows (Ms Laura), Friday, 28 February 2003 20:30 (twenty-two years ago)
― Martin Skidmore (Martin Skidmore), Friday, 28 February 2003 21:08 (twenty-two years ago)
― I'm Passing Open Windows (Ms Laura), Friday, 28 February 2003 21:24 (twenty-two years ago)
― Colin Saunders (csaunders), Friday, 28 February 2003 21:34 (twenty-two years ago)
― Martin Skidmore (Martin Skidmore), Friday, 28 February 2003 21:36 (twenty-two years ago)
― Sterling Clover (s_clover), Friday, 28 February 2003 21:49 (twenty-two years ago)
― Jon Williams (ex machina), Saturday, 1 March 2003 07:39 (twenty-two years ago)
― electric sound of jim (electricsound), Saturday, 1 March 2003 07:40 (twenty-two years ago)
― RickyT (RickyT), Saturday, 1 March 2003 11:11 (twenty-two years ago)
― rex jr., Saturday, 1 March 2003 13:26 (twenty-two years ago)
if (msg.getA()!=null && msg.getB()!=null && msg.getC()!=null && msg.getD()==null) return 15;
if (msg.getA()!=null && msg.getB()!=null && msg.getC()==null && msg.getD()!=null) return 14;
if (msg.getA()!=null && msg.getB()!=null && msg.getC()==null && msg.getD()==null) return 13;
if (msg.getA()!=null && msg.getB()!=null && msg.getC()!=null && msg.getD()!=null) return 16;
if (msg.getA()!=null && msg.getB()==null && msg.getC()!=null && msg.getD()!=null) return 12;
// 11 more just like the above here...
return 0;}
sigh
― koogs (koogs), Wednesday, 25 August 2004 07:21 (twenty-one years ago)
― Ricardo (RickyT), Wednesday, 25 August 2004 07:26 (twenty-one years ago)
― koogs (koogs), Wednesday, 25 August 2004 07:41 (twenty-one years ago)
― Ricardo (RickyT), Wednesday, 25 August 2004 07:52 (twenty-one years ago)
― Andrew (enneff), Wednesday, 25 August 2004 08:53 (twenty-one years ago)
Also, am I reading this right; all 16 possibilities are represented and it STILL caps off with a "return 0;"?
― VengaDan Perry (Dan Perry), Wednesday, 25 August 2004 13:19 (twenty-one years ago)
he actually seemed pleased about it when i queried him because he'd put the more likely scenarios first in the list...
― koogs (koogs), Wednesday, 25 August 2004 13:34 (twenty-one years ago)
― VengaDan Perry (Dan Perry), Wednesday, 25 August 2004 13:42 (twenty-one years ago)
― Ricardo (RickyT), Wednesday, 25 August 2004 13:46 (twenty-one years ago)
we asked some company to set us up an account so we could download their data from their website. a day later we tried to access it given the username and password we'd supplied and got the following ColdFusion error in the browser window:---An error occurred while evaluating the expression:
(#username# is "blah1") or (#url.username# is "blah2") or (#url.username# is "blah3") or (#url.username# is "blah4") or (#url.username# is "blah5") or (#url.username# is "blah6") or (#url.username# is "blah8") or (#url.username# is "blah8")
Error near line 10, column 228. ---
(names have been changed to protect the stupid)
but it gets better than that. we tried again using the right case and got:---An error occurred while evaluating the expression:
(#url.password# is "password1") or (#url.password# is "password2") or (#url.password# is "password3") or (#url.password# is "password4") or (#url.password# is "password1") or (#url.password# is "password6") or (#url.password# is "password7")
Error near line 18, column 203.---
(again, i've changed the passwords. they were in plaintext. one was 12345678. it also doesn't seem to be checking name/password pairs - any password would work with any name)
― koogs (koogs), Monday, 6 September 2004 11:38 (twenty-one years ago)
we do a lot of stuff with vb.net. it's not so bad. better than it's predecessors, that's for dang sure.
i've dealt a lot with no boundary checking and sql injection fun, etc etc. we've had some folks put passwords in their javascript code. awesome shit.
a lot of rapid prototypers (and that's pretty much my specialty over the last couple years) code awfully. elegance is left for the rewrite. it's about convincing code demons to wash your car and take the client to the golf course.
i've inherited some prototype code to reorganize and honestly, some hacks never EVER become pretty. some libraries are used in ways no one ever imagined they'd be used. when i was in school there was this guy who was probably one of the smarter guys in the dept for the last several years and he wrote some crazy imaging/computer vision software for the navy and one of the main professors. after he left, 5 separate, very intelligent people got their hands on that code and only one of them ever made very much sense of it. i saw some of the code cause i did sysadmin work for the dept and got to stare at everybody's problems... it was just nasty. it was like ~40K lines spread out in the most bizarre fashion.
evidentally, i was told later by an elder who was good buddies with him... he had just broke up with his fiancee. he rarely slept. he was addicted to dexedrine. etc. must forget about girlfriend... CODE OR DIE! with imaginary bees chasing his ass.
it showed. m.
― msp (msp), Tuesday, 7 September 2004 05:19 (twenty-one years ago)
― Spinning Down Alone You Spin Alive (ex machina), Sunday, 7 November 2004 01:06 (twenty years ago)
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGH
― wetmink (wetmink), Sunday, 21 November 2004 23:23 (twenty years ago)
function html_closeHref(){ // DESCRIPTION // Creates the HTML for the closing of an Href // PARAMS // None
html_write('</a>');}
where html_write() is:
function html_write(response){ // DESCRIPTION // Writes the HTML // PARAMS // None // alert(response); document.write(response);}
when did just writing </a> in a flat html file go out of fashion?
there's a whole tree of included functions, hundreds of lines of code, functions calling functions calling functions that dynamically writes html to do something that doesn't need to be done. taken him ages to write and us an whole afternoon to try and decipher.
― anon_andrews, Friday, 26 November 2004 18:38 (twenty years ago)
― Martin Skidmore (Martin Skidmore), Friday, 26 November 2004 19:17 (twenty years ago)
Doesn't this sound like a great way to confuse new programmers, shoot yourself in the foot and make code unpastable....
― LSD ARISTOCAT (ex machina), Wednesday, 19 January 2005 05:22 (twenty years ago)
― donut christ (donut), Wednesday, 19 January 2005 05:26 (twenty years ago)
― donut christ (donut), Wednesday, 19 January 2005 05:27 (twenty years ago)
― LSD ARISTOCAT (ex machina), Wednesday, 19 January 2005 05:28 (twenty years ago)
― caitlin oh no (caitxa1), Wednesday, 19 January 2005 05:34 (twenty years ago)
― donut christ (donut), Wednesday, 19 January 2005 05:35 (twenty years ago)
― LSD ARISTOCAT (ex machina), Wednesday, 19 January 2005 05:36 (twenty years ago)
― Ken L (Ken L), Wednesday, 19 January 2005 05:40 (twenty years ago)
"/*VARIABLES ARE*/"
haha
― LSD ARISTOCAT (ex machina), Wednesday, 19 January 2005 05:44 (twenty years ago)
they now want me to take the dynamically generated but fundamentally flat html pages written in some frankenstein php / javascript way and get it to send events to a java JMS message queue. would take me half the time to recode the entire thing (3 pages!) from scratch in jsp but they'd rather i spend time writing code that i know will be thrown away in a month.
― anon_andrews (koogs), Friday, 15 April 2005 09:37 (twenty years ago)
― Andrew Farrell (afarrell), Friday, 15 April 2005 09:44 (twenty years ago)
― koogs (koogs), Friday, 15 April 2005 10:06 (twenty years ago)
Well, it *was* invented in the Netherlands...
― caitlin (caitlin), Friday, 15 April 2005 10:15 (twenty years ago)
― RickyT (RickyT), Friday, 15 April 2005 10:45 (twenty years ago)
― RickyT (RickyT), Friday, 15 April 2005 10:54 (twenty years ago)
― Mr Noodles (Mr Noodles), Friday, 15 April 2005 12:22 (twenty years ago)
― RickyT (RickyT), Friday, 15 April 2005 17:12 (twenty years ago)
― Open your eyes; you can fly! (ex machina), Friday, 15 April 2005 19:01 (twenty years ago)
― Keith C (lync0), Wednesday, 7 December 2005 15:36 (nineteen years ago)
― koogs (koogs), Wednesday, 7 December 2005 15:41 (nineteen years ago)
― GET EQUIPPED WITH BUBBLE LEAD (ex machina), Wednesday, 7 December 2005 15:49 (nineteen years ago)
xpost
― Keith C (lync0), Wednesday, 7 December 2005 15:50 (nineteen years ago)
― Keith C (lync0), Wednesday, 7 December 2005 15:52 (nineteen years ago)
― kingfish trampycakes (kingfish 2.0), Wednesday, 7 December 2005 16:04 (nineteen years ago)
TS: setting tabstop to 4 or leaving it at 8 and finding other ways to do a half-tab?
I wonder what *Mich* has been up to the past 12 years?
― k/l (Ken L), Wednesday, 7 December 2005 16:07 (nineteen years ago)
some of the code here makes my eyes bleed. nobody else seems to mind. but then i do write code with the visible whitespace flag in the editor turned on. (once wrote a patch for vim that added space to the listchars option because it bugged me that it wasn't there)
/* vim: set ai ts=4 tw=4: */
― koogs (koogs), Wednesday, 7 December 2005 16:39 (nineteen years ago)
― o. nate (onate), Wednesday, 7 December 2005 16:44 (nineteen years ago)
― Dan (Grrrrrr) Perry (Dan Perry), Wednesday, 7 December 2005 16:48 (nineteen years ago)
I've been using a great visual diff tool for windows: Araxis Merge. It lets you click on blocks to merge.
It bugs me a little because I was merging two sibling versions of an XML file and it stopped making sense -- matching child nodes with different patterns, etc.
― GET EQUIPPED WITH BUBBLE LEAD (ex machina), Wednesday, 7 December 2005 17:11 (nineteen years ago)
― A BOLD QUAHOG (ex machina), Thursday, 16 February 2006 20:00 (nineteen years ago)
system we've been working on went live this morning. development environment = one server. live system = 4 servers clustered together. yeah, that'll work.
― koogs, Thursday, 14 June 2007 11:54 (eighteen years ago)
I am getting cancellation errors when I take the difference to two very close, very large numbers. Floating point arithmetic is a bitch. As a result my galaxy models look like ass.
― caek, Thursday, 14 June 2007 12:20 (eighteen years ago)
Hah, I'm leaving my position as a software test lead TOMORROW to take time off and be a goof off. Begone software engineering nightmares! No more triages at 11 PM! No more video conferences with India at 6 AM! yay!
Except that my dog demands to still be fed, so I will be back at work shortly at a startup so that he can continue to eat Eukanuba and be a spoiled fuzzbutt.
― lyra, Thursday, 14 June 2007 23:33 (eighteen years ago)
scheduled task, runs every hour. uses oracle sysdate to work out what to do (only process records modified in the previous hour). the machine with the oracle instance on it is 25 minutes slow so only stuff timed to run in the last 35 minutes of any hour actually works correctly.
― koogs, Friday, 29 June 2007 14:06 (eighteen years ago)
hahahahahaha wow
― HI DERE, Friday, 29 June 2007 14:35 (eighteen years ago)
annoyed with myself for not seeing it earlier and annoyed with the sysadmin people for not doing anything about it when i asked them to on the 6th june. grrr.
still, bigger logical errors elsewhere - have rows holding aggregated sums of similar rows in different table and other rows (with null device id) holding sums of these first (device specific) rows. only part of table is updated at any one time. can't know whether summed row contains half-computed new total (which i need to add to) or the old total (which i need to delete). gah.
― koogs, Friday, 29 June 2007 15:05 (eighteen years ago)
nationwide product launch tomorrow at 5am(!) so why am i sat here trying to decipher someone else's java and trying to learn enough plsql to understand someone else's stored procedures in order to optimise something that is already adequate?
and why does it insist on compiling 2053 source files every single time when i've only modified one of them?
― koogs, Wednesday, 31 October 2007 08:30 (seventeen years ago)
rewrite my code introducing bugs and then go on holiday leaving me to fix them why don'tcha?
― koogs, Wednesday, 28 November 2007 10:56 (seventeen years ago)
My life has gotten less interesting.
― Catsupppppppppppppp dude 茄蕃, Thursday, 29 November 2007 08:40 (seventeen years ago)