Self-Awareness through Measurement
Posted: July 07, 2011 by Ryan BrightOver the past few days, I’ve developed an addiction with the self-tracking movement and have begun brainstorming various metrics that I’d like to start monitoring at a more granular level. These brainstorm sessions have generated an exceptionally long list, so I’m limiting myself for now until I’m able to optimize my methods.
Since analysis is only as effective as the tools that are used to perform it, I’ve spent some time researching some good ones for the job(s) at hand. Here’s what I’ve come up with so far:
-
DailyBurn provides a great set of tools for planning and tracking your workouts, meals, and overall health. I’ve added all of my favorite exercises to reflect my typical workout routines so that I can easily log my progress after I leave the gym each day. I’ve also been logging every serving of food that I eat to help me conquer the dreadful eating habits that I picked up during college. As an added bonus, DailyBurn sends me periodic emails to let me know which nutrients are lacking in my diet along with a long list of foods I can eat to supplement those nutrients. I highly recommend this one for anyone that wants to get into shape.
-
Sleep Cycle is an innovative alarm clock that uses the iPhone’s accelerometer to determine what phase of sleep you’re in throughout the night and wake you up when you’re going to be least groggy. I’ve been able to crudely estimate the number of hours I’m in bed each night (not many), but this tool allows me to measure the quality of sleep that I’m getting so that I fully understand the reasoning behind my morning coffee rush. This one’s probably going to be difficult unless you’re sleeping solo or in a King-sized bed, so it may not be for everyone.
Sleep graph from July 5-6
-
Wakoopa provides insights into how you spend your time on your computer. It runs silently in the background of Mac OS X, Linux, and Windows and tracks the amount of time you actively use the various applications on your machine. At the end of each day, the website generates a usage report that allows you to visualize which categories you spend the most time on throughout the day. While I’ve become quite aware of my habits since I started using Wakoopa in 2007, it’s always helpful to know that I could spend a little less time using Adium. :)
Usage breakdown for the week of June 20
-
Using pen and paper allows me to make quick notes about my workflow (and lack thereof) when I’m at the office. Each time I get distracted by wonderful web goodies, I note the times that I lost and regained focus. Each time someone wanders into my cubicle to ask me a question, I note their times of arrival and departure. Hour long meetings? Noted. At the end of each day, I enter all of these times into Google Calendar so I can visualize my work day and better estimate my level of productivity. Today, I was only shooting 51.08% and really fell off the wagon after lunch. I’m hoping that continued analysis can help me determine my prime productivity hours throughout the day and also allow me to accurately measure and increase my capacity for SCRUM planning.
These tools work great on their own, but I’m currently working on a more centralized solution that will leverage the APIs of each service to display the information that I’m most interested in. Additionally, I plan to build a few simple tools to assist me in recording and displaying various metrics that are more difficult to automate.
Next up on my self-tracking list:
- How strong is the correlation between my mood, diet, exercise, and sleep quality?
- How do my blood pressure and heart rate change as my diet changes?
- How does listening to music affect my overall productivity at work?
Stay tuned!
Blogging with Jekyll and Git
Posted: June 26, 2011 by Ryan BrightIn recent years, social media like Twitter and Facebook have allowed me to communicate my ideas in small, palatable bites of information. This format was revolutionary (no pun intended) for the conflicts in Egypt and Iran, and it’s allowed me to bitch about traffic and my university with stunning efficiency. Though, there are still times when I’d like to convey a longer or more complex message to the handful of people that might stumble upon my web presence. While Tumblr has served as a happy medium for some, I don’t feel that we’ve fully eluded the need for traditional, robust blogging platforms like WordPress and TypePad.
But I don’t want to use WordPress. I may dabble in the art of spewing my thoughts and opinions on the Internet, but let’s face it – I’m a programmer. For me to write paragraphs of content that may never be read by another human being, my platform needs to be covered in peanut butter to hide the fact that I’m generating content written in human-readable language. Enter Jekyll.
Jekyll is a static site generator that allows me to build my blog using the tools that are already a part of my daily workflow – MacVim, Git, and Ruby. All markup, styling, and extensions are written using my own tools, so I can be sure that the only spaghetti code being generated on my pages will be something that I have written myself. Additionally, I’m able to manage the content on my blog by tossing it all into a Git repository that can be pushed to my server. There’s nothing quite like “git reset –hard” to crumple a sheet of digital paper, eh?
Many people have written about how to migrate from WordPress to Jekyll, so I won’t bother trying to oust these great tutorials. However, if you’d like to integrate Git into your Jekyll workflow, I’ve provided a simple shell script to help you get started. The script is executed each time a push is made to the remote repository.
Note: I’m assuming that you’ve installed the Jekyll gem on your server along with all of its dependencies. Additionally, you might want to setup Gitolite to simplify management of your repositories.
#!/bin/sh # File: $HOME/repositories/ryanbright.me.git/hooks/post-receive export GEM_HOME=/usr/local/rvm/gems/ruby-1.9.2-p290 GIT_REPO=$HOME/repositories/ryanbright.me.git TMP=/tmp/ryanbright.me PUBLIC_HTML=/srv/www/ryanbright.me/public_html JEKYLL=/usr/local/rvm/gems/ruby-1.9.2-p290/bin/jekyll rm -Rf $TMP rm -Rf $PUBLIC_HTML/* git clone $GIT_REPO $TMP $JEKYLL --no-auto $TMP $PUBLIC_HTML chmod -R 755 $PUBLIC_HTML/* rm -Rf $TMP exit
I’m looking forward to digging more into Jekyll throughout the coming weeks, but I’m happy to have my blog up and running for now – WordPress free. If you’re in the market for a lightweight, customizable blogging system, give Jekyll a try!
Algorithms Revisited: Fibonacci Sequence
Posted: August 15, 2010 by Ryan BrightWith another school semester on the horizon, I’ve been reviewing old course material to refresh my memory. Since a lot of this material is useful when devising algorithms, I’m going to spend the next few weeks revisiting some of the more interesting concepts. First up is the Fibonacci sequence. This is the sequence F(n) = F(n-2) + F(n-1) where F(0) = 0 and F(1) = 1.
If we wish to determine a given Fibonacci number n, there are several approaches we can take. The approaches I’ll cover here involve recursion, iteration, Binet’s formula, and matrix form. Each of the following examples assumes that the algorithm is handling a positive integer, and all were validated with Ruby 1.8.7.
Recursion
def F(n) return n if n == 0 or n == 1 return F(n - 2) + F(n - 1) end
This naive solution uses recursion to calculate the value of a Fibonacci number and runs in exponential time. While the solution is viable for small values of n, the algorithm’s lack of memory will cause the execution to take significantly longer for larger values.
Example: Find the fifth Fibonacci number.

