George V. Reilly

LastPass and Diceware

My LastPass browser plugin just upgraded itself to v4.0. For several years, I’ve been using LastPass to manage all of my passwords. I have literally hundreds of passwords. I can’t even remember half the sites, much less the usernames. With LastPass, I can maintain a strong, distinct password for each site, which is robustly encrypted and backed up in the cloud, and I get good browser in­te­gra­tion and adequate Android in­te­gra­tion. We also use LastPass at work for our individual use and to share cre­den­tials.

There are still a handful of passwords that I have to remember and type, including the master password for my LastPass account, laptop passwords, and GPG passphras­es.

I’ve long used continue.

Review: Hide Me Among The Graves

Title: Hide Me Among The Graves
Author: Tim Powers
Rating: ★ ★ ★ ★
Publisher: William Morrow
Copyright: 2012
Pages: 544
Keywords: fantasy, secret history
Reading period: 2 December, 2015–6 January, 2016

The Rosetti siblings, Christina, Dante (Gabriel), Maria, and William, are haunted by the vampire who was once their uncle, John Polidori. The vampires pos­ses­sive­ly love certain humans and grant those humans great powers of creativity. Christina both loves her uncle and yearns to be free of him. The other humans who receive the attentions of the vampires likewise feel both a forbidden attraction and a horrified repulsion at their own potential damnation.

Tim Powers is known for his “secret histories”, wherein he takes historical events continue.

Decrementing Loops

The canonical for-loop in C and C++ is written thus, counting up i = 0, i = 1, …, i = N-1:

for (int i=0; i < N; i++) {
    // loop body

(In C, you have to declare int i before the for-loop.)

Let’s unpack that for-loop into an equivalent while-loop:

int i = 0;
while (i < N) {
    // loop body
    i = i + 1

In other words, we initialize i to zero. Then, before every execution of either loop, we check i < N. If i is still within bounds, we execute the loop body. Then we postin­cre­ment continue.

Obfuscating Passwords in URLs in Python

New MetaBrite Dev Blog post, Ob­fus­cat­ing Passwords in URLs in Python.

My Recent Reading

The ac­com­pa­ny­ing photo shows most of the books that I’ve read between late September 2015 and January 2nd:

Review: The Red Road

Title: The Red Road
Author: Denise Mina
Rating: ★ ★ ★ ★
Publisher: Back Bay Books
Copyright: 2014
Pages: 320
Keywords: police procedural, tartan noir
Reading period: 31 December, 2015–2 January, 2016

Glasgow DI Alex Morrow is trying to put a dangerous criminal back in prison, but she can’t explain how his prints were found at the scene of a recent murder when he was already in custody. Fifteen years ago, when Rose Wilson was a sexually abused 14 year old, she was re­spon­si­ble for two deaths in one night, but only did time for one culpable homicide. Now the lawyer who saved her is dead and coverups are unraveling.

In other hands, this tale continue.

Thanks for Making a Mess

Emma and I have a bargain. If one of us cooks a nice dinner, the other cleans up. While I can and do cook, Emma does most of the cooking. Therefore, I do most of the cleaning.

I always thank Emma during dinner for the meal, and Emma invariably thanks me for cleaning when I’m washing pots and pans. I—a lifelong smar­tass—usu­al­ly respond, "Thank you for making a mess."

So far, she’s taken this with good grace—prob­a­bly better than I deserve. In truth, the cleanup is usually far quicker than the cooking.

Review: The Magician's Land

Title: The Magician’s Land
Author: Lev Grossman
Rating: ★ ★ ★ ★ ½
Publisher: Plume
Copyright: 2014
Pages: 416
Keywords: adult fantasy
Reading period: 26–29 December, 2015

[Sequel to The Magician King]

At the beginning of The Magician’s Land, Quentin Coldwater is in exile from Fillory. After a brief sojourn of teaching at Brakebills, where he researches an enormously complex spell he found in the Nei­ther­lands, he is fired and Plum, a student, is expelled. A mysterious summons draws them into a magical heist, which goes awry. Meanwhile, Fillory is dying and Eliot, Janet, Josh, and Poppy are trying to save it.

Quentin has matured over the trilogy, emo­tion­al­ly and as a magician, rising to the daunting challenges "He was continue.

Python: a use for nested list comprehensions

I wanted to turn a list like ['*.zip', '*.pyc', '*.log'] into ['--exclude', '*.zip', '--exclude', '*.pyc', '--exclude', '*.log'].

A simple list com­pre­hen­sion doesn’t work as desired:

In [1]: excludes = ['*.zip', '*.pyc', '*.log']

In [2]: [('--exclude', e) for e in excludes]
Out[2]: [('--exclude', '*.zip'), ('--exclude', '*.pyc'), ('--exclude', '*.log')]

The trick is to use a nested com­pre­hen­sion:

In [5]: [arg for pattern in excludes
             for arg in ['--exclude', pattern]]
Out[5]: ['--exclude', '*.zip', '--exclude', '*.pyc', '--exclude', '*.log']

Free ebooks from Springer

Via Hacker News, "All Springer Textbooks More Than 10 Years Old Available for Free Legal Download".

This includes books from Apress as well as a ton of those im­pen­e­tra­ble gray-and-red Lecture Notes in Computer Science books.

Update 2015-12-30: No longer available. Springer aren’t commenting. Presumably a mistake.

Previous » « Next