November 08, 2009

Andy Wingooptionals, keywords, oh my!

(Andy Wingo)

OK! Where were we?

In my last dispatch, I talked about case-lambda in guile. The gist of it is, let procedures parse their own arguments, and they can do neat stuff like multiple-arity dispatch.

Also, neat stuff like optional and keyword arguments! Consider our my-write example from last time:

(define my-write
  (case-lambda
    ((obj port) (write obj port))
    ((obj)      (my-write obj (current-output-port)))))

It's a little silly, to write it this way. It's not essentially one procedure with two different bodies, it's one procedure with one required argument, and one optional argument. The optional argument defaults to (current-output-port).

So, as you would imagine, there is a better way to express this "design pattern": lambda*, and its sugary friend, define*.

In this case, we would simply define my-write like so:

(define* (my-write obj #:optional (port (current-output-port)))
  (write obj port))

So nice, so clear. Default values are only evaluated if the argument is missing. (It's a rare Python programmer that's not surprised about Python's behavior in this regard; but I digress.)

keyword args too

Optional arguments are good at allowing for concision and extensibility, but code that uses them can be confusing to read. Actually this is a problem with positionally-bound arguments in general.

I like how Carl Worth puts it: that nice prototypes can result in inscrutable code. His solution in C is to have function names encode their arities, but we can do better in Scheme, with keyword arguments.

So let's say we want to add a "detailed" argument to my-write. We can add a keyword argument:

(define* (my-write obj
                   #:optional (port (current-output-port))
                   #:key (detailed? #f))
  (if detailed?
      (format port "Object ~s of type ~s" obj (class-of obj))
      (write obj port)))

Invocations are really nice to read:

(my-write 'foo #:detailed? #t)
=| Object foo of type #<<class> <symbol> 8c4fca8>

(my-write 'foo (open-output-file "foo.log") #:detailed? #t)
; writes the same thing to foo.log

The second example gives an explicit port; and indeed, I am left wondering what it is, when I read it. Keyword arguments make for more readable code.

Keyword arguments also allow for better extensibility. But don't take it from me, take it from P. Griddy:

Most of the operators in Rtml were designed to take keyword parameters, and what a help that turned out to be. If I wanted to add another dimension to the behavior of one of the operators, I could just add a new keyword parameter, and everyone’s existing templates would continue to work. A few of the Rtml operators didn’t take keyword parameters, because I didn’t think I’d ever need to change them, and almost every one I ended up kicking myself about later. If I could go back and start over from scratch, one of the things I’d change would be that I’d make every Rtml operator take keyword parameters.

-- Paul Graham, from a talk he gave back when he didn't talk about startups so durn much

And, there's one more thing, which applies both to optional and keyword arguments: the default values are evaluated in the lexical context of their preceding arguments. So you can have a later argument referring to an earlier one. For example, Guile's compile is defined like this:

(define* (compile x #:key
                  (from (current-language))
                  (to 'value)
                  (env (default-environment from))
                  (opts '()))
  ;; wizardly things here
  ...)

See how env's default value references from? Awesome, yes? I thought so.

newness

So what's new about all this? Not much, semantically. Guile has supported lambda* and define* for more than 10 years. But now they are available in the default environment, and they are fast fast fast -- for the same reasons that case-lambda is faster now. There are special opcodes to process stack arguments into optionals, and to shuffle and bind keyword arguments, all without consing a single cell.

Also, now the toolchain knows about optional and keyword arguments, so that backtraces and printouts show them nicely. For example, my-write prints like this:

#<program my-write (obj #:optional port #:key detailed?)>

Ah, there is case-lambda*; though it is of dubious utility, given that it can only reasonably dispatch on the required and optional arity, and not on keyword args. But there it is.

In any case, I look forward to using lambda* more in the future, without speed trepidations. Just say no to rest arguments masquerading as optionals!

by Andy Wingo at November 08, 2009 12:33 PM

November 07, 2009

Andy Wingocase-lambda in guile

(Andy Wingo)

Oh man, does the hack proceed apace. I really haven't had time to write about it all, but stories don't tell themselves, so it's back behind the megaphone for me.

Guile is doing well, with the monthly release train still on the roll. Check the latest news entries for the particulars of the past; but here I'd like to write about a couple aspects of the present.

First, case-lambda. The dilly here is that sometimes you want a procedure that can take N or M arguments. For example, Scheme's write can be invoked as:

(write "Hi." (current-output-port))
=| "Hi."

(=| means "prints", in the same way that => means "yields".)

But actually you can omit the second argument, because it defaults to the current output port anyway, and just do:

(write "Hi.")
=| "Hi."

Well hello. So the question: how can one procedure take two different numbers of arguments -- how can it have two different arities?

The standard answer in Scheme is the "rest argument", as in "this procedure has two arguments, and put the rest in the third." The syntax for it is not very elegant, because it introduces improper lists into the code:

(define (foo a b . c)
  (format #t "~a ~a ~a\n" a b c))
(foo 1 2 3 4)
=| 1 2 (3 4)

You see that 1 and 2 are apart, but that 3 and 4 have been consed into a list. Rest args are great when your procedure really does take any number of arguments, but if the true situation is that your procedure simply takes 1 or 2 arguments, you end up with code like this:

(define my-write
  (lambda (obj . rest)
    (let ((port (if (pair? rest)
                    (car rest)
                    (current-output-port))))
      (write obj port))))

It's ugly, and it's not expressive. What's more, there's a bug in the code above -- that you can give it 3 arguments and it does not complain. And even more than that, it actually has to allocate memory to store the rest argument, on every function call. (Whole-program analysis can recover this, but that is an entirely different kettle of fish.)

The solution to this is case-lambda, which allows you to have one procedure with many different arities.

(define my-write
  (case-lambda
    ((obj port) (write obj port))
    ((obj)      (my-write obj (current-output-port)))))

implementation

You can implement case-lambda in terms of rest arguments, with macros. Guile did so for many years. But you don't get the efficiency benefits that way, and all of your tools still assume functions only have one arity.

Probably the first time you make a VM, you encode the arity of a procedure into the procedure itself, in some kind of header. Then the opcodes that do calls or tail-calls or what-have-you check the procedure header against the number of arguments, to make sure that everything is right before transferring control to the new procedure.

Well with case-lambda that's not a good idea. Actually if you think a bit, there are all kinds of things that procedures might want to do with their arguments -- optional and keyword arguments, for example. (I'll discuss those shortly.) Or when you are implementing Elisp, and you have a rest argument, you should make a nil-terminated list instead of a null-terminated list. Et cetera. Many variations, and yet the base case should be fast.

The answer is to make calling a procedure very simple -- just a jump to the new location. Then let the procedure that's being called handle its arguments. If it's a simple procedure, then it's a simple check, or if it's a case-lambda, then you have some dispatch. Indeed in Guile's VM now there are opcodes to branch based on the number of arguments.

So much for the VM; what about the compiler and the toolchain? For the compiler it's got its ups and downs. Instead of a <lambda> that just has its arguments and body, it now has no arguments, and a <lambda-case> as its body. Each lambda-case has an "alternate", the next one in the series. More complicated.

Then you have the debugging information about the arities. The deal here is that there are parts of a procedure that have arities, probably contiguous parts, and there are parts that have no arity at all. For example, program counter 0 in most procedures has no arity -- no bindings have been made from the arguments to local variables -- because the number of arguments hasn't been checked yet. And if that check fails, you'll want to show those arguments on your stacktrace. Complication there too.

And the introspection procedures, like procedure-arguments and such, all need to be updated. On the plus side, and this is a big plus, now there is much more debugging information available. Argument names for the different case-lambda clauses, and whether they are required or rest arguments -- and also optional and keyword arguments. This is nice. So for example my-write prints like this:

#<program my-write (obj port) | (obj)>

So yeah, Guile does efficient multiple-arity dispatch now, and has the toolchain to back it up.

Next up, efficient optional and keyword arguments. Tata for now!

by Andy Wingo at November 07, 2009 11:52 AM

Andy Wingodigital interfaces

(Andy Wingo)

I made some tomato and red pepper soup for lunch yesterday. Before I had a chance to eat it, the universe decided it still needed more red, and that I should try something stupid with a pocketknife. I sliced up my left forefinger and thumb pretty good.

This blog seems to be specializing in thoughts just before blood, so here it is: ah fuck, going to have to get stitches. I knew that in the first second.

Thankfully, there's a CAP (Centre d'Atenció Primària) in most neighborhoods, so after laying down on the couch to make sure I wouldn't faint, and grabbing chocolate from the cupboard, considering I hadn't yet eaten the soup, I walked the 10 minutes to the CAP, my hastily bandaged hand held high. People looked at me funny.

An hour and a half later, well, four stitches in the index finger, three on the thumb. But I'm ok.

* * *

I hear that some family of mine is going to these "tea party" protests. If you're not plugged into the States political scene, the deal is this: the Republican brand is broke, and everyone knows it. But there is so much anger at their base. So voila Republican anger without the Republican state trappings, a catchment of the neofascist tendencies in all of us, whipped up around a symbol: the idea that Obama is a foreign element, an outsider, not of us, coming to enslave us all.

One of my family writes, referring to the return of another from these "tea party" protests:

When you are released and your tracking anklet has been removed. . . what do you say we move to Montana and prepare for the movie Red Dawn? We don't have to paint Wolverine on the side of every Afghan or Obamian tank that we destroy, but we can live off the land, sleep under the stars and pee in overheated radiators. The enemy will be obvious out there. I remember Sesame Street. . . . which one does not look like the others. . . . got it. Always look for the red dot and the table cloth on the head.

This makes me so sad. And the thing that's really binding them together, even the less racist, is hatred of "Obamacare" -- the idea that one should be able to walk into a clinic, get treated well and kindly, and walk out, regardless of your employment status, without signing for anything, without paying anything, as I did yesterday, in this foreign land.

by Andy Wingo at November 07, 2009 10:08 AM

November 06, 2009

Thomas Vander SticheleDedicated separate Firefox windows

(Thomas Vander Stichele)

Dear intarweb,

here’s what I’d like to be able to do. I would like to start a completely separate Firefox window, in a separate process, with a given webpage. This process should be completely separate from my regular browsing, not take new links in its window when I click links somewhere else (usually they go to the most recently opened window), not crash when the regular firefox process crashes, and not bog down because my regular firefox goes to 100% CPU and beyond.

It seems to be hard to google for this idea; is it possible ?

by Thomas at November 06, 2009 09:59 AM

Thomas Vander SticheleBest post-sale screen ever

(Thomas Vander Stichele)

Just gave in to the geeky side of the force this morning and bought a DVD documentary about BBS’s. (the version I bought comes with a DVD full with BBS text files, ANSI art, and random crap.)

After buying, this is the screen I got:

I don’t think I ever got a chuckle out of what happened right *after* I forked over cash. Here’s to you, Bob!

by Thomas at November 06, 2009 09:24 AM

November 05, 2009

Bastien NoceraGet Moblin, get GNOME

(Bastien Nocera) If you were to install the new Moblin 2.1 somewhere, you'd be getting a gnome-bluetooth powered Bluetooth panel.

All the code lives upstream in the gnome-bluetooth module on master.

by hadess (noreply@blogger.com) at November 05, 2009 10:10 PM

Mirco MüllerStupidity of the day

(Mirco Müller)

I’m leaving for Texas, USA soon. Me being a German living in - guess - Germany, causes the need to apply for the US “Visa Waiver Program” using https://esta.cbp.dhs.gov (thanks again to Otto for reminding me *g*) these days. While clicking through and filling out the forms of the electronic variant of that “green sheet of paper” (the one you used to have to fill out on the plane prior to landing on US soil) I was greeted by this notice…


small_umlaut-failure-in-form_png.png

It’s almost 2010! Have the people, who implemented that web-interface, ever heard of Unicode or do they expect international travelers to not use anything but ASCII to supply their (usually non-english) names, which carry the high probability with them to not use ASCII characters only? For me it’s just the ü in my surname. I wonder what people with funkier names do, when they have to diverge from the correct name-spelling to something this ESTA-system accepts. Once they succeed there, I bet they have a hard time trying to convince the staff at customs, that they are really themselves, because the spelling of their name on the passport doesn’t even remotely match the spelling in the visa-waiver-form.

I once almost wasn’t let aboard a plane in Germany, because the travel-agency booked my flight on “Mueller”, but my passport says “Müller”. Is all that the legacy-fault of Cobol?

by MacSlow at November 05, 2009 06:28 PM

Mirco MüllerDoh, can’t sleep…

(Mirco Müller)

… so… I wrote my first particle-system ever. It does not look photorealistic - by far not *g* - but implementing something like that is great fun! You see a cluster of 5000 particles in the screencasts below. Right now I’ve two emitters (a “singularity” one and a rectangle one) with a gravity force-field being applied to the particles. WASD/Quake-like camera-navigation I implemented too, so one can “walk around”. From here numerous things could be added: wind, general turbulence, attraction-/repulsion-forces between particles, collision-detection with obstacles… the visualization could be improved with motion-blur, lighting, shadows etc. Rendering- and simulation-loop are coupled and run at 60 Hz. Screencasts were recorded with 30 Hz.


small_gl-particles-1_ogv.png
(click to play back, ogv/theora, ~85 MBytes, right click to save to disk)



small_gl-particles-2_ogv.png
(click to play back, ogv/theora, ~60 MBytes, right click to save to disk)

by MacSlow at November 05, 2009 03:08 AM

November 04, 2009

Bastien NoceraNo more stuttering

(Bastien Nocera) Today, as some of you guessed from my teaser yesterday, I finished implementing on-disk buffering in Totem, using playbin2's new features.

Using Totem in master with this gstreamer patch, Totem will start playing back videos as soon as enough buffering has been done on disk.

Note that this will only work for QuickTime and FLV streams, but that means that the YouTube Totem plugin and streaming trailers from Apple's website just got better, and should allow us to implement stream saving very soon.

by hadess (noreply@blogger.com) at November 04, 2009 08:04 PM

November 03, 2009

Stefan Kost3 Nov 2009

(Stefan Kost) upstream hacking

I started the month with upstream bugs work. First I looked into #581873, made a fix and two days later realized that my git checkout was on a stale branch and its already fixed in gtk+-2.18. Next I looked at the mime matching issue that is already plaguing me for a while (#541236). I also have a patch for that and hope that I get green light for it or a review how it should be fixed instead.

buzztard

In buzztard I implemented copy and paste in sequence. I also found our what I did wrong in my clipboard handling code (see my previous post). Dunno what wrong with the old code, but this change made it work:

GtkClipboard *cb
-cb=gtk_clipboard_get_for_display(gdk_display_get_default(),GDK_SELECTION_CLIPBOARD);
+cb=gtk_widget_get_clipboard(widget,GDK_SELECTION_CLIPBOARD);

Next I finally got rid of the gnomevfs hard dependency. It is only needed if you have a quite old gtk to get help working. While testing I noticed that some translations disappear during run time. I made some i18n handling fixes regarding to initialisation and libraries.

I am probably the last one to figure that one has to draw with the 0.5 px offset in cairo to get non blurry gfx. After Matthias post I looked at my vu-meters and voila, I was doing it wrong. Fixes are in svn together with some small optimizations.

November 03, 2009 09:59 PM

October 30, 2009

Stuart LangridgeUsing XDG folders

(Stuart Langridge)

Lionel’s just written about how applications should use the FreeDesktop (”xdg”) folders. I like this a lot more than most people do, because my XDG folders aren’t the default. The default folders are .local/share, .config, and .cache. Now, to me, having my settings be in an invisible folder defeats the point. So my folders are Applications/Data, Applications/Settings, and Applications/Cache. The beauty of this is that if an app has gone mad, I can just go into Applications/Settings, find the settings file or folder for an app, and delete it. No grovelling around on the command line. It’s lovely.

To do it, put this in .gnomerc*:

#!/bin/bash
export XDG_DATA_HOME=$HOME/Applications/Data
export XDG_CONFIG_HOME=$HOME/Applications/Settings
export XDG_CACHE_HOME=$HOME/Applications/Cache

and then all proper applications just store their data in there.

Couple of other tiny benefits: it’s easy to see what you’ve got installed, and it’s also to see which naughty applications don’t actually check what your XDG folders are and just hardcode the defaults into their program (notify-osd, I’m looking at you here, and whatever stores motd.legal-displayed as well).

by sil at October 30, 2009 11:41 PM

Thomas Vander SticheleDeveloper Productivity Presentation

(Thomas Vander Stichele)

Dear interweb,

recently I’ve been doing a bunch of thinking on how to have productive developers. We’ve been having some discussions on the topic on the business side, and there are things that I take for granted that aren’t always as obvious to the more commercial side. Things like, ‘flow is the most important part’, ‘context switches should be avoided’, or ‘a 3 month deadline for development with 1.5 months of testing/deployment/… can be given double the development work with only 50% more time’.

So I started thinking it would be nice to be able to give a quick presentation to those people, explaining some of the basic concepts they should consider, and references to back it up (studies, papers, …) that give some weight to the argument beyond ‘trust me, I know because I’m a developer’.

I went out googling for something like this but I didn’t find anything, possibly because I don’t know what to look for. It seems like something useful for any kind of technical/dev manager.

If you have an idea, please let me know!

by Thomas at October 30, 2009 02:50 PM

Julien MoutteLook what’s coming…

(Julien Moutte)

Fluendo engineers have been busy preparing that :

Fluendo DVD player on OpenSolaris 

It’s a matter of days now before it appears on our web store :)

by dolphy at October 30, 2009 10:28 AM

October 29, 2009

Bastien NoceraBug fixing galore!

(Bastien Nocera) In the past couple of weeks, we've been hard at work fixing bugs for the next Fedora release, Fedora 12.

We've had new releases for Totem - with loads of warnings, crashers, and behavioural bugs fixed -, for gnome-bluetooth - with upstream fixes for some killswitch handling problems -.

I've also helped out fixing bluriness in gnome-settings-daemon, and made gnome-power-manager use the same OSD code as the volume pop-ups.

As a relief from all the bug fixing, I've started working on a Bluetooth input setup helper, which will help you set up a mouse and keyboard on Bluetooth should you find yourself without any connected to your computer. This should be helpful to users of Logitech, or Dell branded dongles.

by hadess (noreply@blogger.com) at October 29, 2009 05:18 PM

Mirco MüllerThe day of the Koala

(Mirco Müller)

Today is the day, the day of the Karmic Koala aka Ubuntu 9.10. Get it here…





High-5 to everybody in GNOME, KDE, Xorg, Ubuntu and Canonical! Now where is that Lucid Lynx running around?

by MacSlow at October 29, 2009 02:40 PM

Christian SchallerRequest for help with Transmageddon

(Christian Schaller)

One task I been trying quite a few times with Transmageddon is to port it from libglade to gtkbuilder. So far I have always failed for some reason or the other. A big part of it is that I have tons of examples out there for how things are done with libglade, but not so much for gtkbuilder yet.

That said I am also convinced that someone with the right skills could do the port in about 30 minutes or so. Which is the reason for this blog post. Is there anyone out there who would be willing to cook up a patch for me to port Transmageddon to gtkbuilder? (Its written in Python). If so please grab either the latest release or check out git master from GNOME git.

Any help with this would be much appreciated.

Update: Multiple patches received, much appreciated. I will use weekend to try to merge

by uraeus at October 29, 2009 11:25 AM

October 28, 2009

Christian SchallerMobile linux and the desktop

(Christian Schaller)

Edward pointed my to this blog today which brought up a point I myself have been making in regards to Android. I spoke to several people at the CE Linux meeting a couple of weeks ago about this for one. To quote from the blog:

Android is an island of its own, and useful code sharing is largely limited to the kernel.

At Collabora Multimedia we are currently working with both Maemo and Android systems and while I can see the appeal of Android from a phone makers perspective I can’t help but be a little saddened by how worthless it is to the general linux eco-system. One of the things I always loved about Nokia’s Maemo effort is that since its using so many of the standard components that we use on the Linux Desktop, it means that when a feature is added or a bug is fixed in Maemo, it directly helps also the linux desktop. Nokia and Maemo has had a strong and direct impact on a lot of open source projects, ranging from GStreamer, D-bus, GTK+, Telepathy, Matchbox, X Window System and more. And Nokia’s work on Qt going forward will of course have a direct impact on the quality of KDE.

Android on the other side has a much more marginal impact. I know they have contributed some patches to Webkit, but apart from that they offer little value to the rest of the linux eco-system. Been even told by some kernel developers that an Android kernel driver is about as immediately useful for the mainstream kernel as a FreeBSD or OpenSolaris driver. Meaning that porting is needed.

So for me personally I can’t help but feel a lot more positive about Maemo (or Moblin for that matter as they too share the same kind of philosophy as Maemo) and getting a N900 is definitely on my TODO list. That said Android is a work in progress and hopefully we can get them to abandon their essentially proprietary stack going forward and instead incorporate more and more shared libraries with the server and desktop. Maemo has proved that for a smartphone these libraries works just as well as Googles homebrew. Some of the efforts we are involved with are pushing in that direction and hopefully Google will realize that the secret to the success of open source is synergy.

by uraeus at October 28, 2009 10:55 AM

October 27, 2009

Stuart LangridgeThat was LugRadio Live 2009

(Stuart Langridge)

A review of LugRadio Live 2009

So, that was LugRadio Live 2009. The last LugRadio Live conference ever. We really mean it, this time.*

Be warned: this could get long.

In short, it was a blast. There are photos.* We had a great set of speakers, and they did us proud. All the talks were videoed, by LugRadio hero Tony Whitmore and his AV crew, and they’ll be linked from the LugRadio Live site when they become available. Particular highlights for me were Gerv Markham, who was not only his usual sterling self but also loaned me a clicker for the live show, and watching Matthew Somerville valiantly overcome Windows pain to put together a presentation anyway.

People fussing around a projector

Actually, that bit of comedy probably needs a bit more explanation. Matthew showed up with a presentation that requires Windows — and already you can see the comedy begin to start — and then his laptop wouldn’t work with the projector. So, the call went out from the main stage: “Does anyone have a Windows laptop?”

At an open-source conference.

Not one person said yes.

Anyway, poor Matthew eventually got his presentation up and running, in 8 glorious colours (not 8-bit, you note: 8. It looked like a photo negative) and did a very good job of introducing Theatricalia and various other things.

Scattered marginalia

We had the usual LugRadio Live array of random things scattered around the venue; one I rather liked was Low-Tech Twitter, a paper version of Twitter constructed with loving care by Peters Cannon and Oliver. You cranked the handle round and then wrote your “tweet” in the next box to come into view. It even had the fail whale for all the times it fell apart while they were setting it up. Good work, lads. We also had a LugRadio condolence book in which people could leave their messages for the departing show (rather more than a few were cries for it to come back next year, of which more shortly), a Technic Lego build-cool-things competition, the return of the world-famous LugRadio Live potato stamps as proof of entry* and some really big A0 posters of the schedule provided by head of crew Ron. I didn’t realise just how big A0 was when I asked for them…

It’s the little things that people remember about your event, when it’s gone. That doesn’t mean that you shouldn’t concentrate on the big stuff — speakers, seating, refreshments — but throw in some cool bits as well. They’re what put your personality on your event.

The live on-screen twitter feed

We did something a bit new this year. The main stage had three display screens. One, a free-standing screen off to the left, was used by our resident artistic genius Chris Hayes. Throughout the day, he drew caricatures of each main stage speaker. These were fantastic, and they’ll be published on the LugRadio Live 2009 website for everyone to marvel at in due course. Marvellous job, Chris; lots of people commented on how cool it was to see the cartoons drawn in real time, and I was really pleased with it.

The second screen, one of the two big ones, was for the speaker themselves to show their slides on. No problem there.

The third screen, taking up half of the back wall…was a live Twitter feed for the hashtag #lrl2009. One tweet at a time on screen. Anonymously.

This excited some comment.

Now, making the tweets anonymous was a deliberate decision of mine. In retrospect, I’m not sure it was the right one, but I’m not as unconvinced as others. My idea was that it would work sort of like a back-channel — people watching the talks could comment on the talks as they were going on, and, importantly, everyone else in the audience could see those comments live as they were happening. Now, this anonymity means that people can make what might be a negative comment about the speaker and feel OK about doing it. And, to be honest, I expected a goodly amount of humour to come out of this, and I was right. But…it made for a pretty harsh environment for some of the speakers, particularly the first couple who were on before the novelty of this new thing had worn off for the audience. I think, with the laser-like vision granted by hindsight, I’d have not made it anonymous, except for the live LugRadio recording — the LugRadio team expect that sort of interaction with the audience, and we’re at least partially about the comedy of the situation. Other speakers aren’t. So, if you hated the live Twitter thing, blame me. If you think it’s a great idea, on the other hand, you can do it at your conference: fstwittertag.html?q=lrl2009&style=custom.css is the URL we used, and you can replace the hashtag with whatever you want to track, and pass a full URL to your custom CSS file for it.

The live show

There was, of course, a live LugRadio recording.

Jono in a raccoon suit

I was really pleased with the live show; one of the best we’ve done, I think. We talked about what’s changed in the tech world since February 2004 when we started recording LugRadio (conclusion: not much), and whether Oracle buying MySQL is a big problem (conclusion: possibly, although people like me who don’t care about 20th century technology like relational databases aren’t that worried), and the audience really got involved in both things. We’d been sent a number of copies of Jono’s book, The Art of Community, and gave them out to people for making insightful or amusing comments. For reasons passing understanding, Alan Pope got three copies, and apparently had them on eBay before we’d even finished. We’d asked everyone at the event to sign one of the LugRadio Live vinyl banners, and the seven* presenters all signed another, and we gave one to MrBen for being the community hero in perpituity, and auctioned the other banner, with proceeds going to the Open Rights Group. And then, for the finale, we had all seven presenters up on stage. Chris, Adam, Ade*, Matt*, Sparkes*, Jono, and me. It was great that all of us made it for the final LugRadio Live. We got a standing ovation, which was rather nice.

Yep, you read that right. Final LugRadio Live. Now, I know we have known form with saying it’s the last one ever and then it’s not, since we did the same last year, but this time we mean it.

However.

We did a segment in the live show about open source conferences in the UK. Our intention was to say: what should replace LugRadio Live? Numerous people have said that there’s nothing quite like LRL in the UK, and although we don’t want to run LRL any more, we’d like there to be something a bit like it — a conference that caters to people who want to have fun, not to people who want to buy products or make partnerships or network. So, our intention with that discussion was to say: what do you like about LugRadio Live? What don’t you like about it? Which parts of LRL would you like to take forward into a new conference? And then once people had come up with lots of ideas, we were going to say, well, that sounds great: so who wants to organise it, then? It won’t be LugRadio Live — that was our thing — but we’d love to see someone else give us their view on what a fun UK open source conference could be.*

And then we got a question from the floor. “If someone organised a conference next year, would you do a LugRadio live show at it?”

That had, honestly, never occurred to us. Not one of the presenters had even considered this idea. So, after a few exchanged glances, we said: yes.

So it’s quite possible that there’ll be another conference next year, crowd-sourced, or organised by a new group of people, or OggCamp II, or something, and there’ll be a live LugRadio recording at it.

You just can’t keep a good thing down, it seems.

There was the traditional Saturday night party afterwards, too. This included karaoke, about which the least said the better, I feel. Many thanks to Microsoft for paying for it, though :-)

The Story Of LugRadio

The above-mentioned Tony Whitmore has, when not organising OggCamp or helping plan LugRadio Live or, y’know, doing his job or sleeping, spent the last eighteen months of his life creating a documentary called “The Story Of LugRadio”. It’s brilliant. We showed it at lunchtime on the main stage. It’ll be available soon, free to download. Everyone give Tony a big pat on the back (and then ask when it’ll be uploaded).

OggCamp

The day after LugRadio Live was OggCamp, a joint event organised by the Ubuntu UK Podcast and the Linux Outlaws. It was a really good laugh. Barcamp-style events stand or fall on how much fun you have there, and they managed it rather neatly; they recorded a live show (all of them together!), had some cool speakers, and did a raffle during which we elegantly rigged it so Jono won a copy of his own book. Heh, heh, heh. Good work, OggCamp people. I really hope it happens again next year.

The final curtain

So, that’s that. Thank you very much to all our crew, especially Ron and Dave M and Tony, all our sponsors, especially Matt Bloch at Bytemark, all our audience, and everyone who cried out for more LugRadio next year. It’s been a wild ride. Maybe we’ll be back.

Oh, and if you’re still feeling the need for podcasts with Jono and I in, keep your eyes peeled for Shot of Jaq

by sil at October 27, 2009 07:25 PM

Zeeshan AliRygel 0.4.4 (Green

(Zeeshan Ali) Here goes the release log:

Brief summary of changes since 0.4.2:

- Provide a gstreamer-based MediaRenderer plugin. This is mostly code stolen (
and heavily adapted) from gupnp-media-renderer except that it doesn't depend
on libowl-av and/or gtk+.
- More ease for MediaServer implementors.
- Better error handling.
- Make sure no message is suppressed until we know what level of console output
user wants.
- Make use of vala's async support to simplify code quite a bit.
- Plugins should load xml files from source tree when built with
'--enable-uninstalled' configure flag.
- Build with no optimizations in debug mode.
- Use closure table to speed up object lookup and deletion.
- Add build option for SQL debugging.
- Workaround a crasher bug (#3774) in sqlite 3.6.12.
- Use vala's static client D-Bus syntax.
- Early ignorance of disabled plugins. This not only speeds-up startup a bit but
also rids us of redundant debug messages.
- MediaExport:
- Nicely handle unavailability of gstreamer's playbin(2) element.
- Fix a potential crasher.
- Tracker:
- Use multidimensional arrays to deal with search results. This combined with
static client D-Bus syntax gives us quite a speed boost.
- Handle item creation error.
- External:
- Allow applications to provide custom thumbnails for items.
- Support pixel-aspect-ratio properties.
- All D-Bus operations are now done asynchronously.
- Make use of plugin icon if provided.
- Move magic string substitution to core so other plugins can benefit from it.
- Lots of other improvements and bug fixes.

Dependency-related changes:

- Require and adapt to libgee >= 0.5.
- Require and adapt to valac >= 0.7.8.

Bugs fixed in this release:

597276 - Rygel crash on startup
587649 - thumbnails not published for external media servers
589959 - External plugin should query media servers on demand
598005 - unable to load media-tracker plugin

All contributors to this release:

Zeeshan Ali (Khattak)
Jens Georg
Thijs Vermeir

Download source tarball from here.

October 27, 2009 04:13 PM

October 26, 2009

Stuart LangridgeI, Troublemaker

(Stuart Langridge)

When the police admit that someone could end up on a secret police database merely for attending a demonstration, it is exactly the time to worry. — Mark Thomas, The Guardian, “Doth I protest too much?”

Disappointed that you’ve, at some point, exercised your democratic right to protest and free assembly and have nonetheless not managed to get on the Metropolitan Police’s spotter card list of mugshots of people who show up at protests a lot? Do you want to be one of the new menaces to 21st century society that are “domestic extremists”? Or perhaps we should call them “reds under the bed”?

Well, help is at hand in the form of I, Troublemaker. See yourself alongside people who don’t like the arms trade, comedians, and other threats to our cosy way of life. I’m particularly pleased with outing that notorious extremist Gandhi, but choose your own satire (some of them are even government employees, for example).

England prevails, etc, etc.

by sil at October 26, 2009 11:57 PM

Benjamin OtteI do it my way

(Benjamin Otte)

While preparing the video hackfest I realized Google maps is still not the best guide for walking: “Please stay clear of pedestrian precincts“.
 
Google’s suggested way from the accomodation to the venue on the left, my suggestion on the right. I guess I’ll do it my way.

Also, for everyone living behind a rock: The video hackfest is officially announced, lots of video goodness for everyone ahead.

October 26, 2009 10:12 PM

October 25, 2009

Felipe Contrerasgit send-email tricks


I recently found out a few awesome tricks for git send-email that have made my life much easier, so I decided to share them here ;)

First, git send-email is an essential tool in every git guru’s arsenal, as it’s the preferred way of submitting patches. All you need to do is generate your patches with git format-patch (preferably with a cover letter), and then use git send-email to send those patches inlined in a nicely formatted email thread with your MTA.

But do you know about the different threading formats, address-book queries, or the cc-cmd option? No? Well, let’s get started.

Threading formats

By default git uses the deep threading format, which looks somewhat like this:

foobar patch 0
+-foobar patch 1
  +-foobar patch 2
  | +-foobar patch 3
  |   +-foobar patch 4
  |   | +-foobar patch 5
  |   +-comment on patch 3
  +-comment on patch 1

This looks really nasty, specially for very big patch series. That’s why for v1.7.0 the default format would be the shallow one:

foobar patch 0 (usually a summary/overview)
+-foobar patch 1
| +-comment on patch 1
+-foobar patch 2
+-foobar patch 3
| +-comment on patch 3
+-foobar patch 4
+-foobar patch 5

So, if you want to be nice with your patch reviewers, all you have to do is:
git config --global sendemail.chainreplyto false

Read Junio’s email for more details.

Address-book

Sometimes it becomes tedious to manually specify each person’s name and email address in the command line, such as:
git send-email --to "John Doe <john.doe@gmail.com>" *.patch

That’s why git send-email has a nice feature called ‘aliases’. With this, you can use your address-book from MUA’s such as mutt, mailrc, pine, elm, and gnus. Once you configure ’sendemail.aliasesfile’ and ’sendemail.aliasfiletype’ properly you don’t have to type emails again:
git send-email --to juha --cc mark --cc rene --cc marco *.patch

cc-cmd

Now, sending an email to a mailing list might not be enough to get your patch accepted, so you probably want to CC the right people, but finding them usually takes some effort. That’s when ‘cc-cmd’ comes to the rescue. With the ‘cc-cmd’ option you can specify a command to run for each patch being sent; each line generated by this tool will be a person to be CC’ed.

For example, suppose I have a script that magically finds the people to CC:
magic-script 0001-simplify-the-user-configuration.patch
"Dan McGee" <foo@bar.com>
"J. Bruce Fields" <foo@bar.edu>

When I run:
git semd-email --cc-cmd magic-script 0001-simplify-the-user-configuration.patch

Dan and Bruce will be automatically CC’ed.

Pretty neat, huh? Now the only missing piece is the actual magic script. The Linux kernel has one called ‘get_maintainer.pl’, which is awesome, but it only works on their code-base, and unfortunately there doesn’t seem to be a generic one… until now.

The magic cc-cmd script

Suppose we have the following patch:

--- a/Documentation/user-manual.txt
+++ b/Documentation/user-manual.txt
@@ -985,9 +985,8 @@ easiest way to do so is to make sure the following lines appear in a
 file named .gitconfig in your home directory:

 ------------------------------------------------
-[user]
-	name = Your Name Comes Here
-	email = you@yourdomain.example.com
+$ git config --global user.name "Your Name Comes Here"
+$ git config --global user.email you@yourdomain.example.com
 ------------------------------------------------

 (See the "CONFIGURATION FILE" section of linkgit:git-config[1] for

Who should we CC in order to get this patch accepted? Well, probably the people that have touched those lines before. Fortunately git blame makes it easy:

git blame -L985,+9 -- Documentation/user-manual.txt
58c19d1f J. Bruce Fields file named .gitconfig in your home directory:
d19fbc3c J. Bruce Fields
d19fbc3c J. Bruce Fields ------------------------------------------------
d19fbc3c J. Bruce Fields [user]
d19fbc3c J. Bruce Fields name = Your Name Comes Here
d19fbc3c J. Bruce Fields email = you@yourdomain.example.com
d19fbc3c J. Bruce Fields ------------------------------------------------
d19fbc3c J. Bruce Fields
5162e697 Dan McGee (See the "CONFIGURATION FILE" section of linkgit:git-config[1] for

Bang! That’s exactly what we need. For each chunk the patch is touching, we get the authors, and put them in the CC list. That way not only we make sure that the patch gets accepted, but also that the changes are properly reviewed.

I wrote a script that does exactly that, you can find it on gist.github.com.

Final notes

Here’s my example configuration for the git project:

sendemail.aliasesfile=/home/felipec/.mutt/aliases
sendemail.aliasfiletype=mutt
sendemail.chainreplyto=false
sendemail.to=git@vger.kernel.org
sendemail.cccmd=git-cc

Usually my patches are on top of the ‘master’ branch, I always add a cover-letter, and review them before sending, so:
git format-patch --cover-letter master
git send-email --annotate *.patch

If you don’t have a decent MTA, you can use msmtp to send your patches through Gmail, so really there’s no excuse not to send your patches properly :)

So let’s march and send patches all over the Interwebs™ powered by git ;)

by FelipeC at October 25, 2009 04:46 PM

October 23, 2009

GStreamerGStreamer Bad 0.10.16 stable release

(GStreamer)

Hot on the heels of Wednesday's release of the Bad Plugins module 0.10.15 is an update that fixes several problems - including possible deadlocks when starting DVDs.

Check out release notes for gst-plugins-bad or download the tarball gst-plugins-bad

October 23, 2009 11:00 PM

Thomas Vander SticheleFriday night couch surf

(Thomas Vander Stichele)

It’s Friday night, the missus is away from home, and I have the place to myself after work. Most people would spend it either out or on the couch. I went for option two, with a twist – dust off that CouchDB book again and see if we can get it to work this time.

I last tried this a bunch of weeks ago, and couldn’t really get a magic mix working of that day’s version of the book (it’s a work in progress), CouchDB’s trunk (it didn’t yet have user authentication I think), and Sofa’s git master (there’s only one branch, master, and it already implemented user authentication from the 0.11 branch). It was a frustrating experience for a newcomer, since when things go wrong because of a version mismatch you end up with obtuse or confusing error messages. The #couchdb IRC channel on freenode was helpful but couldn’t offer much more than an apology that the book was in a state of flux.

Today I definitely had more luck. I was able to clone the sofa app, which is a blog example, make a post, and see some JSON action.

Now I understand most of the concepts, but I don’t know how to get started. The book explains how to get the sample sofa application and run it, and even customise it, but I don’t know how you’re supposed to start from scratch.

Again, IRC helped out: there is a ‘couchapp generate’ command that sets you off with a default structure. After that, I copied the shows/edit.js and templates/edit.html from the sofa example because I thought I’d start out by providing an edit page for my test application.

I was then greeted with an obtuse error message, that included something like this:

[error] [<0.6600.0>] OS Process Error :: {compilation_error,
"expression does not eval to a function.

and then a bunch of javascript code expanded from edit.js

I was guessing this was a syntax error somewhere, so I started removing code until I figured out path.js was the culprit. I haven’t actually written javascript before outside of a web app, so I wanted to verify by syntax checking the javascript files. Apparently these days you can just install a javascript binary on your system, and sure enough, running that on path.js gave me:

(sandbox)[thomas@ana gtd]$ js vendor/couchapp/path.js
vendor/couchapp/path.js:8: SyntaxError: syntax error:
vendor/couchapp/path.js:8: if (!noJson) && (name == “key” || name == “startkey” || name == “endkey”) {
vendor/couchapp/path.js:8: ……………….^

While I am no javascript expert, I just randomly guessed I needed additional parenthesises around the if argument, and lo and behold, that fixed my problem.

I went around browsing through couchapp’s github pages to see if the code still has that issue, and found this fix (interspersed with unrelated fixes, boo).

A quick check later on IRC told me that there is in fact a newer release than the couchapp I was using (0.3.31 vs. 0.3.32) that somehow easy_install did not pick up on – with a little luck you won’t run into the same problem as me.

Anyway, why go through all this detail ? Because it reminds me of an opinion of mine about the five minute run experience of a project. I truly believe that most people evaluate a project within the first five minutes of trying it. People will invest a little bit of their time in your project, increasing the time they spend at each step if the previous step gave them a good feeling and/or a rewarding experience. It usually starts by reading the elevator pitch of your project somewhere. That’s a five second read. If that piques their interest, they might follow through on a blog post or go to your website. Another quick step.

If that looks promising, they may read your about page, your FAQ, skim through your introductory chapter if it’s short enough, or go look at your screenshots. Maybe a minute ? And if they’re still with you, they may try to download and install the software so they can actually run it.

If that is easy (and that means, it’s just one click or command – the .exe or an installation instruction for a distro package) you’ve gotten them to the point where they can actually run the software. If it’s harder (a bunch of commands, building from source, dependency hunting, …) you’re likely to loose them. Imagine it’s easy and takes a few minutes waiting to download.

Now the clock really starts. Your app has five minutes to convince the user that it actually seems like it’s working, has some level of quality, and might do something interesting the user cares about. If the user can do something useful within those five minutes, you’ve won him over. But if within those five minutes he manages to make the program throw up errors, do something wrong, or just plain crash, or if he can’t do anything useful in it, he’s likely to discard it completely and go on to the next app he wants to try.

This counts doubly when someone actually needs to do something specific and is just looking for different applications to do the task. If you find ten twitter clients on Freshmeat, how do you decide which one you’ll want to use ?

Of course, there are exceptions. So far CouchDB’s five minute run experience hasn’t been so good compared to everything before it. The elevator pitch is right up my alley, this thing does something I’m interested in exploring. The website ticks all the right boxes, the description is excellent, and that couchdb book looks good.

But then actually trying it quickly became a swamp. Fedora only had 0.9.1 – not CouchDB’s fault of course, but the book is written for 0.10 which wasn’t released yet. Worse, the book was out of sync with the versions it recommended I use to try it. I didn’t make time to look at CouchDB for a few weeks. That was a lucky shot – this time around that part was much better, and I invested an hour in playing with Sofa.

The second roadblock was this couchapp problem. A really minor code bug, but again took me a while to figure out what was going on, not helped by the confusing error message.

Why am I breaking my own five minute run rule here ? Because I want to see if CouchDB lives up to the promise – if it really can do all this replication stuff, it seems like a perfect match for a few of my projects. I’m believing the opinion of a few people I trust. But normally, I would have moved on to playing with one of the other key-value stores instead and give them an equal chance for my developer dollar.

In any case, I’m going to push ahead some more now that I found the bug. Hopefully I have a simple edit and view working sometime this weekend if I find some more time.

Sleepy time!

by Thomas at October 23, 2009 10:15 PM

Thomas Vander SticheleWhere’s my $100K?

(Thomas Vander Stichele)

Linked from the blog of the always excellent Harald Welte is this LIMO paper on the economic value of merging back changes to an open source project.

Quoting from there:

Currently, GStreamer comprises some 911,000 SLOC. Using our $50/SLOC factor, this equates
to an equivalent engineering cost of $45.5 million to develop this technology from scratch.

HFSNW! Surely at least $100K of that is my work. Where is my money?

by Thomas at October 23, 2009 08:03 PM

Christian SchallerWelcoming new team members to Collabora Multimedia

(Christian Schaller)

We have recently added 3 new members to our growing Multimedia team and GStreamer consulting business. The first one onboard was Thiago Sousa Santos who I think many of you probably already know as he has been a regular GStreamer contributor for the last few years. He also wrote some important plugins for GStreamer as part of the last two Google Summer of Code projects, namely the Quicktime/MP4/3GPP muxer for GStreamer and this year the ASF muxer and ASF RTP payloader. Having been so impressed with his work as part of the community over the last few years we made sure to snatch him up as soon as he graduated from University :)

The second person we added to our team was Robert Swain. He might not be familiar to people following GStreamer or GNOME, but he has been an active contributor to the ffmpeg project, working for instance on improving the AAC support in ffmpeg. A lot of the work we do at Collabora Multimedia is of course low level multimedia handling and optimisations and Robert will strengthen our capabilities in that field. Also with his experience with ffmpeg we can hopefully use his knowledge to improve the GStreamer ffmpeg plugin where possible.

And finally we have Arun Raghavan, who will be joining us next Month. Arun comes to us recommended by Pulse Audio maintainer Lennart Poettering and will be part of our effort to officially support the Pulse Audio sound server as part of our portfolio of open source projects we offer expertise and consulting services around. Wim Taymans have been moonlighting a bit as a pulse audio developer over the last year, but with Arun on the team we now have a person dedicated to Pulse Audio development, making sure Pulse Audio works great for our customers on their embedded systems. We also hope his efforts will pay dividends for Pulse Audio users on the desktop too in terms of more features and better stability. The synergy we are able to create between the embedded world and the desktop is part of our core mission here at Collabora and with Arun on the team we hope to continue and deepen the great working relationship we have established with Lennart. As a sidenote Arun comes to us from NVidia so maybe we can even have him help improve the GStreamer vdpau plugins :)

Speaking of synergies between embedded and desktop work, I hope everyone read Guillaume Desmottes blog post about Collabora’s increased effort behind the Empathy chat,VoIP and video conferencing client

by uraeus at October 23, 2009 01:56 PM

Thomas Vander SticheleStreaming Media Europe award and panel

(Thomas Vander Stichele)

So, it’s now official: Flumotion has won the ‘Best Streaming Innovation’ award at last week’s Streaming Media Europe conference in London. Thank you for all who voted! I’m surprised to see so many people in total vote, that means that there are quite a few real users out there.

I wasn’t there myself to accept the award (our commercial team accepted what basically is a technology award, but we get along well enough :)), but I did go on Friday to replace Julien on a panel about the promise and disruoption about Open Source Video (scroll to the bottom).

This was actually my first panel, but I think we did well, especially considering it was the last panel of the day. There certainly were many more questions from the audience then in the transcoding panel I attended earlier that day. The panel was led by Dr. Tsur from Kaltura, an open source video platform.

After the conference I took the underground with Damien from New Bamboo who was also on the panel. They developed Panda, a cloud transcoding solution with the very catchy tagline of ‘video solved’. It uses ffmpeg at its core, which might get them in trouble now that they want people to run it as a cloud service, so I suggested he take a look at GStreamer instead. My first suggestion was that it should be doable to provide a drop-in binary replacement with the same interface, but having looked at the output of ffmpeg -h this weekend, I’m not sure anymore – that binary was already complicated to use way back when and it has only exploded further.

In any case, since it’s an open tool, maybe someone at work should take a look and see how easy it would be to teach it GStreamer. Or, maybe instead, we should open our own transcoder solution.

Anyway, back to London and the conference. Since the conference was over after the panel and people didn’t hing around, I called Lotte, a friend living there, to go have a drink before taking the Eurostar back. And thus it happened. I felt like a real global cosmopolite, having a drink in London after a conference for my Spanish job coming in from Belgium wearing a Spanish jacket, American shoes bought in London, a Florentine shirt, and New York pants.

by Thomas at October 23, 2009 09:50 AM

Stuart LangridgeRunning Raindrop on Ubuntu 9.10 using Desktop Couch

(Stuart Langridge)

One cool chap has posted a guide for Ubuntu Jaunty users for setting up Mozilla’s new mail/social-media/collaborative messaging thing, Raindrop.

Now, users of Ubuntu 9.10 (release candidate out today! final release out next week!) have it a lot easier; 9.10 comes with Desktop Couch, your own private CouchDB that you can play with. So it’d be great if Raindrop used that.

Instructions

  1. sudo apt-get install python-twisted python-twitter python-feedparser
    (you may need packages other than this; I have so much Python dev stuff installed that I may have already had half the requirements)
  2. wget http://launchpad.net/paisley/0.1/0.1/+download/paisley-0.1.tar.gz
  3. tar -zxvf paisley-0.1.tar.gz
  4. Follow https://wiki.mozilla.org/Raindrop/Install to get the Raindrop source
  5. Apply the pretty small raindrop-desktopcouch.diff to patch Raindrop to use desktopcouch if you have it available
  6. Edit your ~/.raindrop file and then PYTHONPATH=paisley-0.1 ./run-raindrop.py sync-messages --max-age=5days exactly as per https://wiki.mozilla.org/Raindrop/Install
  7. To open your Desktop Couch for browsing, do xdg-open $HOME/.local/share/desktop-couch/couchdb.html (instead of the localhost:5984 link that the Raindrop install instructions recommend)
  8. So now we can all have a play with Raindrop. It looks really cool. Nice one, Mozilla Messaging team.

by sil at October 23, 2009 02:29 AM