Unboxing of My Vibram Five Finger Bikila’s

From the front Ever since I read my buddy John Hornbeck’s description of the Vibram Five Fingers I have been interested in both how they feel and can I use them for more than just walking around in.  Last Fall I picked up a pair of the KSO’s at a local shop, which allowed me to both try them and find the right size since they go by numbers rather than typical American measurements for feet.  After wearing them around for a while I grew to love them, which is what my other Vibram wearing friend, Geoffrey Simpson, said would happen.

I used my KSO’s to walk around in at parks or go to the store (yes people looked at me strange), but never got into running with them because of the overall feel of the the KSO’s.  I read about blisters and rubbing when used for more strenuous exercise.  So when the Bikila’s were announced on the Vibram’s Birthday Shoes Blog I got very interested in getting a pair.  Turns out they were really difficult to get and still are with only a few retailers carrying them.  I missed the first time they were on sale by a few hours and couldn’t get my size (42), but the second time I saw them being sold online last week I snatched up a pair from City Sports.

On Monday of this week they arrived at my doorstep and I proceeded to open with glee and take some photo’s of the unboxing.

Box All Nice and Packaged First One Out Underside Into the Toes A pair makes 2 From the front Underside #2 This Little Piggy... Put your right foot in From the side Reusing the Box Box Explored

On Tuesday morning I headed to the gym for my first short run (2mi) in them to see how I would adjust to barefoot running style over my regular running shoes.  More on that experience in another post

Meet Rory “Zsa Zsa” Vernon

