Shared posts

13 Oct 12:41

Not Safe For Not Working On | Dan Kaminsky's Blog on WordPress.com

There’s an old Soviet saying:

If you think it, don’t say it.
If you say it, don’t write it.
If you write it, don’t be surprised.

It’s not a pleasant way to live.  The coiner of this quote was not celebrating his oppression.  The power of the Western brand has long been associated with its outright rejection of this sort of thought policing.

In the wake of a truly profound compromise of sensitive photographs of celebrities, those of us in Information Security find ourselves called upon to answer what this all means – to average citizens, to celebrities, to a global economy that has found itself transformed in ways not necessarily planned.  Let’s talk about some things we don’t normally discuss.

Victim Shaming Goes Exponential

Hey @itsjenIawrence. Maybe you shouldn't pose nude if you can't handle the public seeing it. #dumdum. And don't step on downed power lines!


Larry WACHS (@houseofwachs) September 01, 2014

Dumdum?  Really?

We shouldn’t entirely be surprised.  Victim shaming is par for the course in Infosec, and more than Infosec, for uncomfortably similar reasons.  When social norms are violated, a society that cannot punish the transgressor will punish the victim.  If the victim is not made a monster, their unpunished victimization today could become our unpunished victimization tomorrow.  And that’s such a dark and scary conclusion that it’s really quite tempting to say –

No, it’s OK.  Only these celebrities got hacked, not me, because they were so stupid they took sexy photos.  It attracted the hackers.

As if the hackers knew there had to be such photos in the first place, and only stole the photos.  As if we don’t all have private lives, with sensitive bits, that could be or already have been acquired by parties unknown.  We’ve all got something to lose.  And frankly, it may already be lost.

You Don’t Necessarily Know When You’ve Been Hit, Let Alone What’s Gone

There’s a peculiar property of much criminality in the real world:  You notice.  A burgled home is missing things, an assaulted body hurts.  These crimes still occur, but we can start responding to them immediately.  If there’s one thing to take away from this compromise, it’s that when it comes to information theft you might find out quickly, or you may never find out at all.  Consider this anonymous post, forwarded by @OneTrueDoxbin to Daniel Wolf (better known as the surprisingly insightful @SwiftOnSecurity):

anontheory

It is a matter of undisputable fact that “darknet” information trading networks exist.  People collected stamps, after all, and there’s way rarer stuff floating around out there than postal artifacts.  This sort of very personal imagery is the tip of a very large and occasionally deeply creepy iceberg.  The most interesting aspects of Daniel Wolf’s research have centered on the exceptions – yes, he found, a significant majority of the files came from iPhones, implicating some aspect of the Apple iCloud infrastructure.  But not all – there’s some JVC camcorder data here, a Motorola RAZR EXIF extension there – and there’s a directory structure that no structured database might have but a disorganized human whose photo count doesn’t number in the billions would absolutely use.  The exceptions show more of a network and less of a lone operator.

The key element of a darknet is, of course, staying dark.  It’s hard to do that if you’re taunting your victims, and so generally they don’t.  Some of the images Daniel found in his research went back years.  A corollary of not discovering one attack is not detecting many, extending over many victims and coming from multiple attackers.

Of course, darknets have operational security risks, same as anyone, and eventually someone might come in to game the gamers.  From someone who claims to be the original leaker:

“People wanted shit for free. Sure, I got $120 with my bitcoin address, but when you consider how much time was put into acquiring this stuff (i’m not the hacker, just a collector), and the money (I paid a lot via bitcoin as well to get certain sets when this stuff was being privately traded Friday/Saturday) I really didn’t get close to what I was hoping.

Real?  Fake?  Can’t really know.  Pretty risky, trying to draw together a narrative less than a hundred hours since the initial compromise was detected.  It’s the Internet, people lie, even more so anonymously.  It fits with my personal theory that the person who acquired these images isn’t necessarily the person who’s distributing them (I figured hacker-on-hacker theft), but heh.  It’s amazingly easy to have your suspicions confirmed.

One reporter asked me how it was possible that J.P. Morgan could immediately diagnose and correct their extended infection, while Apple couldn’t instantaneously provide similar answers.  As I told them, J.P. Morgan knew without question they were hit, and had the luxury of deciding its disclosure schedule (with some constraints); this particular case simply showed up on 4Chan during Labor Day Weekend when presumably half the people who would investigate were digging their way back from Burning Man.  Internal discoveries and external surprises just follow different schedules.

I’ve personally been skeptical that an account brute forcing bug that happened to be discovered around now, was also used for this particular attack.  There’s only so many days in the year and sometimes multiple events happen close in time just randomly.  As it happens, Apple has confirmed at least some of these celebrity raids have come via account attacks, but whether brute forcing was required hasn’t been disclosed.  It does seem that this exploit has been used in the field since at least May, however, lending some credibility.

We have, at best, a partial explanation.  Much as we desperately would like this to be a single, isolated event, with a nice, well defined and well funded defender who can make sure this never happens again – that’s just not likely to be the case.  We’re going to learn a lot more about how this happened, and in response, there will be improvements.  But celebrity (and otherwise) photo exploitation will not be found to be an isolated attack and it won’t be addressed or ended with a spot fix to password brute forcing.

So there’s a long investigation ahead, quite a bit longer than a single press cycle.

Implications For Cloud Providers

Are we actually stuck right now at another password debate?  Passwords have failed us yet again, let’s have that tired conversation once more?  Sam Biddle, who otherwise did some pretty good research in this post, did have one somewhat amusing paragraph:

To fix this, Apple could have simply forced everyone to use two-factor verification for their accounts. It’s easy, and would have probably prevented all of this.

Probably the only time “simply”, “easy”, and “two-factor verification” have ever been seen in quite such proximity, outside of marketing materials anyway.  There’s a reason we use that broken old disco tech.

Still, we have to do better.  So-called “online brute-forcing” – where you don’t have a database of passwords you want to crack, but instead have to interact with a server that does – is a far slower, and far noisier affair.

But noise doesn’t matter if nobody is listening.  Authentication systems could probably do more to detect brute force attacks across large numbers of accounts.  And given the wide variety of systems that interface with backend password stores, it’s foolish to expect them all to implement rate limiting correctly.  Limits need to exist as close as possible to the actual store, independent of access method.

Sam’s particularly right about the need to get past personal entropy.  Security questions are time bombs in a way even passwords aren’t.  In a world of tradeoffs, I’m beginning to wonder if voice prints across sentences aren’t better than personal information widely shared.  Yes, I’m aware of the downsides, but look at the competition.

iamgroot

OK.  It’s time to ban Password1.  Many users like predictable passwords.  Few users like their data being compromised.  Which wins?  Presently, the former.  Perhaps this is the moment to shift that balance.  Service providers (cloud and otherwise) are burying their heads in the sand and going with password policies that can only be called inertial.   Defenders are using simple rules like “doesn’t have an uppercase letter” and “not enough punctuation” to block passwords while attackers are just straight up analyzing password dumps and figuring out the most likely passwords to attempt in any scenario.  Attackers are just way ahead.  That has to change.  Defenders have password dumps too now.  It’s time we start outright blocking passwords common enough that they can be online brute forced, and it’s time we admit we know what they are.

We’re not quite ready to start generating passwords for users, and post-password initiatives like Fido are still some of the hardest things we’re working on in all of computer engineering.  But there’s some low hanging fruit, and it’s probably time to start addressing it.

And we can’t avoid the elephant in the room any longer.

In Which The Nerd Has To Talk About Sex Because Everyone Else Won’t

It’s not all victim shaming. At least some of the reaction to this leak of celebrity nudity can only be described as bewilderment.  Why are people taking these photos in the first place?  Even with the occasional lack of judgment… there’s a sense of surprise.  Is everybody taking and sending sexy photos?

No.  Just everyone who went through puberty owning a cell phone.

I’m joking, of course.  There are also a number of people who grew up before cell phones who nonetheless discovered that a technology able to move audio, still images, and videos across the world in an instant could be a potent enabler of Flirting-At-A-Distance.  This tends to reduce distance, increasing…happiness.

Every generation thinks it invents sex, but to a remarkable degree generations don’t talk to each other about what they’ve created.  It’s rarely the same, and though older generations can (and do) try, there is nothing in all of creation humans take less advice about than mating rituals.

So, yeah.  People use communication technologies for sexy times.  Deal with it.

Interestingly, to a very limited extent, web browsers actually do.  You may have noticed that each browser has Porn Mode.  Oh, sure, that particular name never makes it through Corporate Branding.  It gets renamed “InPrivate Browsing” or “Incognito Mode” or “The I’m Busy I’ll Be Out In A Minute Window”.  The actual feature descriptions are generally hilarious parallel constructions about wanting to use a friend’s web browser to buy them a gift, but not having the nature of the gift show up in their browser cache.  But we know the score and so do browser developers, who know the market share they’d lose if they didn’t support safer consumption of pornography (at least in the sense that certain sites don’t show up on highly visible “popular tabs” pages during important presentations).

I say all this because of a tweet that is accurate, and needs to be understood outside the context of shaming the victim:

The risk to copy naked pics to iCloud, esp. as a celebrity, may just be too high to be acceptable. And saying that is not "blaming women".


JP Aumasson (@veorq) September 02, 2014

Technology can do great, wonderful, and repeatedly demanded things, and still have a dark side.  That’s not limited to sexy comms.  That applies to the cloud itself.

True story:  A friend of mine and I are at the airport in Abu Dhabi a few years back.  We get out of the taxi, she drops her cell phone straight into a twenty foot deep storm drain.  She starts panicking:  She can’t leave her phone.  She can’t lose her phone.  She’s got pictures of her kids on that phone that she just can’t lose.  “No problem, I get police” says the taxi driver, who proceeds to drive off, with all our stuff.

We’re ten thousand miles away from home, and our flight’s coming.  Five minutes go by. Ten.  Fifteen…and the taxi driver returns, with a police officer, who rounds up some airport workers who agree to help us retrieve the phone (which, despite being submerged for twenty minutes, continued to work just fine).

Probably the best customer service I’ve ever received while traveling, but let me tell you, I’d have rather just told my friend to pull the photos off the cloud.

The reality is that cell phone designers have heard for years what a painful experience it is to lose data, and have prioritized the seamless recovery of those bits best they can. It’s awful to lose your photos, your emails, your contacts.  No, really, major life disruption.  Lot of demand to fix that.  But in all things there are engineering tradeoffs, and data that is stored in more than one location can be stolen from more than one location.  98% of the time, that’s OK, you really don’t want to lose photos of your loved ones.  You don’t care if the pics are stolen, you’re just going to post them on Facebook anyway.

2% of the time, those pictures weren’t for Facebook.  2% of the time, no it’s cool, those can go away, you can always take more selfies.  Way better to lose the photos than see them all over the Internet.  Terrible choice to have to make, but not generally a hard decision.

So the game becomes, separate the 98% from the 2%.

3_inbox_screen_new-bgg

So, actual concrete advice.  Just like browsers have porn mode for the personal consumption of private imagery, cell phones have applications that are significantly less likely to lead to anyone else but your special friends seeing your special bits.  I personally advise Wickr, an instant messaging firm that develops secure software for iPhone and Android.  What’s important about Wickr here isn’t just the deep crypto they’ve implemented, though it’s useful too.  What’s important in this context is that with this code there’s just a lot fewer places to steal your data from.  Photos and other content sent in Wickr don’t get backed up to your desktop, don’t get saved in any cloud, and by default get removed from your friend’s phone after an amount of time you control.  Wickr is of course not the only company supporting what’s called “ephemeral messaging”; SnapChat also dramatically reduces the exposure of your private imagery (with the caveat that with SnapChat, unlike Wickr, SnapChat itself gets an unencrypted copy of your imagery and messaging so you have to hope they’re not saving anything.  Better for national intelligence services, worse for you).

Sure, you can hunt down settings that reduce your exposure to specific cloud services.  You’ve still got to worry about desktop backups, and whatever your desktop is backing up to.  But really, if you can keep your 2% far away from your 98%, you’ll be better off.

In the long run, I think the standard photo applications will get a UI refresh, to allow “sensitive photographs” (presumably of surprise birthday parties in planning) to be locked to the device, allowed through SMS only in directly authenticated circumstances, and not backed up.  Something like a lock icon on the camera screen.  I don’t think the feature request could have happened before this huge leak.  But maybe now it’s obvious just how many people require it.

Like this:

Like Loading...

Related

Bookmarked at brandizzi Delicious' sharing tag and expanded by Delicious sharing tag expander.
09 Sep 20:53

O governo sob investigação

by João Villaverde

No final eletrizante da segunda temporada da série de TV americana House of Cards, o governo federal é investigado por conta de má gestão pública. No olho do furacão, estão o presidente Garret Walker e, em menor medida, seu vice-presidente (e protagonista de House of Cards) Frank Underwood, interpretado por Kevin Spacey. Quem investiga o governo americano na série… é o próprio governo, por meio de procuradores federais, tendo à frente a procuradora especial Heather Dunbar, interpretada por Elizabeth Marvel.

Não, leitor, não vou contar aqui como termina o imbróglio de House of Cards (aliás, assistam: a série é fantástica). A história aqui é outra – real e brasileira. Há, no exato momento em que essas linhas são escritas, um paralelo entre a série de televisão norte-americana sobre o poder em Washington com o que está acontecendo com a equipe econômica do governo federal em Brasília. Mas aqui o foco não é diretamente a presidente Dilma Rousseff, mas sua equipe econômica.

O Ministério Público Federal (MPF) está investigando a área econômica do governo federal. Mais precisamente, o Tesouro Nacional, o Ministério da Fazenda e o Banco Central estão no foco da procuradora Ana Carolina Tannúz Diniz, titular do 4º Ofício de Atos Administrativos do MPF do Distrito Federal (MPF-DF).

Ela não está sozinha. O procurador Júlio Marcelo de Oliveira, do Ministério Público junto ao Tribunal de Contas da União (TCU) também viu indícios de problemas graves na gestão do dinheiro público. Ele apresentou um requerimento ao TCU, em que aponta para a necessidade de realizar uma “inspeção” no Tesouro Nacional e no Banco Central.

O leitor deve, agora, estar se perguntando a razão dessas investigações. Entramos, agora, em um terreno arenoso – as contas fiscais da União.

Desde o início deste ano, o governo está pressionado a cumprir uma meta fiscal de R$ 99 bilhões, o equivalente a 1,9% do Produto Interno Bruto (PIB). Essa meta, hoje, parece praticamente impossível de ser atingida, porque as receitas do governo estão em queda diante da economia em recessão e porque os gastos, por outro lado, continuam aumentando. O governo não cumpriu sua meta fiscal em 2012 (quando fez 2,4% do PIB enquanto prometia 3,1%) e em 2013 (entregou 1,9% do PIB, mas tinha prometido fazer 2,3% do PIB).

A meta de 2014, então, tinha que ser alcançada. O ano começou difícil, com o rebaixamento da nota de crédito do Brasil pela agência internacional Standard & Poor’s (S&P). A baixa confiança de empresários e consumidores com o futuro também diminuiu a força dos investimentos e do consumo das famílias, também apertado pela inflação alta. O quadro, ali em fevereiro-março, não era bom e muitos economistas do próprio governo já imaginavam que poderia piorar… como piorou, de fato.

Coisas estranhas, então, começaram a acontecer com as contas públicas.

Em maio, o governo anunciou um déficit primário de R$ 11 bilhões. Isto é, o setor público gastou R$ 11 bilhões a mais do que arrecadou em maio. Este foi o pior resultado fiscal para meses de maio desde 1999, quando a série histórica começou. Mas esse buraco poderia ter sido ainda maior se não fosse a incorporação nas contas fiscais de um volume de R$ 4 bilhões que estava em uma conta em separado de um banco privado nacional.

Sim, leitor, falamos aqui do misterioso caso dos R$ 4 bilhões. O Banco Central informou ao Estadão ter encontrado esse dinheiro numa conta de um banco privado que estava escapando ao sistema automático de verificação fiscal do governo federal. Os quatro bilhões de reais referiam-se a um crédito a favor da União e sua descoberta, portanto, melhorou o quadro do governo. Como disse ao Estadão o porta-voz do BC em entrevistas gravadas, “o déficit de maio poderia ter sido R$ 15 bilhões se não fossem os R$ 4 bilhões”.

Dias depois de revelada a informação, o próprio BC soltou uma nota oficial com uma informação muito importante: a área de supervisão da autoridade monetária está analisando essa estranha operação do banco privado. Duas perguntas continuam sem resposta sobre esse “caso dos R$ 4 bilhões”:

1) Por que o banco privado fez uma mudança em seu registro contábil, fazendo com os R$ 4 bilhões simplesmente saíssem do radar do governo?

2) De onde saiu esse dinheiro? Por se tratar de um crédito da União, a pergunta é válida: de que natureza era esse dinheiro?

Os procuradores da República estão apreensivos com esse caso. Mas não é apenas isso que causa estranheza nas contas fiscais do governo. Desde o início do ano, especialistas em contas públicas do mercado financeiro e da academia brasileira tem chamado a atenção para a evolução das despesas federais. Elas estariam subindo menos do que deveriam. O caso da Previdência Social é o mais fácil de entender. O governo, por meio do INSS, paga aposentadorias e pensões. De 2013 para 2014, o valor dos benefícios teve um reajuste real, isto é, acima da inflação, de 1%. Além disso, há sempre um aumento inercial no número de aposentados e pensionistas de um ano para outro, por questões demográficas e melhorias sociais.

Ou seja: há mais gente recebendo benefícios e também o valor dos benefícios é maior em 2014, no entanto, as despesas federais com a Previdência subiram pouco de janeiro a julho. Matematicamente, isso não faz sentido. Então, por que isso está acontecendo?

