Dedicated to my late brave, beautiful and silly mummy, Debra Ross. I love you mumster.

Skip navigation

Category archive for programming

Because archives are so much easier than having just hundreds of posts on the home page. I learned that the hard way.

On low profile PCI cards and Microsoft tax

While I love Apple computers and use my MacBook Pro probably more than any other machine I own, I also love putting together machines myself for eight critical reasons:

  1. It’s cheaper
  2. I choose everything, no need for compromises
  3. I don’t ever have to pay the Microsoft tax
  4. Microsoft doesn’t get any money with bundled Windows
  5. I’m not supporting Microsoft
  6. I can install FreeBSD or NetBSD from the beginning
  7. Much easier to upgrade
  8. I don’t give any money to Microsoft

The latest machine I’ve put together is assembled in a slimline MicroATX tower case to make it easier to take to Adelaide when I go back to study, plus it takes up much less space on my already critically full desk.

The downside is because it’s so slim, the PCI and PCI express slots are only half the width. Doing a bit of research it seems for this machine at least I’ll be limited to using "half height" or "low profile" cards. They certainly do look strange!

It’s less of a concern for this machine because I’m using it primarily for raw number crunching and compiling large amounts of crap, so I’m just using the onboard graphics. Plus, the board has inbuilt FireWire 400 ports, gigabit ethernet and a generous number of USBs… I’ll probably need another gigabit ethernet port before anything else.

Anyone know where you can get a low profile PCI express gigabit ethernet card? ;-)

Rails pollutes Ruby search results!

ASIDE: Within five minutes of this post going live I received a message from Vannesa Choi in Taiwan saying that I can filter out a lot of Rails related results by specifying eRuby specifically instead. I still get lots of Rails results, but certainly much less than before. Xie Xie :)

I’ve been learning Ruby for a while now and have started moving from Perl to it in recent months as my primary tool for solving most of my day to day problems (alas, just with computers, real life is the next step!). With all I’ve picked up I’ve now decided to use Ruby in web development and replace my PHP powered sites other people have coded over to an eRuby FastCGI powered site I code myself (I got part of the way through a similar project a few months back, but life got in the way again and stalled it!). What was the quote that Google put on it’s Google Code adverts? “Computer Scientists don’t adapt other people’s code, they create their own!”

Anyway the problem I’m having with finding quality documentation online for Ruby web development is the exact opposite problem I had when I first learned about CGI using Perl back in 2004: there’s too much of it! But in an ironic twist, just as the sailor stranded at sea in a lifeboat can’t drink the water despite it being all around her, all the documentation I’m finding is all about Ruby on Rails! Even the O’Reilly book on Ruby proudly proclaims it to be the language that powers Rails!

Ruby is not just for Rails!

Virtually every search I perform for Ruby development in books, online or even talking to people, whether it’s for MySQL connectivity, FastCGI or sessions always brings up Ruby on Rails but not Ruby! I don’t want the triple chocolate sundae with nuts and fudge, I want the wholesome Ruby goodness you can only get from eating the plain but smooth vanilla ice cream. From the tub. With a spoon. In my pajamas. That’s a funny mental picture.

Now don’t get me wrong, there are some good websites on Ruby web development such as Hiveminds in the UK, but I guess what I’m trying to say is that I’m fed up with seeing what appears to be an excellent page detailing an aspect of Ruby web development only to discover that they’re talking about Rails! Argh!

I guess one could ask why someone who wants to do web development in Ruby doesn’t want to use Rails, and I could spend all day typing here explaining why, but Hiveminds puts it very eloquently:

One of the most troublesome of the Rails drawbacks for me and the reason that I decided to go with eRuby is the that Rails was taking up all my time with Rails problems and troubleshooting. I was learning a lot about using Rails but not much of the Ruby programming language. Someone suggested we go with CGI instead and while researching this we found eRuby.

eRuby is a much easier way of using, learning and getting the power of Ruby on to a website. With eRuby deployment is a easy as uploading your files to your web server. This is to say deploying an application or webpage is no harder in eRuby than it’s counterparts like PHP or ASP. I honestly believe that if Ruby popularity is going to increase that eRuby will be the reason. Unlike Rails eRuby has a very shallow learning curve and does not require a lot of effort by web hosting companies to set up.

