29 Aug

blank screen in vnc

I upgraded the office server using apt dist-upgrade earlier on, but when I tried to load up my beautiful KDE3.5-alpha desktop via VNC, all I got was a blank screen.

After a bit of work trying to find out what was going on, I finally noticed that the permissions on ~/.vnc/xstartup were rw-rw-rw-, and there was a “permission denied” message in the log.

So, to solve this, simply chmod +x ~/.vnc/xstartup, and everything should run fine.

28 Aug

remotely starting up x11 applications

We have a TV here in the house, but it’s gathering dust – the only person in the house that uses it is my two-year-old son, Jareth, who uses it to incessantly watch Bear In The Blue House over and over.

Instead, we use the monitor and speakers of the main house server, Monolith (called that because it’s big and black) to watch our media.

Being the lazy bastard that I am, I was sitting on the couch with my laptop on my lap, and decided I wanted to watch something on the big computer.

So, I did a bit of research and came up with this method:

  • ssh into the machine using the username which controls the active desktop.
  • enter xhost +lappie, where “lappie” is the name of the computer you’re sshing from.
  • use mplayer to open up your media on the remote computer.

If you get an error, then make sure that DISPLAY is set. If you’re not sure, then set it with export DISPLAY=:0.0 (the most common number – if you have vnc servers running, or multiple monitors, then it may be different).

It’s possible then to run a program on your local machine and have it display on the remote one. For example, the following line, typed into your local console, opens up klines (a cool strategy game) on the remote machine:

DISPLAY=monolith:0.0 klines

Unfortunately, that’s pretty useless, as you won’t be able to control it with your mouse – unless, of course, you combine it with the amazing powers of Synergy.

All in all, there’s a lot of potential for this trick…

One possible use for it is to have a CPU-/RAM-intensive program such as OpenOffice running on your fast home server, and displaying on your slow laptop – of course, there are better ways to do that (VNC, for example), but it’s a thought.

27 Aug

rekog

As some people know, I’ve been thinking about robotic gardening for years. It’s about time I started on it.

The robot’s brain will consist of a few modules, some of which are:

  • A recognition engine, for distinguishing between plants I want, plants I don’t want, and other miscellaneous items (sky, dirt, people, etc).
  • A mapping engine. This engine will take multiple images as its input, and build up a 3D internal representation of the world based on those images.
  • The rest. I’ll worry about these when the time comes, but basically, these consist of a scheduling engine, code for controlling the various parts of the robot, and sundry.

I’ve started on the recognition engine, which I am calling rekog, as I’m using the KDE widget set to construct it.

In the end, the finished code will consist of a simple API for importing an image and retrieving a list of probable identities for the image’s contents.

Of course, to get to that end, I need something visual, so I’m building a visual program for importing the images and building test data.

The program will be simple to use. Simply build a list of images, create some “neurons” describing what the images contain (“vegetation”, “sky”, “road”, “grass”, “nettles”, “potatoes”), click “train”, then the engine will be reasonably ready for use with live images.

The “brain” of the engine will be a neural network, or at least, an approximation of what I think is a neural network (I’m not an educated computer scientist, so I may be wrong). In particular, it will be similar to a “Hopfield Network”.

The difference between a Hopfield network and the usual feed-forward perceptron is that a Hopfield network forms a recurrent cycle, which means that each neuron is linked to almost every other neuron (no “layers”), and a “memory” of sorts remains in the system.

An advantage to the memory effect is that an image seen just a moment ago can influence the result of the image you are looking at now. This means that if the engine is definite that the image it’s looking at contains, say, nettles, then there is a greater chance that it will recognise the nettles in the next image which is taken from a foot away.

Anyway – I’m enjoying learning visual programming – I never got the hang of GUI stuff back when I was working in C in the 20th century. The concepts I’ve learned working with Unobtrusive JavaScript and AJAX (two forms of asynchronous programming in web pages) are really helping me get the hang of it.

25 Aug

