Tom Roche
Shared posts
Accelerationism: how a fringe philosophy predicted the future we live in – podcast
Tom Rocheoriginal article/transcript by Andy Beckett @ https://www.theguardian.com/world/2017/may/11/accelerationism-how-a-fringe-philosophy-predicted-the-future-we-live-in
Israel-Palestine: the real reason there’s still no peace - podcast
Tom Rocheexcellent piece. Note original transcript by Nathan Thrall @ https://www.theguardian.com/world/2017/may/16/the-real-reason-the-israel-palestine-peace-process-always-fails , or listen to a shorter version (more focused on the Six Days' War) @ http://mpegmedia.abc.net.au/rn/podcast/2017/06/lnl_20170605_2240.mp3
Six Day War 1967:the political legacy
Tom Rochegood piece from Nathan Thrall--for a longer view from him, listen to https://flex.acast.com/audio.guim.co.uk/2017/05/30-59789-gdn.lr.170530.sb.israel-palestine-real-reason-no-peace.mp3 (or read the text @ https://www.theguardian.com/world/2017/may/16/the-real-reason-the-israel-palestine-peace-process-always-fails )
Lost histories of Australia
Tom Rochererun
Scatter, Adapt, and Remember: How Humans Will Survive a Mass Extinction by Annalee Newitz
Tom Rochererun
Ryan Alford, “Permanent State of Emergency: Unchecked Executive Power and the Demise of the Rule of Law” (McGill Queens UP, 2017)
Tom Rocheexcellent
Death in the Haymarket: A Story of Chicago, the First Labor Movement and the Bombing that Divided Gilded Age America by James Green
Tom Rochegood, but rerun
PEARC17 registration and hotel deadlines May 31
Tom RochePractice & Experience in Advanced Research Computing conference: research attendees and presenters from recent years https://www.pearc.org/
The regular registration deadline is coming up May 31 for PEARC17, the Practice & Experience in Advanced Research Computing conference July 9-13 in New Orleans. It’s also the deadline for locking in the conference hotel room rate. (These deadlines will not be extended.) Late registration fees take effect June 1.
PEARC17 will include a robust schedule of tutorials, a special student program, and a technical program that includes four paper tracks, posters, a Visualization Showcase, and Birds of a Feather (BoF) sessions. Keynote speakers will be Paula Stephan, Georgia State University professor of economics and research associate with the National Bureau of Economic Research, and Paul Morin, founder and director of the Polar Geospatial Center, an NSF science and logistics support center at the University of Minnesota.
See the PEARC17 website for details.
Don Baker, “Catholics and Anti-Catholicism in Choson Korea” (U. Hawaii Press, 2017)
Tom Rocheexcellent romp through Korean history, and quite fair to the Confucianists
Britain's critical threat
Tom RocheInterview with Ian Dunt (from politics.co.uk) ends rather bizarrely, with the following @ 13:16 (excerpted to essentials): "Farage is part of this global authoritarian right nexus: you have Assange, Donald Trump, Marine le Pen, and at the head of it all you have Putin." But then, in classic corporate-funded-media style, Dunt walks it back a bit with, e.g., "we don't know what it is we're talking about." A new low point for Phillip Adams.
The Equality Effect: improving life for everyone [Audio]
Tom Rocheone of the very best talks (on any feed) of 2017 to date--gotta get the slides
Behind the News, 3/9/17
Behind the News, 5/18/17
Tom Roche1st piece by Henwood (original @ https://lbo-news.com/2017/05/17/the-post-trump-era/) on how US Democrats are allying with the US surveillance state to "get" Trump, but at best will only get Pence. Ends @ 7:29. 2nd piece (by Moore) IMHO wastes 26 min. 3rd piece (interview with Greg Kaplan @ UChicago, starts 33:26) is excellent, regarding issues in a recent NBER working paper (suggested citation:
> Guvenen, Fatih and Kaplan, Greg and Song, Jae and Weidner, Justin, Lifetime Incomes in the United States Over Six Decades (April 2017). NBER Working Paper No. w23371. Available at SSRN: https://ssrn.com/abstract=2961095
) and related issues. Note that the paper is paywalled at the above cite, but
* a preprint is available @ https://web.archive.org/web/20170516185537/https://fguvenendotcom.files.wordpress.com/2014/04/gks_lifetime_history_2017_apr_nber.pdf
* an even more informative (for the non-specialist, like me) presentation is available @ https://web.archive.org/web/20170522234357/https://fguvenendotcom.files.wordpress.com/2014/04/slides_gksw_sf_fed_novemberr2016_v2.pdf
The post-Trump era?
Tom Rocheaudio is 1st part of BTN
How much longer can this go on? As I write this, PredictIt gives 71/29 odds that Trump will last the year, but it’s mighty tempting to buy the “no”—especially after the revelation that he asked Comey to shut down the Flynn investigation. (Disclosure alert: I bought 100 shares of “no” at $0.28.)
What is the endgame of the people, mostly Democrats, pounding the drums most heavily? Do they want to impeach Trump, which seems a long shot given Republican control of Congress? Do they want to bruise his weak ego so badly that he resigns? Clearly the job is much harder than he ever imagined—and, by the way, what reasonably sentient person over the age of 8 ever thought the presidency wasn’t grindingly hard? But he also wants adulation, not the relentless volleys of shit he’s gotten. It’s not impossible to imagine him just walking offstage, especially if his legal situation gets seriously dicey.
What then? President Pence? If Pence were president, the entire Republican dream agenda would sail through Congress in like three weeks. Pence spent a dozen years in Congress (Tea Party branch) and four years as governor of Indiana; he’s an appalling figure but he knows how things work. He might not be able to overcome his party’s internal divisions, but he probably could do a better job than Trump, and every day would not be a circus as it is now.

