Archive for September 2008

 
 

My Thoughts on Nike+

Off and on during college, I’d spend a little bit of time each week jogging around campus. Running was something that I always enjoyed, but I was not as diligent as I would have to liked. Primarily, I attribute to my inability to stick with a consistent running schedule during school to higher priorities - working with a team on a project, studying, or working on some other assignments always took precedence. For the past several months, however, I’ve been sticking to a much more consistent running schedule. As I’ve gotten more into running, I’ve become increasingly interested in keeping statistics on my performance. I’ve recently purchased Nike+ and have been using it to keep track of my work outs. I really enjoy using the device, and I think that it gets a lot of things right with respect to tracking your workouts.

Why Nike+

When I found out that Nike and Apple were partnering up to create a device that helped runners track statistics about their workouts, I thought it was a great idea. To some degree, it was almost a no-brainer. After all, how many people typically listen to music when working out? Couple that with the iPod and you have a solid product. Unfortunately, the initial release of Nike+ required a special set of Nike shoes that included a sensor used for tracking statistics, and an iPod that contianed software for interfacing with that sensor. I wasn’t willing to ditch my existing iPod and splurge on a new set of shoes for the sake of “Running 2.0″ so, although I was very interested in Nike+, I resolved to wait until a later to see about investing in it.

A few months later, I read about Nike releasing a sports band to interface with the Nike+ sensor. My interest was sparked once again - I could purchase the sports band and a sensor independent of a pair of shoes and an iPod, and still get all of the performance measurements all for significantly less in cost. I recently purchased a Nike+ sports band and sensor, and have been using it for a little over a week now. For the most part, I’ve had nothing but a positive experience - between the device and the associated website, there’s a lot to be said; however,  I have a small list of things that I think would be cool to have in another version of Nike+.

What I like

The Sensor and the Sports Band

The sensor and sports band are obviously the heart of Nike+. After all, the sensor is responsible for tracking your performance, and the sports band is responsible for providing real time statistics based on what the sensor is reporting.

For the most part, utilizing the sensor as the sports band is a straight-forward process. Turn the sensor on, place it in your shoe in whatever way works best for you (more on this shortly), pair the sensor with your sports band, and then start your workout. Immediately, statistics of your performance will be available on the sports band. At any given time during your workout, you have access to viewing the distance you’ve run, the pace at which you’re running, how many calories you’ve burned, and how long you’ve been running. 

Thoughout your work out, all of this information is also stored in the memory on the sports band of the device so that you can connect it to a USB port on your computer. Once connected, the information is uploaded to NikePlus.com where you can see a breakdown of you work outs.

Performance Visualization

Once you’ve connected the Nike+ USB device from the sports band to your computer, the results will automatically be uploaded to your account on NikePlus.com (assuming you’ve already created an account). This is where the device really has a lot of value. 

The website maintains visual and statistical information about each of your runs. For each run that has been uploaded to the website, you have the ability to see a graph of your performance in terms of your time over distance covered. You also have the ability to access to the other data the device stores such as calories burned, average pace per mile, etc. A graph for a single run looks something like this:

On top of seeing a single run analyzed, Nike+ also allows you to review all of your runs performed using the device. These runs are displayed on a graph showing the number of runs and the distance for each run. By clicking on one of the runs, you’ll be able to view the single run graph that was mentioned above.

Lastly, the website will also keep track of the total number of workouts you’ve performed as well as how many total miles you’ve run, how many calories you’ve burned, and the average pace for the collection of workouts. This information is all visible as soon as you log in to the website.

Nike+ Coach

On top of offering you visualizations of your work outs, the Nike+ website includes a feature called ‘Coach’ that is designed to help you prepare for certain goals such as a 5k, 10k, Half-Marathon, etc. Essentially, this area of the website is nothing more than a collection of pre-set programs that aim to give you a formalized plan for preparing for one of the said goals.

Each program will provide you with a plan based on a given start date and a level of experience (beginner, intermediate, or advanced). Once setup, you will be presented with a chart for the next x-number of weeks for how far you should be running each day.

In addition to the running schedule for the plan you’ve setup, the website will also maintain how many miles are required for the total program, how far you’ve run for that program, and how far you are behind or ahead of the plan. All of this information is also presented in a clear, easy-to-understand visual format.


Sharing Statistics

