Shared posts

04 Jul 18:18

Owen Williams: The Surface Book 2 is everything the MacBook Pro should be

by Volker Weber

surfacebook2
Photo Microsoft

Owen Williams:

I'm back to say I was wrong, and I've found a machine that not only matches Apple's standard of hardware quality, but goes far beyond it to demonstrate how a laptop of the future should work. That machine is the 15-inch Surface Book 2 and somehow Microsoft has made the 2-in-1 that Apple should've been building all along, to the same level of quality I'd expect from anyone other than Microsoft. I've used the Surface Book 2 as my daily computer for three months now and it's consistently blown me away with how well considered it is across the board, how great the software works and has completely converted me into the touchscreen laptop camp.

And then he dives deep to explain how he uses the machine. I am firmly in the Surface Pro camp, but of course I could live with a Surface Book 2 as well. Last week I also looked at the latest MacBook and MacBook Pro, and while they are sexy, they don't get the job done for me.

More >

04 Jul 18:18

Writing Asynchronous Code for Android — Introducing Coroutines

by Roberto Orgiu
Illustrations by Elena Xausa

Writing asynchronous code is hard, even when we have amazing tools such as Reactive Programming to help us. What if we could write synchronous code and have it work asynchronously?

On the Android Team at The New York Times, we tackle writing asynchronous code with help from our Store library and from RxJava, which is a fundamental piece of our architecture. We use it to handle our most computationally intensive tasks, from parsing the news feed to reacting to UI changes.

Although we have used RxJava up to this point, we also try to keep ourselves and our app up-to-date, so we have started to incorporate the use of coroutines. Coroutines were introduced only recently as an experimental feature of Kotlin 1.1 and they give developers the ability to write more concise, asynchronous code. Even if coroutines are not a new concept (they exist in multiple other languages), it is really amazing that they are available in Kotlin and on Android, where the features of Java 8 have been a dream for several years.

In this post, we will walk through some examples of coroutines and talk about what is going on under the surface.

Blocking Vs Non-Blocking

Before we learn how we can make use of coroutines, we have to understand the difference between blocking calls and non-blocking calls. Let’s look at the following snippet:

launch { 
delay(1000L)
println("World!")
}
println("Hello,")
Thread.sleep(2000L)

What we have here is pretty straightforward, but it has some peculiarities: first, we have not one but two different ways of invoking a waiting time. Something we may be familiar with (Thread.sleep()) and something we might have instead seen within RxJava’s operators (delay()). Invoking sleep() is a blocking call, while delay() is a non-blocking call. Diving deep, the first call will make the whole thread sleep, freezing its execution for as long as we request, while delay() will only suspend it, allowing the rest of the code to work normally.

Let me explain this even further: when we launch this routine, it will encounter delay(), which will make the code between launch and the closing bracket suspend for one second, while the rest (the println instruction) will be executed. This is when we see the output in the console printing “Hello,”. The next step is Thread.sleep(), which will freeze the execution for two seconds, blocking everything that was in the pipeline, which means that the delay() counter will freeze as well. When this time passes, delay() will restart and finish, at which point we’ll see the last output in the console printing “World”.

Visualizing this as a timeline can maybe help make this very important concept crystal clear:

start[delay(1s)] -> println(“World!”) will wait for its execution time
println(“Hello,”) -> this will be printed immediately
Thread.sleep(2s) -> everything will freeze for 2 seconds
finish[delay(1s)]
println(“World!”) -> will be printed when both Thread.sleep() and delay() are over

This concept is so important because the definition of coroutines is:

Coroutines are computations that can be suspended without blocking a thread.

Now that we know this, we can easily identify this snippet as our first coroutine:

launch { 
delay(1000L)
println("World!")
}

Before discussing more theory, let’s see why delay() is so important. For coroutines to be suspendable without blocking everything else, we have to give up a little bit of flexibility, meaning that we can only stop them at specific points; and delay() is one of them. These points (which are functions, after all) are called suspension functions, and are created by applying the suspend modifier to the declaration of the function itself:

suspend fun delay(
time: Long,
unit: TimeUnit) {

}

Another very peculiar aspect is that suspending functions can only be called inside a coroutine or from another suspending function.

But how can we create a coroutine, then? The answer is by using a builder. A builder will help us create a coroutine by accepting suspending functions as parameters. In our previous example, the builder is identifiable with the launch function, which creates a fire and forget coroutine that will not return any value when its execution has completed.

At this point, we can finally identify the launch() function: in Kotlin, this is called builder, and it is what makes the coroutine possible. Here is one possible declaration of a launch() function:

fun launch(block: suspend () -> Unit): Job

As we can see, it’s nothing more than a higher-order function. Together with suspending functions, they provide us with a powerful way to write asynchronous code clearly and concisely.

Illustration by Elena Xausa

Project setup

As of the time of writing, coroutines are still experimental and cannot be used unless we take a few introductory steps. The first thing we have to do is open the gradle.properties file in our project and add this line, which will enable coroutine support in the IDE.

kotlin.coroutines=enable

The next step is adding their dependency, which should look very similar to this line. We add this to our module’sbuild.gradle file:

dependencies {

compile "org.jetbrains.kotlinx:kotlinx-coroutines-android:0.22.5"
}

The last step we have to take is enabling the coroutines for our build and we do it by adding this snippet to the same build.gradle file in which we have been operating so far:

kotlin {
experimental {
coroutines "enable"
}
}

An easy example

Suppose we want to create a very simple countdown function, which will change the value in a TextView from ten down to one and will then replace the number with “Done!” as soon as we have finished counting. To make it slightly more complex, at each iteration of the countdown we want to wait for one second, so that the timing is as close as possible to reality. Since we want to use coroutines, what we have to do is use the launch() builder and insert the delay() function in a simple for loop, in which we also change the label of a TextView.

launch(UI) {
for (i in 10 downTo 1) {
hello.text = "Countdown $i…"
delay(1000)
}
hello.text="Done!"
}

The only odd thing here is that parameter we passed to the launch() builder: this optional parameter is the coroutine context (not related to Android’s object with the same name) which will instruct the coroutine on where we want this code to be executed. In this case, we want it to be run on the UI Context, which is a wrapper of Android’s Main Looper. Since we are going to invoke methods of a View, we can only do so from the thread which created the aforementioned View. We should worry not: as we already saw, a suspending function will only suspend the coroutine, without impacting our main thread, so we are sure that delay() will not make our app unresponsive.

In the case that we want to cancel this countdown, we can do so by just holding a reference to the Job returned by launch() (as we saw when we introduced launch() declaration, this builder function actually returns a Job object) and invoking the cancel() method on it.

val job = launch { … }
job.cancel()
Note: All coroutines should be cancelable, but we can also make a noncancelable coroutine. However, this discussion is out of the scope of this introduction.

Let’s take this example a bit further and refactor it so that we can more clearly understand how coroutines can help us in our everyday life.

We can start by wrapping the countdown routine into an extension function so that we can invoke it on any of the TextViews in our layouts:

fun TextView.countdown() {
for (i in 10 downTo 1) {
text = "Countdown $i…"
delay(1000)
}
text="Done!"
}

Since delay() is a suspending function, and suspending functions can only be called from inside other suspending functions, we mark our countdown() extension as suspending as well. The downside of this can be that we will not be able to call countdown() whenever we want, but since we need to suspend the execution, this is a fair limitation that we are willing to accept.

suspend fun TextView.countdown() {
for (i in 10 downTo 1) {
text = "Countdown $i…"
delay(1000)
}
text="Done!"
}

At this point, we want this routine to be fired when we press a button, so that we can start the countdown whenever the user wants to. To do so, we need to wrap a builder function into a View.OnClickListener. The quickest way to reach this goal is to leverage the Kotlin language and create an asynchronous click listener.

fun View.onClickAsync(action: suspend () -> Unit) {
setOnClickListener {
launch(UI) {
action()
}
}
}

This snippet shows nothing more than what we mentioned above: we create a higher-order function, a parameter of which will be a suspending function, and we wrap our coroutine in an OnClickListener, invoking the suspending function we received as parameter.

Now, we just need to bind this logic to a View and a TextView, so that we can see the magic happen:

fab.onClickAsync { textView.countdown() }

We can take this example a bit further, maybe with a network call, to demonstrate how easy and readable coroutines can make our code. Let’s use the Retrofit framework which, at the time of writing, has no official support for this feature. However a pull request has been issued and we should see this compatibility layer added sooner rather than later. Before we start diving into the code, we have to highlight a couple of other small things: We only encountered the launch() builder, but it’s not the only one. Its duty is to create a ‘fire and forget’ coroutine, which will not return any result; while its counterpart, called async(), will return a value which we can literally await.

Let’s only focus to the relevant part of the code. Since coroutines have not yet a stable AdapterFactory for Retrofit, we can either create one or we can go for a different (and maybe less elegant) solution, which is having the framework perform synchronous calls that we’ll make asynchronous later.

In order to do this, we instruct our interface to return a Call<OurType>:

interface NetworkService {
@GET(“whatever”)
fun getData() : Call<OurType>
}

