Review: Shadow of the Giant -- Orson Scott Card

\(JPG\) On his good days
Orson Scott Card is one of the best science fiction authors out there -
interesting thoughtful stories and realistic characters with believable
motives and flaws. Even on his bad days his work is better than most of the
science fiction out there.

Ender’s Game has to be one of the classic science fiction works and I was very
happy to see OSC write more books in the same universe. After Ender’s Game OSC
wrote 3 more books following Ender Wiggan after the Bugger War when he is no
longer remembered as a hero but instead the man responsible for the death of
an entire species (this is not entirely fair since Ender was unaware at the
time that he was doing anything more than participating in a strategy game).

The Shadow Saga follows on from Ender’s Game but does not feature Ender at
all, instead OSC explores what happens to some of the other major characters,
particularly “Bean” the boy genius instrumental in Ender’s victory over the
buggers. I have to say that I prefer the books that feature Ender as some
parts of the Shadow series do drag a little and do tend to harp on about the
amazing tactical skills of the Battle School graduates (Book 3: Shadow Puppets
was one of the least impressive IMO).

OSC has set himself a challenge since he has to describe the campaigns fought
by military geniuses while not (presumably) being one himself.

This book wraps up most of the loose ends but not all which makes me wonder if
there are more books on the way even though this book appears to be the last
in the Shadow saga.

Worth reading if you enjoyed the Ender books.

Links

View the discussion
thread.

Eragon -- the film

Eragon (2006)

Director: Stefen Fangmeier
Screenplay : Peter Buchman
Based on the novel by Christopher Paolini

By the time you read this I expect that director Stefen Fangmeier and
screenwriter Peter Buchman will have committed seppuku and the author
Christopher Paolini may have stopped spinning in his grave - I’m assuming here
that Christopher Paolini died with shock on seeing the travesty that his novel
became on the big screen.

As far as I can tell (from
www.imdb.com) this is the first film
directed by Stefen Fangmeier (previously his background has been in special
effects) and that the only other screenplay by Peter Buchman that actually
made it onto film was Jurassic Park III. After sitting through Eragon the film
I sincerely hope they are not given a chance to create another such ediface of
excrement.

I’ll start with some positive comments (as one is apparently supposed to) and
then detail what went wrong. The dragon special effects are generally very
good. Sorry, I should have said positive comment as I can’t think of
anything else I liked about the film apart from the end titles signalling the
end of cinematographic torture and giving the cue to leave the theatre.

Actually, I suppose we do have one think to thank the director and
screenwriter for - Eragon is a near perfect example which demonstrates the
wisdom of the old writers’ adage “show don’t tell.” Eragon the film takes
every opportunity to tell, not show, you what’s going on right from the
excruciating narration at the start of the film. The intro could have been
worse - they did manage to avoid having an animated book on screen during the
narration - but you can tell that serious thought went into making the
introduction as corny as possible.

When turning a novel into a film some details often have to be omitted but
it’s a bit of a shame when pretty much the whole plot gets removed and
replaced by an evil changling. Instead of chasing his uncle’s killers Eragon
runs away to find santuary with the Varden. When he meets Murtagh (in a way
that makes little sense) he is positively bursting to find the Varden which
makes even less sense since he knows they will imprison him or worse.

As well as replacing the plot with a collection of cliches, Pete Buchman is
guilty of cinematographic genocide - the elves and dwarves have vanished and
the Urguls have been replaced by humans in dirty clothes - and grevious harm
to Arya. He has managed to turn a warrior/soceress princess into a
stereotypical helpless damsel wailing to be rescued.

The dragon looks impressive enough but seems to have undergone a personality
exchange with a rabbit.

I could go on, but frankly it’s not worth it. I stayed to the end of the film
in the vain hope it would get better - it didn’t. If you enjoyed reading the
book don’t watch this film. If you didn’t enjoy the book don’t watch the film.
If you’ve never heard of the book don’t watch the film. Whatever you do, don’t
watch the film.

Why Program?