O Tesouro Nacional, responsável pelo repasse do dinheiro aos bancos públicos e privados (que pagam as obrigações do INSS), estaria atrasando a transferência do dinheiro. O expediente, apelidado de “pedalada fiscal” pelos economistas, serviria para reduzir artificialmente as despesas federais. Ao deixar de repassar o dinheiro em um mês para repassar no mês seguinte, e assim por diante, o governo estaria tendo, portanto, menos despesas mensais. Como a economia é a ciência das expectativas, a estratégia seria então assegurar, ao menos por alguns meses, que a meta fiscal de 2014 seria sim cumprida.

As “pedaladas” estariam ocorrendo de forma mais aguda na Caixa Econômica Federal, e envolveriam não apenas a Previdência, mas também repasses obrigatórios do Tesouro para bancar programas sociais, como Bolsa Família, e trabalhistas, como o Abono Salarial. Aqui, o caso fica sério. Com os saldos crescentemente negativos em suas contas sociais, a Caixa buscou uma solução inédita: bateu na porta da Advocacia Geral da União (AGU). A AGU abriu uma Câmara de Conciliação e Arbitragem para resolver a pendência entre Tesouro, Caixa e Banco Central. O conflito entre Caixa e Tesouro chegou no auge.

Os capítulos mais recentes são de arrepiar quem acompanha economia. Esses atrasos do Tesouro, confirmados pela Caixa em documento preparado por sua área jurídica, podem ser entendidos de duas formas. Se ficar entendido que o Tesouro pode atrasar o repasse do dinheiro porque sua relação com a Caixa é de prestação de serviços, OK, mas um precedente perigoso de ciranda de atrasos poderia se estabelecer. No entanto, se ficar entendido que os atrasos do Tesouro constituem uma operação de crédito da Caixa, então o caso entra no terreno legal. Como a Caixa está pagando tudo em dia, ela está usando capital próprio para custear programas oficiais. O artigo 36 da Lei de Responsabilidade Fiscal (LRF) veda que o Tesouro Nacional seja financiado por bancos estatais. Na prática, é o que está acontecendo… a não ser que a AGU entenda que são contratos de serviços.

O BC, por meio de sua Procuradoria-Geral, acha que se trata de um contrato de prestação de serviços. Isso ficou evidente no memorando enviado pelo BC à Procuradoria-Geral da Fazenda Nacional (PGFN) há duas semanas, quando o BC questiona a PGFN sobre o assunto. Obtida pelo Estadão, a resposta da PGFN foi direta: não cabe a ela dizer o que é ou não. Ou seja, o pepino ficou mesmo com a AGU.

Mas, agora, diante da gravidade do caso, a opinião da AGU poderá se transformar não apenas em um entendimento jurídico do governo, mas sim na tese que o governo usará para se defender caso os procuradores da República entendam o contrário.

Sob investigação do Ministério Público Federal (MPF) e do MP junto ao TCU, a área econômica do governo Dilma Rousseff deve, agora, dar o próximo passo.

 

****

Uma boa notícia sobre o “caso dos R$ 4 bilhões” –> aqui.

09 Sep 14:24

Washington Puzzled as Putin Doesn’t Back Down

by Scott McConnell

Consider an analogy to get a sense of how Russia might perceive America’s Ukraine policy. It is imperfect of course, because unlike Russia, America has no history of being invaded, unless you count the War of 1812. But a comparison might be instructive nonetheless:

By 2034, China’s power position has risen relative to America’s. America has evacuated its East Asian bases, under peaceful but pressured circumstances. The governments of Korea and Japan and eventually the Philippines had, by 2026, concluded it was better off with a “less provocative” more neutral arrangement. The huge naval base at Subic Bay became home to a multilateral UN contingent. China’s economy had been larger than America’s for a while, though American per capita income is still somewhat higher. American technological innovation edge has largely disappeared, America still has a lot of soft power—people over the world prefer Hollywood movies to Chinese and America’s nuclear arsenal exceeds the Chinese. But the countries are far more equal than today, and throughout much of the world it is assumed that China will be tomorrow’s dominant “hyperpower.”

A political crisis erupts in Mexico. Mexico has a freely elected but typically corrupt government, whose leading figures are linked to Wall Street and Miami Beach by ties of marriage and money. But many in Mexico—where anti-gringo nationalism remains a potent force—want to become the first “North American partner” in the China led Greater East Asian Co-Prosperity Sphere. Young Mexicans proclaim defiantly they are “people of color” and laud the fact non-white China is rising while America, country of aging white people, is in decline. Their sentiments, materialistic and infused with personal ambitions are so permeated with anti-American, anti-imperialist “third worldist” rhetoric that it is difficult for outsiders to sort out the true motivations. When the Mexican government, under American pressure, rejects a Chinese invitation for candidate membership in China’s East Asian Co-Prosperity Sphere, long prepared protests erupt in Mexico City.

The core group of protest leaders and organizers have been on the Chinese payroll for some time, as the heads of various civic action and popular democracy initiatives, many with an obvious anti-gringo flavor. Soon Chinese politicians and movie stars begin flocking to Mexico City to be photographed with the protesters. Thus encouraged, protester demands escalate, including not only the resignation of the government, Mexico’s adhesion to the Chinese economic bloc, but a military alliance with China. The NSA captures a cell phone conversation of the Chinese ambassador discussing who will hold what posts in the next Mexican cabinet. Three days later, sniper fire of undetermined origin riddles the protestors and police, and any semblance of order breaks down. Mexico’s president flees to Miami.

The above scenario parallels pretty directly the run-up to the Ukraine crisis, before Russia began to respond forcefully. One can of course see the ambiguities of right and wrong. Why should America have anything to say about whether Mexico has a revolution and joins an anti-American military alliance, some would ask. Mexico is sovereign, and should be able to join any international grouping it wants.

What is most striking about the Ukraine crisis is how much the Washington debate lacks any sense of how the issue might look to other interested parties, particularly Russia. Putin is analysed of course—is he, as Hillary Clinton suggested, following Hitler’s playbook? Or is he merely an aggressive autocrat? Or perhaps he is “in his own world” and not quite sane? But in open Washington conversation at least, and perhaps even at the more reflective levels of government, all talk begins with the premise that Russia’s leader is somewhere on the continuum between aggressive and the irrational. That he might be acting reactively and defensively, as any leader of a large power would be in response to threatening events on its doorstep, is not even part of the American conversation. Thus in the waning days of American unipolarism, America diplomacy sinks into a mode of semi-autism, able to perceive and express its own interests, perceptions, and desires, while oblivious to the concerns of others.

A rare and welcome exception to blindness was the publication in Foreign Affairs of John Mearsheimer’s cogent essay on the Ukraine crisis, which with characteristic directness argues that Western efforts to move Ukraine in the Nato/EE orbit were the “taproot” of the present crisis. Prior to Mearsheimer, one could find analyses tracing how various neoliberal and neoconservative foundations had, with their spending and sponsorship of various “pro-Western” groups, fomented a revolution in Ukraine, but they were generally sequestered in left-liberal venues habitually critical of American and Western policies. In the Beltway power loop, such voices were never heard. The policy of pushing NATO eastward, first incorporating Poland and Bulgaria and then going right up to Russia’s borders moved forward as if on mysterious autopilot. That such a policy was wise and necessary was considered a given when it was discussed at all, which was seldom. Was Obama even aware that a leading neoconservative, a figure from Dick Cheney’s staff, was in charge formulating American policy towards Ukraine—with designs on igniting revolutionary regional transformation? One has to assume not; confrontation with Russia had not been part of Obama’s presidential campaign or style, and since the crisis began his comments have always been more measured than the actions of the government he purportedly leads.

As Mearsheimer points out, there remains still a fairly obvious and quite attractive off-ramp: a negotiation with Russia which settles formally Ukraine’s non-aligned status. There are useful precedents for this: Eisenhower’s negotiation with Krushchev that brought about the withdrawal of foreign troops from Austria in 1955 is one, and so of course is Finland. No one who contemplates where the Ukraine crisis might lead otherwise—with a war that devastates the country or perhaps brings in outside powers to devastate all of Europe, or even explodes the entire northern hemisphere—could sanely consider Austria or Finland—prosperous and free countries—to be bad outcomes. Nevertheless the entire conversation in Washington revolves around measures to make Putin back down, and accept the integration of Ukraine into the EU and eventually NATO. People act baffled that he won’t.

There is a mystery to the way Washington works—how an entire political class came to see as American policy that that Russia be humiliated at its own doorstep as logical, without ever reflecting upon whether this was a good idea in the larger scheme of global politics nor whether the West had the means and will to see it through. Because to see it through likely means war with Russia over Ukraine. (The West-leaning Ukrainians of course, be they democratic or fascist, want nothing more than to have American troops fighting beside them as they become NATO partners, a tail wagging the dog). America’s policy makes sense only if it is taken for granted that Russia is an eternal enemy, an evil power which must be surrounded weakened and ultimately brought down. But very few in Washington believe that either, and virtually no one in the American corporate establishment does. So it’s a mystery—a seemingly iron-clad Washington consensus formed behind a policy, the integration of Ukraine in the West, to whose implications no one seems to have given any serious thought.

Russia’s leaders and diplomats have been telling America to butt out of Ukraine in unambiguous terms for a decade or more. Did American diplomats and CIA agents push for an anti-Russian coup d’etat in Kiev knowing that and pursue it anyway? The sheer recklessness of such an action would border on criminal—but oddly enough, no one who truly counts in Washington, Republican or Democrat, seems even to consider it even slightly misguided.

Scott McConnell is a founding editor of The American Conservative.

09 Sep 13:53

Acting French

I spent the majority of this summer at Middlebury College, studying at l’École Française. I had never been to Vermont. I have not been many places at all. I did not have an adult passport until I was 37 years old. Sometimes I regret this. And then sometimes not. Learning to travel when you’re older allows you to be young again, to touch the childlike amazement that is so often dulled away by adult things. In the past year, I have seen more of the world than at any point before, and thus, I have been filled with that juvenile feeling more times then I can count—at a train station in Strasbourg, in an old Parisian bookstore, on a wide avenue in Lawndale. It was no different in Vermont where the green mountains loomed like giants. I would stare at these mountains out of the back window of the Davis Family Library. I would watch the clouds, which, before the rain, drooped over the mountains like lampshades, and I would wonder what, precisely, I had been doing with my life.

I was there to improve my French. My study consisted of four hours of class work and four hours of homework. I was forbidden from reading, writing, speaking, or hearing English. I watched films in French, tried to read a story in Le Monde each day, listened to RFI and a lot of Barbara and Karim Oeullet. At every meal I spoke French, and over the course of the seven weeks I felt myself gradually losing touch with the broader world. This was not a wholly unpleasant feeling. In the moments I had to speak English (calling my wife, interacting with folks in town or at the book store), my mouth felt alien and my ear slightly off.

And there were the latest developments, the likes of which I perceived faintly through the French media. I had some vague sense that King James had done something grand, that the police were killing black men over cigarette sales, that a passenger plane had been shot out the sky, and that powerful people in the world still believed that great problems could be ultimately solved with great armaments. In sum, I knew that very little had changed. And I knew this even with my feeble French eyes, which turned the news of the world into an exercise in impressionism. Everything felt distorted. I understood that things were happening out there, but their size and scope mostly eluded me.

Acquiring a second language is hard. I have been told that it is easier for children, but I am not so sure if this is for reasons of biology or because adults have so much more to learn. Still, it remains true that the vast majority of students at Middlebury were younger than me, and not just younger, but fiercer. My classmates were, in the main, the kind of high-achieving college students who elect to spend their summer vacation taking on eight hours a day of schoolwork. There was no difference in work ethic between us. If I spent more time studying than my classmates, that fact should not be taken as an accolade but as a marker of my inefficiency.

The majority of people I interacted with spoke better, wrote better, read better, and heard better than me. There was no escape from my ineptitude.

They had something over me, and that something was a culture, which is to say a suite of practices so ingrained as to be ritualistic. The scholastic achievers knew how to quickly memorize a poem in a language they did not understand. They knew that recopying a handout a few days before an exam helped them digest the information. They knew to bring a pencil, not a pen, to that exam. They knew that you could (with the professor’s permission) record lectures and take pictures of the blackboard.

This culture of scholastic achievement had not been acquired yesterday. The same set of practices had allowed my classmates to succeed in high school, and had likely been reinforced by other scholastic achievers around them. I am sure many of them had parents who were scholastic high-achievers. This is how social capital reinforces itself and compounds. It is not merely one high achieving child, but a flock of high achieving children, each backed by high-achieving parents. I once talked to a woman who spoke German, English and French and had done so since she was a child. How did this happen, I asked? “Everyone in my world spoke multiple languages,” she explained. “It was just what you did.”

There were five tiers of French students, starting with those who could barely speak a word and scaling upward to those who were pursuing a master’s degree. I was in the second tier, meaning I could order a coffee, recount a story with some difficulty, write a short note (sans verb and gender agreement), and generally understand a French speaker provided he or she talked to me really slowly. The majority of people I interacted with spoke better, wrote better, read better, and heard better than me. There was no escape from my ineptitude. At every waking hour, someone said something to me that I did not understand. At every waking hour, I mangled some poor Frenchman’s lovely language. For the entire summer, I lived by two words: “Désolé, encore.”

Compared with my classmates on the second tier, my test scores were on the lower end. Each week, in my literature class, we were responsible for the recitation of some French poems (Baudelaire, Verlaine, Lamartine) from memory, and each day we had to recite a stanza. This sort of exercise may well be familiar to readers of The Atlantic, but the rituals required to master it were totally new to me. I had never been a high-achieving student. Indeed, during my 15 or so years in school, I was a remarkably low-achieving student.

The Joy of Learning French

There were years when I failed the majority of my classes. This was not a matter of my being better suited for the liberal arts than sciences. I was an English minor in college. I failed American Literature, British Literature, Humanities, and (voilà) French. The record of failure did not end until I quit college to become a writer. My explanation for this record is unsatisfactory: I simply never saw the point of school. I loved the long process of understanding. In school, I often felt like I was doing something else.

Like many black children in this country, I did not have a culture of scholastic high achievement around me. There were very few adults around me who’d been great students and were subsequently rewarded for their studiousness. The phrase “Ivy League” was an empty abstraction to me. I mostly thought of school as a place one goes so as not to be eventually killed, drugged, or jailed. These observations cannot be disconnected from the country I call home, nor from the government to which I swear fealty.

I mostly thought of school as a place one goes so as to not be eventually killed, drugged, or jailed.

For most of American history, it has been national policy to plunder the capital accumulated by black people—social or otherwise. It began with the prohibition against reading, proceeded to separate and wholly unequal schools, and continues to this very day in our tacit acceptance of segregation. When building capital, it helps to know the right people. One aim of American policy, historically, has been to insure that the “right people” are rarely black. Segregation then ensures that these rare exceptions are spread thin, and that the rest of us have no access to other “right people.”

And so a white family born into the lower middle class can expect to live around a critical mass of people who are more affluent or worldly and thus see other things, be exposed to other practices and other cultures. A black family with a middle class salary can expect to live around a critical mass of poor people, and mostly see the same things they (and the poor people around them) are working hard to escape. This too compounds.

Now, in America, invocations of culture are mostly an exercise in awarding power an air of legitimacy. You can see this in the recent remarks by the president, where he turned a question about preserving Native American culture into a lecture on how we (blacks and Native Americans) should be more like the Jews and Asian Americans, who refrain from criticizing the intellectuals in their midst of “acting white.” The entire charge rests on shaky social science and the obliteration of history. When Asian Americans and Jewish Americans—on American soil—endure the full brunt of white supremacist assault, perhaps a comparison might be in order.

But probably not. That is because fences are an essential element of human communities. The people who patrol these fences are generally unkind to those they find in violation. The phrase “getting above your raising” is little more than anxious working-class border patrolling. The term “white trash” is little more than anxious ruling-class border patrolling. I am neither an expert in the culture of Jewish Americans nor Asian Americans, but I would be shocked if they too were immune. Some years ago I profiled the rapper Jin. As the first Asian-American rapper to secure a major label contract, he often found himself enduring racist cracks from black rappers abroad and the prodding of fence-patrollers at home. “’Yo, what is this? You really think you’re black, Jin?” he recalled his parents saying. “Bottom line—you’re not black, Jin.’”

Pretending that black people are unique—or more ardent—in their fence-patrolling, and thus more parochial and anti-intellectual, serves to justify the current uses of American power. The American citizen is free to say, “Look at them, they criticize each other for reading!” and then go about his business. In that sense it is little different than raising the myth of “black on black crime” when asked about Ferguson.

I will confess to having very little experience with fence-patrolling, and virtually none with the idea that if you are holding a book, you are “acting white.” The Baltimore of my youth was a place where white people rarely ventured. It would not have occurred to anyone I knew to associate reading with white people because very few of us knew any. And I read everything I could find: A Wrinkle In Time, David Walker’s Appeal, Dragon’s of Autumn Twilight, Seize The Time, Deadly Bugs and Killer Insects, The Web of Spider-Man. I had a full set of Childcraft. I loved the volume Make and Do. I had a full set of World Book encyclopedias. I used to pick up the fat “P” edition, flip to a random page, and read for hours. When I was just 6 years old, my mother took me to the Enoch Pratt Free Library on Garrison Boulevard and enrolled me in a competition to see which child could read the most books. I read 24 that summer, far outdistancing the competition. My mother smiled. The librarian gave me candy. I was very proud.

For carrying books in black neighborhoods, in black schools, around black people, I was called many things—nerd, bright, doofus, Malcolm, Farrakhan, Mandela, sharp, smart, airhead. I was told that my “head was too far in the clouds.” I was told that I was “going to do something one day.” But I was never called white. The people who called me a nerd were black. The people who said I was going to “do something one day” were also black. There was no one else around me, and no one else in America then cared. This was not just true of me, it was true of most black children of that era who were then, and are now, the most segregated group in this country. Segregation meant many of us had to rely on traditions closer to home.

The people who called me a nerd were black. The people who said I was going to “do something one day” were also black.

