Wednesday, March 25, 2009

There is nothing wrong with your television

I've been watching episodes of Outer Limits on hulu lately. I just got through the new(in color) episodes that were posted, and contemplated watching some of the old black and white ones. But, then I noticed something. The new episodes are around 44.5 minutes. The old ones are around 51.5 minutes. Comparing a few other old shows to modern ones shows the same tendancy. Basically, it seems that, for either half-hour or full-hour shows, people ended up having twice as many commercials in there.

Interestingly, I can watch either one now, and I will watch about the same amount of commercials, maybe slightly longer for the slightly longer show. Either way, it's somewhere around 2.5 minutes for a 44.5 minute show. 2.5 minutes. If it was 15.5 minutes, I could most likely find a torrent and put up with some of that hassle. 2.5 minutes is hard to beat though when you include all of the hassle that can come with that.

Overall, watching Outer Limits on hulu does not have the same effect. First of all, it's anytime you want, instead of at 2AM when you're already a little tired and in "what was that?!" mode. Second of all, they don't control the horizontal, or the vertical. The can't expand one single image to crystal clarity. When I watch, I change tabs (especially during those agonizing 2.5 minutes). This feels less like being defeated by the show's intro than actually changing the tv channel. I am controlling what I see, and I can skip the intro, because it's just creepy. And suprisingly, the actually show is almost not creepy at all when you cut out the intro.

The first statement though, "There is nothing wrong with your television." That one's interesting, and raises a few questions. Why do I have to watch 6 times as many commercials on it than on hulu? Why are there so many channels, and so little quality?

Often, what media you consume can be a defining feature. In high school, this was simple. There was one kid I was friends with almost strictly due to him watching the Simpsons every Sunday. Comedy Central was only in some lucky areas, so in the early days of South Park, those kids got to be so much cooler than everyone else.

What now? Well, everything pop sucks, and everything not pop is... well, most of it sucks too. I'm not sure how to abstract this problem, but to characterize it, here's something that happened recently. Someone asked me "what music do you like?" My mind is completely blown by the scale of that question. The last three albums I acquired were the following. Mediafriend- "I don't feel like this is happening", Oasis(an American folk band)- "Oasis", and Anamanaguchi- "Dawn Metropolis."

The first album I bought from a guy at the Somerville Fluff Festival. He was selling a cassette decks mounted on cigar boxes with switches to control the the playback speed of the tape. The CD cost "$5 or whatever." Oasis is a band from the early 70's that Pandora recommended, after listening to lots of annoying stuff. The album was being sold on a website from 2001(and it shows), but the links to buy it were all dead. After an hour of google searching, I found a blog that linked to a download on megaupload or something. The third, is a chiptune band that my friend recommended.

So what do I say? I like weird stuff? I like things that take serendipity to find? I don't know.

Despite not having to watch commercials, it seems to take more energy than before to define, or at least describe myself through media that I appreciate.

Thursday, March 19, 2009

WRDD and FRDD

In his rails class, Matt Knox mentioned a development ideology that may have only been used by accident before. He called it WRDD (web request driven development), in the style of TDD or BDD. Basically, you run an unfinished site live, and make the pages as people find their 404s. Taken further, this idea could be extended into FRDD, or feature request driven development, where the site has no original intention.

Of course he was joking, but I'm wondering if there isn't some merit to it, at least as an exercise in speedy iterations. It makes me think. Basically you have three things to worry about. The first two are the things you need, content, and a place where the content goes. Third, you need a way for users to communicate with you about what they want.

This might be an actual good case for firef.ly. They can communicate where things should be, it doesn't get in the way, and you can have on record who said things when.

I can't see it working too well for commercial purposes, but hobbyists and students might get some benefit out of working this way. A contest or class organized around this could be quite interesting.

A web-design version of pig anyone?

Monday, March 9, 2009

Platoon for NES


http://vgmaps.com/Atlas/NES/Platoon-Stage1.png

Wow. This is really reassuring. I thought that sucking at Platoon when I was 7 had something to do with me being stupid or a terrible soldier or something. Turns out that, just as I remember it, everything DOES look exactly alike, and there's no reason that I should have known what to do. I guess the best that I can hope for is that the designers were trying to make some commentary about the Vietnam war being unwinnable.