Hopefully this will be the first of several articles I’ll be writing for
Cache. I’ve been writing software since around 1983 and started writing
professionally since around 1989. I’ve written in at least 10 different
languages including binary code (writing 8bit Z80 machine instructions without
an assembler), 8,16 & 32bit assembler, popular languages such as C/C++, BASIC
and Java, scripting languages such as ruby and the various UNIX scripting
languages, “teaching” languages such as Pascal as well as more exotic
languages such as lisp and occam (a language for writing parallel programs).
Along the way I’ve learned a lot (I have made enough mistakes to give me
plenty of learning experiences!) and with any luck some of what I’ve got say
will help you too. I will try not to get too technical but stay technical
enough to actually say something more than vague generalities.

In this first article though, I would like to ask a question which may seem to
have an obvious answer. Why program? Or rather, why should you program? Now,
obviously someone needs to write software or we’d be deprived of such
uplifting experiences as watching MS Word crash before we’ve saved our work or
enjoying the visitations of the Windows Blue Screen Of Death (BSOD). Also a
fair number of people, myself included, think writing software is an excellent
way to earn money. However, I’m going to argue that almost anyone who uses a
computer could benefit from having at least some programming skills. I’m going
to try a simple analogy to illustrate why.

Yoda provides an incentive to program

Let’s suppose that you’d like an action figure of Yoda from Star Wars (don’t
worry you don’t have to tell me why you’d want such a thing). If you can’t
program it’s like arriving at the store and find you can have any action
figure you want as long as its Darth Vader, Luke Skywalker or Obi wan Kenobi.

But never mind programming, there’s a lot of “no programming required” tools
out there right? Well, most of these are template based and that’s like
settling for a mold of Darth Vader. Armed with your mold you can make lots of
plaster copies of Darth Vader and you can even choose what colours to paint
them but once you’ve made and painted your figure it’s hard to change and even
though you can buy Luke Skywalker and Obi wan Kenobi molds a Yoda one is still
not available.

Now let’s say you want that Yoda figure enough to be willing to put in a bit
of effort. You buy a kit of “super Lego” - this is really cool because not
only does it come with lots of pieces that are ideal for making a Yoda figure
but with a bit of effort you can even make new pieces. You end up with a Yoda
figure than can not only stand up on its own but can even bash the Darth Vader
plaster cast on the head with a light sabre. OK, making Yoda this way took a
lot longer than buying one and your Yoda figure looks a little rough around
the edges compared something mass produced but even if you’d been able to buy
a Yoda figure that could do all yours can it would cost you a lot more than
what you’d paid for your “super Lego.”

In fact a modern programming environment is a lot like our mythical “super
Lego” - the pieces are like the libraries that come with languages such as
Java, python, ruby, C++ etc and the language itself allows you to make new
“pieces” which are indistinguishable from the libraries that came with the
language.

If you knew that you could get a kit of “super Lego” for free would you be
tempted to give up your Darth Vader plaster casts and spend a little time
learning how to use it?

A real life program

Let’s leave Yoda alone for the moment and move on to something a little more
like programming. Even if you don’t want or need to program “in the large”
(write a reasonable complex game, an alternative to MS Word or a web app to
compete with Amazon.com) I find that there are plenty of times when it’s good
to know how to program “in the small.” It’s not glamorous, it (probably) won’t
earn you mountains of cash but it will let you get your computer to do a bunch
of tasks that you’d have to do manually or otherwise not be able to do at all.

You want examples? Just before writing this article I was putting together a
set of images to test some software I’ve been working on. However, they all
had names like “dave picking his nose.jpg” and “george bush cartoon.gif” and
being the neatness freak that I am I wanted them to have nice convenient names
like “test1.jpg” “test2.gif” etc. So, I have a choice:

  1. I can rename all the files manually, if there were 10 maybe I’d do it but there are several hundred. I don’t care that much. If I didn’t know how to program the file renaming probably wouldn’t get done right?
  2. I write a little script that gets my computer to do all the work.

Here’s the script (I’ll explain what it does in a moment):

fogey% ls -1 *.jpg | grep -v method_ | awk 'BEGIN { count=1 } { printf("mv %s test%d.jpg\n", $0, count++); }' > jpgfiles.sh
fogey% bash jpgfiles.sh

