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, x > [...]
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 [...]
¶
Posted 10 August 2009
† Porges
§
‡
°
Tagged: code, debugging, Functional programming, ikarus, machine, Programming, recursion, scheme, silly, theory, turing, universal, ypsilon
Argh #include <stdio.h> #include <math.h> #include <fenv.h> int main () { // don’t set rounding here double ten0 = sin(pow(10.0,22)); fesetround(FE_DOWNWARD); double ten1 = sin(pow(10.0,22)); fesetround(FE_UPWARD); double ten2 = sin(pow(10.0,22)); fesetround(FE_TONEAREST); double ten3 = sin(pow(10.0,22)); fesetround(FE_TOWARDZERO); double ten4 = sin(pow(10.0,22)); printf( "Default: %f\n" "Downward: %f\n" "Upward: %f\n" "ToNearest: %f\n" [...]
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 [...]