Bread Pudding

Whenever I went to my Nan’s house, she would always have a large variety of (generally very fatty) home baked goods on offer.  There was one which I could never resist, and this was her bread pudding.  Ever since I got into baking, I’ve been trying to work out what exactly it was and how you’d go about making it.  I didn’t even know what it was called – which made finding a recipe very difficult.  I described it as “a bit like a very moist fruit cake, with sultanas.  More like a jelly than a cake”.

My Nan grew up in a family for whom times were hard, and you really had to make do with what you had.  You couldn’t afford to waste food.  So things like stale bread got turned into something more storable and palatable with what you had on hand.  And, going with that tradition, I have made a slightly different recipe with what I happen to have on hand.  Due to an error of judgement with my milkman, I’ve ended up with a LOT of loaves of bread.  Most of them are frozen, but I don’t get through the thawed ones quick enough, and they go stale before I eat the whole thing.  I also have far too much milk.  Thus, I have been given a perfect opportunity to refine my recipe.

It’s deliciously moist and tasty, hot or cold, and full of flavour, and goes great with tea.

Ingredients

  • About 400g of stale (but not mouldy obviously) brown bread, crusts removed
  • About 200g of sultanas, or any other dried fruit that you fancy
  • 100g of brown sugar (any kind)
  • 1/2 tsp mixed spice
  • Dash of cinnamon
  • 1 tbsp marmalade
  • 1 egg
  • 1 pint of milk

Method

  1. Remove the crusts from the bread.  Eat the leftovers so you grow up to be big and strong – alternatively share with housemates/friends/partners/pets.
  2. Put the bread into a bowl, and break up as much as you can by hand.  Great stress reliever.
  3. Empty the milk into the bowl, and mix up the bread good and proper.
  4. Add the dried fruit and mix it in.  May as well throw in the mixed spice and cinnamon at this point too.
  5. Leave this to soak for about half an hour.  Go do some work or something.  Alternatively, cover and put into the fridge and go to work.
  6. Come back.  Add the sugar and marmalade, and mix well.
  7. Crack an egg into a cup, beat it with a fork.  Empty it into the mixture, and mix it up some more.
  8. Get a pyrex dish, or a nice clean baking dish, and cover it in butter (otherwise it’ll stick to the sides).
  9. Empty the mixture into the dish, and put it in an oven pre-heated to about 200C/392F/Gas Mark 4 for about 1.5 hours.
  10. After an hour and a half, you should find it’s got a nice dark brown crust over the top, and it’s starting to break away from the sides a bit.  Take it out of the oven, and leave to cool for about 30 minutes.
  11. Once it’s cool, you can cut it up and serve it – perhaps with some custard.  Or you can leave it to cool completely and put it in the fridge, for a tasty treat any time of the day (I’ve had it for breakfast, but then, I’m a bit strange).

And there you have it.  Delicious and cheap.  Try it!

SMS: Push me, Pull you

Lately I’ve been busy trying to implement a SMS interface for a small community radio station.

The way it works is this:  we’ve got a provider who recieves the SMSes on our behalf through a geographical telephone number (i.e. it starts 01227).  Once they recieve the SMS, they will use HTTP POST to send it to our servers.  It gives us the message, a unique ID for the message, timestamp and other such things.  Once we’ve got the SMS, we have to do something with it.

ProblemHow do you handle incoming SMSes in a live broadcast situation?

When in the middle of a live broadcast, every second counts.  If a presenter asks the audience a question at the end of a link, and then there is a 3-5 minute song until the next link at which point they will want to read the answers out on air. The faster we respond to listeners, the more likely they are to interact with us again.  So the aim of the game is to get the SMS from the phone to the presenter as promptly as possible.

Approach 1: Pull PHP/HTML interface

Lets say we have a script which takes the HTTP headers and stores them all into a table in a database.  We then have another script which p0lls the database, and generates a HTML web page with all of the latest SMSes to be entered into the DB.  This is fine, but we’d need to refresh the page frequently.  We could do this with AJAX or similar.  But, unless you are refreshing the feed very often (say, once every second),  you’re going to induce an amount of latency.  Also the constant polling of the XML file will generate load on the client, and the server, and cause lots of data to flow over the network even when there are no new messages arriving.

This method I would call “pull”.  Whilst the message is being “pushed” to us by our gateway provide, we are then buffering it and waiting for the client to pull it back out of storage.  Let’s not get all starry eyed about it – HTTP XML feeds are pull.  Pull methods will always have a timliness vs. resource utilisation tradeoff.

