Belated Goals for 2009

I found it helpful last year to enumerate some goals and check back in with them from time to time throughout the year.  So this year I’m trying it again.  I actually started this list in January but am only just now getting around to posting it.

  • Finish my home page update.  Check.
  • Finish setting up the new home server.
  • Finish Microsoft MCTS certification.  I’ve already taken the 70-536 exam, I just need to finish studying and take the 70-528 exam.  I’m also required to get some certifications for work this year.
  • Learn more about Silverlight and WPF.  This is something I want to get at least a rudimentary knowledge of, but I don’t want to sacrifice everything else for it.
  • Learn more about Flash.  My goal is to create a flash “thing” for my home page.  Not really sure what the “thing” will be yet.  I need to look at some other flash things on other sites to get some ideas.  A first step in this process would be to find some software for actually creating flash things.
  • Use more jQuery in web projects.
  • Do something with my hostgator web host or cancel it.  Maybe convert it to an ASP.NET host so I can try out some Microsoft stuff there.  UPDATE:  Oops, hostgator doesn’t have Windows hosting.
  • Move some more of my projects to Google Code.
  • Give Ubuntu or some other Linux variant a serious trial.
  • Write some music.  I haven’t done much of anything musical since about 2001, and I think it’s about time to change that.  I need to organize the studio and make it as easy as possible to just sit down and start creating something.
  • Try creating a regular podcast.  I don’t really have a good topic, though.  I’m thinking it should be something with a local flavor, though.  Maybe something instructional.
  • I also have this crazy idea to do some short cell animations.

My URL Shortening Service

As part of my continuing effort to take over the world, I’ve created my own personal url-shortening service: http://uvurl.net.

Just for the record, mine is NOT implemented as Jeff Atwood describes in URL Shortening: Hashes In Practice.  It’s actually much easier than creating an “aggressive hash.”  Each URL is assigned a sequential numeric identifier, which is converted into base-36 with one PHP function.  (Why PHP has a function for converting number bases is beyond me, but there it was.)  Voila.

This Week In Tech Snobbery

I’ve been listening to a lot of tech podcasts lately, and I find it fascinating to hear that there is just as much of a “bubble” in Silicon Valley as there is inside the Beltway.

This Week in Tech with Leo Laporte is a prime example.  His guests usually sound like a bunch of college frat kids yucking it up about who’s buying what companies or who’s selling what web sites or who’s got the most followers on Twitter.  They’re all looking for publicity for whatever venture they happen to be working on at the time.  I think the whole “technology field,” to these guys, is simply the process of building a hugely popular web site and subsequently selling it to someone else before it comes crashing down in flames.  They really don’t seem to care about what the site actually does – they just want to know how it leverages the “social graph” or how they can “monetize” it.

I guess I’m an old fashioned Virginia hick… I still look at a software project in terms of how it can actually benefit a user.  As opposed to taking any old useless crap project and making up a slick sales pitch to deceive people into thinking it can benefit them, which seems more like the Silicon Valley way.

UPDATE: Later in the very same episode of TWiT I referenced above, ABC’s Dan Patterson courageously rose above the din and said the exact same thing:

“I wonder if we don’t live in our own little bubble … I’m also a little concerned that, to middle America, we may look like a bunch of dilettantes running around with our gadgets and toys.” -Dan Patterson, TWiT Episode 187, “So Say We All”

A valid point, Dan.

No Agenda Podcast

My new favorite political show is the No Agenda Podcast.  It’s sort of a subversive, anti-government, rambling talk show with Adam Curry (the former MTV VJ) and John C. Dvorak (the technology columnist).

I find it incredibly refreshing to hear people approaching current events from a different perspective.  But if you’re a Republican or Democrat, chances are you won’t like it.  They are more ideologically along the lines of the Ron Paul Libertarian fringe (Curry tends to believe everything is some sort of world government conspiracy).  Also, it’s a podcast, so, you know, it’s not very polished.

But it’s great fun to listen to on the drive to and from work.  It easily beats talk radio, the mainstream news and pundit shows, which I personally think spew repetitive streams of homogenous inanity into the gullible minds of the uninformed.

uvBlog 2.0 Code Released

I posted uvBlog 2.0 (the PHP code that runs thomaskrehbiel.com) on Google Code under the GPL3 license.  That basically means you can use it as long as you release the source code, too.

You can browse the source code at:

http://code.google.com/p/uvblog2/source/browse/trunk/uvblog2

I don’t think anyone but me can commit changes there, but if anyone else actually wants to be able to do that I’d be happy to set them up, and I’d appreciate any contributions anyone wants to make.  There is certainly no shortage of improvements that could be made.

P.S. I’m not sure I want to keep it on Google Code – I’ve been getting a massive Big Brother vibe from them lately so I might move it to some other hosted repository, if I can find one.

Eclipse and PDT for PHP Development

I started looking for a PHP IDE again to replace the venerable TextPad.  Last year I looked at NuSphere’s PhpEd, which was actually not bad but I couldn’t bring myself to spend $100+ on it just to get a little Intellisense.  Now I’m looking at Eclipse with PHP Development Tools (PDT), which is free and open source.

CORRECTION:  I’m told that Eclipse is open source but it’s somewhat commercially developed.  It’s all described on Eclipse’s About Page.

The version I’m looking at is Eclipse 3.4.2 and PDT 2.0.0.  And note that I don’t know where Eclipse ends and PDT begins, or vice versa.  Throughout this post I refer to Eclipse or PDT, but I might actually be talking about PDT or Eclipse, respectively.  I gather that Eclipse is the “engine,” which I presume includes a basic text editor, and PDT is the set of extensions that provide PHP-specific functionality.

So far it’s not bad.  Eclipse does run fairly well for a Java app, which is in contrast to most Java apps I’ve seen.  (The only other Java app I’ve seen that really impressed me was Azareus (now Vuze) which used to have a very impressive-looking interface… now it’s rather bloated, but that’s a different topic.)

I can definitely say that it beats TextPad as far as PHP development functionality is concerned.

I realize I probably shouldn’t do this, since they are aimed at two totally different developer audiences (Microsoft developers vs. everyone else), but it’s hard not to compare Eclipse with Visual Studio, which I still consider to be the IDE to beat.  (For me, at least:  I’ve been using Visual Studio since around version 5.)  VS gets bigger and slower with each new version, but it still has a pretty impressive set of features.

(Side note:  The only other IDE I’ve used with any regularity is Xinox Software’s JCreator, which I thought several years ago was a decent Java IDE, and worth the nominal fee I paid for it.  Other than that, I’ve used mainly TextPad for PHP development and Visual Studio for everything else.)

I’ll start with some pros before I get into the cons.

I love that you don’t have to install Eclipse.  You just unzip it into a directory and run it, just like that.  (Not counting Java runtime installation.)  Life as a Windows user would be so much better if more applications worked like that.  (That is still one of the biggest things I miss about the Amiga to this day.)  Visual Studio, on the other hand, takes several man-years to install, patch, and get running.

Eclipse’s Open Resource feature, or CTRL+SHIFT+R (which Red pointed out to me), is pretty awesome.  I am constantly struggling to remember where files are in the project hierarchy, and I almost always have to fumble around in the Solution Explorer (aka. PHP Explorer in Eclipse) to find things.  When projects get really big, that becomes a surprisingly large impediment in my workflow.  So the idea of being able to open any file by typing the first couple of letters of the filename is pretty cool.  (UPDATE:  I went searching and found a Visual Studio add-in that has similar functionality:  Koda.)

image

I like that Eclipse reads “TODO” comments and puts them into a task list for you.  That’s a feature I use a lot in Visual Studio, so I’m glad to have it in PHP development.

UPDATE:  It occurred to me that the ability to see syntax errors in the editor is a major plus for PHP development.  With plain old TextPad, you have to load the page before you can see syntax errors, which is rather time-consuming.

image

The terminology in Eclipse is very different from Visual Studio.  You’ll have to learn what workspaces and resources and views and perspectives are.  It’s not difficult, but some of it doesn’t feel very intuitive.  To me, there’s not much difference between the words “view” and “perspective,” yet in Eclipse, they are entirely different things.  (Also, a “view” in Eclipse actually seems a lot like a “window” to me, and a “resource” looks suspiciously like a “file.”)

Initially it’s somewhat frustrating to work in Eclipse after using Visual Studio for so long, because of the operation of Auto-complete (aka. Intellisense).  In Visual Studio, I’ve become entirely accustomed to pressing TAB to make selections from the dropdowns, but in Eclipse, you have to press ENTER.  (Come to think of it, I think JCreator also used ENTER.)  Maybe I just need to stop using TAB in VS – it turns out that ENTER also works (along with a slew of other keys).  Unfortunately, because of the physical location of the keys, pressing TAB with the left pinky after using the arrow keys with the right hand feels much more efficient and comfortable to me than stretching a finger to press ENTER after using the arrow keys both with the right hand.

