Sunday, December 13, 2009

Amazon Mechanical Turk Perl Library Error


I've been playing with Amazon Mechanical Turk for a project, and I think it's really, really powerful.  So far, I've done a bunch of research and some tests using the Requester UI, but have not yet dug into the API.  But, over the past few days, I've finally started my research and experimenation using the API directly.  However, my very first time trying to use the modules that Amazon published, I got a big error:



t/01-ListOperations.t ..................... Can't locate object method "new" via package "Net::Amazon::MechanicalTurk::Transport::RESTTransport" at /Users/dviner/.cpan/build/Net-Amazon-MechanicalTurk-1.01-1kIAvQ/blib/lib/Net/Amazon/MechanicalTurk/Transport.pm line 21.


This error message was repeated a few dozen times.  Also, in searching for the problem, I found this StackOverflow issue: Perl module Net::Amazon::MechanicalTurk failing tests.

I find it pretty amazing that Amazon hasn't fixed this problem.  But, after doing a bunch of searching and sniffing around, I couldn't find any solution at all.

So, I made one of my own.  Here's a short patch that will allow the Net::Amazon::MechanicalTurk module pass all it's tests.  Most will be skipped with the message:


skipped: Configure Amazon AWS Authentication to enable tests against Mechanical Turk Sandbox


If you want to try to get those to verify, you must make a file named mturk.properties in the current directory.  In that file, you must list your access key and secret key as well as the turk service URL and API version you are using.  Here are the sample contents:


access_key: your-access-key
secret_key: your-secret-key
service_url:     http://mechanicalturk.sandbox.amazonaws.com/?Service=AWSMechanicalTurkRequester
service_version: 2008-08-02


Note that even with this file in place, several of the tests still fail.  I'm not an expert on the Turk API (yet), so I'm not sure how to fix the other errors that occur.

But hopefully this patch will help people.  Feel free to contact me if you find additional changes that should be made to the library.

Wednesday, December 2, 2009

jQuery, tables, and administrative interfaces

A few month ago, I posted about using Jquery to re-imagine simple things. Recently, I've been working with jQuery and jQuery UI quite a bit - in particular in building simple administrative interfaces.

Simple admin interfaces almost always require a table of stuff - users, comments, posts, actions, jobs, whatever - the "things" being administrated. jQuery has a really cool plugin called TableSorter that makes it's incredibly easy to convert a simple HTML table into a fancy, easy-to-read interface.

