The Night Before

My knee replacement surgery is tomorrow. I have to be at the hospital at 5:30 AM, which will be difficult enough in itself!

On Friday I decided to give my knee one last fling, so that I have a clear memory of how much I was limited by the arthritis. I did 15 minutes on the elliptical machine at the gym, and then later in the afternoon I hit a bucket of balls at the driving range. Well, I made it about 2/3 of the way through the bucket when I started to feel a twinge in my knee, so I gave the rest to the guy next to me and headed home.

For the past decade or so, I’ve dealt with my knee, as well as my other painful joints, by taking Aleve (naproxen sodium). If I knew I would be doing something active, I would take it ahead of time prophylactically, and always took it afterwards. This would keep the inflammation to a minimum. However, when you are having surgery, they make you stop taking all drugs a week ahead of time, as they can increase your chances of blood clots during surgery. So after my exertion during the day, my knee was throbbing pretty badly at night. The pain continued through the weekend, and it’s still present as I’m typing this. Obviously I had relied on Aleve to mitigate the pain in my knee so much that I had forgotten just how bad it could be.

I probably won’t be able to add to this blog for a few days, but I’ll try to remember as much of the experience as I can so I can write about it later.

Out With the Old (knee), In With the New

This coming Monday I’m having total knee replacement surgery. Neither of my knees is very healthy, but my left knee has been particularly painful. It’s been over a decade since there has been any cartilage between the bones of the knee, and all that wear and tear has taken its toll.

I tried to get my actual x-ray to illustrate this post, but that proved to be difficult, so here’s one I got off of Google Images:

knee xray
X-ray of a Normal knee vs Arthritic knee

Normally the bones are separated by cartilage, which allows them to move without much friction. My left knee’s x-ray looks almost exactly like the image on the right. I have had to have all the cartilage in that joint removed over the years, and now it’s “bone on bone”.

I’ve written about my physical ailments before, and for the past two years I’ve been despondent over this decline. Then this past November came the email from the state soccer referee representative informing us of the upcoming registration and re-certification for the 2019 season. I thought about my complete lack of involvement in soccer over the past two years: I reffed a few games in early 2017, and didn’t ref a single game in 2018. I had decided that I should face the truth and retire. I told my wife and family, and felt at peace at finally accepting that this was something I simply could no longer do.

But a couple of weeks later it started gnawing at me. I didn’t want to give this up without a fight. I told my wife that I was thinking about getting a knee replacement, with the goal of being able to ref a few games by the end of 2019. She was 100% behind me, so after the holidays I started looking around for a surgeon. After many hours researching knee surgeons in San Antonio, I found Dr. David Fox, and set up an appointment. We discussed what would be involved, and he didn’t sugar-coat anything. He told me to “expect 6 weeks of hell” after the surgery, as the recovery process involves doing a lot of physical therapy exercises that can be painful. Normally, people undergoing this surgery have to take 3–4 weeks (and sometimes longer) off of work, but as I work from my home, I can be back at work as soon as I’m off my pain meds and mentally clear.

I’ll be sure to follow the course of the surgery and recovery process in future posts. Now I’m ready for my 6 weeks of hell!

Using a Python virtual environment

This is a quick demonstration of how to create a virtual environment in Python3. I’m starting with an empty directory in ~/projects/demo. I then run the command to create a virtual environment:

ed@imac:~/projects/demo$ ll
ed@imac:~/projects/demo$ python3 -m venv my_env
ed@imac:~/projects/demo$ ll
total 0
drwxr-xr-x 6 ed staff 192B Jan 24 18:14 my_env

Note that the command created a directory with the name I gave it: ‘my_env’. Next we have to activate it. ‘Activate’ changes Python’s internal references to look for things such as which Python version to run, and where installed modules are placed.

ed@imac:~/projects/demo$ source my_env/bin/activate (my_env)ed@imac:~/projects/demo$

I have a bash script that changes the prompt to show the current Python environment; notice that after activating the prompt now starts with ‘(myenv)’.

Installed modules are located in the ‘site-packages’ subdirectory that’s a few levels deep. Let’s see what’s in this fresh virtual env’s site-packages:

(my_env)ed@imac:~/projects/demo$ ll my_env/lib/python3.6/site-packages/
total 8
drwxr-xr-x 3 ed staff 96B Jan 24 18:14 pycache
-rw-r--r-- 1 ed staff 126B Jan 24 18:14 easy_install.py
drwxr-xr-x 23 ed staff 736B Jan 24 18:14 pip
drwxr-xr-x 10 ed staff 320B Jan 24 18:14 pip-9.0.1.dist-info
drwxr-xr-x 6 ed staff 192B Jan 24 18:14 pkg_resources
drwxr-xr-x 34 ed staff 1.1K Jan 24 18:14 setuptools
drwxr-xr-x 12 ed staff 384B Jan 24 18:14 setuptools-28.8.0.dist-info