Time to write it: about 30 seconds. Time taken to run it: < 1 second. Is it
pretty? Not really? Is there a more elegant way I could have done it?
Probably. However, my goal is not to show you the most elegant solution
(assuming one exists) but to show you what small, “throw away” programs are
like. You don’t care if they’re elegant because you might only use them once.
You do care about writing it quickly and getting the job done; after all if I
wanted to spend hours renaming files I might just as well do it manually.

So, when programming “in the small” like this I’d argue the rules are
different from what you might have been taught. If you are writing pieces of
software that you want to keep or are more than a few 10s of lines long your
goals should be:

  1. Make the program correct.
  2. Make the program maintainable.
  3. Make the program efficient enough to be useful. Note that efficiency came third on a list of three items. Firstly, for the program to be useful it has to be correct - I won’t care if it runs fast if it doesn’t do what I want. Secondly, you are likely to spend more time modifying and adapting any program that you keep for a while than you did writing it in the first place so it’s important that the structure is clear enough for you to be able to understand it and change it six months after you wrote it. Many inexperienced programmers worry both too much and too little about efficiency. Too much, because they worry about speed before correctness. Too little, because they make poor choices of data structure and algorithm that mean that efficiency is doomed from the start.

When you’re programming “in the small” the rules are different:

  1. Make the program correct.
  2. Write it quickly Even small programs have to be correct in order to be useful. However, the goal when writing tiny scripts like the one above is not to produce a work of art that you’ll treasure for the rest of your life but to get the computer to save you time so you can get back to doing the thing you actually want to do (which may or may not involve programming).

Summary

So, to summarize I think knowing how to program in the small is very useful
for a number of reasons: It can save you a lot of time even if you don’t care
about writing large programs It’s a great way of experimenting and trying
things that will help you learn how to write larger programs. The programs are
small and quick to write so easy to understand and you get (almost) instant
feedback - you don’t have to invest hours of work before you know if you’re on
the right track or not.

There are some excellent free tools available for small and large programming
on Windows, MacOS and Linux so you don’t even have to spent any money - the
only thing you have to spend is a bit of your time.

Assuming, you want to hear more; next time I’ll talk a bit about some of the
free tools I mentioned above and show you how to use them to do useful stuff.
In the meantime if you have any comments and questions I’d be happy to hear
them at mailbag@emptiness.org If you have any
examples of small tasks that you’d like to know how to automate send me an
email and let me know what platform (Windows, Mac or Linux) you’re using and
if I have time I’ll discuss them in subsequent articles.

The script decoded

Oh yes, the script. I hadn’t forgotten. Now the first thing to realise is that
the “script” as I showed it is actually not a single program but a series of
commands that generate a script and place it in the file jpgfiles.sh and then
a command to run it. fogey% is the command prompt of my terminal showing that
it’s waiting for input (fogey is the name of the machine) - since you see the
prompt twice this is a dead giveaway that I’m actually entering two commands.
Now since the first line generates a script in jpgfiles.sh I could always open
that file in an editor to check it is right before I run in - so I have a
built in safety mechanism. The first line is actually three commands “piped”
together using “|” which takes the output of one command and sends it to the
input of another so we can break this down into four parts:

  1. ls -1 *.jpg : gives a list of all files ending in .jpg one per line
  2. grep -v method__ : removes all files with “method“ in their names from the list
  3. _awk ‘BEGIN count=1 printf(“mv %s test%d.jpg\n”, $0, count++); ‘ > jpgfiles.sh_ : uses a simple language called “awk” to take each line and change it from something like “filename.jpg” to “mv filename.jpg test1.jpg”. “mv” is the UNIX command to rename a file so the generated script has one line for each file which uses the mv (rename) command to change the name of that file. The “> jpgfiles.sh” means “take the output of the command and put it in the file jpgfiles.sh”. I won’t go into more detail on awk here, since I’m running out of space but I might say more in another article.
  4. bash jpgfiles.sh : bash is one of many UNIX command interpreters. I use bash to run all the rename commands in the jpgfiles.sh

