Sunday, August 31, 2008

Gnome/Firefox tip: Pandora as a Separate Application

The problem: Pandora is more like a desktop application than a website. It should stay open when you close your browser. If you do web development, or your browser tends to crash a lot, or you just like to close Firefox sometimes, you probably don't want to lose your tunes. Figure out a way to keep Pandora open when the rest of your web browsing session is gone.

This is a walkthrough for Gnome/Compiz users for isolating Pandora from the rest of Firefox cleanly. Much of this will be applicable to you if you don't use Compiz, and even if you don't use Gnome.

This assumes Firefox 3.0.1/Linux, I can't vouch for command line options on any other version.

When I refer to your Default Firefox Icon, I am talking about whatever means you usually use to launch Firefox, whether it's a toolbar icon, a menu icon, Alt+F2 "firefox", etc.

Create a Clean Pandora Profile

Start by shutting down all instances of firefox completely. Then bring up a Terminal window and type:
firefox -no-remote -ProfileManager
You'll get the small Profile Manager window. Create a new profile, named 'pandora'. You may, if you wish, clean it up. I did all of the following:
  • moved all the controls to the menu bar line at the very top (right-click a blank space and "customize...").
  • hid all the toolbars.
  • edit > preferences and changed the homepage to http://pandora.com/
Now quit from that firefox window. Once again, run:
firefox -no-remote -ProfileManager
Firefox makes your latest profile the default in all situations. To fix that (you don't want Pandora as your default browser): Select 'default' (or your original profile) from the window that just appeared, and let firefox open. Now your Default Firefox Icon won't open Pandora.

Make a Launcher

Right click on your Gnome menu panel, and "Add to Panel..." Select Custom Application Launcher. Enter the following:
  • Type: Application
  • Name: Pandora
  • Command: firefox -no-remote -P pandora
  • Comment: Opens in a separate Firefox process
(Only the Type and Command must match what I show above.)

Leave that window open for now. Re-launch Firefox using your Default Firefox Icon.

Let's get a pretty icon for the launcher you're about to make. In Firefox, visit:
http://pandora.com/favicon.ico and save the file as ~/.mozilla/firefox/*.pandora/pandora.ico

Now, go back to your New Launcher window (you didn't close it, right? :) and click on the springy-looking icon to change the icon. Choose the icon file you just saved as your icon. Now finish/OK until you are out of the New Launcher window and you have a new launcher.

Bonus Compiz Step: Place Windows Support

The Compiz "Place Windows" plugin lets you put windows on a particular workspace automatically. I want Pandora windows to automatically be placed on desktop 8, and other Firefox windows to automatically be placed on desktop 3. This was the trickiest part of the entire process.

This isn't an explanation of how to use Place Windows (find that elsewhere). This is an explanation of why using Place Windows for the tricked-out Pandora profile is difficult, and how you can fix it.

Problem: Compiz requires you to identify the windows you want to place by window Class, Name, Title, Type, or a few other things. For all firefox windows, Class, Name, Type and so on are the same; so if you want some firefox windows to go one place and some to go another, well, you can't do that with Place Windows unless you can differentiate them by title. But firefox always starts with the same title: "Mozilla Firefox". Compiz only looks at the initial title when it tries to place a window.

Solution: A plugin called MozFox. This is a version of FireSomething, that plugin that lets you randomly name your browser "Fireslug", etc. Bring up your Pandora profile using your new launcher icon, and visit the link above. You will have to create an account and log in there because this is currently an "experimental" plugin.

Install the plugin, and let the Pandora profile restart. When it comes back up, Tools > Addons > MozFox > Preferences. You will have to manually delete everything in the three lists. (You can select multiple to delete at once, then right-click and "delete". This is a pain in the butt.)

Add to each list: "Pandora", "Fire", "fox".

Now in the Place Windows plugin, set it up to match "title=Pandora.*". (You must have Regex Matching on.) Close out of that window, and restart Pandora. When it comes back up, Compiz will automatically position it where you told it to go!


Friday, June 27, 2008

Goonmill - seeking art

I am moving into the final phase before a first release of Goonmill. I am seeking art for any of the monsters found in the D&D 3.5e SRD.
  • The art must be CC-licensed, public domain, or otherwise free to distribute for any purpose. If CC licensed, it may be of the 'attribution' or 'no derivatives' types, but it must not be 'non-commercial'. Goonmill is arguably a commercial effort, even if it is open source.
  • The more uncommon the creature for which you found art, the better. I think I can cover orcs, humans, goblins, human skeletons, human ghosts, and human zombies pretty easily. Variations are welcome.
  • You may of course contribute your own art to the cause, as long as you are willing to license it compatibly.
  • Honestly, I'm not that picky about quality or style at this point. I am looking for 2d art, not models, though. Feel free to render your models to 2d art.
  • Prefer an isometric viewpoint, but not required.
I am collecting this art for use with the D&D 3.5 SRD monsters. It will be released freely once collected. Goonmill will use it as part of the application, but in addition the entire database of art and creature stats will be available for use in other applications or for any other purpose. The "any other purpose" part is why the art must not be CC-NC licensed.

Monday, June 23, 2008

Spam subject lines: A positive sign?

Actual spam subject line received today:
Obama grows great length through herbal supplements

I think it's fair to say that your candidate is viewed in a positive light when he is used as a symbol of male virility. I never got any "Kerry's dong will please your woman all night long", for example.

Thursday, June 12, 2008

Decipher is Hiring

Dear lazyweb,

If you want a job in R&D, and you have strong skills on all of the following, send your resume to the owner of this blog. (If you have any trouble finding the email address, it's on my resume, which you can find on Google.)

Skills
  • Javascript
  • CSS
  • Linux development
  • Python
When I say strong, I mean, you really have recent experience building web apps with those skills, in combination. We're in Fresno, and preference will be given to people who can work locally, but all resumes will be read.

We are Decipher, Inc.

Thursday, June 05, 2008

Greenpeace and Broadening Horizons

My stepson, Steven, is attempting to raise money for a semester learning from and about Greenpeace through their GOT program. While I don't agree with everything GP does politically, I do support him learning and broadening his horizons and, well, I am a Green party member so I support things that contain green in the name, or things that are green, or things that encourage greenness. Also, I like whales. :-)

Anyway, it's a serious program, and he's putting together a serious web presence to raise the money to go. He's also trying out Fundable on my suggestion, and I'd really like to see that succeed, because there's a few places I think Fundable could make a huge difference in this new, honor-system based economy we seem to be sailing into.

Thursday, May 22, 2008

Review: Rain-Slick Precipice of Darkness Episode 1

Completed the game. The first time through, it represented about 10 hours of gameplay for me, perhaps 6-7 for someone who actually plays video games often.

On a value-for-money basis, this is really good, especially when you include the enormous amount of value Penny Arcade has provided over the years; I bought this game without even downloading the trailer first, just because PA has earned that money either way. Then, after I completed my second playthrough, I realized that the value was pretty damn good. I may play it again; I will at least go back to my savegame and try to find all the hidden concept art. The game stands on its own merits, and I would have enjoyed playing it even if I didn't know much about Penny Arcade. It's a lot of fun.

Criticism


I have some criticisms, which I'll start with, but spoiler alert: they're all nitpicks. I'll try not to include any actual game spoilers here.

1) camera is somewhat frustrating at times. I always had the sense that there was some cool stuff offscreen that I could get to if only I could see it. It isn't that big a deal though; very rarely did I have any trouble seeing or navigating to the things the game needed me to see and navigate to.
2) pathfinding AI was basically nonexistent. You really only see this when you are trying to smash something to grab the combat bonus item inside, which you do by clicking on it so the player runs there. My guy couldn't figure out how to get there if there was something more complicated than a lamppost in the way, and not even that if the lamppost was right next to him. Oh well, it amounted to only a few extra clicks. I never got stuck anywhere, either.
3) It was a bit hard to navigate in some places, though. This was particularly noticeable inside Anne-Claire's room, where, to reach her, you must either smash a box or find just the right detritus-free spot on the floor to click on.
4) I wish it was longer. I just wanted to play it more. I would have paid double for a game 50% longer, and still felt it was a good deal. Fortunately, it comes in episodes! I cannot wait for the next episode, and I will purchase it sight unseen again. Based on plot points, I think there will be 4 episodes in total.

