Technology

How Journalists Covered the Rise of Mussolini and Hitler

Bundesarchiv bild 146 1969 065 24 munchener abkommen ankunft mussolini wr jpg 800x600 q85 crop

When Hitler’s party won influence in Parliament, and even after he was made chancellor of Germany in 1933 – about a year and a half before seizing dictatorial power – many American press outlets judged that he would either be outplayed by more traditional politicians or that he would have to become more moderate. Sure, he had a following, but his followers were “impressionable voters” duped by “radical doctrines and quack remedies,” claimed The Washington Post. Now that Hitler actually had to operate within a government the “sober” politicians would “submerge” this movement, according to The New York Times and Christian Science Monitor. A “keen sense of dramatic instinct” was not enough. When it came to time to govern, his lack of “gravity” and “profundity of thought” would be exposed.

Source: How Journalists Covered the Rise of Mussolini and Hitler

Technology

Quote shell characters

Sometimes it’s nice to be able to display a command being run and do it in a form that can be repeated from a terminal window. Unfortunately, I’ll build a command in python like this:

args = ['somecmd', 'WHERE=$(DESTDIR)', '--message', "Lot's of text" ]

The trivial answer of ‘ ‘.join (args) produces something that can’t be passed to the shell:

>>> ' '.join (args)
"somecmd WHERE=$(DESTDIR) --message Lot's of text"

Here is a code fragment and some attached tests that provide better quoting. It’s used like this:

>>> import shquote
>>> args = ['somecmd', 'WHERE=$(DESTDIR)', '--message', "Lot's of text" ]
>>> print ' '.join ([shquote.shquote (a) for a in args])
somecmd 'WHERE=$(DESTDIR)' --message "Lot's of text"
#!/usr/bin/env python
def shquote (arg):
    """
    Quote a single argument in the most readable way so it is safe from
    shell expansion.
    """
    # Return an empty string as double quoted
    if not arg:
        return '""'
    special = """ t[]{}()'*?|;"""   # These need double quotes
    superspecial = """$"!"""        # These need single quotes
    quotechar = None
    # See if we need single quotes
    for c in superspecial:
        if c in arg:
            quotechar = "'"
            break
    # See if we need double quotes
    if not quotechar:
        for c in special:
            if c in arg:
                quotechar = '"'
                break
    # No quoting necessary
    if not quotechar:
        return arg
    # If quotechar is present then escape it by dropping out of quotes
    if quotechar in arg:
        arg = arg.replace (quotechar, "%s\%s%s" % (quotechar, quotechar, quotechar))
    return quotechar + arg + quotechar
if __name__ == '__main__':
    tests = [('',       '""'),
             ('*.cpp',  '"*.cpp"'),
             ('test.[ch]', '"test.[ch]"'),
             ('(',      '"("'),
             (')',      '")"'),
             ('a',      'a'),
             ('$',      """'$'"""),
             ('$a',     """'$a'"""),
             ('abc|def', '"abc|def"'),
             ('abc;def', '"abc;def"'),
             ('a b',    '"a b"'),
             ('"abc"',  """'"abc"'"""),
             ("""It's mine""", '"It's mine"'),
             ('abc | def ABC=$(XYC)', """'abc | def ABC=$(XYC)'"""),
             (""""That's impossible!" he said.""", """'"That'\''s impossible!" he said.'"""),
          ]
    for (input, expected) in tests:
        output = shquote (input)
        if output != expected:
            print 'input    = ', input
            print 'expected = ', expected
            print 'got      = ', output
        else:
            print "%-30s => %s" % (input, output)

And the result of running this:

bash-3.2$ ./shquote.py
                               => ""
*.cpp                          => "*.cpp"
test.[ch]                      => "test.[ch]"
(                              => "("
)                              => ")"
a                              => a
$                              => '$'
$a                             => '$a'
abc|def                        => "abc|def"
abc;def                        => "abc;def"
a b                            => "a b"
"abc"                          => '"abc"'
It's mine                      => "It's mine"
abc | def ABC=$(XYC)           => 'abc | def ABC=$(XYC)'
"That's impossible!" he said.  => '"That'''s impossible!" he said.'
Technology

Game of Thrones meets Rdio

Some humorous social media advertising on Rdio

Pete s Network Rdio

Arya Stark

Arya Stark reviewed a playlist.
X
Playlist by Joffrey Baratheon
Great to hear you are dead – one less on my list.


Jon Snow

Jon Snow reviewed an album.
Shades Of Cool
Lana Del Rey
You know nothing about the lower temperatures my dear… But if you need a fur – I have a couple lying around.
Happy to help.


Tyrion Lannister

Tyrion Lannister reviewed a playlist.
Champion
Playlist by Tyrion Lannister
If they let me drink in this damn cage I would be tossing wine all over for these jams.

Technology

Unsubscribe from cheap tickets email

I Hate Cheaptickets

I bought some tickets via cheaptickets.com and kep teething all these emails. Clicking on the “unsubscribe” link didn’t do anything. Cut & paste would show a funky URI such as x-webdoc://329FFAF9-8186-4348-9BB3-44C9C920A90F
There was some discussion on an Apple Support Community but nothing useful.
I tried it in Apple Mail, then in Gmail (using Safari) then Gmail (using Chrome) all with no luck.
Finally, I took a look at the raw message.
– In Apple Email that is:
– Raw message: View -> Message -> Raw Source)
– Just the headers (View -> Message -> All Headers)
– In Gmail:
– Top right of a message is the More -> Show Original
And noticed a header List-Unsubscribe: with a URI. Cut&Paste that URL into a browser. Presto, I was unsubscribed. w00t! Btw, be suspicious of any such URI.
Gmail also has an unsubscribe button that appears just to the right of the address.