always end a javascript statement with a semi-colon

Although it is optional, I recommend always ending javascript statements with colons.

A very good reason for this is that some packers (one, two) reduce the file size by removing excessive white-space – including carriage returns.

For example, the following code:

  var a=3
  var b=4

– will be packed to this:

var a=3 var b=4

The above line is nonsense. If semi-colons had been used, then the statements would still be parseable.

Beware of this gotcha: when you create a function dynamically, you must still place a semi-colon after the closing ‘}’.

For instance, this code:

  this.onreadystatechange=function(){
    return false;
  }
  return true;

– will not parse after being stripped of its carriage returns. You must rewrite it like this:

  this.onreadystatechange=function(){
    return false;
  };
  return true;

Oh – and for those people that complain that packed source is harder to read and maintain than non-packed – always keep a copy of the original code in a /source directory. Every JavaScript library that I know of uses this scheme, so it should be good enough for anyone.

23 Aug

two photos

Just thought I’d share these. the first one is my son Jareth, being Terminator after a sloppy meal.

it's a photograph. you need to use a graphical browser to view it.
click for a larger image

The second is of a custom job I did on Bronwyn’s guitar. I painted ivy onto the guitar, then made a new scratch plate from some perspex. I gave the scratch plate a frosted look with a wire brush on a rotary tool, and engraved a pentagram into it (avoided that area while doing the frosting). The image is of me playing Flight Of The Bumblebee. Note that the scratch plate is mostly transparent. The frosting gives a tantalising glimpse of the wiring underneath.

it's a photograph. you need to use a graphical browser to view it.
click for a larger image

22 Aug

latin sounds great when put to music

I’m listening to a load of songs by a band called Helium Vola. They sing in both German and Latin. The current tune I’m listening to is “Fama Tuba”, which, my research tells me, is this poem, but I’m not certain about all the lines. That song is a pretty spooky industrial tune – very dancy, but scary. I also highly recommend their song Omnis Mundi Creatura.

Another Latin song that I love is Miserere Mei, by William Byrd, if I remember correctly. Machine In The Garden did a fantastic cover of it on their One Winter’s Night album.

22 Aug

access to csv, the difficult way

This is kind of annoying. I do not have Microsoft Access installed on this machine, but was sent a database of stuff to import into my CMS.

I thought this would be a good time to write a CSV-importing tool for the CMS, so went to work converting the .mdb to .csv.

This was not as easy as it seems!

The only open-source program I could find to read the .mdb file was Open Office.org. I use that all the time, so that was fine by me.

Opening the file was simple enough, although the program asked me whether I wanted to register the .mdb database online (what the fuck?), and it also insisted on creating a new file to work from, instead of the .mdb. My guess is that OOo actually only reads its own format, but has a conversion tool for converting .mdb to .odt.

Once I had managed to open the file, I went into the Tables section and opened up the table I wanted as CSV. I expected there to be a simple “save as…” export function to save the table as either a .csv or even an OOo Calc document. But no…

I couldn’t even select multiple fields to copy into a spreadsheet or even a word-processor table!

In the end, after a few hours of absolute frustration, I found that this is the simplest way to convert a .mdb table to a .csv file (as far as I know):

  1. Import .mdb into OOo.
  2. Create a report, using the table you want, and all fields of that table.
  3. Select the entire table, and copy it to the clipboard.
  4. Create a new spreadsheet.
  5. Paste the clipboard contents to the spreadsheet.
  6. Save as CSV.

Now that, I think you will agree, is a very fucking roundabout way of doing this, but is the shortest way possible at the moment!

I was told that it was possible to shorten this, by replacing step 2 onwards with a simple SQL statement “select * into text `file.csv` from `mytable`“, but of course, when I tried that, I got a bunch of errors.

I hope OOo becomes a little more interoperable with its other parts soon. It is a shame I can’t just select-all from the table view, and either paste directly into a spreadsheet, or save as a .csv.

21 Aug

the shootist

