Posts categorized “LazyWeb”.

Music and movies on the TV

I have a reasonably large collection of music and movies. In my lounge, there’s a big computer with a 1TB drive in it, which is where all the movies and music live. It’s running MythTV, and plugged into the television. Upstairs, there’s a second MythTV box, a front-end only, which I use for watching TV in bed. My laptop runs Banshee, and can see the music and films through gvfs and SSH to the main MythTV box.

This all works fine. But it’s annoying. I don’t really like MythTV’s interface much. Creating playlists in Banshee is great and easy, but those playlists don’t appear in MythTV. I have to import new music twice, once into Banshee and once into Myth. I want to be able to do it all from one place, and have it all work.

So: what should I do? I’m happy to change almost everything about the setup, with the one hard-and-fast requirement that every component needs to run on Ubuntu, and I’d much rather run stuff that’s packaged for Ubuntu. I’d prefer to use Gnome apps and GStreamer apps where possible, but if I have to step away from that I’ll think about it.

I’ve had various thoughts about this; I don’t know whether any of these are realistic, and I’d happily hear your thoughts on any of these or on anything else that I haven’t mentioned:

  1. Make MythTV a UPnP server, keep Myth on the main machine and the upstairs frontend, and use a UPnP client on my laptop. Flaws with this: I don’t know whether UPnP does playlists, I don’t know whether you can edit a playlist over UPnP, Banshee doesn’t have UPnP support afaik, Rhythmbox does but doesn’t play videos.
  2. Investigate the mythtv:// source in GStreamer and build a Banshee plugin for it. Downside: I’m not very good with Mono stuff, so writing a Banshee plugin is hard. Rhythmbox would be easier (I’m fine with Python), but again, Rhythmbox doesn’t do videos
  3. Use Elisa on the server instead of MythTV. Flaws: not sure how this helps the edit-playlists-on-my-laptop problem; see above issues about UPnP; Elisa doesn’t actually work very well, or it didn’t last time I tried it (it was very slow, and the UI is slickish but doesn’t actually seem much easier than Myth); Elisa doesn’t record stuff off DVB (although I could keep mythbackend running, but how would I configure it?)
  4. something else I haven’t thought of

Lazyweb, tell me what to do…

Drunk in charge of lyrics

Hrm. Just back from the pub, where they played a song which I thought was called “Fool Out Of Me”. The video had a band all of whom wore suits, and a succession of female singers who, in the video, were reading the lyrics from a piece of paper, one at a time. Anybody got any idea what it is?

Free SMSes through Google Calendar

Right, first of all: don’t do this.

Drew commented on Twitter that it ought to be possible to mash up Twitter with Google Calendar to get SMS alerts for Twitter direct messages, because Google will send you SMS reminders for an event in your calendar. (Twitter stopped doing this a while ago, because sending SMSes costs money in the UK and they couldn’t afford it. Google, being a bit better capitalised, can afford it, thus far at least.) So, the idea is that you watch for a direct message in Twitter, then you create a Google calendar event for six minutes from now with the text of the message, and set an SMS reminder on that calendar event for five minutes from now. Then wait one minute, and you get an SMS with the text of the Twitter message, and you didn’t have to pay for it.

So, send_sms_via_gcal does the latter end of that. Python, requires the Python GData API.

It’s not very useful, though. You get an SMS message which has lots of Google calendar stuff in it and so on, and it truncates the actual message you wanted to the first 57 characters. So not all that helpful. It litters your calendar with reminder messages that you have to go and clean up manually (which could be cleaned up automatically without too much difficulty, but you’d have to write a separate thing which fired once an hour or so and cleaned up old messages.)

I suspect the Google calendar people will also take a shockingly dim view of their SMS reminder stuff being so flagrantly misused, too, which is why I said to not do it. SMS reminders are pretty nice; don’t make Google turn them off.

Readable non-harvestable email addresses with CSS

Stupid hack I’ve just thought of. My email address is:

@silogenixkry.org

Spam harvesters looking at that will see the following code:

<p style="padding-left: 5em"><span>@</span><span
 style="margin-left: -2.5em">sil</span><span
 style="margin-left: 3.5em">ogenix</span><span
 style="margin-left: -5.3em">kry</span><span
 style="margin-left: 4.1em">.org</span></p>

