A Pixie has Stolen My Heart

We have a little Maltipoo puppy. We named her Pixie Woo. I think she imprinted on me. When we were at the breeders to pick out a dog, she stood up on her hid legs and and begged me to pick her up. I did. She rode home on my lap and by the time we got home, I was her human.

My wife tells me that Pixie cries for half an hour every morning after I leave for work. When I get home in the evening, she barks with glee and dances around on her hind legs until I pick her up and give her a hug.

And the affection goes both ways. I have never had a pet that I loved like her. She is such a smart girl. She has a large vocabulary and it’s growing all the time. She knows steak, chicken, and fish. She knows carrot and greenie. She loves carrots and greenies.

My wife plays a game with her where she gets her nose while saying “Boop!” She decided to be the “booper” and jumps up and tags our nose when we are playing the game.

When I call my wife to make plans for dinner, she asks our dogs what they want to eat. She goes through a list of possibilities. When she says something that they want, they high-five her.

I have spent a good part of my life studying computer science with the goal of creating artificial intelligence. Part of the challenge is coming up with a test for determining whether a program is exhibiting intelligence behavior or is just doing what it has been programmed to do. By all criteria I can think of both my dogs are extremely intelligent. But Pixie more so than Belle our older Maltipoo. One thing is for sure, I am lucky to be the human of such an intelligent, affectionate little dog.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

Ode to British Television

The BBC makes such exquisite documentaries. For instance, tonight they are running a documentary on Paris of 1928. He has taken us to the places where people were meeting, where the artists lived, where the musicians played. They explore the reasons that people flocked there. The philosophical and artistic ideas that it inspired. I am a big fan of PBS but the BBC outshines it in almost every way.

There are a few PBS shows that can hold their own though. Ken Burns’ documentaries illuminate American History in a style uniquely his. And of course Austin City Limits showcases the best of our musical talent. There are others but those two stand out in my mind.

I think it is probably because American television entrepreneurs are more interested in broad popularity. Thus we have Seinfeld where they have The Office. They sometimes attempt to import some of their shows to American television with mixed success. On the other hand, they have produced such extremely popular shows as Dr. Who and Sherlock. But these are not the Crown Jewels of British television.

Such shows as Midsomer Murders, Poirot, and Jeeves are just a few examples of the highest standards of both production and story telling. I’m obviously a hopeless anglophile but I think even those not nearly as obsessed with all things British will agree that the British produce engaging television.

The documentaries are the hidden gems though. They are usually standalone offerings on a given topic. They rarely exceed an hour and a half duration. But they inspire enthusiasm whatever their topic.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

Fibonacci Fun with Python

I’ve been playing with numbers with Python. I wrote a function that returns the nth Fibonacci number. Fibonacci numbers are generated by taking zero and one as the first two numbers, then adding the previous two Fibonacci numbers together to yield the next one. The next Fibonacci number after 0 and 1 is also 1 since 0+1=1. The next one is 2. The next one is 3. The next one is 5. And so on. Strictly speaking, the first Fibonacci number is 1 since there is another trait that Fibonacci numbers exhibit and 0 can play no part in that. Given two successive Fibonacci numbers, the ratio of the greater to the lesser of the two will tend toward the golden mean or phi.

The golden mean is approximately 1.61803398875 although, like pi, it is an irrational quantity that has no exact expression. It can be written as the expression (1 + square_root(5))/2. It is the square_root(5) term that makes the number irrational. But, if you will notice, 1/1 is 1, 2/1 is 2, 3/2 is 1.5, 5/3 is approximately 1.667 and as you continue to compute the ratio with larger and larger Fibonacci numbers, the result gets closer and closer to phi.

Phi is an interesting quantity. It shows up in many places in nature. Some of the claims about it, for instance that it is evident in the logarithmic curve formed by a Nautilus shell, have been disproven by empirical study. Others, like the fact that the ratio of the length of a diagonal of a regular pentagon to the length of one of its sides is phi, are on sound footing. In any case, computing Fibonacci numbers and phi can be an interesting pastime.

I found a simple function in Python that yields the nth Fibonacci number in relatively short order without having the unfortunate side effect of consuming the entire stack.


def fib(n):
a,b = 0, 1
for x in xrange(n):
a,b = b, a+b
return a

view raw

gistfile1.txt

hosted with ❤ by GitHub

