Apr 12

var self = this;

JavaScript, Tech 4 Comments »
$.fn.delayHide(time, callbackArgument) {
var self = this;
setTimeout(function() {
callbackArgument.call(self);
}, time);
}

I find that I have to use the var self = this; pattern far too often in JavaScript.

The darn magic scoping of this really gets ya.

I also had someone ask me why foo never ended up containing something:

var foo = bar(function() {
....
return something;
});

It made me more worried about adding closures to Java :)

Apr 12

Leopard won’t pounce until October

Tech No Comments »

This is so well spun:

iPhone has already passed several of its required certification tests and is on schedule to ship in late June as planned. We can

Apr 11

The conspiricy theories of crowds

Tech 3 Comments »

I don’t know whether to laugh or cry when I read the comments to Proposal for the W3C to adopt HTML 5.

I love how people are so keen to find crazy theories and to throw mud at people based on the most bizarre reading of the situation.

Some of the commenters truly are in a bizarro-like universe as David says:

Reading the comments on this is absolutely astonishing. Ian Hixon a corporate pawn? Mozilla, Opera, Google, Apple, and Microsoft all teaming up in a conspiracy to mess up the internet? What kind of bizarre parallel universe are you people living in?

“Dave Hyatt” has the best response:

I would like to take the time to respond to this in detail, but my Evil Underling beeper has just gone off. My overlord and master Ian Hickson has summoned me to his underground lair beneath Google to discuss further our plans for global domination.

Come on people. Before you spew this crud, take part in the conversation and see what is really happening. It is easy to blow hard.

I feel like I need to apologise to Ian for this crap. Fortunately, I know that a magnitude more people do not comment, but read, and they aren’t fooled.

Apr 11

Blogger supports enclosures via the GData API

Google, Ruby, Tech 6 Comments »

I am producing a new podcast and since I was using Blogger for the podcast blog, I really wanted to be able to throw enclosures right into the feed.

I had thought that Blogger didn’t support enclosures, but I found that this wasn’t the case. Although there isn’t an area in the UI to upload files to a blog post, the GData Blogger Data API does allow you to attach an enclosure to an entry.

Since the GData API works with Atom feeds, you will need to attach a correct link tag (as opposed to an <enclosure> tag from RSS) to the blog entry that you want to attach the podcast.

E.g. a simple enclosure can be added as

<link rel=”enclosure” type=”audio/mpeg” title=”MP3″ href=” http://foo.com/episode2.mp3 ” length=”19283″ />

You can also add other types such as BitTorrent.

To implement adding an enclosure I created a ruby script to do the work called addenclosure.

