Posts

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

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 b...

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

Image
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 applicab...

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).

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...

Chinese Intervention?

Image
Just on a light note, have a look at this screenshot of Firefox in an "embarrassing" situation. I wonder if it was because of the ever present Chinese... :)

Automatic Django Template Directory adjustment

Django is that hot new MVC framework on the block that's kept me sleeping at night, quite unlike PHP . Yup, its that good! :) It's got wonderful features that make me feel - Yeah! Development for the web is still worth the grind! By the way, if you're not into Web Development and don't care two hoots about the difference between a framework and a library, this post is not for you - Mosey along now! Nothing to see here. ;) Anyway, one of my few n00b questions to which I've never actually got a satisfactory answer is - How do you specify the template directory so that you can send your code to others and have it execute by manage.py runserver without any changes? The primary problem is the hardcoding of directories that is done in the settings.py file at the root of the project. After a bit of searching, I've come to a satisfactory solution and lest I forget it, I've decided to post it to my blog. Here's the code snippet. TEMPLATE_DIRS = ( # Put s...