elephant, penguin

Confessions of a Recovering Proprietary Programmer, Part XVII

One of the gatherings I attended last year featured a young man asking if anyone felt comfortable doing git rebase “without adult supervision”, as he put it. He seemed as surprised to see anyone answer in the affirmative as I was to see only a very few people so answer. This seems to me to be a suboptimal state of affairs, and thus this post describes how you, too, can learn to become comfortable doing git rebase “without adult supervision”.

Use gitk to See What You Are Doing

The first trick is to be able to see what you are doing while you are doing it. This is nothing particularly obscure or new, and is in fact why screen editors are preferred over line-oriented editors (remember ed?). And gitk displays your commits and shows how they are connected, including any branching and merging. The current commit is evident (yellow rather than blue circle) as is the current branch, if any (branch name in bold font). As with screen editors, this display helps avoid inevitable errors stemming from you and git disagreeing on the state of the repository. Such disagreements were especially common when I was first learning git. Given that git always prevailed in these sorts of disagreements, I heartily recommend using gitk even when you are restricting yourself to the less advanced git commands.

Note that gitk opens a new window, which may not work in all environments. In such cases, the --graph --pretty=oneline arguments to the git log command will give you a static ASCII-art approximation of the gitk display. As such, this approach is similar to using a line-oriented editor, but printing out the local lines every so often. In other words, it is better than nothing, but not as good as might be hoped for.

Fortunately, one of my colleagues pointed me at tig, which provides a dynamic ASCII-art display of the selected commits. This is again not as good as gitk, but it is probably as good as it gets in a text-only environment.

These tools do have their limits, and other techniques are required if you are actively rearranging more than a few hundred commits. If you are in that situation, you should look into the workflows used by high-level maintainers or by the -stable maintainer, who commonly wrangle many hundreds or even thousands of commits. Extreme numbers of commits will of course require significant automation, and many large-scale maintainers do in fact support their workflows with elaborate scripting.

Doing advanced git work without being able to see what you are doing is about as much a recipe for success as chopping wood in the dark. So do yourself a favor and use tools that allow you to see what you are doing!

Make Sure You Can Get Back To Where You Started

A common git rebase horror story involves a mistake made while rebasing, but with the git garbage collector erasing the starting point, so that there is no going back. As the old saying goes, “to err is human”, so such stories are all too plausible. But it is dead simple to give this horror story a happy ending: Simply create a branch at your starting point before doing git rebase:

git branch starting-point
git rebase -i --onto destination-commit base-commit rebase-branch
# The rebased commits are broken, perhaps misresolved conflicts?
git checkout starting-point # or maybe: git checkout -B rebase-branch starting-branch


Alternatively, if you are using git in a distributed environment, you can push all your changes to the master repository before trying the unfamiliar command. Then if things go wrong, you can simply destroy your copy, re-clone the repository, and start over.

Whichever approach you choose, the benefit of ensuring that you can return to your starting point is the ability to repeat the git rebase as many times as needed to arrive at the desired result. Sort of like playing a video game, when you think about it.

Practice on an Experimental Repository

On-the-job training can be a wonderful thing, but sometimes it is better to create an experimental repository for the sole purpose of practicing your git commands. But sometimes, you need a repository with lots of commits to provide a realistic environment for your practice session. In that case, it might be worthwhile to clone another copy of your working repository and do your practicing there. After all, you can always remove the repository after you have finished practicing.

And there are some commands that have such far-reaching effects that I always do a dry-run on a sacrificial repository before trying it in real life. The poster boy for such a command is git filter-branch, which has impressive power for both good and evil.

 

In summary, to use advanced git commands without adult supervision, first make sure that you can see what you are doing, then make sure that you can get back to where you started, and finally, practice makes perfect!
inside

The Old Man and His Macbook

I received a MacBook at the same time I received the smartphone. This was not my first encounter with a Mac, in fact, I long ago had the privilege of trying out a Lisa. I occasionally made use of the original Macintosh (perhaps most notably to prepare a resume when applying for a job at Sequent), and even briefly owned an iMac, purchased to run some educational software for my children. But that iMac was my last close contact with the Macintosh line, some 20 years before the MacBook: Since then, I have used Windows and more recently, Linux.

So how does the MacBook compare? Let's start with some positives:

  • Small and light package, especially when compared to my rcutorture-capable ThinkPad. On the other hand, the MacBook would not be particularly useful for running rcutorture.
  • Much of the familiar UNIX userspace is right at my fingertips.
  • The GUI remembers which windows were on the external display, and restores them when plugged back into that display.
  • Automatically powers off when not in use, but resumes where you left off.
  • Most (maybe all) applications resume where they left off after rebooting for an upgrade, which was an extremely pleasant surprise.
  • Wireless works seamlessly.


