Click here to Skip to main content
15,891,943 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: A function that does... nothing... :-). Pin
cpkilekofp4-Jun-10 10:59
cpkilekofp4-Jun-10 10:59 
GeneralRe: A function that does... nothing... :-). Pin
Jeroen De Dauw23-May-10 22:23
Jeroen De Dauw23-May-10 22:23 
GeneralRe: A function that does... nothing... :-). Pin
Chris Boden24-May-10 3:39
Chris Boden24-May-10 3:39 
GeneralRe: A function that does... nothing... :-). Pin
OriginalGriff23-May-10 23:31
mveOriginalGriff23-May-10 23:31 
GeneralRe: A function that does... nothing... :-). Pin
PIEBALDconsult24-May-10 5:27
mvePIEBALDconsult24-May-10 5:27 
GeneralRe: A function that does... nothing... :-). Pin
supercat924-May-10 6:31
supercat924-May-10 6:31 
GeneralRe: A function that does... nothing... :-). Pin
Luc Pattyn24-May-10 7:03
sitebuilderLuc Pattyn24-May-10 7:03 
GeneralJoining stuff, the hard way Pin
Jeroen De Dauw22-May-10 19:48
Jeroen De Dauw22-May-10 19:48 
I guess you come across things such as there rather a lot, but I'm still O_o at it Smile | :)

if ( count( $this->m_query->sortkeys ) > 0 ) {
	$psort  = '';
	$porder = '';
	$first = true;
	
	foreach ( $this->m_query->sortkeys as $sortkey => $order ) {
		if ( $first ) {
			$first = false;
		} else {
			$psort  .= ',';
			$porder .= ',';
		}
		
		$psort .= $sortkey;
		$porder .= $order;
	}
	
	if ( ( $psort != '' ) || ( $porder != 'ASC' ) ) { // do not mention default sort (main column, ascending)
		$params['sort'] = $psort;
		$params['order'] = $porder;
	}
}


Can has implode[^]?
Jeroen De Dauw

Forums ; Blog ; Wiki

GeneralRe: Joining stuff, the hard way Pin
PIEBALDconsult23-May-10 6:41
mvePIEBALDconsult23-May-10 6:41 
GeneralRe: Joining stuff, the hard way Pin
Jeroen De Dauw23-May-10 6:54
Jeroen De Dauw23-May-10 6:54 
GeneralBut...wait, what? PinPopular
JHizzle20-May-10 5:23
JHizzle20-May-10 5:23 
GeneralRe: But...wait, what? Pin
PIEBALDconsult20-May-10 6:17
mvePIEBALDconsult20-May-10 6:17 
GeneralRe: But...wait, what? Pin
scotchfaster20-May-10 7:01
scotchfaster20-May-10 7:01 
GeneralRe: But...wait, what? Pin
Robert Rohde20-May-10 19:12
Robert Rohde20-May-10 19:12 
GeneralRe: But...wait, what? Pin
Thomas Krojer20-May-10 20:59
Thomas Krojer20-May-10 20:59 
GeneralRe: But...wait, what? Pin
JHizzle20-May-10 22:18
JHizzle20-May-10 22:18 
GeneralRe: But...wait, what? Pin
Robert Rohde21-May-10 5:02
Robert Rohde21-May-10 5:02 
GeneralRe: But...wait, what? Pin
supercat924-May-10 6:40
supercat924-May-10 6:40 
GeneralRe: But...wait, what? Pin
Chris Meech21-May-10 1:34
Chris Meech21-May-10 1:34 
GeneralSide-effects are bad Pin
leppie25-May-10 1:27
leppie25-May-10 1:27 
GeneralRe: But...wait, what? Pin
Hired Mind13-Jul-10 10:50
Hired Mind13-Jul-10 10:50 
GeneralLogical genius! Pin
Simone Serponi19-May-10 3:01
Simone Serponi19-May-10 3:01 
GeneralRe: Logical genius! Pin
Dr.Walt Fair, PE19-May-10 5:19
professionalDr.Walt Fair, PE19-May-10 5:19 
GeneralRe: Logical genius! Pin
Chris Boden19-May-10 5:40
Chris Boden19-May-10 5:40 
GeneralRe: Logical genius! Pin
supercat919-May-10 6:40
supercat919-May-10 6:40 

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.