Ahhh! Where did that come from? Last week Kristen from Atmos Communications (http://atmos.tv) sacrificed herself and her phone to rescue Rory from a storm drain after she was jumping into save her sibling from drowning.

On Saturday I took over as the proud owner of Rory and have spent several days with her.  She is being adored, played with and has a healthy and loud purring engine.  Expect to see a bunch of pics in the coming months as she grows from being the current 7 weeks old kitten into an awesome pet.

You can view all the images on my Flickr account.

More photos:

The claw chooses who will stay and who will go What's that? Hey let me eat in peace Nom Nom Nom Me likey blanket Ooo Ball!

Limit Facebook’s Sharing Of Your Data

If you haven’t heard already Facebook announced a new way to share your data with outside websites and building a “Social Graph” of your friends, likes, etc…  Most of us are ok with our friends having information about us, but not too thrilled about sites your friends visit getting information on you.  I didn’t see many posts on how to change your Facebook privacy settings to limit or turn off the sharing of your data to partner sites or even blogs so I made a step-by-step guide below.

1. Choose Privacy Settings under the “Account” Menu

2. Under privacy settings choose “Applications and Websites”

3. Choose “What your friends can share about you”

4. Deselect anything you do not want shared.

That’s It.

How I Lost Over 50lbs

Since about October 21st, 2009 I have lost over 50lbs and continue to do so. I went from being a borderline diabetic overweight programmer to a guy who has completed 3 indoor and 1 outdoor triathlon sprints, several 5ks and a 50 floor stair climb. I went from a 46″ inch waist with a 56″ inch chest to a 38″ waist and 46″ chest in 6 months and if I can do it, you can too!

During the last few months I have been asked countless times what was my inspiration, how I did it, or what’s my secret. I hope this post gives some answers and possibly guidance for others. Before I start please note: this worked for me, but may not work for you.

So how did it all start? Like most things in a man’s life, it started with a beautiful woman who I was dating at the time. She got me thinking about getting fit and losing some weight, mainly because I felt she was way out of my league. She also got me used to getting up at 5am to get going to the gym on a daily bases, not an easy task back then, just ask my mother. Our relationship didn’t work out, but I am thankful for her getting me started on the path towards where I am now.

I had a very bad relationship with the gym and exercising in general before October of 2009. Yes, I had a membership to St. John’s in Tulsa, but went a few times every two weeks it was never a lasting and fruitful relationship between us. My relationship with the gym has since grown and if I am away for more than a day my body starts telling my brain it’s time to make a trip.

Now that you have a little background here are my first 5 tips for getting fit:

1. Commit to 5+ Hours a Week to Fitness

We all would like exercise to be quick and easy and ads on TV tell us all you need is 20 minutes a day 3 days a week to get fit.  They could be correct, but they are averaging that over a years worth of running on their crazy machine or aerobics video.  Getting fit takes a serious time commitment.  When I first started I was going into the gym for an hour every 3 days and sometimes a fourth day.  Now I spend 1-1.5 hrs a day 6-7 days a week at the gym, running or biking.  Sometimes I go to workout in the morning and swim in the evening when training for a triathlon.  Exercise has become my second job and has had an effect on my social life, but the physical benefits have been worth it and you will feel the same way.


2. Expect to Spend Money / Buy the Right Clothes, Shoes, Etc..

Since October I have spent over $1,000 on clothes, shoes, supplements, gym membership and event fees.  That doesn’t even include the money spent on buying new clothes that fit me. The only thing that has benefited from my weight loss is the Goodwill as I give them bag after bag of things that no longer fit me.  When I started my workouts I wore basketball shorts and a t-shirt and an old pair of running shoes I have had since college.  Now I go with a breathable shirt, lightweight shorts or triathlon shorts and fitted running shoes.

Clothing
Everyone of us has an old t-shirt that we paint in or workout in, which is great in the beginning, but getting a breathable shirt that allows air to freely hit your body is great.  Sure t-shirts work, but wouldn’t you rather have the fan behind you whisk away your sweat and cool you down rather than have a cotton t-shirt wet and sticking to your back?  Especially when doing a workout in the sun, having a shirt that is light weight is worth the $20 cost at the local athletics store.

Shoes
I cannot stress enough how important it is to get the right running shoes for you and going to a local running store (I recommend Fleet Feet Tulsa on 51st and Yale) to get them.  Most will film you running and match the right support for your arch and step.  I had terrible support and needed to get special shoes and add super feet inserts, yes they cost me around $180, but the benefit I get is I have yet to have any pain while or after going on runs because my feet are supported correctly.

If you are biking or doing spin classes, make sure you have biking shoes with clips on them.  They allow you to not only push down while pedaling, but pull with the opposite leg at the same time.  You will build more muscles and have a harder workout using clips.

Supplements
When I started I only took a multivitamin every day.  Now I have fish oil, multivitamins, protein shakes and muscle/workout powders to give my body the energy and nutrients it needs to sustain a 6 day a week workout.  They all cost money and some start at $80 for a small container that lasts you 45 days, but I find that they all have helped me enhance my workouts and more importantly keep me from being sore.


3. Buy a Heart Rate Monitor

You will see me at the gym always with my Polar F6 on with my heart rate strap under my shirt.  I rarely do any workout with out it on.  I have said to friends I live and die by my heart rate, which isn’t the complete truth, but I do focus on it more than the actual excercise I am doing.  What does a heart rate monitor tell you?

First of all it keeps track of your calories burned during your workout tailored to your weight, age, and resting heart rate.  Is it perfect at your burned calories? Nope, but far better than the bike machine at the gym.  The HRM I have keeps track of daily and weekly workouts and the total calories burned.  There is sometime really special about seeing on Monday morning that last week I burned 3400+ calories.

Also most HRMs keep track of your “zone” which is your lower and upper HR for maximum efficiency.  Being able to see that zone and stay within it is a very helpful tool during workouts or training. For instance if I am going over my top HR by about 10 or more BPM then I’m not going to be able to maintain the level of exertion I am currently at. If I am under my “zone” I know I have more in the tank and should get my legs moving faster.


4. As Time Goes On Don’t Be Afraid To Change Your Goals

Like I said above, I lost weight quickly in the begining of my journey, but then in February I plateaued and didn’t start losing weight again until the middle of April.  Instead of  working on losing weight still I shifted my goals to being better and faster at running, swimming and everything I did.  I focused on my times and my heart rate during my exercises and worked to keep in my “zone” and maximize my workout.  I also changed from just going for endurance to building up the muscles in my legs specifically the ones that would benefit me in running and biking.  I actually gained weight for a while as I saw my legs muscles grow and since I changed my focus from weight to being better, I wasn’t phased by the weight gain.


5. Find A Partner to Join You

When starting out having someone by your side going to the gym or going on a run can be all the difference. They keep you accountable and get you going.  There is something powerful about not letting down your friend and getting out of bed at 5.30am to go run on a treadmill for 30 minutes.  If you don’t have a friend who is interested go join a Couch-to-5k group or head to Fleet Feet Tulsa near LaFortune and join their fun runs in the evening.  I guarantee you will make friends and want to go each week.

You can use sites like DailyMile.com to find friends in other cities and track your progress.  They have system to encourage your friends and vice versa.  I have been able to keep track of friends progresses and nothing makes you feel bad like seeing on the day you took off from the gym your friend just ran 10+ miles, I’m talking about you Shawna :)

