George V. Reilly

Undeleting Notes in Evernote

I ac­ci­den­tal­ly deleted a note that I shouldn’t have in Evernote. It wasn’t obvious how to undelete it. I had to resort to the help:

Review: The Silent Twin

Title: The Silent Twin
Author: Caroline Mitchell
Rating: ★ ★ ★ ½
Publisher: Bookouture
Copyright: 2016
Pages: 344
Keywords: police, paranormal
Reading period: 3 June–10 July, 2016

Abigail has gone missing from creepy Blackwater Farm days before her tenth birthday. Her twin Olivia has been mute ever since. Their strange mother is not helping matters and the father is acting oddly too. DC Jennifer Knight, who belongs to a secret psychic police task force, is the family liaison officer. She must convince Olivia to break her silence and reveal what she knows before time runs out for Abigail.

This was a reasonably good thriller that I think would have been better without the su­per­nat­ur­al elements.

Review: Thor: Dark World

Title: Thor: Dark World
Director: Alan Taylor
Rating: ★ ★ ★ ½
Released: 2013
Keywords: Marvel, superhero
Watched: 16 July, 2016

Millenia ago, the Dark Elves almost destroyed the Nine Realms with their ultimate weapon known as the Aether. Now the Con­ver­gence, when the Nine Realms briefly align, is imminent and the surviving Dark Elves have returned to reclaim the Aether. Meanwhile on Midgard (Earth), as­tro­physi­cist Jane Foster discovers portals linking the realms, whereupon she in­ad­ver­tent­ly becomes the host of the Aether. Thor rescues his lover and brings her to Asgard. Many battles ensue across the Nine Realms as Thor prevents the Elves from invoking the Aether at the Con­ver­gence.

I preferred the first Thor film to continue.

Review: Elysium

Title: Elysium
Director: Neill Blomkamp
Rating: ★ ★ ★ ★
Released: 2013
Keywords: sf
Watched: 15 July, 2016

By 2154, the rich have moved off-planet to a utopic habitat, while the teeming billions languish in slums below. Elysium has Med-Bays which can cure anything; Earth scrapes by. Max (Matt Damon), an ex-con des­per­ate­ly in need of a cure, agrees to shoot down the shuttle of an Elysian CEO and hijack his brain. This lethal variety of industrial espionage leaves him holding the keys of the kingdom and makes him Los Angeles’ most wanted.

Blomkamp has taken the ever-growing gap that exists between rich and poor today, and ex­ag­ger­at­ed it into an un­scaleable cliff with the have-nots continue.

SQLAlchemy got me Killed

I ran a script this afternoon that died mys­te­ri­ous­ly without any output. It was using SQLAlchemy to query all the rows from a large table so that they could be trans­formed into JSON Lines to be loaded into Elas­tic­search. When I reran my script, I noticed this time that something had printed Killed at the very end.

A little research convinced me that the OOM Killer was the likely assassin. I looked in /var/log/kern.log and I found that my process had used up almost all of the 8GB on this system before being killed.

The query had to be the problem. A little more research led me to augment my query with continue.

Disabling Vibrating Notifications in the Facebook Android App

I’ve had to figure this out twice in recent months, and it was no easier the second time than the first.

If you reinstall the Facebook app on Android, you will be plagued by the phone buzzing every few minutes to notify you that someone posted something.

The relevant setting is buried deeply.

Python: Joining URLs with posixpath.join

On Mac/Linux, os.path.join is an alias for posixpath.join, which always joins path segments with /. On Windows, os.path.join is an alias for ntpath.join, which always uses \. When dealing with URLs, we always want forward slashes, regardless of platform, so posixpath.join should be used to build URL paths.

Running:

from __future__ import print_function

from six.moves.urllib_parse import urljoin as abs_urljoin
from posixpath import join as path_urljoin

def urljoin(site, path):
    return abs_urljoin(site, path)

def test_join(site, path):
    result = urljoin(site, path)
    print("'{0}' + '{1}'\n\t-> '{2}'".format(site, path, result))
    return result

local_path = path_urljoin('2016', '07', '12', 'release', 'index.html')

test_join('https://www.example.com', 'foo/bar/quux.js')
test_join('https://www.example.com', local_path)
test_join('https://www.example.com/', local_path)
test_join('https://www.example.com/prefix', local_path)

Yields:

'https://www.example.com' + 'foo/bar/quux.js'
   
continue.

Logging in Python: Don't use new-fangled format

Python 2.6 introduced the format method to strings. In general, format is now the preferred way to build strings instead of the old % formatting operator.

One exception is with the logging module, where the best practice is to use %s and %d. Why? First, %s is the idiomatic way to use logging, which was built years before format was introduced. Second, if there’s a literal % in the in­ter­po­lat­ed values, logging will be unhappy, since there won’t be cor­re­spond­ing arguments in the call. It won’t fall over, since “The logging package is designed to swallow exceptions which occur while logging in production. This is so that errors which occur while handling logging events - continue.

Review: Flashman and the Mountain of Light

Title: Flashman and the Mountain of Light
Author: George MacDonald Fraser
Rating: ★ ★ ★ ★
Publisher: Plume
Copyright: 1990
Pages: 368
Keywords: historical fiction, humor
Reading period: 29 June–10 July, 2016
Flashman Papers IX: 1845–46

Flashman and the Mountain of Light takes place just after Flashman’s Lady, and it also falls between the two parts of Royal Flash, making it the fourth book chrono­log­i­cal­ly of the Flashman Papers and the ninth book published.

In the prologue, our hero finds himself telling Queen Victoria a much-edited version of how he came to acquire the Koh-i-Noor diamond on the crown’s behalf forty years earlier during the First Anglo-Sikh War. The actual story—at least according to Flashman and Fraser—is that continue.

Black Lives Matter: Alton, Philando, and Dallas

What an awful week for race relations in the United States of America. On Monday night, Alton Sterling was shot and killed by Baton Rouge police. One night later, Philando Castile was shot and killed by police in Minnesota. Both men were black and neither was resisting arrest. Both shootings were caught on video, which inflamed passions. On Thursday night at a peaceful rally in Dallas protesting police violence, two snipers killed five police officers and wounded seven others. Micah Johnson was later killed by police in a standoff; three others were arrested.

The police should not have killed Alton Sterling or Philando Castile—or Tamir Rice or Freddie Gray or continue.

Previous » « Next