yes.

16th
Oct. × ’09

Posted in Uncategorized | 1 Comment

Life Improvement, Step One.

12th
Jun. × ’09

While flipping through Twitter earlier, I read a tweet from @tara mentioning the Four Hour Work Week, by David Allen.  It’s a book I’ve been hearing about a bit recently, so I thought I’d go see if Amazon had it for my Kindle.  Sure enough, they did, and I picked up a copy.  While I was there, they suggested I might like Getting Things Done, also by David Allen.  Another book I’ve been hearing a lot about and actually meaning to read.  So far I have only purchased the 2 books, I haven’t started reading them just yet..  I’m curretly in the middle of another book and want to finish that one before moving on, but they’re definitely next up on my reading list.  However, I did some searching around and decided to start getting some things organized in preparation for my GTD planning.

Getting started with GTD

The first thing I did was grab myself a copy of OmniFocus.  From what I’ve read, this is basically the best application around for GTD.  I like it so far, I watched the intro screencast and it seems like it has some really awesome features and workflows for getting organized and getting things done.  I started with the basic brain dump and will quite likely be adding lots and lots of tasks in to it over the coming weeks.

Unfortunately, with the app, I’ve already run into my problem of over-engineering every little thing, to the point where I don’t even finish because I’ve designed the task to be far far far to

Laptop Organization

One of the tasks I added to OmniFocus was to organize my laptop.  Right now, I basically have 3 folders: Applications, Documents, and Downloads.  I really don’t have any organization in those whatsoever.  I also have Time Machine nagging me like crazy saying it hasn’t backed up my machine in 8 months or something crazy.

Documents, Applications, and Downloads

The first part of organizing my laptop was to create a “Expires on 2009-08-31″ folder inside my Applications folder.  I then went through and moved any apps I hadn’t been using into there, and if I don’t use them by 2009-08-31, they’re getting deleted.  That helped clean up my Applications folder quite a bit.

EMail

I also switched back to Mail.app from Thunderbird.  I’ve never really liked either, but OmniFocus has some nice integration with Mail.app, iCal, and such, so I kinda want to get back to some more integration.  Due to the massive amount of email I have for work and for my personal account, organizing my email is going to be a major task, so that will come later.  Hopefully I can put aside my personal preference issues with Mail.app and grow to like it more.  Anything’s better than Thunderbird, right? :\  Personally, KMail is my favorite mail client, but running on OSX I lose out on that.  I might look into mutt again, and just set up an account specifically for OmniFocus stuff, but we’ll see.  Mutt is a pretty steep learning curve if you’re picky, and also I’ve had issues with it in the past with very very large mail directories (of which I have many), but for now, Mail.app is my master.

Browser

Along with Thunderbird, I’ve been a long time Firefox user.  When I started at DreamHost I started making very extensive use of the keyword search functionality built into Firefox’s bookmark system.  I simply cannot live without this functionality.  There are some ‘hacks’ for Safari which provide similar functionality, but they are severely lacking, both in features, multiple-machine synchronization, ease of use, and, in the case of Keywurl, lack of support for Safari 4 (which is really really trying hard to get me back to using Safari).  In order to replicate that functionality, I’m thinking of looking into some sort of plugin for QuickSilver (something of which I really don’t take enough advantage) to emulate that functionality.  I’ve looked in the past, but what I thought would be stupid simple wasn’t, I got discouraged, gave up, and went back to Firefox.  Another option I’ll likely pursue is just a simple web page with a form which does it all for me.  I’ll quite likely use this approach, as then I don’t have to worry about synchronization, and I can also make it available to other folks at DreamHost to help them get around our back-end management application more easily.  This is still not quite optimal, as it’s a copule of extra steps instead of just hitting cmd-l and typing in the quick search, but it’s way way way better than what one currently has to do if they don’t have keyword searches set up!

Goals

One of my goals is to start blogging more.  I’m not a great writer, and most people probably couldn’t care less about the things I’m likely to write about, but it’s good practice, and if nothing else it’s documentation of my life, something of which I have depressingly little.

Another of my goals is to be more productive at work.  I’ve kinda been in a rut for a while as far as actually getting things accomplished around the office.  I take care of my normal everyday duties such as server maintenance, helping tech support, etc, but I don’t feel like I’m getting much done in the way of actual progress.  I always feel like I’ve checked my email 10000 times, checked on random things 10000 times, and am constantly task-switching, which, unlike a computer, humans do very poorly.

