Recently in language Category

December 21, 2011

Block commenting with PyDev for Eclipse

Python doesn't have special syntax for block comments, but if your IDE supports it, there may be a shortcut command to achieve roughly the same.

I'm using PyDev for Eclipse on a Mac, and the shortcut happens to be command+/ (command, forward slash.) Just select the block of code that you want to comment out, and use the shortcut key. A "#" will be inserted in front of each line that you highlighted.

With exactly the same lines selected, you can hit the shortcut key again to toggle the comments off. If you happen to select an extra line that was not commented out before, using the comment shortcut will add an additional "#" in front of each line.

The keyboard shortcut is easier to remember when you're using a language that uses slashes in the commenting syntax.

On a PC it's control+/

In a language that has special syntax for multi-line comments, you can use command+shift+/ (on a Mac) or control+shift+/ (on a PC.)

September 19, 2006

Talk like a Pirate Day

June 26, 2004

schadenfreude

I learned a new word today.

schadenfreude (sha-den-froy-duh) noun: enjoyment obtained from the troubles of others.

From Merriam-Webster Online