Forgot your password?

typodupeerror
User Journal

Journal: Pacman coding contest 2

Journal by Alioth

To celebrate 30 years of "Pac Man", at this year's Retromañï½Âa (University of Zaragoza, 8th - 12th November) there's a Pacman programming contest (with prizes!). Information about the contest and rules can be found here:

http://www.retroaccion.org/sites/default/files/eventos/retromania/2010/concurso_pacman/RM10-ProgPacman-english.pdf

There's two categories - one for games programmed beforehand (so that people who can't go to Retromañï½Âa can put in an entry) and for those programmed during the event.

I'll myself be off to Retromañï½Âa, not for anything to do with the Pac man coding contest, but to demonstrate and explain the ethernet hardware that I've made for the ZX Spectrum (itself coming close to its 30th anniversary). Indeed that entire week is going to be an orgy of retro geekyness, the weekend leading up to it is R3PLAY in Blackpool (retrogaming event), then I'm off to Zaragoza for Retromañï½Âa, and then on the way back I go via Madrid for a small gathering of retroafficionados in a bar somewhere in Madrid. Three events in less than 10 days.

User Journal

Journal: That was Britain's first Vintage Computing Festival 1

Journal by Alioth

So the VCF finished yesterday afternoon.

It lived up to and exceeded my expectations, what a fantastic event. Unfortunately, I didn't really get to see all of what was going on since I was manning my own stand a lot of the time (four Ethernet-networked Sinclair Spectrums, with a MicroVAX fileserver - all of this connected to the internet! - plus a Vectrex since people seem to really like them). My stand and Chris Smith's were next to each other (he reverse engineered the Spectrum ULA for a book he's writing, which charts the history of Ferranti's ULA technology and Sinclair's use of it) - we were hoping to get his Harlequin (100% accurate Spectrum implementation consisting of 74HC logic ICs) onto the network too but his stand was so busy he spent all his time talking to visitors!

The Spectrum twitter client went down very well. I think there were about 8 pages of tweets from the Speccy by the end of Saturday. I really ought to have put a counter in the client to give a definitive count of how many tweets had been made.

I picked up a double density disc drive for my BBC Micro while I was there, and also fixed one of my 128K "toastrack" Spectrums (all it had was a bad transistor in the power section and a dodgy keyboard membrane). Unfortunately I forgot my USB lead for the camera so no pictures till I get home.

Probably the highlight of the show was the talk by Sophie Wilson (designer of the BBC Micro and the ARM CPU, that last bit being very highly significant). If I had the choice of seeing Sophie Wilson or Bill Gates at a computer show, it would be Sophie Wilson every time. She may not be 0.1% as famous as Bill Gates, but I think she is actually a lot more important and significant than Bill Gates. Nearly anyone could have been a Bill Gates, he got where he was due to luck and sticking his neck out a bit (at no real risk to himself, he was already backed by a very rich familly) - if Compaq hadn't cloned the PC, and if IBM had been more closed about the PC specification, Bill Gates and Microsoft may have been just another footnote, remembered only for their truly dreadful BASIC on the Commodore 64; once PC cloning happened, for Microsoft to make money off DOS was about as difficult as falling of a log. But on the other hand, ARM only came about through lots of real intelligence and thought and grit and determination - and today ARM ships 1.25 *billion* units per *quarter*, more than every other microprocessor architecture put together. When the ARM was designed, Hermann Houser jokes "we gave the ARM team exactly what they needed, no resources and no money" :-)

And without the microprocessor designers, where would software people be?

User Journal

Journal: Sinclair Spectrum Twitter client 2

Journal by Alioth

It's the UK's first Vintage Computing Festival next weekend, so I've been getting some stuff together for my Speccy exhibit. Of course I've been working on the Spectrum ethernet card, and while things like the network filesystem it provides are handy, I thought I needed something that VCF attendees could appreciate.

A while ago we did a "hack" of a Twitter client (over a pint of beer, in a pub in Oxford - while getting strange looks from all the "normals") but it was just that - a hack - with the tweet and the login details hard coded into a short asm program. This time I've written a proper http library, and some user interface. Most of the work is done by the HTTP library (parsing headers, putting headers into the request etc), and it's all written in C.

If you can't get to the VCF, you can at least watch a video here:

http://www.youtube.com/watch?v=-ECnN7jdgA4

User Journal

Journal: Cooking for Friends - Mushrooms in white wine sauce

Journal by Alioth

Thanks to a friend via Facebook, I discovered a good food ideas site, called "Cooking for Friends" - or at least, "Cocinar para los amigos" (it was from a Spanish friend). I saw a recipe go past the other day that I thought looked awesome, so I made it last night - just for myself, I like to test recipes out on myself before I try them out on other people :-)