This script takes a bunch of arguments:

  • Blog ID: If you don’t know your blog id, simply go to your feed at http://yourblog.blogspot.com/ /feeds/posts/default and look for the id field. It should look something like tag:blogger.com,1999:blog-4808741160899251111
    . The numbers are the id that you need to plug in (4808741160899251111)
  • Entry ID: To find this id, you can either look in the same feed and hunt for the correct entry: <entry><id>tag:blogger.com ,1999:blog-4808741160899251111.post-5004114743910071111</id>... and the numbers after the ‘post-’ are for the entry (5004114743910071111). You could also view the entry itself and look for the comment feed ( http://yourblog.blogspot.com/feeds/5004114743910071111/comments/default ) or various post links, that have the post id.
  • Enclosure URL: You need to tell the script the location (URL) of the podcast itself ( e.g. http://foo.com/episode2.mp3)
  • Enclosure Length: How big is that file? Let me know.

I fully admit that it is a little ugly to have to scrounge for the various IDs, but once you run this script you can visit the feed to see a brand new enclosure link. Throw this into a podcatcher such as iTunes and Bob’s your Uncle.

How the script works

The script itself uses my, alpha quality, GData Ruby library. The library was first factored out of gspreadsheet and consists of:

  • GData::Base: The base library knows how to talk GData, including being able to authenticate to Google and use X-HTTP-Method-Override for HTTP methods such as PUT. It has the low level GET, PUT, POST API that other service specific libraries will build on
  • GData::Blogger: The Blogger code knows how to speak to blogger and get and modify feeds and entries. It includes high level methods such as add_enclosure(..)
  • GData::Spreadsheet: Likewise, the spreadsheet module has high level methods such as add_to_cell and evaluate_cell

Along with the library, scripts are also packaged to show the library usage:

  • addenclosure: what we have been talking about
  • bloggerfeed: view the entire feed
  • gspreadsheet: run formula
  • removeenclosure: nuke an enclosure from an entry

In the future I want to work with more GData folk to have a fully fleshed out API for Ruby-folk to talk to any GData service. A couple of people have already contacted me asking to add features ( e.g. high level support for the new Picassa APIs).

Apr 11

Google Developer Day – Worldwide – May 31, 2007

Tech 2 Comments »

We are hosting a new event, at locations worldwide: Google Developer Day 2007.

Google Developer Day will take place at Google offices and offsite locations in Mountain View, Sao Paulo, Madrid, London, Paris, Hamburg, Moscow, Beijing, Tokyo and Sydney. The proceedings will begin in Sydney on May 31, 9 a.m. AEST and end 27 hours later in Mountain View on May 31, 7 p.m. PDT.

Google engineers and product experts at each location will lead sessions in topic areas such as, “Developing with Geo: Google Maps, Google Earth and SketchUp,” “Tools for Better Web Development: The Google Web Toolkit, Open Source and Other Developer Initiatives” and “Mashups and More: AJAX, Google Gadgets and the Google Data APIs.”

Confirmed presenters include:

  • Guido Van Rossum, Google software engineer and creator of the Python programming language (Beijing)
  • Chris DiBona, Google open source programs manager (London)
  • Mark Stahl, Google data APIs tech lead (Madrid)
  • Bruce Johnson and Joel Webber, co-creators of the Google Web Toolkit (Mountain View)
  • Bret Taylor, group product manager for Google developer products (Mountain View)
  • Lars Rasmussen, Google Maps senior engineer (Sydney)
  • Greg Stein, Google engineering manager and chairman of the Apache Software Foundation (Tokyo).

It is going to be a really fun event, and I am lucky to be involved. Getting the community together like this will be a real learning experience. I look forward to meeting users of the APIs and services, and find out what they like, don’t like, and need.

Signup and join us!

Apr 09

Using your UI to make users do the right thing

Tech No Comments »

I realised that when I use Textmate I tend to fix things like:

shoutingatme.png

That red background calls at me to change it. Otherwise, would I?

The same effect happens in IntelliJ with the yellow lines. Are you the type that has to get your file all green? The tool has to have a subtle balance of using the power of the yellow for important things. If there are a million yellow lines indicating trivial work (in my opinion) then I will ignore all of them, and it is useless.

Anyway, all of this made me think of how to create UI that subtley prods users down the right path, even if it isn’t quite the path of least resistance.

Apr 09

Entertamer? Really?

Tech 1 Comment »

While driving through downtown San Francisco I keep seeing adds for the Logitech Harmony universal remote.

Entertamer? Really? Could it get Lamer? Having an advertisement for a remote control is quite funny in its own right.

And then there are the ads for “The Algorithm killed Jeeves” and “The Algorithm is from Jersey” which are talking about ask.com, but I wonder how many people driving by have a clue… even in the valley.

Apr 07

I need good RSS content

Tech 5 Comments »

Bruce Eckel wants Smart RSS.

I agree that polling isn’t that efficient. I agree that it is hard to find the good stuff.

However, you can implement most of what Bruce wants already.

I have a folder that has the important feeds in it, which acts as my “friends” list. I look there first, and if I have more time to kill I delve into the deeper wells, which a set of levels to go deeper into.

My biggest issues is dupes. I wish my reader was smart enough to nuke dupes for me (I talked about aggregators of aggregators before).

Sometimes the extra levels are too much, but it is nice to search them from time to time, or browse them when I am stuck at an airport and bored.

I do think that there is room for tech to give Bruce more of what he wants. I would pay for a service that feeds me what is important, and what I need.

Apr 04

Hats off to James Anderson, Mac Genius in Palo Alto

Tech 1 Comment »

I have had mixed experience with the Apple Store. Today, James Anderson, who runs a Palo Alto Apple Store gave top notch service.

We were walk ins, right before the store closed, and he stepped up fixed the problem and gave us new parts in seconds.

This was a step up from other apple stores in other parts of the US. They should give this guy a free 8-core Mac Pro. I told him to try out the new Google Desktop for Mac, which may have some issues, but it is great to be able to have one search across everything.

Apr 04

Mute a Gmail thread with ‘m’

Tech 10 Comments »

How had I not noticed this feature until yesterday?

A simple flick of the wrist to the m key will mute a conversation in Gmail:

If you’re subscribed to a mailing list, you’ve no doubt been subjected to the ‘thread that just won’t die!’ If you’re part of a long message conversation that isn’t relevant, you can ‘mute’ the conversation to keep all future additions out of your inbox.

By using the ‘m’ shortcut key, new messages added to the conversation bypass your inbox so that the conversation stays archived. If your address appears in the to or cc field, though, the conversation will pop back into your inbox ready for your attention.

Muted messages are not marked as read, are still searchable, and can specifically be found by searching for:

is:muted

Filters will still be applied to muted messages.

To un-mute a conversation, select the conversation and select Move to inbox from the More actions… menu. Doing so will move the entire conversation to your inbox and will remove the mute action, so that future messages are also delivered to your inbox.

What a difference this makes!