Or, with HTML stripped, @silogenixkry.org, which ain’t an email address. It does it by breaking up the address into bits, putting the bits into HTML in the wrong order, and reassembling the bits into a readable order with judicious use of CSS.* It requires a certain amount of fiddling to get the margins right such that (a) the address shows up in the right order and (b) changes in font-size don’t screw it up. I’d write a tiny web-service to do it to a supplied address if I could be bothered; lazyweb, go for it. Of course, if everyone uses this, harvesters will learn how to interpret CSS (and this is relatively trivial to do in this case). Might keep your name off the lists for a little while longer, though.

Setting an environment variable for all your apps

In the New World Order, Linux apps should all store their user-specific data according to the FreeDesktop Base Directory specification, which in practice means that config details for myapp end up in $HOME/.config/myapp. All well and good. However, I don’t like having configuration stored in dotfiles; I like to be able to get at it more easily, so I want it in $HOME/Settings. The XDG spec provides for this: you set an environment variable XDG_CONFIG_HOME (which defaults to $HOME/.config) and then everything uses it. Great! But…where do I set this variable so that all the apps get it?

Some suggestions:

  • $HOME/.bashrc, $HOME/.bash_profile, $HOME/.profile — as far as I can tell, these aren’t run as part of the login process, so they’re no good. They get run when you start bash, which means when you first fire up a terminal.
  • $HOME/.gnomerc — gets run by gdm. Might be a Debianism, and doesn’t work if I change away from gdm a few months from now
  • $HOME/.xinitrc, $HOME/.xsession — get run if you’re in X but not if you’re running over SSH, and .xsession is a Debianism
  • /etc/xdg/user-dirs.conf — this will change it for all users on the machine, not just me
  • Something in PAM. Perhaps. It’s not clear what, though.
  • A file of my choice, which I then source from all of the above places. This is doable but seems stupid to me, and I’m bound to miss something.
  • Something else. This is where you come in; where am I meant to set the environment so that everything gets access to it?

Answers on a postcard…

My new network is unstoppable

My internal network — connecting together 6 machines, a JetDirect printer sharer, wireless, the phones, and my cable modem — used to all be wired together through two 10baseT hubs. Throughput was horrible; one or both of the hubs were broken. I’ve just replaced the two hubs with one 16-port 10/100/1000 switch, and my network is now between ten and one hundred times faster in my testing!

It’s now fast enough, for example, that the computer plugged into the TV can show films and TV programmes that are stored on another computer on the network!

You might be thinking: yeah, whatever dude, this is not exciting, of course it does that. Well, the hell with you, anyway. I think it’s exciting.

Anyway, this means that something I’ve been thinking of doing for a while leaps up my priority list. One of the 6 computers is a server: an old tower case machine with 90GB of storage in it made up of scrounged hard drives I had lying around. I use it as the server for my home backup system, and it does a good job. However, since I can now play media across the network (exciting! it is!), I could use it as the storage place for all our films and TV and music and games and whatnot. However, it’s old and a bit noisy, so it’d be nice to get rid of it. I still need whatever I replace it with to be an actual server, though, not just a NAS-style stack o’ discs, so I don’t want a Buffalo Terastation or similar — it not only needs to run the rsync server but I also plan on having it be used for BitTorrenting stuff I’d like to watch and to be always on for downloading things.

Can anyone think of a better alternative than buying a Linksys NSLU2, installing the Unslung firmware, and plugging a big USB hard drive into it? That looks like a powerful and cheap way to do it, as far as I can tell.

iTheora and Java support detection

Interesting project: iTheora, a PHP script handling in-browser display of Ogg Theora video files, using the Flumotion Cortado Java applet. The site’s originally in French but has also been translated into English by Bruno (nice one Bruno!).

I’d like to do this client-side with JavaScript. The big issue I find with Cortado, and indeed all Java applets, is: Java takes so long to start up. What I’d like to do is only load the Java applet if someone asks to see the video, and not show it at all if they don’t have Java installed. The problem is: how do you detect whether the punter can display Java applets, without starting Java? As far as I can tell, it isn’t possible. I’ve seen a few attempts at it, but none of them work across browsers. JavaScript people: how do you detect Java support without starting Java? I’m quite happy to write the script to do it if I can work out how, but all my experimentation and research have not led me to a solution. Lazyweb: help me out!

A book reader

I want to be able to read electronic books on the train. More importantly, I want everyone else to be able to do the same.

“But, but, but, you can already do that! Sony’s Reader does it! And Franklin’s eBookman! And loads of others!”

No, no they don’t. They let people like me (and doubtless you, gentle reader) read books on the train. They’re computers. Computers are not useful and not fun. People don’t want to read books on a screen, they don’t want to read one on a computer, they don’t want to think about computers when they’re reading.

I mean, look at the Sony Reader.

That doesn’t look like a book. That’s a PDA. Someone looking at that isn’t going to think, “I am reading a book”. They’ll think “I am reading a book on a computer“, and then they’ll hate it.

What they want, I believe (based on asking quite a few people about it, and discussing it with a friend in the publishing industry) is what I’m about to describe.

What the thing looks like

Imagine something that looks like a book. It’s about the same weight as a book, it’s about the same thickness as a (thinnish) book. And there’s text on it that is the same as a book; you can read it in bad lighting conditions, it’s not lit up, it’s well formatted. This is already possible with E-Ink’s technology; it’s what the Sony Reader uses, for example. An E-Ink “screen” looks like words printed on paper, doesn’t need a backlight, and lasts for ages on one battery. It’s like a printed piece of paper, in fact. The difficult technology bit of this is done. What’s missing is how people actually read books.

The device I propose would allow you to read books. Any book you can get onto it. It folds in half, so when it’s folded it’s about half the size of a book (and will go into your pocket or handbag or briefcase); when it’s folded it’s not running, and when you unfold it it’s instantly working again. (This is the advantage with the E-Ink stuff; it doesn’t use any power to maintain the screen.) To turn the page, you press on the bottom right corner (or bottom left corner to turn back a page). The “screen” is the whole width of it; there’s no plastic border around the screen at all (so it doesn’t look like a PDA).

How to use it

The way you get books onto it is that there’s basically a mobile phone built into it. You press a “stop reading this book” button and it shows you a list of all the books, ever. Choose a book to read and enter your credit card number (somehow: I’ve got some UI ideas for this), and it gets the book for you and you can read it.

The way you get books off it onto some other device is: you can’t. There are no ports on it. None. The only thing you can plug into it is its power supply, and that only needs plugging in about once a fortnight (because it’s very low-power, as mentioned). It has nothing to do with your computer. You never plug it into your computer, or bring it near your computer. This neatly avoids the whole DRM-for-books thing, because it is not possible to take the book off your reader and put it on the internet.

The device can’t browse around the internet; it can’t play Tetris; you can’t balance your checkbook on it. It reads books, and that’s all it does. It doesn’t ask you where to connect to, because it only ever connects to one place.

Who buys it

The market for it is all the people who read books on the train. They get the same experience from this that they do at the moment, but it can be all the books you’ve ever wanted, and you never have to go near Waterstones or any other bookshop. You don’t have to worry about where to find a book; they’re all available. You could even let people read the first chapter for free or something.

It costs less than a hundred pounds.

Possible problems

You may be thinking: there are some problems with this. I sort of agree with you. One of them is: how do you get every book in the world onto it?

Well, I’m prepared to say that it’s limited to those books that can already be bought in electronic form, somehow. I’m not 100% clear on the legality of my proposal here, but here it is: when someone says “get me, say, Thud, the latest Discworld book”, the server charges them $7.99, then connects to (say) http://ebooks.palm.com/product/detail/20229?book=Thud_, downloads the ebook from there (paying the $7.99 that the punter paid), and sends the ebook down to the device. We don’t touch the ebook; you’re just buying it and then reselling it without ever reading it. That’s certainly allowed in the US (under the first sale doctrine) and it’s likely to be fine everywhere else, because every time someone with my reader buys Thud we go and buy another copy of the ebook. We don’t buy one copy and sell it more than once.

After you’ve been doing that for a while, when lots of people have the device, then you approach the publishers direct and say “why not make your books available to this market, who will buy them, and it avoids all the existing problems with ebooks”. You don’t approach them beforehand because they’ll say no, or worse they’ll say yes if and only if you agree to sell only their books. That’s a dreadful idea; people who read don’t care who publishes the book.

