Archive for the 'Culture' Category

Feb 01 2010

The Baroque Cycle in its entirety: wonderful

Published by Dougal under Books, Reviews

After however many pages and words and months I finished reading the last volume of Neal Stephenson’s Baroque Cycle, The System of the World. Back in August I was effusive with my praise of part one but never got round to saying anything when I finished part two (The Confusion). So let this entry mark as my feelings on both.

Brilliant! Read them now!

Ahem. The two books that comprise The Confusion are the intertwined tale of piracy on the high seas, and political intrigue in the court of Versailles. They follow on from the events of Quicksilver though many other characters drop out and others become more important. It’s in The Confusion that many of the important links to Cryptonomicon become obvious — many of the family names which appear in that latter book first make an important appearance here — the Hacklhebers, Gotos and so on. It’s also in The Confusion that Stephenson lets his nerdy side really come to the fore. The chapter about the creation of phosphorous from urine was exciting and informative and hugely enjoyable — all that from chemistry, you ask, but it really was damn good reading.

The events which unfold at the very start of Quicksilver aren’t mentioned again for the remainder of Quicksilver and the entirety of The Confusion. All that is basically flashback. The thread is picked up again in The System of the World as one party attempts to reconcile the deep philosophical rift between Newton and Leibniz while another attempts to sabotage Newton’s work at the Royal Mint. Again we’ve got political intrigue combined with stunning action sequences that would overwhelm the audience of most heist movies.

Rather unusually for Neal Stephenson he manages to end everything too. Maybe given 2500 pages of writing he has finally worked himself into the right position to pull it all together. His other books have disappointed me on the last page, but I was very thankful that such an epic series ended right.

Make that investment! Read these books!

No responses yet

Jan 31 2010

Crappy shortbread recipe disaster!

Published by Dougal under Books, Food

We’ve had so much success with recipes in the last few years that it’s sometimes easy to forget that some recipes are useless through and through. If you’re not very familiar with the general idea then it’s easy to get dragged far from the path by a instructions that are confusing or just downright wrong.

That’s what happened to me last week when I tried Scrummy Chocolate Swirl Shortbread from the Green & Blacks Chocolate Recipes book. I couldn’t really remember what the process for shortbread was so I just followed the instructions and ended up with something useless quite demoralising. I later checked Delia and James Martin’s respective recipes for shortbread and confirmed that the recipe in the Chocolate book is utter bobbins. Compare:

  • Cream sugar into butter, then add flour.
  • Mix dry ingredients then rub in butter.

The first one gets you a stiff dough, the second ones gets you breadcrumbs. And at that point there’s not much you can really do to pull it back — it’s not easy to decrumb crumbs.

I’ve just tried again, ignoring the mixing process they suggested in favour of Delia Smith’s instructions, and they seem much better. They’re cooling at the moment. Now I get to revisit the original recipe and mark it up for future occasions. I’m not sure if I should write proper instructions, or just score the whole thing out with “Wrong! Consult Delia!”. That would be more satisfying.

2 responses so far

Dec 23 2009

James Cameron’s lost the plot but found the 3D glasses.

Published by Dougal under Films, Reviews

We got to see James Cameron’s new epic on Tuesday night, Avatar in 3D.

The three-dimensional aspect was very well done — much better than Beowulf in 3D which was hampered by terrible graphics. It looked fabulous and, who knows, maybe the added depth helped to make the action clearer.

Unfortunately the plot was fairly boring and the characters were about as shallow as it’s possible to get. In fact, it was largely the characters from Aliens — including Sigourney Weaver herself — fighting the Corporation and their unethical ways. They had a knuckle-head military guy, who appears to be a subtle blend of Duke Nukem and Kilgore from Apocalypse Now. No, I tell lie, there was nothing subtle there at all. They had a sleazy company guy and they had a mining operation set up to gather Unobtainium. I couldn’t help but snigger that they actually called their precious metal unobtainium. I wonder if they use it to make MacGuffins?

One response so far

Nov 23 2009

Jane Eyre (and some closure on The Eyre Affair)

Published by Dougal under Books, Reviews

I read Jane Eyre and now I finally understand The Eyre Affair. The “original” ending in The Eyre Affair is not the real one, and the one which gets created is the real one (to some approximation: there are no time-travelling super-villains).

I was getting worried as the book went on because it seemed so much like the rubbish ending from The Eyre Affair was going to be the real one. That Jane really was going to India to be a missionary’s wife to the detestable St John Rivers. But she pulls it back from the brink.

