Sunday 25 December 2011

Cheat's Trifle

For the last four years I have made a trifle for our Christmas dinner. You know you've been accepted when your family let's the foreigner make the trifle.

When I was looking for trifle recipes my wife initially suggested I would make Heston Blumenthal's version*. Hah, very funny, love, but no. I decided to go for Rick Stein's Traditional English Trifle.

Well, I looked at it.

And then I took every shortcut I could think of.

Bake my own madeira cake? Oh, look, cheap supermarket's madeira cake.
Make my own custard? Ooo, look, cheap supermarket's fresh custard...

I've never actually made Rick Stein's trifle and as a result I don't have a clue whether my shortcut version has any positive relation to his, but my family likes it, so who am I not to keep making it?

Since I'm not actually following Rick Stein's recipe I've always had to guess most of the quantities and have ended up buying too much. My main reason for writing this down is so next year I can finally stop buying too many ingredients.



While most celebrity chefs always seem to suggest getting the best ingredients money can buy, I suggest getting the "normal" range of fresh custard from your supermarket, and the cheapest madeira cake you can get.

2 * 500gr tubs fresh custard (I use Sainsbury's Fresh Custard, not the one from their Taste the Difference range)
1.5 jars raspberry conserve (I use Bon Maman)
4 * 265gr madeira cake (I use Sainsbury's Basics Madeira Cake)
200 gr milk chocolate
480 ml double cream
Oloroso sherry (about 20 spoonfuls, far less than a bottle)

This gives me about two medium sized serving bowls and a bit more worth of trifle. I tend to create little individual ones without the sherry for the kids and put all the sherry in the main bowls.

Day before serving (i.e. Christmas Eve):
Cut the cakes length ways into slices about 1cm thick, cut the "crusts" off.
Put one layer of cake on the bottom of your serving bowl.
Spread about two spoonfuls of jam on it.
Add another layer of cake + jam.
Depending on the height of your serving bowl, you might want to add another layer of cake + jam.
Drizzle over the sherry and give it a bit of time to sink in, you can help it by poking the cake layers with a knife to create a few holes.
Pour the custard on top, cover with cling film and put in the fridge.

Grate the chocolate (First time I bought a packed of grated chocolate, and since I haven't been able to find that cheat anymore I now grate the chocolate using a food processor). Cover and put in the fridge as well.

Just before serving (Christmas Day):
Whip cream, scoop and spread on top of the trifles, sprinkle over the grated chocolate.

There is no chocolate in Rick Stein's recipe, but I think the sprinkled chocolate looks and tastes good and the kids love doing the sprinkling.

Enjoy.

* I used to have a link to Heston Blumenthal's trifle recipe, but the recipe seems to have disappeared from the BBC Food website. I can't find the recipe online now, but it is the one that takes 6 hours to make and requires wonderful kitchen implements such as an electric drill and a blow dryer. [UPDATE: I found a simplified version of Blumenthal's trifle, which still seems like an awful lot of work.]

Friday 3 June 2011

Shortened URL Expansion

Twitter provides me with a lot of value through the plenty of interesting and/or useful links that get tweeted by the selection of people that I follow.

Usually when I notice an interesting looking URL, I mark the tweet as favourite, so I can easily find it again later. The twitter.com's favourites interface isn't nearly easy enough for my liking, so I decided to create a webpage that would show me all my favourites links, so I could easily bookmark them on delicious or send them to instapaper.

However, I don't want to bookmark the shortened URL, to prevent link-rot I'm only interested in the actual link hidden behind one or more layers of URL shortening services. In fact I don't even want to see shortened URLs, I would much rather know where I'm going.

My initial attempt to solve this problem was to use the bit.ly api for expanding bit.ly URL-s, which works for a lot of shortened URL-s as many of them go to bit.ly under a different guise.

However, it doesn't work for all. Most importantly, it doesn't work for twitter's own t.co shortener. This also doesn't appear to have an easily discoverable API for expanding the url.

If I can't find a nice way to expand the URL, why not simply keep following the redirects until I hit the actual page I want to bookmark? The following few lines of code should expand any shortened URL, and indeed any redirected URL whether shortened or just hidden behind a redirect.

   protected string expandurl(string url) {
System.Net.HttpWebRequest hwr = (System.Net.HttpWebRequest) System.Net.WebRequest.Create(url);
hwr.Method = "HEAD";
hwr.AllowAutoRedirect = true;
hwr.MaximumAutomaticRedirections = 10;

System.Net.HttpWebResponse response = (System.Net.HttpWebResponse)hwr.GetResponse ();

return response.ResponseUri.ToString();
}


The MaximumAutomaticRedirections setting will stop an endless redirection loop, but also means that you might still end up with a shortened URL if the one you've passed in hides even more lot of layers of redirection.

The HEAD HTTP method should only return the HTTP headers, not the actual content of the page, so using that should reduce network traffic.

Because I'm figuring out which URL is at the end of the redirect chain by following the chain, there is a rather high chance that every time this get's executed the intermediate URL shorteners will register our passing by as a "click" and update the stats for that particular shortened URL (if that service provides that service).