Since we’re in the age of all-things Web 2.0, what would a website be without some form of social networking? Nike+ has that feature covered. Your account can be marked as private or public. Private profiles are essentially used for storing data such that only you can access it; however, public profiles will allow you to not only share your runs, performance, and other statistics with other runners, family, or friends, but will also allow you to join up in groups to to setup friendly competitions or goals with peers.

Additionally, Nike will hold various challenges for the users after which all of the information from participating users will be collected from around the globe. The results will then be published and you can see how you, or your region, or your country faired against the other participating users.

What I’d change

As much as I love the Nike+ and as nice as the performance visualization and Nike+ community is, there are a few things that I would have liked to see added to the device that would have really topped it off. Of course, I really have no complaints. If I was ever asked how I might improve or modify the existing product, this is what I would suggest.

GPS

I’m fortunate enough to live in an area where I can step out of my apartment and start running for a distance that is significant enough for my purposes. To that end, I don’t really have to spend a lot of time planning my routes - I know the approximately distance to each of the locations I’ll be running and the sports band will also keep track of that for me. If I ever feel the need to plot a slightly different course, then Google Maps ends up proving to be an easy-enough solution. Nonetheless, making the sports band GPS-enabled could provide two features that I’d think would be nice.

First, the sports band could record the route taken on your run and upload it to the Nike+ website. This would allow you to store favorite routes, share routes, or simply view various routes taken while exercising. Additionally, seeing a correlation between your performance for a given route could allow you to rate each route on a scale of difficulty. This would allow you to tailor a run based on a goal or on the type of run you’d like to perform for a given day. Furthermore, runners in a local community could share routes, find running partners, or publish their routes categorized by difficulty for people that are just starting to run or people that are looking to mix up their routine.

Secondly, having the sportsband GPS-enabled would also allow you to download a route from the website and store it on the sports band. This would allow you to easily adhere to route a with which you’re unfamiliar. On top of this, the sports band could track your progress over the given route which would then allow you to upload it back to the website and compare yourself with your own personal goals or other runner’s in the local community.

Remote Sensor Sleep

One complaint that many users have mentioned on various boards around the internet is the lifetime of the sensor. Because it runs off a small battery, users are having to replace their sensors based on how frequently they use it. Admittedly, people aren’t trying to track every movement of every day, but they may be wearing the same shoes used for exercising. If the sensor is located in this shoe, then it’s still tracking the movement. Obviously, this is detrimental to the lifetime of the sensor as it’s wasting battery when it isn’t being used for it’s intended purpose.

The sensor features a small button on the back side that allows you to toggle the state of the power at any given time, but it’s somewhat inconvenient to use. In order to maximize battery life, I turn the device on right before I run, and turn it off once I’ve completed my workout. Ideally, I’d like to be able to toggle the power from the sportsband, or would like the sensor to shut itself off once it has detected that it has been idle for a set amount of minutes.

Conclusion

For the most part, I have no complaints about the Nike+ sports band. I was skeptical as to how accurate the device would be, or how the user experience would be like when it came to using the website; however, the device, in my measurements, is typically within 5% accuracy of distance performed during a run, and the website, although fully flash, is really easy to use. Furthermore, the presentation of the content and the various features such as Coach, challenges, and program is spot on. All bonus features take a back seat to the visualization of the workouts - they are only accessible by menu items. For a device that markets itself for visualization your run, that should be the first thing presented when I hit the website and it is.

I feel like Nike got a lot of things right with the sensor and the sportsband. Sure, there are things that I’d like to see in addition to the already great feature-set provided in the device, but I don’t feel like I’m missing out on anything when it comes to using the device. Arguably, the coolest thing about Nike+ is that you can actually see how you’re performing with respect to your workouts - visualizing various metrics of a run is really cool. At this point, it’s hard to imagine running without it.

Finding and labeling all unlabeled emails with Gmail

There are three things that I love about Gmail - the fact that I never have to delete a message, the ability to search all of my email and see results almost immediatey, and the ability to label and archive my messages. Over the past few months, I have introduced a number of new labels into my Gmail account either because I have opened new accounts with other sites and/or services and I want to sort their messages, or I want to further organize existing messages. For a while, I was using the same set of filters to automatically label and archives messages; however, there have always been a couple of messages that my filters did not catch leaving it up to me to manually sort them. While I was setting up these new labels, I decided to go all out and sort a lot of my existing old mail, as well. Though Gmail’s filtering and labeling features are extremely useful, there is no feature that makes it easy to find all unlabeled messages. By using Gmail’s existing filter and label features, I came up with a way to easily find all unlabeled messages and ultimately apply my own labeling to scheme to them.

