Mastodon

Firefox 4 Beta on Ubuntu

I am playing with the 64 bit version on Ubuntu Karmic and so far is seems pretty great. You can grab a copy here and, once unzipped into a directory you can run it by doing

chmod +x firefox

./firefox

Its generally feels snappy; opens quickly and loads the pages quickly. No crashes yet either. One serious downer is the lack of a 64 bit flash plugin which Adobe has recently withdrawn. Vendors have been selling 64 bit systems for years now, but for some reason Adobe hasn’t been able to release an official 64 bit flash plugin yet. So Mozilla finally launches a 64 bit browser and great swathes of the internet are unusable to anyone who uses it. Nice. No wonder Steve Jobs doesn’t like these guys. The speed the 64 bit gives is needed when dealing with Javascript intensive sites. The javascript driven Visual editor on WordPress, while sluggish at the best of times, is painfully slow with the Beta of 4. Even switching back to the tab running the WordPress editor is sluggish. On the other hand Google maps is noticeably faster and smoother at nearly everything.

I am also excited by the new Add-ons manager. Mozilla is taking things that typically open a new window and making them run in a new tab instead. This is excellent since the Add-ons definitely require more space than the dialog they were appearing in allowed for. Its interesting that for all the seeming obviousness of the tabbed window design and how long its been around, browser makers are still working on fully integrating the concept into the browser.

My only disappointment so far is likely not an issue with Firefox at all. When I first saw the mockups I was excited to see that Mozilla was following Chrome’s lead in moving the tabs into the otherwise underused title bar. While I love the screen real estate that Chrome gives, it hasn’t been enough to tempt me away from all the amazing plugins that Firefox has.

Version 4 was supposed to mean that I got to have my cake and eat it too, adding the look of Chrome to the browser I already use.However while Windows users get the Chrome like interface, on Linux they have merely simulated the effect by hiding the bookmarks toolbar. Irritatingly, the Windows 32bit version gets the full treatment, tabs on top, File, Edit and Bookmarks all hidden away until you hit the ALT key. Its pretty sexy.

Disappointing but my suspicion is that it likely has something to do with the way windows are handled by Gnome, rather than anything to do with Firefox. Hopefully that will be sorted out with Gnome 3. For the moment, fast is good enough.

Dear Canonical: Need Data.

Dell’s partnered with Canonical in 2007 was pretty exciting news. In my professional life I have spent close to half a million on computer hardware with the majority of it going to Dell. All my personal computers have always come from them as well. When I decided to get myself a new laptop, I went to straight to Dell.ca/ubuntu to pick out my dream machine.

After a little poking around I realised that they only sell Ubuntu on the low end machines. At the time (almost a year and a half ago now) they sold Ubuntu preinstalled on at least one desktop machine and on maybe three different laptops. Their best one was the lowest end of the XPS line and had very few customisation options.

While I really wanted to buy a system with Ubuntu preinstalled so Dell would know that a market for this stuff actually exists, I also knew I would be doing myself a disservice by buying something less powerful than I needed. After agonising over it I bit the bullet and bought the top of the range XPS with most of the bells and whistles… and Windows Vista.

Looking again, Dell seems to have reduced even that meagre offering and is now only offering Ubuntu preinstalled on the Dell mini netbook and a low-end Inspiron laptop. Aside from the fact that Ubuntu is almost impossible find for anyone not typing in the URL directly, the worst part is the Inspiron 15 with Ubuntu is $579 while the Inspiron 15 with Windows 7 is $569. Perhaps I’m old fashioned, but a computer with a $110 copy of Windows 7 on it should be more expensive than one without. It would be nice if one of the most obvious benefits of Linux were a little more obvious in the pricing. For a partner, Dell seems to have some funny ideas about what will help Ubuntu sell well.

While I believe Dell was correct in sensing that there is a market out there, and gutsy enough to try it out, its Ubuntu offerings seem to be languishing. Partly its pricing silliness and poor marketing but mostly it seems like they are misreading the market. Its been my experience that Linux users don’t buy low end hardware. Low end hardware in the Linux community seems to be something that is either gifted or salvaged, not something you purchase. When purchasing, its mid range to high end systems they are after. With that in mind, I can’t help but feel that Dell has missed the mark with their offering.

