Category Archives: Programming

LateX in WordPress.

Recently, I learned LateX to compile documents. It is great. Though the learning the syntax was a pain to wade through at first, it really becomes natural after a few months of using LateX to build documents. You can even version control it! Anyway, I found a great WP plugin here that lets you use [...]

Also posted in Wordpress | Tagged , | Comments closed

Greatest common denominator in Scheme.

Here I’ve implemented Euclid’s famous functions for calculating the greatest common denominator. I’ve also implemented a slight addition that allows us to calculate the integer coefficients x and y such that d = gcd(a, b) = ax + by. These algorithms were adapted from Thomas Cormen’s exercises on pages 859-860 of Introduction to Algorithms, 2nd [...]

Posted in Programming | Tagged , , , | Comments closed

Writing a simple PLT Racket program with a test case.

I’m considering deploying a small PLT Racket web server so I thought I should brush up on the most recent version of Scheme that I’m familiar with: PLT Racket. The following is a small sample program and the syntax for testing that function. #lang racket   (require test-engine/racket-tests)   (define (my-factorial x) (cond [(= x [...]

Posted in Programming | Tagged , , | Comments closed