I’ve known about tries for sometime. They’re a pretty neat data-structure for storing and looking-up strings.I decided to try and implement one in Java so that I can learn more about them. I’ll post another article later that goes into some more detail about this implementation, but for now you can check out the source…
Category: Nerdy Stuff
Explanation of the dialup sound
Ran into this awesome explanation of the dialup protocol, i.e., the sound you hear from a modem when it dials up.
The Feast
Inspired by The Codeless Code: The master was meditating when a priest respectfully entered his chamber. The master opened his eyes. The priest bowed respectfully and said, “Master, I would like you to look at the code of a young disciple of mine”. The master nodded and followed the priest to a computer. On the…
Data and Code
Inspired by The Codeless Code: A novice monk had just started learning assembly programming when he was troubled by doubt. He approached his master and asked: “Master, how do I know which is code and which is data?” The master who was meditating, opened his eyes, smiled, and said: “Each is the other, yet neither…
Indenting XML and HTML from vim
vim has an awesome feature, using which you can pipe a range through an external command. This is pretty useful if you’re opening up an un-indented or poorly-indented XML or HTML file. If you want to indent your entire file, simply do the following: :%!tidy -i -xml -q The -i option tells tidy that it…
Implementing pinch-zoom and pan/drag in an Android view on the canvas
I was trying to get pinch-zoom and panning working on an Android view today. Basically I was trying to implement the same behavior you see when you use Google Maps (for example). You can zoom in and pan around until the edge of the image, but no further. Also, if the image is fully zoomed…
Akṣi: Handwritten-digit-recognizing neural-network
I’ve always been interested in Neural Networks (ever since I first found out about them around 10 years ago). However, I never got a chance to learn about them or write one of my own; this is something I’ve wanted to do for some time. I got the opportunity this semester when my professor in…
Setting the content type to text/plain for a JSON response from a Spring controller
I was using a jQuery plugin called a ajaxfileupload to upload a file through AJAX. Technically what the plugin does isn’t AJAX. It creates a hidden form and an iframe, and then submits the form using the iframe as the target. The iframe will then end up with the response from the server. This response…
Popularity Contest WordPress plugin breaks RSS feed
I’m using a somewhat old plugin (it hasn’t been updated since ’09) called Popularity Contest to show the popularity of my posts. However, I noticed that it was breaking my RSS feed. This is due to the fact that the plugin doesn’t properly escape the ampersand character inside an image URL. Instead of & it…
A new look
I decided to change the theme on my blog. I went for a wider theme this time because on my older theme the real estate for post content was rather narrow. This made the posts excessively long. This new theme has a lot more room for posts and so it doesn’t look like I’m posting…