Apr 27
Fougasse
icon1 Krishnamurthy Koduvayur Viswanathan | icon2 cooking | icon4 04 27th, 2011| icon3No Comments »

When it comes to using very few ingredients, and making  really good tasting bread; few breads can beat fougasse. It is the less fancy cousin of focaccia. Both Gitika and I love a good bread along with pasta; and this particular evening, we needed to make a quick bread, without making a trip to the grocery store. Fougasse fit the requirements and the result was fabulous.

Ingredients:

  • 4 cups all-purpose flour
  • 1 1/4 cups water
  • 1 sachet active dry yeast
  • 1 tsp sugar
  • 1 tsp salt
  • 1/4 cup olive oil
  • salt and pepper to taste

Optional

  • a handful of flax seeds
  • olive oil to brush

Method:

First, add the sachet of yeast and the sugar to the water and let it sit for 15 minutes. The yeast should be foamy (and smelly) by now. This means that the yeast is active and will cause the bread to rise well. If this is not the case, then the yeast is dead, and you will have to use another pack.

Sift together the salt and flour in a large bowl, and create a well in the center. Add the yeasty water to the flour. Also add the olive oil, and the flax seeds.

Mix it well with a spatula, and when the mixture comes together, knead it with your hand for about 5 minutes till you have  a ball of dough.

Place it in a well oiled contained, covered with a damp cloth for a little over an hour (or till it doubles in size).

Punch the risen dough and let it rise for a further 20 minutes.

Now knead the dough well for 5 minutes and divide it into 4 roughly equal parts. Create four elliptical shaped pieces about 1 cm thick.

Make a few slanting cuts on the dough, and let it rise for 30 minutes. Meanwhile, preheat the oven to 415 F.

Brush with a little olive oil, and sprinkle some salt and pepper to taste, before placing it in the oven.

Let it bake for 15 minutes, before spraying the loaves with a little water (this will make the loaves crisp).

Bake for a further 10-15 minutes before taking it out of the oven and letting it cool for 5 minutes on a wire rack. Eat some while it is still warm. Tastes great with pasta, and even by itself as a snack.

Apr 25
absolutely simple pasta
icon1 Krishnamurthy Koduvayur Viswanathan | icon2 cooking | icon4 04 25th, 2011| icon3No Comments »

I was recently discussing really simple pasta recipes with my friends. Here is what I like to do if I want a quick meal, and when I don’t want to use too many ingredients (I almost always have most of this stuff in my pantry):

Ingredients (serves 1)

  • 1 and a quarter cup pasta (use your favourite)
  • 1 onion finely chopped
  • 3 tbsp olive oil
  • 3 cloves garlic, finely chopped
  • 1 large tomato, roughly diced
  • handful of fresh basil leaves, roughly chopped
  • salt and pepper to taste

Optional:

  • grated parmesan cheese for topping (or use any you have in the fridge. lets not be a cheese snob)

Method:

In a large pot, bring one quart of water to a rolling boil. Add all the pasta in there, and stir a little. Bring the water back to a slow boil. Stir occasionally. Cook the pasta until it is barely al-dente (it should have a little bite remaining in it). This is important. Do not cook it all the way. Do not cool the pasta under cold water. If it is done. Simply switch off the heat, and let it rest.

In a pan, add the olive oil, the onions and the garlic, and saute till the onions are translucent (how good does that fresh garlic smell?).

Now throw in the tomatoes, add some salt and pepper to taste. The tomatoes will immediately start sweating due to the salt, and release a lot of juice.

Don’t overcook the tomatoes (about 5-10 minutes on medium heat should be good). Add the fresh basil leaves and cook for another minute. Add a few tbsp whole milk if you like.

Now add the cooked pasta to this sauce, and cook the pasta all the way through.

As a result of this, the pasta will absorb the flavour of the tomato sauce. Make sure the pasta is well coated, and check the seasoning. Add some more salt/pepper if necessary. An extra drizzle of olive oil is always helpful. Serve hot with some good artisan bread (I prefer a nice home baked focaccia or fogasse).

Apr 16
Console Application…continued for facebook
icon1 Krishnamurthy Koduvayur Viswanathan | icon2 development, programming | icon4 04 16th, 2011| icon3No Comments »