So now that I’ve thoroughly spoiled the book for you, what’s it actually about? Well, it’s your standard fare of feisty young lass being brought up by an aunt who hates her. She’s sent off to school to have some docility and meekness beaten into her, which thankfully doesn’t work. Then there’s stuff about growing up and falling in love. It sounds bland in these terms but it’s pretty riveting when you’re inside it.

2 responses so far

Nov 12 2009

Microserfs by Douglas Coupland

Published by Dougal under Books, Reviews

I picked up two books at last month’s book group but it’s taken me a wee while to get through this first one. It wasn’t the rollicking read I was hoping for.

Douglas Coupland’s Microserfs is about a group of programmers in the early 90s who leave Microsoft for a Silicon Valley startup. It’s populated by the usual nerdy stereotypes — bearded millionaires, basement dweebs, greasy marketing guys and social misfits.

microserf (day 99)
microserf (day 99)
© Jenny Spadafora

Tragically, none of it seems remotely interesting. All these smart people say nothing very interesting at all. The computer game which they create is not very interesting. Nothing very interesting happens to them in the creation of the game. It reaches completion without any hitches or even much in the way of work, as far as I can tell.

Along the way the characters have uninteresting conversations about… well, anything that strikes their fancy. As long as it remains uncontroversial and shallow they’ll talk about it — TV series, junk food, roads and buildings. But if there’s anything to be gleaned from these conversations it’s probably wrong. Even the one topic of conversation you would assume the techies could manage, computers, remains strangely beyond them. Who could seriously say something like “your body is your hard drive” who knew what either was?

The book is written as a diary, interspersed with pages of stream-of-consciousness word association. Nothing else irritated me quite as much as the word-association pages, because nothing else was quite so explicity saying look how goddamn deeeeeep I am.

In the last dozen pages the shallow characters of these people is thrown into stark relief, as something truly emotional and affecting happens. This really just illustrates how pointless the previous couple of hundred pages was, as we really know nothing about these people other than their ability to make dull conversation.

If you want to compare this tedious nonsense to something that is at least a real diary of a real programmer at a real startup, Jamie Zawinski has published diary excerpts from the early days of Netscape (then Mosaic). He at least mentions the programming once in a while.

So, now that this disappointment is over I’m going to start something which has been recommended by more people, Jane Eyre. This will also help me to put another recent book into its proper context.

One response so far

Oct 15 2009

First thoughts on new Arborise album

Published by Dougal under Music, Reviews

One of the great discoveries we made when we saw Thea Gilmore live was her support act, solo acoustic guitarist Dan Arborise. I bought his album Around in Circles at the merchandise stall because I was particularly taken with his song To The Sea. It is a really beautiful collection of songs which I can totally recommend.

I bought his second album for Helen’s birthday. It’s called Of Tide & Trail. I haven’t got totally inside it yet but it seems a bit more vicious than his previous disc. Some swearing and pointed lyrics in songs like You’ll All Get What’s Coming To You. You have to listen carefully to find them though: on the surface it’s still beautiful music.

Of course you could say the first album wasn’t short of shocking thoughts: “what do you do when you find that everything that you’ve been taught to love is a lie?”.

3 responses so far

Sep 27 2009

Bad movies

Published by Dougal under Films, Friends, Reviews

Last weekend Mat invited us round for an evening of bad — nay, terrible — movies, centred around his bargain purchase of Mega Shark versus Giant Octopus. We also saw a bit of Batman & Robin that was telly at the time, and I Know Who Killed Me, a horror movie.

Mega Shark really was as bad as we all imagined. The acting was just short of terrible, but the overall artistic vision was disastrous. It’s amazing how many “armed guards” there were in this movie, standing in the background in laboratories and offices, all wearing dark glasses despite the moody lighting.

I took particular enjoyment from the “science” scene, in which the marine biologists mixed arbitrary liquids in test tubes until they found that right combination that luminesced. (Don’t worry, it wasn’t all taxing science in the laboratory: there was time for a sex scene in the supply cupboard. Unusually, it’s legitimate to say that it was a necessary part of the plot.)

The shark and octopuses were a bit lacklustre. I was hoping for some old-school giant rubber tentacles reaching over boat decks and maybe some stop-motion or something. Instead we were treated to the same three clips of shark swimming, shark fighting octopus, octopus swimming, in various combinations. It was just like watching Saturday morning cartoons again.