Pence is a horror—fiscal sadist, misogynist, homophobe, lover of the carceral state. He’s repeatedly described himself as “a Christian, a conservative, and a Republican, in that order,” though given today’s modern GOP, it’s not clear there’s much of a difference among these features. (He should have said he’s a reactionary Christian; there are plenty of other kinds.) He’s a creationist who rejects climate change, thinks stem cell research is “obsolete,” and once actually said that “smoking doesn’t kill.” His anti-abortion law was the most extreme in the country. His cuts to Planned Parenthood led to a rural HIV epidemic. Like Sessions, Pence is a maximalist on drugs, including weed. He’s hot to privatize Social Security. He likened the Supreme Court’s upholding of Obamacare to 9/11.
Should Trump get pushed out, the orchestrated campaign of healing would be painful. It’s not far-fetched to imagine leading Democrats channelling Gerald Ford’s “our long national nightmare is over.” There would be something of what Wall Street calls a “relief rally” on the transition, and it would perversely grease the way for Pence to make the U.S. more like the Indiana he left behind. We should be fighting to keep him in office, as fatally damaged goods.
Several things seem to be driving this campaign to squeeze Trump out, aside from the obvious fact he’s an unstable ignoramus. Dems still can’t get over the fact that they lost to the most unpopular candidate in the history of polling, but instead of blaming their own terrible candidate (the second-most unpopular candidate in the history of polling) and the slavers’ legacy, the Electoral College, they want to blame Russia. (Time was they blamed Comey too—remember when Paul Krugman said that “Comey and Putin installed a crazy, vindictive can’t-handle-the-truth person in the White House”? But he’s since been rehabilitated.)
But that’s not all: a large part of the political class (Hillary prominent among them, along with John McCain), the security establishment, and their contract-hungry patrons in the military–industrial complex all want desperately to make Russia the enemy, and are reviving zombie tropes from the Cold War to promote their cause. Trump may well have friends in the Russian mob, but his resistance to elite hostility towards the country is one of the few non-awful things about him.
It’s been stunning to watch liberals cheering on the security state’s war-by-leak against Trump. He’s odious, but he is the legally elected president—under an absurd electoral system, but that’s the one we’ve got. (Makes you wonder what they would have done to Sanders, if by some unimaginable fluke he’d won.) And yet we’ve seen months of praise for the CIA and the FBI as the magic bullets who could deliver us from the short-fingered vulgarian.
The defenses of the CIA began with Trump’s disparaging remarks about the Agency before taking office, which were taken as near-blasphemous. For an amateur like Trump, such attacks were extremely risky. In early January, Chuck Schumer presciently warned (on the Maddow Show, of course): “Let me tell you: You take on the intelligence community—they have six ways from Sunday of getting back at you.” You’d almost think that he knew what would come next: an endless series of leaks portraying Trump as Putin’s towel boy and, as an extra-special bonus, a pervert (the piss tape)—all applauded by liberals, with little regard for the CIA’s 70-year history of lying, assassination, and coups.
Then came the Comey firing, and suddenly the FBI was a noble organization as well. It’s far from that, and has always been. As Mark Ames reports in his little history of the Bureau, it has no legal charter; Congress didn’t want to authorize a secret police so Teddy Roosevelt created it by executive fiat. Much of the Bureau’s history was been about persecuting communists—and gay people—and smearing its enemies. It spent the 1960s and early 1970s trying to ruin Martin Luther King, the Black Panthers, and and the New Left. In other words, it’s been political from the very first, and all these current worries about “politicizing” the FBI are Grade A bullshit.
Which brings us back to the endgame issue. Democrats look to be extending the strategy of their failed 2016 campaign by being the not-Trump and nothing more—it’s all they’ve got. They are making no visible effort to come up with an appealing agenda as an alternative to the deeply unpopular one the GOP has on offer. In fact, they’re annoyed at Bernie Sanders for trying to get the party to talk about policy, which is somehow seen as an act of narcissism in the Beltway worldview:
But the senator, who’ll be 79 the next time the New Hampshire primary rolls around, is continuing to put himself at the center of the conversation. He’s introduced a Medicare-for-all bill this week that he hopes will force others to sign on.
Imagine that! Pushing a bill to expand health insurance coverage at a moment when Republicans are trying to take it away. The ego of that man.
The party’s strategy can’t be counted a success on conventional measures; Gallup reports that the Dems have lost 5 approval points since November, leaving the two parties with near-identical approval ratings (D: 40%, R: 39%).