Additionally, I want to get healthier, exercise more (I have a pretty decent road bike now!), eat better (I’ve been watching lots of Good Eats!), and manage my money better (saving up for a down payment on a house by forcefully stealing money from your checking account helps get rid of that obnoxious toy-buying habit).  And of course, QUIT SMOKING.  Ugh.  It’ll happen.  I just have to Get It Done :)

And finally, I want to be happier!  As part of the non-productivity at work, I’ve started to get a little on the depressed side which, knowing from past experience, ends up making me less productive, which ends up making me more depressed, and on and on in an uncontrollable downward spiral.  Getting my head back in the game, kicking ass at work, taking control of my life, and getting out of the house more often should certainly help with that.

Posted in Uncategorized | Tagged , | Leave a comment

HTML Entities and form handling.. fun times!

2nd
Dec. × ’08

Lately, I’ve been getting more and more into Unicode and localization stuffs, so when I saw a bug come in at work regarding Hebrew text in our web panel, I jumped at the opportunity to take a stab at the issue.

Unfortunately, the deeper I investigate the issue, the more I realize it will require a lot of sweeping changes to our web panel codebase and practices in order to handle properly.  Or, I could just make things happen at a lower level and things will be happy.

The main problem I’m coming across is the inconsistency of how Unicode characters and HTML special characters are encoded when being sent along as form data.  Take the ampersand character (&) for example.  When sent in a form, by itself, it always is sent across literally as the ampersand character.  Less than and greater than characters are the same, they come across literally.  The problem arises when you start sending non-ascii characters.  The following text, which has been copy/pasted from here is sent across as the HTML entities which represent the Unicode codes:

היישוב היהודי בחברון הוכרז שטח צבאי סגור

(היישוב, etc)

