Guus was kind enough to make a maven project for the Generic Tree. He also fixed an error in my equals method for the GenericTreeNode (I intended to do Object.equals(Object obj) but was doing GenericTreeNode.equals(GenericTreeNode obj). Since it’s a maven project, you can easily create a jar out of it and add it as a…
Tag: programming
Generic (n-ary) Tree in Java
This project is available on github. Please download from there to make sure you have the latest version. Last week I was solving a problem at work that required the use of a Generic (n-ary) Tree. An n-ary tree is a tree where node can have between 0 and n children. There is a special…
A brainfuck interpreter in bAdkOde
A few days before I left India, I started writing a brainfuck interpreter in bAdkOde. I finished implemented all the instructions, excepting for looping. I actually finished the code (and fixed all bugs) while I was in the air, flying from Dubai to Los Angeles. Emirates Airlines has power-plugs for your laptop on the seat….
bAdkOde is Turing Complete
In my previous post, I suggested that bAdkOde might be Turing Complete by writing a quine. One of the ways to actually prove Turing Completeness is to try and write an interpreter for another Turing-Complete language in bAdkOde. Another approach involves providing a direct translation from another Turing-Complete language into bAdkOde. Here, I prove the…
A bAdkOde quine (which suggests that bAdkOde is Turing Complete)
On the bAdkOde project page, I mentioned that I didn’t know whether bAdkOde is Turing Complete (although I suspected it). I also mentioned that if I was able to write a quine in bAdkOde, then it would probably mean that it is Turing Complete. I was able to write one after going through this excellent…
if-else in bAdkOde
I was talking to my CSE 200 (my first CS class at ASU) professor Richard Whitehouse about bAdkOde and he (rightly) pointed out that it didn’t have an explicit selection statement. He also said that unless I wanted it to be really ugly I’d need to have a selection statement. However, since I was going…
bAdkOde: An Esoteric Language
I’ve added another project to the projects page. It’s called bAdkOde, an interpreter for an esoteric language that I designed. The very first incarnation of bAdkOde was written in Java and I actually posted it (or made a blog entry about it) over 8 years ago. For some reason I took it down. Probably because…
JSTL, instanceof, and hasProperty
I’ve been doing a little bit of JSTL over the past week, especially custom tags. I’ve written custom tags in Grails before, and there you use actual Groovy code. I guess this was how custom tags used to be written (in Java), but now you can can build your own custom tags using the standard…
About Me and Projects
I finally got around to adding pages to my blog. I’ve added an “About Me” page and a “Projects” page. The “Projects” page is similar to the one I had on the old site. I’ve migrated one project (Sulekha) over. Will be moving the second one (FXCalendar) over soon and I’m also going to try…
Displaying images side-by-side in WordPress
I’ve been using WordPress for about two months now and I really like it. It takes away a lot of the pain from blogging. Recently I was writing a blog post and I was trying to get two images displayed side-by-side. This proved to be more difficult than I thought. There’s no immediately obvious way…