The next step is to wrap this call in a function which will only return OurType, keeping the code as simple as possible:

fun getDataSync() = weatherService.getData().execute().body()
Note: If we try and run this snippet as it is, we will incur in a NetworkOnMainThreadException which, in our example, means we are doing exactly what we wanted to do, that is make a synchronous network call with Retrofit.

Now we can finally introduce async(). Differently from what we saw with launch(), this function returns a Deferred<T>(in our case, T is OurType), which is an object that holds the promise that we will have a value, when the coroutine ends its duty. Of course, we have to create a suspending function, as we already saw several times:

suspend fun getDataAsync() =
async {
getDataSync()
}

Now, we can wire this function together with the asynchronous click listener we already saw, and when we get our data, we just pass it to our Views in the correct thread, while executing the network call away from the main thread:

fun View.onClickAsync(action: suspend () -> Deferred<OurType>) {
setOnClickListener {
launch(UI) {
val response = action().await()
bindUiTo(response)
}
}
}

Here, we changed the function we expect as parameter to match the fact that we will return a value, but the interesting thing is when we want to obtain a value from a Deferred<T> object, we invoke the await() method, which will return the T value whenever it is ready. To recap, what we do here is ask for a value which will be computed on another thread, and we await for the result, which we will obtain on the UI thread, so that we can use it right away.

Illustration by Elena Xausa

Coroutines are by default scheduled for execution as soon as we create them, so that we don’t have to wait as long for them to complete. In case we need them to start sequentially, maybe because they depend on each other’s result, we can make them start lazily, and they will be executed as soon as we invoke the await() method on a Deferred<T> instance.

To make them lazy, we simply pass another optional parameter to the builder, which will instruct them on when to start:

async(start = CoroutineStart.LAZY) {…}

Testing

At The New York Times, we really like to test the code we write, so we definitely could not conclude an article without mentioning how we can test a coroutine. One way is to force our asynchronous routine to run synchronously so that our tests can run in a very predictable way. To do this, we use yet another builder, which is runBlocking(). This builder forces our code to run in a blocking way so that we can always predict the behavior of the test:

@Test
fun coroutine_test() {
val actualWeather = runBlocking {
getDataAsync().await()
}

}
Note: This test is an example of how to test a coroutine. We are specifically not mentioning the different ways to test our network layer.

Coroutines are experimental but they are stable enough for daily use and the incoming support for all the major frameworks and libraries make it clear that they are here to stay. They make writing asynchronous code cleaner and easier, and we are quite happy to have them.


Writing Asynchronous Code for Android — Introducing Coroutines was originally published in Times Open on Medium, where people are continuing the conversation by highlighting and responding to this story.

04 Jul 18:18

Worse is better, again?

Are there parallels between the rise of Worse Is Better in software and the success of the "uncreative counterrevolution" in advertising? (for more on that second one: John Hegarty: Creativity is receding from marketing and data is to blame) The winning strategy in software is to sacrifice consistency and correctness for simplicity. (probably because of network effects, principal-agent problems, and market failures.) And it seems like advertising has similar trade-offs between

  • Signal

  • Measurability (How well can we measure this project's effect on sales?)

  • Message (Is it persuasive and on brand?)

Just as it's rational for software decision-makers to choose simplicity, it can be rational for marketing decsion-makers to choose measurability over signal and message. (This is probably why there is a brand crisis going on—short-term CMOs are better off when they choose brand-unsafe tactics, sacrificing Message.)

As we're now figuring out how to use market-based tools to fix market failures in software, where can we use better market design to fix market failures in advertising? Maybe this is where it actually makes sense to use #blockchain: give people whose decisions can affect #brandEquity some kind of #skinInTheGame?

Bonus links

Against privacy defeatism: why browsers can still stop fingerprinting

How to get away with financial fraud

Google invests $22M in feature phone operating system KaiOS

Inside the investor revolt that’s trying to take down Mark Zuckerberg

Ryan Wallman: Marketers must loosen their grip on the creative process

Open source sustainability

K2’s Media Transparency Report Still Rocks The Ad Industry Two Years After Its Release

Mark Ritson: How ‘influencers’ made my arse a work of art

Ad fraud one of the most profitable criminal enterprises in the world, researcher says

Cover story: Adtech won’t fix ad fraud because it is too lucrative, say specialists

https://hackernoon.com/why-funding-open-source-is-hard-652b7055569d

Sir John Hegarty: Great advertising elevates brands to a part of culture

https://www.canvas8.com/blog/2018/ju/behavioural-science-insights-nudgestock-2018.html …

04 Jul 18:18

Twitter Favorites: [SonosSupport] @normanmaurer Hi Norman, we're thrilled to be releasing Airplay 2 support very, very soon. Stay tuned.

Sonos Support Team @SonosSupport
@normanmaurer Hi Norman, we're thrilled to be releasing Airplay 2 support very, very soon. Stay tuned.
04 Jul 18:17

Android P Beta 3: What’s New

by Rajesh Pandey
Earlier today, Google released the third beta/Developer Preview 4 of Android P for all compatible Pixel devices. This is the second-last Developer Preview release of Android P from Google before DP5 drops towards the end of July and the final release of the OS occurs sometime in Q3. Continue reading →
04 Jul 18:17

Erst denken, dann schreiben

by Volker Weber

66a096d66b1ae3697842da248999d7e1

"Ich habe irgendwas im Internet, hier Reddit, gelesen. Da muss ich jetzt eine ganz große Welle machen. Was ist passiert? Weiß ich auch nicht, aber es wird schon was Böses sein. Jedenfalls schreiben da Leute, dass ihr Samsung ihre Bilder an wildfremde Leute schickt. Per "Text", also SMS, nein MMS. Wie RCS? Was soll das sein? Fragen wir mal einen T-Mobile-Pressekontakt, der auch nix weiß."

Irgendsowas muss im Kopf dieser Schreiber rumgehen. Was ist wirklich dahinter? Wir wissen es nicht, und wir werden es vielleicht auch nie erfahren. Irgendwas mit dem x-ten Versuch, auf Android eine Alternative zu iMessage aufzubauen. Also eine native Messaging-App, die nicht Facebook gehört. RCS, bei der Telekom als Joyn gescheitert, soll es reißen. Ja, damit kann man Bilder schicken. Und ob da nun wirklich eine App so mir nichts dir nichts private Bilder verschickt, wer weiß? The Verge jedenfalls nicht.

Nächste Verge-Geschichte:

Gmail app developers have been reading your emails. It’s a common practice that’s gone largely unnoticed.

Oh, diesmal bei The Wall Street Journal abgeschrieben. Der Kollege Dr. Spehr zitiert Netzpolitik und stellt schon mal die Frage in den Raum, ob man Gmail nicht in Europa gleicht ganz abschalten müsse. Weil, DSGVO.

Jetzt mal ruhig mit die jungen Pferde. Schon mal den Dialog gesehen, mit dem man folgendes abnickt?

new-auth-2

Demnächst kommt dann raus, dass der gute Ad-Blocker alle Webseiten lesen darf, die ihr so anklickt, und genau weiß, was ihr in den letzten drölfzig Jahren im Internet angeschaut habt.

Ihr könnt Euch alle wieder hinlegen. Erst denken, dann schreiben.

04 Jul 18:17

Decentralise All The Things!

by Ton Zijlstra

Came across this post by Ruben Verborgh from last December, “Paradigm Shifts for the Decentralised Web“.

I find it helpful because of how it puts different aspects of wanting to decentralise the web into words. Ruben Verborgh mentions 3 simultaneous shifts:

1) End-users own their data, which is the one mostly highlighted in light of things like the Cambridge Analytica / Facebook scandal.

2) Apps become views, when they are disconnected from the data, as they are no longer the single way to see that data

3) Interfaces become queries, when data is spread out over many sources.

Those last two specifically help me think of decentralisation in different ways. Do read the whole thing.

04 Jul 18:17