During the early days of the Trump administration, it seemed like a serious left opposition might take form. That‘s a hazy memory now that so many liberals and even leftists are taking dictation from the security state and throwing around words like “treason.” We can do better than this, can’t we?
Steven Pearlstein Says the Washington Post Can't Find Someone Who Understands Economics to Write About Economic Issues
Tom Rochegood very short summary of trade flows and currency levels
Yes, it's yet another example of the skills shortage. In the middle of his review of a new book by Mervyn King, the former head of the Bank of England, Steven Pearlstein tells readers:
"If you are like me, just thinking about the constant interplay among trade flows, investment flows, savings rates, exchange rates, inflation, interest rates and asset prices makes your head hurt. Perhaps that’s because it’s never exactly clear what is cause and what is effect, or whether the effect is up or down."
For people whose head doesn't hurt, the chains of causation are actually fairly clear. While Pearlstein tells readers that the United States and the other Anglo-Saxon countries are "saving too little," in a context where other countries are propping up the dollars (as King claims and Pearlstein apparently agrees), causing us to run large trade deficits, we are saving too much.
The trade deficits the United States and other countries run as a result of having over-valued currencies lead to unemployment unless they are offset by large budget deficits. The budget deficits run in the years after the 2001 recession and 2008–2009 recession were insufficient to restore the economy to full employment. (We did eventually reach something close to full employment in 2006–2007 due to the construction and consumption demand generated by the housing bubble.)
Larger budgets would mean less national savings, although the increased borrowing associated with the deficit would be partially offset by the additional output in the economy, which would lead to more savings. It is also possible to get back to full employment by reducing labor supply through measures such as work sharing, mandated paid vacations, and other measures designed to shorten the average work year. This is how Germany managed to reduce its unemployment in the Great Recession, even though it had a sharper fall in output than the United States.
Pearlstein's confusion on cause and effect also leads him to claim some sort of crisis is imminent, since at some point other countries are likely to stop propping up the dollar. There is no basis for this assertion. We actually have a clear precedent for this story of adjustment.
In the late 1980s, following the 1985 Plaza Accord, Japan, Germany, and our other major trading partners helped to engineer a sharp reduction in the value of the dollar, which caused our trade deficit to decline from a peak of more than 3.0 percent of GDP in 1986 to roughly 1.0 percent of GDP by 1989. The economy grew at a respectable pace throughout this period and there was no major uptick in inflation.
America's Great Game: The CIA's Secret Arabists and the Shaping of the Modern Middle East by Hugh Wilford. PART 1 of 2.
Tom Rochererun
Stalingrad: The City that Defeated the Third Reich by Jochen Hellbeck and Christopher Tauchen. PART 3 of 4.
Tom Rochererun
Where oil rigs go to die – podcast
Tom Rocheoriginal article/transcript by Tom Lamont @ https://www.theguardian.com/business/2017/may/02/where-oil-rigs-go-to-die
After Latest Bombshells, Only Michel Temer’s Removal and New Elections Can Save Brazil’s Democracy
When Michel Temer was permanently installed as president less than one year ago after the impeachment of elected President Dilma Rousseff, the primary justification offered by Brazilian media figures was that he would bring stability and unity to a country beset by political and economic crisis. From the start, the opposite has been true: Temer and his closest allies were a vessel for far more corruption, controversy, instability, and shame than anything that preceded them. His approval ratings have literally collapsed to single digits.
But yesterday’s emergence of proof showing just how dirty and corrupt Temer is makes the situation utterly unsustainable. Leaks from the ongoing corruption investigation reveal that Temer was caught on tape in March endorsing an executive’s ongoing payment of bribes to maintain the silence of Eduardo Cunha, the formerly omnipotent, now-imprisoned house speaker who presided over Dilma’s impeachment and belongs to Temer’s party. Temer had already faced allegations of deep involvement in bribes and illegal contributions, but that could be overlooked because — unlike now — no smoking gun existed.
Meanwhile, Dilma’s 2014 opponent in the presidential campaign — conservative Senator Aécio Neves (shown above with Temer at the latter’s inauguration), whose party led Dilma’s impeachment and now dominates Temer’s government — was caught on tape requesting 2 million reals from a businessman. He was removed this morning from his seat by a Supreme Court ruling, had his office raided, and now faces immediate imprisonment. Aécio’s sister was imprisoned this morning as part of the corruption investigation.
In sum, the two key figures driving Dilma’s impeachment were just revealed to be hardened criminals, with documentary evidence — audio recordings, videos, and online chats — which all Brazilians will soon see, hear, and read. The exact type of smoking gun evidence that Brazil’s notoriously biased corporate media searched for with futility for years against Dilma was just discovered against the two key figures that drove her impeachment, one of whom they installed as president.
To say that this situation — Temer’s ongoing presidency — is unsustainable is an understatement. How can a major country possibly be governed by someone who everyone knows just months ago encouraged the payment of bribes to keep key witnesses silenced in a corruption investigation? The sole rationale for Temer’s presidency — that he would bring stability and signal to markets that Brazil was again open for business — has just collapsed in a heap of humiliation and destruction.
*BRAZIL STOCK FUTURES PLUNGE 10% ON OPEN https://t.co/lQS9nUityj pic.twitter.com/W1aKkJ1AMw
— Bloomberg Markets (@markets) May 18, 2017
At this point, Temer’s removal — one way or the other — seems inevitable. Although he is momentarily refusing to resign, his key allies are starting to abandon him. The media stars who installed him are now trashing him. There is open discussion everywhere about the mechanisms that will be used to remove and replace him.
Even for the sleazy power brokers of Brasília, getting caught on tape directly participating in blatant criminality is disqualifying: not to stay in the House or Senate, but to serve as the symbolic face of the country to the world and, more importantly, to capital markets. What’s new is not that Temer is corrupt: Everyone knew that, including those who installed him. What’s new is that the evidence is now too embarrassing — too sabotaging of their project — to allow him to stay.
This always was the towering irony at the heart of Dilma’s impeachment. As those of us who argued against impeachment repeatedly pointed out, removing the democratically elected president in the name of battling criminality was such a farce precisely because her removal would elevate and empower the most corrupt factions, the darkest criminals and bandits, and enable them to rule the country without having won an election.
Indeed, the empowerment of the country’s most corrupt factions was a key goal of Dilma’s impeachment. As shown by yet another secret recording — one revealed last year that captured the plotting of Temer’s key ally, Romero Jucá — the real goal of impeachment (aside from austerity and privatization) was to enable those politicians most endangered by criminal proceedings to use their new, unearned political power to kill the ongoing investigation (“stop the bleeding”) and thus protect themselves from accountability and punishment. The empowerment of the nation’s most corrupt politicians was a key feature, not a bug, of Dilma’s impeachment.
The key question now — as it was then — is what comes next? Those of us who argued against impeachment repeatedly urged that if Dilma were really going to be impeached, only new elections — whereby the citizenry, rather than the band of criminals in the halls of power, chose their new president — could protect Brazilian democracy. The absolute worst option was to allow the corrupt line of succession in Brasília to elevate itself and then choose its own successors. That would ensure that political criminality became further entrenched. As David Miranda and I wrote in a Folha op-ed in April of last year:
If, despite all this, the country is truly determined to remove Dilma, the worst alternative is to permit the corrupt line of succession to ascend to power.
The principles of democracy demand that Dilma Rousseff complete her term in office. If that is not an option, and if she is going to be impeached, the best alternative is new elections. That way, the population would assume its proper place as provided by the Constitution: All power emanates from the people.
Yet that’s exactly what took place. What Brazilian elites fear and hate most is democracy. The last thing they wanted was to allow Brazil’s population to once again choose its own leaders. So they foisted on them a corrupt, hated mediocrity — who could never have been elected on his own, who indeed is now banned from running for any office due to election law violations — and he was tasked with imposing an agenda the country hated.
Brazil’s elite media and political class are now openly plotting the same scam. Many are suggesting that Temer’s replacement should be chosen not by the Brazilian people but by its Congress: one-third of whom are the targets of formal criminal investigations, most of whose major parties are rife with corruption. As we saw with Temer’s installation, allowing corrupt institutions to choose a country’s leaders is the antithesis of democracy and anti-corruption crusades. It ensures that criminality and corruption reign. The only debate should be whether direct elections should include not only Temer’s successor but also a new Congress.
Brazil’s democracy, along with its political stability, has already been crippled by the traumatic removal of the person who was actually elected to lead the country. That her successor has been exposed as a criminal exacerbates the tragedy. But it is not an overstatement to say that allowing the same corrupt factions to choose one of their own to replace Temer — once again denying the right of the people to pick their president and instead imposing on them a leader who emerges from the sleaziest precincts of Brasília’s sewer — would be its death blow.
Top photo: Michel Temer greets Sen. Aécio Neves following Temer’s swearing-in ceremony as president of Brazil in Brasilia on Aug. 31, 2016.
The post After Latest Bombshells, Only Michel Temer’s Removal and New Elections Can Save Brazil’s Democracy appeared first on The Intercept.
Stanley Corkin, “Connecting the Wire: Race, Space, and Postindustrial Baltimore” (U. Texas Press, 2017)
Tom Rochehugely disappointing interview, largely ruined by host James Stancil. Major low point for NBN.
Data: friend or foe?
Tom RocheMona Chalabi
White House turmoil
Tom RocheShapiro
PyBites: How to Parse Common Data Formats in Python
Tom RocheCSV, JSON, SQLite, XML
In this post we demonstrate ways in which you can parse common data formats used in Python.
S. Lott: Needless Complexity -- Creating Havoc Leads to Mistakes
Tom Rochegood stuff on Python2/3 compatibility, e.g., writing Python2 code (if one absolutely must) so as to make it more portable to Python3
Here's the email.
I have hurriedly created a blog post titled [omitted] at the url below
[also omitted]
...
Unfortunately, I am neither an algorithm expert or a Python expert. However, I am willing to jump in.
Please review the Python code snippets. I know that they work because I ran them using Python 2.7.6. It was the environment available on my work PC. Speed to get something to the group so that it does not disband outweighs spending time on environments. The goal is not to be Pythonic but to have anyone that has written any code follow the logic.
Also, please review the logic. Somehow, I managed to get the wrong answer. The entire blog post is a build to provide a solution to CLRS exercise 2.3-7. My analysis gave me the answer of O( {n [log n]}**2 ) and the CLRS answer is O(n [log n] ). Where did I screw up my logic?
Havoc was created through a process of casually misstating just about everything that can possibly be misstated. It transcended mere "wrong" and enters that space where the whole thing can't even be falsified. It was beyond simply wrong.
The Problem
"Describe a $\Theta(n \log n)$-time algorithm that, given a set $S$ of $n$ integers and another integer $x$, determines whether or not there exist two elements in $S$ whose sum is exactly $x$."
x + y = x0It's not at all clear what's going on here. What's x0? What's N? Why is x!=y even introduced?
where
x ∈ N and y ∈ N for some finite set of integer values N
x0: the integer to which x and y sum
x != y
This is how havoc starts. The requirements have been restated in a way that makes them more confusing. The original terminology was dropped in favor of random new terminology. There's no reason for restating the problem. The consequence of the bad restatement is to introduce needless features and create confusion.
The Python Nonsense
A quote:Concepts are demonstrated via code snippets. They code snippets were executed using Python 2.7.6. They were written in such a way that anyone with basic coding skills could read the code. In other words, the goal was not to be Pythonic.
The goal of using Python without being Pythonic seems to be -- well -- schizophrenic. Or it's intentional troll-bait. Hard to say.
The Python community will be annoyed because I am using Python 2 and not 3. Their annoyance is appropriate. Unfortunately, I only have Windows machines and can't afford to screw them up at this point in time.
from __future__ import print_function, division, absolute_import, unicode_literals
The code with a -2/10 pylint score
I'm trying to reproduce this faithfully. It's hard, because the original blog post has issues with layout.SomeIntegerList = [1, 2, 3, 4, 5, 6](The original really could not be copied and pasted to create code that could even be parsed. I may have accidentally fixed that. I hope not.)
DesiredSumOfIntegers = 11
for SomeIntegerA in SomeIntegerList:
for SomeIntegerB in SomeIntegerList:
if SomeIntegerA == SomeIntegerB: continue
SumOfIntegers = SomeIntegerA + SomeIntegerB
print "SomeInteger A = ", SomeIntegerA, ", SomeInteger B = ", SomeIntegerB, ", Sum of Integers = ", SumOfIntegers
if DesiredSumOfIntegers == SumOfIntegers:
print "DesiredSumOfIntegers = ", DesiredSumOfIntegers, " was found"
Almost every line of code has a problem. It gets worse, of course.
There's output in the original blog post that provides a hint as to what's supposed to be happening here.
Addition is Commutative
Yes. There is an entire paragraph plus a spreadsheet which proves that addition is commutative. An. Entire. Paragraph. Plus. A. Spreadsheet.Meanwhile, factorial, multiplication, and division aren't mentioned. Why do we need a spreadsheet to show that addition is commutative, yet, all other operators are ignored? No clue. Moving on.
Permutations
A quote:Now, let's talk about the number of computations involved in using nested for loops to examine all the possible addition permutations. Here I am using the term permutation as it is strictly defined in mathematics.First. The algorithm uses all combinations. $\textbf{O}(n^2)$.
Second. "as it is strictly defined in mathematics" should go without saying. If you feel the need to say this, it calls the entire blog post into question.
It's like "honestly." Anyone who has to establish their honesty with "can I be honest with you?" is still lying.
If we're being strict here, are we not being strict elsewhere? If we're not being strict, why not?
The algorithm enumerates all combinations of n things taken 2 at a time without replacement. For reasons that aren't clear. The original problem statement permits replacement. The restatement of the problem doesn't permit replacement.
The n things taken r or 2 at a time problem
There's a table with values for $\frac{n!}{(n-r)!}$No hint is given as to what this table is or why it's here. I think it's supposed to be because of this:
Another Perspective
A quoteAnother perspective is to note that the nested for loops result in O(n^2). Clearly, the above approach is not scalable.
The Worst Code Snippet Ever
SomeIntegerList = [1, 2, 3, 4, 5, 6]
DesiredSumOfIntegers = 11
i = 0
for SomeIntegerA in SomeIntegerList:
i = i + 1
j = 0
for SomeIntegerB in SomeIntegerList:
j = j + 1
if j > i:
print "i = ", i, ", j = ", j
SumOfIntegers = SomeIntegerA + SomeIntegerB
print "SomeInteger A = ", SomeIntegerA, ", SomeInteger B = ", SomeIntegerB, ", Sum of Integers = ", SumOfIntegers
if DesiredSumOfIntegers == SumOfIntegers:
print "DesiredSumOfIntegers = ", DesiredSumOfIntegers, " was found"
This is the most baffling complex version of a half-matrix iteration that I think I've ever seen. I can only guess that this is written by someone uncomfortable with thinking. They copied and pasted a block of assembler code changing the syntax to Python. I can't discern any way to arrive at this code.
The Big-O Problem
This quote:Even though the number of computations is cut in halfThe rules for Big-O are in the cited CLRS book. $\textbf{O}(\frac{n^2}{2}) = \textbf{O}(n^2)$.
The "cut in half" doesn't count when describing the overall worst-case complexity. It needs to be emphasized that "cut in half" doesn't matter. Over and over again.
This code doesn't solve the problem. It doesn't advance toward solving the problem. And it's unreadable. Maybe it's a counter-example? An elaborate "don't do this"?
The idea of for i in range(len(S)): for j in range(i): ... seems to be an inescapable approach to processing the upper half of a matrix, and it seems to be obviously $\textbf{O}(n^2)$.
The Binary Search
This quote is perhaps the only thing in the entire blog post that's not utterly wrong.we can compute the integer value that we need to find. We can than do a search over an ordered list for the integer that we need to find.Finally. Something sensible. Followed by more really bad code.
The code starts with this
def binarySearch(alist, item):
instead of this
from bisect import bisect
Why does anyone try to write code when Python already provides it?
There's more code, but it's just badly formatted and has a net pylint score that's below zero. We've seen enough.
There's some further analysis that doesn't make any sense at all:
Since the integers that sum must be distinct, the diagnol on the matrix have values of N/AAnd this:
Secondly, we should remove the integer that we are on from the binary searchThis is a consequence of the initial confusion that decided that $x \neq y$ was somehow part of the problem. When it wasn't. These two sentences indicate a level of profound confusion about the essential requirements. Which leads to havoc.
Added Complication
The whole story is pretty badly confused. Then this arrives.Complicate Problem by Having Integer List Not Sorted
The total computation complexity is O(2 * n [log n] ) = O(n [log n] )
The Kicker
A sentence or two of introduction might be all that's required to see why the other result is there.
Lessons Learned
This creates havoc. Simple havoc.
Some people appear to act like they're asking for help. But they're not. They may only want affirmation. A nice pat on the head. "Yes, you've written a blog post." Actual criticism isn't expected or desired. This is easy to detect by the volume and vehemence of the replies.
>>> S = [1,2,3,4,5,6]
>>> x=11
>>> [(n, x-n) for n in S if (x-n) in S]
[(5, 6), (6, 5)]
>>> bool([(n, x-n) for n in S if (x-n) in S])
True
This first example is $\textbf{O}(n^2)$ because the in operator is applied to a list. We can, however, use bisect() instead of the in operator.
>>> [(n, x-n) for n in S if S[bisect(S, (x-n))-1] == x-n]
[(5, 6), (6, 5)]
>>> x=13
>>> [(n, x-n) for n in S if S[bisect(S, (x-n))-1] == x-n]
[]
This achieves the goal -- following the parts of the analysis that aren't riddled with errors -- without so much nonsensical code.
This does require some explanation for what bisect(S, i) does. It's important to note that the bisect() function returns the position at which we should insert a new value to maintain order. It doesn't return the location of a found item. Indeed, if the item isn't found, it will still return a position into which a new item should be inserted.
If we want this to be $\textbf{O}(n)$, we can use this:
>>> S = [1,2,3,4,5,6]
>>> S_set = set(S)
>>> x=11
>>> bool([(n, x-n) for n in S_set if (x-n) in S_set])
True
This replaces the linear list with a set, S_set. The (x-n) in S_set operation is $\textbf{O}(1)$, leading to the overall operation being $\textbf{O}(n)$.
If you want to shave a little time, you can use any() instead of bool([]). If you're not returning the pairs, you can reduce it to any(x-n in S_set for n in S_set). Try it with timeit to see what the impact is. It's surprisingly small.
New World First Peoples DNA indicates at least two distinct immigrations from Beringia. @Evolutionscribe Ann Gibbons, @ScienceMagazine
Tom RocheBeringia -> America is just the first half of the piece: 2nd is about 3 migrations into Europe
Vijay Prashad on First 100 Days
Tom Rocheexcellent, but fundraiser
Thomas Muntzer
Tom Rocheexcellent
Tara H. Abraham, “Rebel Genius: Warren S. McCulloch’s Transdisciplinary Life in Science” (MIT Press, 2016)
Tom Rochelink 404s as of 14 May 2017
Whither Europe? Historical Perspectives on 2017 [Audio]
Tom Rochethe Abby Innes piece on the failure of (esp British) neoliberalism is exceptionally concise and excellent
NPR Can’t Help Hyping North Korean Threat
Tom Roche... and yet the advertisements for NPR that air on every "member station" constantly feature listeners testifying to NPR's "objectivity," lack of bias, "fact-based journalism." The utterances of the alt-right are empirically much more false than true, but one thing they've got correct: the NPR demographic (what I call "Nice White Liberals," regardless of their skin color) truly are "sheeple."

