me, thinking out loud…

A couple of counting functions

I had a strict character limit of 180 chars for something I was writing. I just wrote a simple function to count characters in a region or a buffer. Another function to count the words.

(defun count-chars ()
  "Count the number of chars in a buffer or region."
  (interactive)
  (let* ((beg (if (region-active-p) (region-beginning) (point-min)))
         (end (if (region-active-p) (region-end) (point-max))))
         (message (number-to-string (- end beg)))))
(defun count-words ()
  "Count the number of words in a buffer or region."
  (interactive)
  (let* ((beg (if (region-active-p) (region-beginning) (point-min)))
         (end (if (region-active-p) (region-end) (point-max)))
         (count 0))
    (save-excursion
      (goto-char beg)
      (while (< (point) end)
        (forward-word)
        (setq count (1+ count))))
    (message (int-to-string count))))

Asking vs. Figuring out

Should one take the easy route of asking someone who knows, if she is sitting right next to you? Or should we try and find out first, before asking her? Should one value his time more than others’ or others’ time more than his own?

Would we learn more if we tried to find out ourselves? Does learning more, make sense? Is it worth spending the extra time?

I’m just talking of simple things that you could figure out by spending a couple of minutes of searching the web or 5 minutes of thinking or 10 minutes of reading a book.

A GNU and a friend

I now have a GNU! I bought it (a GNU soft toy) in memory of my friend swathanthran from #emacs-in. RIP swathanthran

As a bonus, I got the chance to have a photograph with just RMS and me. Also, hoping the monetary contribution will be of some use to FSF-India.

The thrill of getting the GNU (and the GNU itself) and shaking hands, getting photographed with RMS is dedicated to all the lafoots and specially to Voodoo, who taught me the meaning of the word “hacker”.

Happy Hacking!

ps: I just hope and pray nobody else does anything as stupid and shocking as what swathanthran did.

Happy Teachers’ Day!

Well, it turned out to be not so Happy. I came to know of this sad news. A prof published his students’ work as his own, with no mention of their names! This guy is such a shame to his profession! Shame!

I wonder how this guy has even been able to sleep every night. Isn’t there something called a conscience?

RMS will be in IIT-Bombay on the 6th of this month. He will “speak about the goals and philosophy of the Free Software Movement, and the status and history of the GNU operating system, which in combination with the kernel Linux is now used by tens of millions of users world-wide. ”

  • Date: 6th September, 2010
  • Time: 8:30 P.M
  • Venue: PC Saxena Auditorium, IIT Bombay

org2blog on the web

Well, it’s been a week of lull on my blog. Not that I’m very busy. But, just didn’t have anything to post. I was feeling jobless today and searched the web for org2blog users. Here is what I found.

First 100!

We, Ritesh and I, finished our first 100+km ride – approximately 110km. Yo!

The Route map

IIT-Bombay to Karnala Bird Sanctuary, and back.

The Story

We started at around 0720 and were hoping to reach Karnala Bird Sanctuary by around 1130. We — actually, soot covered clones of us — reached by about 1215 or so. That’s pretty decent, considering we were directed to Karnala sports complex, when we were looking for bird sanctuary and there was quite a bit of traffic near Panvel.

While we were getting tickets to get into the sanctuary, a man was amused by Ritesh’s polka (dirt) dotted shirt and asks us whether we rode down from JNPT. We got all excited and told him, that we rode down from Powai! He just said, “Gone Mad!” and walked away, as if madness was contagious. Both of us, felt great! We were high! It felt like the best compliment to get after a long, tiring, (blackening) ride. We got in and rushed to a tap and almost had a bath under it. The first touch of cold water was heaven! Just a while later, we got a shock. We couldn’t get any food near/inside the sanctuary. We will have to go back 3 km for that. We spent about an hour and a half, getting some oxygen, looking for a few birds, giving up and settling with spiders and clicking some pictures. We got went back 3km to the hotel and spent about an hour there (not all of it eating ;). We started back at around 1515.

The ride back was eventful. We took a slightly different route, tempted by a free Highway(NH4), waiting to be rode on. The road looked awesome, with a hill on the left, and no vehicles in sight. But, as fate would have it, Ritesh’s rear tyre gave way. After some search we found a guy fixing tyres of vehicles on the highway. But he refused to fix our bicycle. He refused even to fill air in it, so we could reach the nearest cycle repair shop. After more search, we found who agreed to fill air in the tyre. (It needs a special valve pin. The previous guy, probably didn’t have it. But we could’ve hacked up something.)

We rushed to Kalamboli and got the tyre fixed. Then we headed back in the route that we had come on. It’d been raining on and off through out the morning. But first rain on the return only started near Nerul. It was a great relief. My cycle started moving more smoothly… I loved it. We got lost a bit near Ghatkopar. Also, the traffic was quite bad there. (Why do drivers get so bad, once it starts raining? It’s not unique to Mumbai, but quite visible here. We were back in Campus by around 2040.

Ritesh was energized after the puncture was fixed. He rode like crazy, after that. The sole of my feet started hurting — something like a cramp. I don’t know what exactly happened. Also, my groin was hurting quite a bit. My only motivation at that point was seeing Ritesh ride like crazy. He was at his best, then! I’m still wondering where he got all that energy from. It was a great ride, for both of us! Motivating each other to keep going. :)

Ritesh, where to next?

Some lessons for future

  • The Cycle needs to be as close to perfect, as it possibly can be.
  • Carry your route map along. Enquiring the route a colossal waste of time and sometimes unreliable, too.
  • A pollution mask is a must for Mumbai (or any other city.)
  • Carry enough water and food. (We drank about 7L of water between us)
  • Need to learn how to fix punctures. Need a tool kit.
  • A helmet, shorts with padding would be good.
  • An odometer would be useful too.
  • Learn to use the hand-pump or carry along a normal pump.
  • I should probably ride along with some Cycling group for the experience of it. I’ll get to learn a lot of things.

Photos

Photos will come soon, hopefully.

Tag Cloud

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: