Main | May 2005 »

Main > Photoblog

April 30, 2005

Charminar Ceiling

View in Photoblog
CameraKonica Minolta 7d
LensSigma 15mm f/3.5
Shutter / Aperture1/100s / f/4.5

Capturing almost any architecture in India can be a challange simply because you have to compete with so many people. Often, this would lead me to try and find new angles and occasionally the shot would work out.

The trick with this shot was to include just enough of the ceiling in the frame to make it interesting, but not so much that the lower-right would become too overexposed. The sun was really bright that day!


Posted by jordanh at 2:59 PM | Comments (3) | TrackBack |

Main > Diary > Development

Intelligent Image Resizing in JavaScript

update 11-Mar-2006: added syntax highlighting to source-code.

It's been a little while since I've played around much with doing anything slightly less than the ordinary with JavaScript and the DOM. After seeing some colleagues of mine bring up my photoblog I noticed that it is somewhat annoying not to be able to view the entire image on your screen at once at lower screen resolutions.

I started playing around—inadvertently on the live site—with developing a solution that would scale the main image using the window.onresize event. I was quickly reminded by how much I hate the differences in implementation between IE and Firefox. I found the following articles useful:

  • Obtaining the browser window size
  • Quirksmode JavaScript - Browser detect
  • The whole thing is implemented as a JavaScript class that manipulates two ids in the DOM, "podImage" the image and "podImageViewOriginalLink" which creates the link test to return the image back to its original size.

    Here's the code:

    function podImageClass() {
       if ( !(this instanceof podImageClass) ) return new podImageClass();
       var browser;
       var podImage;
       var podImageHeight;
       var podImageWidth;
       var podImageAspect;
       var debounceResize = 0;
       var haveResized = 0;
       function __setViewOriginalLink(displayBool) {
           var voLink = document.getElementById("podImageViewOriginalLink");
           if (displayBool) {
              voLink.innerHTML = 
                  '<a href="javascript:podImage.setOriginalSize()">' +
                  "Scale to Original Size" + "</a>";
           } else {
              voLink.innerHTML = '&nbsp;';
       function _setText () {
           var podImageText = '"<$MTEntryTitle$>"' + " / " +
               "Click For Previous";
           podImage.alt = podImageText;
           podImage.title = podImageText;
       function _setSize() {
          var myWidth = 0, myHeight = 0;
          if (debounceResize) {
             debounceResize = 0;
          if( typeof( window.innerWidth ) == 'number' ) {
             myWidth = window.innerWidth;
             myHeight = window.innerHeight;
          } else if( document.documentElement &&
             ( document.documentElement.clientWidth ||  
                document.documentElement.clientHeight ) ) {
             //IE 6+ in 'standards compliant mode'
             myWidth = document.documentElement.clientWidth;
             myHeight = document.documentElement.clientHeight;
          } else if( document.body && ( document.body.clientWidth || 
                document.body.clientHeight ) ) {
             //IE 4 compatible
             myWidth = document.body.clientWidth;
             myHeight = document.body.clientHeight;
          // Only do the resize if we've done this before or if our
          // image is greater than their window size 64px of top margin.
          if ( !( haveResized || ((podImageHeight + 64) > myHeight) ) ) {
          // allow 128px margins on top and bottom:
          var newImageHeight = myHeight - ( 2 * 128 );
          if ( (podImageHeight + 64) < myHeight ) {
             // Just use original width and height;
          } else {
             // Downscale:
             if (newImageHeight > 0) {
                var newImageWidth = newImageHeight * podImageAspect;
                podImage.width = newImageWidth;
                podImage.height = newImageHeight;
          haveResized = 1;
       function _setOriginalSize() {
          // We have to play with the onresize handler to work
          // around IE sending spurious events.
          window.onresize = null;
          podImage.width = podImageWidth;
          podImage.height = podImageHeight;
          if (browser == "MSIE") {
             debounceResize = 1;
          window.onresize = _setSize;
       function _checkIt(string)
          var detect = navigator.userAgent.toLowerCase();
          place = detect.indexOf(string) + 1;
          thestring = string;
          return place;
       function _init() {
          if (_checkIt('msie')) browser = "MSIE"
          else browser = "Other";
          podImage = document.getElementById("podImage");
          podImageWidth = podImage.width;
          podImageHeight = podImage.height;
          podImageAspect = (podImageHeight > 0) ?
             (podImageWidth / podImageHeight) : 0;
       this.init = _init;
       this.setText = _setText;
       this.setSize = _setSize;
       this.setOriginalSize = _setOriginalSize;
    <!-- setup podImage class: -->
    var podImage;
    addLoadEvent(function() {
            podImage = podImageClass();
            window.onresize = podImage.setSize;

    It's live on the site now; let me know if you run into any bugs or if you just find the whole thing annoying.

    I'm sure one day this entire exercise will be reduced to two lines of CSS.

    Posted by jordanh at 1:47 PM | Comments (1) | TrackBack |

    Main > Photoblog

    April 28, 2005

    Charminar Security

    View in Photoblog
    CameraKonica Minolta 7d
    LensSigma APO 70-300mm f/4-5.6 @ 70mm
    Shutter / Aperture1/15s / f/4

    After I was finished shooting over-exposed shots out of the charminar, I turned around and saw this guy. The camera was set absoltely incorrectly for a shot like this, 1/15s @ ISO 100, but I did have Minolta AS engaged and the shot turned out crisp enough.

    There is something I love about shooting candids when people are on the job; there is just so much natural character involved.


    Posted by jordanh at 9:57 AM | Comments (7) | TrackBack |

    Main > Photoblog

    Bazaar from Charminar

    View in Photoblog

    Our colleague and friend in Hyderabad, Srikanth, took us out around Hyderabad our first weekend there. You cannot visit Hyderabad without seeing the Charminar--four minarettes of Islamic architecture towering over the bazaar around it.

    CameraKonica Minolta 7d
    LensSigma APO 70-300mm f/4-5.6 @ 70mm
    Shutter / Aperture1/200s / f/9

    I used my telephoto zoom lens to maximize the perspective compression in this shot. Those little three wheelers make almost any shot worthwhile. The market was really busy considering it was about noon in the heat of the day!


    Posted by jordanh at 9:47 AM | Comments (1) | TrackBack |

    Main > Photoblog

    My First Indian Sunset

    View in Photoblog

    Indian cities should win awards for their air pollution levels but those poor breathing conditions sure to make for beautiful sunsets!

    CameraKonica Minolta 7d
    LensSigma APO 70-300mm f/4-5.6 @ 160mm
    Shutter / Aperture1/160s / f/7.1

    Jim, my colleague and travel companion who joined me for India, and I had just arrived to the Mumbai airport from Schiphol and this was the first thing we saw out the window. We were treated to these sunrises and sunsets nearly every day in India. Indians must think they look bland elsewhere!

    I didn't find the airport to be as bad as many of the people thought in this post, but then again we did have access to the airline lounge until it was time to catch our flight to Hyderabad.


    Posted by jordanh at 9:28 AM | Comments (4) | TrackBack |

    Main > Diary

    April 27, 2005

    Twenty Five Ain't Bad to Be Alive

    I woke up with these words in my head, somehow I've remembered them until now:

    Happy Birthday

    Today is going to be a good day
    celebrating a quarter-century of sideral success
    allegorical alitteration passing the lyrical litmus test.

    Today is my birthday.

    Somehow today I've managed to kill my laptop dead, wipe out my work INBOX of all of my saved messages, and spill salad dressing all over my favorite shirt.

    I am about to board an airplane. I hope to end the badness streak before then. Wish me luck!

    Posted by jordanh at 1:31 PM | Comments (0) | TrackBack |

    Main > Photoblog

    April 26, 2005

    Saqqara Sentry

    View in Photoblog

    There was still plenty of light in the day when I hit up Djoser's step pyramid after Giza. It was a very nice contrast: virtually nobody was there and I felt I could really take my time in looking around.

    CameraKonica Minolta 7d
    LensTamron SP 90mm f/2.8
    Shutter / Aperture1/300s / f/11

    There are sentry with rifles all over the tourist spots. It is a little eerie to consider they are there protecting you from outside forces and not primarily to keep you from doing stupid things (as it generally is in the States and Europe.) All the same, I am a little skiddish to take pictures of people with rifles, but I really liked the way this guy was perched on his camel up on the hill.

    To make this image B/W I applied Russell Brown's conversion technique with some additional channel masking and mixing to bring forth the parts of the image I thought were worth bringing forth. After I was satisfied with the contrast of things I overlayed a grain field to give it that look-at-me-I'm-artsy Tri-X look.


    Posted by jordanh at 12:15 AM | Comments (7) | TrackBack |

    Main > Photoblog

    The Pyramids at Giza

    View in Photoblog
    CameraKonica Minolta 7d
    LensMinolta 50mm f/1.4
    Shutter / Aperture1/500s / f/10

    I remember showing this picture on the back of my camera to people living in Egypt when I got back from my tour of the pyramids. I think my favorite comment was, "I've seen the pyramids, this is a good one." That made me feel great.

    I wish I could say that I had some sort of influence over how this shot worked out—perhaps that I knew the good angle or had some influence over the cloud pattern that produced those nice highlights on the queen's pyramids—but I did nothing put shoot the picture where the guide told me to at the time he told me to.


    Posted by jordanh at 12:07 AM | Comments (9) | TrackBack |

    Main > Photoblog

    April 25, 2005

    Color at Giza for Baksheesh

    View in Photoblog

    My apologies to those who have had to re-add me from, I've changed the URL of this site and there isn't presently any way of doing this from their interface. Please update your URLs, as I will take down the old URL soon. Thank you!

    As you travel around Giza, you will inevitably encounter all sorts of people trying to sell you whatever they can offer: water, postcards, or in this case photo-ops.

    CameraKonica Minolta 7d
    LensMinolta 50mm f/1.4
    Shutter / Aperture1/2000s / f/4.5

    I was with a guide who was trying to maximize the amount of money left in my pocket for his tip so he would try and do his best to shew people away after I would give them their baksheesh. Seeing this guy was just like un-cut cocain for a color junkie like me so I gladly took his picture, cheesy and touristy or not! I even like the fact that he appears to be wearing tennis shoes!

    I think the shot cost me a total of about 35¢ (2 Egyptian Pounds). I think it was worth it.

    I was mounted on horseback when I took this picture. I think that even though I was shooting down onto the subject the picture worked out. The pyramids make one heck of a photogenic background!


    Posted by jordanh at 11:38 PM | Comments (9) | TrackBack |

    Main > Photoblog

    April 24, 2005

    Hooker on the Hook

    View in Photoblog

    While in Amsterdam I was challenged to get a picture of a woman behind the window in the Red Light District. I read that this is difficult and even dangerous as there are hawkers that will think nothing of throwing your camera into the canal for such an offense. This did not stop me however.

    CameraKonica Minolta 7d
    LensMinolta 50mm f/1.4
    Shutter / Aperture1/40s / f/2.5

    I stood over the canal and took a couple of shots aiming generally down the strip. Then I turned and pulled this one off. Thank goodness for Minolta's anti-shake stabilization, this image came off sharp enough.

    It was a little dark, a little over saturated, and a little grainy at first but I think I was able to post-process it to make it interesting. I'd love to know what you think!

    I am just glad the camera didn't end up in the canal!


    Posted by jordanh at 8:47 PM | Comments (7) | TrackBack |

    Main > Diary

    Iron Man, or Bronze Boy?

    This morning I joined my co-worker and friend Dick and his wife Meg for the Iron Man Bike Ride in the southern suburbs of Minneapolis. This ride is often the first of the year for many people and often the weather is crappy so I hear it has a reputation for being rather nasty.

    The weather was very nice today, if not a little cold. It was in the upper thirties when Dick and Meg picked me up from the house but I was prepared with a stocking-cap under my helmet, gloves, and a neck-warmer. The cold was no deterrent to the number of participants; people really seemed to take advantage of the clear weather and showed up in force. I heard there were as many as 5,000 riders riding one of the three routes.

    We had set off to do the 30 mi. route, new for this year to attract a greater set of riders. I am far to wimpy and undertrained to pickup the 60 mi. or 100 mi. option in April but it was still grueling. I don't know how they managed to do it, but the route planners seemed to have either a climb or a head-wind for the duration of the route.

    It was still a lot of fun, however, and we finished about 34 mi. in 2:11:00. I got pretty beat up on the last steady incline. It was five miles of 15-20 m.p.r. head winds for about 5 mi. It felt great to finish and they gave me Gatorade and a cookie. That made all the difference.

    On an aside note, I'm sorry for any connectivity issues you may have been having to the site. It seems my nameserver took this past day. I'll have to try and see if I can get a back-up setup off site somewhere. Would anybody like to do a peering DNS exchange with me? I'll be your backup if you'll be mine!

    Write me an e-mail or leave a comment if your interested.

    Posted by jordanh at 12:39 PM | Comments (0) | TrackBack |

    Main > Photoblog

    April 23, 2005

    Grand Central Station Admiration

    View in Photoblog

    Aimee was nice enough to let me try, try, and try some more to get the picture I wanted of Grand Central. I had just picked up my Minolta 7D the day before at B&H Photo and this was one of the first shots I took with it.

    CameraKonica Minolta 7d
    LensSigma 15mm f/3.5
    Shutter / Aperture1/4s / f/4

    Aimee also tried to produce a reasonable portrait of me with the camera while I was there, but she couldn't quite find the focus. Turns out my camera had the infamous "back-focus" mis-calibration defect that would become an annoyance for the remainder of my trip.

    I like this photo for the couple that is standing motionless in the swarm of busy New Yorkers. That, and I ♥ NY. The perspective of this photo is a little right of center, looking inwards. At times I cannot figure out if this makes the photo look interesting or annoying.

    I took this photo by placing my camera on a conveniently placed ledge at a high vantage point. I used the timer function as a mirror lock, bracketed the exposure around a few shutter rates, and got lucky.


    Posted by jordanh at 5:30 PM | Comments (12) | TrackBack |

    Main > Photoblog

    April 22, 2005

    A Camel's View on Giza

    View in Photoblog

    Starting in November of last year I set off from Minneapolis to Hyderabad, India to help co-ordinate a project for my employer. It was the first time that I learned the around-the-world fare-class ticket is often cheaper than a round-trip fare as long as you make two twenty-four hour stays: one in Europe and and one in Asia. When I was asked if I would make this "sacrifice" in order to save money for the company, I jumped at the chance.

    Taking personal vacation time and counting on acquaintances, I made my way around the world via New York, Amsterdam, Cairo, several cities in India, Kuala Lumpur, and Tokyo. I've always been the type to seize an opportunity and run with it until I am out of breath and I feel I did a good job this time of running until there wasn't any more earth to cover.

    I chose to introduce the trip with this photo as this was really the first time I realized, as I was sitting on a rented horse with a name I couldn't pronounce, that I really was a long way from anything I had ever seen before.

    It was very strange seeing the pyramids for the first time. It was as if something ordinary, like a toy from your childhood or an icon on your desktop, suddenly grew into the size of the mountain and rumbled, "yes, I really am take the bloody picture."


    Posted by jordanh at 7:34 PM | Comments (5) | TrackBack |

    Main > Photoblog

    Saddest India

    View in Photoblog

    The first entry into the photoblog! Choices...choices...

    For the life of me, I cannot remember why the words "Saddest India" popped into my head while I was taking this photo. I saw this basket as we were crossing the bridge over the artificial lake at Brindavan Gardens in the State of Karnataka and that is what popped in my mind. If I really think about it, I think it was just because I was fed up with the litter everywhere.

    CameraKonica Minolta 7d
    LensMinolta 50mm f/1.4
    Shutter / Aperture1/160s / f/2.2

    When I post-processed this, I reduced the saturation by about 40% in order to remove the attention from the foliage and draw it towards the basket and the rocks.


    Posted by jordanh at 1:31 AM | Comments (9) | TrackBack |

    Main > Software > putmarks

    April 21, 2005


    What is putmarks?

    putmarks is a lightweight solution for use with an XBEL bookmark synchronizing package such as the wonderful "Bookmarks Synchronizer" Firefox extension by Torisugari; both pieces of software I use for synchronizing my bookmarks between home and school everyday.

    putmarks functions as the remote end for a book marks synchronizer in that it accepts HTTP GET and PUT requests, reads and writes an xbel.xml file, and also keeps a log of all transations. It is very light-weight and requires nothing more than a PHP-enabled web-server to operate.

    Latest release:

    Version Date Filename README
    1.1 2/9/2005 putmarks-1.1.tar.gz README

    Latest, and other releases:

    Version Date Filename README
    1.1 2/9/2005 putmarks-1.1.tar.gz README
    1.0 11/8/2004 putmarks-1.0.tar.gz README

    Posted by jordanh at 5:07 PM | Comments (1) | TrackBack |

    Main > Software > jFlash


    What is jFlash?

    jFlash is a multilingual, web-based flashcard system based on open web standards, PHP, and XML. It consists of two principal software modules:

    1. A PHP system for indexing and delivering flashcard content.
    2. A browser-neutral Javascript application that parses out and presents a set flashcards represented in XML.

    What is it good for?

    jFlash is useful when you want to memorize something, and perhaps share the ability to memorize things with other people over the web. In addition, jFlash is language neutral since its content is presented in UTF-8, so theoretically you could use jFlash to drill anything from Arabic airports to zoo names in Tamil.

    Who is using jFlash?

    A number of learners around the globe and about 15 students in a University of Minnesota Korean class.

    Please let me know if you find my software useful and I'll add a link to your jFlash content here if you wish!

    You may view my live jFlash installation here.

    What do I need to run jFlash?

    jFlash is a server-side web application, so you must at present have a PHP-enabled web server. Other requirements and features can be read in jFlash's README file.

    Latest release:

    Version Date Filename Change Log README TODO
    1.6 3/26/2006 jFlash-1.6.tar.gz CHANGELOG README TODO

    Latest, and other releases:

    Version Date Filename Change Log README TODO
    1.0 2/5/2004 jFlash-1.0.tar.gz CHANGELOG README TODO
    1.5 11/20/2005 jFlash-1.5.tar.gz CHANGELOG README TODO
    1.6 3/26/2006 jFlash-1.6.tar.gz CHANGELOG README TODO

    Posted by jordanh at 4:51 PM | Comments (2) | TrackBack |

    Main > Software > euc2html


    euc2html is a simple application to convert any double-byte Japanese (and perhaps Chinese/Korean) EUC-encoded characters to HTML/4.0 Unicode entities. It operates using stdin/stdout only, so it is useful for batch updating Web sites, content, etc.

    Sadly, I haven't needed to use this software for anything since its initial release. It would have been nice to add bi-directional processing and (S/)JIS support...this software is now more-or-less supplied for those who are looking for a quick fix like this guy.

    Latest release:

    Version Date Filename Change Log README TODO
    1.01 12/1/2001 euc2html-1.01.tar.gz CHANGELOG README N/A

    Latest, and other releases:

    Version Date Filename Change Log README TODO
    1.01 12/1/2001 euc2html-1.01.tar.gz CHANGELOG README N/A

    Posted by jordanh at 4:17 PM | Comments (0) | TrackBack |