A delicious bookmarklet that works with noscript

This is technical, so unless you’re a do-it-yourself programming/javascript geek, you will not find it interesting.

I was trying to solve this problem:

  • I like to bookmark interesting links on my delicious.com account
  • I like to use NoScript with my firefox – this disables javascript/flash/ads/XSS and other things on a lot of sites, giving me a much more stable experience on various websites.

Unfortunately, both of these things don’t really go well together. NoScript blocks the delicious bookmarklet, and at this time there doesn’t seem to be a any easy way to get it to work as it is.

I tried adding https://delicious\.com/save to the Anti-XSS Protection Exceptions in NoScript preferences but that did not help.

Of course, I can always copy the URL of the site, go to delicious.com and then add the link manually, but that is too much effort. I do this often enough that I needed to automate the process.

After some trial-and-error I decided that the problem was the use of iframes in the delicious bookmarklet. So I wrote this much simplified delicious bookmarklet which works like a charm.

Here is the code for the bookmarklet:

javascript:window.location='https://delicious.com/save?url='+encodeURIComponent(window.location.href)+"&title="+encodeURIComponent(window.document.title)+"&v=1.1";

Just add a bookmark to your Bookmarks Toolbar with “Add to Delicious” as the name and the above code as the location. Now on any website, click on “Add to Delicious” and you get redirected to a page that prompts you for the tags and will then add the delicious bookmark.

Note: if you want to automatically include the current selection as the note/description in the bookmark, use this code instead (I haven’t tested it, since I’m not interested in a note, but I think it should work):

javascript:window.location='https://delicious.com/save?url='+encodeURIComponent(window.location.href)+"&title="+encodeURIComponent(window.document.title)+"&note="+encodeURIComponent(""+(window.getSelection?window.getSelection():window.document.getSelection?window.document.getSelection():window.document.selection.createRange().text))+"&v=1.1";

How I studied for the IIT-JEE

(I had written this as an answer to a question someone asked me to answer on Quora. I am a bit surprised by the amount of popularity and the kinds of reactions it garnered.)

I managed to get a rank of 14 in JEE (1988) in a very unconventional way.

I will first give a conventional answer about how I studied (or rather did not study), and in the latter part of the answer, I will speculate on why I think I did well.

The things I did NOT do:

  • No classes: I did not join any JEE coaching classes – for the simple reason that I lived in Nashik, and at that time, there were no JEE classes in Nashik. In fact, few people had even heard of JEE or IITs. (I did join coaching classes for 11th/12th board studies, and my performance in board exams is directly attributable to those classes. (Thank you Gadgil and Vanzari Sir.))
  • No skipping college: I attended all the lectures and all the labs and my classes in my 11th/12th.
  • No other exams: I did not appear for any entrance exams other than my 12th std board exams, and JEE.
  • No losing sleep: I used to sleep for 8 hours every day.
  • No sacrificing 12th std: I was not really expecting to clear JEE, so JEE studies were a second preference, and I studied hard for 12th std (HSC, Maharashtra) exams. I did well (2nd in Pune board merit list).
  • No Resnick and Halliday / Feynman / Irodov: I did have my own copies of the two volumes of Resnick and Halliday, but to this day, I have not read more than one page. I hadn’t even heard of Irodov or Feynman.
  • No marathon/heroic study sessions: I never studied for more than 3 hours per day (except in the last month). In the last month, I did study about 8 to 12 hours per day.
  • No JEE preparation/classes in school: I hadn’t even heard of IIT or JEE until my 10th std, so there was no question of doing any IIT-related preparation in 5th/6th/7th as kids seem to be doing these days. I started in 11th.
  • No practice exams: I did not appear for any mock tests.
  • No study buddies: As I mentioned above, I did not know anybody else in my city who was appearing for the JEE seriously. So, I did not study with someone else.

What I actually did:

  • Agrawal Correspondence Course: In those days, Agrawal classes of Bombay (which no longer exists, I believe) had a correspondence course. I signed up for that. I used to get one packet of study material, and practice questions every month. I would go through the study material, and then solve all the practice questions (by myself). Agrawal would also have practice tests, and mock exams, and other such things. I never did any of those. If you sent them your answers to their practice questions, they would send back corrected copies. I never did any of that either.
  • Board exams vs JEE: For most of my 11th std., I attended all my classes, labs, and the (non-JEE) coaching classes, and did some studies, but not a lot. I started seriously studying for JEE around the end of 11th std. From then on, for most of 12th std, I did only JEE studies, and did not bother with college studies (except attending all lectures and labs and coaching classes). About 2-3 months before the 12th board exams, I stopped JEE studies entirely, switched to studying only for the board exams. After the board exams, I had about 1 month of studying for the JEE.
  • Regular Studying – 3 hours per day: Starting from (roughly) the second half of 11th std, I studied 3 hours everyday. Regularly. This included JEE studies as well as college studies. I would start studying at 10pm, after a good dinner, and watching about an hour of TV with my family. I would study until 1am. Sometimes I would go on till 2am if the problem set I was working on had particularly difficult problems. In any case, I would sleep until 9-9:30am in the morning, and then go off to attend college (10:30 onwards), and labs (afternoons). I did not do any studying other than during those 3 hours (except in the last month before my board exams and the month before JEE, when I did not have to attend college, so I would study the whole day, roughly 5-6 hours during the day, and 3-4 hours at night.)
  • Doing everything else: I attended college during the day. In the evenings (starting around 6/7pm) I would go for a long walk. I had various friends and relatives who stayed 3-5km from home, an I would walk to their house, spend an hour with them, and walk back home. In case of friends, I would either goof off with them, or if close to college/board exams, I would help them with problems in their studies. In case of relatives, I would play with my cousins (who were babies at that time). After coming back home, I would watch TV (we had just 2 channels at that time) until 10pm.

