Skip navigation.

Maudlin ruminations of a mind bit by wanderlust.

And a shaft of light shall sunder the heavens...

Without a compass.

, ,

Do you ever get that feeling where one moment you feel you're in control of everything and the next moment you find out that something has gone horribly wrong? That's exactly what happened to me during my Technical Drawing Exam. I went in, prepared to draw the wierdest shapes I had never seen, and then - bam - no compass. I am possibly the first to complete the exam without using a compass the entire time. The circles I drew by hand came off pretty well, although I had to take 16 points to get a decent curve.

More when I finish the last one.

Variety

, , , ...

My exams start tomorrow, and end on the 23rd of May. An era will have ended, as I will no longer be subjected to Physics and Chemistry after these exams. Anything I do in these subjects after this will be my own folly.

In other news, I was recently keeping up with the French Presidential elections. I was backing Segolene Royal (Inconsequential, since I can't vote, but still), for the same reason why many people voted for her -- Because I didn't like the other alternative. Being a student, I can sympathize with the student riots in 2005, and can't see my way to elect a president who did tantamount to incite it. Granted, I know almost nothing about any of these issues, but still this is what my gut feeling says.

The Python posts are on hold, because my exam on C is tomorrow. I don't like C. One quote compares a C program to a dance on a waxed dancefloor holding knives. That's pretty much how I feel. In C, you need to think about what you can do practically, and then write a program. In Python, you write a program, with the confidence that you can make it work.

Australia won the World Cup, and the Sri Lankans are in uproar about Adam Gilchrist's keeping a squash ball in his glove. I don't know what to say.

Let the circus begin...

,

Over the last 6 months, and especially in the last month, I have immersed myself in the study of Python (Hence my inactivity, or so I justify it). Because of this, My next few posts will probably be Python related, with this one being an inaugural post of sorts. For anyone who's going or thinking of going into Computer Science or related fields, or even anyone who likes nifty shortcuts to get things done, or anyone geeky enough to use Linux, read on. Even if you don't fit into one of the above categories, maybe I can change your mind.

What is Python?

The Python website says :

Python® is a dynamic object-oriented programming language that can be used for many kinds of software development. It offers strong support for integration with other languages and tools, comes with extensive standard libraries, and can be learned in a few days. Many Python programmers report substantial productivity gains and feel the language encourages the development of higher quality, more maintainable code.



I more or less agree.

Python is arguably one of the most elegant and simplest programming languages in existence. It has very simple syntax, (ie to say, almost none at all), which borders on natural English. Many people have remarked that Python is akin to "executable pseudocode". Because of this, it's very easy to pick up, and lets you concentrate on the logic, rather than grappling with complicated syntax rules. In effect, it's a perfect beginner's language.

But don't think that it's just a beginner's language. Its extensive libraries (more on that later) and exhaustive constructs give it as much functionality as any program would require, and then some. Many mundane/difficult tasks become simpler when using Python.

I'll just give the one example this post, to keep it readable. This is the "Hello World" Program in C++

/* File HelloWorld.cpp */
#include <iostream>

using namespace std;

int main(int argc, char* argv) {
    cout << "Hello World";
    return 0;
}

And to run it, you'd have to do

$ gcc HelloWorld.cpp -o HelloWorld.o
$ ./HelloWorld

on a linux box. Don't ask me for Windows, I hate programming on Windows.

And now for something completely different...

# File HelloWorld.py
print "Hello World!"

and to run,

$ python HelloWorld.py

See the difference? Inevitably, both these programs are the first taught in their respective languages, and yet I'd never want to teach what exactly '#include', 'namespace', and 'int main(int argc, char* argv[])' mean. All I'd want to teach would be the 'print'/'cout' statement, which is exactly what Python asks for.

Biased though I am, I must tell you which are the only 2 inadequacies I've found so far in Python :

  • It's slow compared to other compiled languages. Not that slow, but it becomes noticeable in large programs of the number crunching sort.
  • You must have Python installed on any computer you want to run a Python program on. This is not a problem for linux machines, as most of them have python by default, but can be a minor headache for windows users.


But these aren't that important for many people, and they certainly aren't important for the casual programmer.

One other point worth mentioning about Python is its 'Batteries Included' Policy. This means that when you install Python (all of a 9MB download), you get a huge wealth of standard libraries -- almost all the built-in functions you're ever going to need. There are very few separate downloads I have needed to make to obtain code to use in my programs.

A final note for this post :
The name 'Python' does not come from the class of non-venomous constricting snakes genus pythonidae, but rather from the name of the British comedy troupe Monty Python's Flying Circus and subsequent creations.

Links worth looking at :

Dramatic Exit, Stage Center.

, , ,

First there was...

ROME (10 February, 2007) : "I want to send a strong signal that India is not a potential but a real partner, politically, culturally and economically," Italian Prime Minister Romano Prodi told The Hindu in an exclusive interview.



...then there was this, ...

CHENNAI (11 February, 2007) : Italy had opened itself to both the West and the East and would want to be the "European gate" to Asia in general and India in particular, Italian Prime Minister Romano Prodi said on Saturday.



...this, ...

(BANGALORE, 12 February, 2007) "India and Italy will always go hand-in-hand" and there will never, never be any conflict with New Delhi, he (Romano Prodi) said. His engagements in the city included visits to a facility of Indian Space Research Organisation and to NASDAQ-listed IT firm Infosys Technologies Limited.



...this, ...

KOLKATA (February 14, 2007) : Italian Prime Minister Romano Prodi said here on Tuesday that his Government was ready to work with West Bengal in specific areas such as agro-business, leather, mechanical and engineering segments.



... and also this.

MUMBAI (February 15, 2007) : The visiting Italian Prime Minister, Romano Prodi, and his business delegation have taken Indo-Italian partnership to a new level with the signing of 11 different agreements between Indian and Italian companies on Wednesday. The agreements were signed here in the presence of Mr. Prodi and the Union Commerce Minister, Kamal Nath.



Finally there was this...

ROME, Feb. 22 (AP): Italian Premier Romano Prodi resigned after just nine months in office yesterday, after his centre-left government embarrassingly lost a Senate vote on foreign policy...



My, that was an action packed two weeks wasn't it?

EDIT : The drama was not to last, he was voted back into office.

Karle karle tu ek sawal...

, , ,

I don't think this promotional rap song starring Shah Rukh Khan was prompted by sagging TRPs for his show. Regardless, it's an awesome song (at least I like it).





For those who aren't in the loop, Shah Rukh Khan is an Indian Actor who is anchoring the show "Kaun Banega Crorepati?", the Indian version (and almost literal translation of) "Who wants to be a millionaire?".

P.S : I still don't know hindi.

The KlueLESS Pythonist.

, , , ...

You know about me and Klueless. I don't know if you know about me and python, but if you don't, know it now.

The Python Challenge is a riddle similar to Klueless (Perhaps such a format is standard for all internet riddles), but requires programming knowledge in Python. It was launched in May 2005 (which means I just found out about it) and has 33 levels. The challenge helps you find your way through the nooks and crannies of all the amazing modules included with python, features you didn't know were there and can almost certainly find a use for in the future. It's as addictive as klueLESS is/was, although you need to know python first.

For those who are KlueLESS :wink: as to what Python is, it's a very simple and elegant language that rids you of syntax problems so you can concentrate on the important stuff. Python is an awesome programming language which I'm definitely going to blog about in the near future. It's very easy to learn, and very soon you'll start applying it to problems you have everyday.

NB, About the challenge : You can do the problems in a language other than python (I considered doing some in C++ because I was lazy) but in the end you'll find that python was simpler, faster and more elegant. Besides, it's against the spirit of the game (And all the hints are in python code :wink:).

Go try it out, and tell me what you think.

I'm back!!

I just patched my computer back up, and have returned to reality. Yes, good to see you too. I'll tell you about my holiday in a short bit.

Happy Holidays.

, , , ...

I'm going here :



for the Christmas holidays, so I won't be writing much, that is to say, any more than I was before, which isn't much at all.

Merry Christmas, or whatever, and I think I'll be back for the New Year.

An as-and-when-you-feel-like-it-update

, , ,

  • Tests are ongoing. I have electronics on monday.
  • I'll probably go on a trip for the Christmas holidays.
  • Numb3rs was taken off air, and reruns were put on.
  • So was Commander in Chief, which was my replacement.
  • Now I'm stuck to watching Ghost Whisperers.


It's depressing to note how my life can be summarized to 5 lines.

Yes, Numb3rs was taken off AXN, and although I've been watching Commander in Chief for the past couple of weeks, that was taken off too, so now I'm watching Ghost Whisperers. For those who aren't in the know, Ghost Whisperers is a drama/serial starring Jennifer Love Hewitt (whose presence makes remembering the rest of the cast largely unnecessary), who acts a normal woman who has paranormal gifts. Succintly put, she can talk to the spirits of dead people. It's kind of appealing, once you firmly fix in your mind that it is, in fact, not strictly real. What I find largely hilarious is that the reactions of the characters is ludicrous that I fail to see how anyone could belive it. This in turn leads me to the disturbing question of, are the Americans (who are the target audience), so gullible? Here, let me show you :

JLH : Did my mother ever mention to you that I have a gift?

Other character : No, not that I remember, why? What is it?

JLH : I can...like...communicate with the spirits of beings who are no longer with us in this world.

Other Character : My...(dead daughter)..Sarah came to you?

JLH : Last night. She wants to know why your husband and you were fighting on the night she died.

Other Character : No, please tell her we weren't fighting, we weren't angry, where is she? Can I talk to her?

JLH : (Maintains serious look)

I am unable to remember the rest of the conversation because that's where I fell off the couch laughing. I found it difficult to imagine how the actors can deliver such ridiculous lines with such serious expressions -- I guess that's what they get paid the earth for.

update : Commander in Chief wasn't taken off after all, just slot changed to Sunday.

Back at the helm

,

I just found out how much I rely on the internet : A lot. Too much. It's sad, but it's to be expected. I shifted house 3 weeks ago, and it took that long to get a connection to my new house. And I was alone. Totally disconnected. Couldn't keep in touch with anyone, couldn't do research that I had to do, zip. Nada.

But strangely, now I feel bored.

Anyway, I've retaken the bridge and am back at the helm.
Download Opera, the fastest and most secure browser
December 2009
S M T W T F S
November 2009January 2010
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31