Testing Perl Support for Google SyntaxHighlighter

January 28th, 2008

I’ve been enjoying playing with Google’s SyntaxHighlighter. Another user came up with a Perl brush file, so I thought I’d give it a shot. One note from the author of the brush file is that -> gets converted to -> rather than being translated properly. It’s definitely the highlighter that does it, too, because when you disable the brush it shows up properly.

#!/usr/bin/perl

use strict;
use Mail::Box::Manager;

#################################
# User Variables
#
# Set $password to your password (encoded):
# . only the low four bits of each character count
# . character 0x3f gets split into 0x?3 and 0x?f,
# . fill in the ?'s with anything you like
# . man ascii =)
#

my $server = 'pop.server.name';
my $username = 'username';
my $password = 'tSvx6!f>v7V%d=fU'; # the word "ChangeMe" encoded

#################################
# Get em!
#

my $mgr = Mail::Box::Manager->new;
my $pop = $mgr->open(type => 'pop3',
username => $username,
password => decodePassword($password),
server_name => $server);

my @messages = $pop->messages;

print 
"\033[00;30;1m:\033[00;36m:\033[00;36;1m: ", scalar @messages, " messages in mailbox :\033[00;36m:\033[00;30;1m:\033[m\n";

foreach my $message (@messages) {
	my $fr = $message->get('From');
	$fr =~ s/\s+< .*$//; $fr =~ s/\"//g;

	printf "\033#7\033[1m %-28.28s %-45.45s\033[0m\n", $fr, $message->get('Subject');
	my $lbls = $message->labels;
	while( my ($k, $v) = each %$lbls ) {
		print "key: $k, value: $v.\n";
	}
}

$pop->close;

#################################
# methods
#

sub decodePassword($) {
	my ($password_split) = @_;
	my $password = "";
	my ($high, $low);

	$password_split = reverse($password_split);
	while (length($password_split) > 1) {
		$high = (ord(chop($password_split)) & 0xf) < < 4;
		$low = ord(chop($password_split)) & 0xf;
		$password .= chr($high|$low);
	}

	return $password;
}

About three years ago I was living in the shell. I had a script aliased to ‘m’ that would run a perl script for each of my IMAP accounts and show me all of the unread messages. The script had been originally written by a fellow Help Desk supervisor at UB and then given colorization support by another fellow supervisor, Doug, who has since become a perl and python guru.

The trouble then was that, while this worked for my home email server, I had to change some of the socket code to work on all of the other IMAP servers I used. That wasn’t too tough since IMAP is a relatively straightforward protocol. Getting POP support to work looked to be a lot harder, however. I couldn’t find anyone that had written something similar for me to hack, so I wrote my own.

This script above uses the perl module Mail::Box which installs straight out of CPAN. It’s probably been updated since this was written, and I don’t even know if the script still works (who still uses POP??)

code

General Task Collection Triggers

January 24th, 2008

I mentioned task collection as a GTD concept in my post about the Second Quadrant of the Time Management Matrix. I find this to be an utterly invaluable experience, and even MORE valuable when done on a regular basis. The last time I read Getting Things Done, I copied his list of common task collection triggers and sliced, diced, re-worded and added to it until I came up with something that worked for me. Doing this has given me a reliable method to use when I need to stop and collect everything I need to accomplish in the next X amount of time.

This is the list of triggers that I use to make sure I don’t forget about important tasks. Please note that the list provided in David Allen’s book is FAR more complete. This is just my list:

  • Family
  • Church
  • Follow-Up Communication (look at my recent sent-items)
  • Upcoming Events (check calendar)
  • Borrowed Items
  • R&D - things to do
  • Financial
    • Bills
    • Banks
    • Investments
    • Loans
    • Taxes
  • Household
    • Upkeep
    • Decoration
    • Areas to organize/clean
      • Closets/clothes
      • Garage/storage
    • Vehicle maintenance
    • Pets
  • Computers
    • Home
    • Work
  • Health Care
  • Hobbies
  • Errands
    • Hardware store
    • Drugstore
    • Groceries

