CSS woes

July 17th, 2008

I think I finally figured out how to properly center images that are wider than the column (450 pixels). I couldn't seem to get all four cases (image<=450 pixels, image>450 pixels)x(IE, FireFox) working correctly. I finally resorted to using a different image class for wide images, which looks like this:

img.centerwide {
	display: inline;
	margin-left: -287px;
	margin-right: -287px;
	position: relative;
	align: center;
	text-align: center;
	}

Of course, I'm sure this breaks every web design rule in the book and probably doesn't work for some of the less popular browsers. Oh well, it'll do for now until somebody complains. I really ought to learn about HTML and CSS properly.

Programs I want to write

July 16th, 2008

There are a lot of programs I want to write.

Which of these do you, my blog readers, think I should work on? Comment below to vote. I don't promise to abide by your decision, though.

There are also a number of projects I have wanted to work on in the past but which aren't currently inspiring me for various reasons:

  • Digger (plus Styx and Sopwith) - I now think that emulation rather than remastering is the best solution for these old games.
  • CRTC emulation and other MESS work - superceded by the Modular Emulator and NTSC decoder.

Overlapping images in escape time fractals

July 15th, 2008

This is a post I made on sci.fractals recently (it didn't get any replies there though).

I've been playing about with drawing escape time fractals using different formulae. I've noticed that some formulae give images which seem to have a strange feature - in some places it looks like there are two overlapping images, with one image showing through in areas of the other.

For example, here is an image I made using the formula
z <- (z+1)*(z+c)*(z+i)

Can anybody help me to understand what is going here? Are there really two iterative process going on hidden in one formula or is it an illusion? Does this phenomenon have a name that I could search for to find out more about it?

Modular emulator

July 14th, 2008

Among the many programs I'd like to write is a replacement for MESS (and possibly also MAME while I'm at it). Don't get me wrong, I think these are fantastic pieces of software but I do have some problems with them that can really only be solved by starting my own emulation project rather than by contributing to them. In no particular order:

  • I like writing software from scratch.
  • They are written in C with all kinds of macro trickery to make it more object orientated. I'd rather write it in C++ or some language of my own devising.
  • I don't like the unskippable startup screens that MAME and MESS use. I'd like to set up a PC emulator using a free clone BIOS and DOS and distribute it as a turnkey method for running old games like Digger.
  • I'd like to make it possible to "build" emulated machines at run time (without having to create a driver etc.). You'd be able to say "connect up this CPU, this sound hardware, this video hardware and load this ROM at this address" and it would all work. The emulator would come with a set of pre-written modules, it would have a language for designing modules and plugging them together and possibly even a graphical designer for wiring things up.
  • MAME and MESS timeslice much more coarsely than I'd like to. They emulate the CPU for a while (until a new frame or an interrupt starts usually) then see what the screen has done in that time, what sound was output in that time and so on. I'd like to timeslice on a cycle by cycle basis for more accurate emulation (so raster effects can be done with horizontal pixel accuracy) and to enable emulation of things like the prefetch cache on the 8088 (the lack of which makes MESS about 30% too fast).This sounds like it would make emulation very slow, but in fact if we organized it well and all the code fits into the CPU cache, we'd be doing no more work than MESS is now.

Lemon Meringue Pie

July 13th, 2008