This function takes an integer argument n. It initially sets a to 0 and b to 1. Python allows you to set multiple values with one assignment statement as shown in line 2 above. Then, for  a variable x assigned to every value between 0 and n-1, which is to say n times, you set a to b and b to (a+b). When you are done, you return a because it will be the nth Fibonacci number.

I learned several things while writing this blog post. First, when you are computing Fibonacci numbers, the values get large very fast. For example, the 100th Fibonacci number is 21 digits long. The 1000th Fibonacci number is 209 digits long. Another thing I learned is that the square root symbol does not render as such in a standard web page. I am somewhat baffled by that as it renders fine in the WordPress editor. Perhaps I will discover a way around this.

I also learned how to use GitHub to create a gist, that short block of code above. A gist allows you to display the program formatted as it would be in a code editor instead of formatted as prose as it would be if typed directly into the blog post.

I learned other things tonight but I don’t intend to belabor this post with a lengthy explanation of everything I learned. Perhaps another night.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

Features Running Out My Ears

I’ve had my new MacBook Pro since right before Christmas last year. That’s roughly four months. I finally got around to setting the default font size on the terminal application to a size that I can read without having to lean forward. Font sizes are expressed in points. 72 points is supposed to be an inch but characters are drawn on the screen by turning pixels on or off. The problem occurs when the number of pixels per inch changes, typically becoming greater. Then where there were say 2 pixels per point before there are now 3 or 4 pixels per point. If the program hasn’t been written to be aware of the different pixel densities between models of computer, the font appears smaller than it should on the newer computer.

I knew all of this, but I just couldn’t be bothered to take a couple of minutes to figure out where the preference setting was to change the default font setting on my computer. Now that I have, using the terminal program is a lot more comfortable.

That isn’t the only thing that I haven’t taken advantage of much yet. For example, the latest version of MacOS has a feature where you can split your screen between two applications, one taking up the left half of the screen the other taking up the right half of the screen. This is an ideal way to read directions on a web page with the browser in one half of the screen and follow them with another program on the other half of the screen, An instance from earlier today will show what I mean.

I was using the Python programming environment called Spyder, I needed to look up a detail about the language. Instead of switching back and forth between the two applications I put Spyder on the left side of the screen and Safari (the Apple web browser) on the right. That way, I could see both the Python manual in the browser and the program that I was writing at the same time.

There are a lot of things like that in our fast paced technological world. We learn to do something one way with our computer or phone or whatever. Then when they add a convenience feature we don’t even think to use it until long after we’ve upgraded our device.

Perhaps the point is, we should take a little bit of time every now and then to explore the features of our devices. We might find that they are even more useful than we knew.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

Python For The Win

Today I remembered what I love about programming. It’s that feeling that you get when you know what you want to accomplish. You have an idea of how to start realizing your vision. You are comfortable with your tools, that is the language and the editor that you are using to write your opus. With these elements in place you are set to experience flow. Flow is a state of mind, studied and characterized by Mihály Csíkszentmihályi, where the task at hand is difficult enough to be engaging but not so difficult that you get stuck trying to accomplish it. As you finish one task, the next one becomes apparent to you. It is an exhilarating feeling.

What happened today is that I found a Python package called openpyxl that allows you to read and write Excel files from Python. This was the solution that I was looking for to my problem with analyzing large data sets stored in an Excel spreadsheet. I had been struggling to do it with VBA (Visual Basic for Applications) but I found it to be difficult to use. I found plenty written on it but nothing that spoke to my problem domain. If anything, there were too many mediocre books targeted at spreadsheet power users that were novice programmers. I am the opposite, a casual spreadsheet user that is an expert programmer.

I figured out after I thought about it for a while that experienced programmers just weren’t going to put up with a language as shabby as VBA. Not only was it a bad language but it had no standard definition and was proprietary to Microsoft. Consequently, it was subject to Microsoft’s favorite ploy of making radical changes to the behavior of the language from one version of the product to the next. It made no sense to me to invest any significant amount of effort into crafting a solution only to have to entirely redo it at the next release of Excel.

To summarize, I made more progress today than I would have in a week with VBA. And as a bonus benefit, my code is readable to the large and ever growing cadre of Python programmers. It was a brilliant idea and I’m still floating on air over having figured it out.

Basic was a good first cut at a first language but we have learned a lot about how computer languages should work since it was first released in 1964. Bill Gates and Paul Allen started Microsoft with Microsoft Basic in 1975 and it was a clever implementation that made the limited resources of the early personal computers more approachable by total computer novices. In the intervening 42 years, we have developed a number of languages that fill the niche that Basic originally targeted much better.