However, this approach will work OK on any standard web server with no special requirements.

Approach 2: Ajax Push

So perhaps a better way to go would be to push the message all the way from the SMS gateway to the end user.  We change our script that it will not only store the message in a database, but also notify the clients that a new message has arrived such that they can display it to the end user immediately.

After much googling around,  I came across the APE Project (Ajax Push Engine).

APE is a full-featured OpenSource solution designed for Ajax Push. It includes a comet server and a Javascript Framework. APE allows to implement any kind of real-time data streaming to a web browser, without having to install anything on the client-side.

The interesting thing to note here is that whilst HTTP feeds are normally pull, the APE server is a custom HTTP server which is written to allow the HTTP server to push data to the clients using some clever method (what I’m guessing is the Ajax with long polling method going by what I’m seeing in Firebug).

I spent about 20 minutes setting up the APE server on a Ubuntu Server VM.  Took  a little tweaking (the docs aren’t so clear here), but works excellently.

Then I found EsenAPE, on Paul’s Blog, which is almost exactly what I need.  The only trouble is that he’s using Esendex, who is not who I’m using.  So I’ll have to rewrite the inbound part.  Also, there’s currently no way of having the historic messages shown when you first log in, which is a must for our problem.  I’ll have to do some modifications to get that working. Apparently you can write SSJS modules to interface with MySQL databases, so that is likely the route I’m going to be taking.

How exactly we end up implementing this is yet to be seen, but I’d like to try out the APE server and see what it can do for us.  The ability to push data around out network,  and from outside of our network,  in real-time is quite exciting.

Palladium

Finally, I managed to replace my ancient desktop PC, beckett, with something that was designed in this century.  Going with my new naming scheme (elements) I’ve named it Palladium.

Palladium (pronounced /pəˈleɪdiəm/, pə-LAY-dee-əm) is a chemical element with the chemical symbol Pd and an atomic number of 46.

Quoeth Wikipedia.

I decided on a budget of £300, and got the best PC I could get with that money.  I was quite suprised at what I managed to get!

  • Be Quiet 350W Pure Power PSU – 80plus Certified
  • AMD Phenom X4 9650 2.3GHz Socket AM2+ 2MB L3 Cache Retail Boxed Processor
  • Antec 300 Three Hundred Black Case
  • Western Digital WD6400AAKS 640GB Hard Drive SATAII 7200rpm 16MB Cache – OEM Caviar Blue
  • ASUS M4N78-AM GeForce 8200 Socket AM2+ onboard VGA 8 channel audio mATX Motherboard
  • Kingston 2gb Ddr2 1066mhz/pc2-8500 Hyperx Memory Cl5
  • Xilence Red Wing 120mm Quiet Fan – 3&4pin connection
  • Logitech LX8 Blue Wireless Laser Mouse – USB

The mouse was a little luxury extra (which blew my budget by £10, but never mind).

To my great surprise, the shipment which was processed by eBuyer yesterday afternoon (after the transaction being blocked for fraud protection the first time) and was at my house via Parcel Force this morning.  And this is with Up-To-5-day-shipping, which cost me nothing.  Awesome!

I went for a nice case, and I have to say the Antec 300 is definitely a nice case.  Compared to my £15 ATX case I’ve been using, it’s like moving into a mansion after living in a shed.

Antec300

I opted for the 80plus PSU because I wanted it to be an efficient machine.  I’ve had enough of cheap power supplies with horribly inefficient power supplies that eat up almost as much power as the actual computer uses.

It’s got 4 fans in it, to keep it nice and cool (and efficient).  Also, I’ve set the fans to their minimum speed.  The theory being that if I have several big fans running slowly, it’ll be quieter than fewer fans running faster.  And it certainly is quiet.  Compared to my old beast, I can hardly tell it’s turned on any more.

It has a Phenom X4 processor in it.  It’s 64-bit (a new thing for me …) and it’s pretty nippy.  I used the stock heatsink, since I’m not intending on overclocking it at all, and the motherboard has the Cool n Quiet system so the fan doesn’t go crazy.

It’s got a single 2GB stick of ram in it – so I can upgrade to 4GB at a later date if I need to.

So far I’ve installed Windows XP and Ubuntu Karmic 64-bit on it.

PIC10F Assembly "Hello World"