I suspect they missed it for the same reason most other companies still think there is no money to be made in the Linux world; there’s very little data. While Canonical is starting to gather a little data for their servers, I think the desktop probably needs it more. Perhaps its time for an Ubuntu version of the Steam Hardware Survey. Maybe they should consider some demographic surveys as well.  I think its time we find out big the GNU dollar is.

I think this needs to happen before companies fall prey to a self fulfilling prophecy; Offer a product blindly, receive an underwhelming response, and conclude that there really is no money to be made from the 12 million+ Ubuntu machines and the unknown number of users of other distros. This kind of data would be invaluable not only to developers considering a Linux version of an existing program, but also to partners like Dell who just seem to need a bit of a nudge in the right direction.

What say you Canonical?

Postgres and Rails – for MySQL people

A little while ago I decided to switch from MySQL to Postgres for my development database. Although I love how command line friendly MySQL is and think group_concat is the bomb, I’ve been burned my MySQL’s loosey-goosey nature and had it corrupt some data on me. I decided that it was time to switch to Postgres. The transition was a little aggravating at times but it doesn’t take long to get used to it. Installing Postgres is easy enough on Ubuntu:

mike@sleepycat:~$ sudo aptitude install postgresql postgresql-server-dev-8.4

If you need to start at new Rails project you can specify Postgres right from square one:

mike@sleepycat:~/test$ rails myapp -d postgresql

After installing the database I started to look for the gems that provide the driver. I found myself sorting through a bewildering number of gems. “Postgres”, “postgres-pr”, a few minutes search turned up several options each of which proved to be the wrong thing. The gem you need is actually called ruby-pg and is written by a group of people that includes the actual creator of the Ruby language, Yukihiro Matsumoto. Although it is called ruby-pg if you ever want to find it on the internet, you install it using the name pg:

sudo gem install pg

The next stumbling block for me was my assumption that the naming of the Rails adapter would be similar to MySQL. Since adapter: mysql is what I have been using in my project already, I assumed adapter: postgres would be fine. It’s not.

development:
adapter: postgresql
database: myapp_development
username: postgres
password: password
host: localhost

Coming from MySQL, it took a fair bit of reading to collect the Postgres equivalent of all the commands I use most often. Just to save you some looking here is my “Cole’s Notes” version:

Setting a password for the default user ‘postgres’:

mike@sleepycat:~$ sudo -u postgres psql postgres
[sudo] password for mike:
psql (8.4.2)
Type “help” for help.
postgres=# \password postgres
Enter new password:
Enter it again:

Create a database as user ‘postgres’:

mike@sleepycat:~$ sudo -u postgres createdb myapp_development

Drop a database as user ‘postgres’:

mike@sleepycat:~$ sudo -u postgres dropdb myapp_development

Get to the command line of the database myapp_development as user ‘postgres’:

mike@sleepycat:~$ sudo -u postgres psql myapp_development

Load the file ‘pgdump.sql’ into the myapp_development database as the user ‘postgres’:

mike@sleepycat:~/$ sudo -u postgres psql -f pgdump.sql myapp_development

Dump a Postgres database to a file:

mike@sleepycat:~/$ sudo -u postgres pg_dump myapp_development > ~/myapp_dev_dump.sql

Show tables:

postgres=# \dt

show a table:

postgres=# \d tablename

quit:

postgres=# \q

Thats what worked for me. In general I feel like using postgres is forcing me to write more portable code. Pretty much anything I write in Rails that runs in postgres will run on MySQL, but the reverse is really not true. Little things like using ‘1’ for true. MySQL is fine with that but for Postgres with a real boolean datatype, true is true. 1 is not. I stumbled arcoss that when I was using validates_acceptance_of. I feel like its also forcing me to write better SQL as well. If you’ve written a bunch of “find_by_sql” in an existing app you might not appreciate its pickyness though. However once the initial pain of the switch passes, Postgres is pretty great.

Ubuntu One’s new Music Store