Python has become very popular for both casual scripting and implementation of large projects. It has the inertia associated with a large user community and a responsive team of implementors. There is a clear definition of the language and a carefully controlled process governing the evolution of the language. I can develop in it with confidence that my work won’t be rendered obsolete by the next release of the language.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

Stone Knives and Bearskins

Thirty seven years ago I briefly worked for a little startup based in Hoover, Alabama, which is a suburb of Birmingham. The personal computer era was just dawning and this company was selling personal computers to small businesses and writing software to fit their needs. The computers were from an outfit known as Ohio Scientific and the software was written in a very early version of Microsoft Basic.

This version of Microsoft Basic provided two letter variable names and all variables were globally visible. That means that if you used a variable in a subroutine you couldn’t use it anywhere else in the program without clobbering it every time you called the subroutine. And recursion was definitely not supported. I spent a month debugging a primitive Numeric Control compiler that I wrote in that Basic. I swore I’d avoid writing any software in Basic after that.

Flash forward to the present and I find myself trying to automate analysis of a large data set that is stored in an Excel spreadsheet using Microsoft’s Visual Basic for Applications (or VBA as they like to call it). I will admit, it is slightly improved over the language that gave me fits four decades ago. But, it is still giving me fits. I am in the unenviable position of being too aware of what I want to automate and too ignorant of the mechanisms that might help me achieve that automation in VBA.

I have made a cursory search for solutions to my problem and so far I have learned several things. First, most people that are using VBA are not experience programmers, they are Excel power users. I, on the other hand am an experienced programmer and at best a proficient beginner with Excel. I have been using spreadsheets for twenty five or thirty years but haven’t progressed much farther than summing a column of figures.

Another thing that I’ve learned is that there are hundreds of books that teach you how to use Excel. Most of these have a chapter or two on writing VBA macros. Macro is what Microsoft calls VBA subroutines and functions to try to make them seem less intimidating to non-programmers. Truth be told, if you are writing VBA macros you are writing programs. There are  even some books that are narrowly focused on writing VBA macros but these all seem to assume that you are already an Excel power user.

I am reminded of the Star Trek episode (City on the Edge of Forever) where Mr. Spock explains “I am endeavoring, ma’am, to construct a mnemonic memory with stone knives and bearskins.” That is what it feels like trying to write analysis software in VBA.

There are other options. I will investigate them. One that comes to mind is to use a more rational language like Python to manipulate the data using one of the libraries that allow you to read and write to Excel spreadsheets from Python. It will probably be a lot better, for me at least, than struggling with VBA. It certainly couldn’t be any worse.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

Getting Old is Not For Wimps

I remember one of the first science fiction books that I ever read was A Wrinkle in Time by Madeleine L’Engle. I was a preteen at the time and identified strongly with the protagonist. I think I was vaguely aware that there was a sequel but I didn’t know that she had written so many books in the series.

I’m discovering a lot of things that I have managed to miss in my life. Everything from musicians to authors, movies to paintings. I would love to be able to devote more time to listening, reading, and watching these newly discovered works.

I’ve also been listening to songs with an ear to hearing the bass part. My acoustic electric bass will be here soon and I want to have some new bass licks to try out. I am so excited about this bass. It is a marvel of engineering and a beautiful piece of woodwork all in one.

But the sad truth of the matter is that work takes most of my energy and I find myself nodding off when I sit still for just a moment at home. I have managed to maintain my writing regime but it has been at the expense of so many of my other interests. I need some of the misspent energy of my youth.

I guess I should be thankful I’m still alive and in fairly good health. Thankfulness is important to feeling good about yourself and your place in the world. I will do whatever I can and have fun doing it. I won’t worry about anything that falls off my plate. That’s my plan right now anyway. We’ll check up on how my plan pans out in a couple of months.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

I’m From Missouri, Philosophically At Least

I am not a religious person. I am a spiritual person but religions bother me. They all pretend to have inside information about God or Gods and what they require of humanity. The problem is, all I have is some person’s word that they know what God wants. I don’t buy the argument that I should take them at their word on faith. If God did in fact create me, why would he/she/they give me my senses to perceive the world with and my brain to reason about it if he/she/they didn’t want me to demand proof.