There are of course some annoyances:

  • My typing speed and accuracy took a serious hit. Upon closer inspection, this turned out to be due to the keyboard being smaller than standard. I have no idea why this “interesting” design choice was made, given that there appears to be ample room for full-sized keys. Where possible, I connect a full-sized keyboard, thus restoring full-speed typing.
  • I detest trackpads, but that is the only built-in mouse available, which defeats my usual strategy of disabling them. As with the keyboard, where possible I connect a full-sized mouse. In pleasing contrast to the earlier Macs, this MacBook understands that a mouse can have more than one button.
  • I found myself detesting the MacBook trackpad even more than usual, in part because brushing up against it can result in obnoxious pop-up windows offering to sell me songs and other products related to RCU. I disabled this advertising “feature” only to find that it was now putting up obnoxious pop-up windows offering to look up RCU-related words in the dictionary. In both cases, these pop-up windows grab focus, which makes them especially unfriendly to touch-typists. Again, the solution is to attach a full-sized keyboard and standard mouse. Perhaps my next trip will motivate me to disable this misfeature, but who knows what other misfeature lies hidden behind it?
  • Connectivity. You want to connect to video? A memory stick? Ethernet? You will need a special adapter.
  • Command key instead of control key for cut-and-paste. Nor can I reasonably remap the keys, at least not if I want to continue using control-C to interrupt unruly UNIX-style applications. On the other hand, I freely admit that Linux's rather anarchic approach to paste buffers is at best an acquired taste.
  • The control key appears only on the left-hand side of the keyboard, which is also unfriendly to touch-typists.
  • Multiple workspaces are a bit spooky. They sometimes change order, or maybe I am accidentally hitting some key combination that moves them. Thankfully, it is very easy to move them where you want them: Control-uparrow, then drag and drop with the mouse.
  • I tried porting perfbook, but TexLive took forever to install. I ran out of patience long before it ran out of whatever it was downloading.


Overall impression? It is yet another laptop, with its own advantages, quirks, odd corners, and downsides. I can see how people who grew up on Macbook and who use nothing else could grow to love it passionately. But switching back and forth between MacBook and Linux is a bit jarring, though of course MacBook and Linux have much more in common than did the five different systems I switched back and forth between in the late 1970s.

My current plan is to stick with it for a year (nine months left!), and decide where to go from there. I might continue sticking with it, or I might try moving to Linux. We will see!
inside

Other weighty matters

I used to be one of those disgusting people who could eat whatever he wanted, whenever he wanted, and as much as he wanted—and not gain weight.

In fact, towards the end of my teen years, I often grew very tired of eating. You see, what with all my running and growing, in order to maintain weight I had to eat until I felt nauseous. I would feel overstuffed for about 30 minutes and then I would feel fine for about two hours. Then I would be hungry again. In retrospect, perhaps I should have adopted hobbit-like eating habits, but then again, six meals a day does not mesh well with school and workplace schedules, to say nothing of with family traditions.

Once I stopped growing in my early 20s, I was able to eat more normally. Nevertheless, I rarely felt full. In fact, on one of those rare occasions when I did profess a feeling of fullness, my friends not only demanded that I give it to them in writing, but also that I sign and date the resulting document. This document was rendered somewhat less than fully official due to its being written on a whiteboard.

And even by age 40, eating what most would consider to be a normal diet caused my weight to drop dramatically and abruptly.

However, my metabolism continued to slow down, and my body's ability to tolerate vigorous exercise waned as well. But these change took place slowly, and so the number on the scale crept up almost imperceptibly.

But so what if I am carrying a little extra weight? Why should I worry?

Because I have a goal: Should I reach age 80, I would very much like to walk under my own power. And it doesn't take great powers of observation to conclude that carrying extra weight is not consistent with that goal. Therefore, I must pay close attention to the scale.

But life flowed quickly, so I continued failing to pay attention to the scale, at least not until a visit to airport in Florida. After passing through one of the full-body scanners, I was called out for a full-body search. A young man patted me down quite thoroughly, but wasn't able to find whatever it was that he was looking for. He called in a more experienced colleague, who quickly determined that what had apparently appeared to be a explosive device under my shirt was instead an embarrassingly thick layer of body fat. And yes, I did take entirely too much satisfaction from the fact that he chose to dress down his less-experienced colleague, but I could no longer deny that I was a good 25-30 pounds overweight. And in the poor guy's defense, the energy content of that portion of my body fat really did rival that of a small bomb. And, more to the point, the sheer mass of that fat was in no way consistent with my goal to be able to walk under my own power at age 80.

So let that be a lesson to you. If you refuse take the hint from your bathroom scale, you might well find yourself instead taking it from the United States of America's Transportation Security Administration.