Ubuntu's Music store

Well I’m not sure why it’s here, but it is. Ubuntu launches its music store with the upcoming release of Lucid Lynx. It’s easy enough to find, as its integrated into Rhythmbox. I was lukewarm on the idea when I heard it mentioned a while back, and after playing with it a little, not much has changed. I hate to rain on the parade because Lucid Lynx is looking like a REALLY good release, but this music store feels really tacked on.

While I was able to find pretty near every obscure artist I searched for, searches for Radiohead and Madonna turned up nothing. Where services like Magnatune and Jamendo definitely reflect the values of the Linux community in the sense that both make their ethical business practices (like how they deal with artists) a centre-piece of their business and offer music in open, unpatented formats (lossless Flac and Ogg Vorbis as well as others), the Ubuntu service seems out of step.

Apart from presumably supporting Ubuntu (a worthy thing in and of itself) you can only guess to whom the money might go when you buy a track. All of the albums I looked at were only available in the patented MP3 format, a very strange choice for a company with such powerful a voice in the FOSS community. Doubly strange when Ubuntu doesn’t even play MP3s by default because of the patents involved.

On top of that, while the quality of the files varied between 320 and 192, the price remained steady at .99 euros. Shouldn’t the price and the quality be connected? My guess is that this is really just an Ubuntu front end on someone else’s music service (it turns out it is). If it isn’t, it sure feels that way. In the end I suppose any revenue stream is a good revenue stream, but in my opinion, Ubuntu really needs to rethink this one and bring it in line both with the values of the community and with the othewise excellent work they are doing in other areas.

Ubuntu Lucid Lynx Beta 2

Beta 2 was posted 5 days ago and I am just getting to giving it a spin. The amount of polish on this release is looking seriously impressive. There are still issues with ACPI when you run it in VirtualBox though. I was assuming those would be ironed out by now.

The UI design team at Ubuntu caused a bit of a kerfuffle when they chose to move the min/max/close buttons to the left side of the application windows. Its a change that I find somewhat annoying but one that it has been decided that will be included in the final release. Given that it is so easy to change back, its really not worth getting upset about. If you don’t like it, slap this in the nearest command line:

mike@sleepycat:~$ gconf-editor

The Gnome configuration editor will come up and under /apps/metacity/general/button_layout you can set the buttons up any way you like. The old setting was menu:minimize,maximize,close.

The new installer is looking really impressive:Over all everything is looking rounder, sleeker and sexier. The new purple colour scheme is really nice. I’m not sure yet what I think of the music store that is included in this version or the App store.

While I am happy to see Ubuntu taking this mainstream, I am a little wary of how well some of these commercial ventures will mix with the underlying philsophy. A big part of what makes Linux generally more secure than Windows is the fact that there is no monetary barrier to updating to the lastest version of whatever software. Can you sell applications without losing that? Not sure yet.

For those like myself running VirtualBox OSE 3.0.8; you will need to get a newer version of the Virtualbox Guest additions iso.

Installing memcached gem on Ubuntu Karmic

After my recent fiddling with caching and a little preliminary reading for an interesting side project I’m considering, I decided to install memcached. As will all things on linux, its really easy to install… unless its not. Every time I try to get one of these things going it always takes a while to figure out what packages are needed so the gem can function. So here they are:

sudo aptitude install libmemcached-dev libsasl2-dev libmemcached-dbg

I’m not sure that you need the debug libraries in there but its better to have them and not need them, than need them and not have them. Right?

Now you are ready to install the gem :

sudo gem install memcached –no-rdoc –no-ri

If you miss that libsasl2 library like I did the first time, all manner of badness happens as you can see below. But now you know how to avoid it.

ERROR:  Error installing memcached:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
Libmemcached already built; run ‘rake clean’ first if you need to rebuild.
creating Makefile

make
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I.  -fPIC  -I/usr/lib/ruby/gems/1.8/gems/memcached-0.19.2/ext/include  -L/usr/lib/ruby/gems/1.8/gems/memcached-0.19.2/ext/lib -fno-strict-aliasing -g -g -O2  -fPIC   -fno-strict-aliasing -g -g -O2  -fPIC   -c rlibmemcached_wrap.c

