Search Results: "Matthew Palmer"

22 January 2006

Matthew Palmer: LCA 2006 -- Schwag Review

It's a conference tradition that you get a pile of schwag at registration -- some sort of collection of toys, brochures, and other miscellania to remember the conference by. Or something. LCA is typically characterised by a pretty good schwag haul -- I can't think of an LCA I've been to (all 2 of them up 'til now) where I've been disappointed with the schwag. This year is no exception. The organisers have clearly gone to a lot of effort to dredge up all sorts of geek-friendly gear to dish out. For example, the conference bag -- it's a laptop-friendly backpack-type apparatus. Lots of pockets, shoulder strap, the whole kaboodle. Very tidy. It's a pity I've already got my Targus carry-everything-including-the-kitchen-sink model, because this bag would make a very nice alternative to that. The stuff inside the bag is just as impressive. There's another retractable network cable, like last year (a bit of a pity, perhaps, but this one is Cat-6 rated, for extra... something), as well as a tiny little 1-AAA torch. There's the usual pad/pen, tourist detritus, and conference program. More interestingly, there's a very shiny yo-yo (puppy dogs, beware!) and (possibly most importantly) a keyring-mountable bottle opener. There's also what is possibly the world's smallest frisbee (less than two inches in diameter -- as one of the organisers said, "Throw it at a speaker you don't like, because it sure as hell doesn't fly"), a laser-cut placemat (tres cool), and a chunk of chocolate (because we're about 5 minutes walk from the local cadbury's factory). Finally, there is the T-shirt. Loved ones will be pleased to hear that the T-shirt this year is basic black, meaning that you won't have to worry about being seen in public with a red-clad Matt. (For those of you watching at home, my wife isn't keen on red coloured clothing for some reason, so last year's conference T-shirt was not a big hit). The speakers are going to have to work hard to top the schwag pile. I await their response with baited breath.

Matthew Palmer: The Future Is FUSE