TableSorter even has a simple pagination capability (see the demo here). The current version (2.0.3) of the paginator requires that you have an html element of class "pagesize" which defines the number of items to display on one page. But the code doesn't actually do an error check to see if that value doesn't exist or if the value is NaN (javascript's fancy way of saying the value there is not a number). So, here's a simple patch to apply to the jquery.tablesorter.pager.js file which will perform the validation & error check.

I found one other drawback of the paginator. By default, the paginator will display something like "1/103" for the current page number and the total number of pages. But, the current code is somewhat limiting. You can change the separator ("/" by default) between the current page number and number of pages, but that's about it. In addition, the code will invoke jQuery's .val() method to display the resulting string. This is also really limiting, since not all elements support using val() to set their contents. For example, invoking .val() on a element does nothing.

So, here's another patch to apply to the jquery.tablesorter.pager.js file which will allow you to register a callback function. By using a callback function, you can control the display as you see appropriate. The callback function is passed 3 arguments:
*func (config, page_active, page_total)
The config parameter is the internal configuration information from the paginator, but the really useful parameters are the other two. page_active is the currently displayed page number. page_total is the total number of pages.

Here's a sample of how you can use the callback:

jQuery('.tablesorter2')
    .tablesorter({ 'widgets': ['zebra'] })
    .tablesorterPager({
    'container': jQuery("#jq-pager"),
    'size': 20,
    'positionFixed': false,
    'updatePageDisplayFn': function (config, pg, total)
    {
        jQuery('.pagedisplay_nice').text('Page '
            + pg + ' of ' + total);
    }
    });

This sample code results in displaying the pagination information like this:
Page 1 of 103
in the text area of all elements with the class "pagedisplay_nice". In my HTML page, I have a simple span element in a different place on the page, which looks like this:
<span class="pagedisplay_nice" />
This provides a massive amount of flexibility for the user of TableSorter's Pager plugin.

Hope this helps!


Visible Networking

Recently, Tony Karrer posted an article where he described a pretty interesting new idea - which he termed Visible Networking. I think this concept is really cool. I've always thought that we should use blogs to have more open debates on issues, thoughts, etc. Too often, blogs seem like a one-way broadcast about something - but I think that the most interesting ideas and thoughts are identified and refined in the course of a dialog, not a monologue.

So, I'm going to ask Tony to start visible networking with me. I'm not sure exactly what that means or how it will play out, but I think it's worth trying!

Tony, what do you think?


Tuesday, November 3, 2009

Crazy Business Idea #27

Occasionally, I think of crazy business ideas. I have no idea if they are practical, but they're fun to imagine. Today, I thought of another one.

Imagine a plugin/widget that enabled a DVR to replace ads in a program with ads from a different decade - of your choosing.

I thought of this while watching the original V miniseries on SyFy. It's from the early/mid 80s. The hair, clothes, special effects, everything is awesome. Then I thought - imagine if, instead of the crappy Levitra ads or whatever garbage is showing now, they showed commercials from the 80s that are roughly in time with the show's original airing? How cool would it be to see a Members Only ad, or a Kool-Aid ad with the giant pitcher of Kool-Aid, or one of the original Nest-e Plunge ads, or a Sunkist ad from the 80s! That would be awesome! I'd actually pay attention to the commercials just for the kitch factor.

From a business perspective, it'd be hard because you'd need to obtain the commercials from the early 80s. I have no idea if those ads are laying around in some storehouse or not. And, if they are, would the companies allow you to use them? Maybe... It's cool brand advertising for long-lived brands. So, maybe they'd pay a similar price for the 80s ad as they would for the modern ads.

From a tech perspective, there are several problems. Assuming you can find the original ads somewhere, you'd have to digitize them for delivery in modern cable signals. This is probably feasible assuming they exist. Also, there's the issue of the set-top box integration. You'd need some way to detect that an ad was about to display, and intercept the display in order to show something else.

I don't think that's possible currently, but I could be wrong.

The UI aspect wouldn't be too hard... at the start of the show, or in a persistent configuration setting you could pop up a small dialog window asking from what decade you want to see ads. Actually, I would love to see ads from the 60s. I'm too old to have ever seen the cigarette commercials on TV, but having seen some clips, they totally rock.

All in all, I doubt this is a viable business, but it would be so cool.

Friday, October 23, 2009

ImageMagick, CentOS, and PHP

Ever wonder how to get ImageMagick to work well in a PHP environment on CentOS?

I have done it a few times, and here's a simple recipe to follow. I use this recipe when I have yum managing the basic libraries, but not managing the libraries in active use on the site (like php, apache, perl, imagemagick and a few others).
% sudo yum install libX11-devel
% sudo yum install libjpeg libjpeg-devel
% sudo yum install libpng libpng-devel
% sudo yum install libtiff libtiff-devel
% # download ImageMagick from ftp://ftp.fifi.org/pub/ImageMagick/
% ./configure --with-perl=/usr/local/bin/perl
% make
% sudo make install
(make sure that /usr/local/lib is in the /etc/ld.so.conf.d/*.conf files)
% sudo /sbin/ldconfig

Now image-magick is installed.

To Use in PHP
% sudo /usr/local/bin/pecl install imagick
% sudo vi /usr/local/lib/php.ini
% sudo /etc/init.d/httpd stop
And that's it. Hope this helps.

Thursday, September 24, 2009

Cool event in LA for entrepreneurs

Just wanted to pass the word on a cool new event coming up. It's a
workshop put on my the DealMaker team which also brings you the
Strategy Series and Startonomics. I've been to several of these
events, and I have to say that they are really, really good - very
high signal-to-noise ration. Here's the next big thing they are
putting on here in LA.

Details are below. Enter "STARTUP LA" in the ""how did you hear about
The Workshop" and get $20 off!

Seats are limited, and from the speaker/mentor list, this event
promises to sell out fast! Check it out!
https://undertheradar.wufoo.com/forms/apply-to-attend-the-workshop/

Official Info

THE WORKSHOP: October 6, 2009. 1:00pm – 6:00pm
This hands-on "workshop-style" event will allow entrepreneurs to drill
down on the key issues we face when laying the foundation to build and
fund their company. http://dealmakermedia.com/the_workshop.html

The Workshop is your chance to get your hands on actual cap charts and
term sheets.
Ask questions, get answers.

Tuesday October 6, 2009 | 1:00pm - 6:00pm
Microsoft LA | 333 S. Grand Ave. 33rd Floor, Suite 3300 | Los Angeles, CA 90071
Parking: Joe's Auto Parts:
220 So. Hope
(Microsoft will validate)


WORKSHOP MENTORS:
* Charles Halloran, Attorney, KPPB
* Dan Gould, VP Technology, Fox Interactive Media
* Dave McClure, Founders Fund
* Daniel C. Burnham, Partner, Strategic Law Partners
* Frank Addante, CEO, Rubicon Project
* Jason Nazar, CEO, DocStoc
* John Babcock, Partner, Rustic Canyon Partners
* John Suh, CEO, Legal Zoom
* Kent Goldman, Principal, First Round Capital
* Jeff Tinsley, CEO, Mylife
* Mark Suster, Partner, GRP Partners
* Richard Wolpert, Partner, The Mailroom Fund
* Seth Sternberg, CEO, meebo
* William Quigley, Partner, Clearstone Ventures

SESSIONS – What You'll Learn:

Romancing the Deal: Getting to "I do" And Getting What You Want
Only fools rush in to venture money, and for good reason –
underestimate the bargaining power of your target investor, and you
may just end up with a broken heart. Before you jump in, you need to
understand the strategies and tactics of negotiating a funding round
and it starts with the first date. Get tips from successful founders,
lawyers, and VC's on the moves that lead to "Mr. or Mrs. Right Money".

Determining Need vs. Greed
We've all heard the horror stories of taking too much funding and
diluting your value. This session will help you determine how much
financing you actually need, explore alternative financing options
every entrepreneur should consider, understand the investor's math,
and protect your (ass)ets along the way.

Equity Structure
Equity structure is one of the most important and most misunderstood
factors of starting a company. With numerous legal, investment, and
strategic impacts, implementing a solid equity structure is a
prerequisite to success. How should you divide equity among employees,
and even more importantly, how can your equity structure affect your
legal rights, venture outlook and exit?

Team, Board, & Advisor Compensation
How can you determine the right combination and levels of compensation
plans for your team, board and advisers? What are the legal landmines
and loopholes you should know about? How have VCs' successful
portfolio companies structured compensation packages? We'll help you
understand the ins and outs of incentive plans and choose the right
mix for your start-up.

Term Sheet Negotiation
Think you've mastered the term sheet? Think again. In this session
you'll get to walk through an actual term sheet with a VC,
entrepreneur, and lawyer to find the quick sand and learn how to get
around it.

Working with Investors, Advisors & your Board: What to Watch Out For
In the beginning, everything is happy-go-lucky...until something goes
wrong. What could you have done in the beginning to protect against
explosions, and how much leeway to you really have? We'll discuss how
to structure investor and adviser relationships so you have maximum
control, as well as how to effectively manage your investors and
advisors in the good times, and bad.

APPLY TO ATTEND!
Tickets are limited. Entrepreneurs will be given priority access to tickets.
https://undertheradar.wufoo.com/forms/apply-to-attend-the-workshop/

Potential consulting work in Los Angeles: Drupal-based

A client of mine (based here in LA) is in need of Drupal expertise very soon (in the next few weeks). The project is a consumer-facing Q&A site that is in open beta now, but in need of additional work in the coming months.

Please contact me if you're interested.