Adam T. Bradley

Friday Readings

  • Providence Journal: R.I. rethinking pedestrian bridge plan on 195 land after bids come in high
  • WPRI: Study: Low infrastructure spending makes RI an ‘outlier state’
  • The Economist: America’s growing temporary workforce
    America's temporary help industry first emerged after the second world war, when companies like Manpower and Kelly Girl Service began “renting out” office workers on a short-term basis. In those early years, temps numbered in the hundreds of thousands. Today, the industry employs some 2.9m people, over 2% of America’s total workforce.
  • The Economist: What if Germany had not Reunified
    Joining East and West together within NATO and the European Union was the worst option, except for all the others
  • Lars P. Syll: Why Economists Can't Reason Neoclassical economics has since long given up on the real world and contents itself with proving things about thought up worlds. Empirical evidence only plays a minor role in economic theory, where models largely function as a substitute for empirical evidence. The one-sided, almost religious, insistence on axiomatic-deductivist modeling as the only scientific activity worthy of pursuing in economics, is a scientific cul-de-sac.
  • Chasing Truth. Catching Hell.: Dear Norm: How Do You Defend Those People? (Part 3,223)
    No, I don’t mean “how can you live with yourself ensuring due process for people who have done really really bad things” or anything like that. I mean, how do you actually do it? When you have a client accused of something awful, and he/she has next to nothing by way of a defense, how do you defend them anyway?
  • USA Today: Hardwired for happy hour: Primates choose booze
    Scientists discovered that the aye-aye and the slow loris species both have a taste for booze, a finding that indirectly bolsters one theory for how humans came to appreciate a stiff drink. The aye-ayes in particular were such enthusiastic tipplers that after draining their cups, they searched for more…
  • #fridayreads: Thinking in systems: a primer by Donella H. Meadows

Friday Readings

  • Foreign Policy: The Soft Logic of Soft Targets
    Second, trying to defend “soft targets” is essentially impossible, because such targets are by definition vulnerable and there are an infinite number of them in any minimally free society.
  • Columbia Journalism Review: How a regional newspaper pulled off a national investigation into sexual abuse by doctors
  • Corey Robin: We can get rid of the Hitlers and the Himmlers, but not the Speers
    In 1942, Albert Speer drafted a decree that made it a crime, punishable by death, to provide false information about raw materials, labor, machinery or products. Himmler thought it was too harsh.
  • Foreign Policy: Britain Has a New Snooper-in-Chief
    “Government hacking powers, mass surveillance, and collection and sharing of data,” is how Gus Hosein, the executive director of Privacy International, summed up May’s agenda as home secretary, a position in which she oversaw the police, the MI5 domestic security services, and border control. In that role, May increased data collection on travelers in the EU and, in Hosein’s words, used “any opportunity to decry human rights laws as the bane of our existence.”
  • Open Culture: An 1585 Recipe for Making Pancakes
    Take new thicke Creame a pint, foure or five yolks of egs, a good handful of flower and two or three spoonefuls of ale, strain them together into a faire platter, and season it with a good handfull of sugar, a spooneful of synamon, and a little Ginger…

Friday Readings

Friday Readings

Friday Readings

The study of money is the root of all evil

All these findings correspond with a substantial body of research in the economic literature, which, with the help of surveys, laboratory experiments, as well as field experiments showed that those who learn about markets (economists) or act in markets (businessmen) are lacking in … ‘pro-social behavior’ … I also use corruption as a proxy to show whether there are any differences in pro-social behavior between economists and non-economists, but unlike them, I observe behavior outside the artificial situation of a laboratory. By analyzing real world data of the U.S. Congress, I found that politicians holding a degree in economics are significantly more prone to engage in corrupt practices.

René Ruske, “Does Economics Make Politicians Corrupt? Empirical Evidence from the United States Congress

PaperJS Sparklines

Yet another PaperJS experiment. This one generates Sparklines. It simply looks for canvases matching a specific CSS selector (canvas.sparkler by default), and draws a chart based on JSON-formatted data in the data-data attribute. Here, I'm displaying some unemployment data from Quandl.