Combat


Combat is challenging and fun, requiring skill and strategy simultaneously. I'm not going to go into the details of the mechanics since there are plenty of reviews covering those. Timing is important, but not always critical; you can get by most of the way without catlike reflexes. There are lots of options at any point, and it definitely makes a difference which options you use in a given situation. For example, in many places, if you choose the wrong character to attack a particular enemy, the combat will be much more dangerous and take much longer. This is because creatures have particular resistances to certain kinds of attacks. In some combats, for example, Gabe will shine, while in others he will be useless as an attacker, so you use his turn to activate healing and items instead. The same also applies to which items you choose to use; some monsters have abilities that essentially nullify a particular item; but choose a different one and you can vanquish them quickly. So, to win the game, you have to explore all the combat options.

You also have to master the art of managing three characters at once, because if you waste time trying to decide what to do, the enemies will eliminate your opportunity to do it. This isn't too hard after the first level's worth of battles, though. The only thing really requiring fine reflexes was the 'block' maneuver, performed by hitting the space bar at exactly the right time in an attack sequence. The time segment you have to block is different for every enemy attack, and most enemies have more than one, so you really have to watch the animations and practice. You'll be an expert at this by the time you get to the last quarter of the game or so. (The final boss would be really hard if you hadn't mastered the blocking skill by that point.)

