Login

Your software has a defect, not a bug

Posted by Steve Quinlan on July 12 2010 @ 05:53

Caterpillar

I cringe when software developers say that there's a bug in the software. It feels like the developer is shrugging off any responsibility about the matter, as if a moth randomly flew into the computer and started to swap ones and zeros about.

In fact, the developer has created a fault, error, mistake or defect in the software. If you determine the root cause of the defect, its usually because the software wasn't tested adequately, the developer used risky programming techniques, and he/she didn't have a second or third pair of eyes reviewing the code. 

It's a reflection of the general lack of professionalism that the software developer community exude. We're not accountable for our actions, so we brush of our mistakes by saying a bug flew into the code.

So developers, please take responsibility for your code. You created a defect, not a bug.


0 comment(s)

In praise of Heroku

Posted by Steve Quinlan on May 05 2010 @ 13:51

Heroku

I often hesitate to build trivial Rails applications. The reason is hosting. Sometimes the overhead of setting up a new virtual private server, securing it, and updating it regularly turns me off wanting to make the application in the first place. It costs time and money to pay for the server, which is an unpleasant cost to have to pass on the customer especially when the application is small.

Heroku has changed the game. If you want to write a very simple Rails (or indeed complex) application, you can deploy it for free to Heroku in no time. If you need a few extras such as hourly cron jobs, wildcard subdomains, then you can pay just for those features. There is substantially less fiddling around to be performed when deploying to Heroku.

I've deployed about 3 applications to Heroku, and it wasn't until the 3rd one that it became a smooth process. One does have to make adjustments to one's development environment such as hosting uploadable files on S3, running on Ruby 1.8.6, deploying to Postgres etc. It took quite a bit of jumping through hoops before I figured out how to deploy to Heroku effectively (so be warned)

But the net result is that yesterday I built and deployed a working tested Rails app from scratch for a customer in 1 day - definitely a record for me. 

Thanks Heroku and thanks to Darragh Curran, Declan McGrath, and Kevin Noonan for recommending it to me in the face of skepticism

 

(screenshot taken from www.heroku.com)

0 comment(s)

Top 5 tips for upgrading Rails to Ruby 1.9

Posted by Steve Quinlan on January 06 2010 @ 10:23

[Warning, this is a programmer post. It gets Blurby!]

We’ve upgraded almost all of our applications to Rails 2.3.5 and Ruby 1.9. All things said, it was not easy.

So here are my top 5 tips for upgrading your Rails applications to use Ruby 1.9

The MySQL Ruby Gem

If you use MySQL, use this mysql-ruby fork by  Loren Segal. It wouldn’t install as a gem so I downloaded the code from GitHub and turned it into a gem. Email me if you want the gem.

The MySQL Database

The columns and tables in our databases had to be converted to UTF-8. These commands came in handy

/* Here's 1 command altering a table, and 2 commands altering the first 2 fields in that table */
alter table users character set utf8;
alter table users modify email varchar(255) character set utf8 collate utf8_unicode_ci;
alter table users modify crypted_password varchar(255) character set utf8 collate utf8_unicode_ci;
/* etc.... */

Then I put these lines in my.cnf

[mysqld]
init-connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_general_ci

UTF-8 + Rails + Ruby 1.9

Watch for UTF-8/ASCII problems. In combination with the above, I would advise

  • Putting # coding utf-8 at the top of your ruby code
  • Putting these lines into your environment.rb

Encoding.default_internal = 'utf-8'

Encoding.default_external = 'utf-8'

Maintaining Multiple Ruby versions

Use Ruby Version Manager. This is very useful if, like me, you have a number of Ruby 1.8 and Ruby 1.9 applications running. Ruby Switcher makes it easy to install new Ruby VM’s and switch between them.  Note, it installs Ruby 1.9 off your home directory. Edit the script to change this.

Test

All of our applications have a healthy mixture of Test Unit tests, and Selenium tests. Converting to 1.9 would have been terrifying without this safety net.  It’s been said enough already, but if you’re not testing your code, I would advise that you start now.

