Delicious integrates with many services




IMG_1224

Originally uploaded by joshua.

The bookmarking service Del.icio.us has done quite a few “incremental changes” since I started using it. As has photo service Flickr. Here are two very small, but context-adding betterments that I like a lot.

Flickr’s small context-enhancers: more functional tags. Now Flickr sports a few tags that behave in a special way, apart from being one-word keywords. The tags geo:lat=100.10 and geo:long=123.123 situates a photo in a geographical context (visualized by inserting a GoogleMap on the page). Some cameras and photo-generating devices (urrg, bad word) insert that information right into their EXIF data (which is information embedded in the photo file), so the user doesn’t have to do a thing to get that geo-context.

Also, events published at the Upcoming.org service can be denoted with the Flickr special tag form upcoming:event=123123. 123123 is the ID of this fictional event. A text link with an Upcoming icon pointing to the event is shown with the photo. (The image linked to this article has that property.)

Del.icio.us’ incremental change can be dubbed context-sensitive representations. When you add a bookmark to an URL pointing to a usable media type (say, a photo, or an MP3), Del.icio.us adds either a thumbnail image, or a Flash-based audio player to the bookmarks listing. Makes your listings more immediately useful, without any extra brainpower on your part.

Selenium on Rails: extra-special testing tool

When Obie F. was in town, he ended his talk by showing a final, extra-special productivity-boosting developer tool: Selenium on Rails. As it happens, it is our own Jonas “Danger Bay” Bengtsson who created that Rails plugin, on top of the ingenious Selenium testing software.

Jonas’ own screencast is a little dated, but it shows off perfectly what Selenium on Rails does. Take a look at it. Again, if you already did: now it comes with Obie’s seal of approval, should you need such a thing.

Io on OS X: Get a fixed libsgml

libsgml.zip is the libsgml library with a slightly modified build sequence, to accomodate the Mac OS X need for .dylib instead of .so files.

I learnt a bit on making Makefile.in and configure.in do my bidding, but don’t do this with your spare time. Try and download this file instead.

  • get the fixed libsgml, unpack it
  • make clean && ./configure && make
  • sudo make install
  • recompile your Io!
  • start io, and test:
  SGML; "<foo>bar</foo>" asXML

Update: I just took a look at this again, now on a newer Intel Mac. Here, there was trouble. There is a newer, better source code chunk at: http://www.hick.org/code/skape/libsgml/. Patch that instead. If and when I have something, I’ll post it here. It seems to be the LIBBIN line that irks.

  LIBBIN="\\${CXX} \\${DEBUG} -Wall -dynamiclib -install_name /usr/local/lib/libsgml.dylib -fPIC -o ../libsgml.dylib \\${OBJS}"

That was my blind try. And, it compiles a “dylib” alright. The install step is broken, though. I can not figure out how to get the Makefile.in to recreate the Makefile. That should happen on leaving the .configure.in, I think. Gotta learn more about this.

Update again: GNU Autoconf, Automake and Libtool helps understanding what those files are about. Now I have a little working knowledge, but my head’s spinning with all the things you could do with your Makefiles…

[tags]Io[/tags]

Ruby rockstars in Copenhagen, again

Cph.rb had one more visiting rockstar. Thanks for coming, folks, and thanks for presenting, Obie! Update: Jesper‘s photos.

We did the most of Kassen as an impromptu conference space. There were a large table of guys from Cph.rb, and I got to meet well-known faces, hear some rumours, yammer on about Erlang (my programming language tourist experience of the week), and meet new Ruby folks from Copenhagen.

After some initial hanging out, Obie announced he was going to re-run his JAOO talk. JAOO is that Aarhus conference, “OO stands for object-oriented”. VNC woes made things hard with “sending the presentation across the table”, but we all huddled around Obie, and “shoulder-surfed” as he fired off a version of his Agile talk. It was good, many nice personal pictures. Some were really great explanations of what working in an agile office is like.

Microfacts on Obie:

  • He’s as tall in real life as you’d expect
  • Your beard style my vary (YBSMV)
  • He plays keyboard a little bit, and has made public some of his music

All in all, a great guy. Maybe you had to be there.

Began running

Just found an old unblogged note from August 27:

Today I went for a run in Fælledparken, with my training buddy, PM. This is a completely new experience for me: sports that I have elected to perform myself.

I’m beat! Exhausted. Sweating.

We ran from my house to the park, footfalls synchronized. After a couple of minutes, I felt an onrush of endorphines.

I had to stop for air a few times during the 4 km run, when the pace was too much for me. I just ran out of air. And my legs were killing me.

The body comes into its own again after 48 hours. So, I can run again on Tuesday, at the earliest. But I guess Wednesday is better. When the running season ends, I’ll swim, and there are such facilities nearby.

