Category Archives: Java

(Java) Quicksort in Java, with Enforced Suckitude

It’s no fun implementing QuickSort unless you can force it out of its blister-fast, O(n log n) speed and humiliate it with its worst-case, O(n^2) runtime. So that’s what I set out to do. My naive partition simply pivots around the low item, but my randomized partition defeats the sucky inputs by choosing a random [...]

Posted in Java | Tagged , , , , , , | Leave a comment

(Java) Fun with Fibonacci, Golden Ratio and Factorials, with loops vs recursives

 

Posted in Java | Tagged , , , , , , , , | Leave a comment

(Java) Make Simple HTTP Request and Put Response in String

This snippet shows how to do a simple lightweight HTTP request in Java and place the response content in a String.

Posted in Java | Tagged , , , , , | Leave a comment

Creating a robot in Java with Robocode

Robocode is a programming game where you get to build a robot to battle with other robots. It supports the Java programming language and the .NET framework. We will use the Java programming language in this example.

Posted in Java | Tagged , , , , , | Leave a comment

Parsing XML in Java

There are several methods available for parsing an XML file. Some parsers transform the XML file into a traversable DOM tree. The tree consists of a root node and one or more child nodes belonging to the root node. These child nodes are able have child nodes of their own and so forth. Nodes without children [...]

Posted in Java | Tagged , , , , , , , , | Leave a comment

Console output in Java

System.out.println can be used for outputting a line to the console. public void Foo { System.out.println(“Bar”); }

Posted in Java | Tagged , , , , , | Leave a comment

First post!

wohoo! :-)

Also posted in Assembler, Bash, C, C#, C++, F#, Haskell, JavaScript, Objective-C, Perl, PHP, Python, Ruby, Uncategorized | Leave a comment