If you’ve any questions about converting your Rails applications to Ruby 1.9, just email me or comment below.

0 comment(s)

Irish students forced to use Internet Explorer

Posted by Steve Quinlan on May 15 2009 @ 09:42

Internet Explorer Voodoo

Did you know that some people defend Internet Explorer? It’s true.

We got a support call from a client yesterday who was demonstrating their Kablingy-built product in a  school (I believe a third level one). They application we had built for them wasn’t working on Internet Explorer.

No surprises there.

When I gave my stock answer to the IT administrator to try Firefox, I was truly shocked at the response.

“Sorry, we don’t want Firefox in the schools because it can’t be controlled”.

Apparently some IT administrators want or need to set what the users can visit, what they can download, and what the homepage must be, all from the server. I’m told Firefox doesn’t allow for this. Furthermore, the IT administrator did not want to see Firefox in any school in the country. No disrespect meant towards the IT admin, but this is the fear, uncertainty and doubt propaganda that’s being spread to our children and their keepers.

I generally meet two kinds of clients in my travels – those who use Firefox/Safari/Chrome etc. and those who don’t know about the latter and use Internet Explorer because they don’t know how crummy it is.

I have never met someone who actually stood up for the product. It also makes me sad to think that this is how IT administrators and schools think about students. We must restrict and control everything they do on the web in order to protect the school, and in the process we must make them use the worse software out there.

What kind of adults are we going to produce with that attitude?

And for the record, there’s no hard feelings directed at the IT administrator – he’s just doing the best job he can with the demands made of him. But what hideous demands they are.

0 comment(s)

Could somebody please resuscitate GNU/Linux?

Posted by Steve Quinlan on April 04 2009 @ 09:30

Resusitate A Lizard

Humour me please.

OS X

Take a look at the feature list for Apple’s OS X Leopard:

  • Time Machine – See how your system looked on a given day and restore files with a click.
  • Mail – Email personalized stationery, take notes, and write to-dos that appear in iCal.
  • iChat – Video chat with effects and backdrops, present remotely, and get more from text.
  • Quick Look – Browse, play, view, and page through your files. Without opening them.
  • Boot Camp – Run Windows on your Mac.

Windows

Take a  look at the feature list for Microsoft’s Window Vista:

  • Find, fix, and share photos – Organize, edit, and share your favorite photos with family and friends using Windows Photo Gallery.
  • Find almost anything -Find documents, e-mail, photos, and more in a snap through Instant Search.
  • Turn any room into a media room – Manage and enjoy digital photos, music, TV shows, and movies in your living room with Windows Media Center.M
  • Make movie magic – Retain high-definition quality as you capture, edit, and publish movies from a video camcorder with Windows Movie Maker.2

Both feature lists look relatively good on the box. I’ll omit how well each lives up to its advertised features, except to say I like OS X and I detest Vista. But at least I detest it. There’s something to work with there. One could argue Windows is opinionated. Hell, at least they tried!

GNU/Linux

Let’s take a look at the different variants of Desktop Linux and the features they advertise. Starting with:

Fedora Linux

After scrolling down through paragraphs of missions, core values, community, method, I got to what looks like the distinguishing feature list:

  • NetworkManager
  • D-Bus
  • PolicyKit
  • PackageKit
  • HAL
  • FreeIPA
  • SELinux
  • PulseAudio

Oooooh, excited yet? Take a look at some screenshots from the new Fedora Beta coming out in May. From this arstechnia article.

Fedora 11 Screenshot

Fedora 11 Screenshot

 

Fedora 11 Pk1

 

This is about as exciting as an episode of Friends, unless you are stimulated at the sight of sound preference pop ups of course. Read the arstechnia article in case you think I’m taking this out of context.

[Update 6/4/09: A commenter informs me that Fedora 11 is more intended for IT technicians rather than regular users - its more comparable with Windows Server]

Let’s take a look at another popular flavour:

Ubuntu Linux

Here’s the blurb:

With Ubuntu Desktop Edition you can surf the web, read email, create documents and spreadsheets, edit images and much more. Ubuntu has a fast and easy graphical installer right on the Desktop CD. On a typical computer the installation should take you less than 25 minutes.

I could do all that in Ubuntu in 2004. The feature list for the current release is more of the same. I can browse, chat, email, type a document, and plugin my music player.

Great.

When can I put together a great home movie, record a song, or make a DVD on Ubuntu, out of the box?

When can I waste a precious hour of my Saturday taking a hundred daft photographs like this, using just the camera in my computer?

Silly Photo taken on a Macbook

Can anyone rescue GNU/Linux from a world where features like ‘Ext4 support’ and ‘X.Org server 1.6′ are seen as the latest features to be advertised?

Maybe it's happy to stay in that world.

5 comment(s)

A date with IE8

Posted by Steve Quinlan on March 30 2009 @ 09:23

Typical Web Developer Using Ie8

Today we had to test our application (Overtake) on the recently released IE 8. I was quite hopeful as my Twitter friends had spoken favourably of it, and I figured after all this time, Microsoft would eventually produce something that was compliant and respectful of industry standards. Lofty goals of compliance aside, what I was wanted was that the application would behave as it already does in Firefox, Safari, Opera & Chrome. I develop for Firefox, and 9 out of 10 times, everything is perfect in all of the other browsers. This is all I wanted for IE 8. In short, I wanted to forget about IE from the development cycle.

Happiness did not follow.

Installation

The fun started with the installer. As usual IE 8 can’t separate itself from the operating system. An update to Internet Explorer is a multi stepped and time consuming process. It means an update of the OS, virus checks, integrity checks. Then there’s the questions. “What is your default search engine? Where would like to import Bookmarks? How are you coping in the recession?”.

Once this was over, I realised IE7 had been destroyed in the process. Since I really need IE7 for testing purposes, I went on a wild goose chase to have an operating system that runs IE 8, IE 7 and for fun, IE 6.

Bad idea.

Multiple IEs

To date, I’ve been using Tredosoft’s Multiple IE program which allows me to run IE 6 and IE 7 amounst others. It’s perfect for testing. So when I realised IE 7 was no more, I followed this advice and installed Tredosoft’s “Stand Alone” installation of IE 7 to complete my growing collection of pointless Microsoft browsers.

Don’t do this.

When I installed IE 7, it broke IE 8. Drop downs no longer worked! Everytime I clicked on a drop down box, the popup blocker(!!) was invoked and could not be disabled despite clicking every preference available. Of course I didn’t know the weirdism was because of the dual install. I guessed it was a defect in my coding. So this wasted another hour until I realised it wasn’t my fault.

The Reinstall

So now I went to re-install IE 8. This really took a long time. An hour easily. First it uninstalls everything, reboots, and re-installs. Why is this software so punishing?

Since I’m running Windows on Parallels on OS X, I took precautionary snapshots so I can test on IE 7 and IE 8 by reverting snapshots. A messy solution but it gets the job done. Microsoft recommend Virtual PC for this task. Forgive me if I’m not hopeful about anything Microsoft produces. Instead I’m hopeful about Cross Over which hopefully will run IE 7 and IE 8 on OS X in a couple of months. You can follow their friendly marketing dude, Jon Parshall, on Twitter.

In case you think the above catastrophe was all ignorance and kerfuffle on my part, I leave you with the results of the Acid3 Test run on Internet Explorer 8. I should mention that Safari 4 and Opera 10 both score 100% on this test.

IE 8 Acid test scoring 20%

Certainly a middle finger to standards, to web developers, and an Epic Fail in general.

Photo taken from Flickr

0 comment(s)

Setting up git the almost easy way

Posted by Steve Quinlan on February 08 2009 @ 15:31

Spellbook

 

Friend of Kablingy and all round smart fellow Sean O'Donnell tells me that a sizeable chunk of his site traffic is for a blog posting on how to set up Subversion on Debian with Apache 2. Looking at the incantations on this arcane scripture from 2005, I've no idea how he figured it out. I asked him why he hadn't posted one on how to set up git on a server, and he replied that it was too complicated to set up, what with gitosis etc.

