Building OpenKomodo on Mac OSX
Posted by tom June 22nd, 2008
So, how to build OpenKomodo on Mac OSX.
Prerequisites
Download ActivePython 2.5.2.2 from here and install it, it’s a free download. Also get MacPorts and make sure you have it setup.
Step 1 – Getting the source
Getting the source is easy: svn co http://svn.openkomodo.com/repos/openkomodo/trunk openkomodo
Step 2 – Building Mozilla
If you don’t have a ~/.cvspass, just touch one, otherwise you’re in or a lot of warnings.
The do cd openkomodo/mozilla and give a python build.py configure -k 4.4 --moz-src=cvs:1.8 --release --no-strip --shared --tools. This should generate a config.py.
Then do a python build.py distclean all
Step 3 – Building Komodo
First issue an export PATH=`pwd`/util/black:$PATH and then do
bk configure, bk build
Step 4 – Running Komodo
bk run
Remote file editing
Posted by tom June 21st, 2008
Recently I need to do a lot of remote file editing (again). I really want to use TextMate, together with ExpanDrive, but using source-control-management together with mounting a remote volume is a caching-nightmare. TextMate won’t see any differences (technically there aren’t any – because ExpanDrive isn’t seeing them) and swapping windows between Safari/Firefox and TextMate is so terribly slow (TextMate check’s the project-tree for changes) that it just isn’t funny anymore.
This is becoming so impractical that I started to look for alternatives, which are also multi-platform. Anyway lately I find TextMate development slowing down, perhaps not rightfully so – but it is a one-man show, where as ViM or Emacs have a whole community behind them (as it’s open source).
What about ViM?
ViM has a relatively steep learning curve, but doable – but I found quite a few issues or problems. Navigating/editing multiple files with ViM is another story, I just can’t get my head around the Project plugin – nor does it really work well for remote file systems.
Or Emacs?
I’ve always said that Emacs isn’t an editor, it’s an operating system – which for me was a reason to not have a look at it at first. But then again, why not? For Mac there’s Aquamacs Emacs, which is a Mac OSX version of Emacs. That together with ECB – the Emacs Code Browser and TRAMP – Transparant remote file access – you get a very TextMate like experience. A quick demo shows that it can do a lot of things. Oh and you get LISP – well … Emacs LISP
Here’s a screenshot:

Or Komodo IDE / Edit?
First I’ve tried Komodo Edit, which is a fine editor, you can edit remote files, but it doesn’t have a code explorer or built-in source-control. Komodo IDE has both, but source-control does not work for remote files, so no use for me (yet). I think once it would have remote file source-control it would be a fine editor.

