Click here to Skip to main content
16,004,806 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: the hard way Pin
Dmitry Khudorozhkov13-Mar-07 6:38
Dmitry Khudorozhkov13-Mar-07 6:38 
GeneralRe: the hard way Pin
Shog913-Mar-07 6:57
sitebuilderShog913-Mar-07 6:57 
GeneralRe: the hard way Pin
Dmitry Khudorozhkov13-Mar-07 7:03
Dmitry Khudorozhkov13-Mar-07 7:03 
GeneralRe: the hard way Pin
Shog913-Mar-07 7:13
sitebuilderShog913-Mar-07 7:13 
GeneralRe: the hard way Pin
Roger Bamforth12-Mar-07 6:04
Roger Bamforth12-Mar-07 6:04 
GeneralRe: the hard way Pin
Rob Caldecott13-Mar-07 5:13
Rob Caldecott13-Mar-07 5:13 
GeneralRe: the hard way Pin
Shog913-Mar-07 11:58
sitebuilderShog913-Mar-07 11:58 
GeneralOracle stored procs Pin
User 5838528-Mar-07 14:34
User 5838528-Mar-07 14:34 
When I started at my current company I was given a c# / oracle project and asked to rewrite it from scratch. I was told the guy who wrote it had been fired and everyone who had attempted to maintain the code had given up. I reakon I could have provided six months of content for the WTF web site from this single project. By far my favorite part was how he returned values from oracle stored procs to the application.

Every stored proc returned a var of type VARCHAR2_32_ARRAY, and looked something like this

CURSOR CUR_PARAMETERS IS
    SELECT
      CAST (
        MULTISET (
          SELECT
           COLUMN_NAME_1 || ':' || COLUMN_NAME_2 || ':' || COLUMN_NAME_3
          FROM
            SOME_TABLE_NAME
          WHERE
            SOME_FIELD = SOME_VAL           
        ) AS VARCHAR2_32_ARRAY
    )
    FROM
   DUAL;

RESULT_VAR VARCHAR2_32_ARRAY;
BEGIN

  OPEN CUR_PARAMETERS;
  FETCH CUR_PARAMETERS INTO RESULT_VAR;
  CLOSE CUR_PARAMETERS;

  RETURN RESULT_VAR;

END;


then in the c# code we had things like this

private void ParseResults ( IDataReader p_reader) 
{
  while ( p_reader.Read () ) 
  {
    string _encoded_record = ( string ) p_reader [ 0 ];
    string[] _fields = _encoded_record.Split ( new char[] {':' } );
    
    double var1 = Double.Parse( _fields [ 0 ] );
    etc etc etc
  }
}


Interesting way of doing things to say the least


System.IO.Path.IsPathRooted() does not behave as I would expect

GeneralRe: Oracle stored procs Pin
PIEBALDconsult8-Mar-07 15:39
mvePIEBALDconsult8-Mar-07 15:39 
GeneralYou cannot have it! Pin
Rajesh R Subramanian8-Mar-07 0:59
professionalRajesh R Subramanian8-Mar-07 0:59 
GeneralRe: You cannot have it! Pin
Bradml8-Mar-07 1:04
Bradml8-Mar-07 1:04 
GeneralRe: You cannot have it! Pin
Rajesh R Subramanian8-Mar-07 1:07
professionalRajesh R Subramanian8-Mar-07 1:07 
GeneralRe: You cannot have it! Pin
Thomas Stockwell9-Mar-07 13:33
professionalThomas Stockwell9-Mar-07 13:33 
GeneralRe: You cannot have it! Pin
Gizz8-Mar-07 2:22
Gizz8-Mar-07 2:22 
JokeRe: You cannot have it! Pin
Nemanja Trifunovic8-Mar-07 3:42
Nemanja Trifunovic8-Mar-07 3:42 
GeneralRe: You cannot have it! Pin
Rajesh R Subramanian8-Mar-07 4:07
professionalRajesh R Subramanian8-Mar-07 4:07 
GeneralRe: You cannot have it! Pin
Bugra Barin9-Mar-07 13:19
Bugra Barin9-Mar-07 13:19 
GeneralRe: You cannot have it! Pin
Michael Hendrickx13-Mar-07 7:28
Michael Hendrickx13-Mar-07 7:28 
GeneralTwo disconnected systems apparently communicating [modified] Pin
pbraun7-Mar-07 15:42
pbraun7-Mar-07 15:42 
GeneralRe: Two disconnected systems apparently communicating Pin
PIEBALDconsult7-Mar-07 17:08
mvePIEBALDconsult7-Mar-07 17:08 
GeneralRe: Two disconnected systems apparently communicating Pin
Yop838-Mar-07 6:06
Yop838-Mar-07 6:06 
GeneralRe: Two disconnected systems apparently communicating Pin
Dave Kreskowiak8-Mar-07 5:00
mveDave Kreskowiak8-Mar-07 5:00 
GeneralRe: Two disconnected systems apparently communicating Pin
Erik Burger9-Mar-07 1:05
Erik Burger9-Mar-07 1:05 
GeneralRe: Two disconnected systems apparently communicating Pin
M@r|o10-Mar-07 12:48
professionalM@r|o10-Mar-07 12:48 
GeneralRe: Two disconnected systems apparently communicating Pin
Dave Kreskowiak10-Mar-07 15:15
mveDave Kreskowiak10-Mar-07 15:15 

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.