The sizes and capabilities of the monsters are ludicrous to say the least. How fast does a shark have to be swimming when it leaves the water in order to overtake — and maul — a cruising 747? Answers on a postcard.

The title Mega Shark versus Giant Octopus doesn’t hide any aspect of the film from you. It’s exactly as you imagine. I Know Who Killed Me is another daft title but this one was apparently meant with all sincerity. Lindsay Lohan is abducted by a serial killer and then Lindsay Lohan turns up a few days later claiming to be a different Lindsay Lohan but bearing all the wounds which identify this particular serial killer.

This film wasn’t as bad as I expected. I don’t know if that’s because of drastically lowered expectations, or whether the elements of goodness shone through the rubbishness. Lohan did win two Golden Raspberry Awards for it, tying first and second place for Worst Actress, which I think is a bit harsh. She was far from the worst thing about this film.

Last night I saw a pilot for a modern version of the 80s classic Knight Rider. It was about as rubbish as you’d imagine, though the Hoff got a little cameo as the main dude’s absent father. And they ended on the original theme tune. But the rest of it was still crap. Reimagined, reworked and rebooted series can work very well — see Star Trek: TNG, Battlestar Galactica — but the real work is not done by the computer graphics people. You need good stories, believable plots, interesting characters! Wikipedia reveals that the series had one (shortened) season and was dropped. Hardly surprising.

I’m looking for more so-bad-it’s-good movies if you have something to recommend(!). Fixed in my mind is Battlefied Earth. Any others?

2 responses so far

Sep 16 2009

ComicBake 0.0 sneaks out the door!

Published by Dougal under Culture, Programming

It’s not what any sensible person would call usable, but I’m now announcing the appearance of ComicBake, which is what I’m calling my app for creating web comics.

ComicBake is a CLI tool for making web comics. I shall demonstrate a quick example to let you understand. (This example also appears in the source repository so you can actually recreate it too.)

Example Comic: The Conversation

The first thing you need is an image, preferably with characters who can do some talking. I’ve chosen this image from Flickr of two people having a conversation. I don’t know who they are but it’s a nice photo and it’s suitably licensed so I can manipulate it as I please.

Then you need a script file which tells the compiler all about the action in the scene.

-- A Conversation
-- A Series of Examples
-- 05 September 2009
-- Dougal Stanton
 
-- Photo CC-licenced from:
-- http://www.flickr.com/photos/clairity/154640125/
 
Scene 1. <scenes/conversation.png>
 
Woman: This is just a simple demonstration.
 
Man: Is that because it breaks
     with anything longer?

Ignore the first half-dozen lines as they’re just commentary (though I plan to use them in the future). The important points to note are:

  1. The scene description (including file path to image)
  2. The dialogue.

There are two characters here, and we can easily tell who is who but the computer needs more help. Next up is an image map, which associates names with co-ordinates:

<img src="conversation.png" width="500" height="306" border="0" usemap="#map" />
 
<map name="map">
<!-- #$-:Image map file created by GIMP Image Map plug-in -->
<!-- #$-:GIMP Image Map plug-in by Maurits Rijk -->
<!-- #$-:Please do not edit lines starting with "#$" -->
<!-- #$VERSION:2.3 -->
<!-- #$AUTHOR:Dougal Stanton -->
<area shape="rect" coords="46,29,108,88" href="woman" />
<area shape="rect" coords="426,9,494,73" href="man" />
</map>

This is just the raw file produced by The GIMP when you use its HTML image map feature. The link name for each area (href="...") doubles as the character name. Thankfully you’ll only ever have to do this once for any given image.

Pull all that together and you get:

Getting it, Using it

The code is in the usual place:

darcs get --partial http://www.dougalstanton.net/code/comicbake

To build it use the cabal-install tool. This sets the default install to be your home dir rather than system-wide:

cabal configure --prefix=$HOME --user
cabal build

That should get all dependencies except for gtk2hs+cairo, which is a real pain and something I’m planning to abandon before long. The best bet is to see whether your distro has a package for it…

Running it is simple. It only take one argument, the script file. So if you want to execute the example script:

./comicbake example/conversation.script

This will save a frame1.png into the current working directory.

Bugs

