inicio mail me! sindicaci;ón

Archive for June, 2007

What’s up with Firefox?

I love Firefox, but lately I’ve noticed a few showstopper issues.

  1. On Windows, Firefox leaks quite a lot after a day’s use. I start noticing the performance issues when it gets to be about a 500 meg image in the process list. Why does a browser need so much memory? They really need to solve the memory issue.

  2. On a Mac, the browser eventually gets to a point where the event loop hangs every 10-15 seconds. When you try to drag the window, it will stall for a few seconds with the wait cursor and then suddenly start moving again. I’m running on a Dual G5 PowerMac with a ton of memory and the latest OS updates. This should not be happening. A recruiter at Mozilla contacted me over a year ago to see if I would be interested in working on the Mac port of Firefox. He mentioned they had a few issues that really needed some attention. No kidding.

Again, all of this is on the latest 2.0 of Firefox with really nice hardware. If the right engineer was given the right tools, I bet both issues could be solvable in 1 month.

Yep, we’re in a bubble

Wow - more signal indicating we are in a bubble.

Expensive ad-campaigns of women with swords

A simple directory-tree printer in Ruby

The other day, I came across this interesting post by Tom Moertel. The blog post is called “A simple directory-tree printer in Haskell”. Haskell is interesting and this kind of programming exercise would really show how Haskell deals with real-world resources (the filesystem) as well as rendering the output in a nice human readable representation.

Here is some sample output:

.
|-- haskell.hs
|-- test.rb
|-- tree.rb
`-- tree.rb.html

His post was well written and I really liked how concise the resulting Haskell code was. I also liked the way he dealt with tree printing. I had never seen a tree printer algorithm like this before since I’m used to graphical versions which generally end up having a lot more code. For example, if I was doing this, I would have built a generic tree printer class and passed a lot more state around to each node (like the depth, sibling count, layout algorithms, etc.) Tom’s method is a great little pattern for console style tree output (like pstree) with only a few lines of code. For some past projects, such a simple routine would have come in handy.

So last night, I wondered what the Ruby version would look like. I tried to keep the example in the same functional style… just like his first example. The Ruby code stayed pretty concise.

Here is my Ruby version of Tom’s Haskell version:

 1 
 2 require pathname
 3 

 4 $ArmMap = Hash.new("|   ")
 5 $ArmMap[""] = ""

 6 $ArmMap["`"] = "    "
 7 
 8 def visit(path, leader, tie, arm, node)

 9   print "#{leader}#{arm}#{tie}#{node}\n"

10   visitChildren(path + node, leader + $ArmMap[arm])

11 end
12 
13 def visitChildren(path, leader)

14   return unless FileTest.directory? path
15   return unless FileTest.readable? path

16   files = path.children(false).sort    #false = return name, not full path

17   return if files.empty?
18 
19   arms = Array.new(files.length - 1, "|") << "`"

20   pairs = files.zip(arms)
21   pairs.each { |e|  visit(path, leader, "", e[1], e[0]) } 

22 end
23 
24 ARGV << "." if ARGV.empty?

25 ARGV.map{ |path| visit Pathname.new("."), "","","",Pathname.new(path) }

26 
27 

Trying out Feedburner

Over on the right sidebar, I have now added a link using FeedBurner er. Google for my blog’s feed. I’m going to try it out for the next few months. You can switchover to that feed if you like. Let me know if there are any problems or issues.

Interesting video of Linus on GIT

Thought provoking video of Linus on GIT.

Pretty compelling.

I got burned a while back when I discovered the huge merge bug in Subversion (the fact that you can only do it once). I started looking around a while ago and transitioned to SVK over a subversion repo. At work we are using Bazaar. I still like SVK and Bazaar, but I’m always interested in new and better technology.

Basically, it looks like GIT and Mercurial are the systems to watch.

« Previous entries