Sounding Off on Slots in Fells Point

On November 4th, Marylanders will be faced with a ballot referendum question about whether to amend the Maryland constitution to legalize slot machine gambling at selected sites in Maryland. No matter how you feel about gambling or slot machines, one thing is sure: this is bad legislation, and a bad way to implement it.

It’s being marketed as a mechanism to fund education, but in fact any revenues will end up in the general fund and used however the legislature sees fit. The reason it’s turned into a constitutional amendment measure is that similar legislation has already failed to pass the General Assembly for multiple years in a row. And the only way to amend the Maryland Constitution is to have a ballot referendum.

Is this really the sort of thing we want to embed in our state constitution, the same document that protects your right to free speech and to redress the government?

Today we went to the Fells Point Festival in Baltimore to talk to people about how they feel about the ballot measure, and everyone we talked to had serious questions about the details of this proposal. Watch and see how people feel.

Announcing Spinvision.TV!

Well, folks, it’s here. The new global time-waster video art project, Spinvision.TV!

Spinvision.TV

Since releasing Twittervision and Flickrvision last year, I’ve been imagining what other kinds of visualizations could be created. It was really a natural progression. First text, then photos, and now videos. It’s a trilogy of global media trivia.

Spinvision.TV takes videos from YouTube and plots them on a moving globe. The globe is provided by my friends at Poly9 and is built in Flash; since Flash includes video player capabilities, it was a matter of tweaking things to get the Poly9 FreeEarth component to work the way I wanted it to, and Poly9 was very helpful in making this happen.

We also had the idea to show night and day imagery of the earth, and I worked with Poly9 to put that together; the part of the globe that is illuminated is where it’s really day when you’re watching!

The end result, I hope, is an innovative, fresh look at “Video On Earth” and it’s a view that I hope is captivating, educational, trivial, humorous, ridiculous, and truthful.

The simple idea behind Twittervision and Flickrvision was to show the earth in a new way. I think Spinvision does that too. While there is no shortage of online video content, it seems cloistered, disconnected, and partitioned. My goal with Spinvision was to break down those walls and provide the context of place and time.

Geography may seem irrelevant today, in the age of the global Interweb, but it still matters. The content that comes from our hometowns says much about who we are. Video posted from Saudi Arabia says something that people in France or in the United States need to see. Of course, we have more in common than divides us, but we need to visualize and comprehend that. And of course, we should be aware of our genuine cultural differences, and what they really are.

On YouTube (and other video sites) it’s all too easy to watch videos from people just like you about people just like you who like the things that you like and who live in the country that you live in. While it’s possible to break out of that and watch just about anything, the user interfaces don’t encourage that.

Spinvision.TV wants you to watch outside your comfort zone.

We are seeking to partner with other video content sites besides YouTube, and would ask you to please contact us if you have video content that you would like to see presented on Spinvision.TV.

I like to think of Spinvision as a love-letter to the world, written in Javascript. I hope that you find it to be an engaging visualization of life on Earth — or at least fun!

Please help me spread the word, and thanks again for your continued support and interest!

Erlang Makes My Head Hurt

For those of you who haven’t heard about Erlang yet, it is a functional programming language (like Lisp or Prolog) developed quietly over the last 20 years by telecoms giant Ericsson for use in telco switches.

Ericsson has been using it for roughly the last 14 years; it has several properties that make it particularly relevant to many of the problems facing developers today. It’s one of the few languages that is particularly good at letting programmers take advantage of multi-core/multi-CPU systems, and distribute services across multiple boxes. YAWS, a webserver written in Erlang and a poster child of its efficiencies, kicks Apache’s tail from a scalability standpoint. This is no small accomplishment for a high level language.

Today’s scaling strategies revolve less around faster clock speeds and more around adding cores. Scaling out to many machines is also important, but power and space considerations are also more of an issue than ever before.

So Erlang is gaining ground because it addresses scalability for this new age of multi-core systems. Today you might have a dual Clovertown Xeon box with 8 cores, but very little software to take advantage of it. Once you get past 2 or 4 cores, that extra capacity provides little to no benefit. Enter a language like Erlang, and suddenly all that power becomes available to the programmer.

Some of my coder buddies, (Jay Phillips, Rich Kilmer and Marcel Molina) have been looking at Erlang for various tasks, and Dave Thomas’ blog posts on Erlang have also inspired me to take a look at the language for some of my own work.

I picked up Joe Armstrong’s book, Programming Erlang from Pragmatic Bookshelf and started reading it on a recent airplane flight.

Today I put together my first Erlang program, based on knowledge gleaned from Dave Thomas’ postings and from the book.

This very simple program grabs the top_rated feed of videos from YouTube (an XML RSS feed) and then iterates through the result set to get the profile URL for each user. It is a fairly useless and trivial example, but if I can make this work then there are other things I can do down the line.

-module(youtube).  -export([fetch_each_user/0]).  -include_lib("xmerl/include/xmerl.hrl").

 get_feed() ->  { ok, {_Status, _Headers, Body }} = http:request("http://gdata.youtube.com/feeds/standardfeeds/top_rated"),  { Xml, _Rest } = xmerl_scan:string(Body),    xmerl_xpath:string("//author/name/text()", Xml).

 get_user_profile(User) ->  {_,[A|B],_,[],Name,_} = User,  URL = "http://gdata.youtube.com/feeds/users/" ++ Name,  { ok, {_Status, _Headers, Body }} = http:request(URL),  { Xml, _Rest } = xmerl_scan:string(Body),  [{_,[C|D],_,[],Id,_}] = xmerl_xpath:string("//id/text()", Xml),  { Name, Id }.

 fetch_each_user() ->  lists:map(fun get_user_profile/1, get_feed()).

I am pretty sure I am doing this All Wrong ™.

My biggest area of confusion comes in the pattern matching that’s required to match (and thus read) the results from the xmerl_xpath:string parsing. According to Dave Thomas’ examples, xmerl_xpath should produce a #xmlText record (or a set of them) that can then be matched with the #xmlText{} syntax.

In practice, and with the Youtube API data I used, I see no such #xmlText records. Instead I get a flattened tuple from such parsing, along the lines of:

>xmerl_xpath:string("//location/text()", Xml)[{xmlText,[{'yt:location',14},{entry,1}],1,[],"GB",text}]

The only way I can find to match this is something like this:

[{_,[A|B],_,[],Location,_}] = xmerl_xpath:string("//location/text()", Xml)

I am sure I am missing some key step or concept, but that’s how we learn new languages — stumble along til we figure out how to solve the things we want to solve.

There’s an incredible amount of functionality packed into these 19 lines of code. It’ll be even more amazing when I figure out my initial questions and then add concurrent processing of the user profile URLs. In theory I can simultaneously process dozens of URL feeds from Youtube and spider their API data as though through a fire hose. Stay tuned.

Meantime if anyone has any suggestions on my current puzzlements I’d love to hear them.

Erlang is a cool language. It doesn’t give me the aesthetic fuzzies I receive from programming in Ruby, but I do get pretty jazzed up thinking about what should be possible from a performance and economy standpoint. Erlang doesn’t allow for mutable state; variables have fixed values once assigned, and algorithms are generally handled via recursion. This is how it scales out to so many cores/cpus/machines so readily. It’s kinda weird if you’re used to “normal” mutable state languages.

Whenever I learn a new language (human or computer) I generally have weird and overactive dreams. I attribute this to my brain shuffling things around to accommodate new grammar and semantics.

The last few days have produced particularly vivid dreams.