Monday, May 30, 2011

Reading MIDI In From An Akai APC-20 With Ruby

A simple video describing how to use some simple code.

Saturday, May 28, 2011

Espresso-Induced Archaeopteryx Inspiration Ramble

I enjoyed the very mixed blessing of caffeine this morning. I've scaled back my espresso intake from once or twice a day to once a week or less, and although I'm aiming to get it back down to zero caffeine again (I was caffeine-free for a year and a half, and loved it) I definitely liked the sudden burst of ideas on Archaeopteryx I got as a result.

I recorded the ideas to video immediately for my own future reference, but you're more than welcome to take a gander if you feel curious.

Wednesday, May 25, 2011

Rails 3.1 Release Candidate: Specific Gem Versions

rails: 3.1.0.rc1
rake: 0.8.7
sprockets: ~> 2.0.0.beta.5
rspec-rails: 2.6.1.beta1
mysql2 (and specify that as your adapter in config/database.yml)

rake db:test:prepare is now just rake test:prepare.

You may also need to hack RubyGems to make it usable. People have also recommended downgrading to 1.7.2 or 1.6.7.

How To Fix RubyGems Deprecation Warnings

RubyGems issues deprecation warnings which can easily fill a whole screen. There's been debate about this move, but it's a waste of time debating it when the code is so easy to fix.

Go to the Ruby directory for whichever Ruby version(s) you wish to repair. Then edit the file lib/ruby/site_ruby/1.8/rubygems/deprecate.rb, line 61.

What The Fucking Hell, Wikipedia?

With belief in pig-faced women commonplace, unscrupulous showmen exhibited living "pig-faced women" at fairs. These were not genuine women, but shaven bears dressed in women's clothing.

Seriously?

I'm just wondering, because I'm curious: who shaved the bear? And how? And how often? And how much did they get paid for that?

Tuesday, May 17, 2011

X-Muppets

Tuesday, May 10, 2011

Standup Desk FTW

This is why I have one of these (and no chair to match).

Sunday, May 8, 2011

Joseph Gordon-Levitt Explains hitRECord.org

...which I am taking over the programming side of, and thereby making even more awesome.

short mp3

hitRECord did a small tour recently, which kicked off in Silverlake (Los Angeles) at the Vista Theater.



It's very exciting; the live show, more so than the site, opened my eyes to what the company was about. It validated some of my theories about the future of the entertainment industry and started me thinking about angles and avenues I'd never even considered.

Overthinking The Fast/Furious Series, Part 2

I thought I had a grand prize winner on my hands, but the competition is pretty damn good.

The Future Will Be Really Fucking Weird

It has been said that the Japanese don't always wear their hearts on their sleeves and it can be particularly hard to judge their emotions. Step in the team from Neurowear who have developed a product called 'necomimi' which takes brain signals from our emotions and turns them into visible actions rendering them in the form of wiggling cat ears.

Tuesday, May 3, 2011

Toronto, Canada: Consider Yourselves Warned!

The Crowdsourced Panopticon

Wikipedia:

The Panopticon is a type of prison building designed by English philosopher and social theorist Jeremy Bentham in 1785. The concept of the design is to allow [whomever controls the prison]... to observe all... prisoners without the incarcerated being able to tell whether they are being watched, thereby conveying what one architect has called the "sentiment of an invisible omniscience."[1]

To clarify, pan means "all" in Ancient Greek, while optic means visual or related to watching. The panopticon is a structure which enables watching everybody. It's been a metaphor for totalitarianism surveillance since long before the totalitarian surveillance states of 20th century Communism. The weirdest irony of modern democracy is that the Soviet Union collapsed, but the panopticon exists in the Western world today, and Big Brother didn't build it.

Aaron Greenspan:

were I magically given the responsibilities of the President of the United States (which I am thankful not to have in real life), the MySQL data cluster in Facebook's possession would be a national security issue. The last person I would let near it is Mark Zuckerberg, because the last thing I would want to do is endanger half a billion people.

Julian Assange:

Here we have the world’s most comprehensive database about people, their relationships, their names, their addresses, their locations, their communications with each other, and their relatives, all sitting within the United States, all accessible to US Intelligence...

It’s not a matter of serving a subpoena, they have an interface they have developed for US Intelligence to use. Now, is the case that Facebook is run by US Intelligence? No, it’s not like that. It’s simply that US Intelligence is able to bring to bear legal and political pressure to them.

