Recently in technology 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.)

December 6, 2011

Where is Django Installed?

I was running through part 2 of the Django tutorial when I had to copy some files the Django source code directory. I'm on a Mac (Snow Leopard) and it happens to be at:

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django

May 24, 2011

Forcing users to upgrade their browsers

I have a confession to make. I am a terrible, insensitive web developer.

I was working on a brand new, snazzy HTML 5 design for my personal web site, but could not get it to look half decent in Internet Explorer 6 (a 10 year old browser at the time of this writing) and Internet Explorer 7 (a 5 year old browser) without bogging down my web page with hacks and work arounds.

After wrestling with the markup and CSS for weeks, I finally threw in the towel and decided that people using IE6 and IE7 do not deserve to see my new web site.

I added the following configurations to Apache in httpd.conf (.htaccess works too)

RewriteEngine On

RewriteCond %{REQUEST_URI} !upgrade*
RewriteCond %{HTTP_USER_AGENT} "MSIE 6"
RewriteRule . upgrade.php [L]

RewriteCond %{REQUEST_URI} !upgrade*
RewriteCond %{HTTP_USER_AGENT} "MSIE 7"
RewriteRule . upgradeagain.php [L]

Which serves up the following 2 pages depending on the browser being used by the visitor.

Internet Explorer 6 users are treated to Tandy Kitteh:

upgrade.jpg

While Internet Explorer 7 users are treated to baby IE7 Kitteh:

upgradeagain.jpg

March 8, 2011

Now your friends can fill out your facebook profile for you

I was tagged as a "coworker" on Facebook today.

tagging.gif

I keep a spartan profile with only my name and profile photo displayed, so I was outraged to find that by tagging me as a coworker, my employment information was added to my profile. By someone else, against my will no less. I could only remove the tag after the fact, and even then, it only removed the information from my own profile, and not my coworker's. Severing ties with that coworker (unfriending) didn't help either.

I also tried to find a way to prevent myself from being tagged in this fashion. Users have the option to prevent tagged photos of themselves from being shown. Users also have the option to prevent others from checking you into places. However, there is no option to prevent others from tagging you as a coworker and adding that information to your own profile as well.

This sucks.

February 9, 2011

Yikes!

It's 2011 and I'm embarrassed to say that this web site still has a table layout.

If you don't believe me, you can see it for yourself... but act fast because it's going to be replaced with something a little more modern soon™.

For your amusement while I whip up a snazzy new design for this web site, here is a collection of web sites that I have designed in the past. Click on the screenshot below for hilarity to ensue:

pink_site