Now just in case you’ve got the wrong idea, I personally don’t have anything against Rails and have even used it myself for a few projects, but for most of what I do it’s overkill and when I’m looking for just Ruby material it can get tedious when you get superfluous information. But I am weird right?

O’Reilly Objective C adventures in Singapore

cocoabooks.jpg

I’ve been looking for a good, thick tome to work through to help me learn the Objective C programming language. Just like Ruby, I like the fact Objective C was also inspired from Smalltalk and given my past (icky) experience with C++ and the fact I run Mac OS X and FreeBSD (which has the GNU compilers) I figured it would be a cool language to work on for another study project, and gosh it just looks like a really interesting computer language. Girls love it when I talk like that you see.

Alas, Singapore seems to have as many books on Objective C as elephants have tails. Wait, elephants do have tails. That was a stupid comparison.

Anyway I’ve searched at Borders, Kinokuniya, Times, Popular… and nobody has anything other than For Dummies books on basic Cocoa development. My personal preference is the O’Reilly book series simply because I remember having lots of fun learning Perl and Python from their books back when I was in high school and I like their format. The Dummies series were fun to learn Visual Basic from back when I was in primary, but these days they seem to chatty to me.

I know I’m probably being really picky, but everyone learns in different ways and I find O’Reilly books to click with me the best. So it begs the question, does anyone know of any good places to buy O’Reilly books (or books that follow a similar style) on Objective C in Singapore?

My next try will be to go to that really good computer book shop in Funan Centre, I’m hoping they might have a better range that some of the generic chains. Or I could renew my subscription to Safrai Books Online, I’m sure they’d have some good material.

WordPress eXtended RSS fun

WXR

I haven’t been having much luck with technology this week, but this seems to be the icing on the cake so to speak. The problem is no matter how hard I try I just can’t get WXR working.

WXR is of course the WordPress eXtended RSS format which allows you to quickly export the entire written contents of your weblog including posts, pages, categories, tags and kitchen sinks. It means you can pick up the guts of your weblog, then do a backup of your wp-content folder which contains all your uploaded media, plugins and themes, then import them somewhere else.

Only problem is, this is the seventh time and I still can’t get it to work on one WordPress installation. I have a local web server running on my MacBook Pro which I’ve set up to test new themes and plugins I’m working on, and on this local installation of WordPress I can import my Rubenerd Show material without any trouble at all, but I’ve had no end of trouble when I try to do the same thing from the Rubenerd Blog.

The curious thing is that there’s no consistency to the errors. On Thursday I tried importing from this weblog and WordPress silently failed; the import page just stopped rendering after it had uploaded the file. Then yesterday I tried again and it was able to import posts but only up to September 2006 when it decided to stop.

The only things I can think of that could be causing this problem is the WXR export php file in WordPress wasn’t uploaded to the server correctly, or the file (2.2MiB) is too big somehow for my local web server to handle, or maybe there’s some malformed HTML in one of my posts which breaks the resulting XML file it’s contained in… maybe it’s just gremlins.

One clue though showed itself when I tried to open the exported WXR file in Smultron:

So perhaps it’s an encoding issue? Or does Wordpress not output UTF-8? Could it be failing because some of my posts have East Asian characters which need UTF-8?

Whatever this blasted problem is, it looks like this is going to be a very, very, very long Saturday.

On Coffee, Ruby, Harry’s and Moving

Just thought I’d give people some updates as to what’s going on and so forth.

Was able to go to Singapore for my birthday, but obvious family issue(s) meant I had to return the next day. I was able to go to the Weiner Kaffeehaus and talk to the owner who was a really fascinating guy, it’s obvious he knew exactly what he was talking about and was very passionate about not only coffee and where it comes from, but the ethics involved. Did you know coffee is the second most traded comoddity in the world after crude oil? Yes, more than steel, more than maize, rice and so forth. I think that’s insane; I also have to wonder how much of that demand has been generated by me over the last few years… blood pressure not withstanding.

Also managed to spend a bit of time at Harry’s down at Clark Quay, a Jazz bar which has awesome music. I didn’t get the names of the people from that night, but the lead singer had one of the most amazing voices I’ved ever heard.

