Friday, September 19, 2014

A software developer goes to Nome

The Town



In the evening of August 22, I stepped off a plane onto the tarmac of the Nome airport. A life milestone was reached - after many years of dreaming of it, I was finally in Alaska. What brought me, a software developer, to Nome - a place known more for gold and sled dogs than technology?



The purpose of my visit had nothing to do with technology, which was a welcome break from my daily routine. I was the guest of my colleagues David Anderson and Paul Juergens, biologists for The Peregrine Fund. They were there to research Gyrfalcons. I had been invited to share the Alaska experience and photograph their efforts.


Nome is a town of about 3,500 people on the Seward Peninsula. Access is possible only by air or water. This isolation and distance from manufacturing results in high prices - more than $4 for a dozen eggs, $5 for a glass of orange juice at the cafe, and gas is over $6 per gallon.  However, there are three roads extending from Nome out into the tundra, and these are key to the research project.  The Teller, Council and Kougarok roads lead into some of the most unique and beautiful country I have ever seen.


It was interesting to me to drive through areas I had learned about in history classes. The road to Safety Sound is the final leg of the Iditarod sled dog race.  We passed by the winter trail markers used in the race and other winter travel, which are wooden tripods with tall poles to ensure visibility in deep snow.  The same area was the site of a late nineteenth-century gold rush on the beaches of the Bering Sea.




The Tundra


Someone once told me that tundra is flat. That isn’t true around Nome. The hills, of varying steepness, rolled on seemingly without end into the Seward Peninsula. This was the first time I had walked on tundra. I had heard it was spongy and difficult to walk on. In many spots, it was indeed. It was unique to watch what appeared to be solid ground give way under my boots, with water rushing in around the toes. After stepping forward, the plant-covered ground rebounded, erasing my boot marks.  


From a distance, the tundra looks barren and featureless. A closer look, though, reveals a remarkable diversity of plant life. Multiple types of berries thrive there, including blueberries harvested by locals and visitors alike. Though it was late in the summer, a few flowers were visible.


The vast wetlands around Safety Sound, where the tundra meets the Bering Sea, appear to be an ideal haven for a multitude of bird species. Unfortunately, during the time of our trip, birds were sparse.  That meant it would take a lot more effort to locate the Gyrfalcons.




The Work


My work as a software developer generally involves sitting long hours at a computer in a comfortable chair, with coffee or other preferred drink easily at hand. Usually, I can adjust the air temperature to whatever I want. Whenever I need to, I can take a break to stretch my legs.  It didn’t take long to discover that biologists’ field work is quite different.


Paul and David search for Gyrfalcons
Starting early in the morning, sometimes with breakfast being whatever could be grabbed and eaten in the truck, we were driving. Each of the three roads took us through different terrain and types of habitat, so each was explored frequently.  One hope had been to locate a concentration of prey species, and therefore Gyrfalcons, on the coast. Evidently due to the mild weather, the passerines and shorebirds had not yet gathered. So, our days were long, filled with driving and checking every dot that might be a falcon.  


The first two days we found Gyrfalcons. While I have seen gyrfalcons used for falconry and education, this was my first opportunity to see them in the wild. Their size, speed and maneuverability is impressive.  The first falcon sighted was nearly captured, but evaded at the last moment. After that, things became more difficult.  The closest encounter we had was when driving out one morning. A Gyrfalcon streaked off the hill above us, crossed our windshield less than 25 yards away, then disappeared into a brushy river channel.


Gyrfalcons often perch on a high point and use their excellent eyesight to spot prey far in the distance. Much time was spent with binoculars and spotting scope inspecting bumps on the skyline as we passed through areas with rocky outcroppings, or gray or white spots on the hills. Some areas have a lot of vertical rocks the same size and shape as a Gyrfalcon. These frequently resulted in the truck coming to an abrupt halt and three sets of binoculars going up. Those rocks earned the name of “gyrrockens” for their annoying resemblance to the birds we were searching for.



The Wildlife


One of my main reasons for wanting for so many years to visit Alaska is the wildlife.  This trip did not disappoint.  Less than 10 minutes outside of town on the first day, two muskox were visible from the road. We saw more muskox throughout the trip.


