Click here to Skip to main content
15,923,083 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: I *suppose* that's a way of determining read permissions.. Pin
Erik Burger11-Mar-07 22:44
Erik Burger11-Mar-07 22:44 
General.NET Framework? What .NET Framework? Part Deux Pin
Erik Burger6-Mar-07 4:03
Erik Burger6-Mar-07 4:03 
General.NET Framework? What .NET Framework? Pin
Erik Burger6-Mar-07 3:57
Erik Burger6-Mar-07 3:57 
GeneralRe: .NET Framework? What .NET Framework? Pin
peterchen10-Mar-07 3:24
peterchen10-Mar-07 3:24 
GeneralRe: .NET Framework? What .NET Framework? Pin
Erik Burger11-Mar-07 22:52
Erik Burger11-Mar-07 22:52 
GeneralRe: .NET Framework? What .NET Framework? Pin
peterchen12-Mar-07 5:43
peterchen12-Mar-07 5:43 
GeneralRe: .NET Framework? What .NET Framework? Pin
Erik Burger12-Mar-07 23:36
Erik Burger12-Mar-07 23:36 
GeneralSQL Join? na I know a better way..... Pin
ra ra ra ra6-Mar-07 0:19
ra ra ra ra6-Mar-07 0:19 
Once had the great pleasure of having to examine our banks End of Day processor.

part of the app had the ability to show the account transaction records, which they used to dump transactions to luvly excel spreadsheets for analysis....

the guy who wrote it obviously had never heard of SQL joins though

he used a SQL statement along the lines of "Select * from tran" to retrieve all the records, then entered into a mother loop.

for each row in result<br />
 for each column in the result<br />
     if the datatype is a int, it must be a foreign key <br />
            do a whole load of messin to work out the foreign key table<br />
            so do another sql statement to pull back the foreign key value from another table<br />
            output the foreign key value<br />
     else<br />
            output the value<br />
     end if<br />
 next column<br />
next row.



worked out that each time a new transaction was entered onto the system this loop would have to do another 60 or so new SQL requests.

so instead of one sql query using multiple joins to get foreign key values, this numpty wrote over 60 queries, which fired for each and every row output.

and considering this was only a weeee bank, We did only have in the region of 5 million transactions with about another 100,000 or so a month getting added..

and they wondered why it could take ages to display only a few hundred thousand records and output them..........
Mad | :mad:
GeneralSynchronizing threads Pin
Zorbek5-Mar-07 23:27
Zorbek5-Mar-07 23:27 
GeneralOutrageous error messages Pin
Roger Bamforth5-Mar-07 21:59
Roger Bamforth5-Mar-07 21:59 
GeneralRe: Outrageous error messages Pin
Rajesh R Subramanian6-Mar-07 0:15
professionalRajesh R Subramanian6-Mar-07 0:15 
GeneralRe: Outrageous error messages Pin
BSelznick6-Mar-07 15:13
BSelznick6-Mar-07 15:13 
GeneralRe: Outrageous error messages [modified] Pin
Roger Bamforth7-Mar-07 5:53
Roger Bamforth7-Mar-07 5:53 
GeneralRe: Outrageous error messages Pin
BSelznick7-Mar-07 6:53
BSelznick7-Mar-07 6:53 
General"Edit Thing Error" Pin
Anna-Jayne Metcalfe8-Mar-07 4:08
Anna-Jayne Metcalfe8-Mar-07 4:08 
GeneralRe: "Edit Thing Error" Pin
Erik Burger9-Mar-07 1:13
Erik Burger9-Mar-07 1:13 
GeneralRemember - this is supposed to be C#... Pin
6o'clock5-Mar-07 21:52
6o'clock5-Mar-07 21:52 
GeneralRe: Remember - this is supposed to be C#... Pin
jhwurmbach8-Mar-07 4:42
jhwurmbach8-Mar-07 4:42 
GeneralRe: Remember - this is supposed to be C#... Pin
Erik Burger9-Mar-07 1:10
Erik Burger9-Mar-07 1:10 
GeneralWe always use "i" as a loop counter... Pin
Hal Angseesing5-Mar-07 21:29
professionalHal Angseesing5-Mar-07 21:29 
GeneralRe: We always use "i" as a loop counter... Pin
BSelznick6-Mar-07 15:19
BSelznick6-Mar-07 15:19 
GeneralRe: We always use "i" as a loop counter... Pin
Ted Ferenc6-Mar-07 21:32
Ted Ferenc6-Mar-07 21:32 
GeneralRe: We always use "i" as a loop counter... Pin
Duncan Edwards Jones7-Mar-07 1:10
professionalDuncan Edwards Jones7-Mar-07 1:10 
GeneralRe: We always use "i" as a loop counter... Pin
John R. Shaw9-Mar-07 11:30
John R. Shaw9-Mar-07 11:30 
GeneralInfinite for loops Pin
Jesse Krebs5-Mar-07 21:00
Jesse Krebs5-Mar-07 21:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.