So for a project, I’m using a PIC10F due to their very small size (in a SOT23-6, wow) and low cost.  They don’t have interrupt support, but they do have a timer, watchdog timer and a comparator.  You can do some fairly funky things with them.  However, I’m opting to use assembly for this project since it’s probably going to be simpler this way, as the stuff I need to do is very timing critical (reading sensors without interrupts = lots of polling).  Also I think I can squeeze the size of the program down better than a C compiler might do.

But I ran into a roadblock.  There are no documentations of assembly code listings for the PIC10F, and very few resources online.  So here’s a little snippet for you, which blinks an LED on pin GP2:

	list      p=10F222            ; list directive to define processor

#include
        ; processor specific variable definitions

    #define LightOn bsf GPIO,2  ; turn drive output on
    #define LightOff bcf GPIO,2 ; turn drive output off

;**********************************************************************
	ORG     0x1FF             ; processor reset vector
	ORG     0x000             ; coding begins here

    cblock 0x18 ; this is where we declare what to call user memory locations
      DelayTime:3       ; reserve 3 locations for delay counters
     endc

	goto Init
Start:
	clrwdt
	LightOn
	call Delay
	LightOff
	goto Start

Init:
    movwf   OSCCAL      ; load factory osccal value at start-up
    bcf     OSCCAL,0    ; do NOT output osc/4 on GP2 (IR sensor input)
    movlw   b'00000000' ; set all GPIO low at startup
    movwf   GPIO        ; load port latches
    movlw   b'00000000' ; All GPIO pins are outputs
    tris    GPIO        ; set I/O directions
    movlw   b'11011000'	; wake-up on pin change disabled, weak pull-ups off
                        ; Timer0 clock select on GP2 internal
    option              ; write to OPTION_REG

    ; clear all user RAM/variables on boot

    movlw  0x10         ; initialize pointer
    movwf  FSR          ; to RAM start
	goto Start

Delay					  ;
    movlw   D'2'          ; 2 = a delay period of approximately 500mS

Delay2                    ;
    movwf   DelayTime     ; pre-load W & enter at Delay2 for different delays
    movlw   D'232'        ;
    movwf   DelayTime+1   ;
    movlw   D'255'        ;
    movwf   DelayTime+2   ;
Dloop
    clrwdt                ; 1
    decfsz  DelayTime+2,f ; 1
    goto    $-2           ; 2/1
    decfsz  DelayTime+1,f ; 1
    goto    $-4           ; 2/1
    decfsz  DelayTime,f   ; 1
    goto    $-6           ; 2/1
    retlw   0             ; 2

	end

Delay routine and general structure is shamelessly stolen from Bruce on PICbasic.co.uk.

Hopefully, someone will find this useful :)

Lounge on the Farm: Outside Broadcast for CSR (Part III)

We did it! High fives all round.

After a lot of preparation, sweat and blood we managed to broadcast live, for 11 hours a day for 3 days, from a pigshed in the middle of nowhere. Here’s a little tour of our makeshift station:

This is the Edit Suite and Tech Corner, fully set up. As I mentioned in Part II, we have the encoder on the back wall which encoded audio from the studio (coming up next), and sent it over the point to point wireless link. The edit machines saw a lot of action, as we (the tech team) dashed about the site transporting Marantz recorders from the various stages back to base to be edited for broadcast. They were also used to edit interviews and other bits of audio for broadcast. Once the editing was complete, the data was transferred to the Playout machine in the Studio, where they were added to the database and played out on air.

Here’s the studio. Presenter goes behind the desk, guests and co-hosts in front. We did a lot of mic swapping, and patching over the course of the weekend to accomodate different requirements. The studio ended up being used not only for live interviews and shows, but also for live musical performances! Below we see the rather excellent Harp for Hangovers performing a live set in the studio. We also had Lucy Kitt perform two tracks for us. The quality was excellent, and far better than we expected.

All in all, it was a very successful OB. The editing team have got many hours of live recordings to work with, which will hopefully start being played out on FM in the near future. As one of the OB’s I’ve helped with, I was extremely impressed at how smoothly it went. There were a few hicups, but nothing that caused any significant problems for the running of the TX. High fives indeed!

You can see the rest of my photos for the event on my flickr tag “lotf”.

Lounge on the Farm: Outside Broadcast for CSR (Part II)

CSR is doing an outside broadcast at the music festival called Lounge on the Farm, and broadcasting live (right now as of this writing) on the Internet and on FM 97.4MHz in Canterbury. I am a volunteer for Engineering, and the team had the challenge of making all this possible.

