December 08, 2010

Reading Java properties file in Clojure

A simple and effective way to read properties files in Clojure, since they transform into Clojure maps! Next, to actually read this in, using atoms to swap the values like this seems to work, -- If you have any questions or thoughts, don't hesitate…

Read article →
July 08, 2010

Decoding the US Military's Cyber Command Logo code

From this Wired article (http://www.fastsum.com/support/md5-checksum-utility-faq/md5-hash.php), it looks like there’s a number that is part of the cyber command’s logo – 9ec4c12949a4f31474f299058ce2b22a. Well, its 32 characters long, and looks like a…

Read article →
June 20, 2010

Mutable vs Immutable datastructures - Serialization vs Performance

In my last post, I was playing around with methods to serialize Clojure data structures, especially a complex record that contains a number of other records and refs. Chas Emerick and others mentioned in the comments there, that putting a ref inside…

Read article →
June 19, 2010

Serializing Clojure Datastructures

I’ve been trying to figure out how best to serialize data structures in Clojure, and discovered a couple of methods to do so. (Main reference thanks to a thread on the Clojure Google Group (http://groups.google.com/group/clojure/browse_thread/thread…

Read article →
June 11, 2010

Ode to an Orange

A whiff of citrus – vibrant, shiny, dimpled and thick, your fingers move, probing textural ecstacy, as your tastes await the sweet tartness within. Peel away the layers softly, envelop a piece, let your tongue steep in a myriad of flavors, with the…

Read article →
June 04, 2010

Stack implementation in Clojure II - A functional approach

My last post on the topic was creating a stack implementation using Clojure protocols and records – except, it used atoms internally and wasn’t inherently “functional”. Here’s my take on a new implementation that builds on the existing protocol and…

Read article →
June 03, 2010

Resolving Chrome's SSL Error

I recently started getting a number of SSL related errors on accessing https links with Google Chrome on Ubuntu. One looks like, 107 (net::ERR_SSL_PROTOCOL_ERROR) The top link on Google’s search results is pretty fuzzy, so here’s the solution that…

Read article →
June 02, 2010

Stack implementation in Clojure using Protocols and Records

I was trying to experiment with Clojure Protocols and Records recently, and came up with a toy example to clarify my understanding of their usage in the context of developing a simple Stack Abstract Data Type. For an excellent tutorial on utilizing…

Read article →
May 21, 2010

PyCassa vs Lazyboy (updated)

Update As Hans points out in the comment below, it appears pycassa natively supports authentication with org.apache.cassandra.auth.SimpleAuthenticator. Lazyboy on the other hand doesn’t by default. It’s not too hard to do it though. Intuitively, we…

Read article →
May 08, 2010

Thrush Operators in Clojure (->, ->>)

I was experimenting with some sequences today, and ran into a stumbling block: Using immutable data structures, how do you execute multiple transformations in series on an object, and return the final value? For instance, consider a sequence of…

Read article →
May 06, 2010

Stock Crash

From the (http://www.reuters.com/article/idUSTRE6341EA20100506), The Dow suffered its biggest ever intraday point drop, which may have been caused by an erroneous trade entered by a person at a big Wall Street bank, multiple market sources said. and…

Read article →
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 →
March 30, 2010

Programming Clojure with Clojure 1.2.0 snapshot

This post contains a list of changes between Clojure 1.1.0 and 1.2.0 that would affect you if you’re reading Stuart Halloway’s “Programming Clojure”. It looks like you’d have to replace, (use ‘) (filter indexable-word? (re-split #”\W+” “A fine day…

Read article →
March 29, 2010

BeautifulSoup on Cojure? Enlive

I was looking for a suitable library for Clojure that would work like Python’s BeautifulSoup or lxml – and found enlive. An excellent tutorial here http://github.com/swannodette/enlive-tutorial. -- If you have any questions or thoughts, don't…

Read article →
March 28, 2010

Clojure AOT compilation tutorial

I was trying to figure out how to AOT compile a Clojure program, in order to really see some fast execution times. The simplest way to describe AOT compilation would be how its done in Java, `` javac file.java java file The invocation of the Java…

Read article →
February 27, 2010

viksit-code

It’s been a while since I’ve uploaded code back to the community. This page will track my code on the web, as well as contains links to useful snippets of code in various opensource projects that I’ve worked with. Below is the Google code repository…

Read article →
February 25, 2010

Moving from MySQL to Cassandra - Pros and Cons

Moving on from the question of which NoSQL database you should choose, after reading these excellent posts from (http://about.digg.com/blog/looking-future-cassandra%0A) and (http://nosql.mypopescu.com/post/407159447/cassandra-twitter-an-interview…

Read article →
February 23, 2010

How 'Aardvark was the 6th idea we tried'

Just came across an excellent (http://ventilla.posterous.com/hello-world-2603) by Max Ventilla, the co-founder of Aardvark (a company that Google bought a few weeks ago). His description of how Aardvark was the 6th idea that he and his co-founders…

Read article →
February 11, 2010

Misleading Youtube-Visa ad

-- If you have any questions or thoughts, don't hesitate to reach out. You can find me as @viksit on Twitter.

Read article →
February 11, 2010

Why I quit Google Buzz

Google Buzz seems to have mashed up a number of positive features from Twitter and Friendfeed into itself, and I quite like the idea – or rather, the vision it is supposed to espouse. Unfortunately, it is at a stage where too much of my private data…

Read article →