A couple of days ago, I was talking about how to use your private access token to extract information from your Twitter account using the Twitter API.

Today, I tried using the RestFB library to extract information about my friends from facebook. Now, there is a different kind of a hack that I had to use in order to get an access token: Login to facebook and go to this page: http://developers.facebook.com/docs/reference/api/user/. Now, click on the example link on that page. In your browser address bar, you will see an access token. Save this in your configuration file (this access token expires after a certain duration).

There are a few further to jump through to simply access data. The RestFB library gives you a list of your friend names and ids. Even though it has methods to access other information such as location, gender etc. of your friends, all of these method calls return null UNLESS each of your friends gives your “application” specific permissions to access these fields. Crazy ain’t it? Look at this thread on stackoverflow. So much distress to simply programmatically access information of my friends that I already can see in my facebook account.

So I had to take a different approach: Calling the graph API directly using direct HTTP GET requests as myself, rather than go through the application that needs to be specifically approved by my 350+ friends on FB.

Since I already have my friends’ user IDs (from the previous call using restFB), I made individual HTTP requests to the following URL:

https://graph.facebook.com/id?access_token=abcd (where abcd is the access token I received using the method described above). In the HTTP response body, you receive a JSON string which represents your friend’s information.

One final thing: making a GET request to an https link is painful in java. I used a crude hack in order to do this (essentially install an all trusting trust manager…never do this). Here is the complete code:

Apr 12
What about the good ole’ console application?
icon1 Krishnamurthy Koduvayur Viswanathan | icon2 development, programming | icon4 04 12th, 2011| icon3No Comments »

This is my second attempt at writing this post. Somehow I had a demented idea of using IE9 while writing this; and due to a stupid browser glitch, I lost my original draft. Now back on trusty old Firefox: essentially I was ranting about how I was having to jump through several hoops while using the Twitter and Facebook Graph APIs, mostly due to their OAuth workflow.

I am writing a simple console application that needs to collect some data and do some social network analysis. The complicated browser based authentication workflow supported by both FB and Twitter are a huge hindrance to this purpose, since they assume that you are making a web application with several users. Essentially the process is that your application exchanges your API key and some other secret key for an auth token (specific to each user), and this is done using the browser.

I discovered after a lot of digging in that, Twitter decided to be a little considerate by providing a single user auth_token that can be used for single-user scenarios like mine. So, I can simply start using my secret auth_token and completely bypass the OAuth workflow. To obtain your access token, login at dev.twitter.com, select your app, and click on “My Access Token”.

Given below is an example. I hope this is useful for people who have requirements similar to mine. I will follow up with a post about how to get this working for Facebook.

Feb 21
A French Toast Experiment
icon1 Krishnamurthy Koduvayur Viswanathan | icon2 cooking | icon4 02 21st, 2011| icon3No Comments »

I recently came across this peanut butter stuffed french toast recipe on the flight entertainment system, on my way back home from Mumbai to Newark (don’t ask: I watch every single food related show that I can get). I don’t exactly remember how they did it on the show, but it inspired me to try my own version.

We recently happened to bake a fresh loaf of challah bread; which normally means that I make french toast. So, I set out with my extremely approximate estimate of ingredients:

For the sauce

  • 1/4 cup sugar
  • 1/4 cup water
  • 1 1/2 tbsp butter
  • 3 tbsp whole milk (or heavy cream)
  • 1 banana, sliced

For the french toast:

  • 2 thick slides of challah bread
  • 3 eggs
  • 3-4 tbsp milk
  • 1/2 tsp cardamom powder
  • 1 tsp sugar
  • a large blob of creamy peanut butter (yeah, I like creamy. if you like chunky, then try that)
  • a handful of your favourite cereal, crushed (I used the readily available at home, honey bunches of oats, with almonds. Also, I have reason to believe that Cap’n Crunch is a good choice for this purpose. You should try to Cap’n Crunch french toast at Blue Moon Cafe in Baltimore!)

First, add the sugar and water in a deep pan and stir continuously on medium heat till the water evaporates. The mixture will start bubbling and frothing. Eventually you will have an amber colored liquid. Reduce the flame to it’s lowest setting and keep stirring continuously (it will burn if you do not do this).

