Improvising an AC/DC wall wart adapter

Yesterday I had a nice maker win that felt like validation for time spent building confidence in the basics of electronics.

The problem

The situation was dire.  The Medela Pump-In-Style breast pump was needed immediately.  We found the old pump but couldn’t locate its battery pack or AC/DC adapter.  It was late and local stores were closed.

The hack

On Amazon.com I found the specs for a replacement Medela adapter: output 9V, 1000 mA.  Rummaging in my to-be-recycled electronics pile, I found a 9v 1000mA power adapter from an electric pencil sharpener I’d used as a high school teacher.  But its prong was too small for the Medela.

More rummaging turned up an adapter prong that did fit, this from the power adapter to an old Asus RT-N16 router (12V, 1.25 amps).  I cut each adapter’s cord in half, stripped the wires, attached them with crimp-on butt end splices – noting that the positive wire on each pair was marked with stripes –  and voila!  The pump worked and saved the day.

The North Maple Cycle Track

Summary:  By building a protected cycle path along North Maple Road between Jackson and Miller, Ann Arbor will fill a glaring gap in its transportation infrastructure and significantly improve the quality of life for its west side residents.

The problem

Ann Arbor has a conspicuous hole in its bike map (bike lanes in green).  Do you see it?

Ann Arbor's Bike Map

Okay, there are a few gaps.  Like most American cities, Ann Arbor’s biking infrastructure is limited, relying on unprotected bike lanes and sharrows (other cities have gone way beyond this). But for the most part, its major thoroughfares have bike lanes.  The biggest exception is North Maple Road:

map of bike lanes with N Maple road highlighted

This is an essential transportation corridor.  It connects to major bike lanes at the north (Miller), middle (Dexter), and south (Jackson, South Maple, Stadium).  And it would break from a downtown-centric rut of thinking by enabling residents of many west side neighborhoods to bike to essentials (groceries, drugstore, library, shopping, Secretary of State), restaurants and entertainment, and community hubs like the amazing Westgate Library.

But it’s supremely unfriendly to bikes.  It’s a 4 lane road with nothing to slow speeding traffic; the speed limit is 35 mph, though travel speeds exceed that.  This road is not a destination, it’s a way to get somewhere, including serving as the primary route to highways (I-94 and M-14).  Cyclists must “take the lane” for safety (the lanes aren’t wide enough for a car to pass a bike at the legal distance of 5 feet) and risk the abuse that comes with braving a car-centric roadway.

Maple Road near Walter
North Maple Road near Walter

In my last 1,500+ miles of biking in Ann Arbor, I’ve only been yelled at to “get on the sidewalk!” three times.  That low count is a credit to local drivers.  But all three times have been on Maple between Dexter and Miller, despite this stretch comprising only 1-2% of my biking time.

I can’t fully  blame my harassers.  While the sidewalk is a more dangerous place than the street for cyclists, the drivers are channeling the truth that this particular road was made only for cars.

The solution

A relatively easy fix would be to apply a “road diet,” going from four lanes to three, and use the extra space for an unprotected bike lane on each side.  This would feel like Miller or Packard: much better than North Maple is now – but still insufficiently “safe-feeling” for the average person to feel welcome.

And it would be quite doable.  No major construction needed, just a traffic study, resurfacing, repainting.  The lanes along this stretch are never full, and a recent closure of one lane each way (for road work) offered proof-of-concept that a single travel lane in each direction, plus a central turn lane, will be sufficient.

This would be doing the minimum.  It would work for me, a dedicated cyclist, but most people – regular residents, from 8 to 80 – do not feel comfortable biking on a road with 40 mph traffic whizzing by, separated by a stripe of paint.

No, we can do better.  Look at the picture above, and how much room there is to work with.  Four lanes, plus large public access strips of grass on each side, plus the sidewalks.

It’s the perfect place for Ann Arbor’s first cycle track.

NACTO describes a cycle track:

an exclusive bike facility that combines the user experience of a separated path with the on-street infrastructure of a conventional bike lane. A cycle track is physically separated from motor traffic and distinct from the sidewalk. Cycle tracks have different forms but all share common elements—they provide space that is intended to be exclusively or primarily used for bicycles, and are separated from motor vehicle travel lanes, parking lanes, and sidewalk

