Monday, October 27, 2008

Android Market is open!

Let the awesomeness begin!

Sunday, October 26, 2008

Synchronization

I have spent the past two weeks procrastinating (to some extent) on working on my top secret project. The problem I've been struggling with is just a really hard one to solve and I've gotten quite used to instant gratification with my code. Much of what I've been working on has ended up with results by the end of a hacking session. Not so much with my current task -- synchronization.

One of the key features of the top secret project is that it is always available. Whether by a browser or a native app like an android client, the user is expected to be able to interact with the app no matter if they have internet connectivity or not. This means I have to spend a lot of time working on offline access as a requirement for letting anyone use the app. I thought I could get away with dogfooding my app while I was in Toronto, but I quickly realized that without 3G data on the phone the top secret project would just not function correctly.

One of the challenges I've faced so far is a temporal one. My first thought when deciding to do offline access was that the client would do the synchronization and call back to the server to push a canonical dataset into the datastore. After several nights of hacking I was fed up. I couldn't get the synchronzation to work at all. I found other things (like Statusinator) to work on instead.

On the flight to Chicago I had a "breakthrough" that really should have been my first thought. Do synchronization on the server side! My idea is as such:

  1. Client creates local data, assigns hypothetically-unique UUID to record, tags it as existing locally only.


    1. Stores:
      {"key": "possibly-unique-key", "value": "some-value", updated: "2008-10-27 04:41:01", "created": "2008-10-27 04:41:01", "is_pending": true}



  2. Client requests sync session with server, gets data for min/max records to sync. **All further RPCs have a sync_uuid.


    1. Client Sends:

      {"device_uuid": "some-possibly-id"}
    2. Client Recieves:

      {"sync_uuid":
      "some-unique-session-based-on-device-uuid-and-user", "last_sync": null,
      "max_checkin": "2008-10-27 04:41:01"}

  3. Client pushes record to server, is_pending to denote that the server is receiving a note with an unrecognizable key.


    1. Client sends:

      [{"key": "possibly-unique-key", "value": "some-value", updated: "2008-10-27 04:41:01", 
      "created": "2008-10-27 04:41:01", "is_pending": true}]



  4. Server processes record, changes the key to a valid server key, stores the original as an attribute on the record for future book keeping: local_id.


    1. Server Stores:


      {"key": "some-real-key", "local_id": "possibly-unique-key", "value": "some-value", 
      updated: "2008-10-27 04:41:01", "created": "2008-10-27 04:41:01", "is_pending": false}



  5. Client requests updates from the server, Server responds with all new or updated records modified serverside, along with the newly added records from step 3.


    1. Client requests, asking for all records modified after last_sync (or all records, if None) but before max_checkin.
    2. Server responds:


      [{"key": "some-real-key", "local_id":
      "possibly-unique-key", "value": "some-value", updated: "2008-10-27
      04:41:01", "created": "2008-10-27 04:41:01"}]



  6. Client parses record for "local_id" attribute, and replaces the record in the local datastore with the copy from the server, stripping the local_id attribute and removing the pending bit.


    1. Client stores:


      {"key": "some-real-key", "value": "some-value", updated: "2008-10-27 04:41:01", 
      "created": "2008-10-27 04:41:01", "is_pending": false}



  7. Client tells server sync sesison is complete, using the newest record received from the "push/pull" to specifiy the end date of the session. (just as last_sync is the start). To save a write during the server-to-client record update, the client is the one noting the end date for the session here, instead of the server.


    1. Client sends: last_update.
    2. Server stores: stores last_update as last_sync.

I haven't thought this through all the way yet, but I think this will work just fine for a google-gears based browser client just as it will work for my android client. There is something that still bothers me and I'm having a hard time scoping it out in my head: What happens when clock scews occur?

Remaining questions:
  • Do I leave around "local_id?" When is an appropriate time to strip those records? I don't want the server modifying the records withouth confirmation from the client that the info is no longer needed.
  • What are the error condtions when the sync fails at each of the above steps, how does this pattern resolve conflicts that occur when records are modified after a failed sync?

Saturday, October 25, 2008

Voting Resources

Today I spent the afternoon voting. So much voting! I'm not good at this whole thing either since I haven't done it a lot. In California you vote on many many measures at once. I'm not even sure how it was done in Illinois. I have over 45 things to vote on today and I don't think I did every item justice in research and due diligence. I'm giong to try harder next time around but for now, these are some of the resources I used to educate myself on the issues. Any other recommendations?

Tuesday, October 21, 2008

Statusinator

I've updated the first app I wrote for Android, Statusinator. It is a client that you can use to update your status and upload photos to Facebook. It will be up on the Market as soon as it is launched, but until then you can get it from the Project Homepage.

Monday, October 20, 2008

Why its a secret!

Earlier this summer I started work on my top secret project. There are three people besides myself who know what this project is. One person is my partner in crime, the second a close friend of his and the third is someone who put together the pieces based on a conversation I had had in his presence before I had even thought much about what the project would be. Well, I think that is the only people who know what the project is -- there are plenty of people who could know the same things the detective that I just mentioned realized. They might just be acting oblivious to make me feel better.

There are a few reasons I want to keep what I'm working on a secret. The first thing is that, well, I thought I had a pretty unique idea. Treating this project like a job has had a great impact on my desire to follow through. Its an attitude that has propelled me along.

The second reason though, that I don't tell is simply that if you talk about something too much without acting on it, it becomes just a figment of discussion. Like a dream, but even worse because just having the idea isn't as interesting as a dream could be.

Third, keeping the project a secret makes me feel cool. Neener neener. I know, you don't. This means you ksw.

Fourth, if I don't tell anyone what the project is, then when I change things around becuase I have a new idea or because I just don't have the talent to accomplish what I originally set out to do nobody is any the wiser.

Fifth, so I can keep people in suspense and excited about hearing what I have to say, instead of them having to listen to me rant and rave about specific technical challenges that I've been facing.

I'm writing these things because I'm at the point where I really want to tell people what I'm working on. I'm having a bit of a crisis of confidence and a bit of a lack of excitement about the (hard) tasks coming up. I spent the afternoon today staring at documentation for various code libraries I might use to implmeent a feature I feel is needed for launch but I'm not really excited about writing this part. This is part of the reason I've been mentioning needing additional help on the project. There are parts of it that I don't feel very interested in. I lack the experience to make it awesome or unique -- This, though is one of the *key* components of my project and I really can't launch without it.

Saturday, October 18, 2008

Losing Some Steam

Oh no! I just realized the other day that some of the core code in the Android side of my Top Secret Project is going to have to be re-written. I am very sad about this and have started to lose a little steam. It doesn't help that I've spent the past two weeks letting the feeling linger while I hung out with friends in Toronto. I have one week before I'm back in Chicago for a bit and while I don't think I'm going to be able to make my app launch-ready by Wedensday (The G1 Launch Date) I feel like the app *is* coming along to some capacity. I sometimes dream of having a team of Engineers working with me on this project, all as dedicated as I am. If that were true, the past two weeks, each and every one of them would have written a total of 0 code for the app. I guess its a good thing right now that I'm not running a startup or anything like that. Who ever heard of a startup stopped because some crazy country up North decided to abscond the dude in charge?

Tweets for Today

  • 11:50 @superabbey see ya there! #
  • 13:51 Soap box derby is so crowded! #
Automatically shipped by LoudTwitter

Thursday, October 16, 2008

Tweets for Today

Automatically shipped by LoudTwitter

Wednesday, October 15, 2008

Tweets for Today

  • 19:06 Saw the dark knigh toy story. Pretty good. #
  • 19:39 @saydiana mmmmm.... scotch!!!! I'm drinking canadian beer now. #
  • 02:34 Canada conspires against me leaving. Closes exit to highway 427. next on the 5am news. #
Automatically shipped by LoudTwitter

Tuesday, October 14, 2008

Tweets for Today

Automatically shipped by LoudTwitter

Monday, October 13, 2008

Tweets for Today

  • 08:33 Rise Against writes really good rock hooks. #
Automatically shipped by LoudTwitter

Sunday, October 12, 2008

Tweets for Today

  • 21:55 Answering questions on the android-developers group while walking back to my hotel... nerd. #
  • 22:12 Left by laptop bag on the sidewalk an hour ago ... taxi'd back, still there. Thanks for being low crime Toronto. #
  • 09:03 Who let "whoa" back into music and where do they live? #
  • 09:19 Not a fan of "Hero of War." #
Automatically shipped by LoudTwitter

Saturday, October 11, 2008

Tweets for Today

  • 11:42 New rise against is great. #
  • 13:41 Workin in my favorite environment... coffee shop... but in Toronto. Kensington Market is highly recommended. #
  • 16:04 Haunted toronto walking tour. #
Automatically shipped by LoudTwitter

Tuesday, October 7, 2008

Tweets for Today

  • 16:12 Radio is still terrible. Using my phone instead of the car radio for tunes. #
Automatically shipped by LoudTwitter

Sunday, October 5, 2008

Tweets for Today

  • 13:11 Shoe museum in toronto is actually kind of cool. #
Automatically shipped by LoudTwitter

Saturday, October 4, 2008

Tweets for Today

  • 12:57 When using amex, do you try/except or if/else? #
Automatically shipped by LoudTwitter

Friday, October 3, 2008

Tweets for Today

  • 19:21 In Toronto. Now what? #
  • 12:27 @dknowles2 Now go finish your stared items... #
Automatically shipped by LoudTwitter

Thursday, October 2, 2008

Catchup with two hands

its been six days and its time again to leave SF for a new place. I'm going to be in Toronto until the 15th. I'm in for work but ahould have plenty of time for fun. Heck, as I'm good at doing, I am in Toronto over a 3 day weekend too.

I have taken this whole week off of work, including Friday but excluding part of monday. In that time I have  been able to catch up on several months of life. I got a haircut, went clothes shopping and had several Hendricks (great gin, thanks for the recommendation josebiro) Martinis. I have also added a few more needed features to the top-secret prokect and am still looking for someone to do some UI design work, I could also use someone who is interested in mobile applications, python, java and/or javascript because I think I need more people to work on this if I'm going to get this completed in any reasonable amount of time.

On one hand, I see that I am making steady progress. Every day that I sit down and focus on it, I walk away at the end with something newer and better than before. On the otherhand, some of the ideas that propelled me to work on this project seem so far away in the future that I'm worried ill never get to the cool problems that will make this project stand out. Heck, I've no doubt pumped some people (including myself) up about this and I'm sure it won't meet anyone's expectations.

On the other hand, I'm still happy about the work that I have completed, I just wish it hadn't taken four months to get here. My thought is that in the next few days ill start using the app on my own and see if in its current state it is usable. If not, I'm going to have to take a hard look at what it will take to make my project get there. if not I will have several months of rewrite ahead of me and I will surely have lost the first to market edge.

Tweets for Today

  • 23:19 @superabbey yup not great day. #
  • 23:20 @schrierc MSI is great. #
  • 23:21 @saydiana pics or it didnt happen. #
  • 23:27 Anyone interested in working on a top secret cool project? Java, python and javascript skill required. Hurry, apply now. limited time offer. #
Automatically shipped by LoudTwitter

Wednesday, October 1, 2008

Tweets for Today

  • 14:09 if anyone asks, i fell down some stairs. #
  • 14:11 @noisebridge congrats on the new space! i can't wait to come visit when i get back in town! #
  • 14:45 damnit, why is it when i say shortened haircutters think i say cut all the hair off they can? #
Automatically shipped by LoudTwitter