The Price of Nice Nails

The typical cost of a manicure in the city helps explain the abysmal pay. A survey of more than 105 Manhattan salons by The Times found an average price of about $10.50. The countrywide average is almost double that, according to a 2014 survey by Nails Magazine, an industry publication.

With fees so low, someone must inevitably pay the price.

Ever wonder why getting you nails done in NYC is cheaper then just about everywhere else?  Doesn’t it seem incredible that one of the most expensive cities in the US could have a service that is cheaper then almost anywhere else?  This is a great expose in the NYT about how workers are exploited.
I particularly liked this map showing the number of Starbucks vs. nail shops:

Source: The Price of Nice Nails

Atomic Labs Across the U.S. Race to Stop Iran

Interesting article in the NY Times about how scientists in nuclear research labs in the US aided the negotiations with Iran

It was over one of those dinners in Vienna last summer that several of the experts began wondering how they might find a face-saving way for Iran to convert its deep-underground enrichment plant at Fordo, a covert site exposed by the United States five years ago, into a research center. That would enable Iran to say the site was still open, and the United States could declare it was no longer a threat.“The question was what kind of experiment you can do deep underground,” recalled a participant in the dinner.

Source: Atomic Labs Across the U.S. Race to Stop Iran –

The Machines Are Coming

Machines aren’t used because they perform some tasks that much better than humans, but because, in many cases, they do a “good enough” job while also being cheaper, more predictable and easier to control than quirky, pesky humans. Technology in the workplace is as much about power and control as it is about productivity and efficiency.

Source: The Machines Are Coming –

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 = "'"
    # See if we need double quotes
    if not quotechar:
        for c in special:
            if c in arg:
                quotechar = '"'
    # 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
            print "%-30s => %s" % (input, output)

And the result of running this:

bash-3.2$ ./
                               => ""
*.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.'

Middle East Friendship Chart

Slate has a great interactive chart showing friend/ambivalent/enemy status between middle eastern countries. In the interactive version you can click on each cell and see the explanation. Examples such as:

Ranking friendliness

Taking a -1, 0, +1 to rank the entities it seems Iraq is the only country with a surplus of friends and the US isn’t looking as bad as you’d think:

  • Al-Qaida: -10 (friends with no one)
  • Egypt: -6
  • Hamas: -3
  • Hezbollah: -2
  • Iran: -2
  • Iraq: +1
  • ISIS: -12 (everybody’s enemy)
  • Israel: -6
  • Palestinian Authority: 0
  • Saudi Arabia: -3
  • Syria: -5
  • Turkey: -4
  • US: -1

Making it friendlier?

If we ignore Al-Qaida (no one’s friend) and ISIS (everyone’s enemy) the results become a little more positive but still not an outpouring of friendship:
– Egypt: -4
– Hamas: -2
– Hezbollah: 0
– Iran: -1
– Iraq: +3
– Israel: -4
– Palestinian Authority: 2
– Saudi Arabia: -1
– Syria: -3
– Turkey: -2
– US: +1

Game of Thrones meets Rdio

Some humorous social media advertising on Rdio

Arya Stark

Arya Stark reviewed a playlist.
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.
Playlist by Tyrion Lannister
If they let me drink in this damn cage I would be tossing wine all over for these jams.

Buy or Rent?

Is it better to rent or buy?

The NY Times has a great interactive calculator for evaluating the trade-offs of buying vs. renting. It looks to cover everything:

  • House Price
  • Interest rates
  • Length of mortgage
  • Downpayment
  • Planned time to occupy
  • Future rental rates
  • Housing market expected increases
  • Taxes
  • Maintenance fees

It produces a number like:

If you can rent a similar
home for less than …
$961 PER
… then renting is better.