I asked him why he hadn't done it the almost easy way (no, not via the brilliant github), and he suggested I should write it up.

So here it goes. Wizard hat on, magic wand in hand, let us call out some incantations. At Kablingy, we favour Ubuntu servers  hosted by the outstanding provider Slicehost. Hopefully these steps shouldn't require too much adjustement for your set up. I shall mark instructions for your local machine with [local] and instructions for your server with [server].

Steps 1 and 2 are for those without a git user on their server, and without a git repository. Readers can probably skip straight to the meat of the article in step 3.

1. SSH Preparation

If you already have a git user on your server with ssh access, you can skip to the next section.

As root, add a user called 'git', and give it ssh access.  This presumes you have already done the ssh public key dance etc. Instructions can be found on the Slicehost Articles

server: sudo adduser git

then set password etc..

give the git user ssh access

server: sudo nano /etc/ssh/sshd_config

add the user to the list of users with ssh access

AllowUsers otheruser anotheruser git

Reload SSH

server: sudo /etc/init.d/ssh reload

Login to the git account and allow your local machine to ssh to that account

server: su git

Put a copy of your local machine's public key into the /home/git/.ssh/authorized_keys file.

Check that ssh access works

local: ssh git@server

This should bring you to the prompt on your server

2. Set up a simple git repository

Let's set up a simple repository. If you already have a git repository, you can skip this step

local: mkdir ~/myapp

local: cd ~/myapp

local: echo hello > myfile.txt

local: git init

local: git add myfile.txt

local: git commit -a -m "my first commit"

3. Upload your git repository to the server (the weird part)

Tell your git repository about your server

git remote add origin ssh://git@server/home/git/myapp.git

If that doesn't work, try it manually. Prepare the git config file

local: cd ~/myapp/.git local: nano config

Paste this sorcery into the git config file. Adjust the line in bold to suit your server.

[core]

  repositoryformatversion = 0

  filemode = true

  bare = false

  logallrefupdates = true

[remote "origin"]

  url = ssh://git@server/home/git/myapp.git

  fetch = +refs/heads/*:refs/remotes/origin/*

[branch "master"]

  remote = origin

  merge = refs/heads/master

Now clone a bare version of the repository into a directory called myapp.git

local: cd ~

local: git clone --bare myapp myapp.git

And move that repository up to your server.

local: scp -r myapp.git git@server:

Don't forget the : at the end of the above statement. If your repository is rather big you might want to zip up the directory first, but you will have to unzip it once it's on the server.

Now test that the local machine repository can talk to the repository on the server:

server: git pull

From ssh://git@server/home/git/myapp

* [new branch] master ->origin/master

Already up-to-date

Let's add another file to the repository

touch Another file > anotherfile.txt

git add anotherfile.txt

git commit -a -m "added another file"

git push

You should see something like:

Counting objects: 4, done.

Compressing objects: 100% (2/2), done.

Writing objects: 100% (3/3), 308 bytes, done.

Total 3 (delta 0), reused 0 (delta 0)

To ssh://git@server/home/git/myapp.git c2985b7..68b18a3 master -> master

To clone your repository from the server, type:

git clone ssh://git@server/home/git/myapp.git myapp

That's it! To give somebody else access to your repository, you can use the above statement, but their ssh public key will have to exist in the server's /home/git/.ssh/authorized_keys file. This is described in step 1.

Credit goes to the Darryl West who wrote this helpful blog posting on setting up git for flex projects.

Finally kind reader, please let me know of any defects in this article.

Picture borrowed from creative commons images on Flickr

0 comment(s)

Kablingy have a new look and feel

Posted by Steve Quinlan on January 27 2009 @ 11:48

New blog, new website look and feel, new office, new phone number, new shoes.

We'll be posting on developments in our company, Rails, Web, and Agile.

Stay tuned

0 comment(s)