The Eclipse editor seems fine, but there are subtle differences from Visual Studio that cause me to do some extra backspacing sometimes.  Minor things in the areas of auto-indentation and tabbing.  A lot of times I press enter at the end of a line and the cursor moves over someplace I wasn’t expecting.  Nothing that I couldn’t get used to, though.

Except for one thing that I found kind of weird:  For PHP, I use tabs set to 2 spaces.  When I hit tab in Eclipse, it always seems to move the cursor over exactly 2 spaces, even if you’re on an odd column, so sometimes I find that my code is one column off.  There may be settings to change that behavior, but I haven’t found them yet.  (The number of settings in Eclipse is even more bewildering than those of Visual Studio, if you can believe that.)

The Eclipse editor also has a puzzling habit of highlighting things for no apparent reason (see screenshot below).  If I click on, say, the $plugin variable, it highlights all the other instances of $plugin in the code, too.  Sometimes in a different color.  I’m sure there’s a reason for it, but I can’t make heads or tails of it.  It’s sort of distracting, actually.  Maybe it would make more sense if I could right-click on one of those highlighted variables and find some kind of clue about what to do in the context menu.  (UPDATE:  Oh, it’s called “Mark Occurrences” and all it seems to do is highlight occurrences of whatever you select.  Thankfully you can turn it off from the toolbar.)

image

I don’t understand Eclipse’s search feature at all.  I can’t seem to get it to perform the simple task of finding a string in the file I’m editing.  Like, say, a variable name.  It always seems to want to search every file on disk or something.

image

It looks like the Find/Replace window is actually what I want… except I didn’t want to replace anything.  I guess the two operations are built into the same window, which makes perfect sense from a programming perspective but seems odd from a usage perspective.  (Find and Find/Replace have been two distinct tasks since the dawn of computing, as far as I know.)  So I suppose I’ll need to bind CTRL+F and CTRL+H to the same function.

image

All of the above leads to my biggest gripe with Eclipse:  It’s lacking quite a bit in the area of polish, especially in the menu structure.  I don’t want to get off on a commercial vs. open source rant here, but Eclipse demonstrates something I see a lot in “mature” open source projects (especially ones coming from Linux):  A sort of entropy sets in when, during development, a bunch of different people add different things to the menus in what looks like completely random order, and several years later you end up with 50 different menus with 50 different sub-menus and no real organization or structure.  I bet most of the menus probably aren’t even useful except in obscure cases.  It might make perfect sense to anyone whose been using Eclipse all along, but to a brand new user it seems pretty mysterious and, well, kind of unprofessional.

For example, when I highlight a method in the editor and right-click for a context menu (see picture below), why on earth do I see things like Run As and Preferences?  What does that have to do with the text I just highlighted?  To me that’s a sign of a rush job, programmer laziness, poor attention to detail and/or lack of project management.  (All of which are typical of community-driven projects.)

Eclipse Context Menu

And here’s something else on the same context menu that makes one think twice about using a product.  Will the real Apply Patch please stand up?

image

(Yeah, yeah, it’s open source so I can easily fix it, blah, blah, whatever.  That’s just a lame excuse for poor craftsmanship.  Don’t release the product until it’s ready… it’s not like you’ve got upper management breathing down your neck to meet a deadline.)

Ahem.  Anyway.

One thing I was hoping to find in PDT was a Refactor option like Visual Studio’s.  The kind of thing where you can just rename properties and methods and it will go and automatically change all the references in the project for you.  Since Visual Studio 2005, I’ve come to use that feature almost compulsively during C# development.  I’m sure it would be challenging to implement reliably in a PHP IDE, but it sure would be nice.

PDT also does not include any way to FTP files to a server, which is kind of a bummer (PhpEd did, and it was pretty nice to be able to hit a button and upload changed files).  Supposedly that functionality is available from another Eclipse plugin called Target Management (Remote System Explorer), but I haven’t had a chance to look at it yet.  Just from reading the overviews it seems entirely too powerful (ie. complicated) for my needs, and I’ll probably just stick with FileZilla.