Add the butter, and continue to stir. There will be more bubbles. As soon as the butter melts, add the bananas and stir for a minute. Now add the milk, and stir till you get the smooth caramel sauce color and consistency.

Keep the sauce aside while you prepare the french toast.

Apply the peanut butter nicely to the two slices of challah bread and then put them together like a sandwich. Whisk together, the eggs, milk, cardamom powder and sugar to create the batter. Dip the slices of bread in the batter and leave it to soak for several seconds. Turn over so the other side can soak too.

Roll the slices in the crushed cereal, and transfer to a buttered pan. Let both sides cook for a couple minutes till it gets a nice brown texture.

Plate the french toast, and top it with a generous quantity of the banana caramel sauce. Serve hot.

Feb 8
Vegetable Pie
icon1 Krishnamurthy Koduvayur Viswanathan | icon2 cooking | icon4 02 8th, 2011| icon3No Comments »

I discovered two cooking enthusiasts over hi-tea, the past week in the department. You know how much fun that can be! We had a long conversation about foods, recipes and the like. Somebody happened to mention savory pies, and I recalled this vegetable pie recipe that we once made when a friend came over for dinner.
It was originally meant to be a pissaladiere recipe, but we happened to modify it a lot as we cooked. So I will call this a vegetable pie, and not a pissaladiere.

Ingredients:

For the pie crust

  • 1.5 cups all purpose flour
  • Yolk of one egg
  • 3 tbsp iced water
  • 4 tbsp butter (that is half a stick, cold and cut into pieces)
  • 1 tsp salt
  • 1 tsp Italian seasoning

For the filling:

  • 2 large onions, thinly sliced
  • 2 garlic cloves, crushed
  • 3 tbsp olive oil
  • 1 can diced tomatoes
  • 1 large green bell pepper, sliced
  • 1 cup sliced mushrooms
  • 1/2 cup corn
  • 1 tsp sugar
  • 2-3 sprigs thyme
  • 2 tbsp capers
  • Salt and black pepper powder to taste
  • 1/2 cup grated cheddar cheese for topping

Knead the dough as described in the apple pie recipe. The only difference is that you add the Italian seasoning as well, while kneading. Wrap it up nicely and place in the refrigerator for about 30 minutes. Preheat the over to 375 F. Meanwhile you can start preparing the filling.

Gently fry the onions and garlic in the oil for a while till the onions are soft. Stir in the tomatoes, sugar, thyme and cook for a few minutes.

Add the peppers, corn, and mushrooms. Season with salt and black pepper. The vegetables will release a lot of water. Cook till the water evaporates and leaves behind a slightly syrupy mixture of vegetables. Check for seasoning and adjust. Once cooked, remove from heat, and allow to cool. Mix in the capers.

Meanwhile, you can roll out the dough into a bottom pie crust, using a rolling pin, as described here. Carefully place the bottom crust on to the pie pan. Bake the crust in the heated oven at 375 F for 15 minutes.

Take the pre-baked crust out of the oven. Carefully pour the filling into the pie dish, and bake in the oven at 375 F for 15-20 minutes.

Sprinkle the cheddar cheese on top (a lot more than the picture above) and grill till the cheese melts and stars to bubble. Slice and serve hot.

Dec 8
Naive Bayes Classifier in 50 lines
icon1 Krishnamurthy Koduvayur Viswanathan | icon2 machine learning, programming | icon4 12 8th, 2010| icon3No Comments »

The Naive Bayes classifier is one of the most versatile machine learning algorithms that I have seen around during my meager experience as a graduate student, and I wanted to do a toy implementation for fun. At its core, the implementation is reduced to a form of counting, and the entire Python module, including a test harness took only 50 lines of code. I haven’t really evaluated the performance, so I welcome any comments. I am a Python amateur, and am sure that experienced Python hackers can trim a few rough edges off this code.

Intuition and Design

Here is definition of the classifier functionality (from wikipedia):

Now this means, that for each possible class label, multiply together the conditional probability of each feature, given the class label. This means, for us to implement the classifier, all we need to do, is compute these individual conditional probabilities for each label, for each feature, p(Fi | Cj), and multiply them together with the prior probability for that label p(Cj). The label for which we get the largest product, is the label returned by the classifier.

