2-pivot quicksort
This posting on the Java core library mailing list proposes to replace the current quicksort with a new, 2-pivot quicksort.
Ordinary quicksort in Haskell looks something like this:
quicksort [] = []
quicksort (pivot:rest) =
quicksort [x| x ← rest, x ≤ pivot] ++
[pivot] ++
quicksort [x| x ← rest, [...]
So, I thought it would be a fun idea for my first ever Lisp/Scheme program to implement Alan Turing’s original a-machines from his paper, On Computable Numbers, with an Application to the Entscheidungsproblem (paper available to public). Fun? Oh, I hadn’t any idea…
Preamble; choice of implementation
I decided to go with the latest and greatest version [...]
¶
Posted 10 August 2009
† Porges
§
code
‡
°
Also tagged: code, debugging, Functional programming, ikarus, machine, recursion, scheme, silly, theory, turing, universal, ypsilon
This is in reference to the current ‘Twitter image encoding challenge’ running on StackOverflow.
If we want to restrict ourselves to assigned, non-control, non-private Unicode characters, then by my reckoning that gives us 129,775 available characters.
wget http://unicode.org/Public/UNIDATA/UnicodeData.txt
awk -F ‘;’ UnicodeData.txt -f countUnichars.awk | bc
countUnichars.awk source:
BEGIN { print "ibase=16" } # set bc to hex mode
$2 ~ [...]
Maya’s python interface leaves something to be desired, as it seems like a straight port of their existing MEL interface with no additional thought put into designing a nice OO interface. For example, here is how to set or get the ‘radius’ attribute of a sphere:
s = cmds.sphere()
r = cmds.sphere(s, query=True, radius=True)
cmds.sphere(s, edit=True, radius=10)
Nasty.
So, here [...]