This is all fine and dandy.  The way we normally have been doing things is taking whatever comes in and taking it verbatim.  We sanitize on the display end of things in most cases, with HTML::Entities and converting &, <, and > characters to their HTML entity counterparts.  However, you’ll notice that there are & characters in the text being sent to us, so now the browser is encoding it, and we’re encoding it again!  So it displays improperly for users (displaying the literal &#1234; instead of the character they expected) as well as being stored in our database incorrectly (for non-HTML usage, like when sending automated emails and such).  However, if we simply decode the *entire* string, then we accidentally decode literal &amp; and &lt; etc. that people put in as form input, and when we encode it later, it doesn’t come back properly.  In either situation, all or nothing, we munge information.  At least when we do *no* decoding, we don’t *lose* information, but it’s not correct, either.

The solution I’ve come up with here is to simply only HTML entities decode Unicode entities (&#1234;, etc) and leave all of the other entities alone.  This is something I can easily wedge into our lower level POST/GET processing and make transparent to the developer, but I’m unsure if it’s the correct approach, or if it will even work.  I’m definitely going to need to play around with it some more before I make anything live, but I’ll be talking about my experiences with it all right here, on this very blog, for the world to see.  Unfortunately, there don’t seem to be any pre-made perl libraries to do this for me.  HTML::Entities looks promising, but its decode method doesn’t seem to be able to take exceptions.  I’ll probably end up stealing a bunch of code from it and piecing it together.

As a quick side note: WordPress (at least as of the version I’m running, which is 2.7-rc1) handles this all excellently.  Not entirely sure if it’s just because of the ‘visual’ editor, or if it handles it properly on the server side, or what, but I’ll definitely be looking more into this as well.

Posted in Uncategorized | Leave a comment

Deep Polymorphism in Perl

23rd
Sep. × ’08

While writing some code for work and exploring our class layout, I’ve already implemented some polymorphism.  For instance, if you pull up an object for a service, it goes ahead and gives you the appropriate class for that service.  All you have to do is instantiate the service object, you don’t need to care about the class.  This is very elementary stuff, and works very well.

However, I’d like to take that a step further and go ahead and do multiple levels of polymorphism.  We also currently have polymorphism on our DomainService objects, which define types of services provided with a domain (mail, dns, http, https, jabber, etc).  As you may have just noticed, there’s already a place for some deeper polymorphism there, as the http and https domain service types will generally share quite a lot of code.  We’re currently using a method similar to this article on perlmonks to achieve our one-level of polymorphism, but I’m not so sure I want to have to hack up the base class every time I want to add another level of polymorphism (not saying that it will happen often, but it shouldn’t be necessary).

I’m currently investigating options, but if anyone has done this, I would love to see some examples!  And of course, I will share examples if I figure it out on my own :D

Update: Well, I feel a bit silly for making this post when the solution was so easy.  The problem was more that I was thinking about the wrong approach.

Currently we have some classes like this:

  • DomainService
  • DomainService::Http
  • DomainService::Https
  • DomainService::Dns

We instantiate DomainService and it polymorphs into the lower types.  Currently everything is up in the Domain object and the polymorph modules are empty stubs, but with refactoring this will change.  However, I didn’t want to duplicate code between the Http and Https types, considering they’re almost entirely identical, so I was thinking of having DomainService polymorph into DomainService::Http which would polymorph into DomainService::Http::Http and DomainService::Http::Https.  However, I came to my senses and realized that’s not the correct approach.  The correct approach is to do something like this:

  • DomainService
  • DomainService::HttpBase
  • DomainService::Http
  • DomainService::Https

Where DomainService::Http and DomainService::Https are subclasses of DomainService::HttpBase which is itself a subclass of DomainService.  So, Domain polymorphs into DomainService::Http and magically inherits the DomainService::HttpBase class.  Duh.

Leaving this here for posterity if nothing else :)

Posted in perl | Tagged , , , | 2 Comments

24 hours with my new MacBook

19th
Jan. × ’08

As some of you may know already from my tweets, I recently acquired a shiny new MacBook.  My goal with this was to become as accustomed to the various Apple software pre-installed on the machine as possible.  This meant ditching iTerm, Firefox, Thunderbird, and Adium, which comprise about 90% of what I spend time using on my iMac at work on a daily basis (Camino doesn’t count, as I only use that for Pandora, so I can crash Firefox without interrupting my music!)
Anywho, so far things have been going quite well.  I haven’t yet torn my hair out, and I haven’t yet installed any of the 5 aforementioned software packages (although I will install Firefox at some point, for sure, simply because I do web development, so I kinda have to :)  Today I even braved using it for work all day.  The only thing I didn’t have is email, and that’s fine I didn’t really want to read any email today anyways, plus I have a feeling I’m still going to hate Mail.app.
Here’s a bit of a rundown of my first full day with my MacBook.

Safari

I’m liking Safari well enough, even finding some things to equal some of the features I love (and miss) from Firefox and the various extensions.  Its speed is very nice, the sites I frequent work and render just fine, and everything seems to be ok.  Occasionally I’ll accidentally close a tab and dearly miss the Undo Close Tab function from Firefox, but on the whole it’s been pretty successful.

Terminal.app 

Terminal.app was one of the big ones for me.  I didn’t think I could go more than a few hours without switching back to iTerm.  I had tried it since Leopard release (pre-leopard it was simply unusable for any sort of real work, lacking tabs and all) but didn’t like it then.  The time I’ve spent on my computer these past 24 hours, I’d say roughly 50-60% of it was spent in Terminal.app.  For the most part, it has been a fantastic experience.  I immediately switched to the pre-made ‘Pro’ theme, set the default window size to something a little more appropriate, and increased the opacity somewhat so I could see what I was trying to read :)  The more I used it, the more I grew accustomed to its strange keybinding for switching tabs (cmd-shift-{ and cmd-shift-}) and the more I got used to cmd-` for switching between windows.  After discovering that each window has a unique number assigned to it, accessible via cmd-(number), I started using it, and I must say, it is a MUCH better way to switch between windows than the counter-intuitive sequential-only switching that cmd-` provides.
One thing I’ve always had issues with on terminals is backspace, delete, page up, page down, and  arrow keys (in certain situations).  Even iTerm had some of those issues.  Now, before you scream at me “fix your termcap!” or “fix your terminfo” or whatever you want to tell me saying that it’s probably not iTerm’s fault (or any other terminal, for that matter), I would just like to say that I honestly don’t have the time, nor do I care enough to spend time learning the ins-and-outs of terminal emulation and how to tweak them on various systems.  I want a terminal that Just Works.  And Terminal.app has done very well with that.  One issue I did have was when I was inside a screen session on my Debian Etch box, backspace didn’t work.  On another Debian Etch box, backspace inside the screen worked.  Fortunately, changing the terminal type in Terminal.app from xterm-color to simply xterm fixed everything right up, and so far I have had 0 problems with backspace, page up, page down, arrow keys, nothing.  It has all Just Worked, exactly as I want it, and exactly as I expect.  I did have to swap the keybindings around between shift-page-up/down and page-up/down because I prefer that my page-up/down goes to the application I’m working with in the terminal, and that I use the shift modifier key if I want to do it in the terminal itself.  I did the same with the home/end keys as well.  I am not faulting the Terminal.app developers in any way because I had to do this.  The default settings are consistent with The Way Macs Work, and I like that, and I’m happy that they give me the option to change it :)
The only real thing I have against Terminal.app right now is that the tab titles are always set to the current command you’re running.  Since I’m almost always roaming around on various servers on our network, fixing things, or logged into our development server working on some code changes, the tab title most frequently seen is ’ssh’ which, when you have 10+ tabs open is pretty much worthless.  I’m just hoping that Apple remedies this in a future update (read: pre-10.6).
One other thing I’d like to see is a keyboard action to scroll up in the buffer a line (or a few) at a time (rather than a full page) so I can bind that to shift-up and shift-down.  Most of the time I use the ‘less’ pager to do this inside the shell itself, but that isn’t always convenient, and sometimes I get a lot of unexpected output, that I all of a sudden would like to scroll through. 
Otherwise, Terminal.app has worked nearly flawlessly for me.  A couple of minor changes, and voila, it’s a great application.  Kudos to Apple for making an excellent next step from Tiger’s Terminal.app. 