In order to compute these individual conditional probabilities, we use the Maximum Likelihood Estimation method. In a very short sentence, we approximate these probabilities using the counts from the input/training vectors.

Hence we have: p(Fi | Cj) = count( Fi ^ Cj) / count(Cj)

That is, we count from the training corpus, the ratio of the number of occurrences of the feature Fi and the label Cj together to the total number of occurrences of the label Cj.

Zero Probability Problem

What if we have never seen a particular feature Fa and a particular label Cb together in the training dataset? Whenever they occur in the test data, p(Fa | Cb) will be zero. Hence the overall product will also be zero. This is a problem with maximum likelihood estimates. Just because a particular observation was not made during training does not mean that it will never occur in the test data. In order to remedy this issue, we use what is known as smoothing. The simplest kind of smoothing that we use in this code, is called “add one smoothing”. Essentially, the probability for an unseen event should be greater than one. We achieve this by adding one to each zero count. The net effect should be that we redistribute some of the probability mass from the non-zero count observations to the zero-count observations. Hence, we also need to increase the total count for each label by the number of possible observations, in order to maintain the total probability mass at 1.

e.g. if we have two classes C = 0 and C = 1, then after smoothing, the smoothed MLE probabilities can be written as:

p-smoothed(Fi | Cj) = [count(Fi ^ Cj) + 1]/[count(Cj) + N] where N is the total number of observations across all features in the training corpus.

Code

For simplicity, we will use Weka’s ARFF file format as input. We have a single class called Model which has a few dictionaries and lists to store the counts and feature vector details. In this implementation, we only deal with discrete valued features.

The dictionary ‘features’ saves all possible values for a feature. ‘featureNameList‘ is simply a list that contains the names of the features in the same order that it appears in the ARFF file. This is because our features dictionary does not have any intrinsic order, and we need to maintain feature order explicitly. ‘featureCounts‘ contains the actual counts for co-occurrence of each feature value with each label value. The keys for this dictionary are tuples of the form (class_label, feature_name, feature_value). Hence, if we have observed the feature F1 with the value ‘x’ for the label ‘yes’, fifteen times, then we will have the entry {(‘yes’, ‘F1′, 15)} in the dictionary. Note how the default values for counts in this dictionary is ’1′ instead of ’0′. This is because we are smoothing the counts. The ‘featureVectors‘ list actually contains all the input feature vectors from the ARFF file. The last feature in this vector is the class label itself, as is the convention with weka ARFF files. Finally, ‘labelCounts‘ stores the counts of the class labels themselves, i.e. now many times did we see the label Ci during training.
We also have the following member functions in the Model class:

The above method simply reads the feature names (including class labels), their possible values, and the feature vectors themselves; and populate the appropriate data structures defined above.

The TrainClassifier method simply counts the number of co-occurrences of each feature value with each class label, and stores them in the form of 3-tuples. These counts are automatically smoothed by using add-one smoothing as the default value of count for this dictionary is ’1′. The counts of the labels is also adjusted by incrementing these counts by the total number of observations.

Finally, we have the Classify method, that accepts as argument, a single feature vector (as a list), and computes the product of individual conditional probabilities (smoothed MLE) for each label. The final computed probabilities for each label are stored in the ‘probabilityPerLabel‘ dictionary. In the last line, we return the entry from probabilityPerLabel which has the highest probability. Note that the multiplication is actually done as addition in the log domain as the numbers involved are extremely small. Also, one of the factors used in this multiplication, is the prior probability of having this class label.
Here is the complete code, including a test method:

Download the sample ARFF file to try it out.

Update: I found a bug in the last but one(th) line of the GetValues() function. This line gets the possible attribute values from the arff file and stores them in self.featureNameList. This method did not deal with whitespaces correctly. Update this line to:
<code>self.features[self.featureNameList[len(self.featureNameList) - 1]] = [featureName.strip() for featureName in line[line.find('{')+1: line.find('}')].strip().split(‘,’)]</code>

Update: I found a bug in the last but one(th) line of the GetValues() function. This line gets the possible attribute values from the arff file and stores them in self.featureNameList. This method did not deal with whitespaces correctly. Update this line to:<code>self.features[self.featureNameList[len(self.featureNameList) - 1]] = [featureName.strip() for featureName in line[line.find('{')+1: line.find('}')].strip().split(‘,’)]</code>