I’m still in active hacking at the moment — not even really alpha as it’s a bit of a mess. But I figured that if I didn’t release something now I would forget about it and it would disappear eventually. Which would be a shame because I think it’s quite a neat idea with some interesting potential.

  • The most obvious problem is that if you give it anything more than a couple of speech bubbles to place it can’t find space for them and bails out. The error message you see will be: Prelude.head: empty list. This needs sorted.

  • The Diagrams package I’m using is not as suited to the job as I’d hoped, for two reasons. One is that I can’t know how big my speech bubbles will be before I place them, so I’m using conservative guesswork which has so far been quite successful. But it’s not a solution.

  • The other problem is that accurate placement of the resulting objects is something that the Diagrams package doesn’t do very well. It doesn’t think in terms of absolute pixel sizes, so things tend to grow and shrink depending on the space needed.

  • There are a lot of similar-looking tuples littering the code which should be more strictly separated. It would make the code easier to read and reason about, and the type checker would help me more.

The first thing I need to do is sort out my bubble placement algorithm which is clearly not as effective as I’d thought. Then I’ll be replacing Diagrams with GD, I think.

After that there are “to do” items which may happen if it falls easily into my schedule.

  • Neaten up the script parser some more to allow multi-paragraph speeches and some unnamed characters to represent narration or offstage voices.

  • Make the script preamble more explicit. At the moment I don’t use the author’s name or date or any of that stuff yet but it’s there for the future. It would be better if they existed as named fields rather than just being free-form.

  • Write a proper parser for the image maps. I’m currently depending on Neil Mitchell’s TagSoup library for simple HTML parsing. But as I’m already using Parsec elsewhere it seems foolish to depend on them both. Why take two parser frameworks into the shower?

  • Proper command line support. Multiple arguments, let the user choose filenames, maybe some help or useful error messages.

Later on there are some things which I would really like to do. These are actual features which are pretty neat:

  • Stitch the various scenes together in some formation, eg 2x2 or 3x1, so they can be published as a single unit. The author name and comic strip title obviously become more important at this point as it brings all the images together into a story.

  • An alternative that is also pretty good is converting the same story into a flickbook comic, using anim gifs or similar to show the progress.

If anyone has any good ideas just say so! Also if you want me to actually explain how it works I’ll make a detailed post later. Hopefully when it’s closer to working! :-)

8 responses so far

Sep 07 2009

This is an excuse. I’ve been busy. Okay?

Published by Dougal under Culture, Friends

You see, this is why you should never announce intentions, never announce that you’re going to do something imminently because the only possible outcome of that kind of promise is that (a) you then find life carries you away to do a million other things and you have no time to do the last few things you meant to do or (b) you realise what a horrible mess you’ve made and dive back into the project in order to fix it.

I have been suffering a little from (a) and a little from (b) this weekend. Thankfully I’ve got Monday and Tuesday off work in which to make some amends, though really I’m using that time to whip the house into some neater shape for The Student, and tomorrow we’re away to Glasgow. I’m managing to snatch minutes here and there and I’m slowly getting close to something I’d be happy to release.

Last night was the final night of the Edinburgh International Festival, with a concert and firework display above Princes’ Street Gardens. We had Kate and Ben around for dinner and we peered out the window at the fireworks, listening to the performance streamed from the Forth One website. Unfortunately there’s a row of chimney pots that block a good chunk of the view, so we could only see the top half of the higher explosions. (So we couldn’t see the waterfall, but it’s always rubbish I think anyway.) Hilariously the radio stream was several seconds behind the display. At one interlude the radio commentator was still talking while the first fireworks exploded in the distance. I wonder if that was a special delay for those using the intarwebs or if the radio was also slightly behind.

Meal was good though and we had good chat. Kate and Helen had a knitting session while Ben and I looked on, slightly aghast. For the first time that I remember we managed to get everything prepared ahead of schedule and weren’t fretting as people arrived. We must be grown-ups now. Maybe I should start keeping stamps in my wallet.

4 responses so far

Sep 04 2009

It’s like a comic for people who can’t draw

Published by Dougal under Culture, Programming

I discovered Dinosaur Comics a few years and I think it’s great. It’s a bit strange but you soon get used to the idea. The scene is always the same from comic to comic but the dialogue changes. (Sometimes this repetition is even mentioned in the stories.) Dinosaur Comics is not the only comic in this style, but it’s the first I read and the only one I come back to regularly.