There are lots of configurations, but at a minimum this cycle track would be clearly separate from the street, raised to the level of the sidewalk and adjacent to it, and with clear markings for both walkers and bikers.

There’s great food for thought in what other cities are doing.  Sure, some European cities are in another league, but there are American cities innovating, too.  In the time I’ve been dreaming about this space, I personally saw inspiration in Chicago:

Bikeway separated from street
Taken from a bus near Michigan Avenue

(Here’s the rendering of that raised bikeway).  And inspiration in Brooklyn:

Separated cycle track in Brooklyn, NY

In both cases, I happened to be walking or busing by and thought: we deserve this, too.  This is a bike path that a ‘tween could ride to the library with her friend, or that a senior could take to Plum Market.

Uncertainties

One two-way cycle track, or two one-way cycle tracks?

I would like to hear from experts on this.  A one-way track in each direction seems cleaner to enter and exit, there’s no need to cross the street.  And it seems safer as bikes would be traveling in the direction that cars expect.

But a single two-way track on the east side of the road might work better for the Jackson-Dexter stretch (see below).

Two sections: Dexter-Miller and Jackson-Dexter

The bike infrastructure gap on North Maple spans these two sections of North Maple.  Dexter to Miller is simple: road diet that includes a turn lane (northbound cars often stop traffic to turn left  into the Alano Club).

Between Jackson and Dexter

The two blocks between Dexter and Jackson are trickier.  I’m less certain this could be subject to a road diet, at least not the southernmost block.  There is more lateral movement of cars in this stretch, including turning into the Maple Village shopping center.

Here’s the middle of the stretch, looking north:

Maple Road facing north at the skate parkAnd the southernmost block might be the hardest for integrating bike infrastructure, given the traffic flow to and from Jackson.  But it needs something.  Approaching the Maple & Jackson intersection by bike, and navigating it, is a daunting feat (made worse by the fact that the approach is uphill and that cars swoop into the right lane to make turns):

Intersection of Jackson and Maple
Yes, that’s four northbound lanes. I bike in the 2nd-from-the-right.

(an electric-assist bike helps here, but that’s for another post)

Here is where I think a single, two-way cycle track could have the advantage.  The city owns the land on the east side of Maple between Dexter and Jackson.  If it’s not suitable to remove car lanes here, the track could be built along the west side of Vets Park without altering the road.  There’s currently a footpath here for walkers and skaters and there’s plenty of room for a cycle track next to that (see the north-facing picture above).

Would a one-way cycle track on each side be feasible here?  Perhaps a single-direction track could fit on the west side of Maple along Maple Village, for southbound bike traffic.  This would provide the benefit of being on the natural side of the road, and access to Maple Village.  Though it’s not a big deal to dismount at Dexter & Maple and continue into the mall on foot, and biking along the mall would be less pleasant than biking along Vets park.  And the logistics seem trickier.  There’s grass next to the footpath on the west side of the street, but ownership isn’t as clear to me (would eminent domain by on the table?) and the final few feet where the cycle track would pass the Shell station seems unsolvable to me.

The one-way and two-way cycle track options could be blended.  For instance, take a one-way cycle track on each side between Miller and Dexter.  At the point where southbound bikes would need to cross to their left to join the last stretch of cycle track in Vets Park, a clearly demarcated path could be shown on the pavement indicating how to do this via left turn.  The bike would make a left turn from the left traffic lane (or from the cycle track, if it had its own turn signal cycle – this is a thing in say, Toronto) and then, instead of continuing east into the city, would make a wider curve onto the sidewalk area and join the cycle track.

Stadium-Jackson?

This block, an extension of the North Maple Cycle Track discussed above, is also a bike infrastructure gap.  And frankly an unpleasant place to travel via any mode: car, bike, foot.  It’s often clogged.

Stadium Blvd looking north at Jackson RoadIf the cycle track is built between Jackson-Miller, attention will then be turned to this stretch, to complete the connection to bike lanes on Stadium and Maple.  That would be hugely beneficial.  But I don’t have the knowledge to suggest a solution myself.  If you have ideas, please comment or write your own post!

Outcomes and feasibility

