• Updates on Various Things

    Just kicking back this morning, before going with Anne over to the Bike Co-op for the afternoon…

    Reading: I just finished N.K. Jemisin’s debut novel, The Hundred Thousand Kingdoms. I took to it well enough at the beginning, but it actually became a chore to read: I put it down for a week, and read the last third in two sittings, closing the book with a sense of relief yesterday. Strange because I really liked her award-winning “Broken Earth” trilogy, and the style and voice were very similar; Anne said that maybe the author worked a few bugs out of her writing between her debut and the trilogy, and that may be so but I didn’t really see it. All I can say is that I really recommend the trilogy, but don’t feel the same about this one. I think it’s also first of two, but it’ll be a while before I read the sequel.

    Two Hours Before The Mast: I did my usual Wednesday volunteering at the Canal Museum yesterday. The canal boat is now in dry-dock for the winter, and Scott E is trying to get as much maintenance done on it (especially things like painting) in the nicer weather as he can, so yesterday I helped prep the deck for staining. Mostly this meant sanding, and the sanding I did was mostly “trim work” with a small vibrating sander, near fixtures and in corners where the bigger unit couldn’t fit — I did this for about two hours until the little sander overheated and turned off.  I thought of it as “swabbing the deck,” but showed remarkable restraint and did not talk like a pirate.

    Mapping: The routing website is now essentially — well, not done done, but the functionality is pretty complete. It routes, with a few glitches (but I added error handling so it doesn’t just choke without apologizing), it modifies routes based on user preferences for hills and visible recommended streets, and it can export the route as GPX; the final steps for website usability are to add printing capabilities for the directions, and add some explanatory content. (Finishing the job means building the real database — and finding a place to put it online.) I’m pretty happy with how this came out so far, it’s actually fun to play with.

    Listening: Not to eMusic, that’s for sure. I’ve used them for years to purchase music, and once they were both a good deal at a flat 49 cents a song (with no DRM: download it and it’s yours), and a good source for whatever I was looking for. Then in about 2010, they bought into some of the more mainstream catalogs, changing their price structure — more popular stuff became more expensive, some songs required you to buy the entire album — to accommodate the new sources. This actually  drove away many of the better and more obscure labels, leaving eMusic no better than any other generic source, at least in terms of selection. Now the major labels are gone again (I think), and the catalogs are mostly things I don’t care about. So every month I pay $15, which gives me $17-$18 in credit to use or lose that month, and I hardly ever even check in anymore to see their new offerings — and whenever I go there to search for something specific, they don’t have it. It’s time to move on.

    On the Home Front: We are busy researching ovens, in preparation for our new purchase.


  • A Thanksgiving Miracle

    So, flash back to several days ago: Anne was cooking things in the oven, and they were just going …wrong: bread was burning, cakes were coming out uneven, the oven was just acting funny. A quick check with the thermometer and she confirmed that the oven’s thermostat was malfunctioning, and a look inside the oven showed one side wasn’t even firing. Our oven was on the fritz.

    Our oven was on the fritz, that is, three days or so before we hosted Thanksgiving. Maybe it’s just the thermostat, but the last time the repairman came out (to fix the thermostat if I remember correctly), he said we needed a new oven — if we even got a repairman out before the holiday we would probably not be able to get parts,  much less a new oven, in time. A turkey, a ham, many side dishes and pies and cakes, and 17 guests coming — what to do?

    Well, first we panicked, but then Anne did a bit of research and we decided to cook the turkey in the wood-fired outdoor oven — the wonky indoor one, with some supervision, would work well enough for the (pre-cooked) ham as well as those side dishes that couldn’t be repurposed to range-top cooking, and guests would bring plenty of their own food. The only real hit would be the extra work of starting and running the fire.

    This mostly fell to me, and was a two day process. We got up early Wednesday and I got a fire going, and fed it periodically during the day while doing other prep chores. This fire was just a pre-heat to get some temperature into the core thermal ballast; all we cooked on Wednesday was the pizza we had for dinner. A little measurement told us the whole turkey, with a pan big enough to cook it, wouldn’t fit in the oven, so Anne split the bird in half as part of the prep, while I got the fire going again Thursday morning. At around 900 degrees we put the bird in to brown, then we put it back in again when the temperature was down around 500. It cooked in just under two hours, and it came out fabulous. Everything else was awesome too, and the whole day was a fun success.

     


  • On The Bridge: One Step Forward, Two Steps Back

    Talk about hedonic adaptation! A week or so ago I was sure I was far from ever being able to route on my web map using pgRouting, then a triumphant breakthrough, and now here I am, annoyed that it’s not perfect…

    My first problem is a data issue, and a recurring one in my mapping and routing life: dealing with bridges. Once I got the routing to work, I started to customize it with a separate “get_cost” function, which deals with ascent and descent (other criteria are coming), and that worked fine. Then I noticed that the routes seemed a little off, like they were avoiding what I thought would be the optimal routes, the main one being that it would do a lot to avoid a certain section of Broad Street. That’s when I remembered: there are several bridges on that section, and rather than following the elevation of the bridge’s road surface, my elevation data followed the contours of the ground below it, leading to large ascents and descents along that section.

    To solve the immediate problem, I changed the ascent and descent to be zero for the section containing the bridge — close enough to the truth, for that short a span on a mostly flat road. That made the routes in the vicinity more sensible, but what to do about other bridges?

    I think I have three options: I can either find the actual elevation data for the top of the road surface (using a “digital surface model” rather than “digital elevation model” and probably using LIDAR rather than satellite radar data), or I can assume that the bridge has a mostly constant slope, and calculate the slope from elevations where it attaches to the ground, or I can save myself a lot of work and just say “they’re flat, or flat enough to make no difference,” and make all ascents and descents be zero for bridges. I am still thinking about this…

    The second problem is a little harder to figure out, since it involves the PostGIS routing function I got off the Internet: when the beginning and end points of the route are on the same segment of road (ie there are no intersections between them), the function fails. I don’t know enough about Postgres functions to be able to solve this, so I may have to either live with it for a while, and contact the person who wrote the function for some help.


  • Excelsior!

    I thought this would take so much longer… I have a web map designed and working, and I was able to add generic routing functionality to it (via the Leaflet Routing Machine plug-in). Here’s a screenshot:

     

    A screenshot from my web map showing a path around town, using the Leaflet Routing Machine and my PostGIS/pgRouting database.

    The actual routing engine on the server side is done with PostGIS/PgRouting, accessed through a PHP script — Leaflet Routing Machine does not normally work with PostGIS,  but I found another plug-in (called lrm-pgrouting), which included a PostGIS function and some Javascript, to add this functonality. Unfortunately, the unmodified lrm-pgrouting plug-in requires something called Geoserver (rather than just a plain old PHP script) to talk to PostGIS, but it was easy enough to modify the plug-in to use PHP, and writing the script itself was the easiest part of the whole thing.

    Once I got routing up and running, I came across a few problems, mostly with how the directions are displayed: the display only showed street names and distances — that is, no turn information — and, for wherever the route continues straight on the same road through an intersection, there is an unnecessary instruction to “go straight.” Both of these were due to errors in lrm-pgrouting which I managed to fix to my liking.

    So, success! But this is using a generic routing function, rather than the “climbing vs busy road vs recommended commuter routes” function I ultimately want to use, so there’s some room for improvement. I also think I may want to abandon the Leaflet Routing Machine and do the input and display on my own. Also also, all this stuff currently resides only on my laptop; I have to find a host that will let me run a PostGIS database (among other things). I still have some work to do.

     


  • Housecleaning

    The warm weather finally broke (again) with this recent rainy spell, let’s hope it lasts but for now it’s nice and cool…

    While we were in Pittsburgh I kind of got fed up with my phone sending me messages about memory use — it wasn’t really all that close to full, but it was getting closer every day, for no reason I could see, and the messages were getting more ominous. I had already moved as many apps as I could to the external drive, my photos, music etc, there should have been very little on the internal drive at all, much less enough to cause problems.  What gives?

    I started looking through the folders on the drive, Googling their names and trying to find what was going wrong. Turns out (among other things) that my photos were being stored several times on my phone, over a thousand photos, each a few megabytes, and while my regular photo storage is on the external drive, the backups were filling the problematic internal one. Several minor changes to the settings, turning off “cloudagent” or whatever, and I recovered a huge chunk of storage space. I was so happy I deleted a bunch of apps I don’t use, freeing up another chunk. The best part? They’re staying freed up.

    Meanwhile, back home on the laptop… my hard drive has two partitions: one large partition where my old system was, and another one that holds the root of my current system, which is smaller than the first partition but by no means small. Unfortunately, it was also constantly growing, and I was down to like 25 gigabytes — which sounds like a lot, but the disk is old and on the small side, and still it’s 350 gigs. I’m down to less than 10 percent usable space?

    Once again, it was the cloud. I’ve been putting it off for a while, but I knew that the problem was my Dropbox folder, which was huge and growing (photo backups from my phone), and things would be a lot better if that folder was on the bigger, emptier partition. This required some work — the Dropbox preferences program wasn’t working correctly, so I had to fix that first, then the move itself took a while — but in the end, the move was a success, and I freed about 25G on my main partition.

    That got me excited enough to look at what was on my auxiliary partition, maybe there was even more I could free up… I have my old system backed up on a network drive, but the old home folder (about 65G) was still there, and all the useful stuff had been moved over to the main partition already. I couldn’t bear to just erase it, so I moved it all over to the network drive (where there are now two full backups, but with two terabytes it’s a drop in the bucket) and now I have tons of free space — 190G of 350G total — on my drive.

    I know, the excitement is palpable…


  • Some Photos of Our Pittsburgh Trip

    We were out in Pittsburgh over the weekend; Anne and I went with Ben to her nephew Mike’s wedding. An awesome time (though exhausting), hanging and partying with Anne’s siblings and their kids. We drove up Friday morning, the wedding was Friday night, we went to Mattress Factory, an art museum, on Saturday, followed by a picnic at Anne’s brother Bill’s place, and drove home Sunday. Boom!

    So anyway, here are some of the pictures I took.


  • Getting Things Done

    I woke up — late — this morning, with a full day of tasks and errands I wanted to get to: I had a noontime ride planned with Ted B, a friend from back in Manalapan days, and I wanted to get to some computer stuff (mapping, among other things). I was thinking of mowing the lawn, I had some laundry to get done, and, since we’re heading to Pittsburgh for a wedding this weekend, I wanted to get my packing and other preparations for the trip done ahead of time. I have a simple to-do list I keep, a list of the day’s chores and errands, which I update whenever there’s enough to do that I might forget something, and it was all there.

    But life comes at you fast… When I came downstairs Anne said “I want to show you something,” and brought me around the back of the house, where the concrete wall near the basement was all moist — keep in mind, it hasn’t rained here in more than a week. Uh-oh, we’ve had an intermittent problem with the downstairs toilet running, leaky flapper or whatever, a DIY fix-up that would be addressed soon enough, but this now looked like we had a serious leak working its way though the floor and out. Anne called the plumber, and I canceled my ride — she had to take her Mom to the doctor, so I was now on “wait for the plumber” duty.

    I also looked over my to-do list. The planned yardwork was basically weed-whacking and mowing, but the grass hadn’t been doing much growing, and meantime something had been digging in the new mulch (covering the crocus bulbs) so I swapped mowing out for sprinkling cinnamon and cloves around the garden — the Internet says that keeps critters away, we’ll see. I did the same for other things on my list, paring down and swapping out a few things, and managed to get all the things done for today’s modified plan.

    (The plumber came, declared it was most likely condensation from the constantly-flowing toilet pipes, and replaced the flapper for us. We’ll have to keep an eye on it to see if the problem goes away, but I’m hoping.)

    One thing I had on that list was to look at some productivity software I downloaded, something called Task Coach. This is a task and time management tool, almost to the  point of being a lightweight project management tool, where tasks and subtasks can be added, organized, prioritized, assigned prerequisites, tracked, etc. It has a lot of really neat features, including a few I was looking for — for a friend — about a year ago: Lori M, another grade-school buddy, put out a request for recommendations for some to-do list software, which had to include (among other things) the ability to add notes at the project as well as the task level. The moment has long since come and gone to make any recommendations, but Task Coach has this and more. It’s really good, except…

    When I was a kid, allergies precluded me from doing the lawn work at home; my brothers got that job instead, and I was the one who took care of the swimming pool. This meant chlorinating the water daily, maintaining the pump and filter, cleaning out the skimmers and skimming leaves manually, and, most important but also most time consuming, vacuuming the pool. It was kind of a pain but really did not require that much effort.

    Then one year, my parents got a Polaris automatic pool vacuum, sort of like a Roomba for the pool. It would run constantly — it was almost hypnotic to watch, like a slow-moving aquatic creature foraging — and my vacuuming days were over. Sort of: I basically traded the vacuuming job for the one called “maintain the automatic vacuum,” cleaning it out, disentangling it when it got caught in things, and even vacuuming occasionally when the machine didn’t work well enough. In other words, my effort level did not actually get reduced with the coming of this “labor-saving device.”

    It’s something I always remembered, and often used as a good, and surprisingly apt, joke/parable over the years, especially at work. And now here I am, looking at the same situation: beneath a certain level of scale or effort, brute-force methods often work better than the more elegant solutions, and I find myself wondering if I’ll spend more time curating my task lists with Task Coach than I actually save by being organized — Task Coach looks like it would only really shine when it’s managing more complicated projects than my daily chores. We shall see.

    In the meantime, I still have my simple, ever-growing text file. Whenever I feel the need, I start my morning (or end my evening) by writing up, at the top of the file, a list of the tasks that need doing that day. Then I can run through the checklist, marking them done as I go. I can add or remove tasks as it occurs to me to, and if I don’t get everything done — no big deal, I can reschedule it, or not, as I see fit. The file sits there on my desktop where I can see it whenever I go to browse — my usual worst time waster. Just knowing that I have a list of things that I need to do and check off seems to drive me a bit; it gives the day a little bit of an unpleasant sense of urgency, and days that I don’t use it feel deliciously unstructured (even if I do manage to get things done), but “to-do list days” leave me with a real a feeling of accomplishment. It’s the little things…


  • Some Photos From Our New York Trip

    I took a bunch of pictures in Watkins Glen and the Corning Museum of Glass, thought I’d show some of them here.

    In Watkins Glen, we camped at the state park, and there was a trail basically from our campground to the trails along the Glen, and then into town. It was cool and convenient, but the park was very crowded, overcrowded actually, and so it wasn’t as much fun as if we had the place (relatively) to ourselves.

    The Museum of Glass was also very cool, but it really wasn’t a museum about glass per se, with history of glassmaking, chemistry and physics of glass, etc, which I would have liked — they had that, but it was more geared for kids, and in the “kid section” — but more an art museum, and museum art history, where the common medium is glass. Early artifacts, modern creations… the craziest part was the gift shop, where I saw several items in the $10,000-$50,000 price range and fragile as, well, glass, just sitting out on pedestals where kids were running around and anyone could bump into them…

    Anyway, here are my photos


  • Go, But At What Cost?

    Listening: “Golden Brown” by the Stranglers

    Well, so much for my previous experiment — don’t compartmentalize, just write — the real task is to actually take the time to write something. I haven’t been motivated lately  to do any writing, but in my defense there have been a lot of things to write about, which might have caused a bit of vapor-lock. Among other things, I’ve still been volunteering at the Canal Museum and at CAT, we did another overnight trip up to Jim Thorpe, and I’ve been exploring mapping and routing again.

    Listening: “Colossal” by Wolfmother

    Listening: “Beautiful Red Dress” by Laurie Anderson

    ON THE BIKE:

    We did another trip up the towpath: Anne and me, Sarah A and Dianna H. We rode to Jim Thorpe, lunching in town and camping overnight at the lake. Breakfast in town, then Anne continued north on her own from there while Sarah and I did the return trip (Dianna met her husband in town and got a ride home). Anne’s destination was Watkins Glen, and I caught up with her by car there a few days later. I brought my road bike, but we didn’t do much cycling, just some hiking at the Glen, then a trip to the Museum of Glass in Corning on the way home.

    Listening: “Help Me Mary” by Liz Phair

    I kind of got the mountain biking itch again: I did a ride on some seriously “old school” trails, with Greg H up in the Poconos near his cabin, probably my favorite ride of the year so far (except for a persistent creaking out of my pivots). Got the pivots fixed, rode Nox on a weekday with Anne, and did Deer Path/Pine Tar in Jim Thorpe Sunday. I’ll be doing a towpath ride later today.

    In between these things, I also took the Cycling Savvy course. Really fun, and though it covered a lot of the same ground as Road 1/LCI, I came away with more than a few choice new insights. I also rode across the Hill-to-Hill Bridge with my sister-in-law, which should have been a crazy idea, but by the time we did it (as part of the course), it was easy enough to be a bit anticlimactic.

    Listening:“Drumming Song” by Florence + The Machine

    We also managed to do some riding as part of Lehigh’s Car-free Day.

    Listening: “Make You Mine” by Heather Nova

    All this music just lets you know how slowly I write, and also how many in my “Favorites” playlist are female vocalists…

    READING

    I re-read The Mathematician’s Shiva recently, as well as all the “Expanse” books (which didn’t hold up to a re-read as well as I would have liked), and China Mieville’s Iron Council (ditto), the most recent new book was Walkable City by city planner and walkability expert/advocate Jeff Speck. Interestingly, he once was commissioned to do a study of Bethlehem, and gave a talk at Lehigh about his findings. (The town skipped over a bunch of his advice, but they did incorporate at least some of it, some parts more slowly than others.) It was fun (at first) to see him name-drop Bethlehem, and CAT, likely referring back to his study, but it became annoying after a while since it was mostly examples of what we were doing wrong…

    Case in point: I had just finished the “Cycling Savvy” course when I got to Speck’s critique of “Vehicular Cycling,” where bicyclists are trained to bike (on the roads) as drivers of vehicles — in other words, “Road 1” and “Cycling Savvy.” His contention, and there is some merit to it, is that while this may help an individual graduate be safer, it makes cycling grim and scary, a turn-off, thus reducing the number of actual cyclists on the road — and since the biggest driver of cycling safety is not cyclist skill (or wearing a helmet or whatnot), but the number of cyclists on the road, the vehicular cycling approach actually reduces general cycling safety. Oh well, he has a point, but I still liked biking over that bridge.

    Listening: “Old World” by The Modern Lovers

    FUN WITH POSTGIS

    I’ve been playing with a new project recently: building a web map for cycle commuters in the Valley. In the end it will show the major Lehigh Valley towns, and the locations of the major employers, and recommended routes that a cycle commuter might use to get around; I used Leaflet to get these basics down, but then I thought that what the map really needs is routing, and I thought it would be best to build a custom routing engine using PostGIS and pgRouting.

    Listening: “Wildewoman” by Lucius

    So, I’m back to my routing kick; this will be part 2 but I’ll be abandoning my previous project in favor of the web map.

    Listening: “Twenty-first Century Schizoid Man” by King Crimson

    First step (of many) was to make sure I had pgRouting installed properly along with PostGIS, and they both were, no problem. Next up was to build my road network — for right now I’m working on a smaller area, a part of Bethlehem City. I got the road data from OpenStreetMap and used the osm2pgrouting utility to get the roads into the database. So far so good, and the whole process was surprisingly easy.

    Using the routing functions took me a while to work out, but in the end they were also pretty straightforward. PostGIS/pgRouting seem to be easier to use, and easier to do sophisticated things with, than the original QGIS networking utilities.

    Listening: “White Unicorn” by Wolfmother (oh no the same band again!)

    Two things in particular came more easily: dealing with one-way streets, which I ignored in the first project since it seemed more trouble than it was worth (you could always walk your bike) and the actual “cost” of cycling.

    The basic idea behind routing is to find a path through the network that minimizes some function, the total of the “costs” of moving from each individual point to point within the network. The default cost function for my first project was distance (the default, and by far the easiest thing to do), which is a pretty good cost function as far as it goes. But with bicycling, elevation changes could also play a major role, and with pgRouting it’s easy enough to define your own costs.

    Listening: “Funkytown” by Lipps Inc.

    So I decided to consider total ascent, every meter climbed, as part of the cost; I found some studies that cyclists generally take a meter of ascent as equivalent to eight meters of travel — that is, you  might go eight meters longer to avoid another meter of climbing. I also thought that grade would affect that eight meters, and found another online study that multiplied ascent by a factor proportional to some power of grade. I eventually opted to go with a geometric factor, doubling elevation cost every 5% change in slope.

    Listening: “Strangeness and Charm” by Florence + The Machine

    I’ll get into it some other time, but I got QGIS to break up my network for finding ascent, and SAGA to assign elevations from DEM data, then wrote a Python script to extract and calculate the elevation costs. Took some doing, mostly dealing with my own typos, but finally I got the whole thing to work, and it routes beautifully — in QGIS, on my machine.

    Listening: “There There” by Radiohead

    I learned a few interesting things about elevation along the way. A sanity check of my cost results showed some anomalies, especially on 8th Avenue — it turns out my original “elevation data” was raw Space Shuttle radar data, and it picked up the top of the old Martin tower which screwed up nearby elevations. (This difference between ground elevation and radar/lidar elevation readings, the realm of buildings and trees, is — according to the Internet — very important to telecommunications people, who call it “clutter.”)

    So for my second iteration I used actual DEM data  (“digital elevation model,” the elevations at the surface of the Earth, as if it were scraped clear of buildings and vegetation), and that fixed the Martin Tower problem but revealed another one: bridges, my nemesis… I’ll have to figure out how to adjust elevations on bridges so they don’t follow the depressions (creeks, rivers) they jump over.

    Listening: “Furr” by Blitzen Trapper

    Well, that’s it for now…

    “But I still dream of running careless through the snow,

    And through the howling winds that blow

    Across the ancient, distant flow

    To fill our bodies up like water till we know.”

    … now let’s ride!

     


  • The View From Musikfest

    Pretty good night last night: we went with some of Anne’s orchestra friends and saw a trio (violin, piano, clarinet) doing Mozart and a few more modern classical pieces at the Moravian Church, then grabbed a beer at the Sun Inn, which was amazingly quiet compared to the street just outside. Left there, went home for some quick food, then caught Scythian — or the first half of their show anyway, thunder and lightning clearing the metal-pole tent. Doug & Lori joined us, as well as John & Donna who stopped by their place to grab some Scotch they got in Scotland. Much fun ensued, studying the relative merits of different Scotches… (This morning started a bit more slowly than we’d planned.)

    We caught another chamber music trio earlier this week, as well as a Faroese folk singer one evening; both of these were at the Moravian Chapel behind the church — these both were firsts for me, being inside these buildings. We also saw the Skatalites at Volksplatz, but other than that, and last night’s rained-out adventure, we’ve been avoiding Musikfest after dark. With age comes wisdom?

    Speaking of wisdom, I realized that my use of categories here (“the sporting life,” “cultural ramblings,” etc) has caused me to fragment my writing, trying to keep myself to one subject per post. I usually don’t have enough to say about any one thing to sustain a full post though, not on any regular basis at least, so my posting has dropped off and I’ve ended up not writing about anything. Therefore, I think I’ll make a conscious effort, to go back to my previous diary-like mishmash of whatever pops into my head, or into my life. Thus…

    Reading: The other book I read in Canada was A Gentleman In Moscow, by Amor Towles. This is the story of a Russian aristocrat who is sentenced by the Bolsheviks to house arrest for life in a luxury Moscow hotel. The novel has som many surprising twists that anything else I reveal would be a spoiler, so I’ll just say that this was a great book, and well worth reading.

    What else has been going on? I was back volunteering at the Canal Museum on Wednesday, but while there I heard that they had so many bike rentals last weekend that they needed to get some of the spares out of storage, and their tires were low on air, etc. So, I went in yesterday and went through all the bikes, making sure that they would be ready for use if needed this weekend. I also did some volunteering at CAT on Tuesday, building up a bike with Anne. In terms of actually riding bikes, Anne and I did a road ride, with lunch in Riegelsville, and Doug and I rode Jacobsburg on Thursday. Yesterday was rainy, and tonight threatens more, so if I ride tomorrow it’ll probably be a road ride.