Mail.app

Honestly, because of past negative experiences with Mail.app, I didn’t really even try to use it all that much.  I simply went without email (which was good, as I got a lot more work done!).  However, nearing the end of the day I decided I needed to sign up for a mailing list for a software package I was working with, and decided I should finally set up my email within Mail.app.  I set up my personal email account in Mail.app and started playing around with it.  I still really hate how Mail.app handles threads.  I despise it with a passion.  I didn’t work with threads all that much on my personal account tonight, simply because I haven’t really been active on external mailing lists lately and just decided to purge my mailing list directories, but what little I did experiment with, I found the same old problems.

Threading by subject is bad

I get a lot of email with the same subject.  We have monitoring systems which send emails periodically and often have the same subjects.  Sometimes I’ll get an email which just happens to have the same subject as something I got MONTHS ago.  Sometimes subject lines change mid-thread.  Instead of doing all this subject parsing which incorrectly groups some messages, and incorrectly fails to group others, why not use the message headers already included in the email by almost every email client on the Internet: Message-Id, In-Reply-To, and References.  Those 3 headers are there for the purpose of relating threaded messages to each other.  Think about it, an email thread is a one to many situation.  Message-Id headers are designed to be unique, so there’s your primary key.  Then you have the In-Reply-To header, which basically says “This message is a direct reply to this other message.”  Assuming you have the message with that message-id header, you can associate the two easily.  The references header provides some additional glue, in case a message gets lost, accidentally deleted, intentionally deleted, or plonked, so you can still have a rough relationship between parent and child posts.  Can we at least make the subject-based grouping optional, like in Thunderbird? (yes, you have to go into the config editor and change something manually.  I’m ok with that, just give me the damn option!)

Threads are not flat 

Yes, with the current generation of computer users using forums constantly and using their gmail accounts, the beautiful simplicity of the treed thread seems to have been lost on the Mail.app developers.  And to be fair to gmail, this threading issue predates gmail by some time.
Threads are not flat.  If I’m in a long and heated discussion on a mailing list, I want to see the replies in context.  I don’t want to see someone’s reply to the third message in the thread show up at the bottom of a flat line of messages.  I want to see it right next to the third message in the thread.  Especially with people mis-quoting (which has always been a problem, and more-so since Outlook graced us with its presence), understanding what exactly someone is referring to in such a situation can be quite troubling.  However, to be fair, it appears that the fine art of ‘proper’ threading has been lost on the internet nowadays.  Very few forums actually have proper threading: Slashdot, The DreamHost Discussion Forums, anything using SlashCode or wwwthreads, and a handful of blogs with custom comment threading plugins, or completely hand-written ones.  Everything else has taken the route of the flat thread, which to me is a shame, since it makes it a lot harder to read, in my opinion.

Unified Inbox

I really, really don’t like the unified inbox they’ve added.  When I’m at work I try to avoid looking at my personal email as much as possible (especially with how much spam I get lately).  When I’m at home, I definitely don’t want to see my work inbox.  I may be a rare breed who uses his laptop for work AND for personal use, but I think there are others out there with me.
These things pretty much make Mail.app unusable for me, which is unfortunate, because Mail.app provides excellent integration with tons of other features in the OS, as well as having a great look, and very ‘native’ feel to it.  I just wish they would make it more than a more secure Outlook Express and give it something for us email power users to enjoy. 