Exploration



The comparisons to ScummVM games are fairly accurate; the adventure portions of the game really feel like Day of the Tentacle, although not nearly as intricate. The puzzles are my favorite kind: the kind that aren't really that difficult to solve. I've always loved adventure games, but I've always been terrible at solving puzzles. I've lately realized why I love them: adventure games reward you for exploring, and I love games in which exploration is a big factor. I like poking around in all the odd corners of a game, and clicking on everything I see to find the hidden jokes and secrets. Besides the hidden "concept art" which supposedly unlocks a bonus comic, there are also items in the game which can give you combat bonuses but aren't necessary to complete the game, and even some hidden combats. At the risk of spoiling, I'll just say: if you get to the endgame with only T. Kemper and Anne-Claire as supplemental characters, you've missed something cool. :-)

Game Technology and Greenhouse



The game is out for 4 platforms simultaneously: PC, Mac, Linux, and Xbox. This is pretty cool; nobody releases major games for Linux, never mind for all of those platforms at once. As a software developer I appreciate the enormous difficulty they faced in accomplishing that; they obviously had to make some smart technology choices to succeed. I ran into technical problems using the Linux version (pulseaudio sound was flaky); I eventually worked around them (shut down all music players, and run with "aoss" instead). When I first encountered this problem, though, I just wanted to play. The multiplatform release came in handy here, and really demonstrated what I think will become the Greenhouse ethos.

I'm using a Macbook Pro, and I have Leopard on this machine as well as Ubuntu Hardy. So, I just downloaded another copy of the game, this time the Mac .dmg file. I already had my license key for the Linux version. After installing it on Leopard, I entered my Linux key, which Just Worked, and started the game up, and was playing immediately. Greenhouse let me download multiple copies of the game for free and use my key in all of them with no hassles whatsoever. Couple that with the simplicity of the initial purchase: You enter your credit card number, your license key displays in your browser immediately (and is emailed to you immediately), and the game starts downloading immediately. They accomplished that (apparently) most difficult of feats for online software retailers: they made the game easier to buy than to pirate.

Humor and Characters



It's a Penny Arcade game, so it really wouldn't be fair to review the game without talking about the humor in it. You can't talk about humor without killing it though, so I'll keep this section short. Here's the bottom line: if you like Penny Arcade, the game will be really funny. During the run-up to the game, the guys put up a massive .wav file to test the playgreenhouse.com bandwidth, asking everyone to download it--smart QA strategy. What was even smarter, though, was that the file was, in the style of their podcast, Gabe and Tycho talking about the making of the game. One of the topics they discuss was that Tycho had to write descriptive text for every damn thing you can click on, even the crabs littering the boardwalk. Well, the time was well-spent. Click on everything you see; you'll be laughing a lot.

The characters have great interactions with each other, and the dialog adds to the game, it doesn't detract. It makes a difference when game dialog is written by someone who writes for a living every day. Jerry Holkins' wit shines through in every conversation tree.

Conclusion



4/5 asterisks: ****_

As one forum denizen on Giant in the Playground said, "You can hit evil hobos with a rake so hard they literally explode. What could not be awesome about that?"

