Sunday, January 23, 2011

Facebook API calls with Javascript

The social networking app I'm writing with my would be mentor requires integration with facebook.  Given the ubiquity of javascript, I decided, what better way to integrate with facebook than through their Javascript SDK?

FB.ini({
});

While testing a simple case I encountered a frustrating error where facebook api calls seemed to simply stop functioning -- no init's, login information, graph api calls, no nothing.  There wasn't even an unsuccessful login session object returned.  And it seemed as though nothing had changed.  I was ready to blame facebook, but after a little bit more debugging I discovered the cause:

<pic to come>

All facebook javascript sdk calls with a specific app ID must be made from the same domain as the canvas url.  This is very possibly a manifestation of the same origin policy, a rather stringent security necessity for Javascript.  In any event, with that discovery, I was able to continue testing.  However finding the cause of the bug was quite difficult, since facebook's own error response for the issue was virtually nonexistent, and many forums confused the cause of the lack of function with erratic facebook code state.  Ultimately nothing beats personal debugging

Finest Beating of My Life .. So far

You seen his portrait downstairs?  


Yesterday I took my green belt test for Krav Maga.  It was grueling through techniques encompassing kick defenses, punch defenses, reactions to hair grabs, bear hugs, reverse headlocks.  I had already gone through two and a half hours and 2 t shirts ... and then we got to the sparring portion and things just got sadistic.


The dreaded sparring portion of the green belt test is infamous for absolutely beating the crap out of everyone who takes it, and I can personally attest to this.  I'd been supplementing my usual krav maga classes with fight classes for a few months and luckily that kept me from being reduced to pure pulp. For an hour and what seemed like forever, I was rotated in and out of a shark tank and had to stand and fight people well past the point of my endurance.  I think I literally collapsed after my turn in the shark tank, but then had to pull myself together for the rest of the test.  More than once I thought of how obscene it was that I was paying for this abuse.  But now that I've had a little bit of time to think about it, I think I see the value of such abuse: if you can make it through something that tough, then a lot of things in life are that much easier.  Toughness in people is a quality I really respect and so if I can summon it in myself, it boosts my self respect as well.

At the very least, the next time I get hit, instead of thinking 'ow', I can think 'oh heck, this isn't as bad as my green belt test'

oh yeah, and hopefully I passed.  I still haven't found out

Monday, December 27, 2010

Social Networking App

I'm currently aiding in the creation of a social networking app.  My responsibility is setting up the facebook app component.  My knowledge of web technologies is becoming more apparent as I continue on this project, however the skills I gain will be invaluable.  The other project member is tracking his development on his blog so I shall do the same

Monday, December 6, 2010

Sunday's Thai Pad Combo

Start with left right, right straight, left hook, right uppercut

bob on the right, the right straight left hook and a right round kick

add a sprawl and a knee on the way up

Tuesday, November 30, 2010

Quoteable Quotes

I'm a merciless quoter and teller of anecdotes.

I heard these two today, both related to Bush's:

"Poor George. He can't help it - he was born with a silver foot in his mouth" -- Ann Richards

"Some people are born on third base and go through life thinking they hit a triple" -- Barry Switzer


Monday, November 29, 2010

Pack Light!

On the traveling note, one skill I've tried to pick up is how to travel light.  This first started right after I moved to LA during a (hasty and quick) trip to Scotland.  I was going to be in Scotland for just a little over 4 days, followed by 6 days in Seattle.  Speed was a necessity so I was determined to figure out how to make the trip without checked luggage. 
Undoubtedly the most useful site for my journey was One Bag.  A significant component of my traveling method, the bundling packing approach, comes from that site.  It has far more information than I discuss here, so if you leave this post and go straight to one bag, I won't be offended.
The most obvious way to pack is don't take what you don't need.  I have a smartphone, so I don't need to bring my laptop.  An e-reader would remove the space needed for paperback books -- but I take books anyway (probably breaking my own travel light mantra).  Most soaps I get on the other end, so I keep toiletries to a minimum of utility items like combs, toothbrush, tweezers.  If you need a towel, get a travel towel, which folds into a space smaller than a book.  I was skeptical but the damn things work; though be warned, if you fold em up wet and forget about them for a few days they're going to smell like hell. 
Packed and Ready

The MVP of my traveling is without a doubt my bag.  My bag is a Red Oxx Air Boss, based on a OneBag recommendation.  I had a little bit of sticker shock when I bought it but it's worth every dime.  The bag is sturdy and spacious and combines nicely with bundle folding.  It holds everything I need for a 4-5 day trip, and any more can be supplemented with a smaller companion bag, which still falls within carry on limitations.  The dimensions of the bag allow it to fit in overhead storage with ease, and on shorter trips I've been able to fit it between the overhead bin doors and another suitcase.  I wish everything was built this well!
Bundle!

within the bundle!
A technique I keep mentioning is bundling.  Bundling is how I fold my clothes for travel -- again I must cite OneBag for putting me on to this technique.  Basically it involves folding your clothes over each other until they all fit in a wrapped up bundle the size of a pillow.  Not only does it allow for an impressive clothing to space ratio, but the tight bundle helps prevent wrinkling as well.  It is quite easy to fit many days worth of clothing inside a reasonable bundle (in the bundle above I have 3 sweat shirts, 1 dress shirt, 2 pairs of pants, 5 t-shirts, and a pair of shoes). Below is a diagram for this technique. 

  
Altogether I haven't had to check a bag in years.  It makes traveling quicker, easier, and with the increasing frequency of back checking costs, cheaper!

Tuesday, November 23, 2010

Travelling

Tomorrow night I'm hopping on a plane to Seattle for the Thanksgiving holiday.  With weather conditions in Seattle, it'll be like flying from spring into winter.  I hope I won't freeze, having acclimated to the warmer Los Angeles climate.

Since I've moved to Los Angeles, I estimate I've flown to Seattle 10 times over the course around 16 months.  That looks pretty frequent, but it owes to a couple of factors.  A, I like Seattle and I don't mind going back.  It's close.  B the flights are convenient from an airport about 10-15 minutes away from work, and I can take flights out on a Friday night and return on a Monday morning.

I always figured I'd start making these trips less and less frequently as I'd lived away longer, and while numerically that's not that case, psychologically it's starting to feel that way.  I'm no longer actively planning and anticipating the trips as far in advance as I used to as my weeks and weekends become more full here.  The cumulative changes to my home city are growing each time I return and my new city is becoming more familiar.  My friend Travis McCoy once said to him new places started to become home when they became the place you returned to.  In my mind I'm still making an active choice that LA is not my home, just where I work and live, but I do neither of those is Seattle so that idea will erode.  I've often likened Los Angeles to a black hole, where routine and inertia can pull you in and never let you out.  I may get stuck in the well too eventually.

But as far the next 24 hours, I'm landing (hopefully) in Seattle, blazing into what my friends there are calling Snowpocalypse, Snowmageddon, and my favorite, SnOMG!