We saw six species of raptors. In addition to Gyrfalcons, we saw Peregrine Falcons, Northern Harriers, Golden Eagles, Merlins and Rough-legged Hawks. Once we watched a Northern Harrier flush out several ptarmigan, their white wings flickering across the tundra as they tried to reach cover.
Reindeer herd on the Teller road.


Though we never encountered a large concentration of birds, we saw Pintails, lesser Canada Geese, swans, Wheatears, curlews, Sandhill Cranes, jaegers, ravens, and of course gulls.


We saw herds of reindeer many times. They had no fear of us. One day, we had to wait for them to move off the road four times. Their gait is quite different from the deer and elk I am familiar with at home. Their hind hooves kicked out to the sides as they trotted up the road, and they grunted loudly as they finally moved off the road into the tundra so we could pass.


At the time of our trip, salmon were in the rivers to spawn. We saw coho (silver), sockeye, pink, and chum salmon. The sockeyes’ bright red and green coloration was especially memorable. Due to the focus on finding falcons, I had little time to fish. During one of the few and brief roadside breaks, I managed to catch my first silver salmon. It had been in fresh water a long time, and was deep red from kype to tail.


We saw this grizzly bear far up one of the roads out of Nome.
One of the highlights of the trip for me was seeing a grizzly bear. The bear came down a small hill not far off the road, and once it was able to catch our scent, moved quickly away from us. It wasn’t a large bear, but it was the first grizzly I have seen outside of Yellowstone National Park.


By the end of a week, I was ready to return home, to seemingly cheap $3.88 gas and my somewhat predictable daily schedule of computer work. Before I ever got on the plane, though, I was already planning my return to Alaska.

Tuesday, April 30, 2013

Converting Photoshop actions into JavaScript

I have a collection of complex Photoshop actions that I have built.  Now, I am needing to move from actions to scripting to accomplish new tasks in Photoshop.  Since I didn't want to rebuild everything as new scripts, I searched for a tool to recycle my existing actions.

PS-Scripts.com provided a link to a solution.

Running that script in Photoshop CS5 (File>Scripts>Browse) creates .jsx files that replicate the original .atn action files. Now, I can copy relevant sections of JavaScript out and utilize them in my new scripts.

Thanks to xbytor for sharing the solution.

Saturday, January 5, 2013

Problems with Adobe CS2 software activation

I am reconfiguring my computer and need to run my old Adobe Creative Suite 2 Premium software.  After spending time installing it, I received an error that it could not be activated.  A brief search turned up the fact that Adobe recently shut off their activation server for this old version. 

They provided a page with links to download a version of CS2 that bypasses the need for the activation server, but it appears to not provide all the software in CS2 Premium.  I'm not the first to have this issue: http://forums.adobe.com/thread/1114930?tstart=0

I started a separate discussion for Mac CS2 Premium at http://forums.adobe.com/thread/1129934?tstart=30

Thursday, December 27, 2012

Solving erratic mouse behavior in Ubuntu 12.10 inside VirtualBox

My Ubuntu installation within a VirtualBox VM has been nearly unusable due to random, erratic behavior of the mouse cursor. Problems have included:
  •  a click near the middle of the screen activates a button in the launcher on the left side
  •  occasional hits on the exit button of a window, though the cursor was far from it
  •  inability to drag to select text; the selection would jump upward while I was trying to drag down
  •  other dragging operations would create unpredictable and unwanted results

I did research and found these two references:
http://askubuntu.com/questions/202789/cursor-jumps-when-moving-and-some-other-times
https://forums.virtualbox.org/viewtopic.php?f=3&t=51727&start=45

Based on these, I typed the following into the terminal.
sudo apt-add-repository ppa:a7x/bug1041063
sudo apt-get update
sudo apt-get install xserver-xorg-core

My initial tests show this to be a successful fix for the problems listed above.

Monday, November 5, 2012

Dell Optiplex 780 noise after upgrading to Windows 7

I just finished upgrading my Dell Optiplex 780 to Windows 7 64-bit.  The tower was producing a very irritating high-pitched noise after this upgrade.  After a bit of searching, I found this discussion that seemed to match my problem:
http://en.community.dell.com/support-forums/desktop/f/3514/p/19292677/19546282.aspx