Why bother doing this?

Before going into details about how I did this, I want to explain how I generally organize all of my mail. All incoming mail from an existing service or website - be it something like the power company, a credit card company, Facebook, or Flickr - gets its own label and is automatically archived (though not marked unread). All incoming mail directly to me that does not fit in one of my pre-defined labels, sits in my inbox labeled with the current year so that I can easily archive all incoming messages at the end of the year under the appropriate label. With that said and as I previously mentioned, there are certain messages that would not fit into any of my existing filters and I wanted to fix this. Specifically, if an email landed in my inbox that was not labeled in any way, I wanted to apply the label ‘2008′ and leave it in my inbox. Additionally, I wanted to do the same for all existing emails that have missed a filter and label in the past four years. 

How to do it

  1. Sign into Gmail, click on “Settings”, “Labels”, and then click on “Create a new label” - I called mine _FILTER, but use whatever works for you. Note that this filter will ultimately be the one containing all currently unlabeled email.
  2. Once the label has been created, click on “All Mail” on the left-hand side of Gmail’s interface and then click on “Select: All” on the top of the list of messages. Also click on “Select all X conversations in All Mail”. 
  3. In the dropdown menu above the mail list that currently reads “More actions”, find the section that says “Apply Label” and then click on the filter label you just created. This will label every single email with the new label.
  4. Now click on “Settings” in the top left-hand corner of Gmail’s interface and click on “Filters” then scroll to the bottom and click “Create New.”
  5. Now, in the field that reads “Has the words:” type “label:_FILTER” or “l:_FILTER” (use ‘l’ instead of ‘label’ as shorthand) where ‘_FILTER’ is the name of the filter you just created.
  6. In the field that reads “Doesn’t have:” enter all of the labels that you current have. For example (without the quotes): “l:2008 l:Facebook l:Flickr”. Note that if your labels have spaces, you need to replace spaces with hyphens. You may also want to put “l:Inbox” if you archive all of your messages. This way, you can filter all results not stored in your inbox, too.
  7. Click Test Search. All messages not currently labeled should be returned to you. 

Once you have updated all of your previously un-labeled emails, you can simply click on “_FILTER” in the list of labels and do a “Select All” to remove the temporary label from your now-archived messages. I was somewhat surprised to find that Gmail didn’t offer a function to find all unlabeled email. Assuming that I’m not the only one that wanted to clean up my inbox, hopefully this will prove useful.

StyleShell Released

Get StyleShell

Stubbing out stylesheets for XHTML documents can become an increasingly monotonous task. Whenever doing so, I often found myself wishing that I had a tool that would traverse the elements in the XHTML and generate a stylesheet skeleton for all of the elements so that I could simply go in and edit the styles. To that end, I ended up writing one for myself.

StyleShell requires no dependencies and weighs in at 1011 bytes. It should generate valid CSS selectors given any well-formed XHTML document, and should not produce any duplicate information. For more information, check out the project page.

Styling and Profiling with Firebug

Whenever I begin working on a new web site or web page, one of the things that I do first is stub out the XHTML wireframe. For each element that I declare, I also provide the base set of IDs and class names used to identify and style said elements. After doing this, I’ll normally move on to stubbing out the base stylesheet that will be used throughout the site. I structure my stylesheets in such a way that that the order of the selectors follow the hierarchy of the DOM, include its parent element, its element type, and its ID or its first class name. I’ve found that doing this really addresses a lot of issues that come when having to maintain stylesheets.

The downside to all of this is that it can become a monotonous task. Stubbing out XHTML isn’t so bad because most layouts vary; however, stubbing out CSS that follows the structure of the markup immediately after creating it can become repetitive. To that end, I’ve been working on a small JavaScript utility, StyleShell, that mitigates having to do that. This utility traverses the DOM and automatically generates a formatted stylesheet for the markup. Because pages can become increasingly complex, optimization was key and I needed a decent JavaScript profiler in order to evaluate my work. Though there are several tools available, I ended up using Firebug’s native JavaScript profiler. Firebug’s Profiler proved to be an extremely useful tool in evaluating the performance of my script and in giving insight on the areas that could be improved.