Nov 23
Home baked ciabatta bread
icon1 Krishnamurthy Koduvayur Viswanathan | icon2 cooking | icon4 11 23rd, 2010| icon3No Comments »

I recently started baking bread, and there is something about bread making that gets me. Kneading your own dough, setting the yeast to grow in the dough and letting it rise; it is all too exciting for me. And finally, there is a huge difference between artisan breads and regular, store bought bread.

This time, we make ciabatta, which is an Italian bread (literally meaning carpet slipper, due to its shape). The ingredients could not be simpler:

  • 3 1/2 cups unbleached, all purpose flour
  • 1/2 cup whole wheat flour
  • 1/4 tsp active dry yeast
  • 2 tbsp olive oil
  • 2 cups water
  • 1 1/2 tsp salt

This is a basic no-knead recipe. Add all the ingredients in a large bowl, and start mixing it well using a spatula. Really, does it get easier than this?

Keep mixing it, while trying to incorporate all the flour together. After a couple of minutes, you will see the dough starting to come together.

In the end you will be left with some really sticky dough. It is supposed to be that way for ciabatta. Cover the bowl with a plastic wrap, and leave it at room temperature for about 16-18 hours to rise. At the end of this period, you will have a real sticky mass of dough with a lot of gluten strands and air bubbles.

Now sprinkle some water over a tabletop, and lay out some plastic wrap over it. This is so that the plastic wrap does not move while you work on it. Sprinkle a generous amount of flour on it. Now slowly pour out the dough from the bowl on to the plastic sheet using the spatula. The dough is very sticky, and would require some gentle prodding.

Once on the sheet, gently using floured fingers, shape the dough into the classic ciabatta shape.

Now slide the plastic sheet along the table, and place it halfway (lengthwise) along the edge of a well floured baking tray.

Flip the sheet over so that the dough settles on the baking tray nicely.

Dust some flour on top of the dough and cover it with a dry cloth. Let it rise for two hours. You will notice after 2 hours that the dough has expanded more horizontally than vertically. This is to be expected.

Meanwhile, preheat the oven to 425 degrees F. Place an empty baking pan in the lower rack. Brush the loaf with some melted butter and sprinkle some italian seasoning on top.

Pour some water in the empty baking pan on the bottom shelf of the oven. Bake the bread it on the middle rack at 425 degrees for 35-45 minutes.

The outer crust will make a nice hollow sound when knocked. Wait for about 5-10 minutes before cutting out slices using a bread-knife.

Serve it as accompaniment with pasta, or your favorite soup or with a great bruschetta. Tastes great with just butter too.

Nov 17
Home Baked Challah Bread
icon1 Krishnamurthy Koduvayur Viswanathan | icon2 cooking | icon4 11 17th, 2010| icon3No Comments »

Baking is a not so recent passion of mine, and the latest in this series of adventures, is baking my own bread. I considered all the breads that could be baked at home, and asked her which bread should we try. She suggested we make challah (pronounced (kh)hallah), which is a traditional Jewish bread. The prospect of using home-baked challah bread to make stuffed french toast seemed very alluring to me, and I needed no other encouragement.

Here is what you need:

  • 3 1/2 cups unbleached all purpose flour
  • 1 1/4 cups lukewarm water
  • 1 pouch active dry yeast (about 2 and a quarter tsp)
  • 1/3 cup sugar
  • 1/4 cup vegetable oil
  • 1 tsp salt
  • 1/4 cup raisins
  • 3 eggs (plus one extra for coating)

Mix the quarter cup of flour, the yeast, and the warm water in a large bowl and let it stand for 10-20 minutes until it begins to foam. Add the vegetable oil, sugar, and the three eggs (one at a time), and whisk well.

Now add the rest of the flour (one cup at a time) and mix well using a spatula till the mixture starts coming together.

Now start kneading it with your hands, adding extra flour as required in order to get it together into a consistent lump (I had to add a fair amount of extra flour while kneading).

Knead it on a well floured surface for about 5 minutes. Meanwhile grease a large bowl with a little oil and transfer the kneaded lump of dough into the bowl. Move it around so that the dough is coated nicely with oil.

Cover the bowl with a plastic wrap and keep it in a warm place for about 2 hours. The dough should double in size. (Compare the picture below to the one above)

Punch this risen dough down with your fist and cover it again. Leave it to rise for about 30 minutes. Meanwhile soak the raisins in a cup of warm water. After the 30 minutes are over, incorporate them into the dough and gently fold it a couple of times. Add some extra flour if the dough seems too oily/moist, and fold for a minute or two. Cut the dough into three roughly equal sized pieces.

Roll out the three pieces of dough into approximately 10-inch long ropes.

Now comes the most fun part: place all the three ropes parallel to each other on a greased baking tray, and pinch them together at one end. Now braid the three ropes together (like you might have seen women braid their hair).

Break the remaining egg into a bowl, and coat it carefully over the braided loaf. Let it rise for another45 minutes to an hour. When poked with your finger, the dough should not spring back, and should stay dented. Preheat the oven to 350 degrees F. Apply a second coat of the egg after the dough has risen. Ideally the egg coating is done using a pastry brush, but in the absence of one, use your fingers.

Bake it on the middle rack in the pre-heated oven for about 40 minutes. If you notice the top browning too fast, tent it with aluminium foil. The baked loaf should make a hollow sound when knocked.

Update: You should let the bread cool down for about 20-30 minutes once it is out of the oven, before slicing it.

Nov 4
Pumpkin Pie with Pecan and Cranberry Topping
icon1 Krishnamurthy Koduvayur Viswanathan | icon2 cooking | icon4 11 4th, 2010| icon3No Comments »

This pumpkin season, we decided to try out a cool new pumpkin pie recipe that I was waiting to try out for a long time. Usually pumpkin pie is served with whipped cream, but this recipe includes a nice crunchy and tart topping that goes well with the pie. So here are the ingredients:

For the pie crust

  • 1 1/4 cups all purpose flour
  • One egg yolk
  • 3 tbsp iced water
  • 1 tbsp sugar
  • 1 tsp salt
  • 4 tbsp butter (half a stick, cold and cut into pieces)

This pie requires only a bottom crust. First knead the dough as described in the apple pie recipe. Wrap the ball of dough in a plastic wrap, and refrigerate for at-least 30 minutes. While you make the pie filling. Pre-heat your oven for 325 degrees F. Ingredients for the filling are:

  • 15 ounces pumpkin puree (you can find this at any grocery store)
  • 1/2 cup sugar
  • 1 tsp cinnamon powder
  • 1/2 tsp nutmeg powder
  • 2 tbsp butter
  • 2 eggs
  • 1 cup whole milk (or condensed milk)

Add the pumpkin puree to a large bowl. Mix together the two eggs and the sugar in a bowl and whisk them well. Add this to the pumpkin.

Add the cinnamon powder and the nutmeg powder to the mixture. Add the milk and whisk well to a homogeneous mixture. If you have tiny pieces of butter in your mixture, don’t worry. These will melt while baking.

Meanwhile take the dough out of the fridge, and set it aside for 15 minutes so that it becomes pliable enough to roll. Roll out the pie crust, and set it nicely into the pie pan as described here.

Although not strictly necessary, it is a good idea to pre-bake the crust for about 20 minutes before you pour the filling into it. This ensures that your crust is cooked well.

Now pour the pumpkin filling onto the pie-crust.

Remember that we need this pie filling to set like the consistency of a custard. Bake it at 325 degrees for about 45 minutes. You might check on the pie once in a while and see if there are any cracks forming on the top (this normally indicates that your pie is about done).

You might also like to try the old toothpick test: if you poke the pie filling with a toothpick, and it comes out clean, then the pie is done (remember to poke it vertically and once the pie is out of the oven).

When the pie is ready, set it aside while you prepare the topping. Ingredients:

  • 1/2 cup pecans
  • 1/2 cup cranberries
  • 2 nos biscotti

Toast the pecans on a baking tray and set them aside so that they are nice and crunchy.

Now, in a food processor, add the pecans, cranberries and broken pieces of biscotti, and pulse it till it forms a coarse grainy consistency.

Top the pie uniformly with the crunchy cranberry topping.

« Previous Entries Next Entries »