TobyInkster.co.uk

Blog for January 2008

29/01/2008: Looking Ahead to PHP 6

This is my look at what’s planned for the forthcoming revision to the PHP language.

Removal of Deprecated Features

PHP 6 includes a lot of tidying up, removing features of the language that have caused annoyance, confusion and security headaches. Although these changes are too numerous to list here, and the list will probably change before the official release, here are three of the major ones:

  • PHP has for some time included two different regular expression libraries: POSIX Regex and PCRE. PCRE is both faster and more capable, so in PHP 6, the POSIX Regex library will be removed from the PHP core and exist only as an optional extension.
  • PHP includes a feature called register_globals, which automatically creates global variables for any data provided to a script through an HTTP
Filed under: , , .

29/01/2008: Chicken & Chorizo Pasta

Ingredients

  • 2 skinless chicken breast fillets
  • 100g Spanish chorizo sausage, chopped
  • 150g dried penne or similar dried pasta
  • 1 red pepper
  • 1 yellow pepper
  • 3 cloves garlic, finely chopped
  • small handful parsley, chopped
  • 2 tsp paprika
  • 1 tbsp olive oil

Method

Chop each pepper into 4–6 sections, discarding the stalks and seeds. Grill the chopped pepper, skin side up until the skin is charred and blackened. Place the grilled peppers in a plastic bag, seal and set aside to cool.

Prepare the pasta according to the directions on the packet.

Meanwhile, finely chop the chicken. Fry in olive oil until brown and then add the chorizo and garlic.

When the peppers have cooled enough to be handled, remove from the bag. Peel off the charred skins and discard. Chop the flesh of the peppers and add it to the chicken and chorizo. Also, add the paprika and stir well.

Once cooked, drain the pasta. Add the parsley and pasta to the chicken and chorizo mixture and stir together. Heat through and serve.

Filed under: , , , .

26/01/2008: Fennel, Sausage and Bean Casserole

This recipe is ideally made with plain pork sausages, or pork & leek. Try to avoid overly seasoned sausages. If peeling the tomatoes is too much bother, using half a tin of tomatoes would probably work fine.

Ingredients

  • 4 Sausages
  • 2 × 440g tins of cannellini beans, drained
  • ¼–¾ bulb of fennel
  • 4 medium tomatoes
  • 300 mL chicken stock
  • olive oil

Method

Submerge the tomatoes in boiling water. Simmer until their skins split. Remove the tomatoes from the pan and run under cold water. Peel their skins off and chop the tomatoes.

Grate the fennel with a cheese grater, or chop very finely.

Chop each sausage into 6–8 segments. The skin may tear or come loose — discard any loose bits of sausage skin.

In a casserole dish, heat a generous amount of olive oil. Fry the chopped sausages, stirring continuously to prevent them from sticking. Cook for 5–10 minutes, until they are browned.

Add the beans, tomatoes, fennel and stock. Stir until well mixed. Simmer gently for about 30 minutes.

Serve with focaccia or a similar bread.

Filed under: , , , .

22/01/2008: CSS to HTML Compiler

I’ve searched around the ‘Net for something like this before, but without success, so decided to write my own. The basic idea is this: there are certain circumstances in which you need to write some styled HTML without access to the document’s header. For example, when composing HTML-formatted e-mails, which may be displayed in a web-based e-mail client; when adding content to limited content-management system; or in an eBay auction description. In such a situation, you can’t (validly) include a <link rel="stylesheet"> element, nor a block (if you do include such a construct it may just about work, but the document will not be valid), so instead you are reduced to using HTML style attributes all over the place.

However, it is slow work using style attributes as you can’t take advantage of CSS selectors. Instead…

Filed under: , , , , , .

14/01/2008: GPS & Cameras

We are now starting to see the arrival of GPS chips in cameras. Why? Well, so that photos can be tagged with their latitude and longitude. Then when you upload your photos to a computer, they can be plonked onto a map — nifty little trick, and I’m sure people will come up with plenty of other neat ways of using this extra data.

But just wait until Galileo (the European Space Agency’s rival to US-based GPS) goes live. Galileo will provide far higher resolution co-ordinates, potentially narrowing your position down to within a few inches. Combine that with the gyroscopes already build into many higher end digital cameras, which are able to determine the orientation of the camera, and online geotagging — the practice of marking up information on the web with geographic co-ordinates — and you end up with a camera which doesn’t just take pictures, but knows which famous landmark you’ve decided to take a snap of!

10/01/2008: NetSol Cybersquatting

Over the last couple of days I’ve read a few stories about Network Solutions pulling a Site Finder by stealing unregistered domain names on which people have run a whois query.

They wait for people to whois query a domain (commonly done as a first step to registering a domain — to check that nobody already owns it), and if nobody owns it, they temporarily register it for five days (after which they’d have to pay for it themselves!) and thus prevent anyone from registering the domain name using a competing registrar. More details here.

According to CNET, they’ve already started backpeddling on this.

Filed under: , , .

09/01/2008: NetNewsWire is now free!

FeedDemon too!

Filed under: , , , , .

09/01/2008: Mushroom and Tarragon Stuffed Chicken

Ingredients

  • 2 skinless chicken breast fillets
  • 4 large mushrooms
  • 1 baby leek, finely sliced
  • 75g ricotta or Philadelphia cream cheese
  • 40g butter or margerine
  • 20g dried porcini mushrooms
  • small handful of tarragon, roughly chopped
  • 4 cloves of smoked garlic, or 2 cloves of garlic, finely chopped or crushed
  • 2 tbsp mushroom ketchup (optional)
  • salt & pepper
  • 4 cocktail sticks

Method

Put the porcini mushrooms into a mug or cup and fill the cup with boiling water to rehydrate the dried mushrooms.

Chop the fresh mushrooms very finely (pieces should be about the size of peas) and fry them with the leek and garlic in about 30g of butter. When brown, transfer mixture to a small mixing bowl. Allow to cool slightly.

Drain the porcini mushrooms and chop them. Add the porcini mushrooms and cheese to the mushroom and leek mixture and stir together. Place in the fridge to cool and set.

Preheat an oven to 180°C. Grease a small baking try with the remaining butter.

With a sharp knife,…

Filed under: , , .

09/01/2008: The Dan Brown Generator

My famous Dan Brown generator was apparently mentioned in Time Out last month.

Filed under: .

09/01/2008: X-Blog-Name

OK, so the Trackback specification includes the ability for a pinging page to specify its article title and blog name when it sends a trackback ping. However, these fields are optional. When not present, typically the recipient of the ping will then make an HTTP request back to the pinger to determine the article title from the page’s <title> element. But there is no standardised way of determining the blog name — or more generically, because Trackback can be used by sites other than blogs — the name of the “collection of web pages”.

The following informal specification suggests a method of determining the name of the collection of documents to which a given HTML document belongs. It also provides a clear way for you to mark your own HTML documents as being part of a particular collection.

Determining the Collection for a Given Document

Attempt to find the name of the collection…

Filed under: , , , .