I wondered how these comics were constructed. Most of the comic writers who do this use graphics programmes — Photoshop or Inkscape or something similar. I got to wondering if all that overhead was necessary. The only real changes from episode to episode is the text, which can surely be written just as well in a text file as anywhere else. Is there not a program that can insert today’s script into the scene?

(Now I fully admit that there is a great skill in lettering and bubble placement when making comics. But something I have come to notice recently is that something which is 90% of the way there, or right-on 90% of the time, can be incredibly useful. And let’s not shoot down this project before it’s really airborne, eh?)

Speech Bubble
Speech Bubble
© Alper Çuğun

I did a bit of search and found some fascinating work, but nothing that seemed to come close to what I was thinking. The coolest thing I did find in the right area was automatic film-to-comic translation research. Using the screenplay and the movie side-by-side, the researchers’ program could extract relevant frames from the movie and place the correct dialogue in speech bubbles next to the actors. One of the authors has written an excellent page showing what their program does and has example scenes from a number of mainstream movies. Naturally, no source code is published. :-(

I decided in the end that any prior art on this subject was too well-hidden for me to find with Google. There were many fits and starts. My first attempts were almost immediately shelved because I was attempting to interface directly with Cairo to draw text and speech bubbles onto images. As nice as Cairo is, it’s not the right level of abstraction for this job.

Later on Brent Yorgey started his Diagrams project, building a functional combinator approach to drawing. This was exactly the approach I needed to get started, and I made some contributions so that it supported text. My sincere thanks to Brent for unwittingly kickstarting this project. I spent some time playing around with Diagrams and getting a feel for the best way to do things. I made a number of examples which could draw speech bubbles and place them on images at some desired location.

After a lot of thinking, and producing altogether too many doodles to be considered healthy, I finally got down to some serious procrastination. My problem was that I didn’t know where to start — I couldn’t see what shape the program was meant to be, and I didn’t work it out for a long time. But since I’m getting close to actually releasing the first version, I can say a good deal more about the structure and construction of the program.

First of all, it does indeed create “comics” out of written scripts. That you can be assured of. To create a three-panel comic strip you will need:

  1. A script with three scenes.
  2. At least one image, referenced in the script, which depicts the “scene” in the comic strip.
  3. A file which gives the co-ordinates of any characters that appear in the scene.

I apologise for the requirement (3) but it’s best way that I know to ensure the speech bubbles can be attached to people in the scene, and to make sure bubbles don’t land in middle of a person’s face. And the idea is that you only have to write this file once. It will always be true for that image. I’ve also made it slightly easier because the parser expects the actual co-ordinate data to be in the form of an HTML image map as exported by any number of graphics programs. You can load your images into The GIMP and save out an image map with each character boxed and tagged. It’s cheap and it works.

On the inside it’s modelled pretty like a compiler. The source file is the script file which is pretty close to the script you’d find for a stage or screenplay. There are a number of obvious differences — specifying filenames, for example — but I’ve tried to minimise the amount of non-story-writing an author would do on a regular basis.

Found
Found
© Alan Woo

The script is loaded in and does two separate things. First it reads through the script itself, noting down the names of characters and everything that they say in each scene. Obviously we want to know what the characters are saying, but knowing who is in a scene is also important. The program finds all the background images whose filenames are stored in the script. At the moment I can only handle .png files but this may change. It then looks for a .map file with the same name and loads that to see which characters appear in that image. If there’s a speaking character in the script who doesn’t have a location in any of the images we have a problem! So it’s important to know who we expect to find and to know that it’s accurate.

All along the way we’re noting down all this information for each scene — who is speaking? where are they? what are they saying? Once we know all this we can start placing speech bubbles around these characters. The canonical method of placing speech bubbles is left-to-right and top-to-bottom (I presume this changes for other languages which read right-to-left or vertically?) so we try that in a very simple way. We create a big margin around every character, like a thick frame, which is where bubbles can be placed. Each time we place a bubble we make sure that previous bubbles are placed “above” or “left” of the current location to keep the sense of the conversation.

Lastly we convert all this abstract data of locations and text and images into concrete files, which are written out to disk: frame1.png, frame2.png, frame3.png. At time of writing there are a few annoying problems, the most important being the bubbles have really rubbish tails. Creating good speech bubbles programmatically — and pointing the tails towards the speaker — is a problem I have not solved. The bubbles are a bit crap right now.

I hope to publish the code and some examples within the next couple of days. Look out for it!

2 responses so far

Next »