Staying on top of Changes with Mercurial

If there’s one constant in software development, it’s change. Little changes here and there, and the occasional big change happen all the time.

Web development is the same, and arguably even more so. Freed from the need to package everything up and ship it in a numbered release, it’s all to easy to fix a single small bug and immediately make it live on the site. Or change a single word on one page, and make that live.

If you have more than one person working on a project (web or otherwise), keeping everyone’s changes in sync can be a chore. Back in the day when Jared and I were working on Redux together it was a simple matter for one of us to “claim” a chunk of the source code for an hour (or a day), telling the other to keep their hands off it.

Nowadays there is an entire genre of Source Code Management programs that keep track of everyone’s changes with a minimum of fuss. In addition they document changes, keep track of different revisions, know what files were changed when and by who (and why). They eliminate the possibility of one person stepping on another’s code (and wiping out their changes), and should a change go completely astray, they even let you revert to any earlier (working) version.

After looking at a few different SCM programs, I settled on Mercurial, which seemed the best fit for my working style. It’s lightweight, and installs easily on Mac OSX as well as the various Unix servers that host my web sites. You control Mercurial from the command line, using the new hg command it installs (from the chemical symbol for mercury: Hg).

After installing Mercurial, the first step was to pick one of my websites and tell Mercurial which files I want to keep track of for the site. I then made a snapshot of those files, or as Mercurial refers to it, a “changeset”. It asked me to include a brief comment with the changeset to describe it; for the first changeset a comment like “added key site files” worked just fine.

Now I make changes as usual, and Mercurial keeps track of what changed. I frequently commit a set of changes to a new changeset, along with a brief note describing the change. At any point if I don’t remember what I’ve changed a simple hg diff command will tell me not only which files changed, but which lines in those files changed (both old and current versions).

What’s very cool is that I can keep a local copy of the website on my MacBook, make changes locally and testing them, and when I’m satisfied that the changes are ready to go live I can send those changes to the website with a simple command: hg push.

Once the changes have been pushed to the site, I can make them live at my leisure; a simple hg update command instantly makes the changes live. No more fussing with uploading changes with ftp, messing with renaming files or worrying about copying files to the wrong directory.

Mercurial is easy to install, easy to learn, and easy to use. It makes it easy to keep track of changes, and to migrate those changes to different developers (or different locations, like live web sites). I’ve only scratched the surface of what it can do, but even after just a few days it’s already made my life easier.

Dave, morphed

I found this “cool morphing site”:1 on digg.com today. You upload your photo, and a java applet morphs your image in various ways.

Here I am morphed to a Manga cartoon and an El Greco painting:

It’s like Sunday morning comics!

[1]http://www.dcs.st-and.ac.uk/~morph/Transformer/

Kartoo

Kartoo offers an interesting slant on search engines; rather than displaying a list of relevant entries it shows an animated map of result sites. Mouse over one of the result pages and information about the site is displayed the left sidebar. A line appears connecting the page to words it has in common with other result pages. Clicking on a page opens it in another window.

I like the interface, it’s a new approach to search results. It’s not likely to replace Google anytime soon, but it’s nice to see some fresh thinking on a tool we all use every day.

Check it out yourself below.


Search the Web :



Moving Pains

In a mostly painless move, microseeds.com now lives at Jagfly.

In a mostly painless move, we’ve successfully moved the microseeds.com website to Jagfly, a wonderful web host in Amherst, MA. The actual move went really well, and I got the site copied over with too much fuss, got cgi scripts working, and setup a MySQL database and WordPress for the blog. There was a brief glitch when I succeeded in locking myself out of the site, but Sheldon at Jagfly straightened things out and all is now good.

What triggered all this was getting the *davermont.com* domain name a few weeks ago, and wanting a place to host it. Since I’d sent a number of my clients to Jagfly and they’re great to work with, it only made sense to host it there. And if I’m gonna move one domain to a new host, why not move three?

So anyway, I’m liking the new digs and it’s great to be here.

Speaking of digs, have you checked out digg.com?? It’s my new favorite site, kind of like slashdot with a bit of fark thrown in, with a Web 2.0 feel to it. Check it out.

Tracks: Ruby on Rails Meets GTD

I love it when two of my interests collide, and when it’s two fresh new interests that’s even better. The theme for this entire week as been Getting Things Done, and I’ve spent a fair amount of time collecting and organizing the things I need to do. I’ve also been curious about Ruby On Rails, a cool new tool for web development.