And it is indeed awesome. For the benefit of those who don't know Spanish I'll repeat it here. The original is here:

Mushrooms in a white wine sauce
http://cocinarparalosamigos.blogspot.com/2010/05/champinones.html

It's a very easy recipe to make. All it needs is garlic, a glass of white wine, some grated bread (to thicken the sauce) and parsley. The recipe as made also includes a small amount of chili (I didn't have the little ones that he shows in the video of the recipe, so I just used a small amount of fresh chili I had in the cupboard. I think it needs just a *small* amount, it's not supposed to set your mouth on fire...) I also made half the quantity that the recipe demands, on the grounds that I was trying it out on myself, not trying to do a starter or a side for four people.

Ingredients:
500 grams (1lb) mushrooms
4 cloves of garlic
a little olive oil
a small heap of breadcrumbs (basically, enough to fill a wooden spoon heaped up)
a branch of fresh parsley, chopped finely
a little chili (I've not seen the tiny chilis that were shown in the video anywhere near me, so I used a small amount of sliced chili)

Put some olive oil in a pan, enough to start cooking the garlic and put on the heat, drop in the garlic. Once the temperature has come up and you've got typical "starting to fry" sounds, add the mushrooms. After 2 minutes, add the glass of wine. Give it a stir and allow to simmer for about 10 minutes with a lid on the pan. After 10 minutes, add a little water, the breadcrumbs and the chili. Let simmer for about 20 more minutes with the lid on - the sauce should be thickening nicely from the grated bread and the evaporation of some of the liquids. Then add most of the parsely and stir for a couple of minutes.

Then serve, sprinkle the remaining parsley on top.

This will make a great starter - I'm going to cook it next time I have friends or family over for dinner.

User Journal

Journal: Britain moves one step closer to thought crime

Journal by Alioth

http://www.theregister.co.uk/2010/05/10/twitter_bomb_joker_guilty/

This is the very problem with broad legislation like the Terrorism Act. Not only cases like this, but these days it is an offence to have "information that may be useful to a terrorist" (and the onus is on the defendant to prove that it's not, which reverses the principle of the accusers bearing the burden of proof). A recipe for a bread roll is, after all, information that may be useful to a terrorist, a terrorist has to eat after all.

User Journal

Journal: Spaghetti Sauce 3

Journal by Alioth

A couple of weeks back I went to an Italian restaurant with some friends from work. I had a salmon dish (since I don't speak Italian, I can't exactly remember what it was called) - basically, salmon fillet baked with lemon. The side was spaghetti and spaghetti sauce. Two thoughts struck me: (1) the food is incredible and (2) it can't be at all difficult to make at home.

So I made it. What makes it really is the contrast between the lemoned salmon's tartness and texture, and the sweetness of the spaghetti and sauce. I just guessed at what to do with the salmon and it turned out good. The spaghetti sauce - I had a look at various recipes on the internet, and in the tradition of open sauce (yes, go on, groan now) I decided to use ideas from several to come up with sauce code (yes, groan again) that I thought I'd like best. And in those traditions of Free Sauceware, I'll share what I did...

The salmon is easy, each salmon fillet (adjust quantities to taste, but I reckon this is a good starting point)
* 1 salmon fillet
* About a tablespoon of olive oil
* A thin slice of lemon
* About 2 tsp of lemon juice
* Just a pinch of sea salt
Wrap in foil and put in the oven for 20 mins at 180 celsius (if you have a fan oven). I found it was good to prepare the lemon and salmon in the morning and let it sit and marinade until the evening.

The spaghetti sauce (enough for 4 people, or two very hungry people):
* 500g small (cherry) tomatoes
* 1 tube (about 150g) tomato puree (if in your locality it's called tomato paste, make sure it contains nothing but tomato)
* 2 tsp brown sugar
* 1 tablespoon basil
* 2 tablespoons rosemary
* 5 cloves of garlic (or to taste), finely chopped
* 4 tablespoons of olive oil
* 1/2 teaspoon sea salt
* 1 onion

Chop the tomatoes (into quarters I think is best), slice and dice the onion into small bits, and chop the garlic finely. (I have a device with a handle on that you wind for mashing garlic rapidly into small bits, I don't know what it's called - I inherited it from my grandfather and it's at least 40 years old but it's so insanely useful I'm sure they are still available today) and put in a bowl and add the rest of the ingredients. Then give it a good stir. Once again, I found it was best to prepare it in the morning and allow it to fester in its own juices until dinner time.

To cook, put in a pan and stir on a medium heat until it's ready. Generally it should take less time than the actual spaghetti.

The way the Italian restaurant served this was to leave the salmon in its foil, sitting in the lemon juice and olive oil and serve the spaghetti and sauce as a side. I think that works very well.

User Journal

Journal: Debian users are without ClamAV - mail servers broken 1

Journal by Alioth

Well, this morning I found my mail server had died. Postfix was up just fine, but the logs showed that it was failing while passing messages via clamav.

ClamAV was complaining about a bad daily.clv file, and looking at clamav's website... oops, the version of ClamAV in debian-stable has been *disabled* deliberately by ClamAV! (The issue: that version uses too much bandwidth when updating its AV database and ClamAV can no longer tolerate the bandwidth usage).

Oops. Any Debian mail server that passes mail through ClamAV is currently down, unless the admin already knew of this and compiled a new ClamAV or uses Debian unstable.

Looking at sendbug, Debian have been informed... I don't see any information about when we'll get a new ClamAV package, so it's time to compile the latest from source.

User Journal

Journal: Why machine translation won't be all that good for a very, very long time... 2

Journal by Alioth

A couple of things recently really highlighted why machine translation is going to be awkward and clumsy for years to come, and why even human translation is so damned difficult when you get into colloquialisms and jokes.

A couple of weeks ago, I was with a friend in Wichita and we were at a Mexican restaurant. He mentioned he'd seen a Mexican movie (ÂY tu mamà también?) - a movie subtitled in English, and that some of the audience was getting a laugh out of *something*. He wondered why - was it just a bad translation? Probably not, I answered. Probably a play on words or a double meaning that just doesn't translate to English, or perhaps something cultural (for instance, there are jokes that are funny in Britain but would leave Americans thinking "uh?" due to cultural differences, and vice versa - despite the shared language).

Today I came across one of these. There's this geek comic strip made in Spain called TiraEcol. It's translated into many languages (and I don't know how the attempts to translate it worked in others) - but the English translation just didn't work, and I can't think of any way of actually translating the play on words so it works in English. The original Spanish is here:

http://www.tiraecol.net/modules/comic/cache/images/tiraecol-351.png

And the English here.

http://en.tiraecol.net/modules/comic/cache/images/tiraecol_en-346.png

The last frame will leave the English speaker thinking "Uh?"

But in Spanish, you say your computer crashed by saying it's hung. Furthermore, in Spanish, the personal pronoun is almost always dropped - so it could be "it hung", "he hung" or "she hung". In Spanish, if you want to say "It crashed", you say "Se ha colgado". If you want to say "she hung herself", you say "Se ha colgado". So you have the double meaning for the joke in Spanish, but which is lost in the English translation - Nano responds "What, the program or the girl?" which doesn't really work for "Uh oh, crash".

Indeed, the dropping of pronouns means that machine translation from Spanish to English generally results in something ugly. A human being knows whether someone's talking about "he", "she" or "it" from context, and with the verb conjugation in Spanish, a human doesn't need the pronoun to understand what's going on, because we already grasp the context from what happened earlier. But this is highly problematical for a computer, and quite often the machine translation will guess completely wrong whether the thing in the sentence is a "he, she or it". Also the pronoun for the indirect object is the same for "him, her and it", and again, machine translation frequently picks the wrong one when translating to English. (I can only imagine how tough it will be for languages which come from cultural bases significantly different from ours, such as Japanese or Chinese). Translations have been getting better, especially for things written formally, such as news or technical items, but they will continue to suck for a very great deal of time for informal writing or speech.

So don't use the excuse "oh, we'll have good machine translation soon" as an excuse for not learning a language, at least not for the next three or four decades :-)

User Journal

Journal: Adventures in Functional Programming, part 1 6

Journal by Alioth

And now for something completely different.

For years, just like pretty much anyone else who writes software, I've been using imperative languages. All the days from ZX BASIC, BBC BASIC, Z80 assembler, 6502 asm, C, C++, Perl, php and Java. (And even some COBOL, but I don't like admitting to that). Most recently, most of what I do is in Perl, or shell script, or Java.

That's a long time habit of doing things like "i++".

At times, out of disaster comes opportunity, Recently, our largest customer went into administration (for US readers, I'm not sure how this maps to Chapter 11 or Chapter 7, but basically it means the company is insolvent, and its management has been taken on by a third party who will try to sell what's left). This has left me with quite a lot of time to spare because a project I would have been working on right now is currently on hold until the situation with our customer is resolved (and the outcome looks like it should be favourable).

I've heard bits and pieces about functional programming, and Haskell, and Erlang - but never really had looked into it. My memory was jogged on Erlang when I was reading an article about telephone exchanges, somewhat coincident with the above catastrophe with our customer. Erlang was initially developed for telecommunications, where five 9s are simply not good enough, and I'm always interested in something that can help me make more reliable systems. I'd rather be developing than cleaning up after a system crash. So the time was ripe to start on Erlang.

What makes me interested in this language is that it is a tool that's designed for making reliable, concurrent systems. It has good features for that such as extremely light weight processes, the VM supports upgrading software *WITHOUT* having to shut down the program - you can upgrade/fix a service that's running and NOT shut it down to load the changes. It is also a functional language. And functional languages to me are (at least until last week) an alien concept.

The journey has only just begun. I started with "Learn You Some Erlang for Great Good" (it's titled in Engrish, but written in English) - http://learnyousomeerlang.com/ . I now also have the O'Reilly Erlang book, which I'm just about half way through reading and working through the examples.

The striking thing is you have to think a bit differently for a functional language like Erlang. You don't so much as describe how a task should be completed, but declare What The Truth Is - in a way that is very similar to how you write functions in mathematics (indeed, one of the first examples in Learn You Some... is a function that returns the factorial of a number, and the Erlang has a direct correspondence with the way a mathematician would write a factorial function). The way lists can be manipulated (list comprehensions) is straight out of mathematics set theory. Although the language looks strange and impenetrable and ugly at first, soon you see a mathematical beauty emerging. The other striking thing is that variables aren't. (I'd have called them "invariants" - calling them variables isn't all that accurate since they can't be varied once assigned). But you don't need variable variables in a functional language.

The other striking thing is how you must think differently with Erlang if you're making a concurrent system. The O'Reilly book points out that they've encountered time and time again, when people from an imperative background start using Erlang, they do it wrong - they write the system like they would in, say, Java, so with a minimal level of concurrency. But processes in Erlang are really, really cheap so you've got to get rid of all those ideas on how to write a large system. For example, the book cites how one group had set out to make an IM proxy in Erlang. They had one process handling the sockets from clients, another process doing some work on the data, and a final process emitting the data to the downstream servers. They ran into trouble with more than half a dozen concurrent messages. But how they should have designed it is to create a new process for every single packet - processes are *that* lightweight that you can make tens of thousands of them quickly and without huge memory overhead - and their proxy could handle orders of magnitude more simultaneous messages. Interprocess communication is also very lightweight, and lacks the shared memory drawbacks of traditional threads. Essentially, in Java or C++ or C# you think like the Protoss - a few heavy weight warriors. If you write Erlang, you have to think like the Zerg. A veritable swarm of lightweight processes, and zergling rush your problems :-)

This neatly segues onto something I did many moons ago in university. We learned a design methodology, written by a man called Michael Jackson (not the dead singer, the still alive computer scientist). JSD (Jackson Structured Development) and JSP (Jackson Structured Programming) were methodologies developed in the 60s and 70s, and today are largely forgotten, in fact in the 90s when we were learning this stuff there was much grousing about it being "obsolete"... but one thing that keeps coming back was when analyzing your problem, you analyzed it as if you had the perfect concurrent system and so you modelled every small problem as a completely new process. In those days you'd eventually flatten it down to effectively a single thread. I remember remarking to a classmate at the time that there seemed to be an elegance of starting your model as if you had the ideal concurrent system because it made it clear - and that perhaps one day we would have a system in which you could take the design and implement it as a concurrent system, just as you had drawn it. Perhaps it's time that JSD was revisited, because in Erlang you DO make every single little process that happens in your inherently concurrent world an actual Erlang process, just like Jackson suggested you model it! JSP, which we used in COBOL at the time, and COBOL itself was the source of much grousing - (JSP is specifically good at program design when you have an input, you transform it, and make an output. The stuff of many COBOL programs. If you model your inputs and outputs correctly, the resulting program structure makes programming a simple mechanical task and you get no logical errors in your code) - it strikes me that JSP fits amazingly perfectly with XSLT. Indeed, JSP models everything as a tree. Now what's XML? Basically, your program structure is exactly how XSLT is structured - a tree. So is your input and output.

So perhaps Michael Jackson really is a genius, too.

The past always looks better than it was. It's only pleasant because it isn't here. -- Finley Peter Dunne (Mr. Dooley)

Working...