After I turned 28, I have had 1500$ loss on the cancellation of my air tickets, been fined for speeding and had a "short-paper" acceptance (that's such a slap on the face). Rewind please :)
Well, at least I got a cake from my students for my birthday :)
Thursday, December 4, 2008
High-precision math
I was wondering a couple of months ago about how to achieve accuracy in floating-point computations such as say, try to multiple 4.34524362 with 2.456357642456 while we know that there is only finite precision that can be provided by programming languages. A way around this problem was to save the values as strings and multiple two strings rather than two numbers - so you won't be able to multiply two "values" a and b as a*b but you multiply them as multiply(a,b). Using operator overloading, even a*b can easily be achieved. Now, what I have done so far is +,-,*,/, factorial, combinations on integers and being too lazy, I only implemented the * functions on floating-point values. The implementation works for extremely large values (as high as the compiler would support for a string - which is pretty high :D)
The math_library.cpp (right click and choose "save target as") can be used by anyone but NOT for commercial purposes.
The math_library.cpp (right click and choose "save target as") can be used by anyone but NOT for commercial purposes.
Thursday, November 6, 2008
pumpkin masala / kaddu ki sabzi
This is a recipe I am posting as an apology to Eric for not turning up for the skype chat on Wednesday evening :(
Serves 2
1kg Pumpkin - JAP - the green one
Mustard seeds - 1/3 teaspoon
Cumin seeds - 1/3 teaspoon
Chilli powder - 1 teaspoon (for spicy otherwise half)
Turmeric powder - 1/3 teaspoon
Coriander powder - 2 teaspoons
Oil - 4 tablespoons
Coriander leaves for garnishing
cut the pumpkin. the size of the dices in the image will make the end product mushy (which i like). NO NEED to skin the pumpkin :) if you want the pieces to be separate at the end - cut bigger pieces.

Heat oil in a saucepan and when hot add mustard seeds and after 2-3 seconds cumin seends and after 3-4 seconds the diced pumpkin. toss so that they mix nicely. cover lid, turn heat down to 3 o'clock and cook for 20 minutes, tossing one or two times in between.
mix the chilli, turmeric and coriander powder in a cup with water so that it dissolves and becomes a liquidy paste. turn the heat high and add this paste, stir till they mix decently and turn the heat down again to 3 o'clock. Cook for another 5 minutes and done! garnish with coriander leaves and serve with bread/naan/ chapaati/ pooris (but not rice :D)
Serves 2
1kg Pumpkin - JAP - the green one
Mustard seeds - 1/3 teaspoon
Cumin seeds - 1/3 teaspoon
Chilli powder - 1 teaspoon (for spicy otherwise half)
Turmeric powder - 1/3 teaspoon
Coriander powder - 2 teaspoons
Oil - 4 tablespoons
Coriander leaves for garnishing
cut the pumpkin. the size of the dices in the image will make the end product mushy (which i like). NO NEED to skin the pumpkin :) if you want the pieces to be separate at the end - cut bigger pieces.

Heat oil in a saucepan and when hot add mustard seeds and after 2-3 seconds cumin seends and after 3-4 seconds the diced pumpkin. toss so that they mix nicely. cover lid, turn heat down to 3 o'clock and cook for 20 minutes, tossing one or two times in between.
mix the chilli, turmeric and coriander powder in a cup with water so that it dissolves and becomes a liquidy paste. turn the heat high and add this paste, stir till they mix decently and turn the heat down again to 3 o'clock. Cook for another 5 minutes and done! garnish with coriander leaves and serve with bread/naan/ chapaati/ pooris (but not rice :D)
Labels:
cooking,
pumpkin,
recipe,
simple food,
vegetarian
Subscribe to:
Posts (Atom)