Accepting the fact that I was overweight was one thing. Actually doing something about it was quite another. You see, my body had become a card-carrying member of House Stark, complete with their slogan: “Winter is coming.” And my body is wise in the ways of winter. It knows not only that winter is coming, but also that food will be hard to come by, especially given my slowing reflexes and decreasing agility. Now, my body has never actually seen such a winter, but countless generations of of natural selection have hammered a deep and abiding anticipation of such winters into my very DNA. Furthermore, my body knows exactly one way to deal with such a winter, and that is to eat well while the eating is good.

However, I have thus far had the privilege of living in a time and place where the eating is always good and where winter never comes, at least not the fearsome winters that my body is fanatically motivated to prepare for.

This line of thought reminded me of a piece written long ago by the late Isaac Asimov, in which he suggested that we should stop eating before we feel full. (Shortly after writing this, an acquaintance is said to have pointed out that Asimov could stand to lose some weight, and Asimov is said to have reacted by re-reading his own writing and then successfully implementing its recommendation.) The fact that I now weighed in at more than 210 pounds provided additional motivation.

With much effort, I was able to lose more than ten pounds, but then my weight crept back up again. I was able to keep my weight to about 205, and there it remained for some time.

At least, there it remained until I lost more than ten pounds due to illness. I figured that since I had paid the price of the illness, I owed it to myself to take full advantage of the resulting weight loss. Over a period of some months, I managed to get down to 190 pounds, which was a great improvement over 210, but significantly heavier than my 180-pound target weight.

But my weight remained stubbornly fixed at about 190 for some months.

Then I remembered the control systems class I took decades ago and realized that my body and I comprised a control system designed to maintain my weight at 190. You see, my body wanted a good fifty pounds of fat to give me a good chance of surviving the food-free winter that it knew was coming. So, yes, I wanted my weight to be 180. But only when the scale read 190 or more would I panic and take drastic action, such as fasting for a day, inspired by several colleagues' lifestyle fasts. Below 190, I would eat normally, that is, I would completely give in to my body's insistence that I gain weight.

As usual, the solution was simple but difficult to implement. I “simply” slowly decreased my panic point from 190 downwards, one pound at a time.

One of the ways that my body convinces me to overeat is through feelings of anxiety. “If I miss this meal, bad things will happen!!!” However, it is more difficult for my body to convince me that missing a meal would be a disaster if I have recently fasted. Therefore, fasting turned out to be an important component of my weight-loss regimen. A fast might mean just skipping breakfast, it might mean skipping both breakfast and lunch, or it might be a 24-hour fast. But note that a 24-hour fast skips first dinner, then breakfast, and finally lunch. Skipping breakfast, lunch, and then dinner results in more than 30 hours of fasting, which seems a bit excessive.

Of course, my body is also skilled at exploiting any opportunity for impulse eating, and I must confess that I do not yet consistently beat it at this game.

Exercise continues to be important, but it also introduces some complications. You see, exercise is inherently damaging to muscles. The strengthening effects of exercise are not due to the exercise itself, but rather to the body's efforts to repair the damage and then some. Therefore, in the 24 hours or so after exercise, my muscles suffer significant inflammation due to this damage, which results in a pound or two of added water weight (but note that everyone's body is different, so your mileage may vary). My body is not stupid, and so it quickly figured out that one of the consequences of a heavy workout was reduced rations the next day. It therefore produced all sorts of reasons why a heavy workout would be a bad idea, and with a significant rate of success.

So I allow myself an extra pound the day after a heavy workout. This way my body enjoys the exercise and gets to indulge the following day. Win-win! ;–)

There are also some foods that result in added water weight, with corned beef, ham, and bacon being prominent among them. The amount of water weight seems to vary based on I know not what, but sometimes ranges up to three pounds. I have not yet worked out exactly what to do about this, but one strategy might be to eat these types of food only on the day of a heavy workout. Another strategy would be to avoid them completely, but that is crazy talk, especially in the case of bacon.

So after two years, I have gotten down to 180, and stayed there for several months. What does the future hold?

Sadly, it is hard to say. In my case it appears that something like 90% of the effort required to lose weight is required to keep that weight off. So if you really do want to know what the future holds, all I can say is “Ask me in the future.”

But the difficulty of keeping weight off should come as no surprise.

After all, my body is still acutely aware that winter is coming!
SequentialCaveman

Parallel Programming: December 2019 Update

There is a new release of Is Parallel Programming Hard, And, If So, What Can You Do About It?.

