Archive

Archive for July, 2008

The Atrocity Archives

July 27th, 2008

I finished reading The Atrocity Archives by Charles Stross the other night so here’s my usual half baked spoilerific review:

The Atrocity Archives is like James Bond meets Yes Minister meets Shaun of the Dead. We join Bob Howard, a trainee field agent working for “The Laundry” as he battles zombies, tentacled monsters with a taste for brainz, demon possessed Nazi’s from outer space and accidental discoveries in computational number theory. Oh and he also has to brave the admin and accounting department as well trying to avoid being noticed by a spooky upper management ex-field agent legend with vampirish vibes.

I liked this book. It was funny, clever, engaging, fast paced and charming. The main character, Bob Howard is likeable, cheeky, aware of irony and balls-y.

I’m just trying to think of anything I didn’t like about the book and I’m coming up short. But don’t take my word for it. You can get a taste of what the book is like by feasting your browser upon the exciting (no really) new Tor website and downloading Down on the Farm which is a short Bob Howard adventure. (note that part way down the page on the left is menu from which you can download the pdf version and an audio version. Thanks Tor!!)

P.S. Checkout my library on librarything

[tags]bob howard, book review, charles stross, the atrocity archives[/tags]

books ,

Science Tech Device Generator

July 16th, 2008

I’ve been mucking about generating a list for some test code here at work. To keep myself awake, I’ve been amusing myself by using some Back to the Futureish words.

flux capacitor

Here’s the code in case you need to generate a list of dumb device names in C++.

    vector<string> adjective_wordlist;
    adjective_wordlist.push_back("");
    adjective_wordlist.push_back("Inductive");
    adjective_wordlist.push_back("Sonic");
    adjective_wordlist.push_back("Retroactive");
    adjective_wordlist.push_back("Photovoltaic");
    adjective_wordlist.push_back("Universal");

    vector<string> pronoun_wordlist;
    pronoun_wordlist.push_back("Flux");
    pronoun_wordlist.push_back("Vortex");
    pronoun_wordlist.push_back("Space/Time");
    pronoun_wordlist.push_back("Field");
    pronoun_wordlist.push_back("Dimension");
    pronoun_wordlist.push_back("");

    vector<string> noun_wordlist;
    noun_wordlist.push_back("Capacitor");
    noun_wordlist.push_back("Coupling");
    noun_wordlist.push_back("Maximiser");
    noun_wordlist.push_back("Virtualiser");
    noun_wordlist.push_back("Retroactivator");
    noun_wordlist.push_back("Confabulator");



    for (int ii = 0; ii < 100; ii++) {
        string label;
        int pronoun_idx = ((ii / (noun_wordlist.size() * adjective_wordlist.size())) + ii)
                            % pronoun_wordlist.size();
        int adjective_idx = ((ii / noun_wordlist.size()) + ii) % adjective_wordlist.size();
        int noun_idx = ii % noun_wordlist.size();
        label += adjective_wordlist[adjective_idx] + " ";
        label += pronoun_wordlist[pronoun_idx] + " ";
        label += noun_wordlist[noun_idx] + " Power";
        cout << label << eol;
    }

Quick! to the Delorean!

[tags]back to the future, C++, geekery, list generator, programming, word generator[/tags]

Uncategorized

The Execution Channel

July 14th, 2008

I finished reading The Execution Channel by Ken Macleod the other day so here’s my usual half baked review.

Overall I enjoyed this book set in a slightly alternative near future on the brink of World War III. In this version of recent history, there have been several terrorist attacks on the scale of 9/11 which have changed the world creating a paranoid surveillance state in the UK (the book is set in the UK BTW)

The two protagonists are caught up in a series of events that various government groups are trying to ‘handle’ but even they are not sure who is doing what to whom and why. By the end of the book I think I understand what happened.

Some good things about this book: The state paranoia and disinformation poisoning of online discussion is scary because it’s so believable. The use of terrorists as scape-goats is scarily real (i.e. the terrorists do bad things but then the government is able to blame everything on them). The execution channel itself is sinister and does a good job of scaring the willies out of the reader as well as the characters in the book. I also liked how the action is not over the top. At no point do the protagonists whip out semi-automatic weapons and start blasting the good but mis-guided cops and blowing up spooks in their black vans. There is action but it is done in such a way as to just create tension. In fact the overall characteristic of this book is the maintained sense of paranoia and near peril. One last good point was that the lessor characters such as the conspiracy theory blogger and disinformation cell were interesting and I wanted to follow them more (I hope they show up again in later books)

