Thursday, 23 February 2012

Online Businesses in Greek and Stool Samples

According to this article, Greece is a particularly difficult place to start an online business:

Antonopoulos and his partners spent hours collecting papers from tax offices, the Athens Chamber of Commerce and Industry, the municipal service where the company is based, the health inspector’s office, the fire department and banks. At the health department, they were told that all the shareholders of the company would have to provide chest X-rays, and, in the most surreal demand of all, stool samples.

For the sake of all that is decent, I really hope this is an error in translation or understanding, or a plain exaggeration. Thank goodness I didn't start Poker Copilot in Greece.

Tuesday, 7 February 2012

What I'm Cooking for Dinner Tonight

PETER SINGER'S DAL RECIPE

INGREDIENTS:

  • 1 tablespoon olive oil
  • 2 cloves garlic (crushed/chopped)
  • 1 medium onion (diced)
  • 1- 2 tablespoons curry powder, to taste
  • Salt, to taste
  • 1 cup small red lentils
  • 3 cups water
  • 2-3 bay leaves, to taste
  • 1 cinnamon stick
  • 1 tin tomatoes, (chopped)
  • 1/4 cup coconut milk
  • 2 tablespoons lemon juice

METHOD:

  1. In a large saucepan, saute garlic til fragrant.
  2. Add onions and cook until they begin to soften.
  3. Add curry powder and salt, to taste, and cook over medium heat til mixture begins to brown.
  4. Add lentils and stir for a minute or so before adding water, the bay leaves and cinnamon stick. Bring to boil, then turn heat down very low and simmer for 20minutes, stirring occasionally.
  5. Add chopped tomatoes, and simmer a further 10minutes, until thick. The lentils should be soft and the consistency just liquid enough to pour.
  6. Add coconut milk and lemon juice. Stir through, and remove from heat.

Serve over rice with lime pickle and mango chutney.


Thursday, 2 February 2012

Expensive creation of a Java instance

Execute this code in your Java program:

SimpleDateFormat df = new SimpleDateFormat();

Here are the consequences:

  • 55 distinct methods are called a total of 123 times
  • 44 new instances of objects are created

That is one badly-designed class. And that's before considering the non-thread-safety of SimpleDateFormat that leads it to be probably the #1 cause of concurrency issues in Java programs. And which prevents reusing one instance across an entire application.

I sourced this here.