This release features a number of formatting and build-system improvements by the indefatigible Akira Yokosawa. On the formatting side, we have listings automatically generated from source code, clever references, selective PDF hyperlink highlighting, and finally settling the old after-period one-space/two-space debate by mandating newline instead. On the build side, we improved checks for incompatible packages, SyncTeX database file generation (instigated by Balbir Singh), better identification of PDFs, build notes for recent Fedora releases, fixes for some multiple-figure page issues, and improved font handling, and a2ping workarounds for ever-troublesome Ghostscript. In addition, the .bib file format was dragged kicking and screaming out of the 1980s, prompted by Stamatis Karnouskos. The new format is said to be more compatible with modern .bib-file tooling.

On the content side, the “Hardware and its Habits”, “Tools of the Trade”, “Locking”, “Deferred Processing”, “Data Structures”, and “Formal Verification” chapters received some much needed attention, the latter by Akira, who also updated the “Shared-Variable Shenanigans” section based on a recent LWN article. SeongJae Park, Stamatis, and Zhang Kai fixed a large quantity of typos and addressed numerous other issues. There is now a full complement of top-level section epigraphs, and there are a few scalability results up to 420 CPUs, courtesy of a system provided by my new employer.

On the code side, there have been a number of bug fixes and updates from ACCESS_ONCE() to READ_ONCE() or WRITE_ONCE(), with significant contributions from Akira, Junchang Wang, and Slavomir Kaslev.

A full list of the changes since the previous release may be found here, and as always, git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/perfbook.git will be updated in real time.
BookAndGlasses

Exit Libris, Take Two

Still the same number of bookshelves, and although I do have a smartphone, I have not yet succumbed to the ereader habit. So some books must go!


  • Books about science and computing, in some cases rather loosely speaking:

    • “The Rocks Don't Lie”, David R. Montgomery. Great story of how geologists spent a great many years rediscovering the second century's received wisdom that the Book of Genesis should not be given a literal interpretation, specifically the part regarding Noah's Flood. Only to spend the rest of their lives resisting J. Harlen Bretz's work on the catastrophic floods that shaped the Columbia Gorge. The book also covers a number of other suspected catastrophic floods, showing how science sometimes catches up with folklore. Well w-orth a read, but discarded in favor of a biography focusing on J. Harlen Bretz. Which is around here somewhere...
    • “This Book Warps Space and Time”, Normal Sperling. Nice collection of science-related humor. Of course, they say that every book warps space and time.
    • “Scarcity: The True Cost of not Having Enough”, Sendhil Mullainathan and Eldar Shafir. Not a bad book for its genre, for example, covering more than mere money. Interesting proposals, but less validation of the proposals than one might hope. (Yes, I do write and validate software. Why do you ask?)
    • “the smartest kids in the world, and how they got that way”, amanda ripley [sic]. Classic case of generalizing from too little data taken over too short a time. But kudos to a book about education with a punctuation-free all-lowercase front cover, I suppose...
    • “Thinking, Fast and Slow”, Daniel Kahneman. Classic book, well worth reading, but it takes up a lot of space on a shelf.
    • “The Information, A Theory, A History, A Flood”, James Gleick. Ditto.
    • “The Human-Computer Interaction Handbook”, Julie A. Jacko and Andrew Sears. This is the textbook from the last university class I took back in 2004. I have kept almost all of my textbooks, but this one is quite large, is a collection of independent papers (most of which are not exactly timeless), and way outside my field.
    • “The Two-Mile Time Machine, Richard B. Alley”. Account of the learnings from ice cores collected in Greenland, whose two-mile-thick ice sheets give the book its name.
    • “Dirt: The Erosion of Civilizations”, David R. Montgomery. If you didn't grow up in a farming community, read this book so you can learn that dirt does in fact matter a great deal.
    • “Advanced Topics in Broadband ATM Networks”, Ender Ayanoglu and Malathi Veeraraghanavan. Yes, Asynchronous Transfer Mode networks were going to take over the entirety of the computing world, and anyone who said otherwise just wasn't with it. (Ender looked too old to have been named after the protagonist of “Ender's Game” so your guess is as good as mine.)
    • “Recent Advances in the Algorithmic Analysis of Queues”, David M. Lucantoni. I had been hoping to apply this to my mid-90s analysis work, but no joy. On the other hand, if I remember correctly, this was the session in which an academic reproached me for understanding the material despite being from industry rather than academia, a situation that she felt was totally reprehensible and not to be tolerated. Philistine that I am, I still feel no shame. ;-)
    • “The Principia”, Isaac Newton. A great man, but there are more accessible sources of this information. Besides, the copy I have is not the original text, but rather an English translation.

  • Related to my recent change of employer:

    • “Roget's Thesaurus in Dictionary Form”, C.O. Sylvester Mawson. Duplicate, and largely obsoleted by the world wide web.
    • “Webster's New World Dictionary of the American Language (College Edition)”. Ditto. This one is only a year older than I am, in contract with the thesaurus which is more than 20 years older than I am.
    • “Guide to LaTeX, Fourth Edition”, Helmut Kopka and Patrick W. Daly. Ditto, though much younger.
    • “Pattern Languages of Program Design, Book 2”, Edited by John M. Vlissides, James O. Coplien, and Norman L. Kerth. Ditto.
    • “Pattern-Oriented Software Architecture Volume 2: Patterns for Concurrent and Networked Objects”, Douglas Schmidt, Michael Stal, Hans Rohnert, and Frank Buschmann. Ditto.
    • “Strengths Finder 2.0”, Tom Rath. Ditto.
    • Books on IBM: “IBM Redux”, Doug Garr; “Saving Big Blue”, Robert Slater; “Who's Afraid of Big Blue”, Regis McKenna; “After the Merger”, Max M. Habeck, Fritz Kroeger, and Michael R. Traem. Worth a read, but not quite of as much interest as they were previously. But I am keeping Louis Gerstner's classic “Who Says Elephants Can't Dance?”

  • Self-help books, in some cases very loosely speaking:

    • “Getting to Yes: Negotiating Agreement Without Giving In”, by Roger Fisher and William Ury. A classic, but I somehow ended up with two of them, and both at home.
    • “How to Make People Think You're Normal”, Ben Goode.
    • “Geezerhood: What to expect from life now that you're as old as dirt”, Ben Goode.
    • “So You Think You Can ’Geezer’: Instructions for becoming the old coot you have always dreamed of”, Ben Goode.
    • “The Challenger Customer”, Brent Adamson, Matthew Dixon, Pat Spenner, and Nick Toman. Good insights on how tough customers can help you get to the next level and how to work with them, but numerous alternative sources.
    • “The Innovator's Solution”, Clayton M. Christensen and Michael E. Raynor. Not bad, but keeping “The Innovator's Dilemma” instead.

  • Recent USA miltary writings:

    • “Back in Action”, Captain David Rozelle
    • “Imperial Grunts”, Robert D. Kaplan
    • “Shadow War”, Richard Miniter
    • “Imperial Hubris”, Anonymous
    • “American Heroes”, Oliver North

    A good set of widely ranging opinions, but I am keeping David Kilcullen's series. Kilcullen was actually there (as was Rozelle and to some extent Kaplan) and has much more experience and a broader perspective than the above five. Yes, Anonymous is unknown, but that book was published in 2004 as compared to Kilcullen's series that spans the Bush and Obama administrations. You get to decide whether Kilcullen's being Australian is a plus or a minus. Choose wisely! ;-)

  • Brain teasers:

    • “The Riddle of Scheherazade and Other Amazing Puzzles”, Raymond Smullyan
    • “Lateral Thinking: Creativity Step by Step”, Edward de Bono
    • “The Great IQ Challenge”, Philip J. Carter and Ken A. Russell

  • Social commentary:

    • “A Darwinian Left: Politics, Evolution, and Cooperation”, Peter Singer
    • “Rigged”, Ben Mezrich
    • “Braiding Sweetgrass: Indigenous Wisdom, Scientific Knowledge, and the Teaching of Plants”, Robin Wall Kimmerer
    • “Injustice”, J. Christian Adams
    • “The Intimidation Game”, Kimberley Strassel