Some bad things: The conclusion of the overall plot was just too audacious to suit the rest of the book for me. I knew it would be something big but when the reveal came I almost laughed at the silliness of it. If the book had been kind of silly the whole way along I would be saying that it was totally awesome but in this case it fell flat. But thinking about it now I can see suddenly why it had to be that ending but I don’t want to say more in case I spoil it for people who have read Ken’s other futuristic books. My advice to Ken is that when he does the re-release of this book he should have at least one character on the other side so that we get a better idea of the magnitude of what is going to happen before it happens.

But overall, a rocking book that marks a change of direction for Mr Macleod of whom I remain a great fan. Next cab off the rank in my semester break book binge is The Atrocity Archives by Charles Stross.

[tags]book review, ken macleod, science fiction, the execution channel[/tags]

books , ,

Matt and Sol’s Favourite Things 02 – The Making Of

July 14th, 2008

Episode 2 of Matt and Sol’s favourite things (Robot edition) is available. The highlight is some animation using stop motion and a rubbery robot toy.

The spoken part of the video was produced using the Macbook’s iSight webcam. The animated clip was made in iStopMotion by importing 110 photos from my Pentax K100D DSLR. I perched the DSLR above a white background holding it still with a cardboard frame in which I cut a hole for the camera lens to poke through. The white balance is very bad possibly because I covered one of the camera’s sensors, I’m not sure. I fixed it up a little bit in iMovie which also cropped it rather heavily. I’ll have to sort out the aspect ratio so I get something compatible with Youtube for future efforts. I also looped some of the sequences in iMovie to flesh it out a bit because I only had about 9 seconds total at 12 fps.

Stop Motion

Soundtrack is “Harder, Better, Faster, Stronger” by Daft Punk (but off the Discovery album, not the Alive album as I may have misled you to believe)

[tags]animation, children, daft punk, dancing, imovie, istopmotion, robots, stop motion, toys, youtube[/tags]

Uncategorized

A day in the life

July 10th, 2008

I’ve been experimenting with my MacBook’s iSight camera and downloaded a trial version of iStopMotion which is software that does time lapse and stop motion photography to make animated movies such as claymation (think Wallace and Grommet)

Due to lack of imagination, I left the time lapse going with my computer on the desk at work and compressed a working day to 1 minute. In this clip, you can see me take a skype call on the MacBook, drink coffee, surf the web a little, go for lunch, have a conversation with a co-worker, take a phone call and drink more coffee. I’m not sure if you can see me getting more tired as the day wears on but I have realised how much I lean on my hand and play with my face all day!

iStopMotion is pretty fun to play with and easy to use. I captured the movie in iStopMotion and then imported it into iMovie to add the soundtrack and cut part of my lunch break which was a bit boring to watch.

The soundtrack is Mike Mills by Air from the Talkie Walkie album.

[tags]isight, istopmotion, macbook, time lapse, work[/tags]

Uncategorized

Laconi.ca and identi.ca

July 4th, 2008

Identi.ca is a twitter clone that runs on open source software called laconi.ca and will apparently be distributed instead of tied to the one host. More like the original blogging idea.

I’m checking out how locani.ca works by downloading and attempting to run it. I should be able to somehow tie my “tweets” back into the main identi.ca site.

Keeping an eye on this Evan who seems to be the brainz behind the operation.

So far, I’ve had to go to the UNOFFICIAL google apps mirror since laconi.ca is down. I had to get the code using svn.

The code is written in PHP which may or may not be a good thing depending on your specific religion.

Actually I just discovered you can get into the laconi.ca site if you know a deep link e.g. http://laconi.ca/Main/Source

To install the required pear stuff (see the tarball/docs/README):

mkdir pear
pear config-create /home/mypath/laconica/pear/ pear.config
pear -c pear.config install validate
# which told me to run the following instead because it is beta
pear -c pear.config install channel://pear.php.net/validate-0.8.1
pear -c pear.config install db_dataobject
pear -c pear.config install Mail
pear -c pear.config install Net_SMTP
XMPPHP
wget http://xmpphp.googlecode.com/files/xmpphp-0.1beta-r21.tar.gz
tar zxvf xmpphp-0.1beta-r21.tar.gz
less xmpphp/README
PHP OpenId
wget http://openidenabled.com/files/php-openid/packages/php-openid-1.2.3.tar.bz2
tar jxvf php-openid-1.2.3.tar.bz2

surf to http://testserver/php-openid-1.2.3/examples/detect.php and everything is ok.

wget http://oauth.googlecode.com/svn/code/php/OAuth.php

Markdown
wget http://michelf.com/docs/projets/php-markdown-1.0.1m.zip
unzip php-markdown-1.0.1m.zip
mv PHP Markdown 1.0.1m/ markdown-1.0.1m

Because I’m using a nonstandard PEAR path, I had to edit my extra_path thing and then copy the two lines (extra_path and set_include_path) to the top of lib/common.php as well.

