George V. Reilly

Christmas Movies: Die Hard

We have three non-tra­di­tion­al Christmas movies that we watch almost every December, Die Hard, Die Hard 2: Die Harder, and The Ref.

Die Hards 1 and 2 are the best in the series. Although they seemed wildly over the top when they were made (1988 and 1990), they seem un­der­stat­ed compared to the thrillers that Hollywood pumps out now.

We saw Die Hard again tonight. Bruce Willis and Alan Rickman shine in their breakout roles. Willis exhibits the trademark cockiness that was already familiar from Moon­light­ing, but he’s not as obnoxious as he often was in later roles. Rickman gently nibbles the scenery as a terrorist turned master criminal.

USB 3 Drivers on a Lenovo E545

Emma’s been com­plain­ing for some time that USB devices only worked in one port on her Lenovo E545 laptop. The USB 2 port worked; the USB 3 ports didn’t.

I took a look at Device Manager, and I noticed that most of the USB nodes looked wrong. She went to the Lenovo website and downloaded two USB-related drivers, the AMD USB Filter Driver and the AMD USB 3.0 Driver. Between them, they fixed the problem and she now has all ports working.

This machine is running Windows 7. At some point, she wiped the machine to get rid of Lenovo crapware, and installed a clean copy of Windows 7. She downloaded a pile of continue.

Review: The Ax

Title: The Ax
Author: Donald E. Westlake
Rating: ★ ★ ★ ★ ½
Publisher: Grand Central Publishing
Copyright: 1997
Pages: 352
Keywords: crime, dark humor
Reading period: Nov 7, 2015

Burke Devore is a middle-aged middle manager at a paper mill, who’s been laid off for some time. There are too many others like him and they’re beating him out for the few positions in his field. In des­per­a­tion, he decides to eliminate the com­pe­ti­tion by placing a fake job ad­ver­tise­ment for others with similar skills and by killing them off.

Westlake is known for a variety of crime novels, including the light-hearted, humorous Dortmunder books. There’s humor here, but in a very dark vein, and social continue.

History of Toilet Paper

Let me tell you, people go on and on about what a great idea electricity was, but I'm going to put toilet paper right next to the wheel and say those are the best ideas anyone's ever had. Scoff at it if you will, but try living for two millennia without it and then we'll talk. - Kevin Hearne

At Freely Speaking Toast­mas­ters tonight, Kim gave a talk on the History of Toilet Paper. It was inspired by the quote above from the Iron Druid Chronicles, by a 2000-year-old druid.

She got much of her in­for­ma­tion from wikipedia. I found the toilet paper FAQ while writing this post.

At FSTM, after the speech evaluator gives the speaker a formal evaluation, we have five minutes of open evaluation from the audience.

My father has a hundred or so sayings that he trots out again and again and again—much to the annoyance of those who know him well. When he moved from the Dublin to the London office of his bank in the

continue.

Christmas Puddings

I spent a couple of hours this evening making Christmas Puddings. I soaked several pounds of dried fruit overnight in hot water with a little whiskey. The fruit plumped up con­sid­er­ably. I let it drain throughout the day.

The photo shows the puddings in their bowls just before I sealed them and put them into the oven for four hours of steaming. They’ll get another four or five hours tomorrow. When we’re ready to eat one, it’ll get another hour of steaming to heat it up. We decant it from the bowl, stick a sprig of holly in the top, heat a tablespoon of whiskey until it catches fire, and pour the flaming continue.

Python Print Formatting

On Stack­Over­flow, someone wanted to print triangles in Python in an M-shape. Various clumsy solutions were offered.

Here’s mine which uses the left- and right-jus­ti­fi­ca­tion features of str.format.

Putting them together:

.. code:: pycon
>>> WIDTH = 4
>>>
>>> for a in range(1, WIDTH+1):
...     print("{0:<{1}}{0:>{1}}".format('*' * a, WIDTH))
...
*      *
**    **
***  
continue.

Review: Star Fall

Title: Star Fall
Author: Cynthia Harrod-Eagles
Rating: ★ ★ ★ ★
Publisher: Severn House
Copyright: 2015
Pages: 256
Keywords: mystery, police procedural
Reading period: Nov 28–Dec 3, 2015

Rowland Egerton, star of a popular antiques TV show, is found murdered in his London home. When Detective Inspector Bill Slider and his team in­ves­ti­gate, they uncover sordid secrets unknown to the British public.

This was a witty and en­ter­tain­ing police procedural, showing both the working and home lives of Slider and team.

Review: Grace of Kings

Title: Grace of Kings
Author: Ken Liu
Rating: ★ ★ ★ ★
Publisher: Saga Press
Copyright: 2015
Pages: 614
Keywords: fantasy
Reading period: Oct 1–Dec 2, 2015

Loosely modeled on the rise of the Han dynasty, Ken Liu’s fantasy tells us of two men who rise up to challenge the emperor. Kuni Garu, the wily and wise one-time bandit, and Mata Zyndu, the warrior scion of a deposed noble clan, are friends initially but fall out. The gods are at play in the affairs of men and they take pleasure in causing trouble and strife.

I enjoyed the novel, but I disliked the pace at which Liu galloped through events.

More

Microsoft Natural Keyboard 4000 on Mac OS X 10.11: Alt/Windows key no longer swapped

When I upgraded my home and work MacBooks to OS X 10.11 (El Capitan), the single biggest annoyance for me was that my external keyboards, all Microsoft Natural Keyboard 4000s, no longer swapped the Alt & Windows key.

By default, when a PC keyboard is plugged into a Mac, the Alt key, which is im­me­di­ate­ly to the left of the spacebar, is mapped to the Alt/Option key, which is two keys left of the spacebar on a Mac keyboard. And the Windows key, which is two keys to the left of the spacebar on a PC keyboard, is mapped to the Command key, which is next to the spacebar on a Mac keyboard.

On a Mac, continue.

Explaining the epilog of fnmatch.translate, \Z(?ms)

I was debugging a filtering directory walker (on which, more to follow) and I was trying to figure out the mysterious suffix that fnmatch.translate appends to its result, \Z(?ms).

fnmatch.translate takes a Unix-style glob, like *.py or test_*.py[cod], and translates it character-by-character into a regular expression. It then appends \Z(?ms). Hence the latter glob becomes r'test\_.*\.py[cod]\Z(?ms)', using Python’s raw string notation to avoid the backslash plague. Also, the ? wildcard character becomes the . regex special character, while the * wildcard becomes the .* greedy regex.

A Stack­Over­flow answer partially explains, which set me on the right track. (?ms) is equivalent to compiling the regex with re.MULTILINE | re.DOTALL. The re.DOTALL modifier makes the . special character match any character, including newline; normally, continue.

Previous » « Next