Well, probably not, but it's a nice catchy headline. <grin> What I do think is that there is a pile of unexplored functionality hiding in mapping more things to regular filesystems. FUSE has lowered the barrier to providing access to non-traditional filesystem places -- there's versioned filesystems, SFTP (of the SSH variety) filesystems, filesystems into tarballs and zip files, and so on. Implementing a FUSE filesystem is as simple as whipping up a few callback methods in your favourite programming language (the native bindings are, of course, in C, but there's FUSE libraries for Python, definitely, and I'm fairly sure I've seen Perl and Ruby ones as well) to implement things like stat, open, read, and so on. Then you run the program as per normal and suddenly you can read and write things you've *never* read or written before... Beyond the mundane extensions of reality listed above, there's whole new vistas of relatively unexplored territory for filesystem-like operations, which are (a) waiting to be explored, and (b) much easier to implement due to the fun of FUSE. For example, SQL databases are very hierarchical in nature. Databases contain tables which contain rows which contain fields which contain values. If you can track your foreign keys, some of those values can be symlinks/directories to other records, or a directory of records for join tables. Sure, it's horribly inefficient to update whole tables by for i in *; do echo 12 > $i/fieldname; done, but at the very least it could be an interesting way of viewing data, and with some judicious caching (depending on use-case) the performance could probably be made half-sensible. A more refined version of this is the idea of reporting into pseudo-flatfiles. Imagine if you could open a file and have a spreadsheet of all of your data. With FUSE, it's possible. A killer one that my boss Dave Kempe came up with is a search filesystem -- you create a directory in this FUSE filesystem that is named after a search query -- perhaps "2005 financial". A Google Desktop-style search then results every time you enter that directory, and all matching files are available for your viewing pleasure. I understand that gmail works something like this "virtual folders with search" model, and I know that applications like Evolution and Liferea already have some sort of virtual folders type of thing, but we don't think that anyone's written something like this for filesystems. Considering that you can run a FUSE filesystem over Samba, you can easily have a company-wide document search-and-retrieval with persistent (and shared) queries, which is probably a pretty valuable thing. Even all of these, though, are relatively tame ideas when weighed against the myriad of things that my tiny mind can't even dream up. I don't think people have put much thought into how far a filesystem really can go, because before FUSE, if you wanted to write a filesystem, you were pretty much restricted to kernel-mode programming -- a very limited (and dangerous) world for your average application programmer.

18 January 2006

Matthew Palmer: Billy and his Boots

Just read this one in the monastery, and had to record it for posterity:
Billy never liked to wear boots. He always wore shower flipflops when he was driving a plane. Turned out he never went through the Escape and Evasion school, so they sent him, and he showed up the first day in those shower clogs. The instructor asked him how long he thought he'd take to get out of the jungle in them if he got shot down. He answered that it took him two weeks the first time, nineteen days the second time, and eleven days the third time.

Matthew Palmer: It Never Rains...

but it pours. So far on my trip home this afternoon (I'm a little over halfway home) I've met three people I know -- two fellow geeks and a friend from TAFE I haven't seen in several years. Statistically speaking, seeing someone you know here and there happens -- it happens to me often enough that I can accept it as normal, if not regular. But three. Thankfully, dice have no memory, otherwise some probabilistically-likely event would have to not happen, or some really bad freakishly unlikely event would have to happen to balance everything out. Shit. I get on a plane on Sunday. Now I'm worried.

17 January 2006

Matthew Palmer: But how, dear Liza?

Support our Aussie Farmers, dear Henry, dear Henry. Support our Aussie Farmers, dear Henry. Support!
I hate "current affairs" shows. They're nothing but beat-ups and bullshit. But I had the unpleasant experience of actually watching an episode just now, and they've hit a new low. It was an article on prawn farmers, and oscillated between South Park style "they took our jobs!" and "those evil retailers, mislabelling foreign prawns as local". Now, I empathise with people who lose their jobs due to circumstances beyond their control, and misrepresentation is a fairly unpleasant thing, but the bit that thoroughly pissed me off was the return comment from the presenter: "We should all support our Aussie farmers." How, exactly? We can't "buy Australian", because the products are mislabelled, and that was the whole thrust of their article. No mention was made of legal action, civil or criminal, and the number of people watching who would be in a position to take such action would be vanishingly small. Misrepresentation is already illegal, so it isn't a matter of pressuring our elected representatives to pass appropriate legislation. At least I know I've not been missing anything by running away every time a show like this comes on the idiot box for the past 12 months.

16 January 2006

Matthew Palmer: Work it out yourself, dammit!

My pet peeve of the day -- web apps which require you to specify, in advance, what the URL of the source of the webapp is. The app *can* work this out for itself, you know. The fact that you're too brain-fuckingly stupid to do so does not mean that you should proceed to screw over anyone who needs to use your program in a "non-standard" environment, it means that you should step away from the goddamn keyboard and stop infecting people with your stupid.

15 January 2006

Jose Carlos Garcia Sogo: Rewriting from scratch

I agree Matthew Palmer, and by extension Joel on Joel on Software that rewriting software projects from scratch is a very bad idea, which in case of FOSS can mean death of the project because people lost interest on it due to the great effort needed to reimplement things that were working before. At the same time I take what Joel says: programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. Being myself a Civil Engineer I cannot agree most. The other option is patchy and result will never be so good as a well planned project, with a good design, time... and money. And this is one of the greatest things of software. With a good planning you can refactorize it, change what you want and even demolish and rewrite some parts, whithout having to throw away all the old code and start over.

Matthew Palmer: Evolution vs Revolution

To rewrite, or not to rewrite, that is the question. If there's one thing programmers seem to love doing, it's rewriting a piece of software from scratch. Which is funny, because "the industry" spends a lot of time bemoaning duplication of effort and generally touting "reusability" and "component-based software development". Joel on Software has a fairly good treatise on why rewriting software, in general, is a Bad Thing. I may not agree with him all the time, Joel is always worth a read, and I certainly can't fault his reasoning on this issue. My primary experience with rewriting software, as with most things software-related, is in the Free Software world. Although I've been involved in (or led) rewrites of proprietary software in the past, I've seen a lot more "let's rewrite it all" death-marches in FOSS. While I wouldn't characterise them universally as "failures", they don't seem to have the beneficial effect the authors were probably hoping for. What does seem to happen, in these FOSS projects, is that the developers squirrel themselves away in their backyard labs, using the latest and greatest in software engineering processes and tools, to produce... the same end result. (If you produce something totally different, it's not a rewrite, it's a new piece of software that does much the same things as the old one). When I say "the same end result", I mean exactly that -- it does the same thing, the code is still subject to coderot over time, and so on. It doesn't seem like much useful output has been produced. So why do we do it? Joel gives some good reasons (and why they're not such good reasons). Rewrites always take a very, very long time to do. It's in their nature. They're also very demoralising -- you're not really creating anything new, you're just recreating existing functionality. In the beginning, though, it's amazingly exciting -- a whole new world of bugfree code, an engineering marvel, something for the annals of software history. But several months later, as your new code is becoming cruftier by the day, and you're just duplicating functionality that already exists, you get bored. And boredom is the death knell of FOSS projects. I presume that this excitement-fading-to-boredom progression is why everyone starts rewrites, but they're often abandoned (or, at least, take a lot longer to complete than estimated). I'd make a comparison to that favourite target of unfair comparisons, marriage, but I know my wife reads my blog, so I won't. <grin>. This boredom factor is what has affected the python-appserver backed rewrite of IRM (from php3-style PHP). I took on maintenance of the existing PHP codebase over a year ago, and the rewrite had been in progress for a while at that point. IRM now has a bunch of useful new features, and there still isn't any indication of a useable tarball emerging from the rewrite. A rewrite in progress is a terrible thing. It tends to make people wary of working on the existing codebase, if it's going to be a deadend. Without something to work on, they'll tend to wander off to other projects. However, sometimes (due to existing deployments), users will work on the deadend. If the developers have been more-or-less neglecting the existing codebase while they take on their glorious rewrite, then the rest of the world is going to have been playing with and tweaking the existing code, adding their own improvements and modifications. The result of this, when the new rewrite finally releases, is that there's great wodges of third-party code that's incompatible with the rewrite, and a large chunk of your userbase says "stuff it" and sticks with what they know. This is what looks like happening in the world of SysCP. A few days ago, I found out that they're planning on doing a rewrite from the functional-spaghetti-PHP of the current version to the cult-of-MVC-PHP. This is nice, but their current estimate is of a first RC release in February. I take this estimate with a boulder of salt -- for the full collection of usual reasons (boredom, real life, overoptimism, etc). The fact that there's not a huge amount of movement on the commit log doesn't inspire confidence, either, and despite early claims of a massive development team, only one person has been committing recently. In the meantime, I'm tasked with adding a number of small features to the current SysCP codebase, which we need for work. When the rewrite comes out, it's highly unlikely that there will be a business case for rewriting my features for the new code, and it's not likely that the features we need will make it into core. So, SysCP will probably fork -- the old, featureful, crufty codebase, vs the new, shiny codebase. If there's sufficient new features to warrant an upgrade, we'll take the plunge, but what SysCP does now is very close to what we want, so it'll take a fair amount of shiny! to get us to move. This is a general issue of software development in FOSS -- if you take your eye off the ball, for any reason, someone else will probably pick it up and run with it. Your rewrite will be a completely new project, and you'll get some of the users and the fork of your old codebase will continue to live on in another guise. Let's face it, though -- your code is going to accumulate cruft. Over time, it morphs into this bletcherous pile of huge functions, multi-purpose classes, and reams and reams of bug reports. How do you deal with this cruft? Surely at some point it's easier just to throw it out and start again? Reality says no. Joel gave the key advice in the article linked above (go read it if you haven't already -- seriously), and it's strongly hinted in my article title. Don't revolt; instead, evolve your codebase. Tweak it, evolve it, move it slowly (and compatibly) towards your utopian ideal of perfect code. You won't get there, but you'll almost certainly get closer by gradual and continuous improvement than you would be going back to the start line and walking in a different direction. There's one big question that's nagging at me, though -- what happens when you want to switch languages? I'm loving Ruby on Rails at the moment, and so are several other people at work, but we've got (both personally and professionally) huge swathes of code in PHP (and other second-rate languages) that needs to be dealt with. It's a lot harder to evolve code into a different language than apply a gradual degunking. I have a number of ideas on this point, but I'd love to hear your ideas too. In a few months, I'll have a lot better idea of what works and what doesn't in massive PHP to Rails conversions, and I'm sure everyone out there in the blogosphere will hear about them in due time.

12 January 2006

Matthew Palmer: Xinerama is the r0x0r

I was motivated, this morning, to look into whether my laptop chipset (Intel 915GM, for anyone interested) could do this funky multihead thing. Much to my surprise, it was (a) possible, (b) quite simple, and (c) incredibly useful. I now have a 15" Dell LCD screen on a cardboard box behind my laptop docking station. What is it useful for, you ask? Let me count the ways (with the help of the <ol> tag, of course):
  1. I've gotten a couple of PDF versions of my current "must always have with me" technical books (Programming Ruby and Agile Web Development With Rails, since you didn't ask), and now I can stick them on the other monitor to refer to while I'm coding.
  2. I can stick my xchat window up on the external monitor, so I can quickly glance at what's going on without having to touch anything. With the ability to stick a window on all desktops, I can have xchat no matter where I go!
  3. If I want to show somebody else something, it's handy to be able to push it up onto the top screen so they can more easily see it without having to crane down at my laptop screen (plus, if they go "what about <smudge>that?</smudge>", it's work's monitor that's getting grotted on, not my laptop screen that I have to stare at for 10+ hours a day).