The idea behind this list is simple: stare at it. Use it to empty your head of all of the things that have come up recently to do that you didn’t collect at the time. I might, for example, have thought this week that I needed light bulbs. I forgot to capture that thought then, and I forgot about it. Oops. When I sit down on Friday mornings to review the past week and plan the next week, I look at this list and see “Household » Upkeep” or “Errands » Hardware store” and I remember that I need light bulbs and should give myself a task to stop by Home Depot for a large-ish pack of CFLs.

Seems simple? Well, yeah… it is.

lifehacks, productivity

Tips For Resume Writing From a Hiring Manager

January 22nd, 2008

I’m still in the midst of staffing frenzy at work, though things are looking better than they were. I suppose the impending recession is to the benefit of some. On average, I seriously read about 10-20 resumes per day, and about twice that on Mondays to account for the weekend. Most of these resumes are written fairly well, but there’s one mistake that seems to be consistent - 90% of them are over 5 pages long.

Yes. 5 printed pages. For a resume.

One might think this was limited to folks with 10+ years of experience. One would be dead wrong. From what jobs a person has had for the last four years since college to every internship, co-op, part-time job and paper route, each are glorified with 2-3 “action statements” or, even worse, a paragraph. My favorite example is one that contains something like this (I’m fabricating this example in its entirety):

Dog Walker (self-employed) 5/1996 - 10/1996

  • Responsible for complete care of 10-12 canines several times per week
  • Created detailed exercise plans for all clients and executed them on a regular basis
  • Delvered on-time, consistent service

Ok, first of all… you’re applying to be a software engineer. You’ve been doing something similar for about four, maybe five, years. For what reasons would you possibly want me to know that you spent a summer twelve years ago walking dogs?

WHY IS THAT IMPORTANT?

Had this been from an actual resume, I’d have serious concerns about the level of judgment of this individual. They either sincerely believe that their summer excuse to walk around in nice weather was relevant to the work they’d be doing designing and developing software, or someone else told them to put EVERYTHING they had ever done onto a resume. So perhaps it is relevant. I will allow for the obvious fact that I’m not the world’s greatest hiring manager. I have to give folks like this some benefit of the doubt, but this was a rant, and now that rant is over. </rant>

There’s a serious purpose to this post. I’ve been thinking a lot lately about what I like to see in a good resume. To me, a resume has one purpose — to get you an interview. So, you might think it goes without saying that the best way to do this is to design your resume to effectively communicate why YOU are the best candidate for a particular job… and let me tell you, sending a novel when a haiku would do is never, ever going to win you anything.

Read more…

management

Quadrant II: Making those other plans

January 21st, 2008

Important but not Urgent

I love to plan. Making lists, brainstorming, hypothesizing. I love it all. If I could design my perfect day, I wouldn’t do a single urgent thing. Rather, I’d spend the time getting done anything that I thought could become urgent in the near future. Everyone would think I was so completely on-top of my game that they’d probably hate me.

Well, just a little, anyway.

From the Time Management Matrix, the common set of Quadrant II activities include:

  • Preparations
  • Presentations
  • Value Clarification
  • Planning
  • Relationship Building
  • True Recreation
  • Empowerment

An aside: I made an argument relationship building being a Quadrant IV activity, but other than that, this is a good list with my favorite “preparations” squarely at the top.

Ideally we should spend the majority of our time here in Quadrant II, handling activities that are important but have low urgency. This is wise; it serves to keep your deliverables and responsibilities from actually becoming urgent. Once something is urgent, you’re stuck. If you want to keep your job/family/life/etc., you have to do it NOW.

Taking care of that looming task when it’s still in Quadrant II (or ideally, IV) empowers you. It puts you squarely in charge of the tasks about which you are already aware. I don’t know if this is what is meant, in the list above, by “Empowerment”, or if that’s about empowering your delegates. I’ll go ahead and presume I’m right and it’s about empowering your own ability to do things in a particular order. If I’m wrong… meh.