inside

The Old Man and His Smartphone, 2019 Holiday Season Episode

I used my smartphone as a camera very early on, but the need to log in made it less than attractive for snapshots. Except that I saw some of my colleagues whip out their smartphones and immediately take photos. They kindly let me in on the secret: Double-clicking the power button puts the phone directly into camera mode. This resulted in a substantial uptick in my smartphone-as-camera usage. And the camera is astonishingly good by decade-old digital-camera standards, to say nothing of old-school 35mm film standards.

I also learned how to make the camera refrain from mirror-imaging selfies, but this proved hard to get right. The selfie looks wrong when immediately viewed if it is not mirror imaged! I eventually positioned myself to include some text in the selfie in order to reliably verify proper orientation.

Those who know me will be amused to hear that I printed a map the other day, just from force of habit. But in the event, I forgot to bring not only both the map and the smartphone, but also the presents that I was supposed to be transporting. In pleasant contrast to a memorable prior year, I remembered the presents before crossing the Columbia, which was (sort of) in time to return home to fetch them. I didn't bother with either the map or the smartphone, but reached my destination nevertheless. Cautionary tales notwithstanding, sometimes you just have to trust the old neural net's direction-finding capabilities. (Or at least that is what I keep telling myself!)

I also joined the non-exclusive group who uses a smartphone to photograph whiteboards prior to erasing them. I still have not succumbed to the food-photography habit, though. Taking a selfie with the non-selfie lens through a mirror is possible, but surprisingly challenging.

