Wednesday, March 31, 2010

Zigndog 3rd Session - Django

Hey guys and girls,
   I have the screencast nearly ready, but it is hugely boring and very very long. Not only that, it's very impossible to download because of the large file size. So, if you're interested, what is the max file size that you can download? Ping in the comments, I'll try and make it smaller.

Divye

Wednesday, March 17, 2010

The super duper not-so-secret recipe for a great Pasta

Pasta in White Sauce

Okay, here goes the super duper ultra not-so-secret recipe to awesome indianized pasta created by the resident geek who writes on these hallowed pages.

Part 1: Preparing the pasta
1. Take a huge kadhai and fill it with sufficient water (sufficient = enough to cover all the pasta you will put into it later completely).
2. Add enough salt to make the water quite salty. Exact quantity doesn't matter too much here..
3. Start heating the water, put in the pasta (penne version preferably as it doesn't break easily) and bring to boil. The water will start frothing.
4. Keep the pasta boiling in the water till it grows in size and changes colour from hard, deep yellow to a lighter, softer, larger size (closer to off-white)
    Acid test for this step: you are able to break the pasta easily with a tablespoon's edge.
5. Remove from boil and drain away all the water with a sieve. (you can taste the pasta to judge its saltiness if you like, it won't be much)
6. Typically, you should be in a position to directly add the pasta to the white sauce that you should have prepared in the meanwhile. If you keep the pasta out for too long, it might start to stick. You can avoid that by coating it with a little oil (similar to noodles).

But I guess you know all that... here's the recipe for the sauce:

Part 2: Preparing the white sauce
0. Cut carrots and beans into 2" long, thin strips. Using about a 1-2 teaspoon of oil and about 1/2 tsp salt, cook the vegetables in an open pan at high heat till they are ready to eat but slightly crunchy. These vegetables will be used in step 6 (can be done in parallel with the remaining steps).
1. Take a kadhai and put in 1.5 - 2 tablespoons of butter and start heating till the butter melts
2. If you want an indianized version of the pasta, now is a good time to put in all the spices - Ajwain for the flavour, some jeera as per taste (any other spices of your choosing). Fry them till they change colour slightly. Add about 1 tablespoon (about 3 teaspoons) of garlic paste freshly prepared from garlic cloves (critical) (erring and adding more is good, adding less is not). Fry till slightly brown and aromatic. Add salt to taste (make sure to account for the salt in the butter and the vegetables and the slight salt in the boiled pasta). 
Reduce the heat and add milk as per the next step.
3. Add 1/2-1 litre of milk (do a bit of judgement here).
    The quantity should be just enough to cover the pasta after accounting for the reduction.
4. Bring the mixture to near-boil at high flame and then add 1-2 teaspoons of dissolved cornflower (dissolved smoothly in 1/2-3/4 cup of water) to the sauce.  This will cause the milk sauce to thicken slightly. Keep stirring the mixture to ensure no lumps form and cook for a minute or two.
5. Add 1-2 tablespoons of tinned cream (optional) and turn the heat down slightly for thickening. Simultaneously, add 3 cubes of grated cheese (where 1 cube is as per Amul's processed cheese pack), lots of oregano (to taste - about 3 to 5 heaped teaspoons), 3-5 cloves for flavour and about 1-2 teaspoons of freshly ground black pepper. Keep heating at slightly reduced flame, thicken for a short while (2-3 minutes (estimated) - the sauce will thicken further on cooling)
6. When the sauce is of the desired consistency but slightly more flu, add the vegetables prepared in step 0 and mix well.
7. Add the boiled pasta prepared separately. Mix well and cook a little so that the flavours seep into the pasta.
8. Pour into a separate container for serving, dust with oregano, grated cheese and black pepper powder (freshly prepared)
9. Garnish with a sprig of freshly plucked Tulsi leaves. Serve hot.

List of ingredients:
1. Carrots, Beans - as per quantity desired in the final dish (example values - 2 long carrots, about 10 beans) - cut into 2" long thin strips (french fries type but much thinner)
2. Penne pasta - I don't know the grammage exactly, but 1 big packet (use only 1/2 or 3/4 of it)
3. Butter - upto 2 tablespoon
4. Ajwain, Jeera - to taste (optional)
5. Garlic paste prepared fresh from garlic cloves - roughly 1 heaped tablespoon or slightly more
6. Milk (boiled preferably) - 1 litre
7. Cornflower - 2 teaspoons
8. Black Pepper (freshly ground) - min 2 teaspoons + more for garnishing
9. Tinned Cream - about 2 tablespoons (optional, but highly recommended)
10. Oregano - lots of it. 3 to 5 heaped teaspoons + more for garnishing.
11. Cloves - 3 to 5 (optional)
12. Cheese cubes (grated) - 2-3 cubes for sauce + more for garnishing
13. Tulsi leaves - for garnishing

Serves: 4

The standard disclaimers apply:
1. I don't take any responsibility should you try this recipe and it blows up in your face, leaving you much the poorer on an empty stomach.
2. All the measurements are approximate as I'm an experimental cook and not a theoretical one.
3. Should you so decide to go ahead, feel free to tell me of the results. I would love to know.


A few closing comments
To the Dieters: What are you doing here?
To the masochist dieters: What's the calorie count of this dish?
To the Geeks: Please learn to cook. It is an important survival skill that will serve you well in life.
To the CS Geeks: No, that fancy robot you've just programmed cannot cook this for you. Get up and do it yourself.
To those in Google/Facebook: Just get your fix from your in-house cook, will ya? Cooking this could prevent you from saving the world! :P


Take care guys! Until next time, Chef DK signing off!



Friday, March 12, 2010

How to enable Compile and Run for C/C++ files in gedit

I never liked using gedit for programming because it needed extensive customization before it even came close to becoming a programming editor. However, those that are just starting out with linux will feel most at home in gedit. So here is how to enable "Compile and Run" functionality in gedit.

1. Enable the External Tools plugin by going to Edit -> Preferences -> Plugins as shown in the screenshot below

2. Go to Tools -> Manage External Tools and create a new Tool by clicking on the "new" icon near the Help button.

3. Name the new tool "Compile and Run" and press enter
4. In the coding area, paste the following script:

#!/bin/sh
cd $GEDIT_CURRENT_DOCUMENT_DIR
g++ -Wall -g $GEDIT_CURRENT_DOCUMENT_NAME && xterm -e "sh -c './a.out; echo Press enter to quit... && read KEY'"

5. Put in a shortcut key (eg. Ctrl + F5) in the shortcut key area
6. Set the save setting to Current Document
7. In the applicability setting, select C and C++

That's it. You're done! Press Ctrl + F5 to start off with compile and run. Happy coding!

PS: All the tools to make gedit programming worthy can be found in the blog posts here:
http://www.makeuseof.com/tag/top-plugins-to-extend-and-make-gedit-a-more-useful-text-editor-linux/
http://www.micahcarrick.com/09-29-2007/gedit-html-editor.html

Compile and Run For C/C++ programmers on vim

If the file is named file.cpp or file.c, in the vim command mode just type in:

:!make abc
:!./abc

The first command compiles file abc.cpp to the executable file abc in the current directory. You can then execute it using the second command.

Alternatively, you could use something like :!g++ -g -Wall file.cpp -o file if you want to specify your own compilation options. (Anything more complex and you should be using a Makefile anyway).

Wednesday, March 10, 2010

Reprint of Zigndog Certificate

This post should probably belong to the Zigndog site, but seeing that I have no time to update it, let me just post it here. I trust that most of you who are interested will be mailing me soon (common self-interest reasons) :)

To get your rewritten certificates, you need to perform the following tasks:
1. Get in touch with me on my Zigndog id (divye kapoor (at the rate of) zigndog (dot) com
2. Send in a scanned copy of your old certificate along with your correct spelling and the address to which you want the certificates dispatched.
3. I'll acknowledge the receipt of your email and dispatch the revised certificate soon.
4. On receipt of the revised certificate, please mail back the original certificate via speed post.

That's all folks!

Looking forward to your mails...