Wednesday, October 24, 2012

Cleaning Scans with Photoshop

If you want to scan more than one photo at a time, you can do it with some help from Photoshop's crop and straighten feature. You can automate this, and use a script to clean up multiple scans. However, this process sometimes creates a large number of "pieces" - more than you want. If you know you have only a single image, you can use Photoshop's trim instead to remove excess whitespace.

Saturday, August 4, 2012

Testing an ant Task

I had to test the SchemaCrawler ant task. Some research shows

  1. Include the ant testunit jar - in a Maven project you can add a dependency such as

  1. Extend your test case from
  2. Write a setup like
  public void setUp()
    throws Exception
    configureProject( "./build.xml" );
  1. Write your test cases, with the methods starting with "test" (as in the classic JUnit)
  public void testAntTask()
    throws Exception
    final File testOutputFile = File.createTempFile("schemacrawler.",
    setAntProjectProperty("outputfile", testOutputFile.getAbsolutePath());

    // some asserts here

  1. You can set properties with the utility method
  private void setAntProjectProperty(final String name, final String value)
    final Project antProject = getProject();
    antProject.setProperty(name, value);

Sunday, May 22, 2011

No Software Required Download of Vimeo Videos

No software required download of Vimeo videos - all you need is a browser.

  1. Navigate to a URL like this:${nodeId}, where ${nodeId} is the Vimeo video id
  2. You will get an XML file. Scroll to the bottom to find the request_signature and request_signature_expires values
  3. Navigate to a URL like this:${nodeId}/${request_signature}/${request_signature_expires}
  4. Use the browser's "Save As" function to save the video. 

Saturday, October 27, 2007

Convert Outlook .pst Emails Into mbox Format

Here is an easy and free way to convert your archived Microsoft Outlook emails into a more standard and searchable mbox format. The mbox format files will be plain text, and will be much smaller than the binary .pst files, and even smaller when zipped up.

Here is the procedure:
1. Install Mozilla Thunderbird, Portable Edition. Set up an email account, using Local Folders.
2. Start Microsoft Outlook, and open your .pst files that contain your archived emails.
3. Import your emails into Thunderbird, using Import on the Tools menu.
4. After the import is complete, you will see a new Local Folder called Outlook Mail. Create a new folder under Local Folders, and move email messages into that.
5. You may delete the Outlook Mail folder after all the emails have been moved out.
6. Exit Thunderbird and Microsoft Outlook.
7. Navigate to the Thunderbird's email directory, which would typically be C:\PortableApps\ThunderbirdPortable\Data\profile\Mail\Local Folders. Find a file with the same name as the email folder that you created. Ignore any files with a .msf extension. This file is in the mbox format. Move out the email file into your backup directory, and preserve it carefully. You may zip it up, and burn it to a CD.

To read or search through your old emails, which are in the mbox format,
1. Make sure that Tunderbird is not running.
2. Copy your archived emails in the mbox format into the Thunderbird Local Folders directory, typically C:\PortableApps\ThunderbirdPortable\Data\profile\Mail\Local Folders. 3. Start Thunderbird, and search and read your old emails.

The above procedures will work best with Mozilla Thunderbird, Portable Edition, but will work with plain old Mozilla Thunderbird too, if you know where to find the Local Folders for email.

Saturday, May 5, 2007

File Dialog in Eclipse RCP

I was trying out a simple application in Eclipse RCP. I needed a simple file open and file save dialog, like the Swing ones. I could not easily find an example on how to do this, from a Google search. Finally, this is what I came up with:

FileDialog dialog = new FileDialog(window.getShell(), SWT.OPEN);
String selectedFileName =;
if (selectedFileName == null)
File selectedFile = new File(selectedFileName);

Friday, March 2, 2007

Gaim on Windows Vista

I installed Gaim 2.0 beta 6 on my new Windows Vista Home Premium laptop, and it worked fine. I had a hard time finding the preferences files though. I turned on the Help -> Debug option in Gaim, and found they were in C:\Users\Sualeh Fatehi\AppData\Roaming\.gaim. Then I was able to overwrite these with my backed up accounts, prefs and blist XML files, and was up and running.

Sunday, January 28, 2007

Burning Google Video to DVD

I wanted to burn a video on Google Video to a DVD for a big screen experience. Google Video allows download of a .gvp file. On opening this file, which is a text file, I found the URL to download the video itself. I saved this video in a file with a .gvi extension on my hard-disk. Then, some more searching on Google showed that I could convert the .gvi to a standard .avi file using the open-source GVI2AVI program. I could play the converted file using Media Player, as well as burn it to a DVD.

Wednesday, September 29, 2004

Software to Catalog Books

Are you aware of any decent software to catalog books? I have not used software to catalog any of my book collection. It sounds like an interesting project. Probably even software that bills itself as a cataloger for videos or audio may work for books.

Here are some links I found on the web:

Let me know what you find.

Friday, November 12, 1999

The GEDCOM Standard Release 5.5

The GEDCOM Standard Release 5.5 "GEDCOM was developed by the Family History Department of The Church of Jesus Christ of Latter-day Saints (LDS Church) to provide a flexible, uniform format for exchanging computerized genealogical data. GEDCOM is an acronym for GEnealogical Data Com munication. Its purpose is to foster the sharing of genealogical information and the development of a wide range of inter-operable software products to assist genealogists, historians, and other researchers."

Well, as I tried to explain GEDCOM is a de-facto standard format that any family tree program can use. Once I enter data in, you can use your favorite family tree program to view the data I send you as a GEDCOM file.

Friday, November 5, 1999

If I have an appliance rated as 9V 150mA and an eliminator which gives an output rating of 9V 1 Amp, is it OK? If I remember correctly, the voltage has to be exact, but the eliminator amperage output rating should be equal to or more than the appliance. Am I right? Yes. However, if the appliance were to short or not have as many safety features and you were to touch a appliance part that can shock you, you would basically provide a least resistance path for the current causing the eliminator to send its maximum rated AMP output through your body. THAT can be dangerous. So yes, it will work but be careful - even a camera flash capacitor can shock you by discharging if you touch the insides of a camera flash (personal experience where I didn't realize that the capacitor may be

charged) .

Answer courtesy Murtuza Vasowalla

What is the the relation between volts, amperes and kilo-watt hours?

What is the the relation between volts, amperes and kilo-watt hours? Also,

where does BTU fit in?
Well a volt is a measure of potential difference. What this means is that it is a measure of the difference in electric "levels". You can compare it to a waterfall. Water will fall over the waterfall only if the water at one end is higher than the other. So we can say the measure of "potential difference" between the top of the waterfall and the bottom is the height of the waterfall. Similarly, electricity will flow only from a point that has a higher potential to apoint that has a loweer potential - that is a positive potential difference.

An ampere is a measure of the amount of electricity flowing. For example, if we have the Niagara falls, it will have a large amount of water flowing over it (or a greater number of "amperes") than a smaller waterfall in Khandala.

Here we have to introduce a new concept - resistance. Resistance is measured in ohms, and is the resistance to the flow of electricity. Resistance being same, a larger voltage (potential difference) will result in a higher current (amperes). But, if you increase the resistance, the flow of current (amperes) will reduce. What I have just explained is known as Ohm's Law, and is mathematically stated as current is directly proportional to the voltage, and the proportionality factor is the resistance, or:

V = iR (V = voltage, i = amperage, R = resistance)

Next we come to the concept of power. Power is the amount used per second. Electric power depends on the voltage (the potential difference). To increase the voltage requires energy. Power also depends on the current - the greater the current, the greater the electric power. So we arrive at a simple mathematical form:

P = Vi (P = power, V = voltage, i = amperage)

Power is measured in watts, and a 1000 watts are a kilowatt. As I mentioned earlier, power is the energy consumed per second. If you want to know exactly how much energy has been consumed, you need to know how much time that you have been using the power. This is commonly measured in hours. So, the measure of total electric energy consumed is measured in kilowatt-hours.

Energy = PT (P = power, T = time)


Energy = ViT (V = voltage, i = amperage, T = time)

A BTU is an imperial measure of energy.