From the start of working on StyleShell, one goal that I had in mind was that it would work as fast as possible for any given input. Because the range of complexity that can exist in page development, I knew that speed was going to be key when generating the CSS shell. All of this led to having to have a collection of test cases to throw that the script in order to see how well it traversed the DOM. For test cases, I used three HTML documents - one that was a small set of data, one that was a moderate set of data, and one that was a large set of data. Having multiple cases helps to evaluate the performance of the script based on the complexity of the data.

When I actually got to working on the script, I ended up making a few optimizations about halfway through development. Some of these optimizations included adding to JavaScript’s native Array prototype in order to utilize faster retrieval of stored data. I also sought to enhance any loops that I had throughout the code, decrease the number of required function calls, and minimize the number of local variables. During development, I ended up creating two versions of the script - one that performed data comparison in linear time (specifically, O(n) time), and one that did lookup in as close to instant time as possible (the goal being O(1)). The linear-time script also included more function calls and local variables than did the optimized version. Naturally, the optimized script was going to have a better performance rating, but I was interested to see how big the difference really was.

Prior to actually running the Profiler on the script, I also used YUI’s compressor to reduce the overall script size and to obfuscate the script to some degree. I ran the compressor on both versions of the script.

Finally, given the defined set of test cases and the two versions of the compressed script, I used Firebug’s Profiler to get some statistics on how well both versions of the script performed across all three test cases. To give some insight on the results on the performance of either version of the script, as well as Firebug’s reporting, I decided to post a few of the results here.

The performance gains were obviously huge - the un-optimized version’s total time was 2848ms with 826 function calls whereas the optimized version’s running time was 270ms with the same 826 function calls.

Overall, I really like how Firebug breaks down the data into the amount of calls to each function as well as the amount of time each function required during execution. Furthermore, it gives really good insight into how much faster and efficient a script can be if you take the time to tweak it for optimization. I still contend that there are additional changes that I can make to the script, but I’m content with its current state of performance.

I’ll be releasing StyleShell as soon as I finish up the project page for it. I’ll also update this site with some information about the script as soon it’s out.

My Thoughts on SQL Buddy

A couple of weeks ago, I stumbled across SQL Buddy - a web-based database administration tool in the same vein as PHPMyAdmin. Although I have always used PHPMyAdmin for all of my web development projects, I have always hated the user interface. Aside from feeling old and clunky, there is entirely too much information on every single screen. Nonetheless, I had grown accustomed to it and had settled on it as the best tool for the job at hand. After spending some time reading about SQL Buddy, I decided to give it a try and use it every time I needed to perform any operation for which I’d typically use PHPMyAdmin. Overall, I really like SQL Buddy.

One of the first things that you notice about SQL Buddy is the minimalistic interface. Aside from offering you only the essential options for each page on which you are working, it does a really good job of staying out of your way. It does not offer seemingly irrelevant options, and it does not try to compensate for more than it should for any given task. Furthermore, it does not rely on any fancy interfact elements - other than text links, text boxes, tables, and list items, SQL Buddy relies on little else to present its information. This not only makes the presentation very clear and clean, but it also makes the application load very fast.

Another thing that I really like about SQL Buddy is that it uses Ajax throughout the application. There are very, very few page loads that occur whenever using the tool. Whenever you click a link or load up a set of data, only relevant sections of the page change based on what you’re trying to accomplish. This gives a really seemless feel to the experience and makes it feel much more like a desktop application. On top of the slick use of Ajax, SQL Buddy also properly handles operations such as the back button. Whereas with most Ajax-enabled applications, you go back to the last previously fully loaded page whenever you hit ‘back’, SQL Buddy will return you to the previously loaded screen.

In addition to this proper handling of ‘back’ behavior, you can also bookmark whatever screen on which you’re currently working such that you can return to that page at any given time with the same data reloaded. This feature is really useful if you have several ongoing projects in that you can setup shortcuts to the database(s) or table(s) related to a given project rather than having to login and manually navigate to the proper location every single time.

Lastly, installation of SQL Buddy is a breeze. It is a simple matter of unarchiving the files to a directory on your webserver. There are no configuration files or any dependencies required. Once the files have been dropped into a directory on your server, then you are good to go.

Overall, SQL Buddy is a great tool. Aside from being lightweight and easy to install, navigating and using the application is a breeze. It runs fast and really does good job handling some of the quirks that many Ajax-enabled applications have. Though it may not be as powerful as PHPMyAdmin or offer as many options, SQL Buddy is great for a straight-forward database management tool.