(via Opinion | What if Trump’s Nativism Actually Hurts Him? -...

04 Jul 18:09

Android P Beta 3 now available on Pixel devices

by Igor Bonifacic

The third Android P beta (fourth developer preview) is now available on Pixel smartphones, Google announced on Monday.

“Beta 3 now takes us very close to what you’ll see in the final version of Android P,” writes Dave Burke, vice-president of engineering at Google and Android chief, over at the Android Developers Blog.

Included in the new beta are a variety of bug fixes, the latest Android security updates and “optimizations for stability and polish”. Additionally, Google has packaged the latest update to the Android Studio build tools inside Beta 3.

At the moment, the update is only available on Pixel devices. Other devices included in Android P beta, such as the Essential Phone and OnePlus 6, should get the update “over the coming weeks”.

Beta 3 is the second-to-last beta Google has planned for Android P. The company plans to release to one more beta before it pushes out the final release of Android P sometime later this summer.

If you’re already enrolled in the beta program, Beta 3 should arrive as an over-the-air update sometime this week.

Source: Google

The post Android P Beta 3 now available on Pixel devices appeared first on MobileSyrup.

04 Jul 18:09

Samsung’s Galaxy X rumoured to feature at least a 3,000mAh battery

by Dean Daley
Samsung logo on wall

Samsung may supply the Galaxy X, an often-rumoured upcoming foldable smartphone, with at least a 3,000mAh battery. The phone’s X moniker is currently the ongoing rumoured name for the handset.

A new report from South Korean publication ItHome indicates that Samsung will start producing flexible batteries later this year. The new batteries are capable of hosting a power capacity ranging from 3,000mAh to 6,000mAh, according to the report.

The South Korean tech giant has been working on these flexible batteries since 2014, when the company first introduced the technology at an InterBattery event, according to SamMobile.

It’s unlikely that Samsung will put a 6,000mAh battery in a smartphone, with the device being more likely to feature a battery in the 3,000mAh range.

Samsung will probably launch the Galaxy X sometime next year exclusively in the Asian market.

Source: ItHome Via: SamMobile

The post Samsung’s Galaxy X rumoured to feature at least a 3,000mAh battery appeared first on MobileSyrup.

04 Jul 18:09

Here’s more evidence that a Face ID-equipped iPad Pro is on the way

by Patrick O'Rourke
iPad Pro

Developer and frequent iOS operating system data miner, Steve Troughton-Smith, is back with new, interesting information found in the latest developer build of iOS 12.

The well-known developer recently uncovered an iPad version of AvatarKit in the latest version of Apple’s mobile operating system.

AvatarKit is the framework that powers Apple’s popular Animoji.

Up until now, just the iPhone X included AvatarKit framework because it’s the only Apple device that features the company’s real-time face tracking TrueDepth camera technology.

Slightly modified iPhone X-like navigation gestures designed for the iPad, were also recently uncovered in iOS 12.

These new discoveries add further fuel to the rumours that Apple is working on a revamped high-end iPad Pro that’s set to feature minimized bezels and a TrueDepth camera system — which also means the tablet will likely include a notch along with Face ID functionality.

It’s expected that the next version of Apple’s iPad Pro will be revealed at the company’s annual fall hardware event.

Source: Twitter (Steve Troughton-Smith) Via: MacRumors 

The post Here’s more evidence that a Face ID-equipped iPad Pro is on the way appeared first on MobileSyrup.

02 Jul 18:54

June in review

by admin

The whirlpool of transitional events and general “end of spring travel crazyness” seem to be quieting down and now it’s time to start setting in a new rhythm while enjoying the things that do not change (the berry harvest from the garden is pretty stable although which berries are there change 🙂

June was a crazy month on all fronts:

  • #3 workshop of Wowlab series on making an own bordgame with homeschooling group (as much as I’d hoped that we would be ready by then, there is #4 I still have to plan).
  • Anna’s pirate birthday party on the beach which was a logistical nightmare and lots of fun of Dutch-English singing at the end.
  • Nancy‘s visit, with fun, personal conversations and a good reason to meet with Aldo, Elmine and Ton after a long break.
  • Honeyberries, (wild) strawberries, shadbush berries harvest with lots of “put in the ground everything that you want to live” work in between.
  • Two weeks with the kids in Russia, with an intense week-long camping with Natural school and then no less intense days of meeting with family and friends and sorting out the remaining boxes from my mother’s house at dacha.
  • Emily’s cooking birthday party on the beach on the second day after arriving home. It was a bit of crazy, with making fresh pasta and tiramisu “in the field”, but gave a good sense of accomplishment.
  • Discussions about Russian and Dutch and changes in the homeschooling group.
  • A last-munite decision of going to a buschcraft weekend with the whole family, which was a nice learning adventure.
  • Lot of personal growth on making sure that boundaries do not become borders.

So, July and August will be a time of rethinking and repacking lots of things:

  • homeschooling goals and plans
  • work activities, routines and personal growth plan for me
  • figuring out how to combine blogging and homeschooling portfolio
  • house and garden long waiting fixes and organisation
  • slow time, travel, books and enjoying in the sun
02 Jul 18:54

What do you think is the worst smartphone feature ever?

by Dean Daley
Essential Phone with Essential 360 Camera

Everyone is always talking about what features they want most on a smartphone. However, out of all of the handsets we’ve seen throughout the years we got to stop to ask ourselves, what is the worst smartphone feature.

Were there any really bad smartphone features throughout the years?

  • Were 3D displays horrible? HTC and LG both tackled the 3D smartphone market. The feature, however, didn’t last too long and it’s a functionality we don’t see anymore.
  • A dedicated Facebook button seemed like a cool idea at first, but let’s be honest, it’s a horrible waste of space. Sorry HTC and Nokia those were terrible ideas and possibly the worst phone feature ever.
  • The iPhone X-inspired notch and even the Essential phone cutout both seem like good ideas as they allow smartphones to have more screen real-estate. However, they are widely hated, but while it’s far from being the worst smartphone feature ever. Looking back a year or two from now we may have a different tune.
  • Squeezing your smartphone to perform an action might be something that I enjoy, however, is the HTC Edge Sense or Google’s Active Edge actually a smart idea? The jury is still out on whether it’s the “worst” feature ever however, it’s definitely far from being the greatest.
  • Unmappable smart assistants are a horrible idea. What a lot of people love about their Android smartphones are their freedom and customization. Adding a button that can’t be customized causes frustration and due to that many Android users seek ways of disabling or somehow changing a button like, Samsung’s Bixby button.
  • Pop up cameras are also not the greatest idea as more the mechanisms a smartphone has, the more things that can break.
  • Persistent notifications are very annoying, thankfully Android will get rid of this with full release of Android 8.0 Oreo.

Thermometers in smartphones, phones with keyboards, modular smartphones are also ideas and features that have died or are slowly dying.

All in all there were plenty of useless features on smartphones and I know I missed plenty.

However, what do you think was the worst smartphone feature ever? Let us know in the comments below.

The post What do you think is the worst smartphone feature ever? appeared first on MobileSyrup.

02 Jul 18:53

The Problem with Code

James Somers lays out the problem with the growing complexity of software systems: they are...
02 Jul 18:53

"I have almost reached the regrettable conclusion that the Negro’s great stumbling block in his..."

“I have almost reached the regrettable conclusion that the Negro’s great stumbling block in...
02 Jul 18:53

Revisiting my Donald Trump predictions

by Josh Bernoff

On the day after Donald Trump was elected president, I made a set of predictions. Today I’ll revisit those predictions and grade what I got right and wrong. The true analyst is always looking forward. Most of my friends were in despair on November 9, 2016. But I knew that Trump was a nontraditional candidate, … Continued

The post Revisiting my Donald Trump predictions appeared first on without bullshit.

02 Jul 18:53

Freeing PDF Data to Account for the Unaccounted

by hrbrmstr

I’ve mentioned @stiles before on the blog but for those new to my blatherings, Matt is a top-notch data journalist with the @latimes and currently stationed in South Korea. I can only imagine how much busier his life has gotten since that fateful, awful November 2016 Tuesday, but I’m truly glad his eyes, pen and R console are covering the important events there.

When I finally jumped on Twitter today, I saw this:

and went into action and figured I should blog the results as one can never have too many “convert this PDF to usable data” examples.

The Problem

The U.S. Defense POW/MIA Accounting Agency maintains POW/MIA data for all our nation’s service members. Matt is working with data from Korea (the “All US Unaccounted-For” PDF direct link is in the code below) and needed to get the PDF into a usable form and (as you can see if you read through the Twitter thread) both Tabulizer and other tools were introducing sufficient errors that the resultant extracted data was either not complete or trustworthy enough to rely on (hand-checking nearly 8,000 records is not fun).

The PDF in question was pretty uniform, save for the first and last pages. Here’s a sample:

Click to view slideshow.

We just need a reproducible way to extract the data with sufficient veracity to ensure we can use it faithfully.

The Solution

We’ll need some packages and the file itself, so let’s get that bit out of the way first:

library(stringi)
library(pdftools)
library(hrbrthemes)
library(ggpomological)
library(tidyverse)

# grab the PDF text
mia_url 

Let's look at those three example pages:

cat(doc[[1]])
##                                   Defense POW/MIA Accounting Agency
##                                       Personnel Missing - Korea (PMKOR)
##                                        (Reported for ALL Unaccounted For)
##                                                                                                Total Unaccounted: 7,699
## Name                       Rank/Rate     Branch                           Year State/Territory
## ABBOTT, RICHARD FRANK      M/Sgt         UNITED STATES ARMY               1950 VERMONT
## ABEL, DONALD RAYMOND       Pvt           UNITED STATES ARMY               1950 PENNSYLVANIA
## ...
## AKERS, HERBERT DALE        Cpl           UNITED STATES ARMY               1950 INDIANA
## AKERS, JAMES FRANCIS       Cpl           UNITED STATES MARINE CORPS       1950 VIRGINIA

cat(doc[[2]])
## Name                          Rank/Rate Branch                     Year State/Territory
## AKERS, RICHARD ALLEN          1st Lt    UNITED STATES ARMY         1951 PENNSYLVANIA
## AKI, CLARENCE HALONA          Sgt       UNITED STATES ARMY         1950 HAWAII
...
## AMIDON, DONALD PRENTICE       PFC       UNITED STATES MARINE CORPS 1950 TEXAS
## AMOS, CHARLES GEARL           Cpl       UNITED STATES ARMY         1951 NORTH CAROLINA

cat(doc[[length(doc)]])
## Name                                                Rank/Rate           Branch                                              Year         State/Territory
## ZAVALA, FREDDIE                                     Cpl                 UNITED STATES ARMY                                  1951         CALIFORNIA
## ZAWACKI, FRANK JOHN                                 Sgt                 UNITED STATES ARMY                                  1950         OHIO
## ...
## ZUVER, ROBERT LEONARD                               Pfc                 UNITED STATES ARMY                                  1950         CALIFORNIA
## ZWILLING, LOUIS JOSEPH                              Cpl                 UNITED STATES ARMY                                  1951         ILLINOIS
##                                       This list of Korean War missing personnel was prepared by the Defense POW/MIA Accounting Agency (DPAA).
##                Please visit our web site at http://www.dpaa.mil/Our-Missing/Korean-War-POW-MIA-List/ for updates to this list and other official missing personnel data lists.
## Report Prepared: 06/19/2018 11:25

The poppler library's "layout" mode (which pdftools uses brilliantly) combined with the author of the PDF not being evil will help us make short work of this since:

  • there's a uniform header on each page
  • the "layout" mode returned uniform per-page, fixed-width columns
  • there's no "special column tweaks" that some folks use to make PDFs more readable by humans

There are plenty of comments in the code, so I'll refrain from too much blathering about it, but the general plan is to go through each of the 119 pages and:

  • convert the text to lines
  • find the header line
  • find the column start/end positions from the header on the page (since they are different for each page)
  • reading it in with readr::read_fwf()
  • remove headers, preamble and epilogue cruft
  • turn it all into one data frame
# we're going to process each page and read_fwf will complain violently
# when it hits header/footer rows vs data rows and we rly don't need to
# see all those warnings
read_fwf_q % 
    flatten_chr() -> lines # want the lines from each page
  
  # find the header on the page and get the starting locations for each column
  keep(lines, stri_detect_regex, "^Name") %>% 
    stri_locate_all_fixed(c("Name", "Rank", "Branch", "Year", "State")) %>% 
    map(`[`, 1) %>% 
    flatten_int() -> starts
  
  # now get the ending locations; cheating and using `NA` for the last column  
  ends %        # turn it into something read_fwf() can read 
    read_fwf_q(col_positions = cols) %>%  # read it!
    .$result %>%                          # need to do this b/c of `quietly()`
    filter(!is.na(name)) %>%              # non-data lines
    filter(name != "Name") %>%            # remove headers from each page
    filter(!stri_detect_regex(name, "^(^This|Please|Report)")) # non-data lines (the last pg footer, rly)
  
}) -> xdf