I have done a bit of ride-sharing, and the location-sharing features are quite helpful when meeting someone—no need to agree on a unique landmark, only to find the hard way that said landmark is not all that unique!

The smartphone is surprisingly useful for browsing the web while on the go, with any annoyances over the small format heavily outweighed by the ability to start and stop browsing very quickly. But I could not help but feel a pang of jealousy while watching a better equipped smartphone user type using swiping motions rather than a finger-at-a-time approach. Of course, I could not help but try it. Imagine my delight to learn that the swiping-motion approach was not some add-on extra, but instead standard! Swiping typing is not a replacement for a full-sized keyboard, but it is a huge improvement over finger-at-a-time typing, to say nothing of my old multi-press flip phone.

Recent foreign travel required careful prioritization and scheduling of my sole international power adapter among the three devices needing it. But my new USB-A-to-USB-C adapter allows me to charge my smartphone from my heavy-duty rcutorture-capable ThinkPad, albeit significantly more slowly than via AC adapter, and even more slowly when the laptop is powered off. Especially when I am actively using the smartphone. To my surprise, I can also charge my MacBook from my ThinkPad using this same adapter—but only when the MacBook is powered off. If the MacBook is running, all this does is extend the MacBook's battery life. Which admittely might still be quite useful.

All in all, it looks like I can get by with just the one international AC adapter. This is a good thing, especially considering how bulky those things are!

My smartphone's notifications are still a bit annoying, though I have gotten it a bit better trained to only bother me when it is important. And yes, I have missed a few important notifications!!! When using my laptop, which also receives all these notifications, my defacto strategy has been to completely ignore the smartphone. Which more than once has had the unintended consequence of completely draining my smartphone's battery. The first time this happened was quite disconcerting because it appeared that I had bricked my new smartphone. Thankfully, a quick web search turned up the unintuitive trick of simultaneously depressing the volume-down and power buttons for ten seconds.

But if things go as they usually do, this two-button salute will soon become all too natural!
inside

Weight-Training Followup

A couple of years ago I posted on my adventures with weightlifting, along with the dangers that disorganized and imbalanced weight-lifting regimes posed to the simple act of coughing.  A colleague pointed me to the book “Getting Stronger” by Bill Pearl.  I was quite impressed by the depth and breadth of this book's coverage of weightlifting, including even a section entitled “Training Program for Those over 50”.  Needless to say, I started with that section.

Any new regime will entail some discomfort, but I was encouraged by the fact that the discomfort caused by this book's “Over 50 Program” coincided with the muscles that had objected so strenuously during my coughing fits.  I continued this program until it became reasonably natural, and then progressed through the book's three General Conditioning programs.  Most recently I have been alternating three sets of the third program with one set of either of the first two programs, with between one and two weight workouts per week.  I fill in with stationary bicycle, elliptical trainer, or rowing machine for between three and five workouts per week.

I did note that my strength was sometimes inexplicably and wildly inconsistent.  On one exercise, where you kneel and pull down to lift a weight, I found that sometimes 160 lbs was quite easy, while other times 100 lbs was extremely difficult.  I could not correlate this variation in strength with anything in particular.  At least not until I made a closer examination of the weight machines.  It turned out that of the six stations, four provided a two-to-one mechanical advantage, so that when having randomly selected one of those four, I only needed to exert 80 lbs of force to lift the 160 lbs.  Mystery solved!  In another memorable instance, I was having great difficulty lifting the usual weight, then noticed that I had mistakenly attached to the barbell a pair of 35 lb weights instead of my customary pair of 25s.  In another case where an unexpected doubling of strength surprised me, I learned that the weights were in pounds despite being in a country that has long used the metric system.  Which is at least quite a bit less painful than making the opposite mistake!  All in all, my advice to you is to check weight machines carefully and also to first use small weights so as to double-check the system of measurement.

I initially ignored the book's section on stretching, relying instead on almost five decades of my own experience with stretching.  As you might guess, but this proved to be a mistake:  Decades of experience stretching for running does not necessarily carry over to weight lifting.  Therefore, as is embarassingly often the case, I advise you to do what I say rather than what I actually did.  So do yourself a favor and do the book's recommended set of stretches.

One current challenge is calf cramps while sleeping.  These are thankfully nowhere near as severe as those of my late teens, in which I would sometimes wake up flying through the air with one or the other of my legs stubbornly folded double at the knee.  Back then, I learned to avoid these by getting sufficient sodium and potassium, by massaging my plantar fascia (for example, by rolling it back and forth over a golf ball), by (carefully!!!) massaging the space between my achilles tendon and tibia/fibula, and of course by stretching my calf.

