Sleep Walk analysis

Sleep Walk” is pretty famous for its I – vi – iv – V verses, but there’s more interesting stuff going on, especially for 1959 top 40 radio.

  • The end of the bridge is a G7#9 (AKA the “Purple Haze” chord). The slide emphasizes this by sliding [D, G] up to [F, Bb] and back, and you can really hear the [B, F, Bb] in the rhythm guitar. I can’t think of any other top 40 song that used it so prominently; even “Purple Haze” mostly omits the major 3rd so it’s not as dissonant.
  • The ending is a G chord with the slide using a falling sixth interval: [G, E] – [Gb, Eb] – [F, D]. This is a common blues trick that turns a V6 (6 on top) into a V7 (7 on bottom).
  • The final cadence is pure jazz:
    • C6 [8-x-7-9-8-x]
    • G7#5b9 [x-8-9-8-9-x]
    • C6add9 [x-10-10-9-10-10]

Take the medicine

I saw an image floating around Facebook that said the human body is “programmed” to be a “self-healing machine” and “pills only mask the symptoms” of illnesses. This kind of thinking leads to kids dying and suffering needlessly.

Symptoms are what kill you. You don’t get a gold star for “roughing out” a fever or a painful injury, and the stress endured doesn’t make your body stronger. Stress is bad for you and damages relationships.

Bodies aren’t programmed. Evolution is a sloppy mechanism that produces systems just barely sufficient to survive threats from the immediate environment. Unfortunately, our “immediate environment” is now global, so with respect to the evolutionary time scale our potential sources of illness has exploded. Our systems are not prepared, and even young, talented musicians can succumb to viruses like H1N1.

Why wouldn’t a Basic Income be consumed by inflation?

Interest in the Basic Income is definitely picking up. This recent piece from Andrew Flowers, like most, doesn’t at all mention the possibility that the BI amount could be somewhat or completely eaten away via increased prices.

The BI will give rent collectors—landlords, near-monopolies like AT&T/Comcast, state/local governments, on and on—large incentives to increase rents, prices, and fees. Of course it will have some level of inflation.

If the inflation effect turns out to be large, BI would be a waste of time and scary to roll back, but there’s also a danger it could be regressively redistributive. I think it’s likely Congress would pass the BI only if it also reduced more direct help to the poor. If Congress took away that help, inflation—if occurred—would effectively force the poor to turn over what’s left to the rent collectors higher up the wealth distribution.

BI is still an interesting thought experiment to me, and it’s cool that studies are underway, but those studies need to be large and long enough to detect for inflationary effects, and articles discussing BI should mention that risk.

There are plenty more feasible ways to help the poor: increase wage subsidies like the EITC, target wage subsidies toward those having particular trouble finding work, or even some WPA jobs.

Obligatory 2015 Marijuana update

The minimal evidence we have of marijuana usage harms keeps withering away under more careful study, but the very real harms of police enforcement go on. I’ve really stopped paying attention to this stuff because it never ends; one month of stories look like any other. I just pop in once in awhile to see the latest abuses. Yep, young women cavity searched on the side of the roadkids shot; tons of no-knock drug raids putting everyone in unnecessary danger

America’s criminal justice system is so brutal and resistant to reform that the only way to reduce harm is to lessen people’s contact with it: move regulation strategies away from criminal law. Thankfully, state referendums to get cops out of the pot business are all over and even nation candidates are being forced to take the issue seriously.

To think how much harm could’ve been avoided if the country hadn’t wrapped up marijuana with the war on crack in the 80s. Hard drugs truly were devastating some communities then and now, but the “smell of marijuana” gave the police practically unlimited power and financial resources to forcibly invade and ruin the lives of people, particularly in neighborhoods unlikely to afford decent lawyers. Very few upper class families receive the Cheye Calvo experience, but lots of the little people still do.

Plugin-based Systems (and Events)

Modern application design is solved! OK, well we at least have a set of camps with their own principles, tools, and paradigms leading us toward the light. One might be “build some components, wire them up with references to each other, and let them talk to each other.” We love/hate static typing, but it allows tools to reason about really large programs.

All that is great, but I feel like plugin system design is in the wild west. To be clear, I mean dropping a new directory of code in place, performing some ritual, and the system behaving radically differently. Of course, we’re getting better at this as apps learn from each other, but I feel like our principles and tools aren’t particularly well matched to this goal of plugins being able to cooperate on a deep level to build up a system.

Allowing plugins to provide APIs introduces a big set of challenges. Just a few:

  • How do we conditionally use API’s if they’re available?
  • How can a plugin decorate/filter the API’s output?
  • How can a plugin replace the API with its own?
  • If two plugins want to replace the API, which “wins”?
  • How can a plugin remove part of the behavior/API of another plugin?
  • How much can plugins detect about each other?

Most robust plugin systems solve these with event systems and some mechanism of ordering plugins to solve disputes (all unique).

A big problem is that events are almost always run-time linking based on strings. Hence it’s very difficult for tools and humans to reason about which listeners will be called, in what order, and what data will flow to each listener and be returned to the dispatching party. Ideally IDEs could sense all this stuff, and help wire up new listeners and events. Instead, devs on a plugin-heavy system must do string searching on event names or at best use some reporting tool built into the event system.

Symfony’s typed event objects and Ruby’s symbols probably help here. Drupal has a strong convention both in code and docs that helps, and is popular enough for toolmakers to focus on it. Middleware systems as in Express (node) and Stack (PHP) offer a formal way to compose applications, which is pretty exciting, but I’m not sure they solve any of the above problems of plugins tightly collaborating on processes.