And at home I found a separate culture of intellectual achievement. This is the tradition of Carter G. Woodson, Frederick Douglass, and Malcolm X. It argues for education not simply as credentialism or certification, but as a profound act of auto-liberation. This was the culture of my childhood and it gave me some of the greatest thrills of my youth.

I was a boy haunted by questions: Why do the lilies close at night? Why does my father always say, “I can dig it"? And who really killed the dinosaurs? And why is my life so unlike everything I see on TV? That feeling—the not knowing, the longing for knowing, and the eventual answer—is love and youth to me. And I have always preferred libraries to classrooms because the wide open library is the ultimate venue for this theater. This culture was reinforced by my parents, and the politically conscious parents around me, and their politically conscious children. The culture was so strong that it could be regarded as a kind of social capital. It was so old that it could also be regarded as a legacy. This legacy is more responsible for my presence in these august pages than any other. That is because a good writer must ultimately be an autodidact and take a dim view of credentials. My culture failed to make me into a high-achieving student. It succeeded at making me into a writer.

I have never had much of an urge to brag about this. I have always known that in failing to become a scholastic achiever, I forfeited knowledge of certain things. (A mastery of Augustine comes to mind.) But what I did not understand was that I had also forfeited a culture, which is to say a tool kit, a set of pins and tumblers that might have unlocked the language which I so presently adore.

Scholastic achievement is sometimes demeaned as the useless memorization of facts. I suspect that it has more to offer than this. If you woke my French literature professor at 2 a.m., she could recite the deuxième strophe of Verlaine’s “Il Pleure Dans Mon Coeur.” I suspect this memorization, this holding of the work in her head, allowed her to analyze it and turn it over in ways I could only do with the text in front of me. More directly, there is no real way for an adult to learn French without some amount of memorization. French is a language that obeys its rules when it feels like it. There is no unwavering rule to tell you which nouns are masculine, or which verbs require a preposition. Memory is the only way through.

At Middlebury, I spent as much time as I could with the master’s students, hovering right at the edge of overbearing. On average, I understood 30 percent of what was being said. This was, of course, the point. I wanted to be reminded of who I was. I wanted to be young again, to feel that old thrill of not knowing. It is the same feeling I had as a boy, wondering about the lilies and dinosaurs, listening to “The Bridge Is Over,” wondering where in the world was Queens.

And I was ignorant. I felt as if someone had carried me off at night, taken me out to sea, and set me adrift in a life-raft. And the night was beautiful because it held all the things I would never know, and in that I saw my doom—the time when I could learn no more. Morning, noon, and evening, I sat on the terrace listening to the young master’s students talk. They would recount their days, share their jokes, or pass on their complaints. They came from everywhere—San Francisco, Atlanta, Seattle, Boulder, Hackensack, Philadelphia, Kiev. And they loved all the things I so wanted to love, but had not made time to love—Baudelaire, Balzac, Rimbaud. I would listen and feel the night folding around me, and the ice-water of youth surging through me.

One afternoon, I was walking from lunch feeling battered by the language. I started talking with a young master in training. I told her I was having a tough time. She gave me some encouraging words in French from a famous author. I told her I didn’t understand. She repeated them. I still didn’t understand. She repeated them again. I shook my head, smiled, and walked away mildly frustrated because I understood every word she was saying but could not understand how it fit. It was as though someone had said, “He her walks swim plus that yesterday the fight.” (This is how French often sounds to me.)

The next day, I sat at lunch with her and another young woman. I asked her to spell the quote out for me. I wrote the phrase down. I did not understand. The other young lady explained the function of the pronouns in the sentence. Suddenly I understood—and not just the meaning of the phrase. I understood something about the function of language, why being able to diagram sentences was important, why understanding partitives and collective nouns was important.

In my long voyage through this sea of language, that was my first sighting of land. I now knew how much I didn’t know. The feeling of discovery and understanding that came from this was incredible. It was the first moment when I thought I might survive the sea.

My personal road to this great feeling, to these discoveries, to Middlebury, was not the normal one. I was raised among people skeptical of a canon that had long been skeptical of them. I needed some independent sense of myself, of my cultures and traditions, before I could take a mature look at the West. I wanted nothing to do with Locke because I knew that he wanted little to do with me. I saw no reason to learn French because it was the language of the plunderers of Haiti.

I had to be a nationalist before I could be a humanist. I had to come to understand that black people are not merely the victims of the West, but its architects. The philosophes started the sentence and Martin Luther King finished it. The greatest renditions of this country’s greatest anthems are all sung by black people—Ray, Marvin, Whitney. That is neither biology nor a mistake. It is the necessary cosmopolitanism of a people, viewing America from the basement and thus forced to take their lessons when they get them—absorbing, reinterpreting, refining, creating.

Now it must never be concluded that an urge toward the cosmopolitan, toward true education, will make people stop hitting you. The inverse is more likely. In the early 19th century, the Cherokee Nation was told by the new Americans that if its members adopted their “civilized” ways, they would soon be respected as equals. This promise was deeply embedded in the early 19th century approach to this continents indigenous nations.

“We will never do an unjust act towards you. on the contrary we wish you to live in peace, to increase in numbers, to learn to labor, as we do,” Thomas Jefferson said. “In time you will be as we are; you will become one people with us; your blood will mix with ours; & will spread, with ours, over this great Island. Hold fast then, my Children, the Chain of friendship, which binds us together; & join us in keeping it forever bright & unbroken.”

The Cherokee Nation—likely for their own reasons—embraced mission schools. Some of them converted to Christianity. Other intermarried. Others still enslaved blacks. They adopted a written Constitution, created a script for their language and published a newspaper, The Cherokee Phoenix, in English and Cherokee. Thus the Native Americans of that time showed themselves to be as able to to integrate elements of the West with their own culture as any group of Asian or Jewish American. But the wolf has never much cared whether the sheep were cultured or not.

“The problem, from a white point of view,” writes historian Daniel Walker Howe, “was that the success of these efforts to ’civilize the Indians’ had not yielded the expected dividend in land sales. On the contrary, the more literate, prosperous, and politically organized the Cherokees made themselves, the more resolved they became to keep what remained of their land and improve it for their own benefit.”

Cosmopolitanism, openness to other cultures, openness to education did not make the Cherokee pliant to American power; it gave them tools to resist. Realizing this, the United States dropped the veneer of “culture” and “civilization” and resorted to “Indian Removal,” or The Trail of Tears. The plunder was celebrated in a popular song:

All I want in this creation
Is a pretty little wife and a big plantation
Away up yonder in the Cherokee nation.

The Native Americans of this period found that America’s talk of trading culture for rights was just a cover. In our time, it is common to urge young black children toward education so that they may be respectable or impress the “right people.” But the “right people” remain unimpressed, and the credentials of black people, in a country rooted in white supremacy, must necessarily be less. That great powers are in the business of using "respectability" and "education" to ignore these discomfiting facts does not close the book. You can never fully know. But you can walk in the right direction.

The citizen is lost in the labyrinth constructed by his country, when in fact straight is the gate, and narrow must always be the way. When I left for Middlebury, I had just published an article arguing for reparations. People would often ask me what change I expected to come from it. But change had already come. I had gone further down the unending path of knowing, deeper into the night. I was rejecting mental enslavement. I was rejecting the lie.

I came to Middlebury in the spirit of the autodidactic, of auto-liberation, of writing, of Douglass and Malcolm X. I came in ignorance, and found I was more ignorant than I knew. Even there, I was much more comfortable in the library, thumbing through random histories in French, than I was in the classroom. It was not enough. It will not be enough. Sometimes you do need the master’s tools to dismantle his house.

Bookmarked at brandizzi Delicious' sharing tag and expanded by Delicious sharing tag expander.
05 Sep 11:44

Your Brain on Metaphors

The player kicked the ball.
The patient kicked the habit.
The villain kicked the bucket.

The verbs are the same.
The syntax is identical.
Does the brain notice, or care,
that the first is literal, the second
metaphorical, the third idiomatic?

It sounds like a question that only a linguist could love. But neuroscientists have been trying to answer it using exotic brain-scanning technologies. Their findings have varied wildly, in some cases contradicting one another. If they make progress, the payoff will be big. Their findings will enrich a theory that aims to explain how wet masses of neurons can understand anything at all. And they may drive a stake into the widespread assumption that computers will inevitably become conscious in a humanlike way.

The hypothesis driving their work is that metaphor is central to language. Metaphor used to be thought of as merely poetic ornamentation, aesthetically pretty but otherwise irrelevant. "Love is a rose, but you better not pick it," sang Neil Young in 1977, riffing on the timeworn comparison between a sexual partner and a pollinating perennial. For centuries, metaphor was just the place where poets went to show off.

But in their 1980 book, Metaphors We Live By, the linguist George Lakoff (at the University of California at Berkeley) and the philosopher Mark Johnson (now at the University of Oregon) revolutionized linguistics by showing that metaphor is actually a fundamental constituent of language. For example, they showed that in the seemingly literal statement "He’s out of sight," the visual field is metaphorized as a container that holds things. The visual field isn’t really a container, of course; one simply sees objects or not. But the container metaphor is so ubiquitous that it wasn’t even recognized as a metaphor until Lakoff and Johnson pointed it out.

From such examples they argued that ordinary language is saturated with metaphors. Our eyes point to where we’re going, so we tend to speak of future time as being "ahead" of us. When things increase, they tend to go up relative to us, so we tend to speak of stocks "rising" instead of getting more expensive. "Our ordinary conceptual system is fundamentally metaphorical in nature," they wrote.

What’s emerging from these studies isn’t just a theory of language or of metaphor. It’s a nascent theory of consciousness.

Metaphors do differ across languages, but that doesn’t affect the theory. For example, in Aymara, spoken in Bolivia and Chile, speakers refer to past experiences as being in front of them, on the theory that past events are "visible" and future ones are not. However, the difference between behind and ahead is relatively unimportant compared with the central fact that space is being used as a metaphor for time. Lakoff argues that it is impossible—not just difficult, but impossible—for humans to talk about time and many other fundamental aspects of life without using metaphors to do it.

Lakoff and Johnson’s program is as anti-Platonic as it’s possible to get. It undermines the argument that human minds can reveal transcendent truths about reality in transparent language. They argue instead that human cognition is embodied—that human concepts are shaped by the physical features of human brains and bodies. "Our physiology provides the concepts for our philosophy," Lakoff wrote in his introduction to Benjamin Bergen’s 2012 book, Louder Than Words: The New Science of How the Mind Makes Meaning. Marianna Bolognesi, a linguist at the International Center for Intercultural Exchange, in Siena, Italy, puts it this way: "The classical view of cognition is that language is an independent system made with abstract symbols that work independently from our bodies. This view has been challenged by the embodied account of cognition which states that language is tightly connected to our experience. Our bodily experience."

Modern brain-scanning technologies make it possible to test such claims empirically. "That would make a connection between the biology of our bodies on the one hand, and thinking and meaning on the other hand," says Gerard Steen, a professor of linguistics at VU University Amsterdam. Neuroscientists have been stuffing volunteers into fMRI scanners and having them read sentences that are literal, metaphorical, and idiomatic.

Neuroscientists agree on what happens with literal sentences like "The player kicked the ball." The brain reacts as if it were carrying out the described actions. This is called "simulation." Take the sentence "Harry picked up the glass." "If you can’t imagine picking up a glass or seeing someone picking up a glass," Lakoff wrote in a paper with Vittorio Gallese, a professor of human physiology at the University of Parma, in Italy, "then you can’t understand that sentence." Lakoff argues that the brain understands sentences not just by analyzing syntax and looking up neural dictionaries, but also by igniting its memories of kicking and picking up.

But what about metaphorical sentences like "The patient kicked the habit"? An addiction can’t literally be struck with a foot. Does the brain simulate the action of kicking anyway? Or does it somehow automatically substitute a more literal verb, such as "stopped"? This is where functional MRI can help, because it can watch to see if the brain’s motor cortex lights up in areas related to the leg and foot.

The evidence says it does. "When you read action-related metaphors," says Valentina Cuccio, a philosophy postdoc at the University of Palermo, in Italy, "you have activation of the motor area of the brain." In a 2011 paper in the Journal of Cognitive Neuroscience, Rutvik Desai, an associate professor of psychology at the University of South Carolina, and his colleagues presented fMRI evidence that brains do in fact simulate metaphorical sentences that use action verbs. When reading both literal and metaphorical sentences, their subjects’ brains activated areas associated with control of action. "The understanding of sensory-motor metaphors is not abstracted away from their sensory-motor origins," the researchers concluded.

Textural metaphors, too, appear to be simulated. That is, the brain processes "She’s had a rough time" by simulating the sensation of touching something rough. Krish Sathian, a professor of neurology, rehabilitation medicine, and psychology at Emory University, says, "For textural metaphor, you would predict on the Lakoff and Johnson account that it would recruit activity- and texture-selective somatosensory cortex, and that indeed is exactly what we found."

But idioms are a major sticking point. Idioms are usually thought of as dead metaphors, that is, as metaphors that are so familiar that they have become clichés. What does the brain do with "The villain kicked the bucket" ("The villain died")? What about "The students toed the line" ("The students conformed to the rules")? Does the brain simulate the verb phrases, or does it treat them as frozen blocks of abstract language? And if it simulates them, what actions does it imagine? If the brain understands language by simulating it, then it should do so even when sentences are not literal.

The findings so far have been contradictory. Lisa Aziz-Zadeh, of the University of Southern California, and her colleagues reported in 2006 that idioms such as "biting off more than you can chew" did not activate the motor cortex. So did Ana Raposo, then at the University of Cambridge, and her colleagues in 2009. On the other hand, Véronique Boulenger, of the Laboratoire Dynamique du Langage, in Lyon, France, reported in the same year that they did, at least for leg and arm verbs.

In 2013, Desai and his colleagues tried to settle the problem of idioms. They first hypothesized that the inconsistent results come from differences of methodology. "Imaging studies of embodiment in figurative language have not compared idioms and metaphors," they wrote in a report. "Some have mixed idioms and metaphors together, and in some cases, ‘idiom’ is used to refer to familiar metaphors." Lera Boroditsky, an associate professor of psychology at the University of California at San Diego, agrees. "The field is new. The methods need to stabilize," she says. "There are many different kinds of figurative language, and they may be importantly different from one another."

Not only that, the nitty-gritty differences of procedure may be important. "All of these studies are carried out with different kinds of linguistic stimuli with different procedures," Cuccio says. "So, for example, sometimes you have an experiment in which the person can read the full sentence on the screen. There are other experiments in which participants read the sentence just word by word, and this makes a difference."

To try to clear things up, Desai and his colleagues presented subjects inside fMRI machines with an assorted set of metaphors and idioms. They concluded that in a sense, everyone was right. The more idiomatic the metaphor was, the less the motor system got involved: "When metaphors are very highly conventionalized, as is the case for idioms, engagement of sensory-motor systems is minimized or very brief."

But George Lakoff thinks the problem of idioms can’t be settled so easily. The people who do fMRI studies are fine neuroscientists but not linguists, he says. "They don’t even know what the problem is most of the time. The people doing the experiments don’t know the linguistics."

That is to say, Lakoff explains, their papers assume that every brain processes a given idiom the same way. Not true. Take "kick the bucket." Lakoff offers a theory of what it means using a scene from Young Frankenstein. "Mel Brooks is there and they’ve got the patient dying," he says. "The bucket is a slop bucket at the edge of the bed, and as he dies, his foot goes out in rigor mortis and the slop bucket goes over and they all hold their nose. OK. But what’s interesting about this is that the bucket starts upright and it goes down. It winds up empty. This is a metaphor—that you’re full of life, and life is a fluid. You kick the bucket, and it goes over."

That’s a useful explanation of a rather obscure idiom. But it turns out that when linguists ask people what they think the metaphor means, they get different answers. "You say, ‘Do you have a mental image? Where is the bucket before it’s kicked?’ " Lakoff says. "Some people say it’s upright. Some people say upside down. Some people say you’re standing on it. Some people have nothing. You know! There isn’t a systematic connection across people for this. And if you’re averaging across subjects, you’re probably not going to get anything."

Similarly, Lakoff says, when linguists ask people to write down the idiom "toe the line," half of them write "tow the line." That yields a different mental simulation. And different mental simulations will activate different areas of the motor cortex—in this case, scrunching feet up to a line versus using arms to tow something heavy. Therefore, fMRI results could show different parts of different subjects’ motor cortexes lighting up to process "toe the line." In that case, averaging subjects together would be misleading.

Furthermore, Lakoff questions whether functional MRI can really see what’s going on with language at the neural level. "How many neurons are there in one pixel or one voxel?" he says. "About 125,000. They’re one point in the picture." MRI lacks the necessary temporal resolution, too. "What is the time course of that fMRI? It could be between one and five seconds. What is the time course of the firing of the neurons? A thousand times faster. So basically, you don’t know what’s going on inside of that voxel." What it comes down to is that language is a wretchedly complex thing and our tools aren’t yet up to the job.

Nonetheless, the work supports a radically new conception of how a bunch of pulsing cells can understand anything at all. In a 2012 paper, Lakoff offered an account of how metaphors arise out of the physiology of neural firing, based on the work of a student of his, Srini Narayanan, who is now a faculty member at Berkeley. As children grow up, they are repeatedly exposed to basic experiences such as temperature and affection simultaneously when, for example, they are cuddled. The neural structures that record temperature and affection are repeatedly co-activated, leading to an increasingly strong neural linkage between them.

However, since the brain is always computing temperature but not always computing affection, the relationship between those neural structures is asymmetric. When they form a linkage, Lakoff says, "the one that spikes first and most regularly is going to get strengthened in its direction, and the other one is going to get weakened." Lakoff thinks the asymmetry gives rise to a metaphor: Affection is Warmth. Because of the neural asymmetry, it doesn’t go the other way around: Warmth is not Affection. Feeling warm during a 100-degree day, for example, does not make one feel loved. The metaphor originates from the asymmetry of the neural firing. Lakoff is now working on a book on the neural theory of metaphor.