Ready made pre-cooked pastry case. - You should be able to get this and it will save all the hassle of making pastry. I don't know what sizes are available but the following is enough filling for one 18-20cm diameter. If you get a smaller one the right size for say 2 -3 portions, just halve the quantities. You might want to make a full sized one and make it last several days - or invite someone to dinner!

  • 2 large lemons
  • 275mls cold water
  • 50g granulated sugar
  • 40g butter
  • 3 level tablespoons cornflour (they might call it maize flour but it's white not yellow)
  • 2 large eggs
  • 110g castor sugar

You'll need a grater with a fine grating surface, - looks like a lot of barnacles! Hold the grater onto a plate or chopping board with your left hand and take a lemon in your right. Rub the lemon on the grating surface in a circular motion, turning the lemon as you go, so you scrape off all the yellow zest but none of the white pith underneath. Repeat this with the other lemon. Scrape or brush all the zest off of the grater and the plate/board into a saucepan. Add the water and the granulated sugar and bring it to the boil, stirring from time to time to dissolve all the sugar.

Put the cornflour into a jug. Squeeze all the juice out of the lemons removing the pips and add it to the cornflour. Mix it to a paste (called slaking - don't ask me why!) and stir it into the hot lemony water. Keep stirring until it's thickened or it will go lumpy! Remove from the heat and add the butter stirring `til it's melted. Separate the eggs as I described in the chocolate mousse recipe. Stir the yolks in to the lemony sauce. Pour it into the pastry case.

Put the whites into a clean dry bowl and whisk with your electric whisk until stiff. Turn the whisk to a slower speed and whisk in the castor sugar. You should get a glossy meringue mix you can spread over the lemon filling and fork up into little peaks.

Cook it in the oven at 150°C. Delia Smith says it takes 45 minutes but I don't think it'll take that long - I never time it! I'd guess maybe 20 - 30 minutes. Just watch it `til it looks done.

You can't freeze leftovers so you'll just have to eat it all. What a hardship!

Blackberry cobbler

July 12th, 2008

For the weekend's recipes we will turn to desserts (or, as we call them where I'm from, puddings). I haven't made up any pudding recipes so both this one and tomorrow's are from Mum.

This one works best if you pick the blackberries yourself. I've only made it a couple of times myself - the first was in Cambridge and it turned out absolutely perfect. The second was in Redmond and it was inedible (I'm not sure if the blackberries I used were the wrong species or too old, but some of them left streaks of black instead of red in the bowl and tasted awful.)

  • 1lb blackberries
  • 2oz sugar
  • 1tsp lemon juice
  • 0.5oz butter

For the topping:

  • 4oz plain flour
  • 2tsps baking powder
  • 0.5tsp salt
  • 1 egg
  • 2oz castor sugar
  • 4 tbsps milk
  • 2oz melted butter

Put the blackberries in an oven proof dish, sprinkle them with the sugar and lemon juice and dot it with the butter cut into little bits.

If you have a food processor, put all of it except the butter into the machine and whizz it up then pour the melted butter in through the spout. Otherwise:-

Break the egg into a bowl, add the sugar and beat it well to mix. Stir in the milk and melted butter. Sift the flour, baking powder and salt into an separate bowl and them add it gradually into the egg etc beating it to get a smooth batter. Pour it over the blackberries and cook it in the oven 180°C or gas 4 for 30 - 35 mins.

Toad in the Hole

July 11th, 2008

This recipe is based on the one from this book which my parents bought for me when I went off to university, but I have tweaked it a bit and made it more specific. This is the only thing I've made the book regularly - it now falls open at this page.

(To serve 2)

Put 7 breakfast sausages in a metal baking pan with a bit of cooking oil and put them in a 425°F oven for 7 minutes.

While the sausages are cooking, put 4 heaped tablespoons of plain flour into a bowl, add a couple of pinches of salt and a couple of eggs. Beat the egg into the flour (this is much easier with an electric whisk) until it's homogeneous. Gradually add 1 cup of milk while continuing to mix. If you add too much milk too quickly it'll go all lumpy.

Pour the batter over the hot sausages and oil (this bit makes a nice sizzling sound) and bake for about 24 minutes. Try not to open the oven door for the first 10 to 15 minutes, so that the pudding will rise well. The Yorkshire pudding should be golden brown.

About 10 minutes before it's done, wash a couple of medium-sized potatoes, stab them all over with a fork and put them on a plate in the microwave for 10 minutes. Peel and slice up some raw carrots to serve with it as well.

Plate it up and eat it with a nice tall glass of cold milk (you may be sensing a theme here with the beverage choices - I do like a nice glass of cold milk with a hot meal).

Pasta dish I made up

July 10th, 2008

This is another one I made up myself in my bachelor days.