Just so you know, after completely screwing up my first install, and realising that the suggested “rake clean” in the memcached directory was failing as well, I sorted it out by deleting the entire /usr/lib/ruby/gems/1.8/gems/memcached-0.19.2 directory. Very ugly. Doing it right the first time is recommended.

So now that its installed, lets test it to see that everything is ok using the example from the README:

mike@sleepycat:~$ memcached -p 11211 &
[1] 15778
mike@sleepycat:~$ irb
irb(main):001:0> require ‘rubygems’
=> true
irb(main):002:0> require ‘memcached’
=> true
irb(main):003:0> $cache = Memcached.new(“localhost:11211″)
=> #<Memcached:0x7feb57cf8b50 @not_found=#<Memcached::NotFound: Memcached::NotFound>, @options={:no_block=>false, :logger=>nil, :ketama_weighted=>true, :retry_timeout=>30, :timeout=>0.25, :auto_eject_hosts=>true, :support_cas=>false, :show_backtraces=>false, :rcv_timeout=>0.25, :buffer_requests=>false, :credentials=>nil, :prefix_delimiter=>””, :sort_hosts=>false, :server_failure_limit=>2, :verify_key=>true, :distribution=>:consistent_ketama, :tcp_nodelay=>false, :hash=>:fnv1_32, :default_ttl=>604800, :use_udp=>false, :cache_lookups=>true, :poll_timeout=>0.25, :default_weight=>8, :binary_protocol=>false, :connect_timeout=>4, :hash_with_prefix_key=>true}, @default_ttl=604800, @servers=[“localhost:11211:8”], @not_stored=#<Memcached::NotStored: Memcached::NotStored>, @struct=#<Rlibmemcached::MemcachedSt:0x7feb57cf8ad8>>
irb(main):004:0> value = ‘hello’
=> “hello”
irb(main):005:0> $cache.set ‘test’, value
=> nil
irb(main):006:0> $cache.get ‘test’
=> “hello”
irb(main):007:0>

Fun with Ubuntu’s notifications in Ruby

Ubuntu has a pretty snazzy notification system and, as it turns out, its really easy to use it in your scripts. At its core is libnotify, which is already somewhere on each Ubuntu system. To talk to it in your Ruby scripts you need to install the bindings for Ruby and the gem.

sudo aptitude install libinotify-ruby libgtk2-ruby libnotify-dev;

And then:

sudo gem install libnotify

Once thats done, fire up IRB:

irb(main):018:0> require ‘date’
=> true
irb(main):019:0> require ‘rubygems’
=> true
irb(main):020:0> require ‘libnotify’
=> true
irb(main):021:0>Libnotify.show :summary => “#{Date.today}”, :body => “Happy #{Date::DAYNAMES[Date.today.wday]}!”
=> true

The “require ‘date'” is only there because IRB doesn’t seem to include Date (or doesn’t include all of  it) for some reason. The result:

How awesome is that?

The downward spiral

There are few things that get computer users as riled up as the user interface. Everyone is effected by it and everyone has an opinion about it. What works for one person is likely to induce tourette’s in another. Battle lines have been drawn for years between the Mac world and the PC world and their differing implementations of effectively the same “desktop metaphor”.

Though most of my computer use has been on Windows, I have a few years of solid use of both Mac and Linux. In the last few years I have ended up switching between them at pretty regular intervals: Windows at work, Linux at home and Mac at my Girlfriends. Several months ago, I set up my laptop as a triple boot, (Windows 7, Ubuntu 9.10, and OS X) further accelerating the rate at which I switch between them.

All this jumping from one User Interface to another has slowly created a pretty generic sense of the desktop metaphor in my head along with a notion of trajectory. While there are things I like and things I don’t about each, my overall impression of the trajectory is this: UI is getting worse.

Learning object oriented programming in school we were warned against creating a “God object” that does every possible task in the program. Though that particular anti-pattern is studiously avoided by programmers, it seems increasingly popular for UI designers. So what do the Windows “Start” menu, the KDE “kickoff application launcher”, Windows 7 Start menu and the soon to be released Gnome 3 Activities menu have to do with the God object?