Was it a fluke?

Since I never appeared for any mock tests, I had no idea how I would do in JEE. Only 1 guy from Nashik had made it into IIT 2 years before I did, with a rank of around 200, and he had been a state topper in the board exams. I did not believe that I was as smart as he was, so I would have been very happy if I had gotten a rank between 1000 and 1500. But, I believed that there was a very good chance that I would not get in at all.

So, I was flabbergasted when I got a rank of 14. Agrawal classes had invited the top-100 rank-holders for a 3 day celebratory trip to Bombay, and when I met and talked to the others, I quickly realized that I had not done any of the things that the others had done to crack the JEE. This feeling got even more pronounced in my first few days in IIT-Bombay. A lot of my classmates were students from Ruparel college, who used to talk about Feynman’s lectures in physics, and the difficult problems from Irodov, and some particularly arcane paradoxes involving angular momentum, and other such things. In general, they had far, far more exposure than I did, and I managed to get myself a massive inferiority complex, and would often wonder whether my JEE rank had been a mistake or fluke of some sort.

I had an unhappy couple of months until the first mid-semester exams, when I out-scored most of them and it slowly began to dawn on me that in spite of my lack of exposure to Messrs. Resnick, Halliday, Irodov, and Feynman, my JEE rank was not a fluke.

So, what was my secret?

I don’t know. But over the course of my 4 years in IIT, I realized one thing: my basics in Physics and Maths were extremely clear. (The same couldn’t be said for Chemistry, but that is another story.)

I now believe that my success was probably due to some of the books (related to Maths, Physics, and general Problem-solving) that I read (just for fun) between the ages of 5 and 15. (A list of the books is included at the end of this answer)

When I was 6, my aunt (who lived in the US) gifted two books of brain teasers (Master Mind Brain Teasers, and Master Mind Pencil Puzzles – both by Joseph and Lenore Scott) to my sister (who was 4 years older). Many of the problems were too complicated for me, but I would simply read the question, and then read the answer. I do think it helped me develop very good problem solving skills (in spite of the fact that I did not actually solve most of the problems myself). Over the next 3-4 years, I would periodically return to those books and re-read them. (Thank you, Krishna Rajadhyaksha)

When I was 9, my school gave me: Figuring the Joy of Numbers (by Shakuntala Devi). This got me started on a life-long love of numbers and maths. (Thank you, Mrs. Roy.)

When I was 11, I got books on Physics and Maths by Ya. Perelman: Algebra Can Be Fun, Figures for Fun, Physics for Fun and Entertainment, Parts 1 and 2. (I can’t find a link to these exact books on Amazon, but I believe this and this are newer editions of the same books). These books I continued to read on-and-off for the next 3-4 years.

Important point to note: these books are not text books, and were not supposed to be “study” books, and were not prescribed by any teacher or class. All of them are ‘fun’ books that I read just out of interest. In fact, my parents would (mildly) complain that I never studied. But it is because of these books that I have very strong fundamentals in Physics and Mathematics (based on intuition, and not just rules and formulas), and good problem solving skills.

I do believe that these books helped build the foundation on which I was able to crack the JEE with much less effort than it takes most other people.