xdf
## # A tibble: 7,699 x 5
##    name                       rank   branch                  year  state        
##                                                        
##  1 ABBOTT, RICHARD FRANK      M/Sgt  UNITED STATES ARMY      1950  VERMONT      
##  2 ABEL, DONALD RAYMOND       Pvt    UNITED STATES ARMY      1950  PENNSYLVANIA 
##  3 ABELE, FRANCIS HOWARD      Sfc    UNITED STATES ARMY      1950  CONNECTICUT  
##  4 ABELES, GEORGE ELLIS       Pvt    UNITED STATES ARMY      1950  CALIFORNIA   
##  5 ABERCROMBIE, AARON RICHARD 1st Lt UNITED STATES AIR FORCE 1950  ALABAMA      
##  6 ABREU, MANUEL Jr.          Pfc    UNITED STATES ARMY      1950  MASSACHUSETTS
##  7 ACEVEDO, ISAAC             Sgt    UNITED STATES ARMY      1952  PUERTO RICO  
##  8 ACINELLI, BILL JOSEPH      Pfc    UNITED STATES ARMY      1951  MISSOURI     
##  9 ACKLEY, EDWIN FRANCIS      Pfc    UNITED STATES ARMY      1950  NEW YORK     
## 10 ACKLEY, PHILIP WARREN      Pfc    UNITED STATES ARMY      1950  NEW HAMPSHIRE
## # ... with 7,689 more rows

Now the data is both usable and sobering:

title % 
  mutate(branch = stri_trans_totitle(branch)) -> xdf

ordr % 
  ggplot(aes(year)) +
  geom_bar(aes(fill = branch), width=0.65) +
  scale_y_comma(name = "# POW/MIA") +
  scale_fill_pomological(name=NULL, ) +
  labs(x = NULL, title = title, subtitle = subtitle) +
  theme_ipsum_rc(grid="Y") +
  theme(plot.background = element_rect(fill = "#fffeec", color = "#fffeec")) +
  theme(panel.background = element_rect(fill = "#fffeec", color = "#fffeec"))

02 Jul 18:52

Is strong AI inevitable?

files/images/prediction-explanation.png

Peter Sweeney, Towards Data Science, Medium, Jul 17, 2018


'Strong AI' in this article is characterized as AI that cannot only make predictions, as today's AI can, but as AI that can also create explanations. This is what is needed to progress from pre-scientific reasoning to scientific reasoning. The creation of explanations poses unique challenges to AI because it consists of things like interpretations (that is, things like models and world views) and formalisms (like math and language and other abstractions) along with predictions. Could AI produce these? Sure - humans do. But how likely is it? In my view, pretty likely. Interpretations and abstractions aren't magical things that appear from nowhere. They are the result of a knowable computational process. So I think computers will begin to be able to explain things. And as the clickbait headlines say, what they say will surprise you.

Web: [Direct Link] [This Post]
02 Jul 18:52

“I Was Devastated”: Tim Berners-Lee, the Man Who Created the World Wide Web, Has Some Regrets

files/images/founder-of-the-web-08-2018-lede.jpg

Katrina Brooker, Vanity Fair, Jul 18, 2018


This is a superficial look at the effort to re-decentralize the web. It focuses mostly on Tim Berners-Lee and his Solid distributed web application. " The system aims to give users a platform by which they can control access to the data and content they generate on the Web. This way, users can choose how that data gets used rather than, say, Facebook and Google doing with it as they please." This project has been in the works for several years; I've covered it previously. The article also mentions some other decentralized web projects, such as Mastodon and Peertube.

Web: [Direct Link] [This Post]
02 Jul 18:51

Samsung Galaxy J8 FAQ

by Rajesh Pandey
Samsung has been on a roll in the Indian smartphone market launching new budget smartphones almost every other week. The company has been launching so many models to prevent its market share from eroding further. Recently, it launched the Galaxy J8 to take on the likes of the Redmi Note 5 Pro and Asus ZenFone Max Pro M1. Continue reading →
02 Jul 18:51

The Daily Promo – Gentl And Hyers

by A Photo Editor

Gentl And Hyers

Who printed it?
We had them printed in Canada by Hemlock. They print Gather Journal whom we work for, so we were familiar with the quality.

Who designed it?
Caleb Bennet designed the promo. It is the first one in a series. We met Caleb while he was at Traveler when he designed several of our favorite stories.

Tell me about the images?
We are known for our food and still life but shoot so much more than that. We wanted to send out a promo that featured our travel work and a deep dive into a culture we are inspired by, this one being Mexico. The work is from both commercial jobs and personal trips. We also wanted to show our love for portrait and travel photography to those clients that only see us as food and still life photographers and to showcase light which is very important to us. We see light the same way whether we are making a portrait on location or in the studio. For us, travel inspires everything we do. We look for light out in the world and then recreate it in the studio. We see and talk about light constantly.

We liked the idea of keeping the promos to a particular subject or place. The next one up is “Family” and while it is also portrait heavy it is more lifestyle and very personal after that will come India another country we have been to countless times and a place where we deeply connect. Caleb will be designing all of them and the circle will continue to be a theme. We saw it as a loose reference to a globe.

How many did you make?
We made 200. We would have liked to print more but they were a little costly. It was the first promo we sent out after switching agents so we wanted to make something special. We sent it to return clients and to new and targeted clients.

How many times a year do you send out promos?
We will print 3 others this year.

Do you think printed promos are effective for marketing your work?
We think the promos were successful, they were meant to inspire more than to be a direct link to work.

We have had several requests to sell the promo so we may think about doing that later this year when we roll out a series of travel prints which will be available for purchase.

------------------------

Visit our sponsor Photo Folio, providing websites to professional photographers for over 9 years. Featuring the only customizable template in the world.

------------------------

02 Jul 18:51

Anti-Flow

by rands

Being in the Zone is such an essential concept to me, I did a shirt. The Zone is a place, and Flow is an activity that occurs within this precious mental place. Flow is the ability to consider a project or a problem deeply. In Flow, you can keep a superhuman amount of context in your head and can traverse that context with ease. With Flow, you can produce extraordinary value. Flow is writing this article right now, but this article needs another action and, oddly, it’s yet another activity within the Zone, I’ve started to call this activity Anti-Flow.