This does not mean that I am an atheist however. I think that atheists are just as radical as fundamentalist. They pretend to know that there is no God. I don’t think that can be known absolutely. If their is a deity or deities, I see no reason why they would bother to make themselves known to man. Do we tell ants what we have planned for them? Do we even have plans for them? Or maybe amoebas would be more apropos.

In any case, as you probably have guessed now, I am an agnostic. A spiritual agnostic, but an agnostic none the less. I don’t know if there is a God or not. I sometimes hope that there is a God and that he or she or it actually cares about me as an individual or even mankind as a race. It seems a long stretch to me though.

I certainly don’t believe that any person has been given exclusive access to the wisdom of a deity. I believe that if a deity were going to reveal a message to mankind, it would be to all mankind. It would be accompanied by some form of evidence sufficient to convince our mortal minds of the veracity of their deity.

But then I am a romantic. I like things that are done with a flare. I may be entirely wrong. I am willing to admit it. I just don’t like anyone preaching at me.

I sometimes think I observe miracles. When I do, I invariably find that there are scientific explanations behind what I have seen. That needn’t reduce the sense of wonder that such things inspire. It just doesn’t seem necessary to give anyone credit for it. The rains come, the crops grow, we are fed for another year. It is miraculous but it doesn’t need a deity to make it so.

Yes, I am a skeptic. That doesn’t mean that I reject all claims of the paranormal. I keep the grain of skepticism at the ready though. If any phenomena is so sensitive to the energy of my skepticism that it can’t exert its effect while I am skeptical, I think it is just a ruse covering up opportunistic exploiters of circumstances or just plain frauds, depending on how charitable I’m feeling at the time.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

It’s Got a Backbeat

I have ordered an acoustic electric bass. It is made by Taylor and is a marvel of engineering. They have managed to make a bass guitar that is the size of it’s six string counterpart, the GS-mini. In fact it is called the GS-mini bass. They also had to work with string manufacturer D’Addario to build a string that would work both acoustically and mechanically as bass strings on a neck that was substantially shorter than usual.

I am so excited. I have always loved playing other people’s basses. It is going to be great to have one that fits my apartment lifestyle. Since I placed my down payment on the bass, I have found myself paying closer attention to the bass lines of songs that I an listening to. I have always loved Paul McCartney’s bass lines but they often fade into the background behind the guitars and vocals.

I love walking bass lines. The song Step Right Up by Tom Waits that I blogged about the other day is a good example of walking bass. There are a number of Joni Mitchell’s songs from the era when Jaco Pastorius was playing bass with her that are worthy of study. Jaco used to call frets speed bumps. I think I probably need to learn to play bass with speed bumps before I give it a try without them. I love the glissandos that you can do on a fretless bass though.

A good bass line provides a foundation upon which great songs can be built. It is often overlooked but is conspicuous by its absence when it is not present in a song. It is said to provide the backbone of the music. Listen for the base line the next time you listen to music. I bet you’ll be surprised at how much it adds to the song.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

There’s Just One More Thing…

What is it about mysteries that hold our attention so strongly? Even when we know who committed the crime we are desperate for details. It is like a giant jigsaw puzzle and we are trying to see the pattern in the pieces as we fit them together one by one. We are called upon to judge the veracity of each witness’ testimony. We are often called upon to use our experience of human psychology and our observations of human behavior to deduce what actions make sense and which ones are suspicious. And yet, it is not just an intellectual activity but also an emotional one.

We want the good guys to win and the bad guys to get caught. We are disturbed when our expectations are not met. When the good guys are corrupt and the bad guys have laudable motives it rankles.

On the other hand, we love to see the detective get led down dead ends following up on red herring leads. Especially when we have been given all the same evidence that the detective has and have managed to avoid the red herrings.

In the last twenty years or so detective stories have divided into two separate categories, the forensic procedural where the science is the star and the detectives just do the leg work to collect more physical evidence, and the psycho drama where the detective has to immerse themselves in the psychology of the suspect to figure out what he did and how he did it. Both are equally valid approaches.

When boiled down to the basics, most mysteries are quests for the solution to the puzzle. How did the criminal pull of the crime? How are they attempting to escape incarceration? What inventive schemes did they come up with to attempt their crime and how does the detective thwart them? Figuring out these details is the job of the mystery writer. Unveiling these details in such a way that the reader figures out the mystery just as the detective solves it is part of the art of the genre.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.