A second problem is: how do you put a mobile phone in it without charging a monthly subscription? Well, you build 2 years worth of mobile phone subscription into the original purchase price, and then you eat the cost after that, basically. The subscription should be pretty cheap anyway, because it’s incredibly low bandwidth; pagers are subscriptionless too in (I suspect) the same way. The device only has to download 300K or so of book once every few weeks. Make it GSM rather than GPRS, make it as cheap and intermittent as you want, really.

So make it happen

I think this is doable, based on how all the technology exists. I think it’d be a roaring success in the market, based on talking to lots of people about why they’re not interested in reading on a PDA. I also think that I have neither the capital nor the time to do it myself, as is usual with these things. So, go for it. Make a million. If you do make it, bung me one for free. And one for Tim, the chap who helped me cook up this idea over a few very late nights and early mornings.

PNRP and Linux

Anyone know anything about this PNRP thing where Microsoft Vista machines will have their own “domain name” without registering with DNS? In particular, does it use some MS-specific stuff that’ll stop anyone else using it? I’ve read the spec but I don’t really understand it…

mirrorbright

Someone should do this. It’d be me if I had five million quid around the place.

One of the big advantages that Apple have over Linux is that it’s easy to buy a laptop with Mac OS X on it. You can buy them online, and there are Apple stores if you’re near a big city, but the key point here is that there’s a brand. Buy an Apple laptop. If you want a Linux laptop, though, you’re less able to do so. You have to buy someone else’s laptop and put Linux on it. Now, there are places slowly arising from the market that do this; System 76 and Emperor Linux in the US, Transtec and The Linux Emporium in the UK, and doubtless others across the world. What I’d like to see, and what I’d like to buy, is this sort of thing; not a Windows laptop that someone’s installed Linux on for you (and the SD card reader doesn’t work, and nor does the wireless) but an actual Linux laptop. Make a deal with ODMs to build it.

If I had the money, I’d set up a company called mirrorbright. They’d do laptops. There are a few important facts:

The outside of the laptop, the whole external case, is a mirror. Not chromed, not just shiny, but an actual mirror. You should be able to shave by looking in it. This is tricky but not impossible; there are plastics firms around that do mirrorised plastics which you then lacquer. I think this would involve making a case for the laptop bits; you can’t take an existing case and mirrorise it, because you can’t get the surface flat enough to avoid imperfections in the mirror.

The firm should do two laptops. The important point here is that that’s not “laptop ranges”, that’s “laptops”. Call them the “mirrorbright one” and the “mirrorbright two”. A mirrorbright one has a 12″ screen and 1GB of RAM; a mirrorbright two has a 15″ screen and 2GB of RAM. Each has 120GB of disc space (or something like that; lots, anyway). Each does wifi and bluetooth and has a small webcam built into the case, above the screen. You don’t get to choose the spec of it; every mirrorbright one is the same. Twelve months from now, release the three and the four which are updated. Every part on the laptop is supported with free drivers, including the graphics card to do dualhead. This will involve some fairly careful hardware choices but it’s critical. Install the latest Ubuntu on the laptops, with a custom mirrorbright theme.

If these existed I’d buy one tomorrow.

Mail forwarding smtp server

Lazyweb: I’d like to set up a mail server that doesn’t do anything other than receive mail for a certain set of nominated addresses (and “catch-all” addresses, i.e., *@example.org), and forwards them on to another email address. What would be the simplest way of doing this? I’m aware that complex mailservers like exim will obviously be able to do this, but I’d rather not use something like that if I can avoid it because exim confuses the hell out of me. Your suggestions are much more likely to be entertained if the software is in Debian :)

Decoding Morse, the computer way

Jeremy Keith’s been sent a Morse message and is wondering what it says. Well, I now know what it says, cos I wrote a program to decode it.

First, I went and got the mp3 of the message from Odeo and loaded it into Audacity. (No, not Jokosher; I’m at work, and there’s no Jokosher port for Windows. Audacity is still a free software audio editor, though, so being able to just download it is very handy indeed.) Audacity can read mp3s; I resampled it to 48000Hz (which made the peaks clearer) and made it mono (rather than stereo).

At this point I could theoretically have decoded it by looking at the waveform: as you can see from this Audacity screenshot, that’s clearly the Morse code .... .. .-.-.- (short sound is a dot, long sound is a dash; that decodes to “HI.”)