I think they are all part of a UI anti-pattern which I’ll call the “God box”.

To me, its an insane idea that everything that happens on a computer should start by clicking on a single widgit (be it button, menu, launcher or whatever). Many have pointed out how twisted the logic is to have to click a button labelled “Start” to be able to turn off your computer, but this is exactly the kind of stuff you get with a God box. While programs and system settings are proliferating, UI designers are trying to cover up the complexity rather than reduce it.

As Jensen Harris (the guy who designed the Microsoft office ribbon) said of the Word 2002 task pane: “We did what every user interface designer does when they run out of ideas; we invented a new rectangle”. The “Start” menu or the “kickoff application launcher” aren’t new panes but they are essentially a “new rectangle” placed above the mess of submenus in hopes managing the presentation of what lies below.

To me the KDE kickoff application launcher is the most over the top example of this anti-pattern, but it seems that UI nerds everywhere are following it. In Window 7 Microsoft finally ditched the classic start menu and forces everyone to use their version of the God box type Windows menu.

While God boxes allow others stay above the issue, offering ways of filtering the mess below, Gnome waded in and broke the entirety of the operating systems capabilities into enough separate menus that they no longer required filtering or deeply nested sub menus. Currently I have a menu for each of the most common things I am going to do: find a program to run (Applications), look for something (Places) or change something about my computer (System).

With rare exceptions I never need to go below a single sub menu. To me, that’s good UI design. The path to what I want should be as direct as possible. Why should I have to take a trip down the UI rabbithole, hunting for something in a sub sub sub menu when I just want to run one of the applications I have installed? Gnome also kept the best parts of both Windows (like the taskbar) and the Mac (like having a CD/DVD appear on the desktop). In general I think its highly underrated in terms of UI.

Unfortunately, with Gnome 3 around the corner, the UI team at Gnome seem to have succumbed to the same thinking that influenced Microsoft and KDE. It looks like they have created their own God box, known as the “activities menu” to replace all the current menus in Ubuntu 10.10.

Apple seems to avoid most of these issues by saying: “Fuck you, build your own menu” and leaves the users to root through theirs applications folders to set up their equivalent of the applications/programs menu (the dock) themselves. The “apple menu” is really the only other place to look for things that aren’t somewhere in a folder. I suppose simple is a reasonable substitute for friendly, but to me it doesn’t seem like good UI any more that if Microsoft added every program to a quicklaunch bar.

So as far as I can tell the trend seems to be towards more clicking and more sub sub sub menus. Add to that the recent decision by Canonical to purposelessly move the min, max and close buttons to the right (what conceivable benefit could there be that would make the aggravation worth it?), and news about things like the “task pooper”, the path that current UI design is going down is inducing more eye rolling than anticipation in me. I hope I’m wrong about the Gnome activity menu, but I’m not holding my breath.

Rails 3 on Ubuntu Lucid.

I just got finished updating my Rails setup script and testing it on the Alpha 3 version of Lucid. Now that the packages seem to be settling down the the repositories for Lucid suddenly I can find the ones I need for Rails. The script now gets Rails 3 running on either Karmic or Lucid. If you need older versions of Rails just uncomment the lines for the version you need.

You can get  the latest version of the script here: http://github.com/sleepycat/wrong-side-of-the-tracks

Lucid Alpha 3 in Virtualbox.

Everything I am hearing about the upcoming Lucid Lynx release of Ubuntu sounds really great. I just grabbed Alpha 3 from the Ubuntu site and was a little dissappointed to see it hang as soon as I selected “Install Ubuntu”. The fix is to turn off the ACPI option in the system settings for your VM.

The side-effect of this is that the virtual machine will no longer close the window and disappear when you shut it down. C’est la vie.

From there the installer started up fine, but it hung again when I tried to update the installer. When I skipped the update it installed without any other problems. Thats what worked for me on Virtualbox 3.08 OSE.

UPDATE: This issue still seems to be effecting the new Lucid Beta 1…