If cognition is embodied, that raises problems for artificial intelligence. Since computers don’t have bodies, let alone sensations, what are the implications of these findings for their becoming conscious—that is, achieving strong AI? Lakoff is uncompromising: "It kills it." Of Ray Kurzweil’s singularity thesis, he says, "I don’t believe it for a second." Computers can run models of neural processes, he says, but absent bodily experience, those models will never actually be conscious.

On the other hand, roboticists such as Rodney Brooks, an emeritus professor at the Massachusetts Institute of Technology, have suggested that computers could be provided with bodies. For example, they could be given control of robots stuffed with sensors and actuators. Brooks pondered Lakoff’s ideas in his 2002 book, Flesh and Machines, and supposed, "For anything to develop the same sorts of conceptual understanding of the world as we do, it will have to develop the same sorts of metaphors, rooted in a body, that we humans do."

But Lera Boroditsky wonders if giving computers humanlike bodies would only reproduce human limitations. "If you’re not bound by limitations of memory, if you’re not bound by limitations of physical presence, I think you could build a very different kind of intelligence system," she says. "I don’t know why we have to replicate our physical limitations in other systems."

What’s emerging from these studies isn’t just a theory of language or of metaphor. It’s a nascent theory of consciousness. Any algorithmic system faces the problem of bootstrapping itself from computing to knowing, from bit-shuffling to caring. Igniting previously stored memories of bodily experiences seems to be one way of getting there. And so may be the ability to create asymmetric neural linkages that say this is like (but not identical to) that. In an age of brain scanning as well as poetry, that’s where metaphor gets you.

Michael Chorost is the author of Rebuilt: How Becoming Part Computer Made Me More Human (Houghton Mifflin, 2005) and World Wide Mind: The Coming Integration of Humanity, Machines, and the Internet (Free Press, 2011).

05 Sep 01:40

Startup Very Casual About Dress Code, Benefits

by villeashell
Startup Very Casual About Dress Code, Benefits:
AUSTIN, TX—Touting the business’s laid-back, nontraditional corporate culture, Go-Go Maps founder and CEO Mike Hannasch explained to reporters Thursday that his company is pretty casual when it comes to employees’ dress code and benefits…
04 Sep 13:57

Por um princípio da não opressão

by Mano Ferreira

Por Mano Ferreira

A liberdade é um fim em si mesma ou um meio para outra coisa? A pergunta é de uma amiga, grande ativista da liberdade, no dia em que nos conhecemos. Vivíamos a fase inicial da rede Estudantes Pela Liberdade no Brasil. Naquele encontro, na casa de um outro amigo, fiz uma espécie de introdução do movimento liberal pra ela, que depois acabou se tornando uma expressiva liderança. À questão, respondi que, no fim, a única coisa que realmente importa nessa vida são as pessoas. Pessoas existem concretamente. O resto é criação nossa.

Disso decorre que a liberdade, do ponto de vista social, é necessariamente um meio – ou, talvez, um ponto de partida. O fim é o desenvolvimento das pessoas, as emancipações individuais, o florescer das potencialidades, habilidades e, sobretudo, individualidades. Esse é o ponto central do liberalismo: propiciar que as pessoas, livres, sejam o máximo de si mesmas.

Todo o arcabouço teórico vindouro decorre dessa preocupação. Quando nos esquecemos disso, a abstração teórica pode ser ressignificada e transformada em sua essência. É um pouco do que acontece na economia quando o apego às equações supera a vontade de entender a ação humana. Da mesma forma, as conclusões das teses liberais são passíveis de instrumentalizar diversos outros fins, alguns bastante distantes da liberdade das pessoas.

(Isso parece ainda mais claro ao tempo em que conservadores e reacionários sequestram parcelas de nosso discurso, fenômeno que foi tratado com toda ênfase pelo colega Valdenor Júnior.)

Como afirma o estupendo ensaio de Jeffrey Tucker Contra o brutalismo libertário:

“a liberdade [formal] permite tanto a perspectiva humanitária quanto a brutalista, embora isso possa parecer implausível. A liberdade [formal] é ampla e expansiva, não afirma quaisquer fins sociais em particular como únicos e verdadeiros. Dentro da estrutura da liberdade [formal], existe a liberdade de amar e de odiar”.

Fiz questão de adicionar uma palavra, sempre destacada em parênteses, ao trecho sensacional do Jeff: formal, pra mim, remete a uma das dimensões da filosofia da liberdade – aquela que se refere ao papel da lei (estatal ou não), que regulamenta a legitimidade da iniciação da força.

Sem dúvidas, esse traço é fundante para uma ordem social livre – o que não significa que o liberalismo clássico tenha se restringido a isso algum dia. Mesmo assim, atualmente uma expressiva parcela do movimento liberal resume suas preocupações na formulação do principio da não agressão: é a ideia de que nenhum ser humano pode iniciar agressão (no sentido de violação da propriedade humana, que se constitui no tripé vida, liberdade e patrimônio) contra um não-agressor. Esse ponto diz respeito à liberdade negativa, no sentido proposto por Isaiah Berlin em seu clássico Two Concepts of Liberty.

Ocorre que, sendo nosso objetivo a criação de um ambiente propício para que as pessoas sejam o máximo de si mesmas, a insuficiência da não-violência é ainda retumbante. A liberdade negativa não basta.

Há uma outra dimensão da filosofia da liberdade, para além do aspecto formal, a que chamarei aqui de dimensão propositiva.

Vejamos: a dimensão formal aborda a não-violência, ou seja, a necessidade de demolir as barreiras impositivas que bloqueiam a liberdade das pessoas – de um modo geral, numa perspectiva macro, falamos da diminuição do estado coercitivo ou do autoritarismo. Enquanto isso, a dimensão propositiva aborda a construção das teias de cooperação social, o mercado liberto – ou seja, os ductos sociais que amplificam a diversidade de propostas e multiplicam as possibilidades de existência para todas as pessoas – de um modo geral, numa perspectiva macro, falamos do aumento da sociedade voluntarista. Voltando ao sentido proposto por Berlin, agora tratamos da liberdade positiva.

Aqui é válido fazermos um adendo: inicialmente Berlin abordava a defesa da liberdade positiva aglutinada ao dever positivo, ou seja, a imposição sobre os outros da obrigatoriedade de prover as condições objetivas para a concretização daquela liberdade positiva específica. É o modus operandi de diversas correntes de pensamento que falam sobre liberdade com um viés estatista – e Berlin tratou dos sérios problemas advindos dessa concepção. De modo diverso, cremos que o liberalismo precisa conciliar a defesa da liberdade positiva com a liberdade negativa. Ou seja, nos referimos à construção voluntária – e portanto não obrigatória – das condições objetivas para a concretização das liberdades positivas. Nesse sentido, a postura liberal não deve se isentar da responsabilidade de construção de redes de cooperação voluntária em prol da liberdade alheia, mesmo que isso signifique não impor essa condição aos demais.

Assim, em resumo, podemos dizer que o pressuposto básico do liberalismo é a propriedade humana. A sua dimensão formal é constituída, de modo geral, pelo princípio da não agressão. E a minha tese – finalmente chegamos nela – é que, para a dimensão propositiva, devemos constituir o princípio da não opressão.

Assim como a não agressão remete ao pressuposto básico da propriedade humana, instituindo como inaceitáveis as violações materiais objetivas a vida, liberdade e patrimônio; a não opressão volta-se igualmente ao pressuposto da propriedade humana, só que no âmbito da relação social mais sutil, que está na esfera da linguagem, da simbologia e do discurso. Importante pontuar que linguagem, simbologia e discurso possuem papel expressivo na formatação das narrativas sociais, na constituição do imaginário e no apontamento das possibilidades aos indivíduos.

Diante de toda essa perspectiva chegamos à pergunta fundamental: o que é opressão? Vamos tentar conceituar: Opressão é a negação da condição de sujeito, em suas variadas formas. É a desumanização do ser humano, o fechamento das possibilidades, a desconsideração das características próprias à condição humana.

Mas o que seria, então, a condição de sujeito? Sujeito é o ser agente, capaz de interferir voluntariamente na realidade, e que possui uma identidade. Por sua vez, a identidade se constitui de modo complexo e diverso, pela justaposição de diversas coletividades que são mediadas e gerenciadas pelo próprio sujeito. Escrevi a esse respeito no ensaio sobre pós-individualismo.

A negação da condição de sujeito ocorre quando sua possibilidade de agir ou sua complexidade identitária são negadas sem a voluntariedade do sujeito em questão, gerando uma objetificação da pessoa.

Atenção para o detalhe: nem toda objetificação configura necessariamente uma opressão, dado que é perfeitamente possível objetificar-se voluntariamente (o que é muito comum em relações sexuais, por exemplo). Quando um agir com um Outro demanda um pressuposto da permissão alheia é porque há uma evidente consideração da condição de sujeito. Agora, se há uma indiferença quanto a essa permissão é porque a condição de sujeito está sendo negada com uma clara objetificação não-voluntária e, portanto, opressiva.

Este é um arcabouço frequente em nossa sociedade e está bastante associado ao que a tradição liberal acostumou-se a chamar de coletivismo – conceito que muitos “liberais” não compreendem. Coletivismo é o equívoco de reduzir a complexidade da condição de sujeito a uma única coletividade dentre as múltiplas que compõem sua identidade. Como já escrevi em outra oportunidade:

É a mentalidade nazista que homogeneiza e apaga o [sujeito] judeu; a racista que homogeneiza e apaga o [sujeito] negro; a homofóbica que homogeneiza e apaga o [sujeito] homossexual.

Em todos esses casos, o apego a uma única coletividade nega a condição de sujeito ao ser oprimido em questão. Mas há diversas outras formas, distintas, que também podem configurar uma opressão. Imagine o exemplo, bastante comum, de um pai que, diante de suas fortes expectativas quanto ao futuro profissional de sua prole, reduz as possibilidades de seu filho, jovem ou adolescente, obrigando-o a seguir uma trajetória qualquer de estudos. Trata-se de uma negação da condição de sujeito capaz de interferir voluntariamente na realidade e construir o seu próprio destino. É um ataque frontal à liberdade – e nada mais coerente que o movimento (e o discurso) liberal também comece a se ocupar dessas questões.

Antes que os apressados me atirem pedras, acusando-me de clamar por uma interferência na vida íntima das pessoas, reitero o ponto: a defesa da não opressão, numa perspectiva liberal, não reduz a preocupação com o consagrado princípio da não agressão e com o ceticismo quanto à eficiência e legitimidade do Estado no trato desses problemas.

A construção de um princípio liberal da não opressão, como toda a boa tradição do liberalismo, deve ter como norte o aumento da liberdade humana. Desse modo, creio que será através das redes de cooperação voluntária e do empoderamento social do oprimido que construiremos as bases mais legítimas e eficientes de combate à opressão. Nesse processo, é necessário um aprofundamento sobre os mecanismos da opressão e suas possibilidades de desmonte – missão na qual devemos reconhecer a importância de autores com outras perspectivas epistemológicas, compreendê-los e ressignificá-los.

Como dizia Simone de Beavouir, “quando se respeita alguém não queremos forçar a sua alma sem o seu consentimento”. E assim, conciliando as contradições dos anseios sociais, a liberdade de um indivíduo deverá sempre somar-se à do Outro.

Como nos acostumamos a dizer, uma ação que agride o PNA (princípio da não agressão) deve ser rejeitada pelos liberais e está passível de uma reação proporcional de legítima defesa. Na minha visão, qualquer ação que agrida o PNO (princípio da não opressão) deve ser igualmente rejeitada pelos liberais – e, seguindo o senso de proporcionalidade, transformar-se em alvo de severo boicote social.

- E aí, feriu o PNO?

manoferreiraMano Ferreira é jornalista, integrante do Café Colombo e co-fundador da rede Estudantes Pela Liberdade no Brasil. Tem interesse em filosofia política, comunicação, estética e comportamento. Admira a obra de Karl Popper, mas se percebeu amante da liberdade bem antes de conhecê-la, viajando além da conta num quadro de Magritte.

04 Sep 10:58

Compulsive Poetry In Epilepsy

by Neuroskeptic

The case of a woman who began compulsively writing poems after being treated for epilepsy offers a rare glimpse into the ‘inner’ dimension of a neurological disorder. Here’s the paper in Neurocase from British neurologists Woollacott and colleagues.

The story in a nutshell: the patient, age 76, had been suffering from memory lapses and episodic disturbances of consciousness. An electroencephalography (EEG) test “revealed left anterior temporal sharp and slow waves”, and the patient was diagnosed with Transient Epileptic Amnesia (TEA).

writing_emotions

She was prescribed the anti-epileptic drug lamotrigine (25 mg daily), which completely stopped the memory-loss and episodes of unconsciousness. However, this wasn’t the end of the matter:

Several months after starting lamotrigine, the patient suddenly began to write original verse. Whereas poetry had never previously been among her pastimes, she now produced copious short poems (around 10–15 each day).

These poems often had a wistful or pessimistic nature, but did not have a moral or religious focus. Her husband characterized them as “doggerel” because they were generally rhyming and often featured puns and other wordplay… she became irritated if attempts were made to disengage her. However, she appeared to derive pleasure from the activity and there was no evidence of distress.

Woollacott et al present two of the woman’s many poems. Here’s one:

To tidy out cupboards is morally wrong
I sing you this song, I tell you I’m right.
Each time that I’ve done it, thrown all out of sight,
I’ve regretted it.

Think of the treasures now lost to the world
Measureless gold, riches unfurled,
Diamonds, sapphires, rubies, emeralds – you must have had them,
All tucked well away. So

To tidy out cupboards, throw rubbish from sight
(Even the poems you write up at night)
Is morally wrong.
So I’m keeping this one.

For the other poem, check out the Mind Hacks post about this paper.

Woollacott et al note that hypergraphia or compulsive writing is a known symptom of epilepsy, especially temporal lobe epilepsy. However, hypergraphic writing often takes the form of incoherent ‘rambling’. This patient, by contrast, produced well-formed poems.

In fact, it seems to me that the poems themselves contain an explanation for why the patient wrote so many poems. In “To Tidy Out Cupboards”, there are two layers of meaning. The poem is about housework, but it is also about memory. The poet justifies her writing by analogy to (not) throwing out rubbish from a cupboard: you might accidentally throw out (forget) something valuable, and regret it. Likewise, she seems to be saying, if she doesn’t write down every single poem, she might regret it later.

Could it be that this (seemingly) obsessive fear of forgetfulness is rooted in the patient’s awareness of the memory impairments that were the first symptom of her disorder? Or is this reading too much into them? Either way, this patient’s poems offer a fascinating look at what a neuropsychological syndrome feels like.

ResearchBlogging.orgWoollacott IO, Fletcher PD, Massey LA, Pasupathy A, Rossor MN, Caine D, Rohrer JD, & Warren JD (2014). Compulsive versifying after treatment of transient epileptic amnesia. Neurocase, 1-6 PMID: 25157425

The post Compulsive Poetry In Epilepsy appeared first on Neuroskeptic.

04 Sep 09:57

Temporada de caça

by Folha

Como não podia deixar de ser, está aberta a temporada de críticas a Marina Silva. É saudável. Todo candidato com chances de ganhar a eleição deve passar por esse tipo de obstáculos.

Azar, na verdade, do comentarista que se aventura no debate. Algum tempo atrás, se falava mal do PT, via-se incluído imediatamente na lista do “PIG” (Partido da Imprensa Golpista). No caso de criticar Aécio, seria estigmatizado como “petralha”.

A ascensão da “terceira via” complica o jogo. O crítico que tentava escapar da dicotomia PT-PSDB precisa agora se afastar de Marina também.

Falar mal dos três ao mesmo tempo! Mas que jornalistas incontentáveis! Será que apoiam Levy Fidelix? Seja como for, o momento é de arregaçar as mangas contra Marina. A tentativa acaba produzindo críticas que me parecem forçadas.

Faço muitas ressalvas à candidatura do PSB, mas prefiro deixar isso para mais tarde. Começo com uma injustiça.

O físico Rogério Cezar de Cerqueira Leite, meu colega de Conselho Editorial, escreveu domingo passado que não se sentia confortável em ter como presidente da República “alguém que acredita concretamente que o universo foi criado em sete dias”.

O criacionismo de Marina Silva, diz Cerqueira Leite, “não decorre da ignorância, mas de um defeito de percepção”. “Os especialistas”, prossegue o cientista, “chamam essa condição de desordem do desenvolvimento neural”.

Fico assustado com um diagnóstico tão irrecorrível. Cerqueira Leite fala dos chamados “idiots-savants”. Pelo que sei, são aquelas pessoas com grande deficiência mental mas que, ao mesmo tempo, conseguem por exemplo decorar listas de nomes intermináveis, ou fazer contas dificílimas de cabeça.

Será que a capacidade política e verbal de Marina entraria nesse mesmo tipo de habilidades? E o que seria um “defeito de percepção”?

Se a candidata insistisse em dizer que, na mesa à sua frente, está sentado um tamanduá, quando todos podem ver que só existe um copo de água, eu chamaria isso de desordem neurológica.

Acreditar no relato bíblico do Gênese não me parece um fenômeno equivalente. Não tem nada a ver com uma percepção errada da realidade. Tem a ver com fé religiosa.

Sou o primeiro a considerar essa fé totalmente irracional. Não chego a ser cético, amistoso ou tolerante quanto a isso. Passo a eternidade no inferno, mas continuarei dizendo que a Bíblia está errada, que a ciência terá sempre a última palavra, e que acreditar em Adão, Eva, arca de Noé e tudo o mais não passa de total bobagem.

A questão é outra. O que significa “acreditar”? Milhões de pessoas acreditam em bobagens tremendas, mas levam sua vida de modo tão razoável e sensato quanto o mais austero cientista.

Acreditar, para essas pessoas, é quase uma reverência pessoal à tradição. Exceto em casos de fanatismo delirante, o religioso está pronto a aceitar que dois mais dois são quatro, e que se uma porta está aberta, não está fechada. Só não leva esses princípios ao reino misterioso da religião, onde Deus pode ser uno e trino, ou pode ter corpo de homem e cabeça de elefante ao mesmo tempo.