The above illustrates another feature of programming “in the small” - rather
than having a single program in a single language it’s common to use a bunch
of small commands and maybe even different “small” languages and join them
together to get the job done. This is often much quicker (to write) than
trying to do everything using a single command or language.

If you’re using Linux or MacOS X then you having everything you need to try
this script already. If you’re running Windows install
Cygwin and you’ll be able to run these UNIX commands
too.

If you’re impatient to understand awk take a look at
http://www.vectorsite.net/tsawk.html

Old Projects

Large screen user interfaces

cw.jpg



As part of the European funded project Campiello, I worked for Xerox Research Centre Europe investigating the use of large screen displays as a means to support serendipitous information discovery and to support awareness between the members of a community or workgroup.The resulting display is designed to look visually appealing and avoid the standard rectangular grid-style layout found on most computer user interfaces.

Networking devices using people instead of wires

pollen.gif



In the course of their workday, people move about visiting different locations, seeing different people and using several different artefacts. This movement in part of their everyday work. In a similar fashion bees move from flower to flower in a field, in search of nectar. However, a bee also inevitably collects pollen on its body when it visits a flower and, when it moves to a different flower, some of this pollen rubs off.

The Pollen network (at Xerox Research Centre Europe) exploited this movement of people to provide a means of transmitting information between people and devices without depending on a fixed (wired or wireless infrastructure). In a Pollen network, people carry an electronic form of pollen with them, not on their bodies, but inside their personal digital assistants (PDAs, such as the Palm or the Psion, etc.) or inside other mobile devices, such as cellular telephones. When two devices come in contact they exchange Pollen messages, thereby providing an indirect means of information transfer. The movement of people is thereby harnessed to create a new kind of computer network.

Collaborative Virtual Performances

now96.jpg



Collaborative virtual environments provide many opportunities for new forms of artistic expression. In one event in Nottingham in November 1996 we (the Communications Research Group at Nottingham University, UK) created an event in which hip-hop poets were able to perform simultaneously to both live and virtual audiences.The virtual audience was able to see, hear and interact with the poets in an environment designed by a UK graphic designer. In addition the virtual world allowed the audience members to see, and communicate with each other, as well as providing other examples of the poets work for them to explore. Meanwhile the audience in the real world as well as being able to enjoy the real performance were able to see the activities taking place in the virtual environment by means of public projected displays.

In 1997 we staged worked with a local artist in which up to five people at once could explore a virtual art installation populated with autonomous agents. The users were able to see and hear each other

Visualising Information

infovis.jpg



Not only is the amount of information that we have access to increasing in volume, it is also increasing in complexity. Trying to understand complex structures, such as software, the relationships of documents in a collection to one another or hypermedia databases is not a trivial matter.To make matters worse, information of this kind has no natural physical representation. Unlike measurements of wind speed around a component in a wind tunnel there are no physical artefacts to relate such data to. A long standing interest of mine has been to “make the intangible tangible” by trying to find appropriate techniques for representing such data.In addition it is important to realise that people do not work in isolation and so these visualisation are not just single-user environments but actively support multiple users and allow them to be aware of the actions of others which might indirectly affect their own work.

The images above show the WWW3D 3D web browser (left) and the VR-VIBE system for interactive searching of document collections (right).

Web programming == No Fun

When I say web programming here, I’m thinking of mid-to-large scale
application development in a language like Java, not relatively small-scale
applications in PHP - which personally I find more fun probably because the
size of the applications I would use PHP for means that it’s easier to keep
the whole project in mind and also because PHP scripting has a shorter write-
test-debug cycle than Java.

Last year I spent a lot of time working on a Java-based web application using
the Spring Framework, Hibernate and Jakarta
Struts
. What a lot of no fun that was. Spring
and Hibernate are quite straightforward - my problem is with writing the user
interface for web applications - it just seems so much harder than it should
be for relatively little in return. I spent weeks building a user interface
that I think is inferior to something I could have built in a day or two using
Swing, and a half-decent Swing GUI editor.