This post is long enough and others have made the case for the benefits of more biking to a city’s residents, so I won’t do that here.  I’ll just note that Ann Arbor would benefit massively terms of health, air quality, environmental impact, social connections, traffic flow (yes, my car-driving friends), and overall happiness.  But I will expound on benefits other than the generic ones of increased cycling share.

A calmer traffic flow with more non-motorized travelers would be an improvement for those who live along this stretch, creating a more pleasant atmosphere in their front yards and a safer place for kids and dogs.  I’d also like to see the city take on the duty of clearing the cycle track of snow; this could be with a small plow, or using a tractor with a spinning broom, ala Water Hill’s SnowBuddy.  With the track elevated next to the sidewalk, this snow removal will be straightforward – and the city can do residents a favor by clearing the adjacent sidewalk while they’re already out brushing.  This would increase the perk of living along the cycle track.  Construction would be an annoyance, but residents along the cycle track would likely see a bump in their home values as a form of compensation.

While the above benefits would accrue directly to those living along the cycle track,  the primary benefit – access to the track – would reach those in many neighborhoods on the west side, on both sides of North Maple.  Thousands of people would now find themselves with a comfortable, short bike ride to the essentials.

The cycle track would be good from an equity lens.  The city’s premier non-motorized transportation projects are downtown (the proposed cycling improvements on First/Ashley/William) or in wealthier near-downtown neighborhoods like the Old West Side and Water Hill (the “Treeline” urban trail).  While all residents and visitors benefit from improvements in downtown, it strengthens the city to have top-notch bike infrastructure outside of the city center.  This project would primarily serve middle-class homeowners and renters, as opposed to the Treeline, whose chief beneficiaries would be the more-expensive neighborhoods of the Old West Side.

This project should rank high on the non-motorized transportation list.  It compares favorably to the Treeline Trail as actual transportation infrastructure*, while also being a recreation opportunity.  Our transportation conversation too often focuses only on getting people in and out of downtown.  Downtown is great for restaurants, the Farmer’s Market, the Hands-On Museum – but it’s not where most people live day-to-day life.  The North Maple Cycle Track reflects the reality of living on a cul-de-sac in The Crescents and needing parts from the hardware store to fix your sink; living by Hollywood Park and picking up a prescription from Walgreens; a one-car family wanting to attend preschool story time at the library.

How does it happen?

I hope planners and other experts will weigh in, likely with better ideas.  I’m an enthusiast but not an expert.  A study will be needed to measure car traffic volume.  And there are lots of details to figure out.

This is not a small project.  It involves pouring concrete to create the cycle track, not just repaving what’s there.  So timing-wise, I expect this would be a ways off in the future, perhaps planned to coincide with other necessary construction along this road.

But it’s unquestionable that we must make North Maple Road more accommodating for bikes, opening up access from neighborhoods to the business corridor that is the heart of the west side (stretching from Maple Village to Westgate and then south to Stadium and Maple).  We have an opportunity to do better than a buffered bike lane.  Let’s show what’s possible and enjoy the city life we deserve.

* the Treeline began life as the Allen Creek Greenway, and its mission of bringing Allen Creek above ground has a significant environmental benefit that should not be dismissed.

You don’t need a TrailKeg

Or, “ode to the carbonator cap.”

A homebrewer friend recently brought a $200 TrailKeg to a club meeting. It is shiny and cool and … a thneed.