NPR (3/23/16)
UN Ambassador Nikki Haley told the UN Security Council on March 8 that “all options are on the table” regarding North Korea. Between then and April 27, NPR.org published 60 stories on US/North Korea relations. Here’s a representative exchange (Morning Edition, 4/20/17):
David Greene, host: A pretty ominous-sounding warning from North Korea this morning…. So what could North Korea actually do to threaten us?… I asked NPR national security editor Phil Ewing about the actual danger at this point from North Korea.
Phil Ewing: So the danger is we know the North Koreans have ballistic missiles…. And we know they have nuclear weapons. They’ve detonated a number of bombs below ground in the past few years. The issue is, will they be able to build a nuclear weapon small enough to fit on top of one of those missiles to be able to threaten their neighbors—South Korea or Japan—or potentially even one day hit the United States?
We don’t know if they’re there yet or not. The Pentagon says it has to assume they’re building toward that capability. And that’s why the generals and admirals, especially in the Pacific, pay so much attention to this danger.
North Korea’s dictatorial government uses the threat of war as a propaganda tool against its own population—fostering loyalty to itself and its military establishment. As NPR’s own reporting (3/23/16) put it, North Korea’s Kim Jong Un “needs to establish his own legitimacy, and that means standing up to enemies.” According to Brookings’ Sheena Greitens, interviewed in that piece: “North Korea might use a range of strategies…but we should remember that they’re all aimed at the same underlying, fundamental objective: ensuring Kim’s political survival.”
If North Korea’s warlike propaganda is so transparent, what should we think of the US media? Of course, professional journalists claim to pursue the truth, and report it in nobody’s interest but the public’s. But what if even a “serious” outlet like National Public Radio launches a flurry of fear-mongering at a word from the Pentagon? A survey of its coverage since March 8 suggests that NPR has promoted the perspective of the US government at the expense of public understanding of US/North Korean relations. The construction of foreign “threats” benefits both a national government hungry for legitimacy—and news organizations hungry for an audience.
Exaggerating the Threat

