Writing by Viksit Gaur

May 01, 2010

C++ Modulus Operator weirdness

Its surprising that the modulus (%) operator in C++ works upwards, but not downwards. When working on some code, I expected, -1 % 3 = 2 0 % 3 = 0 1 % 3 = 1 2 % 3 = 2 but ended up with, -1 % 3 = -1 0 % 3 = 0 1 % 3 = 1 2 % 3 = 2 As a result, you’d…

Read article →
April 20, 2010

Implementing Binary Search with Clojure

I was trying to implement a simple binary search using a purely functional approach, and after much hacking, googling and wikibooking, came up with this in Clojure. -- If you have any questions or thoughts, don't hesitate to reach out. You can find…

Read article →
April 15, 2010

Clojure Application with Command Line Arguments

I was recently looking for a method to create an application with Clojure that would allow specification of command line arguments. I came across an excellent (http://stackoverflow.com/questions/1341154/building-a-clojure-app-with-a-command-line…

Read article →
April 04, 2010

20 Days of Clojure

Came across an excellent (http://loufranco.com/blog/files/category-20-days-of-clojure.html) of blog posts by Lou Franco, where he uses the SICP videos as input to learn more about Clojure. His explanation of HashMap implementations in Clojure, using…

Read article →
April 03, 2010

Thinking in C++ by Bruce Eckel is an excellent book

I just finished skimming through Bruce Eckel’s Thinking in C++ book – available for free from his website. Volume 1 covers the basics pretty well and I didn’t really do much more than glance at it, but volume 2 is highly recommended for its marvelous…

Read article →