I spoke about a previous life previously, in which I spent a vast majority of my time in Quadrant I. One of the most helpful things I ever did in that life was to shut my door for an entire day and re-plan absolutely every facet of the next week. I took the time to stop and plan how my week would follow, giving myself about 30-40% of my time to deal with all of those urgent and important activities that were bound to attack me as the week went on. It meant all of the difference to me in the world. David Allen talks about this a bunch in Getting Things Done, though he doesn’t explicitly link it to the TMM. The closest analogue is when he discusses task collection and the process of emptying one’s head. This is an interesting enough process that I’ll write about it another time. It has, recently, led to the creation of a few sets of goals and milestones, such as:

  • A list of 101 things to accomplish in the next three years.
  • A list of achievable work-related goals for myself for the year.
  • A list of (hopefully) achievable goals for my team for the year.

The point of all of this is simple - make the time to take the time to plan at least enough to get you through the next short period of time. A proper plan (or at least a proper set of goals) gives you the flexibility to adjust your workload as you encounter the more urgent tasks along the way. This is what I meant when I started to talk about breaking down your list of projects into smaller, quickly completed, tasks. That, at the core, is what GTD is all about, for me anyway. I’ve read posts by several other users of the GTD methodology who center on an important concept - Getting Things Done is about finding the best possible framework for you to get said things done efficiently with overall lower stress. Each person is different, so any blanket approach will fail some of the time.

..as much as I want to think otherwise, blogging will always be a Quadrant IV activity. I suppose that, until someone wants to pay me to do so (who would ever want to do that??), it’s smart that it remains something I do with bits of free time.

management, productivity

NewsGator Products Now Free!

January 11th, 2008

NewsGatorNewsGator, the makers of RSS readers such as FeedDemon and NetNewsWire, have decided to go the free route for their consumer products rather than continue their subscription model. I’ve been using FeedDemon for quite some time (and NewsGator Inbox before that), so I’m very happy to seem them make this decision. I’ll ignore the fact that I paid for FeedDemon.. if it was worth it then, why wouldn’t it be now?

Since I already own this now-free software, I wouldn’t normally find it note worthy. However, I purchased a Samsung SCH-i760 a couple of months ago, so I’m intrigued to try NewsGator Go!

So many contextual links, I almost frighten myself.

I highly recommend the NewsGator service. I like it over just about any other offering out there.

software notes

Quadrant III: What happens when you’re busy making other plans

January 10th, 2008

Urgent but Not Important

Lennon said:

Life is what happens to you while you’re busy making other plans.

He could have been talking about the Time Management Matrix when he said this. I’m nearly certain that he wasn’t, but his quote is no less applicable. Life happens in and around every single plan you’ve made. It does not matter how much you plan, something else will happen at some point.

“Life” happens: The phone rings. Email arrives. A knock at the door.

Each is an urgent activity that, while bearing some small level of importance, is not important in the grand scheme of things. It must, however, be attended to NOW. This is life and we must grin and bear it.

There are a few strategies for dealing with an interrupt-driven life, but the most effective one (in my experience) boils down to being as flexible as you can with a set of tasks that are each as short as possible. If all of the things you need to do have a short duration, then each interruption doesn’t skew your ability to get work done at any given time. One trick to doing this effectively, about which I’ll blog another timE, is the philosophy of GTD, on which David Allen makes a living training folks.

The natural path for a Quadrant III activity is for it to end up in Quadrant I based solely on how its level of importance changes over time, determined by one of a few things:

  • External Force (customer, supervisor, etc.)
  • Internal Force (You decide it’s more important)
  • Circumstance

On average, I find that my customers (both internal and external) determine the importance of any given activity. For instance, if I need to create a report about the number of wompums per minute that are completed by a given wompumator, this may seem to me to be of little importance, even if it’s needed soon. I’d prioritize it thusly and move on to activities of greater importance (Quadrant I). However, if the customer needs this report to be able to complete other, more important, activities, I may find it sliding down into Quadrant I and getting completed NOW as they call and demand ask that it be completed now. This is what I call external re-prioritization. The remainder of these activities are internally prioritized - I determine that they are important enough to be completed now.

On an average day in a previous work life, I was interrupted about thirty times, each for a need that varied in importance, but was almost always urgent. I spent nearly 80% of my time working in Quadrant 3/1 (a set of activities that aren’t that important in the grand scheme, but are VERY important to someone else, so they end up being done now). That type of work moves in the direction of burnout quickly, and realizing that I was digging a shallow grave for my career was the first step to manging what time I have more effectively.