On Thursday morning at about 1030 we rocked up to the “venue” in The Kitchen van. We found a pig/horse/cattle shed, complete with straw and cobwebs, and various forms of Hanging Death.

We got the farmer to remove the hanging guttering you see in the above picture, and we removed most of the dangling bits of wood in the roof and put duct tape over all the sharp bits on the walls.

After a large amount of sweeping and clearing, we manage to get it into a semi-decent state so we can start putting all of the kit into the “rooms”. Meanwhile, we were setting up the 5GHz link between the pigshed and the site office where there is an Internet connection.

Here we have a wind up stand, with a crossbar holding an point-to-point wireless link we got from Solwise, and a FM antenna for our radio tuner in the studio.

Once we had the client end of the wireless link in position, we were ready to install the other end. Fortunately, we had found a place to mount the other side that was in perfect line of sight to the receiver. However, it was a little bit scary.

Here we see a terrified looking Rich on the top of a bent lighting mast, and a bit of CAT5 flying down to the portacabins below. We then ran the CAT5 through a window in the site office and into the kitchen (!!) where they have their ADSL router. We installed the Power over Ethernet Injector (which we were praying would work over that length of cable), and plugged it in. And what do you know, it worked perfectly first time.

Once the Internet connection was up, we set about building the transmission equipment.

We’ve got a little AMD Semperon machine which has a DI coming from the studio on the other side of the shed, which is then encoded into AAC+ by SAM Broadcaster and sent over the network connection to the station on the Canterbury campus. We chose AAC+ due to its ability to encode to high quality over very low bitrates. This also means that we don’t need very much bandwidth to provide the stream, which is very good when you’re out in the sticks! It’s quite resilient to packet loss too, as we found.

Most of the networking kit is running off a UPS – mainly so that if the power fluctuates (which is does, quite a lot) then we don’t break the power supply too much, and the link won’t go down (causing a lengthy rebooting process, and potential dead air).

Next to Tech Corner (also known as Rat corner, due to there being a dead rat lying there when we arrived), we have 2 edit stations, where the producers can download content from the recorder units we are using on the stage, and edit them for playout using Audacity.

And finally, the studio.

The studio consists of 4 mics, 2 mixers, a playout system, 2 CD decks and an outboard with compressors and a Saphire 90 sound card. We ended up using SAM Broadcaster for playout. There’s an area for guests in front of the desk, and 2 presenters behind it.

So far, the broadcast has been going beautifully – there was a power outage this morning (we think the main stage is using the same power feed as us, and the breakers tripped). After our Engineers moved the power over to a genny feed, we were back up and running.

I wasn’t actually on site today, however I will be there tomorrow and I hope to post an update from the pigshed!

Lounge on the Farm: Outside Broadcast for CSR (Part I)

Since April I’ve been volunteering some of my free time to work with the Tech team at Canterbury Student Radio CSR FM (broadcasting on 97.4 FM in the Canterbury area, as well as streaming on the Internets). It’s great fun, and gives me lots of freedom to work on interesting projects.

So far, I’ve been involved in building Linux servers, helping maintain Windows Servers, writing perl scripts, doing analog circuit design, building an Asterisk PBX, customising Cisco 7960G IP Phones, as well as lots of other odds and ends.

CSR is going to be broadcasting from the music festival in Canterbury called Lounge on the Farm. This is quite a technical challenge, as you might imagine. Broadcasting from a farm in the middle of nowhere is quite tricky. I’ve been helping out with the preparation for the Outside Broadcast, which will be going live on air this coming weekend (11th -13th July 2009).

We built 4 Windows XP computers to use on Lounge on the Farm to do an outside broadcast for CSR

One for encoding, one for playout (using JAZZLER , apparently) and two with Audacity for audio editing.

300g disks are in the playout and edit machines. And shared with peer to peer file sharing. All set up so all machines can see all drives.

Job is what one might call a good ‘un.

Colour Code

Something I came up with this afternoon with the help of Fluffy, and for a project that we’ll be doing in the somewhat near future.

It’s a code, using colours. See if you can crack it ;)

Body QR Code

I like QR Codes.  I’ve made QR Poems before now, and the idea of having a barcode printed on my hand has been knocking around my head for a while, so I thought I’d give it another shot.  Unfortunately I didn’t do it very well.  Note to self: paint sticks to paper better than skin >_<

Next time, body paint!

Facebook thinks I'm from Jenny's block

Yeah, Jenny from mah block!

Uhh, no.