Bill Farmer

Random thoughts on random subjects

Catalan slow cooked chicken

by Bill Farmer. Categories: Recipes .

This is based on a recipe in Asda magazine.

Ingredients

  • Chicken pieces – drumsticks, thighs, legs – whatever
  • 3 onions, chopped
  • 2 cloves of garlic, sliced
  • Red and green pepper, chopped
  • 6 tomatoes, chopped
  • Bay leaves
  • 1tsp paprika
  • 1tsp turmeric
  • 1tsp dried oregano
  • Chicken stock pot
  • Olive oil

Method

  1. Put the chicken pieces in a slow cooker with bay leaves and turn on full to warm up.
  2. Fry the chopped onions, peppers and garlic in olive oil until soft.
  3. Transfer the cooked onions, peppers, garlic and oil to the slow cooker, add the stock pot, the chopped tomatoes, paprika, turmeric and oregano.
  4. Just cover with boiling water, put the lid on the slow cooker and leave on high for about an hour until it is bubbling gently.
  5. Turn down to low and leave to cook for about four to five hours.

Read more →

Move Linux Mint Root Partition

by Bill Farmer. Categories: Hacking .

I recently added a new disk drive to my workstation and, as part of reorganising, wanted to move the Linux Mint root partition from one disk to another. Naturally I googled duckied it and found a certain amount of useful info.

I used gnuparted to copy the partition from one disk to another. The standard method to reinstall grub on a partition so it will boot appears to be to mount it and use grub-install with the –boot-directory option like this.

Read more →

Fried Rice

by Bill Farmer. Categories: Recipes .

This is our version of Chinese take-away fried rice. Use whatever meat and vegetables are in the larder. Tasty meal for four

Ingredients

  • 2 onions, chopped
  • 2 cloves of garlic, chopped
  • 2 carrots, grated
  • 1/4 white cabbage, thinly sliced
  • 1 1/2 cups of easy cook rice
  • 250g chopped gammon ham
  • 100g cooked prawns
  • 100g petit pois
  • 1 3/4 cups water or stock
  • Vegetable oil

Method

  1. Put a large dollop of oil into a large skillet or wok.
  2. Add the onions, garlic, cabbage and carrots and place on a medium heat.
  3. Cover and let the vegetables cook for a while.
  4. Add the rice, meat, prawns and peas.
  5. Add the water and give a good stir.
  6. Cover and allow to cook until the water is absorbed.
  7. Add more water if necessary.
  8. It is possible to get a tasty paella-like crust on the bottom of the pan if timed just right.

Read more →

Pan fried lamb’s liver, bacon and chorizo

by Bill Farmer. Categories: Recipes .

Back in the mid 70’s, I had to do some work at Kingston upon Thames Power Station. When I stopped for lunch, I found a little Greek restaurant opposite in a parade of shops and restaurants. That whole area, including the power station has since been redeveloped, and bears no resemblance. I had their lunch time offer of pan fried kidneys, probably with rice.

When I got home, I mentioned this to she who did most of the cooking at that time and she came up with something which became her kidney special. It evolved into a completely different dish over time.

Read more →

Handlers in Android

by Bill Farmer. Categories: Hacking .

Using a handler to return results from a worker thread

This has taken me quite a while to put together. There are throw-away remarks in the Android docs about this, but no useful examples. You want to get the results back from a worker thread to your main activity so you can do stuff with them. There are several parts to this.

  1. The main activity implements Handler.Callback, and has a handleMessage function.
  2. When the worker thread is created, include a reference to the main activity.
  3. In the worker thread constructor, create a Handler, including the reference to the main activity.
  4. When some results need passing back, send a Message back to the main activity using the handler.
    public class MyActivity extends Activity implements Handler.Callback
    {
        //...
        // On create
        @Override
        public void onCreate(Bundle savedInstanceState)
        {
            //...
            WorkerThread worker = new WorkerThread(this);
        //...
        public boolean handleMessage(Message msg)
        {
        //...
    public class WorkerThread extends Thread
    {
        Handler handler;
        //...
        // Constructor
        public WorkerThread(Handler.Callback callback)
        {
            handler = new Handler(callback);
            //...
        private void someFunction()
        {
            handler.sendEmptyMessage(WHATEVER);
            // or
            Message msg = handler.obtainMessage(WHATEVER, thingy);
            handler.sendMessage(msg);
            //...

The handler will send the message back to the activity in the UI thread, so you can do whatever with the contents.

Read more →
Previous page Next page