The other option is to work multiple 10+ hour days to stay ahead. Don’t do that.

management, productivity

Playing with Chyrp

January 8th, 2008

I’ve started playing around with Chyrp, a new blogging engine. The test site is here.

First impressions are positive - it seems to deliver what it advertises, though I’m not having any luck with the video posting feather. I’ll toy around some more and post any interesting findings.

blogging, software notes

Quadrant IV: The Procrastinator’s Corner

January 7th, 2008

Not Urgent, Not Important

According to The Time Management Matrix, activities that are neither urgent nor important fall into Quadrant IV, a position that I refer to as “The Procrastinator’s Corner”. These are the trivial, unimportant things that you do when you don’t want to do anything in Quadrants I through III.

This is solitaire. This is reading the news. This is, unless you get paid for it, blogging.

You know you do it. I do it. Everyone does it. We waste time… if we didn’t we’d go nuts! Filling the day with high-priority issues without any relief will lead to certain burnout. The human brain can only take so much stress before it pops, so we play minesweeper. (I don’t anymore - I’ve given up video games in 2008.)

This is ok. The TMM’s quadrants can also be lined up like a slide, from IV down to I. An uncompleted activity in Quadrant IV will eventually trickle down to either Quadrant III (if it becomes time-sensitive) or Quadrant II (if it becomes important).

Minesweeper is probably the exception and not the rule, of course. I personally handle Quadrant IV by living by a suggestion I read somewhere (probably Lifehacker):

When you procrastinate, don’t do nothing, do something else that you’ve been putting off.

This is somewhat similar to the concept of “Structured Procrastination“, though admittedly I only found out about John Perry’s essay when trying to find the site that originally gave me said advice. It’s also a good read on the concept.

One disagreement that I have with the traditional matrix is that I put Relationship Building activities (Networking, Inter-Departmental mingling) in Quadrant IV instead of Quadrant II. This is a personal choice that really comes down to a simple rationale: I already have strong relationships with most of the rest of my company (I know the names of just about every single in-office employee since a majority of them have been hired since I started).

For folks that don’t have strong inter-departmental working relationships, getting to know your co-workers should definitely be in Quadrant II! For me, getting to know newer employees might fall into Quadrant II, especially since hiring season is going to be ramping up in another month or so!

Since I’m big on lists, on a particularly slow day in early December, I “procrastinated by thinking about procrastination” - I made a list of several arguably low-effort tasks that can be accomplished when I have free spots of time or need to hop out of Quadrant I and II for a few contiguous minutes. A few examples from this list:

  • Tidying up the office
  • Processing a list of general task collection triggers (more on this another day)
  • Networking (Rocking the LinkedIn, Facebook, Email, etc.)
  • Casual, Job-Related Reading

For the most part, anyone who needs to make a list of such things probably does not have to try to make time for them since inevitably they will want to leave Quadrants I and II often enough that these things will get done anyway.

Personally however, I find that having a list of things I could do if I need a break is very helpful. It keeps me from actually playing minesweeper.

management, productivity

PHP 5 now out of beta at Nearly Free Speech

January 4th, 2008

My web host, which has a really interesting hosting model, has been beta-testing PHP5 for some time now. I don’t have as much time to play with it as I’d like, so I opted to stay out of the beta for now.

However, testing is complete, and PHP 5 (v5.2) support is now out of beta and is the default for all new sites. I just set up a new site not knowing this and everything in my PHP app is functioning as I’d expect. Groovy!

They’re also offering a CGI-based version which runs with safe_mode and open_basedir turned OFF, which is huge for some apps like Gallery, which used to be my web-based photo app of choice.

So, I’ll just flip the switch and see what happens. Why not, right?

uncategorized

Hanging Folder Binder Clip Hack

January 3rd, 2008

I ran across this simple binder clip hack over at LifeHacker, submitted by one of their readers. I’m humbled by the simplicity and have duplicated these efforts. This is also quite useful for keeping the spare folders sequestered in the back of a cabinet.

Hanging Folder Hack

lifehacks