Thursday, September 24, 2009

Using CASE in WHERE clause

After much searching, I found that yes, you can use CASE expressions in the WHERE clause of a PL/SQL SELECT statement. The article titled case expressions and statements in oracle 9i provides excellent examples and even explains the impact on query plans.

Friday, September 18, 2009

Adding EXIF datestamps and IPTC info on images

This applies to JPEG images from today's digital cameras which do not stamp the date and time on photos. Uses Irfanview to add a white frame around the image and stamps information (copyright text, date, time, caption, city, state, etc.) on the bottom edge.
For more info, Google "EXIF" and "IPTC".

These notes are based on Irfanview version 4.25.
  1. Download Irfanview and install. Make sure to install the plugins also.
  2. Enter IPTC info for your images:
    • Open an image in Irfanview, then press "T" to go to Thumbnails view.
    • Select one or more images.
    • Press "Ctrl-I" to open the IPTC Information dialog.
    • Enter values for the Copyright, Caption, origin info, etc. Note that this information could also be used to batch-rename the photos, so put in as much info as you can. Add keywords too, which will be useful if you plan on uploading the images to the web.
    • Check the settings in the "Options" tab, then save your changes.
  3. Do a batch-conversion to add the frame and the stamp:
    • Select one or more thumbnails and press "B" to open the Batch dialog.
    • Main batch conversion dialog settings:
      • Work as: Batch conversion
      • Output format: JPG - JPG/JPEG Format
      • Use advanced options: checked
      • Output directory for result files: set this to some folder separate from your original files folder (you will want to keep your originals as-is)
      • Select thumbnails and click the "Add" button, or click the "Add all" button.
    • Output format (JPEG/GIF save options)
      • Save quality: 100
      • Keep original EXIF data: checked
      • Keep original IPTC data: checked
      • Keep original JPG-Comment: checked
      • Set file size: Set this to something close to your original file size (I have it set to 4400.00 KB). This is the cool thing about using Irfanview to add datestamps/watermarks--you could get close to your original file size. I've tried other apps and they tend to add around 2Mb to the file size after watermarking.
    • Advanced settings:
      (You might want to save these by clicking the "Save settings" button. Note that this version of Irfanview does not save the Canvas Size settings.)
      • Canvas size: checked
      • Canvas settings:
        left=60
        right=60
        top=25
        bottom=55
        border color=white
        (This is set for images at 3:2 aspect ratio, and are meant to maintain the aspect ratio, thus the thinner top. These values are based on originals at 3648 x 2736 pixels.)
      • Add overlay text: checked
      • Add overlay text settings:
        X-Coord: 80
        Y-Coord: 0
        Width: 3500
        Height: 50
        Start Corner: Left Bottom
        Text: $I116 [$E306(%Y-%m-%d %H:%M) $I90 $I95] $I120
        Text is transparent: unchecked
        Background color: white
        Font: Calibri, Size:36
        Text alignment: Left
        (Click on "Help" to see what values are available for the Text value. Pick a font that is easy to read and that doesn't take up too much space.)
      • Miscellaneous:
        Overwrite existing files: checked
        Delete original files... : unchecked!
        Create subfolders... : checked
        Save files with original date/time: checked
        Apply changes to all pages... : checked
      • Everything else: unchecked

    • Click on the "Start Batch" button

See samples of the output here...

Thursday, September 17, 2009

Silverlight background

Setting "BackColor" on the Silverlight control won't be enough--it still displays a white box in the beginning. Need to set "PluginBackground" also. Found this answer here.

Thursday, September 10, 2009

wmode=transparent for Silverlight

For Flash, setting the "wmode" parameter to "transparent" lets dropdown lists (say, from menus) overlay the Flash, instead of getting hidden under it.

The equivalent for Silverlight is "isWindowless". (Found the answer here.)

Wednesday, September 9, 2009

Background positioning for <a> on IE6, IE7

Suppose you have a link button graphic that has both the off and on states (e.g., the 50 x 50px "off" image is on the top half and the 50 x 50px "on" image is on the bottom half, resulting in a 100px-tall graphic). It's easy to style the link's hover effect by changing the background-position from "left top" to "left bottom" (also needs the link to be a block element, say display:block or display:inline-block). This works great on Firefox and IE8.

Normally, this works on IE6 and IE7 also, but make sure the <a> has the "href" attribute, otherwise these browsers won't change the background position.