Anti-Flow is shower thoughts. They are the random connections your brain makes on a problem, a thought, or an opportunity when you aren’t thinking about that problem, thought or opportunity. The unexpected magical quality of these discoveries might give you the impression that the summoning exercise is equally magical, but I’ve discovered a simple process to create hours of fertile Anti-Flow.

Applied Anti-Flow

This article is currently 257 words. Six paragraphs. I think I’ve got the title and I can see in my head the arc of the piece. I don’t have an ending yet, but it’s likely going to repeat a mid-article point about the importance of Anti-Flow to your daily working life. Something about how the non-obvious work is as important as the obvious work. Yeah, that’s good. Gosh, I love Flow.

In about a half-hour, I’m going to stop writing this piece, and I’m going to jump on Isabelle, and we’re going on a long ride. Three hours. Almost forty miles.

Once I’m on my ride, and since I was recently writing this piece, it is likely my brain will think about this article automatically. Good title? Yeah. Meaningful arc? Sure. Anti-flow has a negative connotation. Is that a problem? Maybe I should research usage of the term? Good idea.

Predicting what might pop up during the ride is impossible because Anti-Flow, by definition, is about discovering hidden potential in the strange mental crevices of your mind. If applied Flow is directing the creative process, Anti-Flow is about lack of direction to achieve an even more ambitiously creative end. An example: It is equally likely that once I start riding that Anti-Flow will percolate a random idea about a meeting I had two weeks ago that ended badly. I haven’t thought about this meeting since it ended, but my brain knows there is an open thread there and the legit magic of Anti-Flow is that BAM here’s a random thought on how to fix a problem I’d forgotten I had. Gosh, I love Anti-Flow.

My weekend morning process, I’ve discovered, is about creating Anti-Flow. No calendar staring at me, a quiet morning, coffee, and a blank browser page. No guardrails. Starting stumbling around the Internet and see what strikes. High creative entropy means I am in Anti-Flow. However, there is an equal chance that I’ll head down a Wikipedia rabbit hole for an hour, continue writing an in-flight piece, or write something brand new. The moment I start building, I leave Anti-Flow and enter Flow.

On a long ride, there are no rabbit holes or keyboards. I can’t engage a random idea because I’m sitting on a bike which means the high entropy state of Anti-Flow persists. My biggest challenge is remembering the random ideas that show up, so I’ve developed a simple system. As an idea shows up and I deem it worth further investigation, (Yes, there are truly dumb ideas that show up that I briefly consider and then dump) I remember the one word that encompasses the idea and start making a memorable sentence. The sentence from a recent ride was, “Larry stats offsite in London.” Gibberish, right? Two of those words were absolute gold.1

Weaponized Inspiration Generation

As I look at my calendar, I see comfortable boxes of time designed to chunk my week into knowable bits of time. Those bits of time are meetings where humans I care about have structured our time with agendas. Crafted to focus on the problems at hand, agendas are run by humans who keep us on topic and within time. These boxes are valuable. Decisions are made. Work that matters progresses.

By design and with a lot of help, my week and my mind are on rails. There is essential unmeasurable work that needs to happen on a regular basis that should not just happen in the shower.

Anti-Flow is the weaponized generation of inspiration. Anything can show up during deep sessions of Anti-Flow from the mundane to the magical. The title of the third book showed up on a ride last summer. The single most important line for a talk arrived two weeks ago. The correct order of operation on telling a human very bad news arrived three weeks ago. One week later, I discovered the words that I needed to say.

Not knowing the source of this inspiration makes the concept of Anti-Flow at odds with a working day which perhaps makes a bike ride a better place to Anti-Flow. It’s one of the reasons when my wife asks me, “Do you get bored on three-hour rides?” I respond honestly, “It’s when I do my most important work.”


  1. Wondering what I found during Anti-Flow on the ride? Well, I did edit this piece, but I was mid-mental edit when found this beautiful vintage 1966 Toyota Stout 1900 and complimented the owner who ended up buying my coffee and jelly beans. After that, I thought about the power of compliments combined with the appreciation vintage things we’ve built with our hands. There’s an article there. Speaking of articles, I also started a piece in my head that I’m currently calling the Rands Information Diet™. I worked on a secret project. And I decided to remove every single thing from my bedside table except for the current thing I am reading. The sentence: Watch independence Toyota music ledger stack. 
02 Jul 18:50

How to set up a short feedback loop as a solo coder

by hello@vickylai.com (Vicky Lai)
I’ve spent the last couple years as a solo freelance developer. Comparing this experience to previously working in companies, I’ve noticed that those of us who work alone can have fewer iterative opportunities for improvement than developers who work on teams. Integral to having opportunities to improve is the concept of a short feedback loop: a process of incorporating new learning from observation and previous experience continuously over a short period of time.
02 Jul 18:49

Apathy Machines

by Rob Horning

Proponents of virtual reality like to claim that the immersive technology can provide “experience on demand,” as the title of Stanford researcher Jeremy Bailenson’s book puts it. It allows you to “wear the body of someone else,” he says in this talk at Google, which also means you can take it off when you feel like it, a luxury that reality doesn’t afford.

The on-demand aspect of virtual reality would seem to conflict with another common claim made about it, that it is an “empathy machine” that immersively and inescapably places the viewer in another person’s shoes and supposedly makes them feel what they must have felt. “Empathy” is an odd way to describe one of VR’s main applications thus far, as a military training technique to habituate soldiers to killing in combat. “There are some issues there,” Bailenson admits. But typically, in clinical studies, empathic viewers in training are exposed to someone else’s unfortunate condition and then tested afterward to see if they more willing to do something about it — often a matter of giving money, as though that were a universal mode of expressing concern rather than dismissing it. Bailenson describes immersing viewers in the experience of homelessness for seven minutes — how much more time would you need to simulate and understand another’s life? — which makes them more likely to sign a petition immediately afterward calling for more taxes to help the indigent.

Virtue, in the “witness” scheme, derives from surveillance. You have to see suffering to confirm that you’ll react with the proper degree of sympathetic emotion

But if we choose to have a particular experience, doesn’t that make it more a commodified consumer good rather than an ethics lesson? Or rather, doesn’t that mainly teach us that we can enjoy feeling ethical as an on-demand experience? This is why game developer Robert Yang describes VR not as an empathy machine but an “appropriation machine.” “If you won’t believe someone’s pain unless they wrap an expensive 360 video around you,” he writes, “then perhaps you don’t actually care about their pain … The ‘embodied’ ‘transparent immediacy’ of virtual reality (or much less, 360 video) does not obliterate political divisions.” Why is it so tempting to VR proponents to fantasize about a technology that renders politics superfluous? Why is it so easy to confuse a susceptibility to emotional experience with benevolence?


The presumption that empathy automatically produces virtue dates back at least to Adam Smith’s Theory of Moral Sentiments (1761), which opens with a disquisition on sympathy and propriety. As Smith theorized it, one witnesses another’s condition and immediately enters into a state of fellow feeling, even against one’s will. “In every passion of which the mind of man is susceptible, the emotions of the bystander always correspond to what, by bringing the case home to himself, he imagines should be the sentiments of the sufferer.” Virtue, in this scheme, derives from surveillance. You have to see suffering to confirm that you’ll react with the proper degree of sympathetic emotion.

But the word “imagine” in Smith’s formulation seems key: What you attribute to the other, and then use as a justification for feeling a certain way yourself, sounds a lot like projection. What the other actually feels is not relevant and there is certainly no need to respect their ultimately irreducible difference. Instead, the ready appropriation of their feelings becomes a kind of parallel to the invisible hand: Because we can’t help but feel what others feel, it thus becomes part of our selfish interest to make them feel better. “That we often derive sorrow from the sorrow of others, is a matter of fact too obvious to require any instances to prove it; for this sentiment, like all the other original passions of human nature, is by no means confined the virtuous and humane, though they perhaps may feel it with the most exquisite sensibility.”

As the passage suggests, Smith’s theory derives from a strand of philosophy that postulated an inborn “moral sense” that allows us to instinctively understand what’s right and wrong.  The moral sense manifested mainly through a mastery of etiquette, making aristocratic habitus a proof of inherent virtue, and the commoner’s lack of it a proof of natural moral deficiency. Since instinctual emotions are benevolent, the stronger we feel them (and thus the more ostentatiously we display them), the more virtuous we are. From this point of view, morality becomes a spontaneous reaction rather than a process of ethical reasoning.

Though innate, the moral sense could be trained; becoming more “virtuous and humane” pivoted on learning to feel “with the most exquisite sensibility” through repeated exposure to a range of pitiable situations. In the late 18th century, the popularity of this idea in England led to the so-called cult of sensibility, an epoch in literary taste that accompanied the first flourishing of fiction as a commercial product. Sensibility “was a significant, an almost sacred word,” literature scholar J.M.S. Tompkins writes, a “modern quality” that was “the product of modern conditions,” which included broader literacy and the dissemination of cultured tastes that printing permitted.