One of my favorite development tools for Python is the pudb debugger. To show that we can install a package, let’s try importing it first (and failing):

(my_env)ed@family-imac:~/projects/demo$ python
Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pudb
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'pudb'
>>> ^D
(my_env)ed@family-imac:~/projects/demo$

Now let’s install it using pip:

(my_env)ed@family-imac:~/projects/demo$ pip install pudb
Collecting pudb
Collecting urwid>=1.1.1 (from pudb)
Collecting pygments>=1.0 (from pudb)
Using cached https://files.pythonhosted.org/packages/13/e5/6d710c9cf96c31ac82657bcfb441df328b22df8564d58d0c4cd62612674c/Pygments-2.3.1-py2.py3-none-any.whl
Installing collected packages: urwid, pygments, pudb
Successfully installed pudb-2018.1 pygments-2.3.1 urwid-2.0.1
(my_env)ed@family-imac:~/projects/demo$

Let’s look at the site-packages directory after installing pudb:

(my_env)ed@family-imac:~/projects/demo$ ll my_env/lib/python3.6/site-packages/
total 8
drwxr-xr-x 10 ed staff 320B Jan 24 18:38 Pygments-2.3.1.dist-info
drwxr-xr-x 3 ed staff 96B Jan 24 18:14 pycache
-rw-r--r-- 1 ed staff 126B Jan 24 18:14 easy_install.py
drwxr-xr-x 7 ed staff 224B Jan 24 18:35 pip
drwxr-xr-x 9 ed staff 288B Jan 24 18:35 pip-19.0.1.dist-info
drwxr-xr-x 6 ed staff 192B Jan 24 18:14 pkg_resources
drwxr-xr-x 18 ed staff 576B Jan 24 18:38 pudb
drwxr-xr-x 9 ed staff 288B Jan 24 18:38 pudb-2018.1.dist-info
drwxr-xr-x 22 ed staff 704B Jan 24 18:38 pygments
drwxr-xr-x 34 ed staff 1.1K Jan 24 18:14 setuptools
drwxr-xr-x 12 ed staff 384B Jan 24 18:14 setuptools-28.8.0.dist-info
drwxr-xr-x 33 ed staff 1.0K Jan 24 18:38 urwid
drwxr-xr-x 7 ed staff 224B Jan 24 18:38 urwid-2.0.1.dist-info
(my_env)ed@family-imac:~/projects/demo$ python

Note that there are now entries for both pudb and its dependency, pygments. And to verify that it has been successfully installed:

(my_env)ed@family-imac:~/projects/demo$ python
Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pudb
>>> pudb.version
'2018.1'
>>> ^D
(my_env)ed@family-imac:~/projects/demo$

There’s a ton more to using virtual environments, but that should give you a start.

Encore

A few weeks ago I was fortunate enough to attend a show by David Byrne. I have seen him perform many times before, and he always put on a great show. He didn’t let us down this time either. After the last number, they bowed and walked off-stage to a standing ovation. The applause continued for a few minutes, and was then rewarded by an encore.

Did I worry that my applause wouldn’t be the decisive amount of noise to ensure that there was an encore? Of course not. When you are a member of the audience of a performance, it’s not about you, it’s about everyone. Of course if I didn’t clap they would have done the encore anyway, and if I had clapped twice as hard it wouldn’t have changed anything. The problem is expecting individual effects in a group context.

Voting is the same thing. It isn’t about you, the voter. It’s about everyone, the voters. When an election is held, vote your preference. Odds are, sure, it won’t make a difference. Your vote won’t be the single event that changes history. But it’s not supposed to be. Assuming that unless it is, it doesn’t matter is completely missing the point. Just as applauding (or not) for an encore, it is the response of the group that matters, not any single member of the group.

If you have the privilege to vote, and haven’t done so yet, make the effort to do so tomorrow. The collective action of those who might feel that they are powerless wields a hell of a lot of power.

My Electoral Dread

With the mid-term elections coming up in a few weeks here in the US, many of us are hoping for the “blue wave” that will help to counteract the extreme direction that the Trump regime has pulled this country. But having observed how things have been operating for the past two years, I can’t help but feel a sense of dread about what will happen.

One thing that has plagued politicians is being involved in a scandal. But in the Trump era, there are new scandals every day, sometimes so many at once that it’s hard to keep up. And I think that’s the plan: overwhelm people so that no single scandal gets any attention.

So this dread I feel is that on Election Day, there won’t be a few irregularities about the vote; there will be thousands and thousands. There will be so many that it won’t be possible to investigate them all. We will have no certainty about the results. There will be cries of fraud, but instead of taking them seriously, they will be met with the standard “you lost; get over it”. And as a result, the political arena will become more extreme than ever before.

I have never hoped that I am wrong as strongly as I do now.