It’s costly for them to hand out individual records, one by one, so they have automated the process.


Now let's take a moment to think about fast cars, beautiful women, and unnecessary explosions.



In the most recent Fast/Furious movie, Fast Five, the protagonists are a group of fun-loving criminals who steal a ton of money (literally) from a gangster kingpin in Brazil who, through corruption and bribery, owns every police officer in the country. He misuses the police as a personal army, and it's one of the main things that make him a bad guy. It's a simple way to make an effective villain, because it's horrible to imagine what it would be like if people misused the police as their own personal armies.



The irony here is that in the previous episode, Fast And Furious, the protagonist Brian O'Conner, still a member of the FBI, misuses his own modest level of power in the law enforcement system to set up a rival street racer for a crime he didn't commit. I don't remember exactly but I'm pretty sure the main reason he did it was to take the guy's car.



In some ways, O'Conner does the same stuff in the fourth movie as the stuff which makes his opponent a bad guy in the fifth.

Here's the political subtext to the Fast/Furious movies: law enforcement systems are weapons. Control of a law enforcement system is a form of power. The upper classes have no role in these movies - they simply do not exist - but let's say for the sake of argument that they fight for control of law enforcement systems by drafting laws and running political campaigns. These movies make the lower end of the spectrum their focus, where control over law enforcement systems is developed two ways: through bribery and infiltration. Insofar as these movies have a moral compass, it consists of this: Bribery is always bad guys, infiltration is always good guys. Spoiler alert: cops who turn away from law enforcement to join criminals because of a greater sense of community with the criminals is a major theme in Fast Five, and indeed the whole series. Brian O'Conner lets Dominic Torreto escape in the first movie, and he joins him as a fugitive from justice in the fourth.

That's actually as spoilers as I'm going to get, but the fifth movie develops the theme further. Hint: one of the cops is a really good-looking woman.



I suppose I should go back and add something like "spoiler alert to my spoiler alert: the upcoming spoiler alert will not contain any actual spoilers." Too late now.

Anyway, the important thing to realize about this idea of law enforcement systems as weapons, and gangs of criminals as tribes who fight over control of those systems, is that it's a dangerous idea. If you want to know how dangerous, read McMafia by Misha Glenny, or The Wrecking Crew by Thomas Frank. The other important thing to realize is that there's already a lot of truth to it.

There's a process which operates in Southern California. Illegal immigrants move into poor neighborhoods, get caught up in gangs, get imprisoned in hardcore jails, get identified as illegal immigrants by the jail administration systems, and get deported. When they leave the country, they take with them whatever skills they learned in American hardcore jails and whatever social connections they made there as well. Through this process, America unintentionally exports its most hardcore criminal knowledge and social networks. There's a gang called the Dieciocho ("18th Street") which dominates parts of Central America but is named after a street in Los Angeles. From time to time, internal investigations discover Dieciocho members on the LAPD.

18th Street cliques have been identified in 32 states and the District of Columbia in the United States, as well as foreign countries such as Mexico, El Salvador, Honduras, Guatemala, Canada.

In countries like El Salvador, the gangs start to look a lot like poorly-funded peasant armies.



Most American laws prohibiting gang activity casually violate the First Amendment by disallowing gang members from congregating in groups. Free association is one of the most important freedoms protected by the First Amendment (and most political protestors today see their First Amendment rights violated with "free speech zones" as a matter of routine).



The argument in favor of this violation, in the case of gangs, is that gangs don't congregate for political reasons but for criminal ones. If a poorly-funded peasant army doesn't look political to you, you might need political eyeglasses. I'm not sure what the rationalization would be for caging political protestors in temporary de facto jails, but I don't think it's worth listening to either.



I haven't been able to track down my source, but I remember reading that the Dieciocho had acquired serious armaments from paramilitaries in Central America - paramilitaries funded, in many instances, by United States foreign policy - and imported that weaponry back into Los Angeles, where I live. I'm not thrilled to hear that, to say the least, but at least it explains why the United States has so many soldiers whose uniforms describe them as police officers.



This blog post is too dark. I'd better find a way to make it funny.



All right. Not quite as funny as I was hoping for, but it'll work. Where was I.

Oh yeah. Facebook. No, better yet, Canabalt, then Facebook.



This is Canabalt, an indie game for Flash and iPhone.



