Blog Articles 151–155

Dark Social — invisible sharing and web traffic

A link to share!

Interesting piece at The Atlantic on web analytics that attempt to account for sharing of links in what the author dubs “dark social”, the various technologies like e-mail, IM, etc. that we still use to share links to each other. Analytics suggest that it dominates even Facebook as a traffic driver.

The article uses Chartbeat metrics, which attribute direct deep page visits to social. Now, there are things unaccounted for that decrease the numbers somewhat. Browsers with referrers off will look like direct social, though that can be mitigated with cookies. Links from SSL search, Twitter, etc. will also look direct by default; I don’t know if they have some way to compensate for that.

But it’s still interesting.

Living under Drones

If I am walking in the market, I have this fear that maybe the person walking next to me is going to be a target of the drone. If I’m shopping, I’m really careful and scared. If I’m standing on the road and there is a car parked next to me, I never know if that is going to be the target. Maybe they will target the car in front of me or behind me. Even in mosques, if we’re praying, we’re worried that maybe one person who is standing with us praying is wanted. So, wherever we are, we have this fear of drones.

From Living under Drones, an account of the impact US drone strikes are having on civilian life in the Pakistani Federally Administered Tribal Area. Read it. All of it.

One of the things that struck me most is the severe impact on civic life and education. The report describes three attacks in particular; the first, on March 17, 2011, was a strike on a jirga, a meeting of elders and community members to resolve disputes and make decisions regarding community affairs. This meeting was to settle a dispute regarding a nearby mine. The community was doing what it does — gathering together to settle the matter peacefully and avoid greater unrest and difficulties in the area — and the US bombed them, killing 42 and wounding 14 more. Among the dead were all the elders gathered for the meeting.

Theoretically, the US is wanting to promote peace and democracy in Pakistan (and Afghanistan). How does bombing peaceful civic meetings and judicial processes do anything but directly undermine such goals?

I am for peace

Too long have I had my dwelling
  among those who hate peace.
I am for peace,
  but when I speak, they are for war!

Psalm 120:6-7, ESV

I am for peace.

Our current president terrorizes Pakistani residents with imminent drone attacks and uses those same drones to murder U.S. citizens.

His chief contender takes the administration to task for “seeking to reap a ‘peace dividend’” when we are supposedly “not at peace”.

argparse4s: clean, powerful CLI handling for Scala

I needed a command line argument parsing library for Scala. Most of the existing ones either didn’t support subcommands, had strange APIs, had strange semi-standard parsing behavior, or weren’t very clean to use from Scala. The best I’d found, JCommander and JewelCLI, both had their own limitations, and JewelCLI at least was difficult to use from Scala due to namespace collision with its @Option annotation.

I found argparse4j, though, and was quite taken with it. It is modelled after Python’s argparse module, which sets the bar in my book for power and sanity in argument parsing APIs. It had all the power I was seeking — subcommands, GNU-style option parsing, automatic help generation, etc. — but the API wasn’t particularly fluent to use from Scala.

So I wrapped it up in a bit of Scala to produce argparse4s. There are some code examples in the README; basically you just write down options you want using flag, option, and argument methods, and then you can retrieve their values using an implicit execution context handed to you by the outer parsing and invocation logic.

It also makes use of type classes to automatically handle type conversions and default metavariables, so if you have option[String]("delimiter"), it will have a default metavar of “ARG” (or something like that), while an option[File]('o', "output-file") will have a default metavar of “FILE”. It will also automatically handle type conversions (hooking into argparse4j’s type conversion logic, and doing a few things of its own). And, of course, you can define the type class for your own types so that you can have options of any type you want.