I watch two or three films every day – there is an incredible amount of story out there. Today, I watched John Wayne’s “The Shootist” for the first time.

An incredible film! I recommend it to anyone – whether they are fans of westerns or not (I’m not, usually).

I couldn’t begin to describe it, so here is a quote from IMDB’s entry:

You Really Should See This Film, 20 October 2003
Author: Dr. Mike from El Paso, Texas

John Wayne is an icon, and so many viewers seem to use his work as a referendum on the larger geo-political issues of our time. I find that distasteful, as this isn’t a political movie, and one that doesn’t even have an oppressed indigenous person in it. This is a personal story of a man who “has outlived his time”, who is dying of cancer, and yet is determined to die with dignity. John Wayne really was dying of cancer when he made this movie… he gathered old friends around him–the widow of Humphrey Bogart, Jimmy Stewart, John Carradine, and addressed the topic of how legends die. (Selling the rights for his corpse to be displayed by the undertaker for $50 cash in advance was a particularly interesting idea.) I am viewing this film 27 years after it was made, and there is ‘something’ it had which is absent from movies today. It is a film addressing mature themes for one thing, but it had a pacing, and made time for it’s dialouge–it was never dull, never slow, but proceeded towards it’s climax with the sort of gravitas you very rarely see in today’s cinematic roller coaster rides, which have become little more than special effects vehicles. There is another reason to see this film–it looks back at 1901 with a loving vision. I was impressed with the historical accuracy in which it was filmed–it was impressive to see the town, from the horsedrawn street car and the Stanley Steamer, to little things like the flour dispenser in the kitchen. (Wondered where it was filmed–perhaps the old Old Tucson Studio before it burned down and was rebuilt to be a tourist attraction?) Anyway, this was a lovingly crafted film–I don’t know if Hollywood could still pull this off “as real” in 2003. So, for big reasons and small, “The Shootist” is worth your time. It is deeper than it looks.

14 Aug

Sajax, without ActiveX

On Friday, I announced a non-ActiveX version of XMLHttpRequest, with the proviso that it would require server-side magic.

Sajax 0.10 (the current “stable” version) does not provide that needed fiddliness, but, perfect timing, really, Sajax 0.11 does.

I have hacked that code and improved it. Here is my amended Sajax.php. The improvements:

  • The script falls back to IFrames if ActiveX is not supported.
  • You may have multiple Sajax instances attached to the same document, with different source URLs.
14 Aug

eircom's webmasters suck

This is getting on my wick. For years (really – years), Eircom has had a stupid annoying JavaScript alert on its front page warning that Netscape was somehow insecure and that entering your username or password anywhere in the site could somehow open your computer up to all sorts of malicious hacker damage.

Are they idiots? “Netscape” is based on Gecko, which is many times more secure than IE. There is no alert when you visit in IE!

I’ve contacted them twice so far in the past about this, and twice, they’ve replied saying basically that I was smoking crack, and that the alert I was talking about did not exist – oh and am I sure I’m talking about eircom.ie and not eircom.net (which, by the way, does not have an alert, so that question was stupid anyway).

Here is a screenshot taken in Konqueror (note: this is not Netscape, or even Firefox).

I am not imagining this!

Here is the message I just sent to them – again.

I’ve been in contact a few times in the past about this problem, and each time, I’ve been basically brushed off with a “this problem does not exist – you’re making it up” response.

Please look at this screenshot:

http://verens.com/i/eircom.ie.png

That alert pops up every time I visit eircom.ie with a browser which is not Internet Explorer (which, by the way, does not work on my operating system (Linux), so you can’t say “well, just use Internet Explorer, then”)

Please stop discriminating against non-IE users. My browser is /not/ insecure. And, by the way, it’s not Netscape either, so the alert is irrelevant anyway.

In the past, I’ve tried getting you lot to fix this, and have had replies such as “You should be talking to the eircom.NET support team” – look – this problem is on the .IE website – please fix it.