Skip to content

New approach to computer lessons in schools

On the news today we hear that the teaching of computer knowledge in British schools has been a waste of time and needs to be reorganised. Instead of teaching children to use Word and spreadsheets we should be teaching programming. In other words, they shouldn't be passive users of the technology but should be able to modify it actively through understanding what is going on under the hood.

This seems eminently sensible, but in the next sentence we are told that Microsoft will be involved in the restructuring, which appears to contradict the essential idea of the restructuring. Surely the pupils should be introduced to the idea of free software, which would give them the ideal field in which to learn their programming skills.

But there may be some hope, because schools will be free to develop their own curriculums, so perhaps at least some of them will not allow themselves to be take over by Microsoft.

Fixed width vs liquid layout for on-screen reading

Now that I've updated my website I've been thinking again about readability in relation to line width. I spent a long time on the internet looking at different opinions. One school of thought recommends 'liquid layout', in which the line length is not specified and each reader's browser decides for itself how long the lines should be.

This is quite an attractive option since it avoids the need for sideways scrolling if you have a small screen and doesn't waste space on large screens. But on large screens it also means that text lines are very long, which makes for difficult reading. Some sites I look at have adopted this format but I don't think it makes for readability.

The alternative is to specify the width. (I know there are some hybrid schemes that try to have the best of both worlds but I'm ignoring those here.) If you choose to do that you have to decide on the width to specify. One of the best discussions of this question I've come across is The Line Length Misconception. This argues that the current widespread recommendation of short lines may be excessive and that lines that are 100-110 cpl (characters per line) are perfecty readable. This is followed by an interesting and knowledgeable discussion by readers. There is evidently room for more research.

In the light of this discussion I have settled for the moment on 82 cpl, with a text width of 550px. This is a compromise, of course, but compromise is inevitable. My screens have a resolution of 1600x1200, which is higher than average. The Statcounter survey shows most browsers viewing my pages at about 1280x1024 or even 1024x768. I've viewed my pages at these resolutions and they still look all right to me, so I hope they do to you. Feedback on this question will be gratefully received.

Which tiling wm - dwm or xmonad?

Update: My current favourite WM is spectrwm. Please see Four tiling window managers: spectrwm, i3, dwm, xomonad.

I used xmonad for several weeks and liked it a lot, but I decided to have a closer look at dwm. This is the tiling window manager from which xmonad forked a few years ago and the two are still quite similar in terms of appearance and function. You can change from one to the other almost seamlessly.

So if they are so similar, why think of making a move? Mainly, easy of configuration. Xmonad is written in Haskell, and although I did manage to get my configuration file working more or less as I liked it was quite hard work and there were still some problems. For example, if I wished to have new key bindings the process of doing, this seemed impossibly complex and non-intuitive. Even when I did get things working, I had little idea of why it worked and no real understanding of the code.

But would dwm be any better? It is written in C, which I don't know - in fact, I'm not a programmer. That put me off even looking into dwm originally, but when I did so this time I found that I could work out what most of the lines in config.h (the file you have to edit to customise dwm) were doing. Simply by writing lines that were similar to those in the default config.h I was able to achieve what I wanted, including adding or modifying key bindings. The site, which produces dwm, has examples of configuration to help you out if you get stuck.

Are there any disadvantages in using dwm instead of xmonad? Not really. Both are excellent window managers and, as I say, there is nothing to choose between them in terms of basic functionality. Xmonad has a lot of third-party modifications available but I don't need them (and usually find them difficult to get working when I do try them out). Xmonad seems to have a large and helpful user community (though dwm also has a user community and, to judge from its mailing list, quite an active one too).

So, to conclude: dwm and xmonad would both be good choices for a tiling window manager. If you know C it would be natural to choose dwm. Even if you don't, I think you would find dwm easier to configure than xmonad; at any rate, I do. For me this gives dwm a slight advantage over xmonad.

There are details of my experience of setting up dwm on my linux page.

Xmonad configuration (Spiral layout)

I'm currently using the Spiral layout for Xmonad. I like its appearance and it eliminates the horizontal option provided by the standard layout, which I don't much like.

The analogue clock in the lower left-hand corner is provided by the program buici-clock, which integrates well with Xmonad.

Here is my xmonad.hs:

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
import XMonad.Layout.Spiral

myManageHook = composeAll
[ resource =? "gimp" --> doFloat
, resource =? "xpaint" --> doFloat
, resource =? "display" --> doFloat
, resource =? "mplayer" --> doFloat

myLayout = spiral (6/7) ||| Full
main = xmonad defaultConfig { layoutHook = myLayout }

{ modMask = mod4Mask
, terminal = "xterm"
, borderWidth = 2

Xmonad and gvim

I'm continuing to use Xmonad as my window manager. One problem which arose was using my standard editor (gvim) in a tiled window. This works, but when I want to quit gvim various error messages appear in the window from which I started it and gvim itself is still visible though not reactive. If this happens, the easiest way of sorting things out is to press Mod-Space to make the window fullscreen and then do Ctrl +C to close the now-defunct instance of gvim. If you had saved the file previously, any changes you made will be preserved.

To prevent this problem from arising, either alias gvim to gvim -f, which prevents it from forking, or always start it from a fullscreen window. The second is what I am doing at present.

This problem does not occur in the stable version of Debian. It does occur with Sid (unstable version). Actually, it also happens with dwm and, in a different way, with awesome, so it seems to be related to tiling window managers in general. Whether it is a bug in vim or xorg I don't know.

Note added 21/10/2011: This bug is fixed in the latest version of vim-gtk in Sid (2:7.3.346-1).

Switching to Xmonad

Note added 14 December 2013
I'm keeping this post for historical reasons but I now use spectrwm not xmonad. For my reasons, please see Four tiling window managers.

A week ago I posted a piece about using Icewm to imitate, more or less, the function of a tiling window manager like Ratpoison. This worked pretty well but I still felt an attraction to the idea of a pure tiling WM. I don't want 'eye candy' such as window decorations or background images, nor do I find a need for icons or docks. I use only a small range of programs with any frequency (Iceweasel/Firefox, Mutt, and Vim/Gvim), and I don't need a lot of windows open - in fact, they would be a distraction. These days I increasingly feel drawn to bare simplicity, with no frills or fripperies.

So I went back to looking at tiling WMs again, and after some experiments decided that Xmonad was pretty close to what I was looking for. It can be driven almost entirely via the keyboard, but, unlike Ratpoison, you can use the mouse as well if you want to. There is an option to have floating windows, which means that the Gimp, for example, is usable. (I don't need it much but just occsionally I do.)

When Xmonad starts you see a blank black screen, which is about as basic as you can get! If you press the Mod key (Alt by default) plus Shift and Return a text terminal appears. Pressing the same keys again produces a new window, with the screen split vertically in two. Further presses give more windows in a vertical column on the right side of the screen. With Mod+Space you can change the display to show the windows tiled horizontally or you can have just one window occupying the whole screen.

Other simple key combinations allow you to move the focus from one window to another, change the size of the 'Master' window, and so on. You can use different workspaces, as you do in Icewm, and you can move any window to a different workspace, again as you do in Icewm.

Currently I'm using Xmonad on all my computers and am likely to stick with it. This is the first time in years that I've been tempted away from Icewm. Why am I making the change?

I wouldn't say Xmonad offers any clear advantage over Icewm. The functionality in both is much the same. As much as anything, I suppose, my current preference for Xmonad is aesthetic and conceptual - I like its uncompromising simplicity. But perhaps I will switch back in the future - who knows? (Perhaps I'll even end up with something like Compiz, though I doubt it.)

Actually, if you really want to tart Xmonad up you can do so with the help of a large number of bolt-on modules provided by external contributors. See the extensive documentation for details. For example, you can arrange the windows in a circle or even in a Fibonacci spiral!

Any disadvantage in using Xmonad? Yes, one obvious one: instead of configuration being done in text files, as it is in Icewm, you have to use the Haskell programming language and recompile. But this can be done without restarting Xmonad and at least there is only one file to edit. Still, I have to admit that it was this dependence on Haskell that put me off trying Xmonad for a long time and instead caused me to look at Ratpoison, which uses a text file. But, in practice, the Haskell business is not as bad as I'd feared it would be.

Most of the defaults in Xmonad were fine for me. I did need to use a different Mod key, because my Alt key is doing a lot of things in Vim. Also, I wanted wider and more obvious window margins (they change colour when the window receives focus). But I quite easily found sample configuration files on the Internet which I could adapt to my needs without the need to learn Haskell. Perhaps I will do so in the future, to try out some more ambitious things, but for the moment it's fine.

I certainly realise that Xmonad, or any other tiling WM, is never going to suit the majority of people, especially not those who expect something vaguely Windows-like. But it does appeal to some, as a quick trawl through Google will show. For anyone thinking of trying it out who still feels a bit apprehensive, I've given more details about my experience to date on my Linux page Using Xmonad.

Tiling window managers for X - Icewm and Ratpoison

Update: This discussion is out of date. I now use tiling WMs exclusively and my favourite is Spectrwm. Please see the tags for more details.

I'm a committed Linux user. I don't like desktop managers such as KDE, Gnome, or XFCE. I've no use for eye candy, background images, icons, and the rest, so I use the plainest window manager (WM) I can find that does the job, I've tried a lot of different ones in the past but have always come back to Icewm in the end. But lately I'm using it in a different way, to make it more similar tol Ratpoison.

Why Ratpoison? Most of the WMs I tried merely added stuff I didn't want. The one exception to this was the tiling WM family, like Ratpoison, dwm. or Lunchbox - there are quite a few. I like the idea of their simplicity and functionality. I did try some of them but most, apart from Ratpoison, were difficult to configure, and anyway, I decided that the tiling business wasn't much of an improvement on the stacking offered by Icewm.

Recently, while googling, I noticed that quite a lot of Ratpoison enthusiasts didn't tile at all but always worked fullscreen. That, I thought, would suit my style of working well, since I seldom need to see more than one application at a time. I do have Mutt and Iceweasel running but they were parked in workspaces of their own. Anyway, I installed Ratpoison again and ran it fullscreen, without tiling. I quickly realised that this was exactly what I wanted.

But things weren't perfect. Graphical programs such as the Gimp were said not to work very well in Ratpoison because of their floating windows. The solution suggested for this was to replace Ratpoison temporarily with another WM - Ratpoison has a command for this. That worked; I could swap back to Icewm for the moment. But then it occurred to me that if I ran my favourite Icewm fullscreen I would get almost the same effect as Ratpoison while preserving all the things I like about Icewm. So that's what I'm doing now.

Ratpoison, as the name implies, doesn't use the mouse at all. Icewm does allow the mouse but it is entirely usable without it; there are keyboard commands for everything. This suits me perfectly; I prefer to avoid the mouse whenever possible but there are times when it is useful to have it. So now I see only one application at a time, filling the whole screen; I can swap back and forth to any others that are open, mostly just using Alt-Tab. I hardly ever need to have more than one application visible, but occasionally it is useful to do so, for example when looking at a cheat sheet to remember keys or for copying stuff from one application to another (mouse needed here). For that purpose I have a second workspace available.

Previously I used to have seven workspaces, which was sometimes annoying if I couldn't remember where I'd opened something. Now I work in the same work space all the time but if, rarely, I want a second application to be visible, I swap across briefly to the other workspace (I've named them Main and Temp )

I realise that this setup wouldn't suit everyone but so far it does suit me, so I thought I'd share it.

Using Brother printer HL-5240 on local network

I have recently bought a Brother laser printer HL5240L. I installed the linux driver from the Brother website and the printer worked without problems with my desktop (the host). But at first I could not access the printer from a laptop on my local network. I eventually found the solution, which is NOT to have the Brother filter on the client (the laptop) but to access it directly on the host (desktop). This requires a very simple /etc/printcap that makes no reference to any filter.

Method: I first set up an appropriate set of files on /var/spool/lpd. I did this, as usual, using magicfilter, which automates the task. I called the printer HL5240. I then modified /etc/printcap as follows:


(The host computer is called arcadia.)

Note added 16 February 2012:
I recently had a HDD crash and then needed to reinstall the software for the printer. Several problems occurred. For details of these and how they were resolved, please see the entry for 16 February (use the calendar on the right to navigate).

Setting up a vpn tunnel in Linux

For the last 3 days I've been struggling to set up a vpn tunnel to a proxy server on my Linux Debian system. This is appparently trivial to do in Windows or the Mac but not on Linux. Still, I got there in the end. For anyone similarly afflicted I've posted a full report here.

A good OCR for Linux

One of the main things that Linux has lacked hitherto has been an OCR (optical character reader) that works. Now there are two. Ocrad is usable though it does produce some errors. Tesseract is better and produces almost no errors here. Both are available for Debian, at least in the Unstable distribution. This is a really valuable addition to free software.

Update for my information about installing Linux on a Thinkpad Z61M

I've just updated my information about Linux on the Thinkpad Z61M in the light of recent experience. I was using Sidux for this but two problems developed. One, which no one could shed any light on, was what I think is a bogus NMI error pointing to a hardware problem when using X. The other was that following an upgrade my wireless connection no longer worked.

I have now reverted to native Debian, currently Testing. With this, everything seems to be fine: no NMI errors and wireless as well as everything else is working as it should.

Microsoft ruling from the EU

According to the BBC news this morning, Microsoft has been hammered by the EU Court of Justice ruling on restrictive practices. They have received a huge fine (which won't worry them), but more important, they will have to disclose their code to facilitate the writing of software to access Windows and they will not be able to bundle media programs with Windows. All this sounds like good news for the Free Software movement. Well done the EU for once!

Installing Linux on new notebook

I've been too busy to post here for the last few days, installing Linux on a new notebook (Thinkpad Z61M). It's a very nice machine but I had problems initially with the installation.

First I wanted to partition the disk to preserve Windows, since I find I need it very occasionally (about once or twice a year). Shrinking the Windows partition to make room for Linux proved quite difficult.

Once that was done I installed Linux Debian. The wireless connection didn't work so I put in a PCMCIA card, which did. Then there was no sound. I spent a day and a half trying to get this working, with plenty of advice from people on the Net. Eventually I gave up and installed Ubuntu, which worked perfectly: wireless detected and working, sound workikng.

I must say I'm impressed by Ubuntu. I'd assumed, quite unreasonably, that it was a watered-down version of Debian mainly intended for refugees from Windows, but in fact it's a lot better than that. And I've been able to configure it so that it looks exactly like the native Debian that I'm used to.

I'll post more details about all this on my Linux page.