This is promo imagery for an inferior corporate ripoff of Canabalt called Mirror's Edge.

Both games have you run from powerful, well-armed pursuit across rooftops in a sci-fi setting. Both games made me understand why parkour is a martial art.



Consider: the only President in recent memory to withstand the shenanigans of the military-industrial complex was Dwight Eisenhower, a former general. He knew the old saying "an army travels on its stomach" - which means that logistics and supply chains are the most important part of warfare - and he skipped the usual heavy investment in unnecessarily complex and expensive weaponry to develop instead an interstate highway system, ensuring that if any part of America were ever invaded, it would be effortless to create supply chains to and from any strategic battlefield.

The Interstate Highway System had been lobbied for by major U.S. automobile manufacturers and championed by President Dwight D. Eisenhower, who was influenced by his experiences as a young Army officer crossing the country in the 1919 Army Convoy on the Lincoln Highway, the first road across America....

Eisenhower gained an appreciation of the German Autobahn network as a necessary component of a national defense system while he was serving as Supreme Commander of the Allied forces in Europe during World War II.[8] He recognized that the proposed system would also provide key ground transport routes for military supplies and troop deployments in case of an emergency or foreign invasion.


If you believe the military futurists who say that the typical war of the future will be fought in a city, then it makes sense that parkour is a martial art, because if you can navigate the city during combat better than anyone else, you win.



After the fall of the Roman Empire, a whole series of feudal kingdoms and smallish empires continued using the Roman roads for thousands of years. Successor society after successor society fought their battles in the still entirely viable ruins of the great empire which preceded them. What would it look like if a successor society made up of ragged tribes fought battles in the still entirely viable ruins of the United States?



It would look like the American wars in the Middle East today. It would also look like gang warfare in any ghetto today.



And it would also look like the Fast/Furious movies. Imagine a successor society which fought battles to control not just the still entirely viable roads of a dead empire, but also the still entirely viable law enforcement system of a dead empire. This of course brings up the question of where do you draw the line between a successor society and the newest generation of an existing society, but William Gibson's Zero History raises that question so beautifully that all I'm going to say on the topic is: read it.

The good news is that now, if anybody tells you that you need to switch your brain off to enjoy these silly, fun movies, you can direct them to this blog post, and they will learn how you can enjoy these movies with your brain on as well, if you so choose. The bad news is that you might still be wondering what the fuck this has to do with Facebook.

The really bad news is that I'm wondering the same thing. OK. I remember. Misha Glenny's McMafia documents the rise of organized crime syndicates in Eastern Europe. Most are made up of, and run by, former Soviet secret police. In their days as the secret police of those totalitarian regimes, one of their major roles was controlling members of the civilian population in what these civilians said and did. There's a very poignant movie about this called The Lives Of Others which I highly recommend, along with The Book Of Laughter And Forgetting or The Unbearable Lightness Of Being by Milan Kundera. The now-mafia/former-KGB's most potent method of control was not torture or murder; it was threatening the loved ones of those who they sought to control.

So: imagine the Russian mafia seizes control of Facebook. The opportunities for extortion inherent in that dataset are horrifying. Control that database and you can trivially identify vulnerable loved ones to threaten for almost any person in America, and indeed many other countries.

This is why it is absolutely essential that we create systems, both legal and technological, to ensure secure data privacy in social networks.

Update: Overthinking The Fast/Furious Series, Part 2

Sunday, May 1, 2011

rvm/bash Hack: Hop Into Gems Directory

I love rvm, but there's one thing I miss: I used to have an env var which enabled me to hop into my $GEMS directory and edit or read gems code. Because rvm puts gems into different directories, specific to the Ruby they're installed to or indeed the gemset, you have to manually navigate there on a gemset-by-gemset basis. Typing this out manually is a bit of a heinous pain in the ass, so I fixed it.

Put this simple bash function in your profile and you can easily hop into the gems directory for whichever gemset you're in. Caveat: it assumes you're using a gemset, and won't work for a bare, un-gemsetted Ruby or for system Ruby.

Update: Foca uses a similar hack, but it runs on gem env gemdir, which'll work under any Ruby, rvm-ed or not. And CainĂ£ Costa told me you can use bundle open #{gem_name}, which only requires setting $EDITOR or $BUNDLER_EDITOR environment variables. That's actually best for TextMate, but workable in vim and I'm assuming standard in emacs, which seems more like a shell than a text editor anyway.