Random tidbits:

  • The only reason I had even heard of IIT and JEE was that I had a classmate in school who had moved to Nashik from Bombay, and he had a brother who was an IITian. He told me that I should appear for the JEE. (Thank you Suyog Moogi). He himself did not appear for the JEE (in spite of the fact that he would get roughly the same marks as I did in school).
  • As you can see from the “So, what was my secret” section above, I did not have a strong foundation in Chemistry. This ensured that I hated studying for Chemistry for JEE, and I continued to hate it after I joined IIT. At the end of my 1st year, on the day of my Chemistry test, I literally burned my Chemistry textbooks because I knew that I would not have to study Chemistry again in my life. A note to those who are going to use this as an excuse to stop studying Chemistry: The fact that I hated Chemistry meant that I had to spend more time studying it, not less. In fact, that is the reason I hated it.
  • These days I routinely give copies of the 4 Perelman books as gifts to any school kids of my friends/family if they show an interest in Science/Maths. Sadly, many of them never read the books 🙁 but I hope there are at least one or two who are inspired by them the way I was.
  • After all the 12th std exams were over, I promised myself that I would never again give this much importance to academics (or indeed my career) again. I decided that I would take an active interest in things other than studies/work. I have largely kept that promise, and as a result, my career graph has not been as impressive as some people expect (based on my JEE rank – e.g. went to a top-10 Univ in the US, not top-5; did not become a fellow/CXO in a large company; and now struggling with a startup that I *want* to do instead of a lucrative job that I *should* be doing; etc), but I have no regrets. I have done other things that I am proud of.
  • It is important to remember that not cracking the JEE does not mean that you’re not smart enough, or that you’re not going to be successful in your career. Students will appear for JEE, or have appeared and failed, and especially parents of such students – do not give up hope just because of bad JEE scores. I have seen enough people who barely managed to get into tier 2 or even tier 3 colleges, and even there, barely managed to pass their exams, but are now running extremely successful companies in which they hire IITians and later fire (some of) them for being too lazy. I have also seen people who are clearly not as smart as some of the other people around them, but when you look at their career over a period of 10+ years, you see them outperforming the others simply through hard work. Do not make the mistake of underestimating someone (especially yourself) due to lack of academic success.

(Check out some of the comments on this answer, and other related discussion on Quora.)

TRAI’s new SMS guidelines are a step in the wrong direction

Starting today, TRAI has started enforcing new guidelines with the intention of stopping the menace of “promotional” SMS, or SMS spam. No promotional SMS can be sent to any user who is on the DND list, and there are hefty fines for violations. Everyone is rejoicing the death of SMS spam, but this is a huge backward step for India – because along with SMS spam, TRAI has also outlawed the sending of automated SMS to users with their permission. That’s right: there is no way for a company X to send a status update to user Y even if the user Y desperately wants such updates, and even if he’s willing to give it in writing.

Don’t get me wrong. I hate unsolicited SMS messages as much as you do. But what TRAI has done is throw out the baby with the bathwater.

If I book a ticket on http://BookMyShow.com, I used to get an SMS confirmation. I could use that SMS at the theatre to pick up my ticket. Now? Gone. If a doctor answers an important patient question on http://bharathealth.com, the patient would get an SMS with the doctor’s answer (so that they get the answer immediately, and not have to wait until they log in to the site next time). This is a service that the patients love, and they start complaining as soon as the SMS service stops working. Now? It’s illegal. The fact that the receiver of the SMS actually wants it does not matter. SMS from http://Flipkart.com telling me where my book has reached – Gone. SMS updates that tell me whether my waitlisted Indian Railways ticket’s status has gotten confirmed – Gone.

Here are the sordid details as I understand them:

Automated SMS can be divided up into two categories: promotional/bulk SMS, and transactional SMS. Bulk SMS is where you’re sending the same SMS to a large number of recipients (e.g. a daily stock tip would be in this category). Transactional SMS is when you’re sending different sms updates/alerts/messages to different customers (e.g. an sms update from your bank immediately after a high value transaction on your credit card).

According to the new regulations, here is my understanding of the effects:

  • Users can sign up for a full DND (in which you don’t get any bulk SMS), or a partial DND, where you can opt in to receive bulk sms in certain categories. There are 7 such categories: 1: Banking/Insurance/Finance, 2: Real Estate, 3: Education, 4: Health, 5: Consumer Goods, Automobiles, 6: Communications/Broadcasting/Entertainment/IT, 7: Tourism & Leisure
  • Any user signin up for partial DND is pretty much asking the world of spammers (in that category) to start spamming him/her. Imagine – the partial DND list will be a public available list of people who have indicated an interest in a particular category and cannot complian if you spam them. A marketer’s (aka spammer’s) dream. As we say in Hindi, this is pretty much aa bail mujhe maar.
  • For DND users, transactional SMS can be sent only by: Banks, Financial Institutions, Insurance Companies, Credit Card Companies, Railways or Airline companies, and registered Educational Institutions. That’s it. No one else can send any SMS to a user signed up for DND.
  • Everybody else will essentially be treated as a telemarketer and be fined heavily in case of DND violations.

So, imagine you provide stock tips via SMS to users you have opted in to your service (what the heck, they’re even paying you for it). Under the new regulations:

  • No, you are not a Financial Institution just because you’re providing finance information. So you can’t send transactional
  • Under the new regulations, you cannot send your SMS to any user on the DND.
  • Your only hope is to convince that user to sign up for a partial-DND and opt in to receive messages for category #1: banking/insurance/finance. I would assume that most users who’ve signed up for DND will be wary of opening themselves up to telemarketing by going the partial DND route.

Follow a discussion of this question on Quora for more.

Also see Sagar Bedmutha’s post on pluggd.in on this topic.