So in the meantime I might as well use Komodo Edit. Okay and now here’s something very interesting: ActiveState and Mozilla, jointly started the OpenKomodo project. They’re set out to create an open source (integrated) development environment. As you probably know Komodo is built using Mozilla XUL technology. So most of the coding is done in XML/XUL, JavaScript and C/C++.
Lua & Io
Posted by tom June 10th, 2008
Recently I’ve (re)discovered Lua (‘LOO-AH’ if you’re English or ‘LOE-AAH’ – if you’re Dutch) and Io.
First – Lua is a neat little language, which can be embedded very well, but can also be used as a standalone language. It has a VM, you can compile your code and it has a very small footprint.
It’s also used more frequently than you would think, of course in games (WoW, SimCity) but also in Adobe Lightroom. LEGO Mindstorms NXT can also use Lua as firmware (pbLua) and will then run the interpreter off of a console.
Second – Io is another neat little language, which can be embedded as well. Also Io has a VM, for which you can compile your code.
As far as I am aware it’s less used than Lua, but perhaps that’ll change?
Anyway, both languages interest me, so from now on I will also write something about Lua & Io here once in a while.
rails.vim - Rails & Vim
Posted by tom June 2nd, 2008
Just came across a good tutorial on rails.vim
VI(M) isn't that bad... at all!
Posted by tom May 22nd, 2008
Okay, today I’ve tried using VI(M) and it’s not that bad, but it does require a lot of (re-)learning. There’s the ‘old-fashioned’ terminal based vim, there’s GVim and there’s MacVim. All three are in principle compatible, but have quite a few differences, which are mostly in the GUI and menu’s. So far MacVim seems the most appealing, besides the terminal one, which is good to learn, because it’s almost always useable.
Gem-ified WBXML4R
Posted by tom May 21st, 2008
I’ve had a lot of requests for the sourcecode for WXBML4R – a Ruby extension which allows you to convert from WBXML to XML and vice-versa. So far I’ve sent the code to people who asked, but now I’ve gem-ified the code and with the use of a gem, it’ll be a lot easier! Hopefully I’ll soon find the time to create a Rubyforge page for it and put it on there.
UPDATE: I’ve just asked for the RubyForge project, once that’s approved I’ll publish the gem there.
Plugging Amsterdam.rb
Posted by tom May 21st, 2008
My new colleague Remco has been successfully plugging Amsterdam.rb (Amsterdam Ruby User Group) lately, next Monday (May 26th 2008). I’ll go, you?
Ruby Qualification Test
Posted by tom May 21st, 2008
Recently, as part of an interview, I’ve been asked to make the following test (in Ruby):
1) Write a program, which asks the user for a URI/URL. The program should then go off, and fetch the webpage which is on that URI/URL. You’re not allowed to use any existing HTTP library (ie use a socket connection yourself). 2) Extend the program so that it loops, until the user enter’s a q (for the URI). 3) Extend the program so that it displays the headers, separated from the body. The headers should be separated in key – value pairs.
I’ve perceived this as a very simple test, which hardly requires OOP. I would use OOP if it would simplify the solution or when it would contribute to the re-use of components. As this was a test, it’s inherently a one-off, therefor no OOP in my opinion. The testers felt otherwise, so I rewrote my entire solution as follows.
#
# test.rb
# degrunt.net
#
# Created by Tom de Grunt on 2008-05-21.
# Copyright 2008 degrunt.net. All rights reserved.
#
require 'uri'
require 'socket'
class Request
include Socket::Constants
def initialize( uri )
begin
@uri = URI.parse(uri)
rescue URI::InvalidURIError => e
raise "Please enter a valid URI"
end
end
def get
socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
sockaddr = Socket.pack_sockaddr_in( 80, @uri.host )
socket.connect( sockaddr )
puts "Path: #{@uri.path || '/'}"
socket.write( "GET #{@uri.path || '/'} HTTP/1.0\r\n\r\n" )
socket.read
end
end
class Response
def initialize( text )
@text = text
headers,@body = text.split(/\r\n\r\n/)
headers = headers.split(/\r\n/)
@status_line = headers.shift
@headers = {}
headers.each do |h|
kv = h.split(/: /)
@headers[kv[0]] = kv[1]
end
end
def to_s
result = ""
@headers.each do |k,v|
result << "#{k} - #{v}\n"
end
result << @body
result
end
end
# ========
# = Main =
# ========
begin
puts "Please enter a URI (press Q to quit): "
uri_str = gets.strip.downcase
unless uri_str == 'q'
request = Request.new(uri_str)
puts Response.new(request.get)
end
rescue Exception => e
puts "An error occurred: #{e}"
end until uri_str == 'q'
Please share your thought on whether using OOP or not is a good idea and whether this test successfully tests one’s qualifications as a Ruby programmer.
On the other hand, I can tell you that I’ve written Ruby Extensions (three by now) using Ruby and C-code, I wrote a Radiant CMS plugin and wrote a couple of Ruby on Rails websites in my spare time. Professionally I work on an extensive Ruby on Rails project, which tests the boundaries of Rails (if I may say so).
Boot Camp: Windows XP SP2
Posted by tom February 4th, 2008
Today I wanted to install Windows XP SP2 onto Boot Camp, so I printed the “Installation & Setup Guide” Apple provides in the “Boot Camp Assistant”. My ultimate goal is to allow Windows XP to boot off off Boot Camp (on it’s own) and by using VMWare Fusion, for the times I don’t want to reboot (which are more frequent).
So in my case I already have a working version of VMWare and Windows XP. Next is to install Windows XP, so first I needed to Partition my drive. In my case I chose a 32 GB Windows partition, as I intend to (also) play some games on it.
Then I needed a Windows XP SP2 install CD, but sadly I only had a Windows XP SP1 bootable CD (well I once made a .cdr file from that CD and used that instead). This can be fixed using the Slipstreaming Windows XP Service Pack 2 and Create Bootable CD guide. Then I used the .EXE mambo-jambo from the Guide. I ended up with a “patched” version of Windows XP SP2. Now then, how to burn a bootable CD, without “Nero”, well I just downloaded the Trial version (which expires after 15 days, but that’s fine).
Once that’s all done … the rest is trivial … except for Windows XP activation, what a nightmare! This article describes what you need to do.
EA Games for Mac OSX
Posted by tom February 3rd, 2008
Well, so far I’ve bought three games for Mac OSX:
- Need for Speed Carbon
- Command and Conquer 3 Tiberium Wars ( Kane )
- Command and Conquer Generals ( + Zero Hours)
The games run great on my Mac (Macbook Pro 2.4 Ghz Intel Core 2 Duo – 4GB 667Mhz DDR2 SDRAM – NVIDIA GeForce 8600M GT 256 MB), but ofcourse I wasn’t expecting anything less!
The only thing that strikes me odd is the fact that I’m being sent to the Dutch EA website which doesn’t have a single Mac game nor any links to it. Neither is there a link to ‘complain’ about this. So I’m off to the US/Canada website
Oh and for the ‘unbelievers’ take a look at Apple’s Game Pages to see (and download) game (demo’s).
Oh (2) and EA, where are Need for Speed Prostreet and Burnout Paradise City for the Mac?
Conceptronic CSATAi23U
Posted by tom January 29th, 2008
The conceptronic CSATAi23U – Serial ATA & IDE to USB adapter – works flawlessly with Mac OSX 10.5 (Leopard). No need to install drivers. Just insert your hard-disk in the connector and insert the adapter in the device and then turn on the device. At this point an orange LED should show and only then connect it to your Mac. Perfect!
Game in JavaScript
Posted by tom January 27th, 2008
I’m truly aMazed! James Edwards created a maze game using JavaScript/HTML/CSS and a bunch of images.
DBVisualizer
Posted by tom January 15th, 2008
After evaluating loads of DB GUI apps for Mac OSX, I’ve finally made my decision. It seems that DBVisualizer is more than able to fit my needs, allows for data entry/export and creation and altering of tables. It also allows for a uniform view into multiple databases (MySQL/PostgreSQL/etc). It doesn’t have a great Mac OSX (Leopard) look & feel, but it’s not all that bad either! All in all I’d recommend it!
Installing MySQL gem on Mac OSX 10.5 (Leopard)
Posted by tom January 15th, 2008
sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config5
Ruby Units
Posted by tom January 6th, 2008
While we’re at it here’s also a little info about the brilliant gem “ruby-units”, which takes away all the nasty conversion from you.
It can be easily installed using the known:
gem install ruby-unitsHere’s some sample code:
require 'rubygems'
gem 'ruby-units'
require 'ruby-units'
c = Unit.new("100cm") >> "ft"
puts c.scalar
k = Unit.new("100","kg") >> "lbs"
puts k.scalar