As you can see, there is a lot of redundancy in this algorithm because we do not store each Fibonacci number as it is calculated. This deficiency can be alleviated by using an iterative approach to hold the value of each Fibonacci number as long as it is needed by a subsequent calculation.
Iteration
def F(n)
return n if n == 0 or n == 1
f = Array[0, 1]
(n - 1).times { f[0], f[1] = f[1], f[0] + f[1] }
return f[1]
end
As mentioned before, this approach will only store a Fibonacci number for as long as it is required by a subsequent calculation. Since a Fibonacci number is the sum of the two Fibonacci numbers before it, these are the only two values that we need to remember. Using this approach allows us to efficiently determine a Fibonacci number in linear time while optimizing memory usage.
Example: Find the fifth Fibonacci number.

Binet’s Formula
PHI = (1 + Math.sqrt(5)) / 2 def F(n) return ((PHI ** n - (-1 / PHI) ** n) / Math.sqrt(5)).to_i end
Depending on the desired accuracy level, a Fibonacci number can be approximated in constant time using Binet’s formula. The formula provides exact values of F(n) for “reasonable” values of n, but the tests I conducted using my Ruby scripts for Binet’s formula and iteration show a deviation at n = 72. Since a linear algorithm executing to n = 72 in linear time will execute in approximately the same time as an algorithm in constant time on modern hardware, there’s little benefit to using Binet’s formula for solving this problem.
Matrix
require 'matrix' M = Matrix[[0, 1], [1, 1]] def F(n) return n if n == 0 or n == 1 lower_right(M ** (n - 1)) end def lower_right(matrix) return matrix[matrix.row_size - 1, matrix.column_size - 1] end
Update: After reading a few of the comments on Reddit, I decided to add the matrix form solution to the list of approaches for this problem. The Wikipedia article contains a better explanation of the theory than I could ever provide, so I’ll just explain how the above algorithm works.
To perform exponentiation of a matrix, we can continuously multiply the matrix by itself. This is accomplished by using the following formula:

Using this formula with the original matrix M = [[0,1], [1,1]], we can calculate the matrix for F(5) where the lower right value is the Fibonacci number.
This algorithm will execute in logarithmic time linear time, providing us with an efficient and accurate method for calculating Fibonacci numbers.
I hope my tutorial for finding any number of the Fibonacci sequence has been helpful! I’m looking forward to diving into more topics in the coming weeks, so stay tuned for more algorithmic goodness!
Buildycrunken #1: Hocus Focus
Posted: November 05, 2009 by Ryan BrightJust as Newton and Leibniz contributed separately to the development of differential and integral calculus, the brilliant minds at Collexion began planning their first Jelly not long before I expressed the need for one in my recent article. Buildycrunken will cater to software developers, writers, artists, students, and anyone else that desires to spend his or her late nights surrounded by creative, entertaining individuals. The first event will start at 9:00pm on November 6 and last until 9:00am the following morning, posing a challenge to those passionate about their work to gauge the limits of that passion with sleep deprivation and unhealthy quantities of caffeine. For those interested in attending, the madness will begin at Third Street Stuff at 9:00pm on November 6. I hope to see you there!
I'd Like Some Jelly with my Coworking
Posted: October 30, 2009 by Ryan BrightSince I started working at Awesome Inc. in June, I’ve fallen in love with the concept of creative individuals coming together within a single coworking space to share ideas and collaborate on projects. Our particular environment contains a coworking space, art studio, engineering workshop, and dance studio, and each component provides a unique contribution to the space’s creative vibe. However, this style of workspace has its pitfalls, as many creative, independent professionals are reluctant to invest the money required to experience working in such an environment. While not founded for this particular purpose, Jelly provides an intermediate solution to those professionals wishing to transcend the boundaries of home offices and coffee shops without shelling out the fee associated with most coworking environments.
What is Jelly?
From the Jelly website:
Jelly is a casual working event. It’s taken place in over a hundred cities where people have come together (in a person’s home, a coffee shop, or an office) to work for the day. We provide chairs and sofas, wireless internet, and interesting people to talk to, collaborate with, and bounce ideas off of.
You bring a laptop (or whatever you need to get your work done) and a friendly disposition.
We see a lot of designers, developers, and internet types, but we’ve also had musicians, cooks, sound designers, tea sommeliers, product designers, photographers, writers, and more.
Some of us are entrepreneurs or freelancers. Others work in an office most of the time, but work at Jelly for fresh ideas and a change of pace.
No matter what you do or what you create, you’re welcome to come to Jelly and share your talent and learn from others.
Companies such as Amazon, Hewlett-Packard, Lexmark, and IBM have had longstanding presences in Lexington, and the city also has the students and faculty of the University of Kentucky at its disposal. However, a majority of the city’s innovators are sprinkled among these institutions with few opportunities to collaborate and share ideas. Coworking spaces like Awesome Inc. and Collexion provide outlets for their target audiences, but what about individuals in other niches or those that don’t want to pay? Coffee shops and libraries are open environments, but this openness permits saturation by those that have no interest in collaborating.
Hosting a biweekly Jelly would be a unique method for facilitating a more cohesive Lexington while also bringing individuals together for at least one common purpose - collaboration. Such an effort has the potential to lead to even greater innovations for our community, and it could be an initial step toward the greater unification of our city’s most brilliant minds.
For more thoughts on the pursuit of office avoidance, Geekpreneur has an interesting article discussing alternatives to cafes and coworking.