Surprisingly, Eclipse consumes roughly twice as much memory (or more) as Visual Studio 2008.  Also, it has a disturbing habit of not closing itself down completely.  Sometimes I have to go into Task Manager and kill the eclipse.exe process before I can run it again.

image

So to wrap up this lengthy rambling, Eclipse with PDT is rough around the edges but it’s certainly better than a plain old text editor to manage PHP projects.  But if you’re a full time PHP developer and you have some money to spend, I can’t honestly say it’s better than a commercial IDE.  I plan to keep using it, though, unless something really bad happens (like it accidentally trashes my source code or something).

Upgraded to AMD and Vista x64

I recently upgraded my home computer to a 2.6GHz AMD Athlon X2 5050e with 4GB of memory.  Parts for this upgrade, including a whole new case, motherboard and hard drive, cost about $350.

In the past, I’ve been an Intel guy, so this is my first big foray into the world of AMD.  I made the switch because I built a system for my mother-in-law last year from an AMD processor, which was slightly cheaper, and I was pretty impressed with how it turned out.  Mrs. Krehbiel also got a laptop last year with an AMD processor and it’s been working well, too.  So I figured, why not?

As far as I can tell, there’s absolutely no reason not to get an AMD anymore.  The days when software might not run quite right on AMD processors are long gone.  It seems like the price difference between AMD and Intel is much smaller these days, too.  So basically it’s a toss-up.

I also decided to install the 64-bit version of Vista.  I keep hearing that it runs much better in 64-bit mode.  I can’t say that I’ve seen a significant improvement, but it’s a little better.

Unfortunately, you’ll find that there is not very much native 64-bit software out there besides the operating system itself.  Thankfully 32-bit software usually runs fine on Vista 64-bit, but it installs into a weird “Program Files (x86)” directory instead of the normal Program Files.  The only software I’ve found so far that doesn’t run on 64-bit Vista is Peer Guardian and Taskbar Shuffle.  (Taskix has a 64-bit version, though, and it works fine.)

As of this writing, there is still no Vista driver for my Microtek ScanMaker 4900, 32-bit or 64-bit.  I have to keep it hooked up to an older computer.

Comment Model

Just so there’s a record of it, here’s how I’m planning to implement comments in the new blog platform.  It’s geared toward a small community size.

You will not be required to create a user account or login to post comments, however, registering an account will be the only way to “reserve” a name or display a web site link with your comment.  In other words, you won’t be allowed to post comments with a name that’s already in use by a registered account.

The idea is to allow people who want to control their name to do so, but at the same time allow pseudo-anonymous comments.  I say “pseudo” because IP addresses will be logged in all cases as a deterrent against blatant mischievousness.

If you don’t enter a name when posting a comment, it will be shown as Anonymous.

You will be able to (optionally) provide an email address if you ever want to reset your password.  (Passwords are stored as one-way encrypted hashes, so it is impossible to retrieve them – they can only be reset.)  I have no desire to do anything else with email addresses.

You will also be able to provide a web site link if you want to promote your web page by putting it on my site (which is sure to receive tens of hits per day).

Everything except the username is stored in the database as encrypted text, if that’s something you care about.  That means if someone at my web host decides to copy my database, they won’t get very much.

Javascript will be required to post comments.  It seems to be a really easy way to block automated spam bots without hassling the user with captchas.  Since I implemented Javascript I’ve had 100% success blocking spam from my blog.  (Admittedly, my page doesn’t come under direct assault very much.)

There will be a relatively short limit (say, 1000 characters) on comments to encourage brevity.  I never like finding comments on sites that are longer than the original post.  At this point, I don’t think I’ll be allowing any HTML or markup.  It’s just too much of a hassle.

I don’t plan to support avatars, although it would be relatively straightforward to add in the future.  Of course, you’d need an account to use that feature.

I also don’t see any need to support OpenID or Gravatars unless the community size grows considerably.  I might explore OpenID someday, though, just for the practice.

Virginia 2009 Statewide Candidates

I finally sat down and made a list of the announced candidates for statewide office in Virginia this year.  These are all the candidates I could find, which is not to say there aren’t any more out there that I missed (like third party candidates, which I found zero information about).

See also:  http://en.wikipedia.org/wiki/Virginia_elections,_2009

Governor

Lieutenant Governor

Attorney General

Apologies if I missed any links.  Let me know and I’ll put them in.