Since I rarely (read: never unless I'm forced to) reboot my machine, instead relying on the magical marvels of sleep/hibernate, I did have one major concern with this multihead thing -- when I'm out-and-about, obviously I'm not going to have my external monitor with me, so how do I view things that are up on the other screen (either because I left them there when I was in the office, or because the window autoplacer stuck them there)? It turns out to be a fairly trivial and rarely noticed problem (except when I shove the mouse at the top of the screen to hit a button and my mouse disappears off into the wilderness). The answer to the invisible window problem is trivial -- I wave my mouse around where I can't see it until the window I want is highlighted in the miniview, then hit Alt-M to lasso it, and drag the little beastie into the light. Much easier than trying to guess where the title bar is to bring it down. In the interests of sharing the love (and having a record of what I did for next time), here is the sum total of what I had to add to my xorg.conf to make it all work on Ubuntu Breezy (along with some comments to make it easier to understand what's happening):
Section "ServerFlags"
        Option  "DefaultServerLayout" "double"
        #Option "DefaultServerLayout" "Default Layout"
EndSection
# This Device section is effectively identical to the one for the
# primary screen, with the addition of the Screen 1 parameter to
# select the alternate display device.
Section "Device"
        Identifier      "vgaout"
        Driver          "i810"
        BusID           "PCI:0:2:0"
        Option          "MonitorLayout" "CRT"
        Screen          1
        Option          "DDC" "false"
EndSection
# external display
Section "Monitor"
        Identifier      "generic"
        # I kept all these loose because most monitors support
        # autodetection.
        HorizSync       27 - 96
        VertRefresh     50 - 110
        Option "DPMS"
EndSection
Section "Screen"
        Identifier      "external"
        Device          "vgaout"
        Monitor         "generic"
        DefaultDepth    24
        SubSection "Display"
                Depth           24
                # I'd have added many more modes here, but
                # the amazingly crufty external LCD I'm using
                # only supports 1024x768.
                Modes           "1024x768"
        EndSubSection
EndSection
# xinerama layout
Section "ServerLayout"
        Identifier      "double"
        # The 0 0 (I think) identifies this as the "root" monitor
        Screen          "Default Screen" 0 0
        # You can also use Below, LeftOf, or RightOf to position
        # your shiny subscreen
        Screen          "external" Above "Default Screen"
        InputDevice     "Generic Keyboard"
        InputDevice     "Configured Mouse"
        # Never, ever forget this option.  You'll get laughed at
        Option          "Xinerama" "true"
EndSection

5 January 2006

Matthew Palmer: Music To Hack To?

Ever since I got my portable ogg player a few months ago, I've been listening to music on a fairly regular basis, particularly when working on my computer (read: programming, mostly). I've noticed that what music happens to be penetrating my skull has a bit of an effect on my coding -- both from a productivity point-of-view (ever so slightly), but more interestingly, from an enjoyment point of view -- some songs just feel like they go well with cutting code, so I enjoy both the music and the coding more than I do normally. My personal favourites have been songs like Meatloaf's Bat Out of Hell, Robbie Williams' Let Me Entertain You, and several tracks off Evanescence's album Fallen. (On the Evanescence point, when my wife first bought Fallen and played it, about 10 bars into the first track, I said "now that is music to hack to" -- interesting how I got that feel so quickly). The common factor that I can identify there is that they're all powerful tracks, with a strong, driving rhythm and a feeling of speed. They also all sound good really, really, loud (much to my wife's displeasure). So, in the interests of scientific discovery, I'd like to know what other people like to listen to when they're writing their stuff. Both from a point of view of "what else can I stock my iRiver with to encourage my coding", and also to see if people's tastes in Music To Hack To is universal, or a personal thing. E-mail your thoughts to mtht@hezmatt.org, or if your blog is syndicated on Planets Debian, Ubuntu, SLUG, or Linux Australia, Just Blog About It and I'll pick it up. Summaries to follow.

4 January 2006

Matthew Palmer: Tabs Are For Indents, damnit!

(Working Title: "Light up the crack pipe boys, thinkin' time's over!") A tab is a wonderful thing. It makes everything line up nicely. So what does YAML ("indentation is so critical to proper interpretation of YAML" -- from the YAML FAQ) do with them? It bans them. Apparently Guido (van Python) thinks the same way -- using the key meant for indenting to indent things is a crime against humanity. And why is it such a heinous crime to use tabs, you ask? Because "they are treated differently by different editors and tools" . Where's the prohibition on using line endings, then? They're treated differently by editors and tools, too. Broken tools exist, that's true, but we don't pander to them -- we either fix them, or insult the people using them until they switch to something that doesn't suck. If tabs are criminal, why do we even bother to *have* a tab key, then? Just pry it off your keyboard and throw it out. It's obviously not useful for anything. Let us bang on our spacebars, and have endless flamewars about how many spaces a particular project should indent all it's code, instead of just using tabs consistently, and then setting your personal preference of tab stop width in your editor like the good lord intended. I am so amazingly and deeply pissed off right now. Bloody religious zealots -- "I don't like something, so neither will you".

3 January 2006

Matthew Palmer: Those who don't understand Unix...

... and so on. Today's example: For each File. Yes, you know what it does already. But that would make for a very short blog post, and that is so not my thing, so I'll quote the short description of the project:
For each File lets you run an arbitrary set of GNU BASH commands upon an arbitrary set of objects. It can be used to perform repetitive tasks such as renaming, extracting, moving, and manipulating a large number of files.
Yes, dear friends, someone has sat down and written a program (and associated manual) to implement a bash for loop (and possibly a bit of find as well). Since it's all written in bash, it's not as though the author of the program was incapable of working out how to write for i in /path/*; do [...]; done, either. I'm not quite sure which part amused me the most. Was it the ever-optimistic -devel and -user mailing lists, completely devoid of archived material? How about the user manual -- 40% of which was the licence text? Perhaps it was the fact that this not just a bash for loop -- it's a fully internationalizationable bash for loop. I know one thing, though -- with all of the energy put into this program (and it's been going for several years now, apparently) the author could have created the ultimate, never to be surpassed manual for the bash for keyword, which would have been significantly more flexible, and certainly less interesting to poke fun at. Addendum: the whole site that FeF is hosted on is accessable only via SSL with a self-signed certificate -- except for the download page, which is HTTP only. So you "know" that the non-existent list archives are really what they say they are (at least as long as you trust "Gna!" as a certificate authority, as I'm sure we all do), but the actual source code is hosted who-knows-where, with no useful assurances as to provenance whatsoever.

29 December 2005

Decklin Foster: Ruby Love

Matthew Palmer writes about the goodness that is Ruby. I, too, have just recently been won over, and am stumbling along with the online docs. In fact, this can be done in one line:
STDIN.readlines.sort_by   rand  .each    line  puts line  
But this is slow, as sort_by needs to be at least O(n lg n), and probably not perfectly random (I suppose you could do rand <=> 0.5, but that s not perfect either). What to do? We can implement a proper Fisher-Yates shuffle in a function, but that takes a couple lines. Can we still perform the actual read-and-print in one? Yesterday, why wrote something that really made me stop and go wow . We can attack the random sort problem in a similar (if more boring, as there are no lambdas to pass in) way, by simply adding another method to Array:
class Array
    def swap!(a, b)
        self[a], self[b] = self[b], self[a]
        self
    end
    def shuffle!
        each_index do  i 
            j = i + rand(length - i)
            swap!(i, j)
        end
        self
    end
end
STDIN.readlines.shuffle!.each    line  puts line  
Now that is cool.

26 December 2005

Matthew Palmer: Making DVD Movies

I recently came into posession of a collection of (smallish) WMV files containing photo slideshows. Unfortunately, they don't play on my DVD player, and SWMBO's laptop has No Hope of playing anything remotely like a video. So, technology to the rescue. Initially, I was just going to convert the movies into something that the DVD player would actually play, but by the time I had those, I was 95% of the way to doing the job properly, and it would (of course) look far nicer with menus and other Shinyness (instead of just a boring file menu), so I went all the way and made a complete DVD movie disc. The whole process was non-trivial to discover, but ultimately straightforward in practice (once you know the set of command line options to use), so I'm archiving this for posterity. I use Ubuntu Breezy. A lot of the packages I've used are under really heavy development, so slightly older versions may not work. If you're running another distro, finding compatible versions may be tricky (or not). Try the process with whatever you've got; if it works, great; if it doesn't work, try upgrading versions or something. Step 1: Convert Video Files To Something Less Bong Packages used: transcode 1.0.2-0ubuntu2 (trivial backport from Dapper; mail me if you want it, but the one in Breezy will probably work OK), mplayer 1.0-pre7cvs20050716-0.1ubuntu9, mjpegtools 1.6.3+rc2-0.0ubuntu2 As far as DVD players are concerned, WMV is non-existent (clever things). DVD players like some form of MPEG-2 video with AC3 or MP2/3 audio. So, we use transcode to convert the video. For WMV files in particular, only mplayer does the decoding right (the af6 plugin seemed to work, but the resizing didn't turn out too well). So, our command is:
 transcode -x mplayer -i $FILE.wmv -g 640x480 -e 44100,16,2 -o $FILE.tc --export_prof dvd-pal
Items of note: As I mentioned, the output from the transcode run is two separate streams -- an audio and a video stream. We want to combine them. This is quite easy:
 mplex -f 9 -o $FILE.vob $FILE.tc.m2v $FILE.tc.mpa
This is a simple "glue them together" command -- the only interesting bit is -f 9, which simply specifies a particular MPEG-2 multiplexing method (full DVD-compatibility, or some such). If things aren't working out for you, try -f 8, which I believe also works. Since you'll probably have a bunch of video files to convert at once, you'll want to automate all of this with a shell script or shell 'for' loop. Step 2: Make a DVD Layout Packages used: qdvdauthor 0.0.10-0.1 This is the bit that I thought would be hard, but is actually amazingly easy (the previous step took me two days to get completely right, this bit took me about an hour). Fire up qdvdauthor, answer any stupid questions it might come up with. When the main screen comes up, click on the 'Add Movie' button on the left hand side, then select the first video you want to add. Repeat as required to add all of the videos you want. (Remember to add the VOB files you created earlier, and not the WMVs you might still have laying around. D'oh!) Clicking on the 'Video' tab on the left hand side should list all of your videos. Check they're all there, and are the correct size. Next, create or find a suitable background picture or video to make your main menu background. I've only tried with an image, but it seems to accept videos if you give them to it. Click on the 'Add Background' button on the main qdvdauthor screen. Pick your image. The image will probably need resizing; just go with the flow and pick the correct image size. Now you need to add those funky little menu items for selecting on. This is the really cool bit. Right-click on the background image you've got, and select 'Add Text'. Drag on the background to create a text box. You'll get a dialog come up, type some text in the bottom box, then click 'OK'. This'll create the text on the background. Drag it around if you need to. Finally, right-click the text and select 'Define as Button'. Another dialog box will appear. Rename the button if you like, then pick which video you want to play from the select box marked 'vmgm'. Click 'OK'. Repeat as necessary. That's all the hard stuff done. You can add a sound clip to play over and over again if you like, but I haven't done that yet, so you're on your own there. Step 3: Make the DVD For this step, I needed to compile toolame from source. Get it from http://toolame.sf.net/. This is super-simple. Basically, just click on the giant icon labelled 'DVD' in the top toolbar. Follow the prompts. Click 'OK' as necessary. When the process is done, check the 'Keep Open' checkbox quickly, and go over the output to ensure nothing completely crapped out. Assuming all is well, you can make your DVD image by running:
 mkisofs -dvd-video -udf -o /tmp/dvdimage.iso $DVD_DIR
Naturally, replacing /tmp/dvdimage.iso and $DVD_DIR with appropriate values. Lastly, cook the ISO to appropriate media with something like:
 cdrecord -dao -eject -v speed=2 dev=1,0,0 /tmp/dvdimage.iso
Assuming all went according to plan, you should have a physical DVD you can stick in your DVD player and watch to your heart's content. Congratulations! You just did all of this in about a 50th of the time it took me.

Matthew Palmer: The Documentation Conundrum

Several times over the last few months, I've had a common experience: I write documentation (gasp!), and then nobody reads the damn stuff. This offends me primarily because (like most geeks) I despise writing documentation. However, I write it because I despise having to explain myself a dozen times over. Better to write it down, and then I never have to worry about it ever again. Then, after I've taken the effort to actually document something, nobody reads the stuff, and they just ask me directly -- and then get offended when I grunt "RTFM" at them and go back to my code. But you start to think: "why am I wasting my time reading these docs, when I could just save myself a few hours of my life and answer their questions as they appear?" Now that I've gotten into the documentation habit, lack of documentation elsewhere also offends me. I want to know something, so I go looking for some form of written expression related to the topic at hand (Google Is Your Friend) and come up completely dry. For free software, I can more-or-less live with it -- I follow TechnoYoda's advice, and Read The Source, Luke (and then document it). For other stuff, though (lock-in software, social processes) I've got no hope. I'm reduced to pouting in IRC channels until someone tells me what I need to know (and then I document it). But you start to think: "why do I waste my time looking for documentation, when it never exists anyway, and I could save myself some time by just asking directly in IRC or on a mailing list?" As we all know, there are two documentation-related universal truths in IT:
  1. Nobody ever writes documentation.
  2. Nobody ever reads documentation.
I got to thinking -- is there a causal relationship here somewhere? Did people write documentation in the olden days, but gave up because nobody ever read it, or did people originally always read the manuals, but stopped looking for documentation because it never existed (or when it did, it was content-free and useless)? Or did both of these truths appear independently, or are they both aspects of a single truth: "Everybody Hates Documentation"?

Matthew Palmer: Language Is Not Just Syntax

My current long-term learning project is Ruby on Rails, the ultra-hyped web application framework from David Heinemeier Hansson and friends. I like it (primarily because I can see a lot of my own abortive ideas from a web app framework for PHP I used to develop), but there is one big thing about it (or, rather, it's surrounding hype) that irritates me. Throughout the Rails literature (webpages, magazine and webzine articles, and the book Agile Web Development With Rails), there is a consistent message -- that, because everything is written in Ruby, you don't have to learn any new programming languages to write Rails applications. This is a wonderful theory -- no large XML config files to define my database schemas, and no castrated and irritating HTML template system to learn. From defining table relationships to printing a select tag, It's All Ruby, All The Time. Sweet, right? Sort of. The problem is that you won't find the language primitive to declare a one-to-many relationship in the Pickaxe (the definitive Ruby language reference book -- like "the Camel" for Perl, "the Bat" for Sendmail, or "the Turkey" for PHP). Defining a separate namespace in Rails for all of these operations is, of course, necessary, since the language didn't already define these operations. But, once you've defined a whole new set of methods to do all of these operations, you can look back on your hard work and see -- what? A new language -- one specifically designed to describe webapps. Don't get me wrong -- domain-specific languages are teh r0x0r. If everyone had to do all of their HTML manipulation by hand, programmers would be even more insane than they are. But, when you're writing your application in Rails, you're not speaking "pure Ruby". Your syntax and basic structure is Ruby, but your methods and attributes are new, different, and All Rails. It may not be a separate programming language in the usual sense, but by the time you've added a whole new pile of classes, methods, and attributes (not to mention whole new ways of structuring your application), how much importance is the use of the @ symbol to signify an instance variable, compared to the whole new set of methods to learn? Natural languages, of course, have similar issues. Most western european languages share a lot of common characteristics -- similar character sets, punctuation sets, and they read left-to-right. So I can look at a page of German or French, and identify most-to-all of the salient features (hey look, an 'a'!), and even grok the meaning of a few of the words (familiar to me, probably, because English misappropriated them from wherever they came from) but I still have no hope whatsoever of understanding the meaning of the passage as a whole. The language syntax looks familiar, but those nouns and verbs don't have any meaning to me. You can't plonk a Rails app in front of even a seasoned Ruby developer and expect them to immediately jump in and start hacking on it like they've been writing it all their life. The language syntax looks familiar, but those methods and attributes don't have any meaning to them. This is nothing peculiar to Rails, of course. If you want someone to hack on your Hibernate or Spring app, you'll get better results if you advertise for a Hibernate or Spring programmer than a Java programmer. But Rails advocates regularly say "it's all just Ruby, so there's nothing new to learn!", and that's Just Wrong, in my opinion. As an aside, if you're looking around for something a bit different, do seriously consider Rails (or just Ruby, if you don't need a webapp framework). It's different from the "usual" suspects (C, C++, and "the Ps" -- PHP, Perl, and Python), and pleasantly so. If you judge your programming languages by the old adage "a programming language that doesn't change the way you think about programming isn't worth learning", Ruby will score well. I know it's helped me think about my programming differently already, especially my Python programming (and thanks to Anthony Baxter for answering all of my esoteric python questions at OSDC a couple of weeks ago).

24 December 2005

Matthew Palmer: My Alternate Career

I have decided, if I ever get tired of working in IT, that I'm going to open a swimwear shop, and call it "Swimmers 'Ere". Thankyou, I'm here all week.

21 December 2005

Matthew Palmer: Ubuntu is now a mature distribution

In my eyes, Ubuntu now has all of the pieces of a mature, well-rounded distribution. What was the missing piece, you ask, that Ubuntu has finally aquired? It's mailing lists now have the ability to sustain a long and pointless discussion, containing a signal-to-noise ratio low enough to cause me to actively add filters into my mail setup to get rid of it (instead of JHD).

16 December 2005

MJ Ray: Revision Control Systems

"All revision control systems suck. This one just sucks less."
That's roughly what I'll say when I find one worth it. I've used rcs, cvs, svn, prcs, tla, arx, monotone and probably some I've forgotten. They all suck, in different ways. I'm now really reluctant to install a new revision control system unless there's a clear benefit. Matthew Palmer:
"Subversion is the One True Revision Control System and we should all just Stop Worrying and Learn To Love The Handcuffs"
Current target of my wrath is subversion, the lardy cake of revision controls. Over 5 times the footprint of CVS gets you atomic commits, but similar design problems with centralised servers and corruptable roots. Server choice is either a pserver-look one or an apache server with all the trimmings. The licence isn't even GPL-compatible, so forget about neat integration into some editors and development tools. Finally, if CVS is "extremely dead" despite its last release in October 2005, then SVN must be buried and rotting because it hasn't released since August. I tend to prefer distributed systems, especially when done well with standard protocols so that I can copy the archive somewhere close to me and work with it at relatively high speed, or off-line. It also gives the benefit that I merge when I want to, rather than being forced to choose between commit and branch. Centralised systems seem to make branching needlessly fiddly. Beyond that, I strongly prefer a system which can generate tarballs and patches (as far as possible) so that the rest of the world doesn't have to install the binaries (even if they can). That's about the base level of compatibility for now and any new tool should at least try to support it, even if the export loses some information. (I'm currently using a small shell script which just automates tarballs and patches, to help me move between my two computers here. I know it's only a 90% solution, but it's one I understand and can put some faith in. I need to have faith in my RCS. I like little less than losing work. Next step is to automate updates and merges, rather than doing them by hand.)

13 December 2005

Matthew Palmer: Diversity in Revision Control

Josselin Mouette has thrown down the gauntlet -- Subversion is the One True Revision Control System and we should all just Stop Worrying and Learn To Love The Handcuffs. In particular:
[...] just use subversion, and if you feel it's missing features, please contribute them. By standardizing on subversion, we lower the barrier for people wanting to contribute, instead of increasing it by asking them to install and understand new tools.
Quick thought experiment, Josselin: replace "subversion" with "Java". Or "Perl", or "C", or even "Python" or "Ruby". Or any other language. It doesn't matter which one. Even if the language you substitute is a good one, and one you happen to like, it's still a fairly obviously braindead idea -- that there can possibly be One True Programming Language for all problems, and that there can never be any improvement that can't be bolted into the existing OTPL. Revision control isn't so much different from programming languages. Different systems will provide different advantages and disadvantages. There's also incremental and revolutionary improvement that will take place over time -- machine code to symbolic to procedural to object oriented -- that can never take place within the established framework. I happen to really like the distributed model -- it reduces (though, naturally, cannot eliminate) the division between the Blessed and the Peons in a project (those with direct commit access vs. the rest of us). You can get disconnected operation for (almost) free. Also, despite the assertions contained in your article, the "barrier to entry", ironically, is actually lower with a good distributed RCS than with Subversion. The barrier isn't what you think, though -- sure, using an unfamiliar RCS is troublesome, but it's a lot less hassle than learning a new language, and people do that on occasion to hack on a particularly interesting problem. The real barrier to entry is forcing anyone who isn't blessed with direct access to The One And Only Repository to use inferior development support tools. "An example!" I hear you cry. Gladly. This morning (literally) I got enough of a handle on the internals of Ruby on Rails to actually track down a bug that was irritating the crap out of me. Being a good developer, I wanted to use revision control to track my changes. In the All Subversion, All The Time "utopia", that would involve getting an anonymous checkout, making a copy, hacking on the copy, then (when all was done) running diff -urN between the original and the copy, and sending it all upstream with a manually-created log message (assuming I could remember everything I'd done). You also need to manually remember (or encode it in your directory or something) the source of your tree, so upstream can merge it reliably (and compare it against other equivalent work that may have been done in the meantime). Doing it better, I could do an anonymous checkout, and then import it all into a new Subversion repository (or directory) of my very own, and hack on it in there. Benefit: revision control of my changes. But it's non-trivial to create a new repo and import everything into it, and there's still no automatic record made of the upstream source of my new repo. Wanting to make a second change is even worse -- I either have to make a whole new copy of my source tree (disk is cheap, but this is getting silly) or just keep forging ahead with changing my existing tree -- so this second set of changes can end up being dependent on the first (which is Not So Great if upstream don't merge your first patch). In the "new repo" scenario, you can branch from the root of your new repo and continue hacking on your newly created branch, which is a good start, but it's still icky. And good luck having the system track new commits from upstream while you're working, too. If the project was using a DRCS, in contrast, the problem would reduce to making a branch into your local archive, hacking (committing at will), updating with new upstream commits as you go along, and then publishing your changes to a public place for reintegration (or, in some cases, sending your changeset via e-mail). Oh, and before anyone starts screaming "if anyone can branch, it will encourage forking!", consider which is more likely to result in a permanent fork (rather than a temporary independent line of development): a local set of changes in a tarball or local subversion repo, both of which are hard for anyone else to collaborate on without major pain; or a branch in a simple-to-publish (or push) designed-to-be-shared DRCS archive, which automatically keeps all of your interesting metadata intact and coherent across archives, merges, time, and space (and possibly even dimensions). This utopia doesn't really exist, and is hampered by everybody having their own Pet DRCS, but the problem, I'm fairly sure, is transient, and my main point isn't even so much against the choice of Final Ultimate Solution, or even the problem space, but more about the attitude that everyone should get behind Any One System and stay there. I can't imagine the world of pain we'd be in if Josselin had posted his message a few years ago (but with s/subversion/CVS/i, naturally) and everyone had followed his advice -- can you imagine per-file changesets with no effective merge capability for the rest of eternity? <shudder />

Next.

Previous.