Warn: There is another system

Posted by stu at September 15th, 2008

Saw “Colossus, The Forbin Project” last night; The U.S. gives an AI control of all it’s nukes… what could possibly go wrong?

Shortly after they turn it, on a message comes up “Warn:  There is another system”, it turns out the Russians have done the same thing, and the system wants a link.  I won’t give away any more of the film, which has some seriously cool looking 70s tech in it (and obligatory wooden panelling everywhere).  I did like the message in the “computer” writing of the time, so made an version in Inkscape, as it would probably make a cool T-Shirt.

Posted in Uncategorized| 2 Comments | 

Making Windows Usable – colourisation

Posted by stu at August 21st, 2008

Human beings are visual creatures, so in this post I’ll introduce some ways of making your life easier using colour.

Colour Your folders with iColorFolder

IColorFolder gives folders a context menu which lets you change the colour.  Unfortunately this doesn’t work fully in Vista yet, and you’ll need to manually change the icon, navigate to Program Files\iColorFolder\iColorFolder.dll to get access to the folder icons.

Incidentally if you want have a shortcut to a folder, you can use the same workaround to use a coloured icon.

Colourise your commandline

Colour ls

It’s equally useful to have colour folders when using the commandline, to achieve this you can use msls from utools.

Download it and place it somewhere within the path (I use \usr\bin, which I added to the path earlier).

Now, to get colour directories you can type “ls –color”.  However it would be better to have that happen all the time.

To set color as the default, set the environment variable LS_OPTIONS to –color:

  1. Press Windows+Pause,
  2. Click through these buttons: Advanced, Environment Variables, New
  3. Set the name as LS_OPTIONS and the variable to –color

Next time you launch the commandline and type ls, it will be in colour.  You can also combine options here, for instance if you want -l to be default as well.

Using 4NT/TCC-LE

Another way of getting colour directories is to use 4/NT or TakeCommand-LE (The free cut down version) from JPSoft.  This replaces the whole command shell and has many enhancements that help day-to-day.

Once you’ve downloaded the shell, if you want to change colours for particular kinds of files, then type option, go to the windows tab, and you can set directory colours.

To set EXE CMD and BAT files to be bright white enter:

EXE,CMD,BAT:15

If you want bright white on blue enter

EXE,CMD,BAT:15,1

Semicolons seperate file types – here I’ve set executables yellow and documents white:

EXE,CMD,BAT:14;TXT,DOC,PDF:15

The colours are arranged foreground, background and can be any of the ones used below (note background only has 8 colours to choose from, while foreground has 16, the last being the brighter versions).

Note:  These are the default textmode colours, if you change the command prompt colours yours may be different.

Tango in putty

The tango project is a usability project for free software, the colours are very pleasing and have been ported to putty, alternatively the Igvita theme is nice.

The tango port comes with the bitstream vera mono fonts too, so everything should look pretty good once installed.

Colourise your browser

If you use firefox you can install ColourfulTabs which makes it easier to find that tab among the crowd (especially useful if like me, you have lots open).

Colourise gmail (sometimes)

This one is a little annoying as it seems to be broken, but I’ll include it anyway in case it gets fixed.

If you install greasemonkey and the gmail colouriser, then all your gmail will be coloured by label (for instance I have a label for mailing lists I subscribe to).      When the gmail colouriser is working this works great for finding certain kinds of mail in the long list.

Unfortunately this isn’t working for me at the moment, so no screenshot… if I knew how to debug greasemonkey scripts I might have a look at fixing this as it’s so useful – it seems to choke on certain mail names but I’m not sure what they are.

Posted in making a really nice work environment in windows, making windows usable| 3 Comments | 

JEdit with tango goodness

Posted by stu at July 12th, 2008

I’ve been using a patched version of JEdit with tango icons for a while, but seems like I missed the fact that 4.3 pre 14 came out with Tango support.

Go forth and download…

Via  http://deadcabbit.blogspot.com/2008/05/jedit-pre14-tango-has-arrived.html

Tango is a project to bring tasty icons to open source projects, those on windows can also see tango icons in the current version of the gimp, in linux you can see them in gnome and kde.

Posted in making a really nice work environment in windows| No Comments | 

ZX Spectrum flightsim

Posted by stu at July 12th, 2008

Just found this while going through my phones photos.  This is from my last contract, the company used to be Psions software division, we found the tape in the bottom of a desk draw, who knows maybe it is the master tape for this game?

Psion flight simulation on cassette

Update:  Link to PsionSoftwareLTD promotional information on worldofspectrum.org

Posted in Uncategorized| No Comments | 

Netcat in windows

Posted by stu at May 22nd, 2008

Just had a nightmare finding a binary for windows that wasn’t cygwinized… eventually found it here

