Posts

Showing posts from 2008

My match with Vishwanathan Anand

On the sidelines of the PanIIT Alumini meet being held at IIT Madras , Vishwanathan Anand - World Champion of Chess put in an appearance and played 14 boards of chess in a rapid mode of play. This was the sequence of moves played at table 4 by Narendranath (a 2000ish rated player and captain of the IITM chess team whom I met while playing chess at the InterIIT sports meet held earlier). It was real fun. Have a look. White: Vishwanathan Anand Black: Narendranath (IITM)/Divye Kapoor(IITR) Match abandoned due to lack of time. 1. e4 c5      ; Sicilian Defense 2. Nf3 Nc6 3. Bb5 a6     ; push the bishop 4. Bxc6 bxc6  ; have a doubled pawn 5. O-O d5     ; try opening the doubled pawn 6. d3 Bg4     ; try pinning the Knight 7. h3 Bh5     ; push back the bishop 8. Nc3 d4     ; push the Knight and block the center 9. Na4 b3     ; Knight threatens entry 10. Bg5 h6    ; Push the Bishop 11. Bxf6 Qxf6 ; Bishop v/s Knight exchange 12. g4 Bg6    ; Break the pin on the Knight 13

Is Heysan.com a clickjacking attack, virus dropper or something else?

Image
For those of you who have been regularly using GMail , the recent arrival of unexplained chats from your friends might have piqued your curiosity. A chat lands up in your GMail Inbox claiming to have been sent to you by one of your friends bearing some sort of cheesy one liners and that you should click on the link to view them. Something like this: Though usually I'm highly suspicious of these sorts of clicks, I went ahead and clicked it. (After all, Firefox, my favourite web browser has quite a decent track record as far as security is concerned).The site that opened up looked like: Now, I'm not going to be giving up my Google Account password to any site that just asks for it. No Way! Not a Chance! Not even if it boasts of the Google Talk logo. But then, there are all kinds of people in the world and some are likely to enter their Google ids and passwords due to ignorance. In my opinion, this site is a fraud that is directly and obviously obtaining access to userids and pas

Permutations of a string containing duplicates (C++ Version)

Update : This is part 1 of a 2 part series of posts that discuss generating all possible permutations/anagrams of a given string. This post discusses how to use the next_permutation function provided by the standard C++ library to generate the anagrams iteratively. The next post discusses a custom recursive implementation of how to achieve the same thing. See:  Recursively printing all permutations of a string containing duplicate characters. Have you ever thought of how to generate and display/print all possible permutations of a string (containing duplicate characters) such that every legal permutation appears atmost once in the final output, without taking a humungous amount of memory to keep track of all the permutations you have generated? This particular function utilizes a cool STL algorithm and generates all possible permutations of a string only once (whether the original string contained duplicates or not). int dup_permute(char *str, size_t length) {     int count = 0;

Selected!!!

Image
After 5 hours of mind wrenching tension and reams of code later, I've finally been selected for the internship programme at the Microsoft India Development Center (better known as Microsoft IDC ). The internship is going to last for atleast 8 weeks and I'll be getting accomodation for 15 days and travelling expenses in addition to my internship stipend. Looking forward to going to Hyderabad, anybody going to meet me there?

The 'Said' Problem

I came across this cool piece of text on a patents website. "The computer-readable medium of claim 23 wherein said workspace is used by a database system to create a plurality of run files, each of which contains a plurality of variable length records from said set of variable length records, as sorted by said database system using said workspace, said step of selectively removing comprises writing a next of the plurality of variable length records that are stored in said workspace out to a run file in a predetermined order, said method further having computer-executable instructions for performing steps comprising: determining that said set of variable length records is greater in size than said predetermined fixed extent of said workspace; creating one or more run files on a data storage medium; and writing out to said run file only those variable length record selected by said step of selectively removing subsequent to determining that said set of variable length

Easter Egg in Google Chrome

Image
Try typing about:crash in the title bar of Google Chrome and see this cute cross eyed robot! :-) Of course, you do know by now that Chrome is hottest new entrant on the browser block, don't you? Well, now you do. :-D Have a look at this review of Chrome on ZDNet.

in.com - India on the world stage

Image
Its rather rare that you come across a site with content really geared towards Indians with a look and feel matching any world class website. Take a quick look at the layout and source code of sites such as CNN-IBN and Aaj Tak and you will realize that we are really retards as far as decent site layouts and navigation is concerned. However, in.com was a really refreshing change. The interface is quick and snazzy and the site runs on blazing fast servers - in fact, I would go as far as to state that I had a better experience with their quick registration and speedy interface than I had with GMail on Google servers. Oh and just not to forget, they've gone onto internet overdrive and I'm constantly receiving targeted ads that lead me to their site. Well, what can I say - you have me hooked! :-) The first thing that I tried out was their radio service - its awesome! Have a look at the screenshot below: Despite it being an obvious ripoff from last.fm , I really don't mind. T

Enjoy Everything You Do

Live the life of a dolphin, Travel the world without fear, Whether to the top of a mountain, Or where the water ain't clear. Fear not to push the ceiling, Try to reach for the sky, Go with the flow if you want to, Or be left high and dry. Speak your words with feeling, Enjoy everything you do. Play from dawn to the evening, Is that not everything you do? Follow the world in its footsteps, Or make the world follow you. Do everything with feeling. Enjoy everything you do.

Bird of Fire

Fly, Fly, Fly little bird in the sky. You own the heavens - the Earth and the Sky. Lie, Lie, Lie, asleep in the clouds, Free from cares, from worldly bounds. You creature of mirth, of joy abound. Live, Live, Live, a life full of dreams, Unchecked by dearth of form or means. Pray, Pray, Pray for a life full of song, For finding a rhythm to play along. You creature of milk, to heavens belong. Say, Say, Say, the words in your heart, Bring a smile with a kind remark. Day, day, day a day in your life, Opens a door from formless night. You warrior of words, of shape and light. Inspired by - To a Skylark by P. B. Shelly

Wordle and SEO

Image
An image is worth a thousand words. This image is a tag cloud generated by Wordle from the text at http://www.drkapoorsclinic.com . I don't need to tell you how such a map is helpful for SEO - do I? And yes: despite my earlier post on Mac v/s Vista - that *is* a screenshot taken from my laptop running Vista. You might call me a hypocrite, I just call myself a pragmatist - if you can't beat 'em, join 'em. ;-)

Walking through your first template metaprogram in C++

From the Wikipedia article on Metaprogramming: Metaprogramming is the writing of computer programs that write or manipulate other programs (or themselves) as their data, or that do part of the work at compile time that is otherwise done at run time. In many cases, this allows programmers to get more done in the same amount of time as they would take to write all the code manually. Unfortunately, metaprogramming is not directly supported by C++ and resources on template metaprogramming are few and far between. I'll try to document my knowledge of metaprogramming as I learn it and hope that it proves useful for one such as myself hunting the web for information. First, lets get the preliminaries out of the way: Templates are used to create generic code (but you already know that, don't you?) Code like: template <typename T> std::string to_string(T const & object) { return object.to_string(); } is used to allow the to_string function to be called on all objects tha

I'm Back

Hey all, Its been ages since I last posted on this blog and its been rather sometime since this blog had been taken off the internet. However, I'm back on the internet after being *really* busy at college and the blog is back online. Well, in the time my blog was offline, I was completing my second year at college and in the summer vacations was developing a website for my dad and mom's Ultrasound clinic . You can see the final result at their home page: http://www.drkapoorsclinic.com .