Do you have a tip to share with me or have a different opinion about what I mentioned? Share it with me in the comments below.

Remember: It doesn’t matter if you are walking, running, skipping or crawling finishing any workout or event is winning no matter what place you come in.

My Quote of The Day

“Your confidence defies logic.” – Brad Vernon

Titanium Mobile Synchronous Network Request Workaround

While using Appcelerator’s Titanium Mobile for a Mobile App I am developing in partnership with a local company in Tulsa, OK I found that there is no support for synchronous network requests.  This can be trouble some if you are wanting to follow DRY (Don’t Repeat Yourself) coding and using a JavaScript based framework/library in your app.  I found a solution that works for the app I am developing and wanted to share with other developers.

Note: This code is written for Titanium Mobile 0.9.x.

What is the issue?

Here is an example of a typical XHR request based on the KitchenSink example application:

1
2
3
4
5
6
7
8
var xhr = Ti.Network.createHTTPClient()
xhr.onload = function () { 
       Ti.API.log('I should be first'); 
};
// xhr.open(METHOD, URL, ASYNC_Request(BOOL));
xhr.open('POST', "http:example.com/getData", false);
xhr.send();
Ti.API.log('I should be second')

The result in Titanium’s Log is:

'I should be second'
'I should be first'

Notice that the “I should be second” is called before the “I should be first” is called. This is due to the asynchronous request not stopping the script from running while a remote request is being processed. This stops the ability to create a general app-wide function that processes your Network request since it will finish and return the function before the XHR request data has been returned.

This requires a lot of copy and pasting of your XHR code for every request you make which if you have a change to make you are going to be spending quite a bit of time searching through your code to fix a problem.

What are our needs?

For our app we have a “common.js” file that has all regularly used functions in it. This allows us to follow the DRY method and limit the lines of code written. Since all data for our app is coming from a remote API call for every function in the app we will be making a remote call, processing the data and displaying the results to the user.

When making a XHR request we have the following needs for each request made:

  1. Set the current API URL
  2. Set the headers to get JSON data from the API
  3. Set the headers for Authorization
  4. If an error occurs either force a login or display error notification to the user
  5. Process the data – returned in JSON string so it needs to be converted to JavaScript Object
  6. Return processed data to the original js function call

What is the workaround?

Simply put: Callback function.

First step create a common.js file that contains the wrapper function for XHR requests. Note: we ran into issues including this in the app.js so a separate include file seems to do the trick best. I included some extra functions we use to show the portability we have been trying to achieve.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
var apiServerUrl        = "http://example.com/api/";
var apiKey              = "&apikey=demoApp";
 
/**
*  Create new Object (mainly for name spacing purposes
*/
var myFunctions = {}
 
/**
*  create a full URL with server, path and API key
*/
myFunctions.prepUrl = function(path) {
    return apiServerUrl+path+apiKey;
}
 
/**
* reusable XHR function
* method: GET / POST
* path: local/ads
* data: object
* callBack: function to call when request is complete
* failMsg: array to pass to myFunctions.notice when request fails for Alert
*/
myFunctions.remoteRequest = function(method,path,data,callBack,failMsg)
{
    json = false;
 
    // create new Network Client
    xhr = Ti.Network.createHTTPClient();
 
    // get the full url to API server
    url = myFunctions.prepUrl(path);
 
    xhr.onload = function(e)
    {
        json = myFunctions.jsonParse(e.responseText);
 
        // 
       // this is the function to call in the main javascript file
       //
        callBack(json);
        return true;
    };
 
    xhr.onerror = function(e)
    {
        myFunctions.networkError(xhr.status, url, failMsg);
        return false;
    };
 
    xhr.open(method,url);
 
    xhr.setRequestHeader("contentType","application/json; charset=utf-8");
 
     // set authentication
        username = Ti.App.Properties.getString('username');
        password = Ti.App.Properties.getString('password');
        xhr.setRequestHeader('Authorization','Basic '+Ti.Utils.base64encode(username+':'+password));
 
    if (data == undefined) {
        data = false;
    }
 
    xhr.send(data);
}
 
