Monday, August 19, 2013

eBay Gripes

It was, however, not so obvious that PayPal would taste its first major success by helping people sell Beanie Babies on eBay. - Eric Ries

I've never sold or bought anything on eBay.  I've had lots of people ask me about how it works and I've always told them I don't know, because I don't know.  Many years later I've gotten around to listing 1st Generation Apple TV and my 17" PowerBook G4 on there.

When comparing to other similar listings it makes me sad.  People get a lot of money for these things by filling them with illegal content.  So I see AppleTVs overflowing with pirated movies or PowerBook G4's overflowing with Microsoft Word, Adobe Creative Suite 4, etc.  They selling description lovingly details all of the illegal content and then says, "Content/Software is unlicensed and for demo purposes only.  It is the buyer's responsibility to remove it."

My devices are completely wiped with a fresh install.  The PowerBook G4 has Panther, complete with pinstripes.  I listed them and I even got a $49.99 bid on my AppleTV.  I was stoked about this.  Then 3-days into my auction they got delisted and I was told to call eBay.

I called and they asked me a bunch of identify verification questions and some basic questions about the items I was selling to see if I stole them or not.  Seriously?  I'm selling 5-9 year old electronics with their original boxes for very little money.

They relisted my items - but they are new actions and the bids were lost.  I sure hope someone will bid again.

Sunday, August 18, 2013

Home for the Max

Most people who work at home find they do not have the benefit of receptionists - Judith Martin

I finished up my last week going into the office until Max shows up. Ever since coming back from the Hawaii vacation, I have been going into the office every single week to try and keep on top of the loads of work that keeps piling on. But no more.

Mrs.Chaos is about T-Minus 28 days from the due date - so I'm here to keep a close eye on her. We're working on the final touches at home. The cosleeper is installed next to the bed and it's great for holding my iPad. The carseat base is installed into the back of her car. The hospital bags (labor and post-partem) are both packed and ready. Since the beginning of the year we've joked that if a baby showed up we had a room to put him. Now if a baby shows up - we're prepared for his entrance.

The only thing left on the schedule to complete is Mrs.Chaos' ambitious cityscape cabinet. It's doing great. Everything is cut. Most things are painted. She just a few more layers of paint to go and then it will be time to screw the entire thing together - and that will be the most exciting part. Hopefully we can get it done in the next week or two.

Wednesday, August 14, 2013

Episode.Next and Web Workers

I finished up all the main development tasks for Episode.Next and submitted for Facebook and Dropbox approval.  Both systems approved the app within 24 hours.  I was expecting Facebook to give me a harder time.  Reading through all of their usage guidelines for the "Watch" action, it is really meant for a website like Netflix or Hulu to post the action and provide a link to where you can watch the show.  I am redirect to TheTVDB.  Anyway, it passed.

As I was once taught as an engineer, get it working first, then optimize.  After I got it working there were two major performance issues related to syncing: 1) calling to the Dropbox API to sync everything there and 2) calling to TheTVDB to check for new episodes.  Each of those was taking about thirty seconds.  JavaScript is, by definition, single threaded.  So while those things were doing their thirty second sync, the entire UI was blocked.
I thought I could use Web Workers to solve this problem.  This was the promise of web workers.  Have a long background task you need to execute?  Just use web workers.  The challenge I ran into was that Web Workers exist in their own security context without any access to the document and can only communicate with the main thread by posting Strings back and forth.  I wasn't able to get the Dropbox JavaScript libraries to work inside of the web worker, so I gave up on that approach and went back to the tried and true method.  I made all the syncing operations iterative.  Then I would do one iteration and use setTimeout to surrender control and get it back as soon as the UI thread did some stuff.  I'm still having some problems, so I'm thinking of increasing the log.
I'm still having a great time.

Sunday, August 11, 2013

The Wire Watcher

You can write amazing Web 2.0 and Ajax apps that look exactly and behave exactly like apps on the iPhone. - Steve Jobs
You know how Infomercials start out the same way? "Does this happen to you every time you want to make an omelet?" and then someone tries to flip an omelet and the egg explodes across the entire kitchen and catches on fire. I feel like app pitches start off by saying, "you know how you always have a problem?"  Generally you hear that and think, "I don't have that problem."  Then you tune out.
I built an app.  I built a "scratch your own itch" app.  I watch a bunch of different shows across various sources: Netflix, Hulu.com, NBC.com, ABC.com, etc.  What I needed was a way to keep track of all the shows I was watching, what was the next episode I wanted to watch, and let me know if that episode has aired yet.  Oh - and one more thing, when I mark it was watched I want to post that to Facebook--the same way GoodReads posts when I read a book.  I figured this would be a pretty easy app to build and I whipped together the first version in about two weeks (maybe 20-30 hours).
It's a webapp - but I'm working extremely hard to make it look and feel like a native iOS app.

HTML5 Boilerplate - I started with the HTML5 Boilerplate template which gives a basic HTML layout that is optimized for mobile websites.  It contains links for all the iOS startup screens, Windows Phone 7 Series, all that good stuff.  I've used it as my starting point for my web projects.
Dropbox Datastore JS - While I'm using HTML5 Local Storage for most of the local stuff, I wanted a place off of the device to dump the data and to be able to sync between devices.  I'm using Dropbox Datastore JS to do this and it's fantastic.  It syncs across devices, it's all JavaScript, and I don't have to write an authentication layer or host any server-side code for it to work.
The TVDB -  Love these guys.  This is a creative commons, open source, community managed television database.  It contains episodes, images, and a full API for access.  The challenge with it is that all the pages and the API don't have CORS headers, so I can't make direct calls to it from my webapp.  The pages don't have Facebook Open Graph tags, so I can't post Facebook "Watch" actions directly to it.
Google App Engine - To work around the two limitations of The TV DB I'm using Google App Engine.  I have a very bare minimum of code hosted there.  I proxy the calls to The TV DB from my web app and insert in my API key on the backend.  This is nice because it protects my API key.  I also proxy all the pages to the individual shows and episodes so that if they are requested by the Facebook OG crawler they return proper tags and if you click on them from any other browser they just take you to the TV DB.
For now everything is working properly.  I've submitted it to Facebook for them to approve the OG action.  My expectation is that FB will deny it, but we'll see how it goes.  For now I'm excited.  It's been a long time since I wrote an app that was more than a simple utility.

Sunday, August 4, 2013

I Love You Dropbox Datastore!

With the Datastore API, structured data like contacts, to-do items, and game state can be synced effortlessly. - Dropbox
I had been meaning to play with the Dropbox API and I did and it's awesome.  These days the main types of apps I build for fun are client web apps that run entirely on the phone.  I use HTML5 local storage to fake having a place to store stuff.  That works okay for little bits of data, but I can't really store a lot because you might switch to another phone or you might clear you cache.  What I've always wanted was a nice place on the web where it was really easy for me to just cram some user settings.
So when Dropbox mentioned they had released an app API and that there was a JavaScript API interface my heart raced!  RACED!  It's been out for a few weeks, but I finally got a chance to give it a spin and it is EXACTLY what I have always wanted.  It's amazing!

I've been working on a web app that lets me tracked all of the TV shows that I'm watching and what episode I am on and I've needed a way to sync it across devices.  I was going to build some simple back-endy stuff on Google App Engine, but this just solved my problem.  Within about 15 minutes of work I had Dropbox API working and was syncing my app data into Dropbox.  SO AWESOME!