Archive for March, 2008

My April Pledge To You

No inane tech-centric April Fool’s Day jokes, ever.

If you aren’t The Onion, you probably shouldn’t bother either.

Update: The Onion or Avdi Grimm that is, who trumps all the other lame-assed April Fool’s joke with one that’s funny, clever, practical and silent but deadly: Ninja Patching. Well done sir.

Comments Off

chris on March 31st 2008 in /dev/random

“Cannot talk to klauncher” in Gnome

If, under Ubuntu, you’re running Gnome and you get this error with any of your installed applications (such as Amarok, Quanta, etc.):

Cannot talk to klauncher

this ought to fix the problem:

:~$ dcopserver_shutdown
:~$ kdeinit

At least it worked for me.

(Via Linux Forums)

4 Comments »

chris on March 26th 2008 in /dev/random

Browsers Tripping on Acid3

Congrats to the Opera team for creating the first browser to pass the Acid3 test!

And as of today WebKit is a mere 2 points from full compliance WebKit passes Acid3 with 100%.

This is the kind of browser war I can get behind.

Comments Off

chris on March 26th 2008 in /dev/random

Fun With Ruby, Hash and ||=

A short-circuit (||=) edge case by DABlog is exactly the kind of ‘thinking about code’ that I thoroughly enjoy with Ruby. As simple an exercise as “What does this do to?”

h[:x] ||= 2

leads to an interesting exploration of the difference between || and or, what’s going on behind the scenes with ||= and ultimately made me stop and really think about the situation, though in practical terms this has never been an issue I’ve encountered. It’s just fun to walk through it in irb.

If you’re into Ruby I suggest popping over to read the article through, and do work it out in irb as you go.

Now, my two cents: if I were to read that line of code as-is in a project, I’d expect to end up with an assignment in h for key :x. The reason being:

irb(main):015:0> g
NameError: undefined local variable or method `g' for main:Object
	from (irb):15
	from :0
irb(main):016:0> g ||= 3
=> 3
irb(main):017:0> g
=> 3

Intuitively those two ||= statements seem “same” to me.

1 Comment »

chris on March 25th 2008 in /dev/ruby

On the Windows Safari Auto-Install Issue

Maybe you’ve heard about the bit of hoopla over the recent Windows iTunes software update by Apple that also had “Install Safari” checked on by default? If not, you’re not missing much but it’s making the rounds.

My opinion on it, and because I have a website and a blog and an opinion I’m thus eminently qualified to opine about it, is this:

Software updates should only ever update the software stated. Period. The user should never be surprised by the results of a software update. To do otherwise potentially damages trust in the update process which, especially on Windows, may be the most important maintenance process a user under-takes.

2 Comments »

chris on March 22nd 2008 in /dev/random

Inner Voice is For Sissies

Watching, via Twitter, Wil Shipley hack the iPhone API is surprisingly entertaining, if only to serve as perspective on my current dev hurdles:


shipley_hacks_iphone.png

(I hope posting Twitter messages doesn’t violate some sort of unwritten Twitter code.)

Comments Off

chris on March 21st 2008 in /dev/random

Unread Messages Count in LovdByLess

Recently Less Everything released their “social network in a box” platform Lovd by Less, built upon the Rails framework, and it’s pretty nice. Very easy to set up and get running. I’m enjoying hacking around in it.

One of the first things I noticed was that users weren’t told how many unread messages they have when in their dashboard. Easy enough to add, just make these two small changes:

1. In _private.html.erb change the Messages link to:

<%= link_to( "Messages (#{@p.unread_messages.length.to_s})", messages_path ) unless @p.received_messages.empty? && !@p.has_network? %>

2. In profile.rb change the has_many association to:

has_many :unread_messages,   :class_name => 'Message', :conditions => ["messages.read=?",false], :foreign_key => 'receiver_id'

(I suspect the change above is actually a fix to an existing bug since calling @p.unread_messages as-is throws a SQL error).

Comments Off

chris on March 19th 2008 in /dev/rails

Ruby: mysql2omnigraffle

I’ve finally put mysql2omnigraffle up on RubyForge. It’s a Ruby script to visually represent the structure and relationships of MySQL tables in OmniGraffle and at the moment it is very much in development.

If you look at the code you’ll see that it contains methods for handling OmniGraffle communication using both RubyOSA and appscript. That’s because they both seem to have their own strengths and weaknesses and I can’t yet tell which is more suited for this task. Until that time, parallel development with both.

Usage

Call the script with the following options:

~/: ruby mysql2omnigraffle.rb -t db_table_name -h db_host -u db_username -p db_password

Current status

  • Reads tables from a MySQL database.
  • Creates shape objects in OmniGraffle for tables and columns.
  • Displays the tables in a linear format down the OmniGraffle canvas.

Needed

  • Grouping within OmniGraffle to group table header shapes and table column shapes together.
  • Foreign key relationships indicated between tables in some way.
  • A better layout process within the OmniGraffle canvas.
  • Command-line parameters to define database, uname, pword, etc.
  • Remove OmniGraffle 4 hard-coding, get working with OmniGraffle 5.
  • Everything else?

If you’re interested in helping out and relish the opportunity to delve into the guts of raw OmniGraffle apple events, please do get in touch.

4 Comments »

chris on March 18th 2008 in /dev/random

Open Web Vancouver 2008

open web vancouver Looks like I’ll be attending Open Web Vancouver this year, which should be interesting and entertaining and all that.

(And if I can swing it I’m also going to try to hit OSCON 2008 after RubyFringe. With a day or two of rock climbing at Mt. Nemo in between. If you’re a climber and you’re going to be at RubyFringe, come out and join the fun the following Monday!)

Comments Off

chris on March 18th 2008 in /dev/random

Craig Hockenberry on the iPhone SDK

In a world of “woe is us iPhone developers!” and “Apple is sticking it to the users!”, Brain Surgeons is quite frankly the first intelligent speculation I’ve read so far (and I’ve been reading a lot, none worth linking to) about Apple’s possible reasons for prohibiting background-running apps on the iPhone at this time.

Do I expect such a sophisticated system to be available in a beta of version 1.0? Hell no. And neither should you.

Amen.

Comments Off

chris on March 16th 2008 in /dev/random