I really enjoy that I'm old enough to be crotchety about video games now. Why, in my day, we had games that made no sense, where you died constantly. And we LOVED it! Our controllers had cords! Personalized avatars? Ha! Two choices: red guy or blue guy. Both 7 orders of magnitude more bad ass than you'll ever be. Memory cardsjavascript:void(0)? A memory card is writing down your password on your mom's recipe book, and hoping to god you remember which ones are 1's and which ones are l's when you put it in next time. Or you start the game over. And god help you if that game is Willow.

Hard Stuff in Ruby- Part 6: Method Missing

What is method_missing? It's a way of enabling your code to figure out what to do when a method is called that isn't defined.

Under normal conditions, this will throw a NoMethodError:

"a string".some_method

Throw this in:

String.class_eval "def method_missing(methId); puts methId; end;"

Now "a string".some_method returns "some_method".

Sweet. How is this useful? It might be irresponsible to throw one of these in everywhere you can, because everything could inexplicably without some error handling. Nonetheless, basically, you get a nice system for handling some big chunks of the unknown.

One of the areas where I'd thought it might be useful is with a DSL for music. Say you're handling an arbitrary amount of accidentals with a note. g.b makes sense. So you define a .b method for notes. Okay. What about double b? g.b.b should be fine. Looks a bit odd. g.b(2), that is awkward, and it might be best to reserve a numerical param for other data such as octave, chord type, etc. An options hash would do the trick, but it could look a little more natural to a musician if it was g.bb, right? THAT is what method_missing can do for you. Interpret the number of flat symbols and pass that off to the function that does the work. Neat

Okay. So that's it for the Hard Stuff in Ruby list. I don't think that this series demonstrates or necessarily provokes brilliance, but I hadn't seen a list of hard topics, with just basic explanations anywhere else. The docs can be incomplete, and most blogs usually focus on more "interesting" (inaccessible to mortals) applications of different topics. There are some exceptions, but a good deal of what I've seen.

Getting over the hump is crucial though. It's the difference between either understanding someone's presentation (or blog) or not.

Till next time


Hard stuff list:
-Metaprogramming
-Blocks
-Lambdas
-eval methods
-bindings
-Singleton
-Method Missing

Sunday, March 8, 2009

Hard Stuff in Ruby- Part 5: Singletons

Okay. There is some weird stuff with this one.

The simplest application is that you can use it to overwrite class behavior on a specific object.

def instance_of_object.method
end

What else? It might look like this:
class << instance_of_object
def method
end
end


This has been described as an essential technique for metaprogramming, but the low hanging fruit is very basic. If you want an object that doesn't necessarily tow the line according to it's class, use one of these.



Hard stuff list:
-Metaprogramming
-Blocks
-Lambdas
-eval methods
-bindings
-Singleton
-Method Missing

Hard Stuff in Ruby- Part 4: Bindings and eval

Bindings and eval are advanced topics. For starters, get into irb (or rails console), and try a basic eval statement:

eval "t = 'lksjafsdn'"

same exact result as just typing:

t = 'lksjafsdn'

But there is one main difference in function. You can also pass in a binding object as a second parameter. What is a "binding?" It's the context where the code is evaluated, so you can still access variables in those contexts. So you can pass around a context, return it from a function, etc.

Okay, so what else can you do with a binding? You can change it. Let's say that you are trying to see inside of an object that you created. Just use cb(Object,class,etc.) So now your inside the object, and instead of saying "self.method_name", you can just say "method_name". So naturally, just typing "self" returns the object that you are demon possessing. Freaky.

You can keep changing the bindings, but if you leave your main context without saving it somehow, there's no way back.
or is there...
Whoops. Just kidding. Here we go: cb(TOPLEVEL_BINDING)

Either way, this is still worth checking out. It gives a few other interesting options for dealing with this kind of stuff:
http://github.com/mattknox/repl/tree/master


If you want a good reference for basics on bindings, here's a good one

http://onestepback.org/index.cgi/Tech/Ruby/RubyBindings.rdoc/style/print


Okay, so you have a lot of specific ways to evaluate in particular contexts. Sweet. Anything else?

Glad you asked. Here you go. We covered basics of eval, but there's also class_eval, module_eval, and instance_eval.

They all act pretty much as expected. Conceptually, you can now stowaway in an object without changing your binding. The following are equivalent:

MyClass.class_eval "some code"
and
cb(MyClass)
eval "some code"



Hard stuff list:
-Metaprogramming
-Blocks
-Lambdas
-eval methods
-bindings
-Singleton
-Method Missing