Anyway I’m back in Kuala Lumpur now, back in the rat race. Actually I’m posting from the Starbucks in Cheras which has much faster internet that what we have at home currently. We’ve got about two weeks left here before we return to Singapore, the removalists are coming on Monday to do an inventory check or whatever they call it. So far we don’t have a house, apartment or even suburb chosen in Singapore!

My Ruby on Rails assingment (I creatively call it Ruben on Ruby on Rails, hah, hah) is coming along very well, I just can’t believe how easy it is to get the databases configured and working, it’s insane. As a real world test of the platform the Rubenerd Show and Blog will be moving over to this programme sometime in April. I like to think of it as a Typo programme but with more of a wiki/CMS type approach to uploaded content such as images. Something like this has probably already been done (Radiant CMS comes to mind) but I don’t think they work in quite the same way. Plus this way I can actually claim it for credit, which can’t be a bad thing.

Cheers,
Ruben

On Ruby CGI, hospitals and stuff

The Ruby powered version of the Rubenerd Show and Blog are well underway and are looking pretty good! The way it is at the moment I’m using WordPress which I can’t use for study credits but I can use a blog provided it is powered by a platform I’ve coded myself. I figure if I can get credit for all the work I’m doing here it would be a real help. The only major hurdle I can think of so far will be to transfer all the accumulated WordPress database information over to my program; perhaps I’ll just stick with the WordPress database schema to save myself trouble.

Great Eastern Shopping Mall satellite mapI’m sitting at the Starbucks in Menara Great Eastern, across the road from the hospital where my mum is having her blood tested. From what I can tell the chemotherapy she was having has stopped working and the tumours on her liver have started growing again. Her doctor in Singapore Dr Tan is currently at a conference discussing what to do next. The way medical science is progressing I’m sure there will be another treatment she can go on.

Had a phone call from my good friend Kevin Tan from Singapore who I met in Adelaide last night; he’s working for Sony now, amazing!

Rubenerd Show 222 has been recorded, but given the reliability of internet here I can’t get more than 2/3rds of the way through the upload before it times out. I’ll go to as many Starbucks WiFi hotspots as I can until the damned things gets up to that server!

Cheerio,
Ruben

Ruby 1.8.6 released

Ruby

My new favourite programming/scripting language (not least because it sounds just like my name ;) ) has been bumped up to version 1.8.6.

A shameless blockquote from http://www.ruby-lang.org/:

Ruby 1.8.6 has been released. (announced on [ruby-list:43267])

The source is available under three formats.

For a brief list of user visible changes and a full list of all changes since 1.8.5, see the bundled files named NEWS and ChangeLog, which are also available at the following locations:

After this announcement, we will start the development for 1.8.7 as well as maintaining the “ruby_1_8_6″ branch on which only critical bugs and security vulnerabilities found in the 1.8.6 release are fixed, and patch releases will follow on appropriate and timely occasions. Please check them out after upgrading Ruby to 1.8.6.

I’m implementing the next incarnation of the Rubenerd Show/Blog entirely in Ruby and am having a ton of fun doing it! Coming from a Perl background I feel right at home with Ruby’s string pattern matching features and a large portion of the syntax, but at the same time it looks nicer and the OOP features are so easy to use.

I’m doing work mostly in mod_ruby because I’m a control freak, but perhaps I’ll give Rails a go soon too.

Rubenerd Forum Finally Fixed!

Vanilla Forum SoftwareOriginally posted on the Rubenerd Forum

Well it’s almost 04:30am here in KL, and I figured out what the darned problem was in Internet Explorer!

Brace yourselves! It was… a <div> tag that wasn’t closed! That’s it! I reinstalled the database, I uploaded all the server files twice, I rewrote all the CSS, and it was because I forgot to close a <div> tag. AAARGH! Firefox must have been more forgiving when it encountered my crappy code extensions; in any event for once it wasn’t Internet Explorer’s fault, it was entirely my own!

Tinkering around though with this Vanilla Forum software though I learned a lot, so it wasn’t a complete waste. I figured out how to use the language customisation features, so now we can all bask in the glory that is Aussie/British spelling! I’m so old fashioned :wink:.

I also changed the theme to one that takes up much less screen space.

Let me all know what you think and if you have any further problems. It was exhausting, but in a way I’m glad it happened, I’ve learned so much about Internet Explorer CSS hacks, and how to customise Vanilla Forum software.

Cheers
Ruben