• Eighteen Years An Outback Man

    Posted on by Don

    Just thought I’d check in with a Subaru update: the engine is shot, there’s nothing short of a new engine that can fix it and a new engine is not worth doing, so I’m scrapping the car. The towing company will actually donate it to a local (Saranac Lake) fire company, and I get a tax write-off — I just have to wait for my new, duplicate title to come from Harrisburg since I lost the original, probably years ago.

    Anne and I were talking about cutting back to having only one car between us, so for now we will not be replacing the Outback, though our original plan was to get rid of her aging Mazda and keep the Outback, so our situation is a bit fluid, and we may end up getting a replacement for the Mazda in the foreseeable, though probably not the immediate, future.

    The question then becomes: what kind of new car? I have had an Outback for about 18 years at this point; the first one lasted 10 years and almost 200,000 miles, while the second did eight years and only 170,000 miles. I suppose I’d consider another Subaru if we could find a used one for a decent price — it still is pretty much the only game in town if you want a 4-wheel-drive station wagon — but the problems I had with the second one were depressingly familiar, almost at the exact same mileage as the first, and though I know every old car will have problems — and I have trouble imagining myself in something that isn’t a 4WD station wagon — I think I’m a little tired of Subaru right now. I guess we have to do a bit of research.


  • Vacation End… Or Is It?

    Posted on by Don

    Today was the last day of our Adirondacks vacation with Anne’s family; we got up early this morning, cleaned the cabin, said our goodbyes and took off in the rain, the only rainy day of the trip. We (Anne and I) got as far as Ray Brook NY, midway between Saranac Lake and Lake Placid — in other words, we’d just barely started our homeward journey — when the car made a “clunk” sound and died. I had just enough presence of mind, and momentum, to pull into a parking space on the side of the road, in what turned out to be the local Post Office.

    Long story short: my timing belt snapped, and there was no oil in the car. I have no idea which came first but both are bad, like possibly “car needs a new engine, which really means I need a new car” bad. We’ll find out Monday, when we also are going to rent a car in Plattsburgh, so we’re here in Saranac Lake until then.


  • Live And Learn

    Posted on by Don

    I’ve had trouble recently with using my email here at donkelly.net: some — not all, but some — networks wouldn’t communicate with mine, emails couldn’t be exchanged, and looking into why that was so, at say, SDF.org I found that they couldn’t even resolve my domain. The domain always resolved on my home computer though, so some DNS was working somehow.

    But my laptop generally uses the DNS server on whatever wifi it’s connected to, and now, connecting here on Rainbow Lake, whatever DNS server they use wouldn’t resolve my domain — which I took to mean uh oh, there really is a problem with my setup and not just at SDF or whatever.

    I checked my DNS info using third party websites and found that here were some major discrepancies — there were four nameservers listed rather than two, and two of them didn’t work. Turns out the original ones had been retired (by my service provider) but my system hadn’t been updated, and the broken servers were the retired originals, which were the only ones listed in my site’s configuration — I have no idea where/how the correct nameservers got listed. I went in and removed the bad servers, added the good ones to my configuration, gave it a few hours, and now even the formerly broken emails seem to work.

    I could have, and should have, done something about this months ago.


  • Just Checking In

    Posted on by Don
    lake and trees
    Looking out over the lake from the porch.

    Fourth of July, third day of vacation, a bit of a mellow day after yesterday’s hike. Anne and I got up early and went kayaking with Lorraine, Laura and Marie, and we might do a short walk on our dirt road soon, but we just finished lunch and the ladies are carding and spinning wool, and I’m just sitting here watching the lake and trying not to nap…


  • Wharton Esherick Museum

    Posted on by Don

    More on this at another time, but we went to the Wharton Esherick Museum outside Paoli today. Tours by appointment only, we went with Lorraine and Ray and their friends Rob and Barb, and think that this was the coolest home I have ever been inside. (We were only allowed to take photos out-of-doors, sorry.) Afterward we went to Sly Fox nearby for lunch. Another awesome day, even if my entire body still hurts from yesterday.


  • A Long Day!

    Posted on by Don

    I took no photos (whoops!), but yesterday I rode the Rothrock/Tussey Mountain IMBA epic with Renee, as part of our training for Wilderness 101. I was totally whooped by the end, but it was an awesome day:

    The only thing I would add to this is that, though we didn’t have too much trouble with it, we followed this course using a phone app, and speaking now from experience I cannot recommend doing that.


  • Scenes Inside The Lock Tender’s House

    Posted on by Don

    What a fun afternoon! I’d arranged to put in some volunteer time today with the D&L Canal people, so I took off down the towpath just after eleven, on my Iguana, to do some cleanup work inside the Lock Tender’s House at Hugh Moore Park. I’d forgotten how fast and fun the Iguana was on the towpath, but before long I was just flying along effortlessly, and was at the Canal Museum by 12:00. Meet up with archivist Martha, and then we go up to the Lock Tender’s house itself, a place I’d been many times but never inside.

    Then came the  “work” part, mostly vacuuming and dusting, getting the rooms ready for the season opening, but even that was interesting, since I was on the other side of the “do not enter” chain, handling stuff the public can only look at from afar. Actually, the house is not that old, having been rebuilt after a fire in 1928 (possibly an arson job from revenge-minded bootleggers, or so I learned today), and while some of the furniture was obviously ancient and worn, some items in the parlor, the room I mostly worked in, could have easily been mates of things in our living room right now — I’m looking at you, hurricane lantern…

    Anyway, here are a bunch of photos I took inside the house.


  • Stop, Look Around

    Posted on by Don

    Wet day here, and its also a bit of a rest day, waiting for the oven repair man to show up. So, I’m off the bike for the day, and just in time because I’ve been feeling tired. Tomorrow I’ll be riding the towpath (volunteer work day at the Canal Museum), Thursday I’m meeting Renee out in State College to do some of the W101 course, Friday we’re going to the Wharton Esherick Museum, and then this weekend we go off for a week in the Adirondacks! Whew…

    This weekend was a blur. Anne’s mom stayed with us from Thursday, the night of Anne’s concert — by the way, Anne is in a new orchestra, better than the last one IMHO but with the same playful spirit — through Saturday (when we went to a memorial service, and Marie got a ride home from there with Anne’s sister Lorraine). There were many people we knew in the concert audience, including Lorraine and Ray with their grandkids Jonah and Quinn, Toby and Erika with Josiah, Donna and John, and many people from the neighborhood. Afterward, we sat on the porch and sampled our new beer (the Two Hearted Ale clone — verdict: delicious) with John and Donna.

    (By the way, I got in a short Towpath ride while Anne was picking up her mom. I only went to the boat club and back, but I was trying to push my heart rate, and ended up with a 15 mph average, better than any towpath ride this year.)

    Friday was a quiet day, just hanging out, but I did get in a Sals ride, one where I felt pretty good on the trail.

    Saturday was the memorial service for Marilyn, the mother of Anne’s sister-in-law Laura. She’d passed away just recently, and she’d been ill for a long while before that, but before her illness she’d been an incredible woman: vibrant, warm and loving, and a real force of nature and positive force in every life she touched; those were the memories that we celebrated. Afterwards we had a lunch at Joe and Laura’s with much family about, and many friends.

    We went out that evening to catch up for a bit with Doug and Lori.

    Sunday was the Steel City Enduro at Sals, and I went up to volunteer. I ended up running the start, no clue what I was doing but I think everyone survived, then I walked the course and did a little race-course cleanup after the riders went through. I was out of there by noon or so, so I could clean up and stop by John and Donna’s place for a picnic with their family. (Anne was off dealing with other mom-errands.)

    Yesterday I woke up really tired, and it took me a while to actually be awake. Went for a Sals ride anyway, felt pretty good, then came home and took an hour-long nap…


  • Befuddle Oneself Methodically

    I’ve been thinking a lot about the economic impact of the towpath lately, and have been looking to the Great Allegheny Passage as a model, where many food and lodging places have popped up to cater to the cycle touring crowd.  I know that the D&L Corridor people are also looking at various businesses and how the towpaths might impact them, but I believe that they are looking at it from a county-wide perspective, when they should probably really be looking at impact within a few blocks of the path, and or at least within about a mile of the river — would you decide to take a fully loaded touring bike miles out of your way, and probably up some hill to get away from the river, just for say, lunch, if you didn’t absolutely have to? So, that got me thinking about the question: what restaurants, hotels, bike shops, and other amenities are actually within a mile of the relevant sections of the  Delaware and Lehigh Rivers?

    (This was a good first approximation, but it’s surely a naive way of looking at the problem, since there are many places within a mile of the river as the crow flies, that are not actually within a mile, or maybe even many miles, of anyplace accessible from the towpath — and places that will see towpath business will need to be located within a matter of blocks, not miles, from towpath access points. But I realized all that later as I thought more about the overall situation, and my first analysis of towpath business prospects was what I worked on first.)

    The way I looked at it, my original problem broke down into two parts. First, what is the region within one mile (or whatever distance) from the river, and second, what are the amenities within that region? The first part was fairly straightforward, but the second, which looked like it would involve some kind of Google Maps search — and eventually it did — turned out to be more complicated than I thought…

    Partial map of Lehigh County and River
    Nifty QGIS: Five minutes of work to get the buffer zone.

    I used QGIS to deal with the first part. I took as my reference some Pennsylvania aerial photos, plus a property map of Lehigh County, and created a new line vector (in a projection that uses feet as a unit of measure), following what looked like the middle of the Lehigh River from about Laurys Station to just past Bethlehem, and then I used the “Create Buffer” geoprocessing tool to create a vector polygon buffer region around that section of river, whose distance from my line vector was 5280 feet, in other words, one mile. That part worked great, but what to do with my buffer region?

    My first thought was to take the buffer vector and export it to a KML file, import that KML file into a custom Google Map (using Google’s “My Maps” personal map creation/editing feature), and then “do something” with it. That all worked great as well, up until the “do something” part — the KML file, and the personal map, were not much use when it came to customizing a map search.

    I did find online, however, that there were some things you could do with polygonal regions, and testing locations (such as the ones returned from search results) to see if they fell within those regions, using the Google Maps API. This added two new steps: first I had to re-export my buffer region, this time as a GeoJSON file because that was what the API would accept, and I also had to sign up for an API key from Google Maps. Both of these were also straightforward and easy to do.

    The final step was to put it all together: make a web page, and (with some javascript), load and draw the GeoJSON file, run a search (for restaurants, in my experimental code), and then find and display results that fell within my region. Code code code, give it a try… nothing. I was able to load the file and see my region, but no place results would be displayed.

    Turns out, there is more than one Polygon type in the API, and the one created by loading a GeoJSON file is different than the one you can test locations against; I would have to convert my polygon from one form to another. (This seemed to me a bit much, especially since I thought I should have been able to load the original KML file and it would “just work.” After all, isn’t KML a Google thing, and kind of a standard?) No matter, the conversion process from one polygon to the other looked as straightforward as every other step so far, so I just added it to the end of the task chain. Code code code, give it a try… nothing, and here is where it started to get really frustrating.

    I couldn’t for the life of me figure out what was going wrong, it looked like I did things exactly the way I was supposed to but my new, converted polygon could not be made, and it looked like the original polygon actually was empty, even though it was drawn on screen. I eventually used a callback routine from the GeoJSON loading function to get the polygon coordinates, and for some reason that worked.

    That gave me my clue: the “some reason” was that the callback was not executed until after the file was done loading, so the conversion routine had something — a non-empty original polygon — to work with, while in my original code the rest of the script wouldn’t wait for the file to finish loading before continuing, so there really was nothing to work with yet when I tried to do the conversion. That took three paragraphs to write, but more than a day to work out…

    I didn’t really like my solution: if you’re forced to use callbacks like that, you end up going down the rabbit hole, callback after callback after callback, just to get some semblance of sequential execution. (Meantime, I found that some methods did not suffer from these kinds of problems, they seemed to wait for the data to load before trying to work on it. Strangely enough, all the simple API examples I found at Google used these methods instead of the one I needed.) Eventually I set up a wrapper function to hide the messy details and just get me my goddamned polygon from the goddamned GeoJSON file.

    Anyway, here is my demo map:

    And here’s my script. Most of this is based on Google Maps API examples, but the function getBuffer() loads the data, and createBufferPolygon() is the wrapper that creates the polygon object:

      var myNewMap;        // the google map
      var myPlaceService;  // object for google places api
      var myBufferPoly;    // the polygon that holds the buffer region
      var myInfoWindow;    // info window for the selected place
          
      // the callback function from loading the API, where everything actually happens
      function initMap() {
        myNewMap = new google.maps.Map(document.getElementById('map'), {
          center: {lat: 40.672628, lng: -75.422778 },
          mapTypeId: google.maps.MapTypeId.TERRAIN,
          zoom: 11
        });
            
        var bikeLayer = new google.maps.BicyclingLayer();
        bikeLayer.setMap(myNewMap);
        myBufferPoly = createBufferPolygon(
          'lbuf2.geojson',
          'lehigh',
          myNewMap,
          true,
          'green'
        );
        myPlaceService = new google.maps.places.PlacesService(myNewMap);
        myInfoWindow = new google.maps.InfoWindow();
    
        getSearch();
      }
          
      // this is the wrapper function, which calls the function that loads the GeoJSON file
      // after creating the polygon to hold the buffer region 
      function createBufferPolygon(url, featureName, map, isVisible, polyFillColor) {
        var bufPoly = new google.maps.Polygon({
          map: map,
          clickable: false,
          visible: isVisible,
          fillColor: polyFillColor
        });
        getBuffer(url, featureName, bufPoly);
        return bufPoly;
      }
          
      // this function loads a GeoJSON file containing a named polygon
      // then adds it to the given polygon object
      function getBuffer(url, featureName, poly) {
        var bufGeom;
        var bufferData = new google.maps.Data();
        bufferData.loadGeoJson(
          url, 
          {idPropertyName: 'name'},
          function(featarr) {
            bufGeom = bufferData.getFeatureById(featureName).getGeometry();
            poly.setPaths(bufGeom.getAt(0).getArray());
          });
      }
          
      // finds all restaurants within 15km of a certain location 
      function getSearch() {
        var request = {
          location: {lat: 40.703117, lng: -75.416561 },
          radius: 15000,
          keyword: 'restaurant'
        };
        myPlaceService.radarSearch(request, displayResults);
       }
          
        // displays search results that fall within the buffer region
        function displayResults(searchResults, searchStatus) {
          if (searchStatus !== google.maps.places.PlacesServiceStatus.OK) {
            console.error("getSearch error: " + searchStatus);
            return;
          }
          for (var i=0, result; result=searchResults[i]; ++i) {
            if (google.maps.geometry.poly.containsLocation(
              result.geometry.location, myBufferPoly)) {
                addMarker(result);
              }
            }
          }
          
      // adds marker for selected places
      function addMarker(place) {
        var marker = new google.maps.Marker({
          map: myNewMap,
          position: place.geometry.location,
          icon: {
            url: 'http://maps.gstatic.com/mapfiles/circle.png',
            anchor: new google.maps.Point(10, 10),
            scaledSize: new google.maps.Size(10, 17)
          }
        });    
        google.maps.event.addListener(marker, 'click', function() {
        myPlaceService.getDetails(place, function(result, status) {
          if (status !== google.maps.places.PlacesServiceStatus.OK) {
            console.error(status);
            return;
          }
          myInfoWindow.setContent(result.name);
          myInfoWindow.open(map, marker);
          });
        });   
      }
    

    That’s a lot of work for something that solves the wrong problem! My next look at this will likely just involve finding the access points, and doing Google searches near each one — soooo much less elegant…


  • Cutting Edge, Trying To Get There

    I use Linux Mint, which is based on Ubuntu, specifically a less-than-current version of Ubuntu for whatever the current version of Mint is. The Ubuntu distribution is in its turn made up of software packages that do not get major upgrades (except for, say, security fixes) within any specific version, so by the time I get the “latest” Mint, the actual programs and applications are actually months, if not years out of date. This drives me nuts sometimes, especially when I run across a bug, Google it and find that it had been fixed last year but it’s not available to me, at least through the official Mint channels.

    In situations like that, you can do things the old-fashioned way (download the source and build it yourself) or you could find a pre-packaged installer file with the latest version, but these now knock you off any available “upgrade path” for that application. The better way is to find another channel from which to receive the software packages, one that is more up-to-date than the official ones.

    (By the way, these channels are called “repositories,” and they are just online sources for the software packages. The packages themselves are compressed bundles of files that contain the software, along with information about what other software, specifically what versions of other software, the package needs, which are called its dependencies. The “package management system” reads these files, figures out what else needs upgrading — or if it can be upgraded — and takes care of upgrading the software and its dependencies from the lists kept in the repositories that it knows about.)

    It’s somewhat frowned upon, since “unofficial” repositories may be malware, or even just poorly made, but I’ve added a few of them to my lists of software sources. I’ve done it to get the latest available Libre Office, and also the latest version of R, for example, and yesterday I decided to do the same with my GIS software, using what is supposed to be a very useful, up-to-the-minute repository.

    Well, it was a little more complicated than that, since the version of GRASS in the repository is 7.0, and the version of QGIS was 2.8, and it turns out that the GRASS plug-in for QGIS 2.8 was broken by the newest versions of GRASS, which is bad because a good portion of QGIS’s advanced functionality comes from its ability to work with GRASS. I’d upgraded myself right out of a useful program… I did a bit of Googling, and found that later versions of QGIS had the problem resolved — wait, later versions?

    It turns out that this cutting edge repository was also not the latest, and I had to get the latest directly from a repository maintained by the makers of QGIS. I feel like I built myself a house of cards, QGIS repository on top of unofficial repository on top of Mint, but at least I now have the software I want.