It turns out that there’s a GTD tool written using Rails called Tracks that does a great job of tracking projects, next actions and contexts. It’s free and it runs on my PowerBook, both big plusses as well.

Tracks was written to do GTD, which it does really well. Adding a new Next Action item (say “call to order a gate for the fence”) is as easy as clicking on the “Add the next action” link and typing it. Optionally you can add more details about that Next Action: you can attach a longer note to it, give it a due date, assign it to a project (Pool Fence Project), or give the action a context where it can be done (“next time I’m at the phone”). It’s easy to edit all three GTD pieces: Next Actions, Projects and Contexts, and to check off items as they’re completed. And it’s easy to print out the current state of things, so you can carry your To Do list in your pocket and leave the computer at home.

I’ve been keeping Tracks open in a browser tab, so it’s quick to switch to it and keep my To Do list up to date. So far Tracks has been trouble-free, and it’s way more fun to use than the Palm Desktop software (which was replaced by Tracks after just one day of using it to do GTD).

The downside of Tracks is that it’s still pretty geeky to set up, as you need use Terminal and set up a mySQL database. There was also a conflict between Tracks and Instiki (which also uses Rails), but I found a quick fix for that little problem.

It’s interesting that I’m relying more and more on browser-based tools like Instiki and Tracks to keep track of my life. They run on my machine and I don’t have to be connected to the net to use them.

*Update Oct 6*
Woke up way too early this morning and decided Tracks was running too slow as a CGI under Apache, so I installed Lighttpd and FastCGI per These instructions, but it barfed on the @sudo gem install fastcgi@ step, til I ran across this solution:

sudo gem install fcgi -- --with-fcgi-include=/opt/local/include --with-fcgi-lib=/opt/local/lib

Getting GD Module Working With Tiger

I always find it a challenge getting the perl GD.pm module working whenever I upgrade or do a fresh install of the operating system. The GD module is perl’s interface to the gd graphics library, which itself requires various libraries installed in order to work with jpegs, truetype fonts, etc. GD lets cgi scripts create custom graphics on the fly, like the Who Owns Vermont map Robin and I created for the Snelling Center a while back. GD can composite and caption photos, watermark them, resize them, convert GIFs to JPEGs or PNGs (and vice versa), draw charts and graphs, and so on. Fun and geeky stuff indeed.

Ever since the hard disk crashed last January, I’ve been unsuccessful getting GD to install despite several attempts using Fink, and even going so far as hunting down the sites hosting the individual parts and trying to install them. No go. (Note: The following assumes you’ve installed the Developer Tools, know what GD is for, and have already installed and configured CPAN.)

Yesterday I decided to try something completely different, and use Darwin Ports to install gd and all its parts. Darwin Ports itself was an easy download and install, so I was encouraged by this good start. I found gd as well as gd2 on the Available Ports, graphics category page; feeling brave, I decided to install the newer gd2. The page reported that gd2 requires the jpeg, libpng, XFree86, and freetype libraries, and I used ‘port’ command (installed by Darwin Ports) to install each of these libraries, like so:
> sudo port install jpeg

Installing software can take a while to compile and, making it a great time to surf the web, catch up on blogging, or whatever. Not a good time to use PhotoShop or other processor-intensive applications, tho, or you’ll be there forever because your Mac is crawling along at a snail’s pace.

Well, the jpeg and libpng libraries installed just fine, and altho XFree86 to a very long time to compile, at the very end it complained that another X package was already installed. I remembered installing Apple’s X11 when I installed Tiger, so I decided to leave that alone and continue with my install (hoping that wouldn’t cause a problem).

The freetype library also installed just fine (and pretty quickly, compared to the behemoth that’s XFree86). I held my breath and installed gd2, the graphics library that ties all the other libraries together. Thankfully, gd2 installed without complaint. And at this point I’m really liking this Darwin Ports thang!

With the last piece in place, it was time to install the GD.pm module, and of course CPAN is the best way to do that. It installed without a hitch, woohoo!

I ran a quick little test perl script that created a 100×100 gif, framed it with a red rectangle and drew some text in the center. And it worked! I was thrilled and pleased that Darwin Ports made installing gd so easy.

GoodPage Review