However, that’d be boring and laborious, and what if the message was five hours long, eh? You wouldn’t want to transcribe that by hand. So, get the computer to do it! I didn’t want to write an mp3 parser, though, and because I was on a Windows box I didn’t have GStreamer available which would have helped with this. So, I exported the sound from Audacity as a WAV file, and then went off and got sox, the Swiss Army knife of audio converters and another open source program. Sox can convert a sound sample to its “data” format, which is a load of lines that look like this:

               0  -6.1035156e-005
  2.2675737e-005  -3.0517578e-005
  4.5351474e-005                0
  6.8027211e-005  -3.0517578e-005
  9.0702948e-005   3.0517578e-005
   0.00011337868  -3.0517578e-005
   0.00013605442                0
   0.00015873016  -3.0517578e-005
    0.0001814059  -3.0517578e-005

where each line represents one sound frame; the first number is “number of seconds since the beginning of the sample”, and the second is “loudness of this frame”. So, that’s the answer! The loudness will be high where there was a sound and low where there wasn’t. I needed to go through the data and find all the loud bits and all the quiet bits; a long quiet bit is a space, a long loud bit is a dash, and a short loud bit is a dot. No problem: quick bit of Python scripting:

fp = open("jezza4.dat")
data = [int(abs(float(x.split()[1])) > 0.01) for x in fp.readlines()[2:]]
fp.close()

# count all the runs
counts = []
current = -1
count = 0
for i in data:
  if i != current:
    counts.append((current,count))
    current = i
    count = 0
  count += 1

# now remove all short runs, which also removes the -1 row!
counts = [x for x in counts if x[1] >= 15]

# and reaggregate everything
counts2 = []
current = -1
count = 0
for i in counts:
  if i[0] != current:
    counts2.append((current,count))
    current = i[0]
    count = 0
  count += i[1]

mystr = ""
for x in counts2:
  if x[0] == 0:
    if x[1] > 350:
      mystr += " "
  elif x[0] == 1:
    if x[1] > 500:
      mystr += "-"
    else:
      mystr += "."
print mystr

and that printed out the Morse code for the message in dots and dashes! Nice and easy. Quick trip over to a Morse code converter to read it, and there we go. Message decoded. Good one, Tom.

Oh, you want to know what it said?

- --- ..- --. .... .-.. ..- -.-. -.- .-.-.- - .-. .- -. ... -.-. .-. .. -... . .. - -.-- --- ..- .-. ... . .-.. ..-. .-.-.- .-- . .-.. .-.. -.. --- -. . - --- -- .- -. - .... --- -. -.-- --..-- - .... --- ..- --. .... .-.-.-

Line smoothing in Python

I’m looking for a line smoothing algorithm in Python; specifically, something which will take the list of data points plotted in the top line in this image and convert it to the bottom line. I’ve got a list of data points to smooth; I’m not looking to smooth the image of the line.

Anyone got any direct suggestions? I’m not much cop at maths things like this.

Living life online

I’m increasingly living my life online. I moved from hosting my own mailserver to throwing mail at Gmail and POPping it off right through to just using the Gmail web interface. I may have to start doing more of that with documents and the like. One of the big things missing there is a presentation package which lets me create S5 presentations in a graphical way. No, s5presents is not good enough. I want a GUI, WYSIWYG presentation editor. A second thing that’s missing is a word processor like LyX. I am more and more becoming convinced that the LyX WYSIWYM approach to document creation is better than the Word/OpenOffice/AbiWord WYSIWYG way of doing things. I rambled about this a little more on the LugRadio forums a while back.

The main thing that’s missing, though, is storage. At the moment, every online application makes you store created documents there, or on the machine you’re on by downloading them. What’s needed is the following:

  1. A shared storage server. It should be possible to run your own, or sign up for an account with someone else who’s running it (imagine someone setting up the server at onlinedrive.org or something, and charging £10/month for accounts or similar).
  2. A JavaScript and server side library which makes it really, really, really easy to save files to a specified shared storage server. This isn’t designed for users; instead, it’s designed for people building Web 2.0 online apps like Writely or Num Sum or s5presents, to make it fantastically trivially easy for them to integrate sharedstorage support into their applications, so instead of saving your files on their server you can save them on your choice of onlinedrive server.
  3. Authentication to onlinedrive servers should work very much like OpenID.