Aliás, o especialista em física quântica também aceita a realidade da porta e da parede à sua frente, ainda que no mundo subatômico as evidências pareçam contrariar o mais sólido senso comum.

O religioso, se não for maluco, sabe fazer a separação entre o mundo real e o plano de sua fé. Pode haver duplicidade mental nisso, mas não se trata de uma percepção deformada da realidade.

O problema não é cognitivo, mas prático. O religioso se complica quando age mais em função da fé do que do bom senso. Segue, por exemplo, a teoria da indissolubilidade do casamento, mesmo que isso seja fonte de infelicidade para toda a família. Sofrerá culpas inúteis porque sua religião não aceita a homossexualidade.

É esse plano prático, e não o funcionamento cerebral de Marina Silva, que cumpre avaliar. Do ponto de vista subjetivo, ela pode acreditar nas maiores tolices. Mas não é tola como candidata.

Aliás, é uma candidata nada inovadora nesse aspecto. Segue, em suas declarações, o que lhe der mais votos, e especialmente aquilo que não lhe tirar os votos que já tem.

Oscila e enrola tanto quanto os outros; um pouco mais, talvez. Incomoda-me, na verdade, mais sua esperteza do que sua tolice. Mas vejo que, para falar disso, preciso do espaço de outro artigo.

04 Sep 09:41

The wasteful fraud of sorting for youth meritocracy

"Sorry, you didn't make the team. We did the cuts today."

"We did play auditions all day yesterday, and so many people turned out, there just wasn't a role for you. We picked people who were more talented."

"You're on the bench until your skills improve. We want to win."

Ask the well-meaning coaches and teachers running the tryouts and choosing who gets to play, ask them who gets on stage and who gets fast tracked, and they'll explain that life is a meritocracy, and it's essential to teach kids that they're about to enter a world where people get picked based on performance.

Or, they might point out that their job is to win, to put on a great show, to entertain the parents with the best performance they can create.

This, all of this, is sort of dangerous, unhelpful and nonsensical.

As millions head back for another year of school, I'm hoping that parents (and students) can call this out.