http://www.hackosis.com/wp-content/uploads/2007/12/nc111nt.zip

[update]

Jon Craton has mirrored this file in case the other link goes down

http://joncraton.org/files/nc111nt.zip

(Cheers :)

[update 2]

It seems that antivirus programs mark netcat as a threat when actually it is just a useful tool – see conversation and links in comments for details.

Posted in troubleshooting| 26 Comments | 

What’s in a name?

Posted by stu at April 1st, 2008

…or why “my” is not a valid prefix for a variable

While I’m greatful for examples like this J2Me GameCanvas example I’m not so happy about this bit of it:

/** Starts the canvas by firing up a thread
*/
public void start() {
Thread myThread = new Thread(this);

// Make sure we know we are running
running = true;
done = false;

// Start
myThread.start();
}

What’s wrong ? Quite simply ‘myThread’.  You see the ‘my’ prefix used in code all over the web – it’s extraneous… extra noise, you may as well add ‘the’ to the beginning of every variable.

Variable naming is to a certain extent a matter of taste; a lot of people would say that it is worrying about nothing. The problem is, that most of the time spent with code is reading it, not writing it; as such we should try and be as succinct as possible ‘my’ adds absolutely nothing here.

In the example above it would be better to either leave out the ‘my’ or call the thread canvasThread.

 Fuzzy

Where possible variable names should reflect what you want to use them for, if your naming is fuzzy then others will use them for things you did not intend and then your on the downward spiral…

This is the other crime in variable naming, over generalising… quite often you see variables called ‘data’ when the name of the type would do fine… usually it is only in IO based applications dealing with arbitrary data that the name is appropriate.

Of course, if you can’t think what to name them, then don’t pad them out as well, it’s pointless.

My my my

A quick search on coders (excluding mysql) finds 301,040 hits for ‘my*’.

That’s a lot of noise… stop the madness: ban ‘my’ now… if microsoft can remove it from Vista, how difficult can it be?

Posted in Uncategorized| 3 Comments | 

Date for wine 1.0 release announced

Posted by stu at April 1st, 2008

The Wine project has been going since 1993, and has got to the point where a large percentage of windows programs run well in linux.

A perennial question is when 1.0 will be released, excitingly it looks like this will be sooner than we thought – as seen from their mailing list today:



Paul Vriens <paul.vriens.wine at ??????> writes:

> Just noticed that the dates attached to the versions on
> http://wiki.winehq.org/WineReleasePlan are not correct.
>
> 0.9.58 came out on March 21st.
>
> Does this mean we still stick to May 9th or do we stick to 0.9.61 as being
> 1.0.0.rc1?

We should stick to May 9th, we'll just have to wait for this date to
coincide with a release. If my calculations are right this should be
release 0.9.218 on May 9th, 2014. Hopefully we can clear the 1.0 bug
list by then.

--
Alexandre Julliard

Posted in Uncategorized| No Comments | 

5 Minute python

Posted by stu at February 26th, 2008

I’ve recently been learning python and decided to note down the *very basics* that took longer to find out than I would’ve liked.

Without furtherado, heres my 5-minute-python.

Posted in projects| 5 Comments | 

Playing a sound in pygame

Posted by stu at February 24th, 2008

It can be useful to test sounds in your current engine (esp for testing MOD support), so I’ve made a tiny sound player for pygame. The code is just this:

import sys, pygame
from pygame.locals import *

import pygame.mixer

if __name__=="__main__":
    pygame.display.set_mode((120, 120), DOUBLEBUF | HWSURFACE)

    pygame.init()

    try:
        filename = sys.argv[1]
        pygame.mixer.init()
        sound = pygame.mixer.Sound(filename)
        print 'Press ESC to quit, any other key retriggers sound'
        sound.play()

        running = True
        while running:
            for event in pygame.event.get():
                if event.type == KEYDOWN:
                    if event.key == K_ESCAPE:
                        running = False
                    else:
                        sound.play()

    except IndexError:
        print 'Usage tplay.py filename'

The file is attached here: Tiny pygame audio player.

Posted in projects| No Comments | 

Vista vs Blender

Posted by stu at February 20th, 2008

The good news is, my laptop can run the Blender game engine at a decent framerate.

The bad news is I found out that is the Vista taskbar that more than halves it.  I run without Aero, as Aero completely borks OpenGL (quite apart from the fact that Vista limits you to OpenGL 1.5).   It’s bothered me for a while that in Blender I could never get over about 30FPS – on the weekend I found out that I can have the window as large as I like and get much better framerates as long as the window doesn’t touch the taskbar.

This is the kind of thing I hope SP1 will fix, but I severely doubt it :(

Posted in Uncategorized| 3 Comments | 

« Previous Postings | Next Postings »