Instead, you should use a carbonator cap ($8* as of this writing) and some 1 or 2-liter plastic bottles (free after you drink the seltzer water).  While TrailKeg claims superiority over the glass growler, the carbonator-cap-and-PET-bottle (PET = #1 plastic, i.e. a soda bottle) combo delivers in most of the same ways:

  • Unbreakable
  • Lightweight
  • Has CO2 input for carbing the beer and keeping/serving it under CO2.

Here’s where they differ:

Continue reading You don’t need a TrailKeg

Batch 76 (?) – All-Malt Lager

Batch 76: All-Malt Lager

My batch numbers might be mixed up, I may or may not sort that out.

Brewing: brewed March 15th.  OG 1.050.  Big boilover, long cleanup, but everything went fine on the beer side.

It was an 18 gallon batch, two vessels of pale lager and a third that got an addition to make it a Dark American Lager.  To make the dark share, I put a half-pound of crushed Carafa II (or III?  See recipe/BCS book) in 2 quarts of hot water, steeped it like a big tea bag til it cooled, then added to fermenter.

Fermentation: fermented in 50F ambient cellar space.  Pulled up to 64F for a diacetyl rest around 1.020 gravity, which was 5 days (CCYL lager yeast) and 7 days (single pack pitch of 34/70).  Let sit around in 64F for a couple more weeks.

Packaging: kegged the CCYL batch on April 11th, it finished around 1.000 FG for a bit over 6% ABV.

 

Recipe and batch notes: https://www.brewtoad.com/recipes/light-and-dark-lager-partigyle/brew-logs/153459.

Things I want to do in 2018

Somewhat belatedly, here’s what I plan and hope to do in 2018.

R Development

Early in 2018, I’d like to finish up a couple of ongoing open-source software projects:

  1. (DONE) Release janitor v 1.0.  I have worked hard on this, it’s 99% done as of this writing, and I enjoy the benefits of the new tabyl() functions every day – but until it’s on CRAN, the impact is limited.
  2. (DONE) Participate in Kaggle’s March Mania challenge, ideally updating my how-to resource.

Then perhaps a break would be healthy, during which I spend more of my free time away from code and the computer.

Making things

I used to build things.  Including complex projects like my electric home brewery.  I’ve fallen out of that.  In 2018 I’d like to again build some small physical things:

  1. A keg washer like Colin’s (DONE)

Writing

I’d like to finish drafts and ideas I have accumulated.  Including:

  1. My proposal for a Maple Road Bike Highway (DONE: The North Maple Cycle Track)
  2. Several cargo bike posts
    1. The cargo bike changed my life
  3. My process for lime-softening well water for homebrewing

Activism

I’ll probably get involved in campaigns given what a busy year it looks to be politically.  Which means I should focus on other things before the fall.

I’m especially interested in the voting access and anti-gerrymandering ballot initiatives, the gubernatorial race, and of course Ann Arbor City Council.

To spread the joy of practical biking, I’d like to lend my cargo bike to at least 3 people/families this year.

Physical activity

  • I hope to again log 1,200 miles on a bicycle.
  • I want to ride:
    • To Dexter and back, and
    • To Ypsi and back. (DONE 2x in July, including once with a kid on the back)
  • And get both kids riding pedal bikes. (DONE and it’s beautiful)

Things I won’t do

Taking things off my plate to make room for others.  A small example: I’m not entering the National Homebrew Competition this year.  Perhaps I’ll keep vegetable gardening to a minimal level.

I’ve been taking a break from following Ann Arbor news, though that may change during election season.

And the best for last:

Expecting another child this summer is the biggest event of the year.  But unlike resolutions and plans above, that one will by default get all the attention it needs.

Advent of Code 2017 in #rstats: Day 13

I liked the twist in the Day 13 puzzle.  Implementing a literal solution to part 1, where I had the scanners walk back and forth, was straightforward.  And Part 2 looked easy enough.  Then I peeked at how slowly my algorithm was proceeding and realized I would need to refactor.

Part 1

This function has been modified in two places for Part 2.  I added the first line in the function, using the modulo operator %% to trim the time down to a single back-and-forth pass.   This made the commented-out direction change line obsolete.

I worked out the time %% ((size-1)*2) bit by counting examples on my fingers 🙂

Part 2

Without the modulo line above, my loop will walk the scanner back and forth for time steps.  As the delay increases, so does the time.  The answer to this problem is a delay of approximately 4 million time units; at that point, each scanner is walked 4 million times… it’s been a long time since CS 201 but I think that makes the algorithm O(N2).  In practice, I realized I had a problem when progress slowed dramatically.

Realizing this, I eliminated the unnecessary walking.  Now, this could still be much more efficient.  Because I’m recycling code from part 1, I test all scanner depths for collisions at each iteration; a faster solution would move on to the next delay value after a single scanner collision is found.  But hey, that is a mere ~20x slowdown or so, and is still O(N).

Having started with R in 2014, I rarely feel like an old-timer.  I learned dplyr from the beginning, not tapply.  But I had that feeling here… being somewhat comfortable with mapply gets in the way of sitting down to learn the map2 functions from purrr, which I suspect will be useful to know.

My runtime was about 15 minutes.

Advent of Code 2017 in #rstats: Day 12

(Day 12 puzzle). This was my favorite day so far.  I’ve never faced my own graph problem and this was a great example for trying out the igraph package.

Big shout out to Gábor Csárdi and anyone else on the igraph team who wrote the docs.  And I mean wrote the docs!  When I google an R question, 99% of the time I land on StackOverflow.  The searches I made for Day 12 all* took me to the igraph documentation website, which answered my questions.  I don’t know of another R package or topic like that.

Their example of creating a graph was clear and was easy to adapt to the toy example on Day 12.  From there, some searching found the two functions I’d need for Day 12: neighborhood() and clusters().  Look how short my part 2 is!

Part 0: Playing with igraph

Here’s the documentation example for creating an igraph.  I played with it to confirm it would work for my needs:

Part 1

This was mostly wrangling the data into the igraph.  It didn’t seem to like integer names for vertices so I prepended “a”.

I increased the grp_size parameter until my result stopped increasing.  That was at about 30 degrees of separation (it was still changing at 15).  A more permanent solution might include a loop to do this.

Part 2

All you need is igraph::clusters():

One.  Function.

Conclusion: graphs are neat, igraph is the way to analyze them.

* okay, one search took me to StackOverflow and gave me what I needed: the clusters() function.  Everything else came from igraph.org.

Advent of Code 2017 in #rstats: Day 11

Once I realized that moves on a hex grid map nicely to a standard rectangular grid, this was easy.   Despite playing hours of Settlers of Catan, I’d never realized this relationship.  Maybe because nothing traverses that hex grid?

North and South move one step up or down.  The four diagonal directions move a half-step up or down and a full column laterally.  The shortest solution path will be diagonal moves to reach the desired column, then vertical moves to the right row.

It took only a minute or two to modify my part 1 function for part 2, so I present both together.

Parts 1 & 2

 

Advent of Code 2017 in #rstats: Day 9

I write less deeply-nested code now that I program in R.  When writing code poorly  in other programs, I’d often use nested IF statements (hi, Excel!).  Debugging that often looked like counting my nesting depth out loud: add one for every (,  subtract one for every ).

That strategy formed the basis for my solution today.   And I was excited to do Part 2 with arithmetic, not writing new code.

Part 1

Strategy: maintain counter of open braces, decreasing for closed braces.

So {{<a>},{<a>},{<a>},{<a>}} = 1 2 2 2 2. Sum = 9.

Part 2

The answer is the total number of characters, minus:

  • The characters canceled by !
  • The bracketing <> for each garbage string
  • The valid characters remaining after removing the garbage in Part 1

To wit:

 

Advent of Code 2017 in #rstats: Day 7

Today was hard, but a good challenge.  I haven’t written a recursive function since college CS – is that typical for data science / analysis work?  I don’t see much about recursion on #rstats Twitter.  Recursion feels like a separate way of thinking, and I had forgotten how.

Part 1

The first part was satisfying.  Data cleaning was quick and I thought joining the data.frame to itself to populate parent and child for each entry was a nice touch.

My tidy data looked like:

Then the solution was easy:

 

Part 2

This was tough going.  I got a function working for the sample input, which worked by stepping backward from the most distant children and adding their weight to their parents, then removing them and calling itself again.

But while the sample input had symmetric towers, in the bigger test data a tower could be balanced if it had two children of 4 and 2 -> 1 + 1.  In that scenario, you can’t peel off the 4 in the same step that you peel off the 1s.  (For my own satisfaction, that false solution appears far below).

I’m proud of my eventual solution.  And besides finally getting my brain to think recursively, I learned a few things: creating a named vector with structure() and using purrr::map_dbl.

I finished with a cop-out: once my function returned the weights of the subtower nodes where the problem existed and their names, it wasn’t worth programming the last bit to do the weight subtraction and get my answer.  With this output:

I just calculated it myself using get_node_weight("ycbqx") and subtracting 5.

Appendix: Solution with Symmetric Towers

Because I feel salty that this didn’t work.