/**
*  Parse JSON data - could be replaced with JSON2.js library
*/
myFunctions.jsonParse = function(json) 
{
    return eval('(' + json + ')');
}
 
/**
*  display alert to user
*/
myFunctions.notice = function (msg,title)
{
    Ti.UI.createAlertDialog({
        title: title,
        message: msg
    }).show();
}

The key to the above is the callBack function parameter that is passed to the networkRequest function and call in line 41.

Now for the login.js file that Titanium is using to display the current window modal view to login a user.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Ti.include("common.js");
 
var win = Ti.UI.currentWindow;
 
win.setBackgroundColor('#fff');
win.title = "Login";
 
var actInd = Ti.UI.createActivityIndicator({
    bottom:10,
    height:50,
    width:10,
    style:Ti.UI.iPhone.ActivityIndicatorStyle.BIG
});
 
var u = Ti.UI.createTextField({
    id:'username',
    value:'',
    color:'#336699',
    returnKeyType:Ti.UI.RETURNKEY_NEXT,
    keyboardType:Ti.UI.KEYBOARD_ASCII,
    hintText:'Email Address',
    height:40,
    clearOnEdit:false,
    fontSize:20,
    borderStyle:Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
    clearButtonMode:Ti.UI.INPUT_BUTTONMODE_ALWAYS,
    top:40,
    width:250
});
 
win.add(u);
 
u.addEventListener('return',function(e)
{
    p.focus();
});
 
 
var p = Ti.UI.createTextField({
    id:'password',
    value:'',
    color:'#336699',
    returnKeyType:Ti.UI.RETURNKEY_GO,
    keyboardType:Ti.UI.KEYBOARD_ASCII,
    hintText:'Password',
    height:40,
    passwordMask: true,
    clearOnEdit:true,
    fontSize:20,
    borderStyle:Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
    clearButtonMode:Ti.UI.INPUT_BUTTONMODE_ALWAYS,
    top:90,
    width:250
});
 
win.add(p);
 
var submit_button = Ti.UI.createButton({
    id:'submit_button',
    title:'Login',
    color:'#336699',
    height:32,
    width:100,
    fontSize:12,
    fontWeight:'bold',
    top:150
});
 
win.add(submit_button);
 
var navActInd = Titanium.UI.createActivityIndicator();
win.setRightNavButton(navActInd);
 
var label = Ti.UI.createLabel({
    top:10,
    color:'#777',
    height:'auto',
    width:300,
    font:{
        fontSize:15
    }
});
win.add(label);
 
/**
* This is where the networkRequest function is going to be used.
*/
submit_button.addEventListener('click',function(e)
{
    u.blur();
    p.blur();
 
    if (p.value.length < 1 || u.value.length < 1) {
        myFunctions.notice("Please enter both username and password", "Login Error");
        return;
    }
 
    navActInd.show();
 
    failMsg = ["Username/Password Failed", "Login Error"];
 
 
    r = myFunctions.remoteRequest("GET","user/verify?",false,callBack_login,failMsg)
 
    if (!r) {
        navActInd.hide();
        return;
    }
 
});
 
/**
* Once the XHR request is complete this function will be called.  You can put all your post data display events within this function.
*/
var callBack_login = function(data) {
    Ti.App.Properties.setString('username', u.value);
    Ti.App.Properties.setString('password', p.value);
 
     navActInd.hide();
 
    Ti.UI.currentWindow.close();
    Ti.UI.close();
}

In line 103 we call the myFunctions.remoteRequest() function. Notice that the callBack_login does not include ’s.

So far this solution has been working great for our development. We hope to see Titanium Mobile support synchronous requests in the future, but our current modular development allows us make the switch quite easily.

I am open to any questions or comments that you may have about our solution.

ZendCon 2009: Day 1 Review

