Archive for June, 2006

Clickback Ad System (Rough Functional Sketch)

This past weekend I threw together an update to Kate and Annie’s Clickback project from the January Organic Marketing build-a-thon. I wrote it in ruby/rails, using acts_as_authenticated and acts_as_attachment, plus a couple of newer features like RJS, as well as Geoffrey Grossenbach’s sparklines package.

Like Kate and Annie’s original, the system provides a mechanism by which viewers can offer feedback on advertisements via a simple +/- voting system. Each vote then affects the likelihood of that ad subsequently displaying for that publisher. This feedback option is a simple but fundamentally different idea, and it makes sense from the media consumer, publisher and advertiser perspectives. Advertisers get feedback from consumers, and through the feedback their ads naturally tend to display on pages where they are most positively received. The plus/minus scores act as a fitness measure for each ad within a particular publisher space. Site owners and publishers ensure that only the most relevant ads appear on their site, not via some hip premier system, but collectively by the community members themselves. Finally, individual consumers and viewers see the ads that are likely the most relevant to their own interests, and they have a chance to participate in the ad selection process.

Clickback Thumb

Inspired by Google’s AdSense, I designed the inclusion code for publishers to be extremely simple. Including an ad is as easy as signing up and then inserting a short snippet javascript customized to use the publisher’s id. The viewers do the rest.

<script type="text/javascript">
clickback_ad_publisher = "brent";
clickback_ad_width = 728;
clickback_ad_height = 90;
clickback_ad_channel ="";
clickback_frame_border = 1;
</script>
<script type="text/javascript"
  src="http://panoramic.media.mit.edu:3000/show_ads.js" >
</script>

Pascal’s Triangle in Ruby

My solution to the Pascal’s Triangle quiz this week:

#!/usr/bin/env ruby

def center_str s, len
  n = (len - s.length) / 2.0
  ' '*(n.floor) + s + ' '*(n.ceil)
end

n = ARGV[0].to_i
rows = [[1]]
for i in 1..(n-1)
  k = -1; r = rows[i-1] + [0]
  rows << r.map{ |x| j = k; k+=1; x + r[j] }
end
m = rows.last[n/2].to_s.length * 2
n = n * m
rows.each do |r|
  puts center_str(r.collect{|x| center_str(x.to_s, m)}.join, n)
end

Sample output:

                             1
                          1     1
                       1     2     1
                    1     3     3     1
                 1     4     6     4     1
              1     5     10    10    5     1
           1     6     15    20    15    6     1
        1     7     21    35    35    21    7     1
     1     8     28    56    70    56    28    8     1
  1     9     36    84   126   126    84    36    9     1

Promise v0.1 Demo

Promise screencast

I recorded a brief (4 minute) screencast of the promise service in action as of today. This is a sketch of a public contract/promise system in which participants can create custom contracts, assume roles within those contracts, sign them, and comment on them. The idea here is that each user then establishes a set of contracts, and implicity a set of contractual relations. Since the contract expresses a relationship between a set of individuals, and information about the contract, such as dates or tags or comments, are then also applicable to the participants in the contract. It is a potentially rich, dense network. It breaks beyond social networks like myspace or facebook or friendster, because these relationships are flexibly and arbitrary, and there are expectations and requirements, more like real life.

While there are no breakthrough technologies here, I think the idea of social promises, agreements and contracts is new and worth exploring. Somehow the promise being out there, public on the web makes it more real than even a simple paper copy. There is an interesting feeling when I actually sign the thing and put it into effect. My role within the promise goes from being undoable to… fixed. Sort of scary, but powerful too. It reminds me of the first time I bought something online, when the idea was so weird and new but the actual act was fairly straighforward. There is something to this, some kernel that is worth pursuing. It’s a simple action and simple technology, but with potentially complex social ramifications.

From here there are a few easy-ish add-ons that could enhance this system and make it seem more relevant. A web service API, with URI-based identification (like open-id), would allow sites to automatically set up their community members in contracts. Also syndication and RSS/Atom feeds would make it easy to monitor contracts and promises as they happen, including creation of new ones, addition of comments, signatures and breaches. Feeds could also be used to monitor users’ participation in promises. The more public we can make this data, the more weight the binding of the participants to their roles.

One challenging problem is to find the language to express these human relationships, which are complicated enough individually, and extremely intricate collectively. As I’ve often thought before, and as John actually brought up today, law is the ultimate programming language. It is the language for expressing human systems, social, political and economic. Capturing the elements of legal language in this contract system is hard. I’ve ranged in my approaches from full programming languages like Ruby (similar in spirit to Sussman and Hanson’s scheme law system) to something like what I have in this demo, which is natural language with a few placeholder variables. Burak had a few nice suggestions for wiki-like group editable contracts, and John had some intriguing thoughts about tapping a little more into some simple language processing, a la Zork. (similar to Hunt the Wumpus, which I fondly recall from my cs106 days). The vision of interactively, socially constructing these agreements is a good one. Looking forward I’ll see what I can do by revisiting the text interface, with an expressive but compact vocabulary and instantaneous, visual feedback.