I tested the BIOS setting change for C State Control suggested by carl.hobbs and petewitt.  It solved the problem instantly.


Thursday, October 11, 2012

Drupal REST process update

I posted earlier about the problems I have had integrating Drupal 7 REST with an external site.  Since my last post on the topic,  it has been working flawlessly.

Today, though, I upgraded the Drupal site to use Services 7.x-3.2, and configured the site to require TLS for all traffic.

The REST connection died with no explanation.

After an hour of stressful debugging, I found two separate causes:

1. The upgrade of the Services module reset the REST resources settings. I had to re-enable parsing of application/x-www-form-urlencoded  and the node resource. http://stackoverflow.com/questions/8535820/drupal-login-via-rest-server

2. Requiring all traffic to route through https (TLS) killed the PHP cURL methods.  For a debugging quick fix, adding curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); solved the problem. For a better solution, see http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/

Thursday, August 23, 2012

Google Maps API 3 inside jQuery Accordion

I am working on a web page that utilizes multiple JS libraries including jQuery and Google Maps. My map is inside a jQuery Accordion pane, and has been presenting a problem with partial rendering as described on a StackOverflow topic. In my case, the code was configured to initialize the map at the time of the first click on the accordion panel that contained the map. It worked fine, unless the user switched to a different pane then tried to return to the map. Then, it would only draw approximately 1/4 of the map canvas, with the remainder being gray.

In my research, calling google.maps.event.trigger(map, "resize"); was a consistent suggestion, but the first few locations I tried calling it did not work. I finally solved the problem by binding the trigger to the click event of the jQuery Accordion pane, based on an example at essentialwebconcepts.com.

My code:
function triggerMapResize()
    {
    google.maps.event.trigger(map, "resize");
    }

jQuery(document).ready(function() {
    jQuery("#the-accordion").bind('accordionchange', function(event, ui) {
        if (ui.newContent.attr('id') == 'the-pane-id')
            {
            triggerMapResize();
            }
        });
    });
The only remaining problem is that the center of the map changes when the user returns to the map pane after looking at a different pane.  I started a topic on SO for this issue.

Update August 24:
Several changes were required to get this to work on all browsers including IE. IE failed upon page load when I was trying to initialize the map. Originally I was using window.onload = function () { initialize_map(); } but that resulted in a vague IE error.

I added code to capture the map's center LatLng when the user moves the mouse outside the map canvas, and more code to move the center to that point upon returning to the map.

          var map=null;
    var currMapCenter = null;

    jQuery(document).ready(function() {
    jQuery("#accordion").bind('accordionchange', function(event, ui) {
    if (ui.newContent.attr('id') == 'region-list')
    {
    if(map==null) {
    //first load; call map initialization
    initialize_map();
    }
    triggerMapResize();
    }
    });

    function initialize_map() {
   
    //do initialization here...
   
    google.maps.event.addListener(map, 'mouseout', function() {
    currMapCenter=map.getCenter();
    });
    }

    function triggerMapResize() {
    google.maps.event.trigger(map, "resize");
    map.setCenter(currMapCenter);
    }

A side note about another problem I ran across in IE8 that has limited documentation online: When creating LatLng arrays, double-check syntax to be sure there is no comma after the final element. While the map looked perfect in standards-compliant browsers, in IE8 each polygon had a segment extending up to near the North Pole.

var polygonPoints= [
        new google.maps.LatLng(24.3250983277945,-79.4028109345145),
        new google.maps.LatLng(48.9377507851552,-142.984008088915),
        new google.maps.LatLng(37.9247004907078,-131.891417410329),
        new google.maps.LatLng(29.8055038628199,-122.143142289543),
        new google.maps.LatLng(21.6909424687438,-114.135809333967),
        new google.maps.LatLng(24.3250983277945,-79.4028109345145),
        ];

This mistake cost me an hour of confusion. Finally I found a discussion mentioning trailing commas with Google Maps in Internet Explorer and discovered the improper extra comma at the end of each array.   It was caused by creating the LatLng object using concatenation in Excel without manually trimming the last value.