Yesterday was the first official day of talks for ZendCon 2009.  After last year I didn’t know if I was going to take the plunge this year and attend this year due to my distaste for ZendFrameworkCon that I experienced last year.  After one day I can say that this year’s conference has been great.  Great talks (mostly), great people and a great location.

This year I have been participating in the IRC backchannel (#zendcon on freenode), Twitter and Google Wave with many of the fellow ZendCon attendees.  They make it possible for me to hear about what is happening throughout the conference and in the case of Google Wave I can view the notes taken in all of the different talks I wasn’t able to make it to.  Sometimes after reading the live notes I wanted to leave my session, but overall so far I have enjoyed the talks.

Here is the list of what I made it to yesterday:

  • Planning for Synchronization w/ Browser-Local Databases
  • Xdebug – PHP Developer’s swiss-army knife
  • Il8n with PHP 5.3
  • Enterprise-Class PHP Security
  • Seven Steps to Better OOP Code

The keynote about the cloud after the ZCE lunch was less than interesting, but thankfully the IRC chat made it exciting. I’m looking forward to the PHP Framework shootout tomorrow, which I expect will be the best Keynote of the conference.

Last night ended with going to the local bar Firehouse which is part owned by my friend from when I still lived in San Jose.  Ended up running into several friends I haven’t seen in over 3 years and catching up with them, which was great.  Still hurting a bit this morning from partying last night, but I made it to the breakfast and keynote this morning.

Now on to seizing the day!

Tagged: Seven things that probably you may not know about me

Luke Crouch tagged me with the first internet meme of 2009 so hear goes with 7 things u may not know about me:

  • In 5th grade I had a small solo singing part in a school play. (I only wanted to get out of class for an afternoon and ended up getting picked)
  • In 1998 I legally changed my last name and now carry on my mother’s maiden name.
  • In 1997 I was featured in Fast Company magazine in the article Little Hands Teach Big Hands (note: article uses my old last name).
  • For two years (‘04-’05) I taught computers at an elementary school in San Jose, California.
  • My favorite beer is James Squire Amber Ale, but I haven’t had one in over 3 years (not sold in Oklahoma).
  • I was raised as a Christian Scientist.
  • I have owned my own business, Shark Media, since I was 17 years old.

I’m calling out/tagging these peeps:

Update: I guess the undocumented rules state you can’t tag people who have already been tagged, so I’m down to 5 people.

ZendCon 2008: Day 2 Review

Yesterday I finished up my second day at ZendCon and learned a few more things:

  1. ZendCon should be renamed to ZendFrameworkCon for next year
  2. Most talks are high-level presentations and very few show the code that matters to me and presumably most programmers attending
  3. Terry Chay is still one of the best presenters I have seen (note: I did not count the # of swear words he used, but if you want to check search for #tcfc on Twitter
  4. I clearly need to learn how to use SPL and Iterators more in my code
  5. Selenium and PHPUnit are testing suites I need to work more with and properly implement
  6. I finally have a reason to move to Zend Studio 6 over Zend Studio 5.5 that I have been using for the last two years
  7. You can control a presentation using your iPhone
  8. The Ajaxian guys not only make a great website and podcast their presentations are beautiful.

Here are the sessions I attending on Wednesday:

ZendCon 2008: Day 1 Review

Yesterday I attended the first day of 2.5 days of ZendCon 2008.  This was the second year I have attended and much more relaxing knowning that I do not need to take a test this year.  Last year I became a PHP5 Zend Certified Engineer (ZCE), this year I got a shiny grey ribbon attached to my badge.

I sat in on the following sessions:

As a whole the day was much more involved and more content than last year.  The two sessions that stood out for the day were Distribution and Publication With Atom Web Services and The Knight Rider Methodology to Software Development which if you know Ben Ramsey or Eli White you know why I enjoyed their talks the most.  Eli was even able to incorporate The Hoff in his presentation, which I’m sure thrilled the German attendees. I’m looking forward to using the Atom publishing and can finally see the difference between RSS 2.0 and Atom and why the developer community has been on the Atom side.

Twitter is being used by several of us heavily and you can view all messages from attendies using the following hash: #zendcon

I have gathered lots of info and looking forward to using the information I have and will learn this week during my talk at TulsaTechFest 2008.

More tomorrow.