This should mean, in theory, that when you go off to your choice of online office app, or anything that saves files, and you click the Save button, it says “where do you want to save it to?” I then say “kryogenix.org”, exactly as I do with OpenID, and it finds my onlinedrive (which might be on kryogenix.org, or might be delegated to onlinedrive.com or online-disc-space.myisp.net or wherever, exactly as OpenID can be), and it then goes through some kind of handshake thing and saves my file to my onlinedrive. This is sort of like .Mac is, as I understand it, except it’s designed to be easily integrable with other people’s applications; you publish the specs and so on.

Allowing people to run their own servers is critical; a lot of people won’t, and there’s then a business model for doing it for them, but if you have to use onlinedrives.kryogenix.org or wherever to do this then it’s a power grab by the people who think it up, and people won’t use it (and it won’t get integrated into apps).

I think this really could work. The OpenID people have done most of the hard work as regards shipping stuff around and how to specify delegation and so on, and everyone wins. Jeremy Zawodny was musing about something similar, but doesn’t mention integration, which I think is the critical part. Note that if the specs are published it would be trivial to also integrate onlinedrive handling into desktop apps; you could do it in the major office apps (OpenOffice, MS Office, etc) with macros. If it’s all open it’d all work. A project for someone to pick up, perhaps.

Real’s Rhapsody

Anyone know anything about Real’s Rhapsody online music download service? They’ve apparently just gone entirely web-based, opening up their market to Linux and Mac users. If you buy a track from them, what format do you get it in? There’s some talk about a subscription model, but they’re pushing the idea of mobile devices to listen to your music, including my Archos PMA400 — how does that work with subscription? If I download a file and put it on my Archos, how does it know whether I’ve paid for it or not? The Rhapsody people don’t seem to say much about formats and how it all works; any good pointers or knowledgeable people want to help me out?

I need a new phone

Right, here it is: I need a new phone, and I’m looking for your advice on what to buy.

I have a set of requirements:

  • A flip phone, or in some other way not have the buttons on the outside (it can have a slide, for example)
  • SyncML support
  • Enough Java support to run Opera Mini
  • Looks nice
  • Cost me nothing to upgrade to it
  • Available on Orange in the UK
  • Decent UI
  • Decent battery life
  • Bluetooth

I’d like a phone that does all those things: none of them are negotiable. If you were about to suggest any of the following, know that I have rejected them: the Motorola V3 (no SyncML, crap UI), the Samsung E720, Z500, D500, E530 (horrifically ugly), the Nokia 8800 (very feature-poor). I didn’t think I had that difficult a set of requirements, but apparently the conjunction of “nice looking”, “flip phone”, and “SyncML” is the empty set. Please prove to me that I’m wrong.

RSS feeds with changing enclosure URLs

On the LugRadio site we publish an RSS feed of episodes, and each episode includes an enclosure tag which references the downloadable MP3 for that episode. So, one snippet from the feed looks like:

<item>
    <title>Bars with coconut in</title>
    <link>http://www.lugradio.org/episodes/31</link>
    <description>Jono Bacon, Stuart Langridge (Aq), Matt Revell, and &lt;span title=&quot;On Call
Bald&quot;
style=&quot;border-bottom: 1px dotted #ccc&quot;&gt;Ade Bradshaw&lt;/span&gt;
talk about Linux and whatever else comes along, including:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An interview with Yannick and Carlos from Nokia about the Nokia
Internet Tablet and the company&apos;s approach to open-source software&lt;/li&gt;
&lt;li&gt;Bounties for writing code: are they a good idea?&lt;/li&gt;
&lt;li&gt;Ian Brown, head of FIPR, on ID cards in the UK, and whether they
should happen or not&lt;/li&gt;
&lt;li&gt;Samba: should we be inventing our own open protocols rather than
chasing the tail-lights of closed competitors?&lt;/li&gt;
&lt;/ul&gt;
</description>
    <enclosure url="http://lug.mtu.edu.nyud.net:8090/lugradio/lugradio-s02e19-040705-high.mp3?podcast" type="audio/mpeg" length="17659904" />
</item>

The problem is this: if the enclosure URL changes, people’s podcast clients and RSS aggregators download stuff again. How can I avoid this happening?

A couple of suggested wrong solutions:

1. Never change the URL

Can’t do that. The URL points to a mirrored copy of the episode’s mp3 file. If that mirror goes offline (our mirrors are run by volunteers without payment), we have to change the URL to point to another.