NPR (4/24/17)
On April 24, NPR’s All Things Considered aired a segment titled “As Tensions Rise, Experts Question Threat Level Posed by North Korea.” Three experts were interviewed, all delivering a message similar to the comment of Matthew Fuhrmann of Texas A&M:
I think a lot of the danger comes from things that the United States might do, not things that North Korea might do…. What concerns me is the possibility that decision makers in the United States or elsewhere don’t understand that.
One wishes that NPR reporters and their expert guests had gotten the memo much earlier. Since March, North Korea has been featured as an “urgent threat” (4/13/17), “a direct threat” and “growing threat” (guest expert Joel Wit, 4/17/17), a “real threat” (guest expert David Sanger, 3/29/17), “one big threat facing the US right now” (4/20/17), and a country that “has emerged as such a threat” (4/7/17). We have repeatedly been invited to imagine North Korea hitting the US mainland with a nuclear bomb (3/29/17, 4/2/17, 4/6/17, 4/14/17, 4/17/17, 4/20/17, 4/17/17).
How likely is such a scenario? We contacted Bruce Cumings, professor of history at the University of Chicago and author of several books on Korea, who stated simply: “North Korea would never launch an ICBM against the US unless a general war was on; they know they would be erased if they did so.” By the time NPR’s April 24 segment aired, walking back the immediacy of the threat, NPR staff and experts had conjured the nightmare scenario at least six times. The least likely of the many possible tragic outcomes has become the most likely to be remembered and feared by NPR listeners.
In a Facebook Live interview (4/18/17), NPR national security editor Phil Ewing described US anxiety over Kim Jong Un’s birthday—when North Korea was expected to test a weapon: “People thought that he might attack…the United States.” Which people imagined such an improbable course of events? Ewing cited no source. Is his role to pass on the information he has turned up as a journalist—or is it to pass on a sense of fear, and an image of North Korea as aggressor?
Bruce Cumings, again:
North Korean military capabilities are constantly hyped across our media, without ever mentioning US nuclear blackmail of North Korea going back to 1951. NPR is less culpable in its scare stories than CNN, but they don’t shy away from hyping the “North Korean threat.”
NPR‘s reporting feeds into a national confusion about US/North Korea relations, exaggerating the risk that North Korea poses to US Americans, and obscuring the real sources of that risk.
Do NPR listeners need this kind of education? Is the American public lacking in imagination when it comes to hypothetical foreign attacks? National polling suggests not: 86 percent of likely US voters “view North Korea as a serious national security threat to the United States” (Rasmussen poll, 4/19/17). When Pew (4/5/17) polled about how to respond to Korean nukes, it found
61 percent of Americans prefer increasing the already severe sanctions that are in place. Only 28 percent say they want to deal with the nuclear issue by engaging more and deepening ties with the country.
Deferring to the Pentagon