Now don’t get me wrong Struts is much better than writing servlets by hand
and the Nitrox plug-in for eclipse makes things easier still. However, the
whole experience is still laborious compared to building a Swing application
and still results in an inferior user experience. One issue is simply the
amount of classes and XML configuration glue required to perform relatively
simply actions. Then there is the conversion between the application’s
internal classes and the Struts ActionForms (although
BeanUtils can make this a
whole lot easier). Even after all this work the user has to wait for page
refreshes after performing most actions.

Now, we have AJAX which should improve
the user experience if done well (check out Google
Maps
for an example how AJAX can help create a great
user experience) but probably does not lighten the programmer’s load (I plan
to build a couple of sites using AJAX to get a feel for this).

Now web applications have a lot of advantages (no install, no upgrade, can
work anywhere if does not rely on proprietary extensions) and for some
applications are definitely the way to go but I can’t help feeling that web
application development environments lag far behind the desktop and that what
we need is a merging of desktop and web programming. Maybe Microsoft’s
XAML and Mozilla’s
XUL are the way forward.

View the discussion
thread.

Dazed wandering into blogging

Well, I finally got around to updating this site to add a blog. After months of thinking I would write my own blogging software I finally decided that I could spend my time more fruitfully than writing yet another PHP blog and so installed WordPress.

Review: Perdido Street Station by China Mieville

\(JPG\) This a
dark book, an excellent read, but a dark book all the same. If this was a
western instead of the hero riding proudly out towards the sunset, he’d be
battered, bruised and crawling out of town at 2am with a few locals throwing
rocks at him for good measure.

The story takes place in the city of New Crobuzon in a world in which magic
coexists with technology - thus we have both steam-driven computing engines
and thaumaturgists able to create bizarre human-animal-machine combinations -
the remade - as punishment. To make things even stranger (China Mieville
refers to his style of writing as “The new weird” by the way) there are a
variety of non-human races such as the Khepri and Cactacai.

New Crobuzon is like a vast dirty Victorian city in which steam power is high
technology into which various extras from horror B movies have escaped. It is
a totalitarian police state and ruled over by politicians who practically
define corruption. The city is vast and ancient and the descriptions of it are
rich and absorbing. The city feels like a place in which violence and fear (of
the secretive militia) are normal. This state of low-level fear degenerates
into outright terror as the events described in the book unfold.

Some of the characters and races in the book are more convincing than others.
The cactacai come across like humans wearing humanoid cactus suits. The Khepri
have the form of human women with giant scarab beetles for heads (Khepri males
are dumb giant beetles). The Cactacai and Khepri are supposed to be races that
evolved independently from humans but this does not really convince. However,
the Khepri culture is interesting to give some substance to the race.

However, while I might complain about some of the alien races being like
humans in rubber suits this is just quibbling in the face of the magnificent
ediface that is the story itself. What makes the book so excellent is the
richness of description, the realisticly complex main characters and the plot
itself.

Isaac Dan der Grimmebulin is a freelance scientist with a Khepri lover, Lin.
He receives a strange visitor at his lab - Yagharek, a Guruda (a race of giant
bird-men). Yagharek has lost his wings as punsihment for the crime of “choice
theft to the second degree with utter disrespect” and has left his band
travelling a great distance to find someone who can give him back the ability
to fly. Isaac, not knowing the nature of Yagharek’s crime but needing the gold
Yagharek offers accepts the commission. In the meantime Lin, an artist,
receives a commission from the monstrous Motley, a drug baron and one of the
most powerful crimelords in the city. Lin is to create a sculpture of Motley
using coloured Khepri spit - a traditional Khepri artform.

While researching flight Isaac accidentally unleashes a monster so terrifying
that even the legions of hell fear it. The city’s response to the threat fails
utterly and finally it falls to Isaac and a small band of companions to
attempt to rescue the city.

I won’t say more about the story lest I give too much away. Suffice it to say
this book definitely deserves to be read. Be warned though, it’s 867 pages
long (at least the Pan edition is) and so you risk spending a lot of time (as
I did) letting other things slide while you rest utterley absorbed in a
bizarre rusty smelly and well, weird, world.

Links

View the discussion
thread.