Cut up some vegetables into small pieces. I found the best combination to be:

  • Celery (1 stick per person)
  • Red bell pepper (1/4 per person)
  • Carrot (1 per person)
  • Onion (1/2 per person)

Add some chopped garlic if you like.

Slice up some bacon as in yesterday's recipe and cook it with the vegetables. The vegetables will fry nicely in the fat from the bacon.

Cook some pasta (I like the twisty ones), drain it and add some sort of pre-made tomato-y sauce. I found one in the supermarket that just said "made with Meat" (no specific animals species were mentioned) so I used that for amusement's sake and it worked pretty well.

Mix the pasta and the sauce together and then dump that into the saucepan with the vegetables and bacon. Turn the heat right up and keep stirring it until the runniness disappears and it acquires a more gloopy consistency (technical term).

Plate it up and eat it with a nice tall glass of cold milk.

Spaghetti carbonara

July 9th, 2008

Soon after I moved to the US I fancied eating this but didn't have a recipe. So, I looked up one on the internet and adapted it to what I happened to have in the apartment. This isn't exactly what most people would consider carbonara (it's more like scrambled eggs and bacon with spaghetti) but it's filling, yummy comfort food.

Cut up some bacon (2 or 3 slices per person) into pieces about 1cm wide. I sometimes cut off most of the fatty bits to make it a bit healthier but this could quite rightly be considered an abomination.

Put some water on to boil and when it gets there put the spaghetti in and turn it down to medium. That's about the right time to put the bacon on. Put it in a nice big saucepan on a medium-high heat (not too hot or the fat that oozes out from the bacon will burn off before the bacon gets a chance to sizzle in it). No extra oil should be necessary.

While the bacon is frying, put some eggs (2 per person), a bit of salt and pepper and some grated cheese (the more kinds of cheese the better - I have had good results with cheddar, shredded mozzarella, parmesan and chevre). Mix it all up together.

If the bacon is done before the spaghetti, turn the heat down to low to stop it getting too crunchy. When the spaghetti is done (which should take 10 minutes or so - you want it just a little al dente but not so much that you get bits of it stuck in your teeth) strain the water off and dump it into the bowl with the eggs and cheese. Turn the heat back up on the bacon now if you turned it down before. Stir that about a bit so that the spaghetti gets coated in the egg. Once it's nicely homogeneous, plop it into the saucepan with the spaghetti and bacon juice. Stir it around a bit until bacon is all mixed in and the egg is just beginning to solidify. I find it's better if the egg isn't completely cooked through but be warned - undercooked eggs might give you food poisoning. I've not killed anyone with this dish so far though.

Plate it up and eat it with a nice tall glass of cold milk.

Risotto

July 8th, 2008

Another of Mum's recipes.

An easy one pot meal good for using up odd leftovers. As long as you have oil, onion, rice and water everything else is flexible.

Per person:

  • 1 very small onion chopped (or half a bigger one)
  • chopped or crushed garlic (optional!)
  • 1 bay leaf (optional but recommended)
  • Chopped herbs (optional but recommended - you could use dried)
  • 75g long grain rice ( "easy cook" rice is good as it won't go sticky)
  • 190 mls hot water ( = 2.5 times volume of rice)
  • half a stock cube
  • 1 tablespoon oil
  • salt & pepper ( stock cube may be quite salty so you might not need much salt you can always add more when it's on the plate)

any or all of the following, quantity depends on how hungry you are:-

  • cooked meat, - bacon, chicken, sausage
  • celery - chopped small
  • carrot - chopped small
  • peas
  • sweetcorn
  • peppers - chopped small
  • chopped tomato
  • sliced mushrooms
  • anything else you've got that you think will taste good

Dissolve stock cube in hot water.

Heat oil in saucepan and cook onion and any raw vegetables until onion is softened. Add garlic, bay leaf and rice a cook for a minute or so. Pour in stock and bring back to boil. Add everything else and simmer gently until rice is cooked and all the liquid is absorbed. Watch it doesn't stick to the bottom of the pan near the end of cooking time. Take out the bay leaf and sprinkle with grated cheese to serve.

Easy or what!