$extra_path = array("/home/mypath/laconica/php-openid-2.0.1",
 "/usr/local/share/php",
 "/home/mypath/laconica/pear/pear/php",
 "/home/mypath/laconica/pear/pear/lib",
 "/home/mypath/laconica/markdown-1.0.1m",
 "/home/mypath/laconica",
 "/home/mypath/laconica/xmpphp");
set_include_path(implode(PATH_SEPARATOR, $extra_path) . PATH_SEPARATOR . get_inc
lude_path());

While you’re at it, you should set the ‘server’ and ‘path’ config options because otherwise you will be getting redirected to localhost all the time (which doesn’t work so well if you’re not running the browser on the web server).

Progress 1 Aug 2008:
<b>Fatal error</b>:  Call to undefined method XMLWriter::fullEndElement() in <b>/home/matthewsmith/public_html/laconica/darcs/lib/util.php</b> on line <b>104</b><br />

I need decafbad to come back online so that I can se how he got past this error.

more soon.

[tags]identi.ca, laconi.ca, microblogging, twitter[/tags]

Linux

Matt and Sol’s Favourite Things

July 3rd, 2008

Sol and I have started a TV show on YouTube called Matt and Sol’s Favourite Things. It will be a reviews kind of show and just something fun so that we can have lots of footage of Sol to use at his twenty first.

Episode 1 of Matt and Sol’s Favourite Things

[tags]matt, sol, youtube[/tags]

fatherhood

Bad Dream

July 3rd, 2008

Last night Sol woke us up crying about a bad dream. For the first time, I was actually able to get him to tell me what the bad dream was about. So what do you think a 3 year old’s worst nightmare is?

“Daddy, I dreamt that my DVDs weren’t working. They were broken.”

[tags]sol, nightmare, dream, funny[/tags]

fatherhood

Using Mercurial to Cure Vault Merging

July 2nd, 2008

The two major issues I have with Vault are that it doesn’t do the metadata in the working directory (making it very hard to change from various local copies quickly) and the merge feature is pretty hard to figure out. Having said that, Vault is 100000000% better than Visual Source Safe (or as it was last time I looked which is a long time).

I have recently used mercurial to merge two parallel branches of code by doing this:

  • Do a show history on the branch you want to merge and get the tree at the place where the branch was created (hint: choose the ‘show folder history by version’ option then click ‘get tree’)
  • Assuming you have samba’d your working directory onto a linux box, you now need to get the shell going in your working dir (lets pretend this dir is called branch1).
  • hg init
  • optionally edit up a .hgignore file but you should be pretty safe if you did a clean get latest (i.e. you haven’t compiled anything yet)
  • hg add .
  • hg commit -m “initial branch”
  • mkdir a second working dir let’s call it branch2 and cd to the dir that holds them both
  • hg clone ./branch1 ./branch2
  • now use vault to do a get latest into branch1
  • hg add .
  • also hg remove any files that have a ! next to them
  • hg commit -m “updated from vault label blah”
  • now get latest from the other branch into branch2 dir and cd there in linux
  • hg add .
  • also hg remove any files that have a ! next to them
  • hg commit -m “updated from vault label blah”

At this stage you have a hg mirror of your two vault branches except without history.

Now to merge branch1 into branch2

  • cd ../branch1
  • chmod -R -u+rw .
  • hg pull -u ../branch2
  • resolve any merge conflicts using vim
  • hg commit -m “merged from branch 1”
  • In vault, do a recursive search for renegade files and check them out
  • In vault, do the a recursive search for unknown to pick up any new files
  • in vault do a search for missing files and delete them if need be
  • commit changes in vault

Now maybe Vault already does all this and I’ve just misunderstood and this method obviously leaves a lot to be desired (e.g. It takes about an hour) so I hope Vault will fix up their merging GUI sometime soon.

[tags]mercurial, merging, methods, vault[/tags]

Uncategorized

A simple CSV Parser in C++

July 1st, 2008

It starts off in C but then uses a bit of C++ but avoiding streamio (except in my example usage) so if you really need to have it in C, then it’s not too hard to convert I think. This is written for an embedded project and we only included STL and streamio halfway.

csv_parser.cc

csv_parser.h

#include "csv_parser/csv_parser.h"
vector< vector<string> > csv;
cCSVParser csv_parser(&csv, "acsvfile.csv");
csv_parser.load();
vector< vector<string> >::iterator row;
vector<string>::iterator col;
for (row = csv.begin(); row != csv.end(); row++) {
    for (col = row->begin(); col != row->end(); col++) {
        cout << *col << ", ";
    }
    cout << endl;
}

So don’t say I never give you anything.

[tags]c++, code, csv, parser[/tags]

Uncategorized