make clean

May 29, 2008

Trade-offs

Filed under: Uncategorized — harshadrj @ 1:25 pm
Tags: , , ,

I think Engineering is mostly just the art of making the right trade-offs.

A classic example

Makes for a good read. Apparently, this was one of the blocker bugs for the release of Firefox 3.

May 13, 2008

LyX : the document processor

Filed under: Uncategorized — harshadrj @ 8:02 pm
Tags: ,

I wanted to create some dot graphs and compose them on a single page, and I thought of using LaTeX for it. That’s when I remembered LyX, my one-time favorite word-processor.

I hopped on to its website and dude! It’s still alive and kicking solid ass. I am surprise, nay shocked! They even have a version compiled with Qt4.4!

Cheers to the LyX team!

I will probably use something like dot2tex to have them co-operate. dot2tex itself looks like a neat tool.

HoM : an experiment in Scala

Filed under: Uncategorized — harshadrj @ 7:35 pm
Tags: ,

I wrote a little game in scala; House of Mirrors. It is a logic game heavily inspired by Chromatron.

It was just a for-fun project and I also wanted to familiarize myself with scala with a real-world application.

My notes:

  • I first wrote the core of the game, with no interface at all. It was probably about 100 lines of Scala code. I found I could easily design and code on the go.
  • I built up all objects using a hierarchy of case classes and stuck to immutable data types.
  • Adding a GUI layer on top of the core was easy with the SQUIB library. I think the total code was about 400 lines of code.
  • However, when dealing with colored light beams I had to get my hands dirty with Swing, since I wanted to define my own Composite class. I found some missing functionality in AWT and had to use Double buffering while compositing. This is what to took most of my time, though it’s just 17 lines of code
  • The next part was saving and loading game files in XML format. Needless to say, this was a breeze to write in Scala. Total code was about 500 lines of code
  • After a lot of game features and minor GUI enhancements the code now stands at 1k loc

The biggest hurdle I faced when dealing with Scala was a lack of documentation for the standard APIs. The others being : instability of the compiler itself, changing APIs and some inconsistencies in the language. An example of the latter; “case North” is treated differently from “case north”! why? because capitalisation of identifiers is treated specially! Bad design choice I think; it’s too quirky.

Most of these problems should go away with time & love but some like the above quirkiness are potential hair-pullers.

March 19, 2008

Inkscape 0.46 will rock

Filed under: Uncategorized — harshadrj @ 12:41 am
Tags:

Inkscape, an excellent open-source vector drawing program, now gets even better. The release note is one long, feature packed list!

I am looking forward to using the engraving tool.

Note to p6 and dkarsh, this was the program I used for creating the BAS logo :)

March 6, 2008

lazy sequences in scala

Filed under: Uncategorized — harshadrj @ 12:53 pm
Tags: ,

At work, some of us were discussing about lazy lists v/s iterators. I just tried a quick lazy list in scala, and it worked pretty well to my satisfaction.

class roleNumbers extends RandomAccessSeq[String] {

def length=10;
def apply(n:Int) = {println(”evalutaing ” + n); “role:” + n}

}

val xyz = new roleNumbers

// drop 8 elements, map the sequence, and then take first element
val one_element = xyz.drop(8).map(”rum ” + _)(0)

println (one_element)

The output :

evalutaing 8
rum role:8

The laziness is preserved across list operations which is a good thing.

In fact, I notice that Iterator trait and List trait have a similar interface, which reinforces my belief that they are pretty much the same, though usage semantics might be differ slightly.

I now need to figure out how to implement an efficient get_next_element kind of iterator in scala.

February 28, 2008

Dormino

Filed under: Uncategorized — harshadrj @ 5:37 pm

A mouse that runs on excess heat from your laptop. Now that’s a cool idea:

http://www.core77.com/competitions/GreenerGadgets/projects/4614/

January 24, 2008

Viewing large graphs

Filed under: Uncategorized — harshadrj @ 5:05 pm
Tags: , ,

For interactively viewing large dot (from graphviz) graphs  ZGRViewer is a great tool.

January 19, 2008

Penrose : Shadows of the mind

Filed under: Uncategorized — harshadrj @ 10:08 am
Tags: ,

Shadows of the mind is an attempt by Roger Penrose to prove that a computing machine can never achieve human like intelligence; the implication being that human brains are something more than “mere” computing machines.

I have been skimming through this book the last few days and I find it very well written. Though, that is its very downfall! The central argument is clearly presented and hence it is easy (for an average mind like mine) to see it’s fallacy.

I will try to show the fallacy here in informal terms. The central argument in the book is just about a page long and tries to combine the halting problem with Godel’s theorem. Expressed informally, it goes like this:

Assume that all algorithms can be arranged into an (infinite) ordered list, C0, C1, C2….

Let A(n) be an algorithm that halts if Cn does not halt. Now A(n) itself has to be listed in the above list, say as Ck. The question is “will A(k) ever halt”? This kind of self-reference obviously leads to a paradox and Penrose uses it to argue that humans are somehow better than computing machines.

However, we can construct a very similar argument with “humans” instead of algorithms:

Assume that all humans can be arranged into a (finite) ordered list, H0, H1, H2..

Let O be a human with oracle like powers that, upon hearing n, winks if Hn doesn’t wink. Now, this oracle herself has to be listed in the above list, say as Hk. The question is “will O wink if she hears k”?

Here, the human O will crumble just as easily as the algorithm A. The real problem was not with O or A, but with the paradoxical question(s) that they were asked.

This book has been a major disappointment in this regard. However, there are some interesting sections that deal with general theory of relativity and quantum physics, which are a good introductory read.

Update: While writing this post, I did a quick search on the web, and there is a similar formal refutation of Penrose’s argument here.

Update: An even better refutation is here, which deals with “systems of reasoning” and their limitations.  A parody of Penrose’s own dialog here.

December 29, 2007

Yummier yumex

Filed under: Uncategorized — harshadrj @ 9:56 am
Tags: , , ,

After many days of struggling with yumex code I finally managed to add a nifty feature to it. With this fix, yumex shows the version difference for an update in bold font.Yumex snap small

I find this very useful to quickly determine if an update is a major upgrade or not. In the above example, rosegarden is a major upgrade, while qt4-x11 is a minor one.

I am posting the patch here, since the yumex website seems to be rather sparse and ill-maintained. This patch is against the 2.0.3 release. (more…)

December 27, 2007

Some cool new programs

Filed under: Uncategorized — harshadrj @ 3:07 pm
Tags: , , ,

I don’t know if this just some fanciful graphics or something truly marvelous. Check it out if you can (it’s for Mac only):

NodeBox | Evolution

The other cool application I stumbled upon:

Scala Ray 

It’s hard to implement a ray-tracer and, yet, these guys seem to have implemented Ambient Occlusion in version 0.1 itself. Render times seem to be a bit slow though.

Next Page »

Blog at WordPress.com.