Jul 9 2010

I love pies, and they’re so easy to make, especially with pre-rolled pastry. My favourite is this Chicken & Mushroom pie recipe I honed on my own from various sources.

Ingredients – serves 2

  • Pre-rolled puff pastry
  • 2 chicken breasts, diced
  • 4-6 sliced mushrooms
  • 150ml Double cream
  • 1/2 pint vegetable stock
  • Tablespoon of cornflour
  • 1 diced carrot
  • 1/2 chopped broccoli heads
  • 1 chopped onion
  • Plain flour
  • Olive oil
  • 2/3 crushed garlic cloves
  • Splash of white wine (optional)
  • 1 egg

Instructions

There is normally enough puff pastry in the pre-rolled packets for both the lid and outside. I normally slice the pastry in half with a sharp knife and roll one half big enough for a lid, and the other half big enough for the dish (make it slightly bigger for the sides of course!). Make sure you use plenty of flour to roll, and sprinkle a little flour into the dish before you put the pastry in. Leave the lid aside for now.

The pie filling is made by frying some onion and garlic in olive oil on high in a large frying pan. Add the diced chicken breasts until starting to go golden brown. Add the mushrooms, vegetable stock, optionally white wine, carrots, and simmer  on low/medium for 15 minutes. Add in the broccoli a few minutes before that is done. Add in cream and cornflour and stir continuously for another 5 minutes on medium heat until nice and thick. Let this cool completely on the side. Once it is cool, put into your prepared pastry in your pie dish and cover with a lid. Gently press down around the edges with a fork or your fingers, and decorate if you wish.

Beat an egg and brush the top of the pie with it. Pop the pie in the oven on 200 degrees for about 20/25 minutes until golden brown.

Jul 8 2010

I have a case at work where I needed to go through a big list of arrays, and add them to a new master array. It turns out this is incredibly slow when adding many large arrays to a larger array. The alternative to this if you don’t care about keys or duplication of values is to just add it into the array. So normally where one might do something like:

$big_array = array();
foreach($array_of_objs as $obj)
{
  $row = $obj->getSomeData(); // returns an array of data
  $big_array = array_merge($big_array, $row);
}
processData($big_array);

I believe that array_merge creates a new array every time which is what was slowing it down. The solution was simple enough, it just took me a while to think of! :)

$big_array = array();
foreach($array_of_objs as $obj)
{
  $row = $obj->getSomeData(); // returns an array of data
  foreach($row as $r)
  {
    $big_array[] = $r;
  }
}
processData($big_array);

This was vastly faster, again possibly because it doesn’t create a new array every time. There are limitations to this method, and it doesn’t do exactly the same thing as array_merge, but it does do what I needed it do, so if anyone has a similar situation, I hope this helps!

Jun 26 2010

As many of you probably know, I’ve been working for quite some time on a project called Private Passwords. It is an online password management tool which stores your passwords for any site and allows you to retrieve them from anywhere in the world. One of the things that has niggled me for a while was the fact that the encrypted passwords were all encrypted using an AES encryption key, but had no real barrier if someone somehow managed to get hold of the AES key. The AES key itself could not  be based on the user’s password as Private Passwords allows businesses to set up accounts for everyone in their company to store/retrieve passwords – that means the key must be shared amongst all the users otherwise if one user encrypts a password, another would not be able to see it unless they had exactly the same password.

However, Kelvin at work suggested adding a second “password” which would be used for each account (account being either a single user’s account, or a multiple-user business account). I have been busy implementing this solution into Private Passwords. What this means is there would be a community-wide* secondary passwords, which I have called a “3D Code” (3-dimensional security – username, password and 3D code). For example, “My Company” would have a 3D Code of “herebedragons”, which would be known to everyone in the company. and user Joe Bloggs who works for My Company would enter his e-mail address, password and also the 3D Code for the company when he logs in. The 3D Code forms part of the encryption key, so when they log in, the 3D code is checked against a hash to ensure the decryption routine would work. If it doesn’t, authentication fails and the user cannot log in.

The important point here is that the 3D Code is never stored anywhere on Private Passwords, so even if the database was compromised somehow there would be absolutely no way of decrypting any of the passwords in the system without knowing that 3D Code which would be different for each home user, and each business account. I think this is a great solution, and although it means having to remember your own password as well as the secondary 3D Code, I think this will provide users of Private Passwords peace of mind when storing passwords in Private Passwords, so thanks Kelvin for that brilliant idea!

* In Private Passwords, a community is a group of users. For a home account, there is one community per user, but for business accounts there is one community for everyone in the business.

Jun 23 2010

I got this recipe off the UKTV website (and modified it slightly) and it is absolutely delicious on it’s own as a starter, or as a side to a nice lemon-marinated salmon fillet. It’s such a simple dish too, and the flavours are exhilarating.

Ingredients

  • Finely diced bread
  • 50g butter
  • Iceberg lettuce
  • Scallops
  • Chopped chives

For the dressing:

  • 2tbsp Ground nut oil
  • 175ml sunflower oil
  • 1 clove garlic
  • 1 shallot
  • 1tsp English mustard
  • Salt & Pepper
  • 2tbsp white wine vinegar

Instructions

  1. Heat white wine vinegar, nut oil, sunflower oil, garlic, shallot and mustard, cook for 5 minutes. Season salt & pepper.
  2. Whilst that is doing, 25g butter in frying pan. Add finely diced bread and fry until crispy. Drain on plate with kitchen paper.
  3. 25g butter in frying pan. Fry for 1-2 minutes on each side until cooked.
  4. Serve lettuce on plate, put scallops on top and sprinkle with croutons. Top with the dressing. Sprinkle with chives.

Jun 17 2010

Image sourced from: roboppy on flickr under CC-by-nc-nd 2.0 license.

A good confit de canard (duck confit) is hard to get hold of in England, but luckily as my parents live in the Dordogne region they sometimes bring over a tin. A confit de canard is duck legs that are kept in tins, covered in it’s own fat. This fat is great and should be kept after cooking for doing roast potatoes and so on. It’s really easy to cook the duck as well. All you have to do is put in oven for 35-45 minutes (for a good fan assisted, I’d stick to 35-40) at 180 degrees. I simply took the duck legs out of the tin, put them on a grill rack skin side up above a roasting tin to catch the precious duck fat. I poured more of the duck fat over to make sure there was plenty on them, and simply season with salt and pepper. Cook as above, until the skin is nice and crispy. It’ll make a bit of a mess of your oven, but it’s well worth it. After cooking, whilst the fat is still hot and pourable, pour into a container with the remaining fat in the tin and let it cool. Keep this fat in the fridge, and it’ll keep for a few months I believe, and you can use it for roasting potatoes etc. or anywhere where duck fat might be a tasty ingredient. I served ours with mashed potato, carrots and courgette, but traditionally duck might be served with some lettuce and sautéed potatoes.