- Feature Articles
-
CodeSOD
- Most Recent Articles
- Mr Number
- intint
- Empty Reasoning
- Zero Competence
- One Month
- A Little Extra Padding
- Ready Xor Not
- A Set of Mistakes
-
Error'd
- Most Recent Articles
- Monkeys
- Killing Time
- Hypersensitive
- Infallabella
- Doubled Daniel
- It Figures
- Three Little Nyms
- Tangled Up In Blue
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
C'mon, he's been paid by the lines of code. [;)]
Admin
I implemented the Quadrasort in C++ to do some profiling. The strategy employed reduces the number of necessary swaps considerably. The last loop performs no swaps at all; it's just for fun.
I would sort all my dates like this from now on, but the idea is probably patented.
return 0;
Admin
What do you mean in Java 1.5 ? This code has been valid since at least Java 1.2
String [] l_names = new String [ l_namesCollection.size() ];
l_names = (String []) l_namesCollection.toArray( l_names )
However I'm not surprised... I've seen the for loop dumping into an array so many times before. People don't bother reading the docs or experimenting.
Admin
I dunno, I think this code is brilliant. I could never write something like this. I just hope I never have to have anything to do with the author.
Admin
Last!
sorry, I was just so excited to see there was a sh*t load of comments here already.
Admin
These comments are probably too old and no one will read this, but isn't TankerJoes code incorrect? Its less byte code because it isn't equivalent. Both waste unused memory.
whoisfred assigns the resulting String[] while TankerJoe doesn't store the result.
The List.toArray(Object[] arg) method does not populate the array parameter, it merely uses the runtime type for the result.
... all this pedantry is pretty unhealthy really.
Admin
I am sorry, but i think that is not fast enough, it has order of n2
Admin
Admin