(Tycho just posted on the p-a site, saying "Thank you for letting me be your dungeon master." God I'm jealous.)

Friday, March 28, 2008

40,000 Coat Hangers

The court system put to its highest purpose. That is to say: hilarious entertainment.

Judge: Tell me, Mr Chrysler, do these businessmen of yours also have Gideon Bibles by their bedside at home?

Chrysler: Many of them, sir.

Judge: And where do you get the Gideon Bibles from?

Chrysler: Alas, they, too, have to be taken from hotels.

Judge: Then why are you not also up on a charge of Bible-stealing?

Chrysler: Because the Bibles do not belong to the hotels. They belong to the Gideon Society. And the Gideon Society has decided not to prosecute me, but to forgive me and tell me to go and sin no more.

Judge: And have you sinned no more?

Chrysler: Alas, no.

This really is stellar stuff.

Sunday, March 23, 2008

My second-favorite FF3 feature

Now that most of my extensions (with notable exceptions) support FF3 without hax, I'm going to start using it fulltime. My second-favorite* new feature: you can finally drag items in the Bookmarks menu. Yes, Firefox bookmarks have finally (nearly) caught up to IE5 boomarks in usability.

It's the little things that matter.

* My favorite, of course, is the greatly expanded SVG support, so I can continue work on Glass Vellum.

Saturday, March 22, 2008

iPod video for Linux

Google will tell you that you can convert video to iPod format in Linux using only VLC. When lots of people tell you something on the Internet, and post howtos, this is often a good sign that lots of people on the Internet are idiots. This is one of those times. None of the howtos worked; I was getting either a corrupt file or no audio. I am clearly not the only one, because every single howto I found that explained how to use VLC to transcode video, and there are quite a few, ALSO had commenters saying "um, the audio doesn't work".

I finally discovered a solution, though, so it's sharing time. Note that this is probably unnecessary if you just want to watch video podcasts, because gpodder works fine for that. For non-podcast video, you almost always need to do a conversion.

(Using Ubuntu, version HammurabiHardy Heron.)

For this meal, you will need these ingredients (aptitude install ..):

avidemux
avidemux-cli
vlc
faad
faac
(every gstreamer plugins package you can find in main or in universe / multiverse)
gtkpod-aac

The avidemux-cli package is optional; handy if you want to convert a whole directory full of files. Note that you are going to install vlc, because it is one of the few players that will reliably play back these files. You want it so you can test your output files before installing them on your ipod, but it may be considered optional.
  1. Open up the avidemux GUI, and open the file you want to convert.
  2. Select menu item Auto > IPOD
  3. Confirm that video is being encoded with XVID4. Optionally change the video bitrate to 1024 through the Configure button.
  4. Audio encoding will still show "Copy". Change it to "AAC". Confirm through the configure button that the bitrate is 128.
  5. Confirm that Format is MP4.
  6. Save. Encoding will begin.
Optional: Batch Conversion. When done, you may save this as a script with "File > Save Project As ..." which allows you to do this from the command line. However, I have already done the work for you. To run it from the command line, get the shell script and .js file from http://wiki.goonmill.org/AvidemuxScript. If you save the shell script as "mp4", you can run it in a directory of AVI files, as

mp4 *.avi

Test the converted file in VLC, making sure video isn't crappy and audio exists.

Now copy it to the iPod. You need gtkpod-aac installed for this, or you will get errors saying "compile gtkpod together with yadda yadda". The package gtkpod-aac contains a binary that is already so compiled. You can simply plug in the iPod, choose your model from the supported list in gtkpod, find the iPod in the tree at the left, pick "video inbox", and Add File there to add your file. Save to copy to the ipod, and Eject the ipod.

Saturday, January 19, 2008

Gibbon takes Leopard

My lovefest for OS X is over. I'm switching back to Linux. It isn't a total loss, but it is a complete burnout for a software developer like me. Some things I liked, some things I hated. . .

What's OK:

- Printing is pretty cool. I really liked that printers were so easy to install. OTOH, Ubuntu's printing stuff is almost as good; the only thing missing might be the icon that shows you what your currently-in-use printer actually looks like. Printers seem to be self-healing in OS X as well, which means that they keep working even when they change IP addresses (something that happens with my printer at home).

- FileVault. Encryption is done well up to a point. They succeeded in making it usable for the masses. Then they halfway-blow it! The screen saver and restart-from-suspend/hibernate do NOT require a password by default. So if you do what most people do and just shut the laptop when you're done using it, all that encryption is useless because your filesystem is always sitting around in plain text. FileVault should require you to password-protect those ways in.

- OmniGraffle. If they made a Linux version, I'd pay for it, and this is coming from someone who actually likes Inkscape already.

- iTunes + iPod is pretty damn awesome. Banshee is quite competitive, but to get the same package that OS X has on Ubuntu you need Banshee and gpodder. I like both of them, but they're not integrated, they don't work well with m4a feeds, so this is a clear Mac win, and no surprise.

- VMWare fusion. I love Unity mode for Windows. I don't really use it enough to keep it around, though. VirtualBox is a more-than-adequate replacement. It lacks snapshots but makes up in overall speed.

- Overall attractiveness. Yep, it's pretty. Ubuntu is about 90% of the way there.

- Um... the hardware? I really like the hardware. I just would rather have something else installed on it. OS X certainly comes with all the necessary MBP drivers, and all that hardware Just Works, so that's good. But it's not as if somebody couldn't do the same with a MBP-targetted Ubuntu distribution.


What's broken:

- Terminal. The tabs are horrible.. they won't display icons, they won't display the label of the terminal settings, they don't even obey the settings of Terminal.app itself. The terminal emulation is frequently broken. Readline is frequently broken. ANSI colors are broken. Terminal, you suck. By all accounts, the alternatives are worse.

- Python. For FUCK's sake Apple, this is an embarrassment. Either get it right or stop putting it on there by default. Why do I have to install MacPorts Python every time to work around missing extensions like _bsddb? Why do I get bus errors running simple things that work in Linux?

- Instant Messaging. Adium is the only decent multi-protocol option, and it doesn't support IRC and hides important options. Adium actually is pretty damn close, but it's not all the way there. XChat on the Mac is pretty crappy, and the other IRC alternatives were slow and worse.

- Graphics software. I refuse to pay for and use Photoshop. Aperture is shipped on Leopard as crippleware, I say no to that guerilla tactic as well. Gimp is a terrific piece of software, but it's unusable on a Mac. Yes, you can run it in X11, and if you tried to, you would know what I mean by "unusable".

- OpenOffice. See previous post. Oh my GOD this is terrible. I refuse to pay for and use standards-raping MS Office, which is NOT an improvement over OpenOffice in functionality or performance anyway, even in the best of cases (running on Windows XP, for example). OO.org works beautifully on Linux and on Windows; on OS X it vomits.

- Media playback and use. Linux just wins here. Apple has nothing to offer over, say, VLC, which is why I installed VLC on the Mac. It actually runs a treat there, BTW. Apple's software respects region coding and all that other DRM and related rights-restriction bullshit, and I refuse to play that game. VLC is able to redeem Apple here--I think. It remains to be seen whether I can do something fair-use-y like rip my DVDs to the hard drive and play them with VLC, or use VLC to play out-of-region DVDs, but I'm beyond the point of wanting to give OS X a fair shake on this one.


What changes to the OS X ecosystem would be required to win me back?

- Fix OpenOffice.org.

- Fix Python. This is an absolute dealbreaker for me.

I can put up with the rest of the problems, but those two are insufferable.

Friday, January 18, 2008

OpenOffice.org on the Mac is shit

  1. OpenOffice.org X11 version:
    1. Requires X11
    2. Actually launches an xterm with a shell session when it runs
    3. Makes you wait a minute before doing anything, then displays a useless "Command timed out" error message
    4. Then runs some Java stuff before finally starting up
    5. Doesn't take X11 with it when you shut it down
    6. Draws menus as window decorations instead of at the top of the Desktop where it belongs in OS X (well, that's an X11 app for you)
  2. NeoOffice:
    1. Utterly broken in Spaces. Won't let you assign it to a particular Space, it just launches wherever you are. Then, sometimes it won't even let you switch away from it, following you around like one of those web popups that just reopens every time it closes.
    2. Doesn't adopt OS X keyboard shortcuts (e.g. Alt+Backspace doesn't erase a word)
    3. Useless Aqua menu: just the NeoOffice menu item itself, not even so much as a "New > Spreadsheet" menu.
  3. OpenOffice.org Aqua version:
    1. All the icons are upside-down and pink
    2. The clipboard doesn't work, even though the last update said the clipboard was finally fixed
    3. By the way, the last update was July 2007.
Then, just to kick you in the teeth a little, all three of these use different directory structures under ~/Library for storing your settings, so if you're persistent enough, like me, to try all three for due diligence, you have to reinstall your settings each time.

And all three are slow.

I don't get it. OO.org is AWESOME on Windows. It blazes in Ubuntu. Why, despite THREE attempts, is it a steaming pile of shit on a Mac?

Sunday, January 06, 2008

My one and only political post

This is my "techie" blog, so I'm not going to spend a lot of time doing politics on here. In fact, I'm only doing one, this one, and I'm only doing it because I want to use this space to advertise my voter registration button. There it is, over to the left, go ahead and click it if you aren't registered, or if you've moved, or if you are currently registered as the wrong party.

I've been a registered Green for years, but I'm switching my affiliation to the Decline to State party for this election season. In California I'm required to either vote in the primary of my party affiliation, or if I have Declined to State, I may vote in any. I intend to remain a Green after this election, but I want to vote for Barack Obama.

The button is there for you guys. If you read this blog and don't consider yourself well-enough educated to get involved in politics, you might think you aren't up to the responsibility of voting. I think this is one of the biggest reasons people don't vote in this country; they are aware that it is an important responsibility, and they don't want to screw it up. (Witness Stephen Colbert's election coverage series, titled "Don't Fuck This Up, America".)

An informed electorate is important to democracy. However, I put it to you that, if you do register right now, you are far more likely to get informed. No matter how ignorant of the issues you are right now, if you take the 2 minutes to get registered, I know you will be more informed in a month, and even better informed still in November. You won't be able to help yourself. You'll start conversations with people about how you just registered, and they'll start talking to you about issues. Thus, the act of registration itself catalyzes a better quality of democracy.

Almost half of the primary elections are being held on Tuesday, Feb. 5, 2008, including California's primary. If you aren't sure, check this PDF calendar. Register, vote.

Thursday, November 01, 2007

Limerick Minute

I once knew a man who said, "Though
It seems that I know that I know,
What I would like to see
Is the eye that sees me,
When I know that I know that I know."

- Unknown

Monday, October 15, 2007

What is Goonmill?

I have written up a definition of Goonmill, so that application actually has a scope and we know when it's done. See the DefiningGoonmill page in the wiki.

It breaks the application into the user tasks you should be able to perform with a completed Goonmill.

Sunday, October 14, 2007

Vim: Run the current buffer as Python code

This uses the handy preview window feature of Vim. Flagging a window as a preview window is useful because you can use pclose! to get rid of it, meaning you can reuse that vim real estate over and over for commands that produce output, and the output has to go somewhere.

fu! DoRunPyBuffer2()
pclose! " force preview window closed
setlocal ft=python

" copy the buffer into a new window, then run that buffer through python
sil %y a | below new | sil put a | sil %!python -
" indicate the output window as the current previewwindow
setlocal previewwindow ro nomodifiable nomodified

" back into the original window
winc p
endfu

command! RunPyBuffer call DoRunPyBuffer2()
map <Leader>p :RunPyBuffer<CR>


<Backslash>+p is mapped to run the current buffer through a Python interpreter. The output appears in a new window below the current one.

The code to do this with another interpreted language, such as bash, is almost identical and left as an exercise for the reader.

Saturday, October 13, 2007

Thumbnails from SWF video

I don't know if this'll ever be useful to anyone, but it was information I needed, and it was extremely hard to come by.

Here's how you extract a thumbnail from an video stored in an swf file. I'll leave the apt-get install dependencies as an exercise to the reader.

#!/bin/bash
SWF="$1"
AVI="${SWF/swf/avi}"
JPG="${SWF/.swf/%d.jpg}"
flasm -x "${SWF}"
mencoder -endpos 5 "${SWF}" -o /dev/null -nosound -ovc xvid -xvidencopts pass=1:turbo

mencoder -endpos 5 "${SWF}" -o "${AVI}" -nosound -ovc xvid -xvidencopts pass=2:bitrate=1600

ffmpeg -i "${AVI}" -an -ss 00:00:03 -t 00:00:01 -r 1 -y -s 120x90 "${JPG}"


BTW, this also converts the SWF to an AVI along the way, so if that's useful to you, great. (Modify the endpos and get rid of -nosound if you really wanted the AVI.)

Friday, September 07, 2007

Substitute Reading List

It's been a bit in vogue lately for people to post their reading lists. I feel sad when I read them, because I don't have time to read any more, and I've always been a voracious and addictive reader until recently. So what does a person do when they can't read any more? They substitute something else. Sometimes what's been substituted gives you a new dimension to appreciate, and you end up feeling as satisfied.

Recently I have discovered the joys of podcast audio fiction, and I actually look forward to my drive to and from work every day, thanks to these. Here is my substitute reading list for the last couple of months:

Escape Pod - Every week, an amazing Science Fiction story via podcast. The quality of the stories ranges from the good to the utterly unforgettable, and it is always worth listening. I've listened to every single full and flash-fic episode, even going back through the archive to story #1.

Pseudopod - I am a huge horror buff thanks to my Dad's lifelong love of the stuff. Pseudopod is a spinoff of Escape Pod, so expect the same with a horror twist. The quality of stuff on Pseudopod is, if anything, of higher quality than Escape Pod, but maybe that's just my preference bias. I've never missed an episode of this show.

(BTW, I'm eagerly looking forward to Podcastle, another spinoff. You can probably guess the theme without clicking on the link. :-)

Eastern Standard Tribe podcast novel - I am a big fan of Cory Doctorow, and not merely because we have the same first name and last initial, spelled the same way. I haven't finished this podcast yet, but I'm hooked already. Be prepared to listen fast; Cory doesn't slow down, so you get a lot of story in a little time. :-)

The Corridor podcast novel - This one, I have finished. It's a thrill a minute, the writing is excellent, and the horror fantasy aspects are simultaneously imaginative and self-consistent, which is difficult to achieve. As if that weren't enough, Zan has one of my all-time favorite reading voices.

The Pocket and the Pendant podcast novel - This one is aimed at young adults and, while it is a bit less consistent than The Corridor, it is well-written, exciting to listen, and entertaining. Mark Jeffrey is also an excellent voice.

(Not podcast audio, but . . . : )

Flight, Volumes 1 and 2 - Graphic novel/anthologies. Absolutely stunning art, in dozens of rich and evocative styles. Tiny bundles of story on page after page. Volumes 3 and 4 are out as well, I will be buying them ASAP.

Tuesday, August 21, 2007

Goonmill repo from scratch

In case you hadn't guessed by my last Mercurial post, I screwed up my Goonmill repository. It's now back, with all the history intact but the one file I shouldn't have committed now purged.

If you have a checkout, please get another checkout, you won't be able to update your existing one.

We apologize for the inconvenience.

Announcing a Playtools Mailing List

I have created a list for Playtools users and developers.
(is also visible from the project's home page.)

I also added some branding to the Launchpad pages for both projects.

Sunday, August 19, 2007

Expunging a problem file from Mercurial repo

Mercurial is almost the perfect version control system: fast, lean, distributed, easily extensible and reliable. It works by copying an entire repository, compressed, every time a clone needs to be made. This is much more efficient than it may sound, and the time it takes to transfer a Mercurial repo is quite comparable to the time it takes to checkout a Subversion repository.

The only time the system breaks down is if you lose your head and commit a large compressed database to the repository. Since I'm still learning how everything in Mercurial works, I did this accidentally, and made several commits before I realized my repo was ballooning out of control due to this one file with only 7 commits.

Here's how you recover.
  1. Make sure you fix this before anyone clones your repository from upstream. The following procedure renders your repository unusable to anyone working on their own clone of it; they will have to clone a copy of the results and start fresh.
  2. Get a list of all the commits that changed your file.
    $ hg log -M -r0:tip --template "{rev} {files}\n" goonmill/srd35.db.gz
    11 goonmill/srd35.db.gz
    52 goonmill/srd35.db.gz
    59 goonmill/srd35.db.gz
    99 goonmill/alter3.sql goonmill/srd35.db.gz
    115 goonmill/srd35.db.gz
    160 goonmill/srd35.db.gz srd35.odb
    189 goonmill/srd35.db.gz
  3. Export the entire repository as patches; use hg export to extract each one to a separate file.
    $ mkdir ../Goonmill-revs; hg export -g -o ../Goonmill-revs/%r:%n-of-%N $(hg log -M --template "{rev} ")
    (Hundreds of patch files created)
  4. Delete the ones that you found in step 2. The reason I had you print {files} in that step was so that you could check to see if any other files would be affected by the new hole in the history. For example, my commit 99 above changes another file. Instead of deleting that revision, I will edit the patch so only the patch to the sql script is committed.
  5. "hg init" a new repository and use "hg import Goonmill-revs/*" to recreate.
You now have a new repository with the same revision history as before, but with your one problem file not contained in the repo history. Next time, commit that database uncompressed, because Mercurial does efficient binary diffs that don't work very well on compressed files but work great on uncompressed structured binary files like a database.