Archive for the ‘Computing’ Category

A walkthrough guide to building yourself a Linux system for coding

November 24, 2012

In any technical role it is important to strike the balance between getting-things-done-quickly and knowing-all-the-details, and this is especially true when it comes to building computer systems.

You can find lots of different Linux distributions to download, and most have a relatively easy system for adding components or software via some kind of package manager.

However, anyone who is fiddling with Linux is probably doing so because they want to learn more about how their computer works. Dragging-and-dropping packages leaves you with a feeling that you haven’t really learned much.

The balance is wrong: we are getting things done but we really wanted to know more.

Of course, the way to know more is to roll up your sleeves and start building software from source code.

But experience has taught me that it is often much more difficult to build/compile than anyone will admit. Typically the problems come because you have some slightly different settings, or there is some minor file missing which everyone assumes is always there, or any one of a collection of ‘little problems’. An experienced user can circumnavigate these issues easily, but a beginner needs a much straighter path to the destination.

In this post I give a walkthrough of how to set up a Linux system (called Puppy Linux) and how to compile a few important packages (SDL, Tcl/Tk and Python) from source that you can use to write interesting pieces of software (eg games, eg applications with windows and buttons etc.).

The important difference with other ‘setup guides’ is that I have put a lot of effort into thinking how we can be sure that your machine is set up identically to mine, so that your walkthrough experience will be exactly the same as mine when I wrote it.


Writing Latex articles with Vim

July 28, 2012

Vim is a text editor, part of the standard suite on a UNIX system.

This is a short post which is a store of some Vim keystrokes that I am progressively discovering, and which are worth sharing for anyone interested.

The main point is that with Vim you learn a new method of moving around a text file, so it is a bit like learning new paradigms for a foreign language if you like.

  1. Don’t move with the arrows, move by words or by searching.
    This means that for scanning through text you might do:

    1. Move forwards and back quickly with W, B and E (move by words, without recognizing punctuation),
    2. Get closer by releasing the shift and using w, b or e in the final stages to home in.

    And to move through larger distances use a quick search:

    1. hit / and type a bit of text to search forward, with n and N to move forward and back along those points,
    2. hit ? and type text to search backward, then use n and N likewise.
  2. Copy text you just typed for a paste later:
    1. Enter the text, then ESC and v to enter VISUAL mode,
    2. use ‘[ (moves to the point of where text was last changed),
    3. yank it with y.

For example, if I need to add something like ‘_{\text{N}}’ to a few ‘\sigma’ in my article I do this:

  1. find a ‘\sigma’ with /\\sigma,
  2. move to the end with e, and then append with a,
  3. type ‘_{\text{N}}’,
  4. ESC out and v into VISUAL mode,
  5. ‘[ and y to copy that text,
  6. now an n will take me to the next instance of ‘\sigma’
  7. and a quick e then p will paste the text where I want it.

Nice! In short, Vim seems to be a good fit for all of the usual text manipulations I do in a Latex article.

Some links on Lisp

December 29, 2011

Curious about the programming language Lisp?

Follow these few links to some thought-stimulating commentary and sites.

The power of notation in problem solving

December 13, 2011

It’s trivial when you think about it:

good mathematical notation is one way of making a problem easier to solve.

In my introduction to advanced probability theory I put emphasis on how probability theory has developed a clever and natural way to describe the processes we deal with. If you think about it some more, the design of the notation is an important part of slicing the subject into manageable blocks.


LISP = Super-powered XML

November 30, 2011

I am fascinated by the programming language LISP, since it seems to me that it offers a better union of the concept of instructions and data.

Experience shows us that the shape of data often expresses an obvious algorithm for processing it, but most languages don’t try to take advantage of that.

LISP does.

This article says as much and is a good read.