What’s the future look like here, and what’s the way toward it? Standardizing on a single event system seems unlikely, but what are the best and most powerful ones out there? What language features would make this easier? Can someone stop me from diving deep into Event-driven programming literature?

Events and Dependency Injection

The Laravel podcast folks mentioned a backlash about firing events in controllers, and I would guess those arguments were based on the notion that events can be used as a sneaky way of using global dependencies. Depending on the design of the event system, the party firing the event can access resources returned by event listeners, and this pattern can be abused like a service locator.

If you allow events to return resources and to be called within a component, you don’t really know a component’s real dependencies without reading the source code. Not at all does this imply you shouldn’t do it, but just that there are trade-offs anytime you reach out for undeclared dependencies at runtime.

What might give the best of both worlds is a way of injecting a dispatcher limited to a single event. E.g. make a class that triggers a particular event and depend on that. This would be best baked into the language similar to generics, so reflection could determine the event(s) needed without a bunch of boilerplate single-event objects.

Pass all the Breakpoints

When modifying a system without adequate tests, I found it helps to include debugger breakpoints in my manual testing checklist:

For each change I make, I add a breakpoint after the modified line, and won’t remove it until the interpreter has passed through it exercising the logic to my satisfaction. Before committing the changes I can pull up the list of breakpoints to make sure I’ve hit them all.

This is probably most valuable when I’ve made a lot of changes at once, or if temporary delusion is making me think I don’t need to test everything.

Caveat 1: I suppose, if there’s any parallel operations, you should also test everything with the breakpoints gone, lest the code relies on losing a race condition.

Caveat 2: In no way is this a substitute for automated tests!

Freedom by vote

I’m already seeing folks in my Twitter feed assuring themselves that Ireland’s recent marriage equality referendum could never be repealed. The danger of freedom-by-majority is that public opinion is fickle, and a shift in voter turnout can have a huge effect. No doubt large numbers of Californians against Prop 8 assured themselves that it could never pass and didn’t come out to vote.

So, for Irish freedom-lovers, pat yourselves on the back, but consider the repeal efforts a serious threat.

Update: In this case it’s unlikely the demographical and cultural shift to acceptance will swing back, and it looks like this could not be repealed by simple vote. In fact, putting it to a popular vote might’ve been a wise move even if it would’ve been non-binding; it got people talking and gave the public an anonymous way to voice their support.

Comedy Bang Bang podcast primer

For those only familiar with the TV show, the podcast eps are much longer, unscripted, at times not at all SFW, and frequently funnier than the show. I tried to pick densely funny episodes, but my favorites have more Andy Daly characters.

http://www.earwolf.com/episode/the-calvins-twins/
http://www.earwolf.com/episode/introducing-huell-howser/
http://www.earwolf.com/episode/this-is-not-me-this-is-them/
http://www.earwolf.com/episode/live-from-riot-la-2/
http://www.earwolf.com/episode/poehler-ice-caps/
http://www.earwolf.com/episode/enigma-force-five-reunion/
http://www.earwolf.com/episode/the-worlds-end/
http://www.earwolf.com/episode/halfway-to-china/
http://www.earwolf.com/episode/penises-abounding/

Sometimes liberty is finite and must be redistributed

The Civil Rights Act was a triumph of people willing to recognize that, to increase the liberty of black Americans, you had to reduce the freedom of whites to practice discrimination. By 1964, the 1st Amendment’s principles of freedom of association and federalism (emphasis mine):

… had been used as weapons against black Americans, and esoteric concerns seem less important than being unable to eat or get a hotel you’re willing and able to pay for as you drive across your own country. This sort of adherence to principle at the expense of the tangible freedom of millions of African Americans sent a clear message of whose liberty received priority.

Of course the unwillingness of motels and restaurants to serve blacks was just the tip of the iceberg.

Obamacare is also redistributing liberty. Millions of Americans once shut out of the health insurance market (who could otherwise pay) are now able to gain coverage, which is a huge deal. Of course, there was no way to do that other than to force insurers to accept them, which requires the other two legs of the stool.

The first piece above also confronts libertarians for not seeing the world as it is, by embracing a view that racism has abated to the point where it doesn’t affect the daily lives of black Americans. Unfortunately this view is in no way limited to libertarians and couldn’t be more wrong. When people think that government interference in markets or taxation are the major things that blacks have to fear, they’re going to propose policies that are hopelessly out of touch with the real world.

Related: Ta-Nehisi Coates talks about the damage done by housing discrimination:

Elegant racism is invisible, supple, and enduring. It disguises itself in the national vocabulary, avoids epithets and didacticism. Grace is the singular marker of elegant racism. One should never underestimate the touch needed to, say, injure the voting rights of black people without ever saying their names. Elegant racism lives at the border of white shame. Elegant racism was the poll tax. Elegant racism is voter-ID laws.

…If you sought to advantage one group of Americans and disadvantage another, you could scarcely choose a more graceful method than housing discrimination. Housing determines access to transportation, green spaces, decent schools, decent food, decent jobs, and decent services. Housing affects your chances of being robbed and shot as well as your chances of being stopped and frisked. And housing discrimination is as quiet as it is deadly. It can be pursued through violence and terrorism, but it doesn’t need it. Housing discrimination is hard to detect, hard to prove, and hard to prosecute. Even today most people believe that Chicago is the work of organic sorting, as opposed segregationist social engineering. Housing segregation is the weapon that mortally injures, but does not bruise.