2. Use a redirect

Lots of people say “just make the URL be http://www.lugradio.org/mirrors/season2/episode19/mp3” and have that be a CGI script that redirects to a mirror. That would be great if podcast clients were compliant HTTP clients, and followed redirects. In practice, they are not and do not. This means that, if we implemented the redirect anyway, we’d be secure in our integrity but lots of people couldn’t download the show the way they want. Knowing that we are right and they are wrong is cold comfort when we’re annoying our listeners; we can’t use redirects.

3. Coralize the podcast enclosure URLs

Use the Coral distribution network to not put too much pressure on the archive that goes into the mirror feed. We’re already doing this, but if that archive goes away, the Coralized URL won’t point to anything, and we’ll have to change the URL. The Coral people are very cool, but they won’t cache all our mp3 files indefinitely.

4. Set up an archive that never goes away

Essentially, this is a suggestion that goes with suggestion 1: make sure that old mirror URLs don’t break by setting up the One Canonical Archive that the podcast feed points at. The issue with doing that is that that one archive gets hit pretty hard for bandwidth, because all the podcast readers use it. This means that it has to be an archive with lots of bandwidth to cover the initial download spike when an episode is released. We could use archive.org, and we do upload episodes there, but their upload process is long and laborious and would delay an episode’s release by quite some time, which we’d rather not do.

5. Do a ‘redirect’ by streaming the data through our URL

No-one’s suggested this, but I’ve thought of it. We could put the URL from the “redirect” suggestion above in the feed, but instead of having that URL redirect to a mirror, that URL points to a CGI script which downloads the data from a mirror and streams it out on the fly to the consumer. I don’t want to do this because it puts a horrific bandwidth requirement on the lugradio.org machine; every downloaded byte of a LugRadio episode will go through that machine, and we can’t afford the bandwidth for that.

At the moment, we Coralize URLs, and we’re trying to set up a Canonical Archive based on a very useful donation (about which more in a few days). But is there a better way? I can’t help but think that there should be a better way around this; something with tag URIs or guids or something. Remember that we need something which works with the podcast clients that currently exist; I don’t want to hear “clients should support XXXX and if they don’t then you should ignore them“, because we don’t have the luxury of doing that, sadly.

Any help will be greatly, greatly appreciated; I’ve been wrestling with this problem for months now and I’m still not sure how to solve it. Thanks!

What to do about alt text

I run into this problem a lot. Imagine I’ve got a picture of, say, Sam and I at a party. I’d like to post that picture here. So, I’d have the picture and then, below it, a caption saying “This is Sam and I at the Beckham’s party“. But then what should I use as the alt text on the picture? Clearly the alt text should be “Sam and I at the Beckham’s party“, or perhaps even a longer description of the image. However, then the caption is redundant; if someone browses the page with images off then it will (correctly) display the alt text in place of the picture, leaving the page saying “This is Sam and I at the Beckham’s party. Sam and I at the Beckham’s party.”
Those of you saying: appropriate alt text for that image is therefore the empty string, since there already is a caption in the HTML; what should I do if i want the image to be a link to beckhams-party.com? If I make the alt text empty then the link is unusable in text-only browsers.
Perhaps I should, for example, make the alt text empty and wrap both the image and the caption in the link, thus covering both those bases. That only works if the caption is the thing immediately following the image, though. Semantic HTML people, what would you recommend?

A little HTML test

Below lies the code for an HTML page. See if you can tell me why the form submits fine in Firefox, but the submit button doesn’t do anything in Internet Explorer.


<html>
<head>
<title>Test page</title>
</head>
<body>
<form>
<textarea>
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
</textarea>
<textarea>
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
</textarea>
<input type="submit">
</form>
</body>
</html>

The answer is not “it’s a bug in IE! IE sux0rs!“. I’m not clear what correct behaviour here is, but IE is defensibly doing the right thing, at least possibly. Your thoughts? And I’ll give you the answer later.

Full-screen video conferencing