Sensibility was never precisely defined but in general indicated a capacity for spontaneous vicarious feeling akin to the VR proponents’ idea of empathy. It was similar to the Renaissance notion of sprezzatura, an instinctual charisma and propriety, but was more passive, emphasizing finely wrought feelings in response to pitiable situations. It was a matter of spectatorship and reaction.

The sensibility era’s novels served as testing devices: If your heart didn’t respond, your moral sense might just be weak and you might not be as moral as you hoped

This connected it to the era’s burgeoning entertainment industry. “Sensibility” in practice became the emotion specific to reading, and novels and circulating libraries had begun to prosper by packaging emotional experiences for readers. The sensibility era’s novels — not only Henry Mackenzie’s fragmentary The Man of Feeling but also long, immersive five-volume epics by now forgotten writers like Courtney Melmoth and Frances Brooke — depicted situations designed to elicit strong and unrestrained emotional reactions, offering opportunity after opportunity for readers to demonstrate their “feeling heart” through vicarious identification and suffering.

As Tompkins points out, this often comes across now as more egotistic than altruistic: “Again and again we find that enormity of self-gratulation with which the weeper at once luxuriates in the beguiling softness of tears and compliments himself on his capacity for shedding them, seeing in his mind’s eye not only the object of his attention, but himself in a suitable attitude in front of it.” The “man of feeling” was essentially a connoisseur of beautiful sentiments — pity, sacrifice, charity, etc. — instrumentalized to demonstrate an inner worth that justifies his social position, or his pursuit of a better one.


At the time, the novels served as testing devices: If your heart didn’t respond, your moral sense might just be weak and you might not be as moral as you hoped. (What if that VR experience of a Syrian child refugee didn’t make you want to donate to UNICEF?) Fortunately, aspiring novelists (and readers) learned the grammar of emotional prose, the key words and scenarios that triggered the right feelings, the sympathetic tears that proved one’s inner worth.

Sensibility novels sought to teach readers how to read and enjoy them — and thus demonstrate their moral fitness — within the unfolding of the text itself. Often it was narrated as an organizing, driving force for the plot. Reading itself was often dramatized, as in epistolary novels, where you read over the shoulder of the characters and have modeled for you the emotional impact of reading. In Samuel Richardson’s Pamela (1741), one encounters many scenes depicting other people reading; generally they are reading the very same text (Pamela’s letters and diaries) you have already read and demonstrate the appropriate level of responsiveness to it. They offer you a chance to test your reactions against theirs.

Books made it seem possible, even desirable, that we should have a world where our things strive to keep us apart, with nothing but abstracted genre conventions to connect us

More than any moral lesson, then, the book teaches you how to better consume books, and makes that seem like morality itself. They taught consumers how to enjoy things in solitude, taking aloneness and preventing it from becoming loneliness. They were instrumental in normalizing isolation, making it seem possible, even desirable, that we should have a world where our things strive to keep us apart from each other and absorbed in our own purely personal pleasures, with nothing but abstracted genre conventions — how scenes are stylized to make us feel for others — to connect us. People thus become morally legible only insofar as they conform to such genre expectations.

Reading meant removing yourself from social interaction to enter into a private fantasy world of pretend intimacy. To counter this, novelists tried to redeem novels with didactic content that taught them how to behave in society. They were covert conduct manuals made palatable and — as their defenders would eventually come to argue — more instructive through absorbing storytelling. Richardson’s Pamela evolved out of his Familiar Letters on Important Occasions, a manual that provided boilerplate form letters for the semiliterate to use. It dawned on him that teaching people what to write was an effective way to teach people how to think and, more important, what to feel.

But adding didacticism didn’t really solve the problem. As Eve Kosofsky Sedgwick argued in “Jane Austen and the Masturbating Girl,” citing literary historian John Mullan, “the empathetic allo-identifications that were supposed to guarantee the sociable nature of sensibility could not finally be distinguished from an epistemological solipsism, a somatics of trembling self-absorption.” Or more plainly, if you felt what the characters in fiction feel, you still indulged in the same emotional short-circuit that bypasses the need for actual other people as a prerequisite for emotional pleasure. The novel (as is today claimed about VR and phones and other modes of immersive engagement) pre-empts the need for co-presence. The pleasures of sensibility, which supposedly proved one’s fitness for better society, could only be truly enjoyed in private. Readers adapted themselves to textual rather than social norms.


The tension between a private, intimate kind of pleasure and the sociability it is supposed to anchor is still with us. We are fully habituated to consuming other subjectivities as we prepare our own for consumption. In Cold Intimacies, sociologist Eva Illouz calls this middle-class specialty “emotional competence” — the ability to self-analyze and communicate one’s emotionality in terms that other bourgeois can understand and work with, as well as read each other’s emotions and respond in a constructive way. This habitus becomes a requisite qualification not only for personal relationships but for high-status jobs: Emotional competence becomes emotional capital. “There are now new hierarchies of emotional well-being, understood as the capacity to achieve socially and historically situated forms of happiness and well-being.” As with sensibility, however, emotional competence reifies emotionality, subjecting it to conscious manipulation. It freezes emotion even as it reveals us to ourselves as suitably emotional.

The same logic that makes VR capable of inducing empathy also has the effect of making empathy a commodity and producing it a technical skill. There is socioeconomic value in being able to manifest empathy as emotional competence. It indexes one’s potential as an emotional capitalist,  capable of opportunistically manipulating emotional states to achieve goals and accrue power. Rather than exercise the moral sense, our empathic reactions build a case against our virtue, showing instead how self-interested all our emotions turn out to be.

02 Jul 18:49

Empathy Machines

by Olivia Rosane

A few months ago, as I was on my way to see “A Mile in My Shoes,” an exhibition staged by the Empathy Museum as a pop-up outside London’s Migration Museum, a woman walked down the aisle of the train I was on, asking for money or food. I gave her the bag of almonds I had in my tote bag, but I don’t think it was empathy that made me do it. The sun was shining through the window that day, and I was in a good mood as I drank my coffee and ate my breakfast. The shame of being happy and satisfied in front of someone who was turning their unhappiness into a public performance made me hand over my snack. Plus, I remembered that I was going to the Empathy Museum.

The truth is that every time I pass a person sleeping or begging on the streets, I am terrified by the thought of what would happen if I did truly empathize with them: If I, even for a moment, felt the precariousness of their life as my own, wouldn’t I have to offer them more than bag of almonds? Wouldn’t it demand that I offer everything I have?

I could imagine her pain, but I would never actually suffer it, and that made walking in her shoes feel more like consumption than communication

This isn’t because I am particularly generous but because the discourse around empathy portrays it as a moral super-emotion. “Great claims are also made for empathy’s ability to make us good, moral, connected, and civilized,” David Howe writes in Empathy: What It Is and Why It Matters. He cites economist Jeremy Rifkin, who calls empathy “the soul of democracy.” Former President Barack Obama also championed empathy’s importance, declaring, “If we hope to meet the moral test of our times, if we hope to eradicate child poverty or AIDS or joblessness or homelessness … then I think that we’re going to have to talk more about the empathy deficit — the ability to put ourselves in somebody else’s shoes, to see the world through somebody else’s eyes.”

The Empathy Museum takes a similar tack. On its website, it defines its mission as using participatory art projects to explore “how empathy can not only transform our personal relationships, but also help tackle global challenges such as prejudice, conflict and inequality.” Founded in 2015, it has launched projects such as the Human Library, which allow visitors to “borrow” another person for a one-on-one conversation, and A Thousand and One Books, an actual library built from donations. “A Mile in My Shoes,” the exhibit I saw, fitted visitors for the shoes of a refugee or migrant and then provided them an audio recording of the person whose shoes they were literally walking in. The shoes I fit belonged to Julie Cheung Inhin, a British East Asian actress. On the audio, she spoke of the moments when someone would comment on her race and she would suddenly become conscious of her difference from the people around her, despite “feeling like everyone else.”

As painful as such moments must have been for her, they also shone a problematic light on exhibit itself. No matter how much I, a white woman, could imagine what Cheung Inhin might feel in these instances, and no matter how long I walked in her shoes, other people would never perceive us in the same way. I could imagine her pain, but I would never actually suffer it, and that made the experience of walking in her shoes feel more like consumption than communication. Did I really need her to relive those experiences into the recording in order to understand she had been treated unjustly in those moments? When I returned from my intimate, meditative stroll with Julie, I saw that others were waiting for their turn with her shoes — my second empathetic failure that day. In paying careful attention to the recording, I paid too little attention to everyone else.


The idea behind projects like the Empathy Museum is that that empathy, when felt truly, will prompt global change. But how? If I’m personally moved to give a bag of almonds or even my entire personal savings, that hardly seems sufficient to pass the “moral test of our times” or change the world. How can personal feelings feed into the collective action necessary for addressing systemic and structural problems?