iChat

What can I say?  It works.  It looks very much like Adium (or rather, Adium looks very much like it) and works quite similar as well.  One thing I wish it had was a real quick and easy way to switch between conversations in the conjoined chat window (it might actually have this and I just haven’t found it, I’m unsure), but otherwise it works well enough for me.  My boss told me some other issues with it, but I haven’t experimented long enough to be able to have an opinion.  Honestly, I really like Adium, and it has a *very* native look and feel, and has a lot of great features.  I will probably switch back to Adium at some point and call it good.  iChat is neat and neither application really “wows” me, so I’ll go with the one I’m most used to and most comfortable with, which is Adium.

Posted in macbook | 1 Comment

Global Warming or not, we still have a pollution problem

23rd
May. × ’07

I don’t know about you, but I’m personally sick and tired of hearing the bickering about global warming. Some say it’s a sham, a fraud, we aren’t causing global warming it’s a natural cycle, and others are saying we need to reduce our CO2 outputs to prevent heading into a new ice age.

People who are against global warming often say “oh but look at the record snowfalls and low temperatures in wherever“. People who are for global warming always talk about how mild winters have been as of late in areas like the midwest, how hot the summers have been, etc. Personally, I think we should come to a compromise. Global warming or not, we still have a pollution problem. Anyone who, like myself, has lived in a small midwest town for most of his life and recently moved to the city, realizes that pollution is a serious problem.

I moved to the LA area about 2 years ago, and let me just say, all the cartoons with the giant cloud just as you pass into the LA city limits aren’t exaggerating that much. The skies of LA are constantly brownish gray, and hazy. Occasionally you’ll get a nice clear day, but rarely can you look toward the mountains and not see the brown cloudy haze in the sky. I also lived in Chicago for a year, and while it wasn’t nearly as bad as Los Angeles, and harder to tell since you didn’t have the nice backdrop of the mountains for the cloud to stand out against, it’s still quite bad. Then there are the satellite images of China showing actual movement of smog clouds from eastern China over Japan and out to the Pacific Ocean. I don’t know about you, but I’m not a huge fan of smog.

Politicians need to get their heads out of their asses and quit bickering over pointless crap, and start making PROGRESS toward something. Encourage people to drive hybrid cars, fund exploration for renewable energy, penalize people who buy gigantic megaSUVs like Ford Excursions, Cadillac Escalades and Hummers. Don’t just sit around debating the merits of global warming. DO SOMETHING.

Posted in politics | 5 Comments

Password length and character restrictions?

4th
May. × ’07

Ok, this is something that has troubled me for some time now, but what is it with all of the password length and character restrictions for various services on the internet? Don’t get me wrong, I whole-heartedly agree with having lower bounds on password strength (must be greater than 6 characters, must contain a non-alphabetic character, etc) … but what’s wrong with having a password that’s 128 characters? Or contains non-alphanumeric (or, perhaps, even non-printable) characters? If you use md5 to ‘encrypt’ the password before storing it, it all comes out to the same length anyways (32 characters, unless you’re doing salted hashes, but either way…), so what’s the point? Perhaps sites that don’t allow long passwords, or certain characters for passwords AREN’T encrypting them.

The main reason I ask this, is because I use a tool called KeePass to keep track of my passwords for me. I generally have it create 16 character passwords with as many different kinds of characters as the site will allow, for increased security. A lot of sites I’ve come across lately don’t even allow non-alphanumeric characters (other than maybe hyphen (-) or underscore (_)), and to me that just seems silly.

Perhaps they feel if they restrict people to using simpler passwords they’ll have less tendency to forget it, or write it down. In my opinion, they should be encouraging people to use strong passwords, not discouraging them.

Oh well!

Posted in encryption, security | Leave a comment

DreamHost!

12th
Dec. × ’06

Howdy folks! I was just hired at DreamHost so I’m moving my stuff over here bit by bit :) I figured since foilhat.org was probably my *least* used domain that actually had anything on it, I would move it first.

I must say, I’m pretty impressed so far with everything I’ve seen. Setting up my domain was simple. Adding WordPress was as easy as going into my panel and clicking a few buttons. I’m really looking forward to working with these guys!

Thank you, DreamHost, for the job, and for the hosting, and I look forward to doing great work with you guys :)

Posted in dreamhost, work | 3 Comments