I’ve been using Tari “GoodPage”:1 for the past week to redesign the House-Mouse site. Unlike other CSS editors, GoodPage edits a page’s style sheet **and** its HTML, which makes it easier to create a modern web site. It can also show a live preview of the web page you’re editing so you can see the results of your changes without having to switch to a web browser, thus it consolidates three major parts of web page design. With GoodPage you do have to edit your HTML and CSS code directly, but I prefer doing that anyway.

GoodPage offers many ways to view your web page, but the ones I’m finding most useful are:

* HTML source code
* style sheet CSS source code
* structure (a graphic, 2D hierarchical view of the web page contents)
* list of individual css selectors (handy to look at a specific selector, rather than being overwhelmed by the entire style sheet)
* brower preview of the web page

The main window can display any two of those views side by side, so you can preview your web page in the left pane while you edit the html (or the style sheet) in the right pane. Or edit the html source and the stylesheet side by side. Or whatever combination you need at the moment. It’s handy not having to switch between windows, or to switch between programs for editing or previewing.

GoodPage offers a bunch of handy little tools to make development easier. For instance you can select an element in the web page preview (like a div, a paragraph or an image), and view its CSS properties in the other pane, then edit them and immediately see the change. This is great for debugging things like figuring out why there’s too much space above an element: you can not only see that top margin (or top padding) is too big, but which style sheet and selector are setting that property. And from there you can just fix the problem. Another nice feature of the side-by-side views is that you can select an element in one view hit Command-L, and a blue arrow appears to point out the corresponding item in the other view. So you can select a paragraph in the page preview and instantly see the html source for that paragraph in the other pane. Nice, it saves scrolling thru the source looking for it.

The developers have sucessfully leveraged the features offered by Mac OS X, and the program is a pleasure to use and is visually pleasing as well. I’m a sucker for aesthetic and useful, which is why I use a Mac.

As nice as it is, my biggest frustration with the program is that it comes with no documentation. None. The developers feel that GoodPage is so intuitively obvious to use that a manual just isn’t necessary. Unfortunately they’re wrong, and it’s taken a bit of stumbled around the program to figure out how to use it. In addition to only using a fraction of its features, I also feel that I’m not getting the most out of the features I am using. Using the program is like using some piece of wonderful alien technology that does some really cool things, but you just have to puzzle it out yourself and learn how to think like the aliens. For instance I can’t see what the big deal is with Structure View, but I get the impression that with it you can edit a page without knowing HTML, but I’ll be darned if I can figure it out. Still, what I have been able to discover has made me so much more productive that even after using it for just a few days, designing CSS web pages without using GoodPage would be so much harder.

With a price of $99 (early adopter special), it’s more expensive than the shareware alternatives, but cheaper than Dreamweaver. At that price it should include decent documentation, a tutorial, and more than the minimal CSS reference it comes with. Some sample templates would be also be great.

GoodPage works they way I do (at least what I’ve figured out so far) and it lets me focus on design without the distractions of switching to other programs, or searching through various style sheets for a given selector. This is an early version (1.1), so now that Tari has released this solid and useful tool I’m hoping they put their energy into writing a manual and perhaps creating a tutorial to show people how to use it. After all, what good are all those wonderful features if nobody can figure out how to use them?

[1]http://www.goodpage.info/

Mashups

I’ve been enjoying the Kleptones’ mashup “Night at the Hip-Hopera” for the last few months, and they’ve just released “From Detroit to J.A.” which sounds great too.

I just ran across a mashup video of the Beatles’ “Paperback Writer” and The Monkee’s “I’m a Believer;” check it out.

Most mashups need to be hunted down (Google is a good place to start), and require you to learn a little about BitTorrents. But if your ears are tired of the same old thing and you want to hear something fresh and interesting, it’ll well be worth it.

Update March 1: Here’s a video mashup of Rambo audio and Iraqi war footage. Also a nice mashup of the Beatles’ Revolver album: Revolved.

Update March 4: Cool mashup of the Beatles For No One, Scissor Sisters’ Take Your Mama, George Michael’s Freedeom 90 and Aretha Franklin’s Think. It’s amazing how it all comes together: No One Takes Your Freedom.

Update March 5: Discovered CDX2, a great site with dozens of mashup downloads!

Updates

My personal home pages were completely out of date, which is only right considering that I work on web pages for a living. How old were they? We’re talking 1999, last century, a totally different millenium. Way old.

So I just spent the last hour updating them a little, but I’m realizing that to do it right they really need more recent photos and a more interesting look. But least now they look a little more modern and consistent, and they even sport a bit of CSS. First things first (but not necessarily in that order)…