The code is on Gist.



ct.unemp <- Quandl("FRBC/UNEMP_ST_CT", trim_start="1978-01-01", trim_end="2013-12-01", collapse="monthly")
ct.2yunemp <- rev(ct.unemp$Value[1:24])

me.unemp <- Quandl("FRBC/UNEMP_ST_ME", trim_start="1978-01-01", trim_end="2013-12-01", collapse="monthly")
me.2yunemp <- rev(me.unemp$Value[1:24])

ma.unemp <- Quandl("FRBC/UNEMP_ST_MA", trim_start="1978-01-01", trim_end="2013-12-01", collapse="monthly")
ma.2yunemp <- rev(ma.unemp$Value[1:24])

nh.unemp <- Quandl("FRBC/UNEMP_ST_NH", trim_start="1978-01-01", trim_end="2013-12-01", collapse="monthly")
nh.2yunemp <- rev(nh.unemp$Value[1:24])

ri.unemp <- Quandl("FRBC/UNEMP_ST_RI", trim_start="1978-01-01", trim_end="2013-12-01", collapse="monthly")
ri.2yunemp <- rev(ri.unemp$Value[1:24])

vt.unemp <- Quandl("FRBC/UNEMP_ST_VT", trim_start="1978-01-01", trim_end="2013-12-01", collapse="monthly")
vt.2yunemp <- rev(vt.unemp$Value[1:24])
New England Unemployment by State, 2011-12-31 to 2013-11-30
State Min/max 2011-12-31 2013-11-30
Connecticut 7.5%/8.5% 8.3% 7.5%
Maine 6.4%/7.4% 7.4% 6.4%
Massachusetts 6.7%/7.2% 6.9% 7.1%
New Hampshire 5.2%/5.6% 5.4% 5.2%
Rhode Island 9.4%/10.9% 10.9% 9.4%
Vermont 4.2%/5.1% 5.1% 4.3%

Social Network Simulation with PaperJS

What it's doing: Each node has a belief that matches its hue, represented as an angle between 0 and 359 degrees. Every 25 frames (once a second or so), a node is chosen at random and given a choice whether to speak; if it does (this is represented by a fading circle expanding from the node). Every other node has a chance to hear the speaking node based on the distance between the speaker and the listener--the farther you are from the speaker, the less likely you are to hear.

Once a node does hear another node, it will only care about what it's hearing under one of two conditions:

  1. The hearer's beliefs (i.e. color) are similar to the speakers, in which case the hearer's beliefs will move slightly closer to the speaker's; or
  2. The hearer's beliefs are very different from the speakers, and its beliefs will move even further away from the speaker's.

In either case, there is a small chance the hearer will subscribe to the speaker, which adds a line between the two and means the hearer will always hear announcements from that speaker.

NB: This isn't designed--at least in this incarnation--to be a realistic simulation of anything. It's another experiment with PaperJS.

Word Hail

This is a minor experiment with Paper.js, made while I (re-)teach myself to animate color and movement. (Click through to view.)

RMarkdown and Jekyll

While migrating my blog recently from WordPress to Jekyll, I looked for easy ways to post RMarkdown documents to my blog. I ended up developing two options of my own (available on GitHub):

jekyll.R provides two R functions to let you add posts or drafts to your Jekyll blog direct from the RStudio console, by knit()ing an .Rmarkdown document into markdown with the YAML front-matter Jekyll expects. This is probably the best option for blogs.

rmarkdown_converter.rb is a Jekyll plugin that provides an Rmarkdown converter. This lets write your posts in RMarkdown and save them in your site's _drafts or _posts directory with the extension Rmd or Rmarkdown, just like you normally post standard markdown documents.

The downside here is that changes to your R environment (you get a new computer and don't reinstall all of the packages you had before, you upgrade R and one of the packages you used to use is no longer supported, etc.) can make it impossible to build your blog (or at least some posts). It might be more useful for some non-blog sites.

This code borrows heavily from the sample converter on the Jekyll plugins documentation page and this post by Simon Elliston Ball.