Andrew Que Sites list Photos
Projects Contact
More Water

More Water

   My phone has this bad habit of turning on in my pocket and randomly changing settings.  It gets worse when it is wet from rain.  Last night on the ride home it misted the entire way, and when I came inside my phone went through a setting change session in my pocket.  This morning my alarm didn't go off, and I woke up 5 minutes before I needed to be at work for a visiting client.  I missed breakfast on State Street, was late and had to drive so I didn't get my ride in.  In addition it was forecast to rain in the afternoon.  So I lost all my miles for the day and with rain forecast for the weekend probably won't get to ride again for a couple days. 
   Pictured is better news.  Back in early September I added two water bottles to my bike and mounted them on the front forks.  I carry 4 water bottles, 3x750 ml and 1x500 ml for a total of 2.75 liters of water.  Despite all this water I consumed most of it on my 31 mile ride to Devil's Lake last weekend.  For that ride I carried an additional 750 ml I clipped under my seat.  This bottle was for the hike, but I ended up forgetting it on the bike.  Before the additional water bottles I used to carry a 2 litter water bottle in one of my bags and will probably continue to do so for camping trips.
   There was light rain forecast for the morning but the afternoon was to be clear.  I decided I wanted the miles more than I wanted to be dry.  A few months ago I picked up some rain gear and this morning I tried it out.  I stayed dry for about 3 miles of my ride.  After that point I slowly began to get soaked with trapped sweat.  By the time I was at work I was pretty soggy but not uncomfortably so.  Today's rides into work and back pushed my monthly total to 319 miles.  I have a ride scheduled for tomorrow and then nothing for a couple days as it is scheduled to rain most of the weekend.
   My bike riding the Merrimac Ferry across the Wisconsin River.

October 11, 2017

Examining Old Algorithms

Back in the late 1990s I was working on a game inspired by the old BBS game Trade Wars 2002. I was looking to have a more advanced value system for traded goods. The other day I was interested in the algorithm I had come up with because I knew it was rather strange. So I decided to find the code and graph the value function I had created. Here is a graph of the function I created.

The purpose of the algorithm was to produce a monetary value based on several attributes that summed to an overall quality rank. Think of this like a gemstone where 100% would be completely flawless and 0% complete flawed. One of the attribute flags could change the value by a scale factor.

When I wrote this algorithm I didn’t know much about the curving numbers. I setup a kind of liner piece-wise function. Six of the steps are fairly obvious: 30, 50, 80, 92 and 98. Probably less intentional were the last two steps. The first happens at 19/32768, and the second 448/32768. My goal was likely to make the slope toward zero more gradual near the end, but since I didn’t understand graphing a function the actual results were not at all what was expected.

The graph is shown on a logarithmic scale so the nuances like the strange end are clearly visible. All the values are actually linear and the curves of (like the one from 2% to 30%) is just a result of the logarithmic scale.

If I were to write this algorithm today I probably would use a second degree polynomial or an exponential function. Something like:


By varying the coefficients a, b, and c I would have a continuous function that curved. The exponential function

will produce the following graph which is fairly close to what the game would have needed.

Like most of my programming projects the game never amounted to much more than a concept. I spent more time fighting with the 640 KiB barrier at the time than doing much development work. It is interesting to look at how I approached math problems when I didn’t know any formal math outside of arithmetic.

8.4 volts to USB adapter

8.4 volts to USB adapter

   This is another attempt at a cellphone charger for my bike.  The battery on my bike is a 10-cell 18650 pack.  The claim is 20,000 mAH although that number is drastically inflated.  Still, there is a fair amount of power available.  On rides longer than 2 hours my phone can't keep charged so being able to convert power from the 8.4V battery pack is useful.  I had a setup when I first put the power distribution setup together but it failed to function at some point.  So I build a second one thinking it was a bad buck converted.  It too died and I think this was because of corrosion on the USB connector.  This setup uses a gold-platted USB connector which should hold up to the corrosion caused by being outdoors as gold does not oxidize.
   I first used the setup on my Devil's Lake ride the other day and it work fine.  We'll see how it works in 6 months from now.
Steve's Victory

Steve's Victory

   Rode up to Devil's Lake this morning and it was a wonderful day for that ride.  I had a tailwind of more than 10 MPH on the way up and did the 32 mile to the south shore in just 2 hours, 38 minutes which included a stop at the grocery store along the way.  Of that time, only 2 hours and 5 minutes of peddle time were needed.
   I had Steve meet me at the lake as he was going to take my car so I could drive back.  However, the ride went so smoothly I decided I would drive back.  Steve and I went for a hike up the steepest of the trails at the park.  Unknown to me Steve has vertigo pretty bad and didn't think he could make it down the way we came.  This was at the half-way up mark.  He decided to hike all the way to the top and take a hike of about 4 miles so he didn't have to go the way we came.  Pictured is Steve at the summit.
   The ride home began about 5:15 pm and I decided to head out the west side of the park and follow highway 12 into Sauk City.  I made another stop at a grocery store for snacks and by this time it was getting dark.  I could have followed highway 12 all the way back to Middleton but that is loud and rather boring.  So I snaked though some back roads.  Soon the sun was gone and this was one of the few times I've actually needed my headlight on a ride.  It was a lengthy ride but I made it to Middleton and stopped for some pumpkin pie before returning home.
   The day comes in at 69 miles, 1.12 of which were my hike with Steve.  That also brings the month to 226.8 miles which is not bad for a single 7 day period.  Only once before, back in June of 2016, have I ridden more in a week.  This time I'd rather not be down for several days for R&R and I plan to cycle to work tomorrow.