What software is there that allows you to do video conferences with multiple people and can show the people as just the images on a black screen, with the whole screen used? I don’t want a little window (or multiple little windows) on your desktop; instead, I want something like my mockup of tilted pictures from the other day (although don’t worry about the tilting or anything like that). The point of this is: while you’re in a video conference, it’s all you’re doing, so it’s fullscreen. It’s not there so you can see someone’s face while you still write stuff in Word. Can any video conferencing software go fullscreen? Important point: I don’t care about text chat, I don’t care about audio. Just video. The audio will be transmitted by another method. Yes, yes, I know iChat in Tiger can do it, but that doesn’t help me; I’m looking at this for work, and work is all Windows boxes (so no GnomeMeeting either). It should be Free Software too, ideally. Trillian does video chat, but it needs to be the Pro version, which is a bit expensive. I’m looking for suggestions…

Videoconferencing multiple parties

Apple’s iChat will, in the Tiger release, do this flash thing where, in a multi-party video conference, it tilts the pictures of the other attendees so that it looks like a conference room. Pretty cool. However, I reckon you could go one step better than that. After all, you’re not interested in the background. Moreover, the background doesn’t change, so it should be possible to strip it out on the fly and just show the heads. Excuse the quick mockup below: the people are just those I found in a quick Google Image search for “head shot“.
It would look something like this.
Is this possible? FaceTop seems to strip out backgrounds so I assume that it’s doable, although it’s possible that the FaceTop people are all sitting in front of black walls. I think it’s a pretty cool idea; all you need to do to each image is strip the background—grab the first few frames and see what doesn’t change, although you might end up stripping the person or their hair or something then as well—and then do a perspective transform on the image to tilt it (as iChat does). The Gimp does perspective transforms, so it’s doable (the Python Imaging Library doesn’t, but there is a patch to apply it to 1.1.4 available). I’d have a crack at it myself if PIL did it and if you could alter how GnomeMeeting works using Python, neither of which are true…

Bloglines meme

After Andy Todd we present: the Bloglines meme. Go to Bloglines. Find your own blog. (If it’s not there you can sign up and add it. If you don’t have a blog this one’s not for you.) Click related feeds. Post the top 5 (or more) on your blog.

  1. kottke.org
  2. Boing Boing
  3. Aaron Swartz: The Weblog
  4. Slashdot:
  5. kuro5hin.org
  6. Jon’s Radio
  7. Google Weblog
  8. Scripting News
  9. BitWorking
  10. Google Blog – Live
  11. Wired News
  12. Thinking About Computing
  13. Scobleizer: Microsoft Geek Blogger
  14. SimpleBits
  15. Ned Batchelder’s blog
  16. Clay Shirky’s Essays
  17. Ben Hammersley’s Dangerous Precedent
  18. Surfin’ Safari
  19. mozillaZine
  20. Anil Dash
  21. Blogzilla – a weblog about Mozilla
  22. World Wide Web Consortium
  23. Photo Matt

Incidentally, the following little bit of Python will create that list for you:

print '<ol><li>'+'</li>\n<li>'.join(re.findall(r'<h2.*>(<a href=".*?">.*</a>)</h2>',s))+'</li></ol>'

if you cut-and-paste the text of the page and stick it in the Python variable “s“.

Satellite navigation using the internet

I had this thought. Do any of the “driving directions” places, like the AA or MSN MapPoint or Multimap allow you to input GPS waypoints? Alternatively, is there anything on the net which translates GPS waypoints into postcodes? If there is, then if you can pipe a net connection into your car somehow (GPRS is the obvious solution here) then you’ve got satellite navigation, because you just keep fishing your current location out of GPS and then query the site for how to get to where you’re going.
Of course, it’d cost a fortune in connectivity bills, and you’d be better off just buying a real satnav system for four hundred quid or so, but that’s not the point.

Editing files as root in Ubuntu

When I right-click a file in Ubuntu and say “Open in gedit” or “Open in bluefish” or whatever, if I don’t have rights to edit that file, I don’t want it to open it read-only. Instead, I want it to say “You don’t have rights to edit this file? Open it read-only or edit it as root?” and then, if I pick “edit it as root“, do “gksudo “, so that I can edit it and don’t have to drop to a command line to do it.
How can I do this? The only way I can think of doing it is to change all my “open this file with this application” things so that, instead of opening the file in the app, it opens them with a little zenity shell script that does what I want. That’s a massive pain in the arse to do. The problem is that you can’t hack Nautilus to do this for you,. because it doesn’t want to happen with applications that aren’t editors. Suggestions, anyone?