Fortunately, my current bouts of calf cramps can be headed off simply by rotating my feet around my ankle, so that my big toe makes a circle in the air.  This motion is of course not possible if the cramp has already taken hold, but rocking my foot side to side brought immediate relief on the last bout, which is much less painful than my traditional approach that involves copious quantities of brute force and awkwardness.  Here is hoping that this technique continues to be effective!
inside

The Old Man and His Smartphone, Episode VII

The previous episode speculated about the past, so this episode will make some wild guesses about the future.

There has been much hue and cry about the ill effects of people being glued to their smartphones.  I have tended to discount this viewpoint due to having seen a great many people's heads buried in newspapers, magazines, books, and television screens back in the day.  And yes, there was much hue and cry about that as well, so I guess some things never change.

However, a few years back, the usual insanely improbable sequence of events resulted in me eating dinner with the Chief of Police of a mid-sized but prominent city, both of which will go nameless.  He called out increased smartphone use as having required him to revamp his training programs.  You see, back in the day, typical recruits could reasonably be expected to have the social skills required to defuse a tense situation, using what he termed "verbal jiujitsu".  However, present-day recruits need to take actual classes in order to master this lost art.

I hope that we can all agree that it is far better for officers of the law to maintain order through use of vocal means, perhaps augmented with force of personality, especially given that the alternative seems to the use of violence.  So perhaps the smartphone is responsible for some significant social change after all.  Me, I will leave actual judgment on this topic to psychologists, social scientists, and of course historians.  Not that any of them are likely to reach a conclusion that I would trust.  Based on past experience, far from it!  The benefit of leaving such judgments to them is instead that it avoids me wasting any further time on such judgments.  Or so I hope.

It is of course all too easy to be extremely gloomy about the overall social impact of smartphones.  One could easily argue that people freely choose spreading misinformation over accessing vast stores of information, bad behavior over sweetness and light, and so on and so forth.

But it really is up to each and every one of us.  After all, if life were easy, I just might do a better job of living mine.  So maybe we all need to brush up on our social skills.  And to do a better job of choosing what to post, to say nothing of what posts to pass on.  Perhaps including the blog posts in this series!

Cue vigorous arguments on the appropriateness of these goals, or, failing that, the best ways to accomplish them.  ;-)
inside

The Old Man and His Smartphone, Episode VI

A common science-fiction conceit is some advanced technology finding its way into a primitive culture, so why not consider what might happen if my smartphone were transported a few centuries back in time?

Of course, my most strongly anticipated smartphone use, location services, would have been completely useless as recently as 30 years ago, let alone during the 1700s.  You see, these services require at least 24 GPS satellites in near earth orbit, which didn't happen until 1993.

My smartphone's plain old telephony functionality would also have been useless surprisingly recently, courtesy of its need for large numbers of cell towers, to say nothing of the extensive communications network interconnecting them.  And I am not convinced that my smartphone would have been able to use the old analog cell towers that were starting to appear in the 1980s, but even if it could, for a significant portion of life, my smartphone would have completely useless as a telephone.

Of course, the impressive social-media capabilities of my smartphone absolutely require the huge networking and server infrastructure that has been in place only within the past couple of decades.

And even though my smartphone's battery lifetime is longer than I expected, extended operation relies on the power grid, which did not exist at all until the late 1800s. So any wonderment generated by my transported-back-in-time smartphone would be of quite limited duration.  But let's avoid this problem through use of a solar-array charger.

My smartphone probably does not much like water, large changes in temperature, or corrosive environments.  Its dislike of adverse environmental conditions would have quickly rendered it useless in a couple of my childhood houses, to say nothing of almost all buildings in existence a couple of centuries ago.  This means that long-term use would require confining my smartphone to something like a high-end library located some distance from bodies of salt water and from any uses of high-sulfur coal.  This disqualifies most 1700s Western Hemisphere environments, as well as many of the larger Eastern Hemisphere cities, perhaps most famously London with its pea-soup "fogs".  Environmental considerations also pose interesting questions regarding exactly how to deploy the solar array, especially during times of inclement weather.