When you're six years old and you try out for the hockey team, only two things are going to get you picked ahead of the others: either you're older (it's true, check this out) or you were born with size or speed or some other advantage that wasn't your choice.

And the junior high musical? It's pretty clear that kids are chosen based on appearance or natural singing talent, two things that weren't up to them.

Soccer and football exist in school not because there's a trophy shortage, not because the school benefits from winning. They exist, I think, to create a learning experience. But when we bench people because they're not naturally good, what's the lesson?

If you get ahead for years and years because you got dealt good cards, it's not particularly likely that you will learn that in the real world, achievement is based as much on attitude and effort as it is on natural advantages. In the real world, Nobel prizes and Broadway roles and the senior VP job go to people who have figured out how to care, how to show up, how to be open to new experiences. Our culture is built around connection and charisma and learning and the ability to not quit in precisely the right moments. 

But that's not easy to sort for in school, so we take a shortcut and resort to trivial measures instead.

What if we celebrated the students who regularly try the hardest, help each other the most and lead? What if we fast tracked those students, and made it clear to anyone else willing to adopt those attitudes that they could be celebrated too?

What if you got cast, tracked or made the cut because you were resilient, hard working and willing to set yourself up for a cycle of continuous improvement? Isn't that more important than rewarding the kid who never passes but still scores a lot of goals?

Before you feature a trumpet prodigy at the jazz band concert, perhaps you could feature the kid who just won't quit. No need to tell him he's a great trumpet player--the fact is, none of these kids are Maynard Ferguson--just tell him the truth. Tell him that every single person who has made a career of playing the trumpet (every single one of them) did it with effort and passion, not with lips that naturally vibrate.

We're not spending nearly enough time asking each other: What is School For?

Since I first published Stop Stealing Dreams to the web, it's been shared millions of times. My hope is that as we go back to school, you'll forward this video and this manifesto (screen edition) to every parent and teacher you know. (Here's a printable edition if you want to print it out and hand copies out).

Let's talk about school and figure out what we're trying to create.

Bookmarked at brandizzi Delicious' sharing tag and expanded by Delicious sharing tag expander.
04 Sep 09:40

Running Code Reviews with Confidence

Adam Victor Brandizzi

É assim que fazemos no trabalho (afora detalhes) e funciona muito bem!

Growing up, I learned there were two kinds of reviews I could seek out from my parents. One parent gave reviews in the form of a shower of praise. The other parent, the one with a degree from the Royal College of Art, would put me through a design crit. Today the reviews I seek are for my code, not my horse drawings, but it continues to be a process I both dread and crave.

Illustration:

Share This:

In this article, I’ll describe my battle-tested process for conducting code reviews, highlighting the questions you should ask during the review process as well as the necessary version control commands to download and review someone’s work. I’ll assume your team uses Git to store its code, but the process works much the same if you’re using any other source control system.

Completing a peer review is time-consuming. In the last project where I introduced mandatory peer reviews, the senior developer and I estimated that it doubled the time to complete each ticket. The reviews introduced more context-switching for the developers, and were a source of increased frustration when it came to keeping the branches up to date while waiting for a code review.

The benefits, however, were huge. Coders gained a greater understanding of the whole project through their reviews, reducing silos and making onboarding easier for new people. Senior developers had better opportunities to ask why decisions were being made in the codebase that could potentially affect future work. And by adopting an ongoing peer review process, we reduced the amount of time needed for human quality assurance testing at the end of each sprint.

Let’s walk through the process. Our first step is to figure out exactly what we’re looking for.

Determine the purpose of the proposed change

Our code review should always begin in a ticketing system, such as Jira or GitHub. It doesn’t matter if the proposed change is a new feature, a bug fix, a security fix, or a typo: every change should start with a description of why the change is necessary, and what the desired outcome will be once the change has been applied. This allows us to accurately assess when the proposed change is complete.

The ticketing system is where you’ll track the discussion about the changes that need to be made after reviewing the proposed work. From the ticketing system, you’ll determine which branch contains the proposed code. Let’s pretend the ticket we’re reviewing today is 61524—it was created to fix a broken link in our website. It could just as equally be a refactoring, or a new feature, but I’ve chosen a bug fix for the example. No matter what the nature of the proposed change is, having each ticket correspond to only one branch in the repository will make it easier to review, and close, tickets.

Set up your local environment and ensure that you can reproduce what is currently the live site—complete with the broken link that needs fixing. When you apply the new code locally, you want to catch any regressions or problems it might introduce. You can only do this if you know, for sure, the difference between what is old and what is new.

Review the proposed changes

At this point you’re ready to dive into the code. I’m going to assume you’re working with Git repositories, on a branch-per-issue setup, and that the proposed change is part of a remote team repository. Working directly from the command line is a good universal approach, and allows me to create copy-paste instructions for teams regardless of platform.

To begin, update your local list of branches.

git fetch

Then list all available branches.

git branch -a

A list of branches will be displayed to your terminal window. It may appear something like this:

* master
remotes/origin/master
remotes/origin/HEAD -> origin/master
remotes/origin/61524-broken-link

The * denotes the name of the branch you are currently viewing (or have “checked out”). Lines beginning with remotes/origin are references to branches we’ve downloaded. We are going to work with a new, local copy of branch 61524-broken-link.

When you clone your project, you’ll have a connection to the remote repository as a whole, but you won’t have a read-write relationship with each of the individual branches in the remote repository. You’ll make an explicit connection as you switch to the branch. This means if you need to run the command git push to upload your changes, Git will know which remote repository you want to publish your changes to.

git checkout --track origin/61524-broken-link

Ta-da! You now have your own copy of the branch for ticket 61524, which is connected (“tracked”) to the origin copy in the remote repository. You can now begin your review!

First, let’s take a look at the commit history for this branch with the command log.

git log master

Sample output:

Author: emmajane 
Date: Mon Jun 30 17:23:09 2014 -0400

Link to resources page was incorrectly spelled. Fixed.

Resolves #61524. 

This gives you the full log message of all the commits that are in the branch 61524-broken-link, but are not also in the master branch. Skim through the messages to get a sense of what’s happening.

Next, take a brief gander through the commit itself using the diff command. This command shows the difference between two snapshots in your repository. You want to compare the code on your checked-out branch to the branch you’ll be merging “to”—which conventionally is the master branch.

git diff master

How to read patch files

When you run the command to output the difference, the information will be presented as a patch file. Patch files are ugly to read. You’re looking for lines beginning with + or -. These are lines that have been added or removed, respectively. Scroll through the changes using the up and down arrows, and press q to quit when you’ve finished reviewing. If you need an even more concise comparison of what’s happened in the patch, consider modifying the diff command to list the changed files, and then look at the changed files one at a time:

git diff master --name-only
git diff master <filename>

Let’s take a look at the format of a patch file.

diff --git a/about.html b/about.html
index a3aa100..a660181 100644
	--- a/about.html
	+++ b/about.html
@@ -48,5 +48,5 @@
	(2004-05)

- A full list of <a href="emmajane.net/events">public 
+ A full list of <a href="http://emmajane.net/events">public 
presentations and workshops</a> Emma has given is available

I tend to skim past the metadata when reading patches and just focus on the lines that start with - or +. This means I start reading at the line immediate following @@. There are a few lines of context provided leading up to the changes. These lines are indented by one space each. The changed lines of code are then displayed with a preceding - (line removed), or + (line added).

Going beyond the command line

Using a Git repository browser, such as gitk, allows you to get a slightly better visual summary of the information we’ve looked at to date. The version of Git that Apple ships with does not include gitk—I used Homebrew to re-install Git and get this utility. Any repository browser will suffice, though, and there are many GUI clients available on the Git website.

gitk

When you run the command gitk, a graphical tool will launch from the command line. An example of the output is given in the following screenshot. Click on each of the commits to get more information about it. Many ticket systems will also allow you to look at the changes in a merge proposal side-by-side, so if you’re finding this cumbersome, click around in your ticketing system to find the comparison tools they might have—I know for sure GitHub offers this feature.

Screenshot of the gitk repository browser.

Now that you’ve had a good look at the code, jot down your answers to the following questions:

  1. Does the code comply with your project’s identified coding standards?
  2. Does the code limit itself to the scope identified in the ticket?
  3. Does the code follow industry best practices in the most efficient way possible?
  4. Has the code been implemented in the best possible way according to all of your internal specifications? It’s important to separate your preferences and stylistic differences from actual problems with the code.

Apply the proposed changes

Now is the time to start up your testing environment and view the proposed change in context. How does it look? Does your solution match what the coder thinks they’ve built? If it doesn’t look right, do you need to clear the cache, or perhaps rebuild the Sass output to update the CSS for the project?

Now is the time to also test the code against whatever test suite you use.

  1. Does the code introduce any regressions?
  2. Does the new code perform as well as the old code? Does it still fall within your project’s performance budget for download and page rendering times?
  3. Are the words all spelled correctly, and do they follow any brand-specific guidelines you have?

Depending on the context for this particular code change, there may be other obvious questions you need to address as part of your code review.

Do your best to create the most comprehensive list of everything you can find wrong (and right) with the code. It’s annoying to get dribbles of feedback from someone as part of the review process, so we’ll try to avoid “just one more thing” wherever we can.

Prepare your feedback

Let’s assume you’ve now got a big juicy list of feedback. Maybe you have no feedback, but I doubt it. If you’ve made it this far in the article, it’s because you love to comb through code as much as I do. Let your freak flag fly and let’s get your review structured in a usable manner for your teammates.

For all the notes you’ve assembled to date, sort them into the following categories:

  1. The code is broken. It doesn’t compile, introduces a regression, it doesn’t pass the testing suite, or in some way actually fails demonstrably. These are problems which absolutely must be fixed.
  2. The code does not follow best practices. You have some conventions, the web industry has some guidelines. These fixes are pretty important to make, but they may have some nuances which the developer might not be aware of.
  3. The code isn’t how you would have written it. You’re a developer with battle-tested opinions, and you know you’re right, you just haven’t had the chance to update the Wikipedia page yet to prove it.

Submit your evaluation

Based on this new categorization, you are ready to engage in passive-aggressive coding. If the problem is clearly a typo and falls into one of the first two categories, go ahead and fix it. Obvious typos don’t really need to go back to the original author, do they? Sure, your teammate will be a little embarrassed, but they’ll appreciate you having saved them a bit of time, and you’ll increase the efficiency of the team by reducing the number of round trips the code needs to take between the developer and the reviewer.

If the change you are itching to make falls into the third category: stop. Do not touch the code. Instead, go back to your colleague and get them to describe their approach. Asking “why” might lead to a really interesting conversation about the merits of the approach taken. It may also reveal limitations of the approach to the original developer. By starting the conversation, you open yourself to the possibility that just maybe your way of doing things isn’t the only viable solution.

If you needed to make any changes to the code, they should be absolutely tiny and minor. You should not be making substantive edits in a peer review process. Make the tiny edits, and then add the changes to your local repository as follows:

git add .
git commit -m "[#61524] Correcting <list problem> identified in peer review."

You can keep the message brief, as your changes should be minor. At this point you should push the reviewed code back up to the server for the original developer to double-check and review. Assuming you’ve set up the branch as a tracking branch, it should just be a matter of running the command as follows:

git push

Update the issue in your ticketing system as is appropriate for your review. Perhaps the code needs more work, or perhaps it was good as written and it is now time to close the issue queue.

Repeat the steps in this section until the proposed change is complete, and ready to be merged into the main branch.

Merge the approved change into the trunk

Up to this point you’ve been comparing a ticket branch to the master branch in the repository. This main branch is referred to as the “trunk” of your project. (It’s a tree thing, not an elephant thing.) The final step in the review process will be to merge the ticket branch into the trunk, and clean up the corresponding ticket branches.

Begin by updating your master branch to ensure you can publish your changes after the merge.

git checkout master
git pull origin master

Take a deep breath, and merge your ticket branch back into the main repository. As written, the following command will not create a new commit in your repository history. The commits will simply shuffle into line on the master branch, making git log −−graph appear as though a separate branch has never existed. If you would like to maintain the illusion of a past branch, simply add the parameter −−no-ff to the merge command, which will make it clear, via the graph history and a new commit message, that you have merged a branch at this point. Check with your team to see what’s preferred.

git merge 61524-broken-link

The merge will either fail, or it will succeed. If there are no merge errors, you are ready to share the revised master branch by uploading it to the central repository.

git push

If there are merge errors, the original coders are often better equipped to figure out how to fix them, so you may need to ask them to resolve the conflicts for you.

Once the new commits have been successfully integrated into the master branch, you can delete the old copies of the ticket branches both from your local repository and on the central repository. It’s just basic housekeeping at this point.

git branch -d 61524-broken-link
git push origin --delete 61524-broken-link

Conclusion

Also in Issue № 402

Git: The Safety Net for Your Projects

by Tobias Günther

This is the process that has worked for the teams I’ve been a part of. Without a peer review process, it can be difficult to address problems in a codebase without blame. With it, the code becomes much more collaborative; when a mistake gets in, it’s because we both missed it. And when a mistake is found before it’s committed, we both breathe a sigh of relief that it was found when it was.

Regardless of whether you’re using Git or another source control system, the peer review process can help your team. Peer-reviewed code might take more time to develop, but it contains fewer mistakes, and has a strong, more diverse team supporting it. And, yes, I’ve been known to learn the habits of my reviewers and choose the most appropriate review style for my work, just like I did as a kid.

Bookmarked at brandizzi Delicious' sharing tag and expanded by Delicious sharing tag expander.
04 Sep 09:18

Photos With Depth

by Dish Staff
by Dish Staff

tautochronos series

Leslie Tane features the delightful work of Michel Lamoller, who “takes multiple photographs of the same place at different times, then prints and layers them, physically carving them into one image, sculpting two-dimensional space into three-dimensions”:

By then photographing the transformed image Lamoller returns the work to two-dimensions, playing with space and volume, echoing the compression of time and place in his work. The deconstructed figures in the resulting photographs are a visual reminder that people are always changing and never fully revealed.

Margaret Rhodes connects the series to Lamoller’s previous projects:

Tautochronos evolved from an earlier series of Lamoller’s, called Layerscapes, that applies the same technique to landscapes and cityscapes. It’s not nearly as personal as Tautochronos, which is dotted with Lamoller’s personal acquaintances (and sometimes shot in their own homes or bedrooms), but both “come from a more personal wish to describe this happening of two things at the same time in one place,” he says. Like much of Lamoller’s work (he’s also created trompe l’oeil collages of banal objects like power outlets), they have a heavy Surrealist slant, and look like x-rays and camouflaged characters all at once.

03 Sep 16:27

You're A Rainbow!: Macro Shot Of A Hummingbird's Face

macro-hummingbird-face-small.jpg Note: Larger version HERE in case you ever wondered if a hummingbird's stare can steal your soul (it can). This is the macro shot of a Green-Crowned Brilliant Hummingbird's face taken by photographer Chris Morgan while on vacation at the Bosque De Paz biological reserve in Costa Rica. You know, Mother Nature -- sometimes you are alright. I mean it's RARE, but when you do, it almost seems to make up for all the other horrible, horrible shit you do. I'll tell you what -- let's call a truce this weekend. You promise I won't find any spiders in my bedroom, and I won't do anything bad for the environment. "Wait -- are you burning car tires?" Haha, I had my fingers crossed you filthy forest nymph! Thanks to Carlo, who informed me hummingbirds are his fourth favorite kind of bird behind owls, eagles and falcons. Good information to know.
03 Sep 16:27

The Most Intimidating Part of My Job

by DOGHOUSE DIARIES

The Most Intimidating Part of My Job

I spend a lot of time rehearsing what I'm going to say to a sysadmin.

03 Sep 14:27

who watches the watchmen?

by noreply@blogger.com (the realist)
this week's episode contains spoilers to Watchmen, a graphic novel by Alan Moore and Dave 
Gibbons. if you haven't read it, you may want to skip this one.
as always, sketches on the Patreon page right here.









03 Sep 12:13

Juggling 300 million variables

RSS

Religion_Explained_by_Pascal_Boyer_book_cover My post The Islamic State Is Right About Some Things was a “success” as far these things go. It was noted in a column in The New York Times, and highlighted issues which you can see being emphasized in pieces in Slate and The Spectator. But obviously in a single post there is a lot of nuance which I had to elide for reasons of space. Though I may be a population genomicist by day, I do think that in certain domains outside of my bread & butter I bring insights which you can’t find elsewhere, so I try to inject it into the broader discussion. But I’m limited in what I can do in a single post. One of the things I noticed as my post was circulating is that many people asserted that I was suggesting you can understand the actions of the Islamic State by the nature of its theology. Long time readers (I’ve been writing for 12 years on these sorts of issues) might be surprised by this, as was I, because actually I think that is one of the major problems that people have when attempting to understand the nature of religious phenomena. Theology is an abstruse field which is the purview of religious professionals of a particular sort. The vast majority of humans today are marginally literate at best, and for most of human history have been illiterate. To put it succinctly and semi-accurately I think our interpretations of theology are actually effects of prior beliefs, which are due to non-theological parameters. For example, I suspect most Christians would assert that their theology is such that slavery is anathema to their moral system with a proper understanding of God (i.e., theology). Obviously this was not so for the whole of Christian history up until 1800. One conclusion I derive from these sorts of facts is that theology derives its content from the subjective preferences of its practitioners. It is not like mathematics, an objective sequence of inferences and derivations from axioms. Nor is it like the natural sciences, extending itself step by step along a scaffold defined the world around us. Rather, it starts from a presupposition, that God, with particular semantically distinct characteristics, exists, and then proceeds to enter into complex and subtle interpretations of that fact.

0195149300 I have come to this state of affairs over time through reading. Though I was raised in a religious (Muslim) environment, it was not exceedingly devout or observant, and my personal beliefs were rather devoid of much interest or consideration of supernatural entities. For some people God is an intuitive and intoxicating concept, which draws them in a magnetic fashion. For me a lack of belief is, and was, the natural state. Atheism bubbled up naturally, unbidden, at the age of eight when I decided to look within. When I considered God’s existence seriously, I couldn’t but help reject it. This meant that my understanding of religion has always been as an outsider, and I tended to take religious people at their word when it came to what they believed and how they believed. Religious people of the sort I interacted with explained that their faith was revealed in a set of scriptures, and from those scriptures one could derive the nature of religion. Even religions, such as Roman Catholicism, where scripture is not emphasized generally accept that the foundational texts are necessary and essential in truly comprehending the faith in a deep way with mind (as opposed to just receiving sacraments through liturgy). This was congenial to my mind, as it rationalized religion, turning into a system of propositions from a set of axioms. My scientific bent meant that I naturally understood this sort of mentality.

Therefore, to understand something like Islamic violence, one only need to look at the foundational texts. But though this seems like a fruitful way to go I no longer believe it describes the structure of reality because on an individual level religious belief and practice does not seem rooted at all in texts. Though one can make broad correspondences and draw arrows of causality, with an understanding at a lower and more fine-grained scale this model has as much validity as Galenic medicine. It captures fragments of reality and presents it before us in a persuasive fashion, but at a deeper level of inspection it fails to explain the basic mechanics of religious belief. To understand how I came to this position one has to know that I have long been interested in evolutionary psychology, and therefore cognitive science. After 9/11 I decided to read books on religion besides the basic scriptures, and I stumbled upon the field of evolutionary cognitive anthropology, and in particular the scientific study of religion in the naturalistic paradigm. Two of the primary sources in this domain are Scott Atran’s In God’s We Trust and Pascal Boyer’s Religion Explained. In these dense works they illustrate the cognitive foundations of religious belief and practice, and exposed me to the reality that despite what many religious believers might tell you religious scripture is actually a sideshow to the richness of the phenomenon. Like the coffee table book that one proudly displays the value of scriptures is that is a visible marker and a common point of reference, as opposed to an instruction manual. In Theological Incorrectness the author explores the reality that religious people don’t even seem to believe what they say they believe on a deep level. For example, monotheists and polytheists seem to have the same internal model of the supernatural world, despite their explicit verbal scripts being very different. To put this in another context, many people who espouse views which deny the existence of the supernatural still get “spooked” in a dark cemetery. Why? They are sincere in their belief that there are no ghosts and demons in the dark, but in the deep recesses of their minds reflexive intuitions honed over evolutionary time remain at the ready, alert for any sign of danger in the darkness. Similarly, most religious people may believe sincerely in a glorious afterlife, but when there is a gun to their head they may soil themselves nonetheless.

Belief matters, but it seems likely that it matters at the margins. For whatever reason we humans tend to believe that we have explicit control over our beliefs and actions, and our decisions are due to conscious reflection. This is just often not so, and it has been scientifically validated to my satisfaction. On a personal level I think it is possible that in a different social milieu I would have “rediscovered” my faith in God at some point because of constant feedback from my peers. Though the United States is often depicted, correctly, as a particularly pious developed nation, it is not difficult to seal oneself in a secular bubble. Very few of my friends are religious, despite most Americans being religious. So my atheism is nicely insulated from countervailing pressures. My beliefs, my understanding of reality, is the outcome of a complex interaction between my dispositions and my social-cultural environment. So it is for us all.

But I don’t want to imply from this that if you understand the cognitive science of religion you understand religion. Rather, it is the basic general chemistry of the understanding of the religious phenomenon. In Darwin’s Cathedral David Sloan Wilson outlines a theory of religion which explains the patterns around us in functional terms; i.e., religions as forms of cultural adaptations. Though I’m sceptical of religious models predicated on rational choice theory, that also has its utility in particular contexts. Religion in a socially corporate context such as India is far different from that in the United States, where religion is understood in more individual terms (e.g., defection from a mainstream religion to another mainstream religion does not necessarily entail a massive rupture in your social ties to friends and family in the United States, so churn is common).

So where does this leave us in relation to the Islamic State? Does genocide history and scriptures of Islamic explain its atavistic savagery? I think not. Unlike most Muslim spokespersons I don’t think the behaviour of the Islamic State is “un-Islamic.” Religion is to my mind a made-up affair, and people can remake it in its own image however they want. And, as a point of fact the early Wahabbi movement in the 18th century exhibited many of the same ticks as the Islamic State, down to genocide treatment of those who avowed wrong belief. What I found particular interesting in a detached manner about the Islamic State is how well versed many of its proponents are in a particular streak of the history of Islam. Watching the Vice documentary of the Islamic State I can pick up terms and concepts from my rudimentary religious education, as well as references to “the Romans,” which in that case refers to the Byzantines under the Heraclian dynasty. Rather than theology I suspect history is a better guide as to what’s going on, and why, from the violent exclusive strain of Islam which periodically emerges from the Kharijites down to the Wahabbis, to early modern period and post-colonial conflicts, as well as the ethnography of political radicalism among small motivated groups such as the anarchists. Most proximately the Islamic State clearly draws energy and strength from Sunni resentment toward Alawite hegemony in Syria and Shia dominance in Iraq. Over time this may evolve into something else, as a generation grows up under the influence of the message of the Islamic State and its broader Weltanschauung. It is essential to keep in mind both the generalities (e.g., it is a Sunni movement) and particularities (e.g., it is global in its imagination and aspiration, at least notionally) when attempting to gauge the possible arcs of the future.

Addendum: And in the interest of frankness, I will also admit that though comments can be highly informative, I don’t listen closely when someone decides to lecture me on the nature of religion because it is rare than I encounter anyone with as much breadth of knowledge as me in this domain (i.e., I have read economic, sociobiological, cognitive, and historical models of religion). If I seem to dismiss your opinion, that’s probably because I don’t think much of your ideas because you likely know far less than I do.

Bookmarked at brandizzi Delicious' sharing tag and expanded by Delicious sharing tag expander.
03 Sep 11:00

Fé, voto e grana - Política - Estadão

Osmarinês é um erro de concordância que transcende a gramática. Consiste em dizer platitudes com convicção, vender generalidades com ar de novidade e evitar especificidades para não assumir compromissos. Não é porque o diabo mora nos detalhes que o divino há de ser genérico. Muito ao contrário.

Tome-se o texto "Para assegurar direitos e combater a discriminação" - expurgado menos de 24 horas depois de publicado no programa de governo de Marina Silva (PSB). Escrito em português, era cristalino nas suas propostas: legalização do casamento de homossexuais, execução de aborto pelo SUS nos casos previstos em lei, equiparação da homofobia ao racismo, material didático para educação anti-homofóbica.

Confrontada com as ideias que havia acabado de lançar por escrito, a candidata saiu-se com um genérico e insignificante "o Estado é laico". Marina fez que não entendeu, mas os pastores e, principalmente, os líderes da bancada evangélica entenderam muito bem - e deixaram isso óbvio pelo Twitter.

Líder do PMDB na Câmara e membro da evangélica Sara Nossa Terra, Eduardo Cunha disparou: "Marina, que levou em 2010 boa parte dos votos dos evangélicos, assumiu em seu programa de governo posições contrárias à família". E desafiou: "Quero ver qual liderança evangélica ou católica terá coragem de defender candidatura com esse programa".

Cunha bateu no ponto fraco: na simulação do Ibope de segundo turno entre Marina e Dilma Rousseff (PT), a candidata do PSB só ganha da petista porque tem duas vezes mais eleitores evangélicos do que a rival. Elas empatam entre os católicos.

"É uma vergonha o programa de governo do PSB de Marina no que tange à causa gay - prevê casamento, adoção de crianças", tuitou Silas Malafaia, da Assembleia de Deus. Na véspera, ele explicara por que endossa a candidatura do Pastor Everaldo (PSC): quer aumentar seu cacife agora para exigir compromissos por escrito de quem vier a apoiar no segundo turno.

Nem precisou esperar tanto para colher os frutos da ameaça. A "errata" do programa do PSB veio logo em seguida, com a devida tradução para o osmarinês do texto sobre direitos e combate à discriminação. Ficou ambíguo e genérico o suficiente para agradar Malafaia. "Melhoraram muito", comemorou.

A nova versão do programa de Marina nada mais é do que a prática do governo Dilma. Por pressão dos evangélicos, a presidente voltou atrás no decreto que permitia às mulheres pobres usar o SUS para abortos permitidos por lei. Também é bom lembrar que, em 2010, Malafaia apoiou o PSDB. Nada de original, portanto, na atitude de Marina. Ceder no conteúdo para ganhar votos é a essência da política de compromisso. A candidata chama isso de "nova política", e seus eleitores podem até acreditar. O marketing e a fé são livres. Só não se deve esperar milagres pela adoção de uma novilíngua.

Siga o dinheiro. As primeiras prestações de contas das campanhas deixaram claras as apostas dos financiadores. O PMDB ficou com quase 1 de cada 4 reais doados principalmente por empresas a candidatos, comitês e partidos, segundo estudo conjunto da Transparência Brasil e do 'Estadão Dados'. A causa é a consequência: não importa quem vença, o PMDB estará no poder.

As doações foram centralizadas no comando do partido, que fez a redistribuição para os candidatos. É uma conexão orgânica, institucional - do poder financeiro com o poder de fato. Isso é mais forte e impactante do que qualquer slogan eleitoral. Bancar o PMDB é uma maneira de assegurar que nada mude.

Caixa curto. O PT arrecadou um terço do que conseguiu o PMDB. Se não reverter logo a falta de dinheiro, o partido corre o risco de uma derrota eleitoral histórica.

Pós-errata. Da próxima vez que Marina disser a um jornalista mais impertinente que ele ou ela não leu seu programa de governo, arrisca-se a ouvir: "Nem a senhora".

Bookmarked at brandizzi Delicious' sharing tag and expanded by Delicious sharing tag expander.
02 Sep 12:46

Reformas para superar o ‘pibinho’

Alexa Salomão - O Estado de S. Paulo

O Brasil teve dois trimestres consecutivos de retração no Produto Interno Bruto (PIB), indicador que mede a geração de riqueza das nações. Na teoria acadêmica, tal situação indica que o País encolheu e sofre recessão técnica. Alguns analistas dizem que não é para tanto e que há estagnação. O governo alega que o problema é momentâneo por causa da Copa, da seca e da crise internacional. Semântica à parte, o fato é que o Brasil crescia pouco e agora anda para trás, com efeitos sobre o emprego e a renda. 

No grupo alinhado com o governo está o professor Fernando Nogueira da Costa, da Unicamp, que lecionou para a presidente Dilma Rousseff quando ela estava no doutorado. Para Costa, foram eventos momentâneos, como a Copa, que frearam o crescimento. 

Boa parte dos economistas que estudam os altos e baixos do PIB discordam. Um deles é Marcos Lisboa, ex-secretário de Política Econômica no governo de Luiz Inácio Lula da Silva e hoje vice-presidente do Insper. Para Lisboa, o potencial de crescimento do Brasil caiu. A queda aparece nos números que medem a produtividade. 

Há uma perda de produtividade que reduziu o potencial de crescimento do Brasil.

De maneira simplista, ter produtividade significa fazer mais e melhor com o mesmo. Exemplo: elevar a produção de 100 para 150 carros com o mesmo número de trabalhadores, de máquinas e de dinheiro. Essa mágica é possível graças a avanços paralelos: trabalhadores com uma educação mais sofisticada e o uso de equipamentos mais modernos. Segundo Lisboa, de 2003 a 2010, a produtividade cresceu, em média, 1,6% ao ano. De lá para cá, estagnou. “Há uma perda de produtividade que reduziu o potencial de crescimento do Brasil.” 

Na avaliação de Vinícius Carrasco, professor da PUC-Rio, esse declínio não foi acidental e a recuperação não virá de uma reação espontânea da economia. Carrasco tem essa convicção porque é um dos autores do estudo “A Década Perdida - 2003 a 2012”, que compara indicadores brasileiros com um conjunto de outros países. A conclusão: o avanço foi menor do que poderia. “Não foram criadas condições para se ter uma produção mais eficiente”, diz. 

É melhor ele ter um celular e pegar três serviços por dia do que empregar e atender dez clientes - é perda de produtividade na veia.

Reverter o “pibinho” não é fácil. O primeiro passo, segundo Monica de Bolle, diretora da consultoria Galanto, é reconhecer o erro. Só isso abre espaço para a mudança. Bernard Appy, ex-secretário executivo do Ministério da Fazenda, acredita que as mudanças dependem de microrreformas, como a tributária. O sistema de cobrança de impostos é distorcivo e incentiva que as empresas não cresçam. “Se um eletricista ganhar R$ 3 mil por mês e for microempreendedor individual, paga 1,3% da receita em tributos. Se for dono de empresa do Simples, 10,5%”, diz Appy. “É melhor ele ter um celular e pegar três serviços por dia do que empregar e atender dez clientes - é perda de produtividade na veia.”

Bookmarked at brandizzi Delicious' sharing tag and expanded by Delicious sharing tag expander.
02 Sep 12:45

The Replication Crisis: Response to Lieberman

by Neuroskeptic

In a long and interesting article over at Edge, social neuroscientist Matthew Lieberman discusses (amongst other things) the ‘replication crisis’ in his field. Much of what he says will be of interest to regular readers of this blog.

Lieberman notes that there has been a lot of controversy over ‘embodied cognition‘ and social priming research. For instance,

There are studies suggesting that washing your hands can affect your sense of being moral or immoral, and so on. These studies are very interesting. They’re very counter-intuitive, which I think leads lots of people to wonder whether or not they’re legitimate.

Lately there was a particular, well-publicized case of a non-replication of one of these counter-intuitive effects, and Lieberman discusses this, but I think the issue is a general one. Here’s what Lieberman says (emphasis mine) about the effort to try and replicate these findings:

I do have some issues with the process of selecting who’s going to do the replications — what their qualifications are for doing those things, have they done successful work in that area previously — because if they haven’t shown that they can successfully get other priming effects, or other embodied cognition effects, how do I know that they can do this? I wouldn’t go and try to do chemistry. I don’t know anything about doing chemistry. There are issues like that.

This argument – which Lieberman is by no means alone in making – might be called the Harry Potter Theory of social psychology. On this model, some effects are real but are difficult to get to work in an experiment (‘spells’). Some people (‘wizards’) have the knack of getting spells to work. Other researchers (‘muggles’) just can’t do it. So if a muggle fails to cast a spell, that’s not evidence against the spell working. What else would you expect? They’re a muggle!

Only if a wizard fails to replicate a spell, should we be worried about the reliability of that particular piece of magic. Accordingly, muggles should not even be trying to test whether any spells work. Wizards can safely ignore muggles.

potter_psychologyLieberman would probably object at this point that he’s not saying that some researchers should be banned from the replication process. Rather, he might say, he is only emphasizing the fact that some scientists are more qualified than others for particular tasks.

If so, fair enough, but all I’m saying is that there’s something odd about the idea that ones qualifications should include a track record in finding positive results in the field in question. That seems to be putting the cart before the horse. I agree that replicators should have the necessary technical skills, but I question whether generating positive (as opposed to negative) results can be used as a proxy for being skilled.

That would make sense if we assume that our basic psychological theory (e.g. of social priming) is valid, and therefore that at least some of our effects are real and replicable. If we grant that, then yes, we could assume that people who fail to find effects, must be doing it wrong. (If magic exists, then non-wizards are muggles.)

But can we assume that? Isn’t that, in fact, the issue under debate in many cases?

The post The Replication Crisis: Response to Lieberman appeared first on Neuroskeptic.

02 Sep 11:51

Letting Students Hit The Snooze Button

by Dish Staff
by Dish Staff

A new report indicates that science agrees with teenagers everywhere – school should start later:

Seeing the mounting evidence, the American Academy of Pediatrics [last week] released a new policy statement recommending that middle and high schools delay the start of class to 8:30 a.m. or later. Doing so will align school schedules to the biological sleep rhythms of adolescents, whose sleep-wake cycles begin to shift up to two hours later at the start of puberty, the policy statement says. The conclusions are backed by a technical report [pdf] the academy also released yesterday, “Insufficient Sleep in Adolescents and Young Adults: An Update on Causes and Consequences,” which is published in the September 2014 issue of Pediatrics.

The “research is clear that adolescents who get enough sleep have a reduced risk of being overweight or suffering depression, are less likely to be involved in automobile accidents, and have better grades, higher standardized test scores and an overall better quality of life,” said pediatrician Judith Owens, lead author of the policy statement, titled “School Start Times for Adolescents.”

The debate over whether to start school later has run for years, but a host of new studies have basically put it to rest. For one thing, biological research shows clearly that circadian rhythms shift during the teen years. Boys and girls naturally stay up later and sleep in later. The trend begins around age 13 or 14 and peaks between 17 and 19. The teens also need more sleep in general, so forcing them to be up early for school cuts into their sleep time as well as their sleep rhythm, making them less ready to learn during those first-period classes.

01 Sep 17:16

Selling Your Soul

by DOGHOUSE DIARIES
01 Sep 11:43

Notes on bookmarks from 1997

Notes on bookmarks from 1997

On August 30, 2014, I imported 264 bookmarks into Pinboard. The source was a file named "bookmark.htm" with a last modified date of October 12, 1997.

  • 264 bookmarks according to Pinboard's import status
  • 260 bookmarks according to Pinboard's count of tags

These bookmarks date between January 1995 and October 1997.

  • 2 were from January 1995
  • 14 were from September-December 1996
  • The rest were from 1997

Upon import, Pinboard reported 163 (63%) of the URLs as being unavailable, with 403 Forbidden, 404 Not Found, 410 Gone, or 500 Server Error. Less than 2/3 link rot over ~17 years doesn't sound so bad.

However, despite reporting 200 on the rest, many URLs weren't the original content. As one example, "serve.com" was a web host named DataRealm, and is now an American Express prepaid card. As another, a VRML tutorial is now a video about birth control. Some of these 200s are only so because of repeated 3xx redirections to ultimately unrelated content, or because of domain name hoarders serving ads.

  • 12 bookmarks were for FTP sites, all of which Pinboard reported as 500 Server Error. These were not tested with an FTP client.
  • 22 bookmarks were for local resources, all of which Pinboard reported as 404 Not Found.
  • 226 bookmarks were left for testing

Of the 226:

  • 1 was 410 Gone
  • 2 were 403 Forbidden
  • 49 were 500 Server Error
  • 76 were 404 Not Found

That's 57%, which sounds even better than the original figure. But then I looked at those ninety-eight 200 OK URLs, too.

  • 77 reported 200 OK, but were parked domains, advertising landing pages, or otherwise completely different content. This is link rot, too, just harder for an automated system to detect. I marked these as 210 OK But Gone.

That's 205 failures, an actual link rot figure of 91%, not 57%.

That leaves only 21 URLs as 200 OK and containing effectively the same content.

In an attempt to confirm and/or recover as much of the original content as possible, I checked the Internet Archive's Wayback Machine for every URL.

  • 1 of the two 403 Forbidden URLs had an old enough copy in the Wayback Machine.
  • 23, or 47%, of the forty-nine 500 Server Error URLs had copies.
  • 45, or 59%, of the seventy-six 404 Not Found URLs had copies.
  • 35, or 45%, of the seventy-seven 210 OK But Gone URLs had copies.

That's 104 failures beaten back by the Internet Archive at some level of fidelity, reducing effective link rot over ~17 years to 45%.

In addition, 9 of the twenty-one 200 OK URLs had old enough copies in the Wayback Machine, which I selected simply to provide a more accurate representation of the content.

There are a couple things you can do to help combat link rot for your own bookmarks moving forward.

First, donate to the Internet Archive: http://archive.org/donate/

Second, if you use a bookmark storage service like Pinboard or others, ask them to support adding submitted URLs to the Wayback Machine. Their bookmarklets or plugins could also submit to the Wayback Machine's "Save Page Now" endpoint. Or that could be done by the service on the back-end. For services that provide full page archives, they could capture a full WARC (network headers plus content), so every successfully cached page could be donated to the Internet Archive and integrated into the Wayback Machine. Or all of the above.

Every URL saved in more than one place increases the likelihood that their content will survive as domains change owners.

I've a lot more bookmarks to import, and doing this processing by hand is tedious.

Any 4xx or 5xx URL could be checked against the Wayback Machine, with the option to link to that instead.

It also seems like some heuristics could be developed to flag URLs as likely being 210 OK But Gone. Parked domains have common content on every URL. Advertising landers have a common format. The Wayback Machine could be checked, and content could be extracted from both and compared. URLs aren't supposed to change, and they're supposed to point to a persistent resource, but companies and domain squatters aren't playing nice. If we want our bookmarks to represent the content we saved as it was when we saved it, we have to be proactive about grooming them.

Vitorio

Bookmarked at brandizzi Delicious' sharing tag and expanded by Delicious sharing tag expander.
01 Sep 11:33

Turtles

by Doug

Turtles

A happy belated birthday to Caitlin! Hope you had a great bday yesterday! :)

Here is another heroic turtle.

31 Aug 10:02

The abject failure of weak typing

More discussion on Hacker News, and the Clojure, Haskell, Rust and Programming subs on Reddit.

Over the last few years of maintaining code old and new at REA, it has become abundantly clear that the neglect and misuse of type-systems has had a sharply negative impact on our codebases. Here we address the concrete causes and consequences, and propose concrete and achievable solutions.

Types at REA

REA’s codebases vary between statically typed languages such as Java and Scala on one hand, and “dynamic” languages such as Ruby, Javascript, and Perl on the other. I’ll mostly leave the dynamic ones alone — while the same arguments obviously apply, they are what they are. However, if we are paying for the conceptual overhead of a static type system, we need to be sure we are using it effectively; otherwise we are simply writing the same old Ruby play-dough but with long build-times and cumbersome syntax. Used properly, the tradeoff of static types is overwhelmingly beneficial.

What’s in a type?

A type is some logical proposition about a codebase, where an implementation is its proof. They are distinct from runtime tags, which are what people mostly mean when they talk about dynamic “types”. Terminology can vary, but I’ll stick to this usage. For example:

  • Haskell has a spectacularly rich static type system, with no runtime-accessible metadata, apart from pattern matching on tagged unions.
  • Dynamic languages such as Ruby are not really untyped, but rather unityped; statically, we know that everything inhabits a single message-receiving type. At runtime, of course, they employ tags to differentiate numbers from strings, arrays, maps, and user-defined structures.
  • Java has both a type system applied by its compiler, and a tag system at runtime that allows reflection, casting, RTTI, and various dynamic features. Neither is a compelling specimen.

Types as design

Even if the language we use doesn’t have a notion of types, you’d better believe they exist — how can we even write code without statically reasoning about it first? A maintainer must construct a model in their heads: what keys do we assume are in this map? Might this thing be null? What are the allowed values of this symbol? Can this string be empty? What messages will this object respond to?

Many dynamic-typing advocates have a curiously limited view of what a “type” is – in fact, almost any proposition we can statically make about the code can be represented as a type. Language choice notwithstanding, there is an enormous amount of information that fits into this category; by proving it up-front we can drastically reduce the number of incorrect programs that are even expressible. As the saying goes, don’t write software that isn’t broken; write software that can’t be broken.

Types are a powerful tool for clarifying thoughts, and designing correct software, arguably far more so than popular test-driven methodologies.

Types done wrong

Essentially anything that can be cleanly and obviously known about the code up-front belongs in a type. The most egregious failures here often stem from using the most common everyday concepts — strings, exceptions, primitives, maps, nulls, typecasts and so forth. Many readers of this post will, like its author, find something to feel guilty about here. Let’s take a tour:

Nulls

The harm represented by nulls is hopefully widely understood by now, but bears repeating.

Any value that we know could be null cannot be directly accessed by correct software; we must either surround usages in an if-guard, or employ some kind of harmless Null Object that can hopefully respond in a sensible way. It is a bald-faced lie told by the type-system in Java, C# and Scala, and to the developer’s mental model in Ruby. If a variable claims to be a Banana, surely you can feel justified in peel()-ing it? If it is null, then it is no banana at all, but a ticking time bomb waiting to explode, potentially at an unrelated line of code far away. Well-written code cannot tolerate even the possibility.

The proliferation of duplicated defensive code at numerous locations is a further burden, which bloats both code and tests, while reducing quality.

Solution:

  • Never permit nulls in code you control, and firmly regulate the contact points of systems and frameworks you don’t.
  • If a type has a sensible “empty” or default value that can fulfil the contract of your type, then initialise variables to this, or employ a Null Object.
  • Avoid mutable entities that need to be initialised piecemeal after creation. Write immutable objects that are immediately and fully initialised from constructor input.
  • If a particular variable might or might not be present, then this should be encoded in the type system using an option type, like Scala’s Option, Function Java’s Option, Java 8′s Optional, or Haskell’s Maybe. This correctly represents the uncertainty in the type system, so that any access is safe, simply by the fact that it compiled.

Exceptions

Exceptions are the primary error-handling mechanism employed by many widely-used languages. They are also a side-effect that makes a liar of the type system, and makes local reasoning about code far more difficult. They represent an undeclared method result smuggled through a back-channel separate from its declared return type. Furthermore, they transitively become an undeclared result of anything that calls that method, and anything that calls that, and so on. Trying to reason about the correct behaviour of code becomes very difficult, since the return type can no longer give you enough information. Exceptions kill modularity and inhibit composition.

Java awkwardly attempts to mitigate this with checked exceptions; they become a fully-fledged, type-checked part of a method signature. While this is better from a type-safety point of view, they still use an exotic second channel for returning results totally incompatible with the first, require an insufferable amount of handling code, and have far poorer tools for abstraction and reuse. Checked exceptions are widely despised by Java programmers, and frequently ignored by library authors.

Solution:

  • Don’t throw exceptions in code you control, except in the most irretrievably broken circumstances.
  • When dealing with code you don’t control, catch their exceptions as soon as possible and lift the various results into your return type.  In Scala, the easiest way to do this is the Try type, which directly lifts the result into an ADT of Success(yourValue) or Failure(thrownException).
  • Exclusively encode possible function results in the return type. Don’t throw that AuthenticationException for a totally plausible and normal outcome! Here’s some alternatives:
    • When there is a main result alongside a possible failure result, use an existing Either or Validation type.
    • Define your own Algebraic Data Type (ADT) that describes the possible alternatives. For instance, in Scala or Java, this can take the form of a closed mini-class hierarchy.

Primitives

Primitive values such as integers and strings are often the first tools we reach for, but are woefully unsuited to most use-cases they are press-ganged into. This is because they have an astronomical number of possible values, and most use-cases do not.

Integers

Consider this function:

def blah(b: Boolean): Boolean

A function A -> B has BA possible implementations, by the number of inhabitants in A and B. So this function has 22 = 4 possible implementations. Perhaps we could write a test case for each one.

Now consider this function:

def compare(a: Int, b: Int): Int

This one has not only 232 possible results, but an incalculable (232)264 possible implementations. Even if we are generous and only allow the inputs to be 0 or 1, we still have 2128 implementations. If the only meaningful return values are -1, 0 and 1, indicating “less than”, “equal” or “greater than”, then why would we embed them like specks of dust in a big desert of undefined behaviour?

If we encode the return value as an ADT representing the 3 possible results, as Haskell does, then we have a positively civilised 34 = 81 possible mappings from input to output. Even in such a simple case, a more precise return type pruned 340 undecillion incorrect programs from the sphere of existence.

Remember, that was an utterly trivial example. So what happens when you have complex/composite/nested data structures, exceptions and even side-effects? How many of the possibilities are even remotely meaningful in your domain? Without precise types, how many were you hoping to reach with your TDD and “100% code coverage”?

Strings

String are perhaps the most commonly used data type, due to their immense versatility; however, they are rarely appropriate. Strings consist of a sequence of characters. This is the perfect representation for unstructured free text, and nothing else. Any restriction, structure or constraint in the format of the string means you don’t have a string at all; you have a URL, a Date, a Name, an Email, a Document, an ID, a Warning, or whatever else that might tempt you to deploy this amazing swiss-army-type.

Not only does “stringly typed” code result in a catastrophic expansion in the number of expressible incorrect programs, it inevitably results in duplication, as the validation, destructuring and restructuring code is repeated in every spot where the string format is supposed to be in use.

Solution:

  • If there are a finite number of possibilities, use an ADT to represent them. This internally prevents a vast number of incorrect implementations, and externally prevents a vast number of incorrect usages.
  • Use a wrapper type to encapsulate the desired structure; make it impossible to create invalid instances. This will also cull incalculable absurdities inside and outside of the function. This costs one line of code in Scala.
  • Wrapper types can sometimes normalise errant input in their constructors, seamlessly eliminating redundant or invalid states.
  • As a last resort, throw exceptions inside constructors to prevent any remaining possibility of an invalid instance.

Records vs Domain modelling

A couple of years ago, we were keen to avoid over-specific domain modelling, and took care to build our services as dealing in the domain of “records” or “attribute-maps”, rather than specifically tie our logic to Listings, Agents, Dogs, Cats, Aeroplanes or what-have-you. This was to prevent the loss of generality, and to keep the application focused on web and infrastructural concerns. So following the famous Alan Perlis line “It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures”, we decided on a unityped representation of domain data.

In an absolute sense, I can’t say whether this is a good idea or not. It’s potentially a totally valid point of view — perhaps the detail and structure of the record data is of no relevance to the code that provisions, streams, encodes, stores, secures and displays it — as long as it stays that way. In practice, however, it has left our codebase with serious flaws.

Firstly, the approach of using unityped records is totally predicated on the application not needing to know anything about their structure, beyond the obvious tree-shape. When the application suddenly needs to, say, differentiate “floorplan” from “main” images, or know if a “logo” was included, then the concept is doomed. This knowledge, completely understood at compile time, must be expressed in clumsy string-based map retrieval, faith-based typecasting and a total absence of any way to reason about the correctness, or even the intended behaviour of the code.

Either business logic has to be strictly forbidden from this unityped pipeline, or we need the types of of the data to truly reflect the knowledge we have, and need, at compile time.

Secondly, even if the unityped record approach was correctly chosen, using, as we did, Map<String, Object> was a clear blunder. The verbosity and repetition are appalling; every single access, construction, iteration, de-reference has to be laboriously performed by hand at myriad locations around the codebase. Even if all we need to know is “it’s a map with certain behaviours and constraints”, then we should have encoded that in the types, and created some sort of Record class. In this case, it was also compounded by the use of Java (pre-8), which has extremely poor facilities for abstracting over collections and maps.

Solution:

  • The static knowledge we have, or require about our domain objects should be captured in types.  If there is a clear case that we don’t need to differentiate between this-or-that domain object, then that should be captured in the types.
  • Quickly translate interchange formats into data structures that reflect the knowledge we require, and can only hold meaningful and valid states. There are mapping tools in Java and Scala that can safely map between JSON and typed objects.

Names are overrated

Let’s look at a function:

def findAddress(userId: String): String

What does it do? Are you sure?

Now lets look at another:

def blah(foo: UserId): Address

Which one tells you more about its purpose — the one with the businessy names, or the one with the types?

Naming has role to play, but consider what it really does. It is a mnemonic, a reference that helps you uniquely recall a concept. While this is fine as far as it goes, names are totally useless for reasoning about software. For documentation, they are as poor as comments, or Word docs. Implementing a precise type signature proves that the software does what it says on the tin. If the types in question have been carefully designed to prevent invalid states, then often there will be only be a handful of possible implementations, or even one — not a number you’ve never heard before, ending in -illion.

Solution:

  • Treat your types as the only real documentation.
  • Constrain argument and return types to a named alternative, that limits possible states. This is all maintainers should need to know about your functions.
  • Wrapper types start from one line of code in Scala.

The way forward

While I’ve listed a variety of different problems, you’ll notice a lot of repetition in the proposed solutions. In fact, we can solve these problems very simply, using only a few techniques — especially if we continue our adoption of Scala in place of Java and weakly-typed languages.

Algebraic Data Types (ADTs)

ADTs are a powerful tool for us here, because they allow us to encode limited possibilities in the type system, so that invalid combinations are inexpressible in a well-typed program.

They are called “algebraic” because they are sums and products of other types. (Sums are like OR, and products are like AND).

For instance, a List in Scala is defined as an ADT — it is a Cons of a value AND another List, OR an empty List. In Haskell, this could be written simply as:

data List a = Cons a (List a) | Empty

In Scala, at the cost of some more characters, we could encode this as a mini-class hierarchy:

sealed trait List[+A]
case class Cons[A](a: A, rest: List[A]) extends List[A]
case object Empty extends List[Nothing]

This is almost a straightforward Java-style class hierarchy, but notice the sealed keyword: unlike normal OO classes, List cannot be extended, except by the classes below it. Without this feature, the number of possible outcomes would still be totally unbounded. In Java, we can still benefit from using this style, but the code required to manually write accessors, constructors, threading through arguments, correct hashcode/equals implementations and unit tests is significant, and error prone.

OO lore has it that pattern matching is evil, and that subtype-polymorphism is the answer to all questions. This is false; there are complementary pros and cons to subtype polymorphism and pattern matching. Since there are only a few fixed cases, it is perfectly idiomatic and sensible to pattern match on ADTs; the Scala compiler will even complain if we haven’t matched every possible eventuality.

myList match {
  case Cons(a, rest) => println(s"the head is $a, the rest is $rest")
  case Empty => println("Nothing to see here")
}

ADTs are a handy weapon in our war against buggy code!

Wrapper types

Wrapper types are one of the best ways to avoid the buggy swamplands of code written with bare strings and primitives. In Scala, this starts at almost no effort:

case class Angle(radians: Double) extends AnyVal

“Case classes” in Scala are (mostly) like any other class, except that the compiler will generate useful functionality. Scala will automatically bind the constructor parameter to an immutable field exposed through accessor methods, generate correct equals and hashCode, a default toString, and a pattern matching extractor. Hugely useful.

Value Classes: eliminating runtime overhead

Explicitly saying extends AnyVal makes our class a Value Class. This class won’t even exist at runtime — it provides type safety in the compiler, then vanishes!

Normalising and validating input

We can get all the benefits of classes here – we can define our own operations, and normalise or validate the constructor input. Here are some examples of this technique applied to Angles and Percentages.  Note they are correct-by-construction; any instance of this type is guaranteed to represent a valid and normalised value.

We should make far wider use of wrapper classes:

case class Email(email: String)
case class Password(password: String)
case class SecurityToken(token: String)
case class ConsumerId(id: String)
case class AgentId(id: String)
case class Price(cents: BigInt)

Types are low hanging fruit

While there are no silver bullets, there’s an awful lot of low-hanging fruit just lying around. Let’s pluck it! We can make major improvements in our software quality, even with minor adjustments to our coding style. Code can be easier to reason about, with vastly less ways to fail, at a very low cost.

Types, kindly bestowed upon us by some languages, are a magnificent tool to improve quality. They prove desirable properties of our code; we should make it our business to put as much code in their reach as we can! There will always be a point where types have no more to say, and must pass the quality baton to tests. Consider though, how much less work tests must do, and how much less code they must expend, when entire universes of nonsense have been prohibited from existence.

In particular, by eschewing exceptions, using Algebraic Data Types to model the precise shape of our data, and wrapper types to constrain crude Strings and primitives, we can make immediate gains before we even get to more advanced abstractions like typeclasses and higher-kinded types.

In Java, much of this has been known for a long time, but the language’s lack of support for value-based classes, ADTs and pattern-matching has meant that good practices are often discarded as prohibitively cumbersome or expensive. Regrettably, despite the welcome addition of lambdas, Java 8 provides little respite.

In languages like Haskell and Scala, these methods are so cheap as to be no-brainers; in new projects you have no excuse for passing up these delights!

Either way, I hope that I’ve convinced you of the good news — there are plentiful green fields of easy code-improvement ahead, before we even get close to tough tradeoffs.

Bookmarked at brandizzi Delicious' sharing tag and expanded by Delicious sharing tag expander.
30 Aug 19:33

Socialismo ou O que posso esperar?

by Manoel Galdino
Adam Victor Brandizzi

Eu assinaria embaixo de uma versão liberal disso.

Eu participei, no começo da semana, de uma série de inquisições no twitter sobre porque ainda falar em socialismo. A premissa dos meus inquisidores era algo como: “Socialismo a essa hora, zero dois?”.

E ontem, em conversa com amigos, retomávamos a questão do que podemos esperar em termos de transformação do capitalismo.

Eu pensei em fazer uma espécie de FAQ para explicar o que penso sobre esses assuntos. Mas lembrei de um texto do Cosma Shalizi e que, creio, pode explicar como vejo essas questões, se colocado no contexto apropriado. Vamos então ao contexto.

O Francis Spufford publicou um dos melhores livros de ficção que li nos últimos anos, chamado Red Plenty. Eu já falei sobre o livo aqui no blog, E o The Crooked Timber fez um seminário sobre o livro lá no blog deles. O Cosma Shalizi participou do seminário com um texto. E a certa altura, o Cosma diz:

There is a passage in Red Plenty which is central to describing both the nightmare from which we are trying to awake, and vision we are trying to awake into. Henry has quoted it already, but it bears repeating.

Marx had drawn a nightmare picture of what happened to human life under capitalism, when everything was produced only in order to be exchanged; when true qualities and uses dropped away, and the human power of making and doing itself became only an object to be traded. Then the makers and the things made turned alike into commodities, and the motion of society turned into a kind of zombie dance, a grim cavorting whirl in which objects and people blurred together till the objects were half alive and the people were half dead. Stock-market prices acted back upon the world as if they were independent powers, requiring factories to be opened or closed, real human beings to work or rest, hurry or dawdle; and they, having given the transfusion that made the stock prices come alive, felt their flesh go cold and impersonal on them, mere mechanisms for chunking out the man-hours. Living money and dying humans, metal as tender as skin and skin as hard as metal, taking hands, and dancing round, and round, and round, with no way ever of stopping; the quickened and the deadened, whirling on. … And what would be the alternative? The consciously arranged alternative? A dance of another nature, Emil presumed. A dance to the music of use, where every step fulfilled some real need, did some tangible good, and no matter how fast the dancers spun, they moved easily, because they moved to a human measure, intelligible to all, chosen by all.

There is a fundamental level at which Marx’s nightmare vision is right: capitalism, the market system, whatever you want to call it, is a product of humanity, but each and every one of us confronts it as an autonomous and deeply alien force. Its ends, to the limited and debatable extent that it can even be understood as having them, are simply inhuman. The ideology of the market tell us that we face not something inhuman but superhuman, tells us to embrace our inner zombie cyborg and loose ourselves in the dance. One doesn’t know whether to laugh or cry or running screaming.

But, and this is I think something Marx did not sufficiently appreciate, human beings confront all the structures which emerge from our massed interactions in this way. A bureaucracy, or even a thoroughly democratic polity of which one is a citizen, can feel, can be, just as much of a cold monster as the market. We have no choice but to live among these alien powers which we create, and to try to direct them to human ends. It is beyond us, it is even beyond all of us, to find “a human measure, intelligible to all, chosen by all”, which says how everyone should go. What we can do is try to find the specific ways in which these powers we have conjured up are hurting us, and use them to check each other, or deflect them into better paths. Sometimes this will mean more use of market mechanisms, sometimes it will mean removing some goods and services from market allocation, either through public provision or through other institutional arrangements. Sometimes it will mean expanding the scope of democratic decision-making (for instance, into the insides of firms), and sometimes it will mean narrowing its scope (for instance, not allowing the demos to censor speech it finds objectionable). Sometimes it will mean leaving some tasks to experts, deferring to the internal norms of their professions, and sometimes it will mean recognizing claims of expertise to be mere assertions of authority, to be resisted or countered.

These are all going to be complex problems, full of messy compromises. Attaining even second best solutions is going to demand “bold, persistent experimentation”, coupled with a frank recognition that many experiments will just fail, and that even long-settled compromises can, with the passage of time, become confining obstacles. We will not be able to turn everything over to the wise academicians, or even to their computers, but we may, if we are lucky and smart, be able, bit by bit, make a world fit for human beings to live in.

O Cosma está, em primeiro lugar, retomando a crítica de Marx segundo a qual a lógica do sistema capitalista é subsumir tudo à valorização do lucro. Que muitos tenham entendido essa lógica como algo determinista diz mais sobre quem leu Marx do que sobre o próprio Marx. Afinal, a lógica aí não passa de uma tendência, de uma das principais forças do sistema, mas obviamente não é a única. Mas divago. O ponto é que a tendência é real. Os melhores apologistas do sistema, como Hayek, reconheceram que o sistema é alienante. O que ele e outros argumentam é que não é possível fugir da alienação e o capitalismo é o melhor que podemos esperar.

O que as pessoas de esquerda, especialmente da tradição socialista, defendem é que não precisamos aceitar o argumento conservador do Hayek. Mas, e aqui concordo com o Cosma, é preciso reconhecer que

human beings confront all the structures which emerge from our massed interactions in this way. A bureaucracy, or even a thoroughly democratic polity of which one is a citizen, can feel, can be, just as much of a cold monster as the market. We have no choice but to live among these alien powers which we create, and to try to direct them to human ends. It is beyond us, it is even beyond all of us, to find “a human measure, intelligible to all, chosen by all”, which says how everyone should go. What we can do is try to find the specific ways in which these powers we have conjured up are hurting us, and use them to check each other, or deflect them into better paths

Em outras palavras, buscar o socialismo, hoje, não pode e não deve significar construir (ou achar?) uma sociedade gloriosa em que viveremos num mundo transparente e não-alienado. Mas significa tentar, com cuidado, experimentações para reduzir a alienação e também conduzir as estruturas emergentes como algo que satisfaçam fins humanos. Significa jamais aceitar o capitalismo como uma fatalidade.

É preciso portanto ao mesmo tempo ter mais humildade e ousadia nas tentativas de luta contra o capitalismo. Humildade para aceitar que o mercado e mesmo a lógica do lucro são a forma menos pior de funcionamento em certos arranjos sociais. A ousadia para rejeitar em outros arranjos esse mesmo mercado e a lógica do lucro.

Para finalizar. Quando eu digo que o socialismo é sobre liberdade, o sentido preciso é justamente aquele de libertar nós humanos, o máximo possível, dos arranjos sociais que nos aprisionam. Que a nossa liberdade será sempre limitada é a conclusão lógica de quem aceita o diagnóstico acima sobre as estruturas emergentes.


Arquivado em:internet, Manoel Galdino, Política e Economia Tagged: capitalismo, Cosma Shalizi, esquerda, internet, Marx, Red Plenty, socialismo, Twitter
30 Aug 19:15

Conversations That Servers in Portugal Might Have Had After Dealing With Me and My Mother

by Leila Sales

13972092214685_big-night
OUR WAITRESS: Thanks for meeting me for a drink, babe. Wow, do I need it after the crazy time I had at the restaurant tonight.

OUR WAITRESS’S BOYFRIEND: What happened?

WAITRESS: These two American women came in to be seated. Mother and daughter, they looked like. I tried to seat them in the nice part of the restaurant, but a guy was smoking a cigarette at the table next to them, so they flat-out refused.

BOYFRIEND: That’s dumb. It’s not like they were going to get lung cancer over the course of dinner.

WAITRESS: I know! But I didn’t want to say anything because I was hoping they’d tip me if I was polite. You know how Americans love to tip. Anyway, I finally get them seated, and then the daughter has a million questions about every item on the menu. Like, what kind of vegetables are in the vegetable soup? Is the chicken dark meat or light meat? Is the rice brown or white?

BOYFRIEND: Why does she need to know any of that?

WAITRESS: I have no earthly idea. After I answer all her questions, she proceeds to order the one menu item that she didn’t ask anything about. Her mom orders the California rolls, only—get this—without the shrimp.

BOYFRIEND: That is crazy! The shrimp is the best part.

WAITRESS: Totally. So I bring over the daughter’s order, which she immediately tries to send back, claiming it’s not what she ordered.

BOYFRIEND: Was it what she ordered?

WAITRESS: Of course. And I bring the mother’s shrimp-free California rolls. When I come back, she has systematically picked out all the raw salmon from them.

BOYFRIEND: No shrimp or raw salmon? What the heck was left in the California rolls?

WAITRESS: Rice. And mango. I would almost think they don’t have California rolls in America, but of course that is silly, because California is in America.

BOYFRIEND: Was that the end of it, at least?

WAITRESS: Yes. Oh, except for one other thing: they kept pouring out their water glasses into these plastic bottles that they were carrying in their bags.

BOYFRIEND: Wait. What?

WAITRESS: Like, multiple times. When they thought I wasn’t looking, they actually grabbed the big water bottle from my station and emptied it into their bottles. I was totally looking, though.

BOYFRIEND: You can’t be serious.

WAITRESS: Oh, and then they tipped me three euros.

HUSBAND: That wouldn’t even cover the cost of the stolen water!

WAITRESS: I know. Ugh. Let’s do another round of shots.

***

OUR WAITER: What do you know about Americans?

OUR WAITER’S WIFE: They often seem to wear gym shoes, even when they are not going to the gym. Why?

WAITER: I had a baffling experience with those two American women who just left the restaurant. They ordered the bacalhau.

WIFE: Ah, yes. Bacahlau, the traditional Portuguese salted codfish that our people have been cooking for generations, since the days of Vasco de Gama. The fish which I myself have been making for our customers for nearly my entire life, using the recipe passed down to me by my mother, God rest her soul.

WAITER: Yes, that bacahlau. The Americans ordered it all confident-like, like some seafood experts. But after I brought it over to her, they tried to send it back!

WIFE: My codfish?

WAITER: They said they couldn’t swallow it! The younger woman pointed to all these masticated white chunks that she’d hidden under the rim of her plate, like as “proof” that the fish was unchewable.

WIFE: My codfish?!

WAITER: Don’t worry, honey. I ate a bite of it myself, in front of her, to prove that it was edible.

WIFE: You are truly a supportive husband.

WAITER: And then I brought out all the frozen cod from our fridge so she could understand our process.

WIFE: I bet that showed her.

WAITER: It should have. But even then she didn’t eat another bite of the bacalhau, no matter how long I stood over her, chanting, “Eat, eat.”

WIFE: Do you think she will write a bad TripAdvisor review of our restaurant? I live in fear of that.

WAITER: I don’t think so. She seemed to really like our bottled water, so I’m sure that made up for her lack of chewing skills.

***

OUR WAITRESS: Seeing that homeless man outside the train station just now reminds me of these two American ladies who ordered the chocolate bread at the café today.

OUR WAITRESS’S GIRLFRIEND: The chocolate bread is AMAZING!

WAITRESS: I know, but somehow they couldn’t finish it, even though there were two of them. They only had a little bit left, but they spent ten minutes trying to figure out how to take it away with them. The younger one went through like fifteen paper napkins, trying to wrap it up. The older one tried shoving it inside an umbrella bag.

GIRLFRIEND: Whoa.

WAITRESS: Eventually I offered them a paper bag. They were super-grateful. It was weird, because the whole piece of chocolate bread only costs seventy-five cents. It’s like they didn’t know where their next meal was coming from.

GIRLFRIEND: That is so sad.

***

OUR WAITER: What do you think of those roasted red peppers I make?

OUR WAITER’S BOYFRIEND: I don’t know, they’re pretty good. Nothing like your bacalhau, of course, but yeah. Why?

WAITER: At the restaurant these two American chicks were almost crying over how good my roasted red peppers were. It was as if they had won the lottery. “These are the first vegetables we have had in a week,” they said to me. (In English, of course.) “We had nearly forgotten what vegetables taste like. You have saved us.”

BOYFRIEND: Oh, come on. They did not say all that. You are such an exaggerator.

WAITER: They did!

BOYFRIEND: Bullshit.

***

OUR WAITRESS’S HUSBAND: Hey, hon, how was work today?

WAITRESS: Seriously fucked-up. The women staying in Room 242 kept going back to the breakfast buffet.

HUSBAND: So? It’s an all-you-can-eat buffet; everyone goes back multiple times.

WAITRESS: But they weren’t going back for more of those mini-sausages, like everyone else does. They kept going up and refilling their glasses with water. Then they’d return to their table, empty their glasses into bottles from their purses, and then they’d go back up to refill their glasses again.

HUSBAND: What?

WAITRESS: They did this four times in a row.

HUSBAND: I suddenly don’t understand how their nation holds such a strong geopolitical position. They’re on the U.N. Security Council and everything.

WAITRESS: It’s all so hard to wrap my head around. I feel like I have watched a great deal of American TV in my life, but somehow two hundred episodes of Friends did nothing to prepare me for the encounter I had today.

HUSBAND: I hope they made it back to their home country without dying of dehydration.

WAITRESS: I guess we will never know.

Read more Conversations That Servers in Portugal Might Have Had After Dealing With Me and My Mother at The Toast.

30 Aug 19:08

August 29, 2014


POW
30 Aug 19:05

Comic for August 30, 2014

30 Aug 18:09

Here Today, Gone Forever?

by Sue Halpern
by Sue Halpern

dish_bitcoins2

Buried – sorry – in Biz Carson’s fascinating obituary of Hal Finney, who died this week from ALS, is a small aside with large implications. Finney, who was 58, was the first owner of bitcoins besides developer Satoshi Nakamoto (not his real name). This was in 2008, in a somewhat serendipitous turn of events, which Finney chronicled last year, typing via an eye tracker.

When Satoshi announced the first release of the software, I grabbed it right away. I think I was the first person besides Satoshi to run bitcoin. I mined block 70-something, and I was the recipient of the first bitcoin transaction, when Satoshi sent ten coins to me as a test. I carried on an email conversation with Satoshi over the next few days, mostly me reporting bugs and him fixing them. After a few days, bitcoin was running pretty stably, so I left it running… I mined several blocks over the next days. But I turned it off because it made my computer run hot, and the fan noise bothered me.

So the question is, now that he has died, what happens to Finney’s virtual currency?

It’s the same question any one of us can ask, looking ahead, about our virtual “possessions,” whether they are documents stored on Dropbox, or passwords to our email accounts, or game characters.

Finney, who has been cryogenically preserved, was clearly a forward-looking guy. Before he died, he secured his bitcoins in a safe deposit box. But will it be enough to ensure that his son and daughter inherit them? And what about our stuff, stored “up there,” somewhere, “in the cloud,” where there is no safe deposit box?

Last month, in an unprecedented move, Delaware became the first state to enact a digital inheritance law. The Digital Assets and Digital Accounts Act is meant to give authorized individuals brief, “peek and copy” access to third-party accounts. Apparently, the tech companies are not pleased and have formed the “State Privacy and Security Coalition” to fight it. They will be even less pleased when some version of the law is adopted in other states, as it is expected to be:

Jim Halpert of DLA Piper, a law firm that represents the coalition, told the Wall Street Journal that the group opposes the laws because accounts may contain information the deceased do not want to disclose, and because they may “conflict with a 1986 federal law forbidding consumer electronic-communications companies from disclosing digital content without its owner’s consent.”

But Jeff John Roberts thinks this is weak:

Neither of these explanations are particularly convincing, however. Despite the companies’ profession of privacy concerns for their late users, the reality is that people have been dying — and leaving behind artifacts for relatives and others to find — for a very long time. The digital dimensions of our personal lives don’t change that.

[Note to self: do not leave will on iCloud.]

(Photo of bitcoins by Steve Garfield)

30 Aug 18:08

thefrogman: [video]