Generating “Unified Diff” Files with ClearCase

September 7th, 2007

In my company, we recently migrated from CVS to ClearCase. We were a bit thrown off by the fact that ClearCase doesn’t readily provide diff files that span multiple files. We have all been used to reviewing CVS diff files which do so. People here had to come up with their own scripts to remedy this issue. Here’s what I’ve been using so far:

cleartool lsco -cvi -r -s | xargs -n1 cleartool diff -pred -ser | egrep -v "^(Files|Directories) are identical"

This Unix shell command will generate the diff output (which you can redirect to a file) recursively (-r) for all files that are checked out within the current directory, on the current view (-cvi).

The output is not exactly a unified diff file (I believe that it can’t be directly used with the patch command) but it still is a human-readable diff that spans multiple files.

The reason that I use -serial_format (-ser) and not -diff_format is that -diff_format suppresses the file headers and obviously a “unified diff” file doesn’t make sense when you don’t know where each individual file starts and ends.

ACB2XML 2.0b - Convert Photoshop Color Books to XML

May 8th, 2007

Here’s a freeware tool that I had written back in 2003, shortly after reverse-engineering the Adobe Photoshop Color Book Format. This command-line Windows application extracts color data from color book files and generates XML. Once the color data is safely in XML domain, the rest is up to your imagination…

Download acb2xml20.zip (30 KB)

Read the rest of this entry »

Burrito 1.0b - FTP to POP3 Protocol Translator

May 7th, 2007

With Burrito you can read and manage your e-mails with any FTP client! It acts as a POP3/FTP protocol translator — it’s actually an FTP server that translates FTP commands to POP3 commands and serves your e-mail messages as individual files. You can view, delete and copy your e-mail messages as if they were files on an FTP server.

Download burrito10b.exe (479 KB)

Read the rest of this entry »

Verifying the Integrity of an Easynews Download without a Checksum File

February 6th, 2007

Suppose you had to download a huge file as a single piece because a multiple archive version wasn’t available. If the poster didn’t supply a checksum file (MD5, SFV) or Parchive files, you can’t readily tell if the file you’ve downloaded is intact. Here’s a method I came up with for verifying the integrity of an ISO image file that didn’t come with a checksum. I didn’t want to burn the ISO image without knowing that the file was intact, to avoid an interrrupted or corrupt installation. Read the rest of this entry »

Default Constructor vs. Empty Constructor

December 16th, 2006

While coding away new classes for your C++ project, do you have the habit of just dropping in a contructor definition, just in case you may in the future need to do some initialization at construction? A while ago, I had wondered if there would be any difference at compile time between having an empty constructor and having no constructor at all (and thus using the default constructor). I did a quick investigation by writing a simple test application and looking at the disassembly. It turned out that there is actually a difference (in a debug build). Read the rest of this entry »

Rendering N-sided Polygons with DHTML

November 28th, 2006

With this technique, convex polygons with any number of sides can be rendered, with a solid color or a background image as the fill. Click here or the image below to launch the demo (opens in a pop-up window).
 

DHTML Polygon Rendering Demo

You can probably figure it out on your own by playing with the checkboxes at the lower left corner of the pop-up, but read on to find out how it all works. Read the rest of this entry »

Behind twofifty.net (in spite of Ajax)

November 19th, 2006

This website of mine is a showcase for digital artwork, strictly 250 by 250 pixels in dimensions and on various formats including GIF, PNG, JPEG, Java, DHTML, Flash and Shockwave. Since its inception in 1999, the website has attracted great talent and received worldwide recognition. The collection currently consists of around 1500 hand-picked pieces, submitted by 340 contributors. But enough of all that. The website infrastructure employs some neat tricks that provide an Ajax-like browsing experience, without using Ajax. This is what I actually want to talk about. Read the rest of this entry »

browsersize.com

November 18th, 2006

A simple website that I had put together a while ago, that harbors two simple tools that web designers may find useful. The main site shows you decently current statistics on different screen resolutions that web surfers have nowadays. You could use that as a starting point for deciding on the dimensions for a non-fluid website layout.

browsersize.com

setmy.browsersize.com allows you to set your browser size to any desktop resolution without the need for extra add-ons/extensions. This is useful for seeing how users with different desktop resolutions will be viewing your website. whatsmy.browsersize.com tells you your current desktop resolution and browser size along with all the installed popular plug-ins (with links to download sites for missing ones).

Using Fewer Images

August 27th, 2006

Image rollovers are usually composed of two individual images; one for the default state and one for when the mouse is hovered over the image or link. However, it bears some advantages to use a single image by taking advantage of CSS image offsets. Read the rest of this entry »

Opt for Pre-incrementing Iterators

August 26th, 2006

There’s a slight performance advantage in using pre-increment operators versus post-increment operators. In setting up loops that use iterators, you should opt for using pre-increments:

for (list<string>::const_iterator it = tokens.begin();
    it != tokens.end();
    ++it) // Don't use it++
{
    ...
}

The reason comes to light when you think about how both operators would typically be implemented. Read the rest of this entry »