“A Mile in My Shoes” is a low-tech analogue of efforts to use virtual reality to increase viewers’ empathy. A TED talk by Chris Milk, a VR filmmaker who made Clouds Over Sidra, about a 12-year-old Syrian girl living in a Jordanian refugee camp, typifies the claims made for the technology. “When you look down, you’re sitting on the same ground that she’s sitting on, and because of that, you feel her humanity in a deeper way, you empathize with her in a deeper way,” Milk says, arguing that this intimate form of connection changes people’s perspective. He took the film to the World Economic Forum in Davos in January 2015 and is currently working with the United Nations to develop more films that he hopes to show “to the people who can actually change the lives of the people inside of the films.” Entrepreneur Jamie Wong and CNN commentator Van Jones employ similar reasoning for Project Empathy, which uses VR to show viewers what it’s like to be incarcerated in the U.S. prison system. Like Milk, they hope that exposing federal and state legislators to visceral VR experiences will change their minds and policies.

The claims made for VR have been made in the past for other emerging narrative technologies. The title of Milk’s first TED talk (“How Virtual Reality Can Create the Ultimate Empathy Machine”) reflects film critic Roger Ebert’s claim that “the movies are like a machine that generates empathy. It lets you understand a little bit more about different hopes, aspirations, dreams and fears.” And before film, literature was the agent of empathy-driven change. Harriet Beecher Stowe’s novel Uncle Tom’s Cabin, for example, is held to have so inflamed Northern sympathies against slavery that, according to legend, Abraham Lincoln said to her when they met, “So you’re the little woman who wrote the book that made this great war.” However, as Daniel R. Vollaro wrote in a 2009 article, there is little evidence that Lincoln said those words or that they accurately reflected the novel’s impact. Instead, the legend stems from 20th century efforts to promote the political power of literature and late 19th century efforts to diminish the role played by more radical abolitionists like William Lloyd Garrison or John Brown, whose direct action and militant organizing were cast as dangerous in the post-Reconstruction era.

The narrative about the power of literature, like the current approach to VR, makes historical change not a matter of the resistance efforts of the oppressed and their allies but of relatively privileged people speaking to other relatively privileged people to spark a paternalistic response. UNICEF found that showing Clouds Over Sidra halved the number of conversations face-to-face fundraisers needed to have before someone agreed to donate. And when Project Empathy’s first film was shown at the Democratic National Convention, 85 percent of viewers said it changed their minds about criminal justice. That seems promising, but both projects also share a theory of social change that is surprisingly anti-social, despite its emphasis on human connection. By focusing on bringing the experiences of the marginalized to elites, VR developers implicitly endorse a system in which a small number of people retain outsize power.

The lives filmed for VR experiences are isolated from any collective movement for justice and deployed instead in a simulation staged as a meeting between a powerful and a powerless individual

The lives filmed for VR experiences are isolated from any collective movement for justice and deployed instead in a simulation staged as a meeting between a powerful and a powerless individual in which all the petitioner’s words and actions are pre-selected by a third party. VR allows elites to believe that the best way to understand another’s perspective and act in their interest is not through talking to them directly but through consuming their experience at a distance, as framed by someone who seems more like a peer.

In mediating between the needs of the afflicted and the apathy of the comfortable, empathy-generating technologies risk reinforcing the very power dynamics they claim to fight. Abolitionist movements on both sides of the Atlantic relied on visceral displays of the physical pain of slavery to sway public opinion. Empathy Museum founder Roman Krznaric holds up the U.K. abolitionist movement as a model of empathy’s political efficacy, but, like the historical example he uses, his museum’s mission statement is troublingly sensationalist: “What is it like to have spent years in prison, or to be a child growing up in Tehran, or to have rediscovered love in your 80s? The Empathy Museum will help you find out.”

Saidiya V. Hartman argues in Scenes of Subjection: Terror, Slavery and Self-Making in 19th-Century America, that depictions of slavery’s violence can “immure us to pain by virtue of their familiarity” while reiterating the “spectacular character of black suffering.” In “Radical Empathy: Politics and Emotion,” Nina Power updates Hartman’s analysis to include the widely circulated videos of the deaths of Eric Garner, Tamir Rice, and other black victims of police violence. Such images are ostensibly meant to rouse (white) people to action, but, as Miles F. Johnson observed in a piece for the Establishment, their spread can be extremely unempathetic to the people on whose behalf they seek to work: “If you locate yourself as someone who wants to resist violent white supremacy, you must not privilege white people having information or being shocked into action over black people being irreversibly damaged.”

I do not mean to say that literature, film or VR has no role to play in rousing people to action on behalf of others outside their immediate circle. Plenty of stories communicate their authors or characters truths in ways that don’t sensationalize their pain, and empathetic communication can happen horizontally between different communities, not only vertically from the marginalized to the privileged. Such a moment is beautifully rendered in Chris Bachelder’s novel U.S.!, in which a boy in a conservative working-class town rescues a socialist-realist novel about outsourcing from a book-burning and is radicalized by reading it. But for change to occur, it is also not enough for narrative technologies to render experience vividly and sensitively. There must also be a surrounding movement to channel any awakened empathy and awareness into action. Otherwise, they may merely present a moral pretext for what is really just imaginative pleasure.


Research into empathy paints a cloudy picture of its efficacy at prompting moral action. Empathy can be instant — the sympathetic wince when you see someone stub their toe — and scientists link it in part to “mirror neurons” that fire in similar ways when we see someone do something and when we do it ourselves. But research also suggests that people can intentionally either enhance or shut down their capacity to empathize. An article from Greater Good magazine pointed to a study by Samuel and Pearl Oliner of people who had rescued Jews during the Holocaust, which found that the rescuers shared the experience of being taught since childhood to consider the perspectives of others. This is tempered, however, by findings that suggest the majority of us are more likely to empathize with members of our own in-group than those outside it, as Peter Bazalgette points out in The Empathy Instinct: How to Create a More Civil Society. For example, one study he cites found that participants’ neural response to watching people in pain decreased when those people belonged to a different racial group.

Research indicates that sympathy for others’ misfortunes and the cognitive ability to assess another person’s point of view correlate with prosocial behaviors like volunteering, but identifying strongly with fictional characters does not. Another study, which gave participants an excerpt of literary fiction, genre fiction, nonfiction, or nothing and then tested their ability to guess others’ thoughts and emotions, found that the literary fiction readers scored better. The researchers hypothesized that parsing such fiction’s “show don’t tell” approach upped the participants’ empathetic capabilities.

“Civility” hits home for beltway insiders who can’t imagine having to emigrate: Empathy becomes a game of claims to who deserves its spotlight, leading to a stalemate of competing moral outrage

Of course, understanding someone’s perspective does not mean you will necessarily adopt it. As Paul Bloom points out in Against Empathy: The Case for Rational Compassion, psychopaths are able to use this skill to better manipulate people. He argues that empathy shines a “spotlight” on individuals, causing us to rush to alleviate their particular pain without thinking of the long-term ramifications of doing so, or of the other, unspotlighted sufferers we might be ignoring. Since empathy is individualized and biased toward those who are more like us, it can lead to ignoring the suffering of groups, which occurs at a scale that exceeds empathy’s grasp. And nothing prevents empathy from being enlisted for hateful causes. “When liberals think about empathy, they only think it’s on their side,” Bloom said in an interview with the Verge. “In reality, empathy can go both ways.” In his book, Bazalgette calls Nazi Germany a “society without empathy” but then later clarifies that Nazis actually exploited in-group empathy to depict their victims as enemies of the German people.

The fallout from the Trump administration’s child-separation policy at the southern U.S. border also points to how empathy can be turned against itself. Opponents of the policy have disseminated images to try to spark empathy for its victims. The photograph of a two-year-old Honduran girl wailing in a pink sweater became a visual distillation of the policy’s human cost. It turned out that the girl in question, Yanela Sanchez, was not actually separated from her mother — an illustration of Bloom’s claim that the empathetic instinct to focus on individuals over collectives can lead to errors in reasoning. Nevertheless collective outrage, spurred in part by the image, eventually prompted Trump to sign an executive order ending the family separation policy he had previously claimed only Congress could stop.

Despite this apparent concession (which replaces family separation with whole-family detention, something immigration rights advocates say merely trades one trauma for another), Trump later in the week doubled-down on his anti-immigrant rhetoric by flipping the empathy table. He held a press conference with so-called angel families, whose loved ones had been killed by people in the U.S. illegally. “These are the American citizens permanently separated from their loved ones,” he said. The implication was plain: You want empathy? I’ll show you empathy. You’re the ones ignoring worse pain. The controversy over “civility” in the wake of administration officials being hounded in public likewise insists that we prioritize the feelings of these officials over the needs of the families separated at the border to be reunited as quickly as direct action can facilitate. The controversy reflects the idea that people empathize more easily with their peers. Civility hits home for beltway insiders who can’t imagine having to emigrate but can imagine having their dinners disturbed over policies they have proposed or enabled. Empathy becomes a game that can be rigged by generating opposing claims to who deserves its spotlight, leading to a stalemate of competing moral outrage. As Bloom pointed out, “political debates typically involve a disagreement not over whether we should empathize, but over who we should empathize with.”