NPR (4/25/17)
NPR‘s coverage typically promotes a sense of murkiness about North Korea/US relations—we can sense the drama and importance, but it is often difficult to tell what is happening on the ground and why it is supposed to be so momentous. Impersonal phrases obscure who is acting, and often obscure NPR’s sources for their assertions. “Concerns” frequently “mount.”—or simply “there is concern.” One headline (4/14/17) read: “Rising Tensions Raise Questions About North Korea’s Military Capability.” Alternatively, tensions also “ratchet up” (4/25/17).
Steve Inskeep, host: How tense is the situation here?
Bob Schmitz, host: Oh, it’s tenser than it’s been in years.
—Morning Edition (4/14/17)
For whom are things so tense? “Everyone in the region” was “feeling more tense than usual,” one piece (4/14/17) unhelpfully explained, adding: “Many people in the region are pretty worried.” Yet NPR (4/23/17) clarified that South Koreans are not particularly worried, quoting Korean author Suki Kim saying “North Korea is kind of old news” in the South. Still, in the 60 stories surveyed, NPR hosts and guests used the words “tense” or “tension” 46 times, as well as “concern” (as in worry) 19 times, and “worry” or “worrisome” 12 times, along with a variety of similar terms.
Vague but agitating language allows NPR reporters to keep drama in their headlines, even when the subject of the story is something that didn’t happen—say, a nuclear test that there was “wide speculation” North Korea would carry out (The Two-Way, 4/24/17).
Murky language also leaves room for spin: US government and military officials emerge as protagonists, and nobody explains why they’re the good guys. North Korean dictator Kim Jong Un is a “strongman” (4/11/17, 4/17/17) and “irrational” (3/29/17, 4/23/17). North Korea’s actions, words or simply its existence are classified as threats in almost every article reviewed—close to 100 times in only 60 articles. But when US officials discuss attacking North Korea, they are never “threatening.” A typical example features both countries outlining potential military responses if “provoked”—but only one is a threat (Morning Edition, 4/25/17):
And then yesterday, North Korea threatened to sink a US Navy strike group if provoked. The United States now is turning things up a notch. For their part, on the Today show yesterday, the UN ambassador, Nikki Haley, talked about the conditions under which the US might consider striking North Korea.
The only time an NPR host described the US as threatening, his own guest set him straight (Morning Edition, 4/17/17):
David Greene: So is the vice president threatening war here?
Joel Wit, US/Korea Institute: Well, I think what the vice president is doing is exactly what he said, which is showing resolve in the face of a growing North Korean nuclear threat.
Instead of being “irrational” or “threatening,” US officials merit serious, masculine adjectives: When Vice President Mike Pence delivers “frank remarks” on North Korea, he is “showing resolve” and being “very straight” or “tough” (e.g., 3/18/17); the administration’s position on North Korea is “hard-line.”
The unpopular vice president, as he threatens to lead the most powerful military in the world into a conflict that would lead to an estimated million deaths, is a potential hero (Morning Edition, 4/14/17):
And if Americans are nervous that these tensions, you know, are there and want someone to step in, get some commitments from allies, somehow calm this down, Pence could be the guy. This is a big moment for him.
From The Two-Way (4/17/17):
Pence, whose father is a Korean War veteran, earlier visited the Demilitarized Zone between the Koreas, where he could see North Korean soldiers across the divide.
The latter move is a perennial photo-op for US administrations, as Cumings described recently in an interview on a WNYC podcast (4/19/17). NPR chooses to include it naturally in the narrative, as if the carefully crafted government storyline was, in fact, the story.
It’s unlikely that NPR reporters and editors want to come off as Pentagon mouthpieces, let alone as representatives of the Trump administration—of whom NPR is generally highly critical. NPR‘s North Korea coverage doesn’t give Trump a free pass—several stories point out that his aggressiveness and “unpredictability” could be making the situation worse. But coverage doesn’t challenge the tropes that help foster a compliant and supportive civilian population in wartime: the atmosphere of excitement and fear; heroic figures appearing amid the fog of war; the republication and amplification of official government statements; the dehumanization of the enemy.
Part of the problem is NPR‘s consistent reliance on Pentagon and official sources: 40 out of 60 stories reviewed cited official governmental sources. For 14 of them, the US government was the only source. Many experts consulted are former government officials, or have close ties to government.
NPR reporters are doubtless frustrated by the seeming necessity of taking so many cues from the Pentagon: in his interview with another NPR reporter about Trump’s armada lie, national security editor Phil Ewing was asked: “In your mind, there’s nothing the media can really do besides trusting what the Pentagon says,” and he responded: “That’s the discipline.” And though such reliance may be frustrating to NPR reporters, it’s downright harmful to the public that trusts them.
Missing History
The most salient point is that Americans (and NPR) never want to examine what their US Air Force did to North Korea in three years of bombing—essentially erasing 16 cities with nary a building standing in 1953, use of oceans of napalm, etc. Every North Korean is well aware of this.
— Bruce Cumings
Through all the twists and turns of the narrative—the hypothetical attacks; the missile tests and military exercises that did or did not happen; the threats and responses—NPR has covered every inch of the present North Korea/US conflict, all while observing a remarkable silence about where the conflict comes from.
Among all the stories posted to NPR.org, including all those from their flagship news programs, none mention US involvement in the Korean War as context for the current situation. The only such discussion we could locate through NPR.org was an interview with Cumings on the PRI/WNYC podcast The Takeaway (4/18/17).
Here’s some of the story that NPR has left out: In 1951, General Douglas MacArthur, after being relieved of command in North Korea, testified to Congress:
The war in Korea has already almost destroyed that nation of 20,000,000 people. I have never seen such devastation. I have seen, I guess, as much blood and disaster as any living man, and it just curdled my stomach, the last time I was there. After I looked at that wreckage and those thousands of women and children and everything, I vomited.
Quoting this passage, historian Bob Neer in Napalm: An American Biography went on:
War leveled at least half of 18 of the North’s 22 major cities. Pyongyang, a city of half a million people before 1950, was said to have had only two buildings left intact.
Fast forward to 2017, where you can hear Steve Inskeep, host of NPR‘s Morning Edition (4/17/17), ruminating:
Inskeep: I just went back and counted. President Trump is the 13th American president to be dealing with this North Korean regime, the 13th….
David Greene: That’s amazing.
Inskeep: …president in a row, a reminder of what a giant order that is to solve this problem. Up to now, for president after president, this has been a problem to manage, not solve.
Within the span of those 13 presidencies, under Harry Truman, a US bombing campaign killed perhaps 20 percent of the North Korean population—a massacre and a war crime that should not be referred to as “management.”
NPR‘s coverage also obscures the US’s recent role in the conflict. As noted above, tensions simply rise or “ratchet up” impersonally in NPR‘s coverage. US ships leaving and entering the region are frequently described as “conducting exercises“—and here is NPR’s most thorough description of what they do (The Two-Way, 4/14/17):
The latest launch comes as South Korea and the US wrap up their annual spring joint military exercises on the peninsula, which North Korea objects to because it views the drills as preparation for war. The US has consistently said the war games are defensive.
For contrast, see Christine Hong’s commentary on Democracy Now! (4/17/17):
Obama’s policy toward North Korea was, in point of fact, one of warfare….
The Obama administration [made] the militarization of the larger Asia-Pacific region one of its topmost foreign policy objectives. And under the Obama strategic pivot to the Asia/Pacific region, the US concentrated its naval forces to a tune of 60 percent…in the Pacific region….
The United States performs the largest war games in the world with its South Korean ally twice annually. And in the course of performing these military exercises, it actually rehearses a number of things. It rehearses the decapitation of the North Korean leadership, the invasion and occupation of North Korea, and it also performs a nuclear first strike against North Korea with dummy munitions.
Why is NPR’s audience shielded from seeing what their own military does, and how it is perceived?
Most significantly missing from NPR’s narrative are the lives of those who would be the primary victims of any military conflict: North Korean people. NPR Pentagon reporter Tom Bowman (4/9/17) summed up the consequences of war :
And if you did start attacking North Korea, there’s a sense that they would start using those missiles. Twenty-five million people [the population of Seoul, South Korea] are at risk, as well as 33,000 US troops. It would be horrific.
NPR reporters and their guests spoke often of the potential human cost of war; they mentioned the South Koreans and US Americans that might die in 11 out of the 60 articles surveyed. At each opportunity, however, they stopped short of mentioning the North Korean people who would die: They mention “casualties on both sides” only once (Weekend Edition, 3/18/17).
To an outside observer, it’s obvious that North Korean media and government statements are not tools to inform, but to shore up political strength. In the United States, news outlets like NPR claim to be independent—and to inform, as much as possible, from an objective point of view. But the propaganda functions of news reporting are all the more effective for being subtle enough to go unnoticed by most listeners. NPR’s coverage of US/North Korea relations, while less sensationalist than that of many other media outlets, presents a skewed picture of the conflict, one which exaggerates the danger to the United States, mystifies the actions of US officials and the military, and erases North Korean victims of the conflict, both past and potential.
You can contact NPR ombud Elizabeth Jensen via NPR’s contact form or via Twitter: @EJensenNYC. Please remember that respectful communication is the most effective.
CORRECTION (5/10/17): An earlier version of this article misattributed a quote from NPR‘s Tom Bowman to Steve Inskeep.