My training buddy is a kayaker and a programmer (!) and he knows all about how the human body reacts to training. You know, “results”. “Give it 2-3 months of a couple of running sessions a week, and you’ll be at a local max. From there you can get further only by using interval training.” In ordinary words, “interval training” means “running an extra lap at full speed.” PM does that. After running a lap, I’m completely, utterly beat.

Today, some time later, I ran the same course, in the park, on my own. Quantity, and lung capacity, that’s the order of the day here.

Give-away: Tillsammans on VHS

On my bookshelf, I noticed a VHS cassette, the Swedish comedy Tillsammans (2000) by Lukas Moodysson (director of Fucking Åmål). Great movie, but I need the shelf space. I bought it new on VHS for some reason, not owning a VHS player. Nor a TV. So, the cassette is still wrapped in plastic, never used.

If you come and pick it up, you can have it! Free, gratis, at no charge. Just comment here, and we’ll email, and set it up.

I guess I could drop by at the local thrift shop, and have them circulate the media. But you don’t frequent that shop, do you? And I’d like you to have it, should you want it.

(At the previous Ruby programming meetup in Copenhagen, I brought a book for a friend. When I took it from the shelf, I noticed another book I could give away, and brought it to the meetup. I told the congregated hackers about the book, and plopped it on a table. At the end of the meeting, the book had been swooped up by a reader.

I thought that way about some of my programming books, too. Some of them really are “one-use”, even if they try to masquerade as reference materials.)

Io gets Ruby-style string interpolation

Io

This is nice for people who come to Io from Ruby: Io, the language, now has…

a C implementation of interpolate (by trevor with help from jer)

Just to give people a heads-up on this point. There is a slight
change in behaviour. Instead of using #io{...} to interpolate your
code, you now use #{...}. As well, instead of the string being
returned being mutable, it is now immutable.

Which is in the new tarball release.

Update: Whoops! You need to send an interpolate message to get the interpolation. Not like in Ruby, where it’s automatic. Thanks Jeremy Tregunna, for correcting! And for stopping by.

CakePHP: grab only the data you need

When dealing with an abstraction that outputs dynamic SQL “behind your back”, it’s often easy to forget that some of the queries are… too greedy and grab unneeded data. Here is how to ask for less data, using CakePHP.

Today, I listed only name and id fields of a Model, and to restrict the findAll() to those things:

`$data = $this->Thing->findAll( aa("Thing.user_id", $user_id), a("id", "name"), null, null, null, -1 );`

Breaking down the call, we have:

aa() is a CakePHP convenience function to make an associative array. Odd parameters are keys, even params values. The parameters here creates a WHERE clause that matches the current user’s Things.

a() does the same for regular arrays. The params list the two fields we need returned.

A couple of null settings, and then the crucial -1, which turns off the Model associations completely.

Grab less data!

Update: here is how to use unbindModel. First take a look at the Thing model definition, courtesy of Mladen Mihajlovic:


 array(
      ‘className’ => ‘AnotherThing’
    ),
    ‘SomeOtherThing’ => array(
      ‘className’ => ‘SomeOtherThing’
    ),
    ‘YetAnotherThing’ => array(
      ‘className’ => ‘YetAnotherThing’
    )
  );
}
?>

Now, in our controller, before calling findAll, we remove two of the associated Models:


$this->Thing->unbindModel( array( "hasMany" => array( "AnotherThing", "SomeOtherThing" ) ) );

[tags]cakephp[/tags]

Copenhagen.rb meeting notes

Update: photos by Pelle.

Syndication with AtomPub, APP and GData… and Rails

Olle Jonsson “explores” some things you would want to do with Atom… and how Rails enables you to do it.

Update: My somewhat confused slides now available (PDF).

DHH on ActiveResource

…and then I got lucky, and David was able to give us “how to do all this painlessly in Rails.”

David HH presented the new ActiveResource stuff. Edge, plugins. “Undecided”, still, about if it’ll be in the standard distribution.

Suffix the URL with .xml (or any format your app responds_to!)

GET /posts/1.xml
POST /posts/1.xml {POST payload}

Clarifiction: The last line there, the POST payload, is not a Ruby block, it is what you send as the body of the HTTP request.

We saw the MIME-type format list that Rails’ ActiveResource can output. I missed the JSON format, mentioned it, and David showed how it would be simple to add JSON support to ActiveResource.

Let us cook that up! And David showed:

  • Register a new JSON mime-type
  • respond_to {} the :json, and spit that out
  • make .to_json()

There must be a plugin for this. And there is, we were informed.

Don’t Trust Yourself with Your Users’ Data

Pelle B. tells it like it is, and provides a plugin called EzCrypto. Short, simple presentation, very good. And also, notes on a couple of new developments from the productive programmer: secret URLs as a plugin.

JRuby at a glance

Teaser-like presentation (‘Part I’) by Morten Ch. from Aarhus.

[tags]ruby,rubyonrails,copenhagenrb,event[/tags]