What emerges from this is that appeals to empathy are politically useless unless scaffolded by an accurate understanding of power. Trump’s dehumanizing rhetoric against immigrants is frightening not only because it reflects a lack of empathy for people in a desperate situation, but also because he has the ability to turn that rhetoric into policy. Without that understanding to scaffold it, empathy can be mobilized to generate fellow-feeling for elites already operating from a position of strength and shield them from the consequences of their actions. It’s worth noting that Obama, who extolled the benefits of empathy, deported more than five million people and escalated the use of drone strikes abroad. The families separated (temporarily or permanently) by those actions didn’t suffer any less because the president championed empathy.

If the 21st-century U.S. is to avoid being described in some future pop-psych book as a “society without empathy,” direct confrontation with the architects of injustice will be required. When Fox News anchors are minimizing the child separation policy by saying, “It’s not like he’s doing this to the people of Idaho or Texas,” it’s time to stop tinkering with the right empathy technology to tweak the hearts and minds of Trump voters and time to start figuring out how to disrupt the machinery of active oppression.

02 Jul 18:49

EMPATHIC CONSUMPTION

by Real Life

“The discourse around empathy portrays it as a moral super-emotion,” Olivia Rosane writes this week: If we can feel as others do, we will be more motivated to do right by others, and less likely to do them harm. But empathy, though it might be a means of building relationships and alliances, is insufficient for understanding power structures. It is often invoked by those with the privilege of imagining their own reality as the baseline around which other realities orbit, or else it becomes a glorified pastime — a way of commodifying and consuming other people’s experiences for one’s own pleasure.

Virtual reality is often sold as an “empathy machine” — a narrative technology capable of placing a consumer in other’s position, supercharging their fellow-feeling for social good, boosting fundraising efforts, making viewers more likely to act on human rights concerns while eradicating their prejudices. While this seems promising, Rosane writes, it can also inscribe or re-inscribe a destructive power dynamic between the consumer and the person whose story is being consumed.

VR, of course, is not the first narrative technology to cultivate such a noble veneer: as Rob Horning writes in “Apathy Machines,” 18th-century novels were “testing devices” for emotional integrity, designed to cultivate their readers’ sensibilities, prove their inner worth with feeling, while literary categories of moral legibility bled out into the real world. “If we choose to have a particular experience, doesn’t that make it more a commodified consumer good rather than an ethics lesson?” Horning writes. “Or rather, doesn’t that mainly teach us that we can enjoy feeling ethical as an on-demand experience?” The opposite applies: As Linda Kinstler wrote last February, in an essay on VR models of atrocity sites like Nazi death camps, virtual reality “may very well be the ‘ultimate empathy machine’… but it can manufacture cruelty too.”

Political work can be tedious, messy, and complex, while feelings are immediate and immersive. But they do not necessarily lead to the soundest reasoning, and they are never free of bias — as Paul Bloom, author of Against Empathy, has argued, people are more likely to empathize with someone they already see themselves in. “Empathy” can be weaponized: Even with the best intentions, relying too much on empathy as a driver of action targets individuals rather than larger, more complex forces. Moreover, immersion in another’s experience does not prefigure identification with it. As W. Sebastian Kamau wrote in November last year, in an essay on the limitations of empathy as the primary goal for VR over envisioning new ways of being, “to suppose VR is a solution to racism implies that racism is personal and not also a social pathology. And so, while VR addresses individuals, it does not fix the broader social systems of discrimination that feed and are fed by the individual feelings of animus.” Strategic empathy puts the onus on survivors to translate their experiences for an audience; it risks doing more harm by forcing people to relive or commodify their own distress. A familiar narrative, palatable to those whose attention is being solicited, becomes an imposition that excludes and erases those whose experiences don’t fit.

Featuring:

“Empathy Machines,” by Olivia Rosane

“Apathy Machines,” by Rob Horning

“Rooms Full of Mirrors,” by W. Sebastian Kamau

“Virtual Atrocities,” by Linda Kinstler


Thank you for your consideration. Visit us next week for Real Life’s upcoming installment, SELF-EXPLOITATION.

02 Jul 18:49

Tired of queuing for the office toilet? Meet Occu-Pi

by Alex Bate

This is the story of Occu-Pi, or how a magnet, a Raspberry Pi, and a barrel bolt saved an office team from queuing for the toilet.

Occu Pi Raspberry Pi toilet signal

The toil of toilet queuing

When Brian W. Wolter’s employer moved premises, the staff’s main concern as the dearth of toilets at the new office, and the increased queuing time this would lead to:

Our previous office had long been plagued by unreasonably long bathroom lines. At several high-demand periods throughout the day we’d be forced to wait three, four, five people deep while complaining bitterly to each other until our turn to use the facilities arrived. With even fewer bathrooms in our new office, concern about timely access was naturally high.

Faced with this problem, the in-house engineers decided to find a technological solution.

Occu-Pi

The main thing the engineers had to figure out was just how to determine the difference between a closed door and an occupied stall. Brian explains in his write-up:

There is one notable wrinkle: it’s not enough to know the door is closed, you need to know if the bathroom is actually in use — that is, locked from the inside. After considering and discarding a variety of ‘creative’ solutions (no thank you, motion sensors and facial recognition), we landed on a straightforward and reliable approach.

The team ended up using a magnet attached to the door’s barrel bolt to trigger a notification. Simply shutting the door doesn’t act as a trigger — the bolt needs to lock the door to set off a magnetic switch. That switch then triggers both LED notifications and updates to a dedicated Slack channel.

Occu-Pi Raspberry Pi toilet signal

For the technically-minded, Occu-Pi is a pretty straightforward build. And those wanting to learn more about it can find a full write-up in Brian’s Medium post.

We’ve seen a few different toilet notification projects over the years, for example this project from DIY Tryin’ using a similar trigger plus a website. What’s nice about Occu-Pi, however, is the simplicity of its design and the subtle use of Slack — Pi Tower’s favoured platform for office shenanigans.

The post Tired of queuing for the office toilet? Meet Occu-Pi appeared first on Raspberry Pi.

02 Jul 18:49

HTC Cutting 1,500 Jobs in Taiwan For Better Resource Management

by Rajesh Pandey
Despite HTC’s earnest efforts, its smartphone business has failed to take off over the last few years. After selling off a part of its smartphone business to Google, HTC has now announced that it will be laying off 1,500 people from its manufacturing unit in Taiwan. Continue reading →
02 Jul 18:48

All the building footprints in the United States

by Nathan Yau

Microsoft released a comprehensive dataset for computer-generated building footprints in the United States. The method:

We developed a method that approximates the prediction pixels into polygons making decisions based on the whole prediction feature space. This is very different from standard approaches, e.g. Douglas-Pecker algorithm, which are greedy in nature. The method tries to impose some of a priory building properties, which are, at the moment, manually defined and automatically tuned.

The GeoJSON files for each state are available for download, released under the Open Data Commons Open Database License. Nice.

Tags: buildings, Microsoft

02 Jul 18:48

Root Store Policy Updated

by wthayer

After several months of discussion on the mozilla.dev.security.policy mailing list, our Root Store Policy governing Certification Authorities (CAs) that are trusted in Mozilla products has been updated. Version 2.6 has an effective date of July 1st, 2018.

More than one dozen issues were addressed in this update, including the following changes:

  • Section 2.2 “Validation Practices” now requires CAs with the email trust bit to clearly disclose their email address validation methods in their CP/CPS.
  • The use of IP Address validation methods defined by the CA has been banned in certain circumstances.
  • Methods used for IP Address validation must now be clearly specified in the CA’s CP/CPS.
  • Section 3.1 “Audits” increases the WebTrust EV minimum version to 1.6.0 and removes ETSI TS 102 042 and 101 456 from the list of acceptable audit schemes in favor of EN 319 411.
  • Section 3.1.4 “Public Audit Information” formalizes the requirement for an English language version of the audit statement supplied by the Auditor.
  • Section 5.2 “Forbidden and Required Practices” moves the existing ban on CA key pair generation for SSL certificates into our policy.
  • After January 1, 2019, CAs will be required to create separate intermediate certificates for issuing SSL and S/MIME certificates. Newly issued Intermediate certificates will need to be restricted with an EKU extension that doesn’t contain anyPolicy, or both serverAuth and emailProtection. Intermediate certificates issued prior to 2019 that do not comply with this requirement may continue to be used to issue new end-entity certificates.
  • Section 5.3.2 “Publicly Disclosed and Audited” clarifies that Mozilla expects newly issued intermediate certificates to be included on the CA’s next periodic audit report. As long as the CA has current audits, no special audit is required when issuing a new intermediate. This matches the requirements in the CA/Browser Forum’s Baseline Requirements (BR) section 8.1.
  • Section 7.1 “Inclusions” adds a requirement that roots being added to Mozilla’s program must have complied with Mozilla’s Root Store Policy from the time that they were created. This effectively means that roots in existence prior to 2014 that did not receive BR audits after 2013 are not eligible for inclusion in Mozilla’s program. Roots with documented BR violations may also be excluded from Mozilla’s root store under this policy.
  • Section 8 “CA Operational Changes” now requires notification when an intermediate CA certificate is transferred to a third party.

A comparison of all the policy changes is available here.

The post Root Store Policy Updated appeared first on Mozilla Security Blog.