So what could my smartphone do back in the 1700s?

  • Record, store, and play back audio.  This seems unimpressive, but given Dom Pedro II's "My God it talks!" reaction to a demonstration of telephony, perhaps it might pique some interest.  Or provoke accusations of witchcraft, as the case might be.

  • Take, store, and display photos.  But it would not be possible to print them, so the services of an artist would still be required.

  • Edit photos.  However, this might not be seen as particularly valuable, especially given the need for an artist as printer.

  • Measure sound and light intensity (courtesy of Clifford Dibble).  It is not clear how valuable this would seem to our 1700s counterparts, but given the N-ray fiasco much later on, there can be no doubt that this would be quite useful.

  • Act as an electronic whiteboard, albeit a rather small one.  Chalkboards might be perceived as a better option, especially given that the services of a scrivener would be required to make any needed permanent records.

  • Store vast volumes of information.  A significant portion, and perhaps even all, of the 1700s English-language body of literature and technical works would fit into a single smartphone.  "A library that fits in yor pocket!"  Except that the device's long-term health would probably require it to be confined to an actual library with physical books, so perhaps it would be the searching capabilities that would be most useful.  And the most threatening to 1700s men of books, which might also provoke accusations of witchcraft.

  • Take, store, and display video.  This could be quite impressive.  However, making a permanent record would provide permanent employment for the aforementioned artist.

  • Act as a small flashlight.  Which is said to be the most frequent use for OLPC laptops, so this might well be the smartphone feature rated most valuable by our 1700s counterparts.

  • Act as a motion sensor.  I must confess that I was unable to come up with any applications of this feature that would be of any interest to my 1700s counterpart, but Maged Michael noted that it can be used as a compass and a level.  Given the right apps, anyway.  Perhaps given appropriate (yet to be written?) apps, this could be used for inertial navigation, perhaps for mapping caves.  But given that Peter Puget was able to produce an accurate map of significant portions of Puget Sound in about a week using a pair of rowboats, some oarsmen, and standard late-1700s navigational equipment, it is not clear that smartphone intertial navigation would be seen as all that valuable.

  • Tell time.  But is a smartphone's timekeeping all that accurate without the occasional contact with a cell tower, GPS satellite, or Internet timeserver?  If so, this would be a killer app for the Longitude Problem, but too bad about the electronics-unfriendly environmentals of 1700s ships.  And the fact that there would be only one smartphone, severely limiting its usefulness.

  • Human-language translation (courtesy of Clifford Dibble), at least assuming that the required translation dictionaries were downloaded ahead of time.  It is quite possible that simply displaying various translation dictionaries all in a small package would be more impressive to our 1700s counterparts than the actual translation.

  • Portable mathematical tables (courtesy of Clifford Dibble).  Although this would likely involve a scientific-calculator app, it is likely that the best way to explain this to our 1700s counterparts would be as a very compact set of mathematical tables.  The concept of a scientific calculator would likely need to come later, and perhaps much later if the 1700s counterpart in question was prone to accusations of witchcraft.  (Yes, I do still have my old and well-used copy of the CRC Standard Mathematical Tables along with a rather less well-used copy of Gradshteyn and Ryzhik.)

  • Act as a computer, at least assuming the requisite code-development environment was installed.  This could be quite impressive, assuming that you either had an app already or snuck away somewhere in order to carry out the debugging process.  I would guess that our 1700s counterparts would be thinking in terms of computing more accurate and more extensive mathematical tables.  Very meticulous scriveners would of course be required for this work.  Of course, this leads to really important questions, such as "What editors and computer languages would be most popular with our 1700s counterparts?"

I leave off any number of uses that involve ferrying information from 2019 back to the 1700s.  Even an accurate seacoast map could be quite useful and illuminating, but this topic has been examined quite closely by several generations of science-fiction writers, so I would not expect to be able to add anything new.  However, it might be both useful and entertaining to review some of this genre.  Everyone will have their favorites, but I will just list the three that came to mind most quickly:  Heinlein's "The Door into Summer", Zemeckis's and Gale's "Back to the Future" movies, and Rowling's "Harry Potter and the Cursed Child.&dquo; So let us proceed, leaving back-in-time transportation of information to today's legion of science-fiction writers.

The upshot of all this is that if my smartphone were transported back to the 1700s, it would be completely unable to provide its most commonly used 2019 functionality.  However, given a solar array charger and development environment, and given a carefully controlled environment, it might nevertheless be quite impressive to our 1700s counterparts.

In fact, it would be quite impressive much more recently.  Just imagine if, at the end of the Mother of all Demos, Douglas Engelbart had whipped out a ca-2019 smartphone.

But the hard cold fact is that in some ways, a 2019 smartphone would actually have been a step backwards from Engelbart's famous demo.  After all, Englebart's demo allowed shared editing of a document.  Lacking both wifi and a cell-phone network, and given the severe range limitations of NFC, my smartphone would be utterly incapable of shared editing of documents.

In short, although might smartphone might be recognized as a very impressive device back in the day, the hard cold fact is that it is but the tiniest tip of a huge iceberg of large-scale technology, including forests of cell towers, globe-girdling fiber-optic cables, vast warehouses stuffed with servers, and even a constellation of satellites.  Thus, the old adage "No one is an island" was never more true than it is today.  However, the bridges between our respective islands seem to be considerably more obscure than they were in the old days.  Which sooner or later will call into question whether these bridges will be properly maintained, but that question applies all too well to a depressingly broad range of infrastructure on which we all depend.

Which leads to another old adage: "The more things change, the more they stay the same".  :-)