Sunday, December 27, 2009

Polyphasic Sleep Map

I just found this really nice map of polyphasic sleepers around the world. If you are trying to adopt polyphasic sleep, or are already deeply into it, please sign up and put your pin on the map.

I'm proud to say that Oregon is the only state other than California (as far as I can see) that has TWO people doing uberman. I think that's pretty cool. At the same time, I hope people become more aware of polyphasic sleep and play with it as their situations permit.

Uberman Sleep pattern

For about two years now I've been doing a sleep style called "polyphasic sleep". The two popular terms on the internet for it are Uberman and Everyman. Originally I started on Uberman and stayed on it for several months, but due to the psychological effects of being awake and alone for an extra 8 hours per day, I changed to an Everyman schedule. I sleep for 4.5 hours per night and take three 30min naps evenly spaced throughout the day.

Last week I went back to the Uberman pattern and things have been going good. Normally the transition to Uberman is truly killer, but my body is already used to taking naps and having a shortened core sleep period. It's been hard and I've fallen asleep on the couch a few times, but it's been manageable.

One of the things that has really helped me this time around is a Nintendo Wii and Wii Fit. My inlaws have it and when I get up from each nap during the night I get on the Wii and run through 30min of Wii Fit routines. When I do that my mind is awake and alert for the rest of the period until my next nap.

Another factor in my transition to Uberman this time around is that I've had 2 years to adjust to a milder version of the same psychological effects. I'm now comfortable working by myself for long hours on end in a low light environment. Feeling alone in your house is one thing, feeling alone in your entire timezone is another (I'm just saying that there are no appropriate locations open at 3am).

Post a comment if you'd like to know more, either on the blog or privately.

Thursday, December 03, 2009

Word pair matching challenge

In trolling the net I found a problem that I thought would be fun. It was posted by CitrusByte and is as follows: Given a dictionary, output all word pairs where both words share all their letters except the last two, which are distinct and reversed.

My solution is a bit long to post inline, but go check it out on github.

My first attempt kept all the words around while the first letter remained the same. It ran in 4 minutes using a ~450k words. This last implementation runs in 5 sec on the same list. Yea! I was surprised too. Just goes to show that you don't always understand the real nature of your data until you test it.

The reason for the speed up it drawn on my board in pictures and diagrams, but I'll try to explain it. When the list of words we can check against is sorted, and our list of possible matches is sorted, when we have passed a given word (represented by the current word being greater than the given word) there is no possibility of a match existing so we can remove the word from the list.

If we are only considering words of the same length in a given list and we remove all words that we have passed, then the word we are looking for should be on top if it is in the list at all. Remember this is using a sorted list of matches. We have to resort the list each time we add an item, but resorting the list each time isn't too bad because the lists stay very small.

Sunday, November 08, 2009

DataMapper adapter for FluidDB

I've built and released a DataMapper adapter for FluidDB. This was a fun project because it was actually my first time using memcache and it is also my first rubygem. You can read the details on github or checkout the Quickstart:

Sunday, October 25, 2009

CSV to GeoRSS converter

A friend of mine was trying to mark on a map the location of 50 people as he read their names and addresses out of a database. The data changes slightly every month and he was doing it with a marker.

I told him I could plot the names on Google maps for him and so I built my first public web app. I've built a lot of web applications, but this is a first in many ways. It's the first time I've used Sinatra, DataMapper, Heroku, and Compass. It's the first time I imagined and created my own layout and styling, and it's my first app that I've tossed out there for people to use and play with. I'm trying to learn to participate more in the Ruby developer community.

The app converts a csv file into a georss feed and then redirects you to google maps with the url of the rss feed as the query string. That causes google maps to fetch the feed and display it's data an a map. The data isn't actually rss feed content, but the georss feed format is a super simple way of passing data to google maps.

Feel free to leave suggestions or check out the code.

Tuesday, October 20, 2009

RDoc: I'm converted

Working on a new rails app yesterday I happened upon a file I hadn't read before: doc/README_FOR_APP

Use this README file to introduce your application and point to useful places in the API for learning more. Run "rake doc:app" to generate API documentation for your models and controllers.

So I ran the rake task and looked at what it generated. Wow. I'm not a big fan of tests in rapidly changing prototype code, but I LOVE documentation when it is easy to add and easy to find. This rake task generates rdocs for your application. If you don't know, rdoc notes are very easy to add to your code.

The rdocs are hyperlinked and have the method bodies inline so you can drill down for more details when you need them. This really helps when you are working on a large code base and can't remember everything about it. Tests are good, but understanding the code you're working with is primary.

Monday, September 14, 2009

Zookeeper as a Cluster Management Framework

As applications scale the line between operations and application development fades. Your application probably depends on multiple layers all tied together in a unique fashion. Index servers, database servers, BLOB storage servers, cache servers, etc. Who keeps everything connected properly? What happens when something doesn't work as expected?

Nati Shalom posted an article about applications taking responsibility for themselves. It takes ideas from the long standing meme of "self-healing applications" and combines it with move to dynamic cloud applications that interact with their environment through API's. Nati is the founder of GigaSpaces and in a later article talks about their implementation of this concept in their product.

An open source project that I have been following for a while is called ZooKeeper. It was written at Yahoo as a application coordination layer comparable to the Google Chubby Lock Manager. Unlike Chubby, ZooKeeper implements some basic primitives that support a really wide array of uses.

Although ZooKeeper isn't a Cluster Management API like Nati envisions (that is the application's responsibility) ZooKeeper is a powerful coordination framework that can give your application a sense of identity as a cluster with which to manage itself. Servers and services and report their status and needs, monitor each other, and store and find dynamic configuration information. Your application can also receive notifications when anything changes.

Check ZooKeeper out and let me know if it solves any problems you've been facing.

Sunday, September 13, 2009

A git based wiki

I decided that I wanted to document all the ideas in my head in a Wiki instead of Google Docs. I use git and vi a lot and like to have access to the text files backing anything. So I was excited to find WiGit.

WiGit is a php-based wiki that stores everything in Textile-formatted flat files in a git repository. 10 minutes and I had a wiki and a git clone of it on my laptop. I can edit things locally and push them back to the web server and the wiki automatically reflects the changes. Of course, the pages can be edited through the web interface too.

The power of Git as a web-based wiki is really awsome.

Tuesday, August 25, 2009

Employee Engagement

"If you could get all the people in an organization rowing in the same direction, you could dominate any industry, in any market, against any competition, at any time."

My reading lately has started to show strong correlations between several current business leadership themes.

1) Strengths-based leadership/hiring - The Gallup organization is one of the major sources of information on this topic. "Now Discover Your Strengths" was written by them and lots of people have started preaching this idea. I personally really like the idea of people being organized according to their strengths. I agree that it helps people enjoy their work. Example article.

2) Democratic workplaces - Coming from a different direction is the idea that your employees are willing and even interested in helping improve the company and business. Historically management has been based on distrust between the top and the bottom of the hierarchy. Democratic workplaces are based on the idea that if you let employees make their own decisions, that they'll act responsibly. This is one of my favorite concepts as I love to come up with new ideas and need people to be open to those ideas. Example article.

3) Collaboration - Enterprise 2.0 is challenging existing management styles because it is all about power and knowledge at the edges. This is the big topic right now, but it gains a lot when considered together with democratic workplace strategies. A lot of the resistance that E2.0 faces is due to organizational culture more that anything else. Wikinomics is a decent primer that introduces the concepts for those still learning what Web2.0 is all about. For the more advanced, Amazon recommends some really great books, dipping into psychology and organizational behavior.

4) Teamwork - Just because we have fancy Web2.0 tools doesn't mean we work well together. Management gurus have long touted the importance of teamwork, but that doesn't mean everyone gets it. Five Dysfunctions of a Team is definitely my next purchase after I finish the 4 books I'm currently reading. Have you ever wanted to start a business just so you could work with your friends and trusted associates. We can build those kinds of teams. We can build teams of trust and inter-dependency.

I'm still not sure if my recent studies have taken such an "organizational-behavior" bent lately because I enjoy it for it's own sake or because it is so important to my personal work style. Either way, these are ideas that I feel could revolutionize any company.

Saturday, August 22, 2009

Nothing is Easy

What happens when you spend years pushing your career in a particular direction and something tells you to go back where you came from?

I'm grateful for the things I've learned by pondering my entrepreneurial interests, but to drop my efforts for a freelance career path is hard. Having read "The Dip" helped me understand the decision that I face, but it was still up to me to take the action. I had to say no to some job opportunities and that was hard too.

I've realized that I really want to help improve cooperation inside organizations through both correct application of technology and good communication and social skills. Startups need this as much as big companies, but they tend not to have a problem with it. I want an environment where I can apply all the business management topics I'm studying and where there are enough people that I can help grease the gears of interaction.

I worked at Brigham Young University and Novell and, when I felt the organization resistance from the trenches, I thought I needed to move to smaller companies. Now I realize that what I really want to do is to reduce that resistance to employee contribution. Having been there and left is a blow to my pride, but I just need to stand up and move forward. It's unproductive to lament past choices once your lesson has been learned.


Saturday, August 08, 2009

Cisco's Democratic management

I recently caught the story about Cisco changing it's management structure from command-and-control to collaborative. McKinsey Quarterly, FastCompany, and several blogs have articles about it. It think it's interesting that John Chambers talks about command-and-control structures in much the same language as Ricardo Semler. I wonder if Chambers read the book?

The comments on the WSJ blog article are disheartening. Everybody that commented talked about how big a failure Cisco's new management style is. They all said that the entire concept is a bunch of "mumbo-jumbo". FastCompany's article title even calls the idea "Socialist", although it appears to give a balanced analysis of it. How is it that such a modern, liberal idea can remain so inaccessible to people?

Netflix and Cisco are the only two companies that I had read about that are embracing collaborative/democratic management, but I just found a site all about organizational democracy and the companies that embrace it.

Friday, August 07, 2009

Personal Initiative vs Business Hierarchy

As I've moved through jobs I've seen things I liked and things I didn't like. I decided pretty quickly that I don't like the hierarchical rigidness of big companies. I do however enjoy the large problems they have to solve.

So between wanting to tackle large and difficult problems, and wanting the flexibility to exercise initiative, I started to study entrepreneurship and startups. That lead me to study business management styles. I wanted to know what kind of company I would fit in with and what it was about big companies that made them so different from small companies. That was when I started to understand the rigid structure that forms inside most companies as they grow.

I took that rigid structure for granted until I read a book called Maverick. It's a book about allowing all levels of your organization to self-organize and self-manage. It completely changed my perspective about how businesses should be run. At the time, I didn't know of any companies that had incorporated any of these ideas.

Evidently not many do. Rob Patterson pointed me to a presentation about Netflix and said, "In a lifetime of studying organizational culture, I have seen nothing this clear or brilliant." For me it is really exciting to have more study material as I learn about cultivating personal initiative in businesses.

The presentation says that it is for reading more than presenting so dig in. It's a long one, 128 slides, but as I digest it I'm sure I'll have some new ideas to share.

Thursday, August 06, 2009

Dead easy google maps integration

Several months ago I had to plot data on a map. It didn't need to be very fancy, it was a low budget project and they just needed to see between 100-5000 data points on a map. After looking around it seemed to me that the easiest way of plotting the data was to just generate a georss document and send the user to a google maps url that would load the rss document.

RSS is most commonly used for keeping track of blog updates, but that doesn't mean that's the only thing you can use it for. Nothing says that the data in the RSS feed has to be time oriented or even changing. My application generates the RSS document from the database, so it could change from time to time, but on the whole it shows the same items all the time. It actually doesn't even have a date in the document.

My application just created a url that the user could visit to view the RSS for the needed data and then redirected them to google maps with the RSS feed url as a query option:
Google maps downloads the RSS document and displays the items on the map. The xml is really easy to build. If you are just putting this data in RSS to get it to google maps (I did) then you'll have to build the RSS from scratch. It's still easy. Here is an example of some simple RSS markup that you can easily generate from what ever language you are using.

It took me 30min to roll out basic google maps integration with my data using this really easy method. You can read more about it at

Saturday, August 01, 2009

Benjamin Franklin's Autobiography

I recently read Benjamin Franklin's autobiography and it had a lot of meaning and inspiration for me. He talks in detail about his efforts as a young man to improve himself and is training. He spends a large portion of the book on his mid-life and his efforts to establish himself in the community as a business man and the mis-steps he made and the keys to his success.

The route the Franklin took in building his business and then profiting from it as it grew beyond himself and in his later years seem to me an excellent pattern for encouraging entrepreneurship and instilling a sense of ownership in the front line of our productive efforts as a society.

One of the elements that had the greatest effect on me was that Franklin consistently pointed out the importance of his relationships to his business activities. He made friends with lots of people and as friends they each found was to help each other mutually. The repeated examples in his life really helped drive home the need for me to reach out and really connect with other people. Not in a sleazy marketing way, but make a really effort to extend my circle of friends. My nature is to have a small circle of very deep friendships, so have a looser circle of less frequent friendships is something that I have to work on.

My marketing professor said, "All things being equal friends buy from friends. All things not being equal, friends still buy from friends." That has stuck with me as I've read many sources and it has really helped me understand the direction I need to take to be a successful business person.

Wednesday, July 29, 2009

The Dip

A lot of commentary regarding Seth Godin's book "The Dip" regards it as just a business book. Some people criticized it for stating the obvious. For those of you that never have any problems, great, for me, this book has been amazing.

I keep a small number of books always at hand to help me in my daily efforts. Most books I read and the content sticks with me pretty well and I review it later if I need to, but this small library I read from everyday to help me improve myself. Previously it had only two books: Stephen Covey's "7 Habits of Highly Effective People" and James Allen's "As a Man Thinketh". These books have been my guiding lights to overcome laziness and fear. Seth Godin's "The Dip" is getting added to that short list.

Imagine a book that really connected with you, communicated to your inner-self why life is so hard and what to do about it, and inspired you to acheive great things. The Dip is that book for me. I have followed Seth's blog for some time and he consistently inspires me to keep my eye on the difficult path to personal development. He encourages me to do the hard things and live life to it's fullest.

I would agree that the book actually discusses points that are pretty obvious on the surface, but I bet that anyone who dismisses it as merely that, is an armchair general or a backseat driver. This book is a call to action and I appreciate it.

Tuesday, July 28, 2009

Developing audacity

I recently started following Steve Blank. His blog posts have a much different feel than most others. It's like listening to old war stories from Silicon Valley, something I'm just too young to have experienced. Most other people talk about the hot new trends and high flyers of the dot-com era. Steve talks about old fashion things that have been working for 50 years. His stories are exciting too.

Being an entrepreneur is just so new for me that I really need the basics that most people take for granted. I think the only characteristic I started with was a desire for self-improvement. All the other character traits that people say are required for entreprenuers, I either lack or have had to work on. One trait that I don't have much of is Audacity. The audacity to ask questions, to try things that people say won't work, the audacity to forgo a 9-5 job.

Steve posted a great article about just asking. It's pretty closely related to the idea that just showing up is a large part of success. I've been dragging my feet on a actually persuing a particular contracting opportunity. I'm afraid they might say no, so I put it off wanting to do something that will improve my chances, but never actually getting to it. I can offer good value to them and have proved it in previous interactions. I need to stop dawdling and get it done.

Habits and character traits can be changed by small and consistent practice. For me right now, blogging is about getting content published. It's about developing the habit of creating it. So, I need to develop my audacity and tenacity by consistently going out on a limb and asking for the things I want (nicely of course). Obviously I'll get a lot on "no"s, but what about that killer "yes" that changes my life?

What things have you put off asking for?

Sunday, July 26, 2009

Yahoo Pipes is addicting

I'm setting up my handheld as an information aggregator with skype, twitter, rss, and gmail. For rss I'm using prssr even though the project isn't active any more, because I don't figure many people are working to support WM5.0 anyways, and it has some nice featurces. So I tried to add my authenticated Highrise activity feed, and prssr just crashed. I was not happy, my highrise feed is really important for me to keep track of what is going on with my rental properties.

The Highrise feed is atom, so I thought that might be the problem. I'd never opened Yahoo pipes, but I had read a good deal about it. I opened Pipes and in less than 5 minutes I had a clean unauthenticated rss feed that works great on my handheld.

Data processing and web service integration is one of my technical delights, so the ease of converting and handling the atom feed was quite thrilling. It makes me want to make more pipes just for the sake of it; if you have something you'd like help with, just let me know.

My iPod Touch: a Dell Axim x51

I've been getting a little envious of people's iPhones and iPod Touches and more than once lately, I've needed to Google Maps while I'm out to find my way. Then I remembered my old Dell Axim x51 collecting dust in a box and a 2G CF card I got from somewhere else.

I dug it out and found that Google calendar and contacts syncs with it and gmail works great via IMAP. Then I added Google search, maps, and youtube. I upgraded the PocketPutty, installed Skype and ceTwit, and started to laugh at how cool it all is. Don't get me wrong, I still think iPod Touch owners are pretty lucky, it's just not a justifiable expense for me right now.

Without spending a dime, I just got 80% of what I would use an iPod Touch for, plus Skype.

Friday, July 24, 2009

Marketing 101

It college I took some business classes because I thought it would help me in my career. Turns out I was right. In my marketing class we talked about the three P's: Product, Price, and Placement. In order to create a service you have to figure out exactly what it is you're offering, how you're going to make money on it, and exactly who you are going to sell it to.

That one piece of information has been critical to my understanding how to start a consulting practice. A few months ago I went to see a SCORE counselor and she spent time over a month driving home the importance of the first item, exactly what is it that you sell? You need to have a 30 second pitch that concisely communicates your value proposition, and if at the end of that 30 seconds your audience doesn't understand what you are offering, you've lost the deal.

During that same time I tried to pick up a family friend as a client by talking about helping improve his law practice. He has a history of giving people jobs just because they need them. He loves to help people out, but despite my numerous attempts to describe the amazing breadth of my abilities, he couldn't see any need for my services. That was a very educational failure.

I've always thought of myself as a jack-of-all-trades, I do very well at any assignment I'm given. My employers love it, my managers really appreciate my efforts. When a potential client ask's what do you do and you reply "Any thing you need!", the respose is quite different, "Stop wasting my time." That has been a difficult concept for me to really embrace.

So if they only want one thing how do I choose what my pitch? Surely I don't want to limit my options, surely I can't say no to other opportunities. Surely I'm wrong, but that doesn't mean it's been easy to accept. I've had to really think about what I enjoy and motivates me enough to go outside of my comfort zone and face rejection.

It has taken me nearly 2 years of reading and thinking to really understand myself and my interests to the point that I have a decent guess at what it is I have a passion for that meets a business need. I have a passion for enabling collaboration. For me that includes enterprise social networking and enterprise data mashups. It's at least narrow enough that I can pick a specific offering and change it later without too much problem.

I have so much to learn.

Thursday, July 23, 2009

What was your leap of faith?

I'm coming up to another opportunity to make a leap of faith and work really hard to find more contracting work, or to turn back and get a normal job with normal benefits. Last time I chickened out. I have the standard family telling me I need to get a job, I have the standard lack of money in the bank, but I have one client that almost pays the bills, I just have to make it one step further and get another project to cover the rest.

It's a big leap of faith for me because I'm currently stuck in analysis paralysis and I need to just commit to following up on leads. I've never done that before. Who knows why, it's just something way outside my comfort zone. And I may not get a very good response for a few months, during which time, I won't be applying for jobs and my one client might not have enough work for me.

I've been trying to gather information from people that have already made the jump. Asking them how they got clients, how they market themselves, etc, but I've never asked about the time when they had to make the leap of faith and really step outside their comfort zone. I think everybody faces it at some point or another. If I make it to Beer and Blog tomorrow, I think that will be my new question, and hopefully it will lend me some courage.

Mind sharing your leap of faith story?

Wednesday, July 22, 2009

Google Wave Code Examples

I found the Google Wave samples gallery this morning and it really helped me understand the power of google wave. This post on a new blog I'm following recently added to my thoughts about the failings of current enterprise applications. The real work happens in the conversations between people, but right now our conversations are in phone and email. Email is static data, as soon as you send the email, your data is old.

Imagine being able to communicate in realtime with your coworkers (I picture an IM chat window) where all your business data, reports, and actions are displayed in your conversation, and you can even interact with them. Now, when you are discussing the cashflow forcast, or the current sales goals, you can have live data right in front of you.

At heart I like to bring things together, to make everything easy and accessible, and to minimize the effort required. There is so much busy work that the computer can do for us. Augmented reality doesn't need fancy cameras or voice recognition, when your job has you sitting at a desk 8 hours a day. Google wave will be an amazing business tool as people start to connect their applications with it.

Getting involved in a community

Recently I've been going to some of the tech community activities in Portland. It's helped be think about the importance of getting to know people and for other people to get to know you. It's a strong theme that I also learned from Benjamin Franklin's autobiography.

Dawn Foster posted yesterday evening about the importance of getting content out there. Now I've agreed with her for sometime; I agree that publishing content to the web is the most efficient way to help other people learn things enmasse. I just never felt I had anything to contribute to the conversation, which is a standard trait of introverts (That's not a bad word, food for thought :).

Dawn's post helped me realize something though. The post didn't have any amazing new information nor was it an explanation of some deep technical issue that she solved. It was just her thoughts about a topic, albeit well written in an engaging style. I've read about Dawn in my research of Portland so she has some authority in my mind that some other random blog doesn't.

I have thoughts too, I just don't write in an engaging style. That can be change however, if I practice. With time there will be people interested in what I think and in having a discussion with me. So here's to gaining momentum for my blogging activities.

Thursday, April 09, 2009

Character encoding in custom to_xml methods

I was writing some tests for my custom to_xml method on an ActiveRecord model and needed to check that the text had been escaped properly. to_xml changse lots of characters to XML entities and I couldn't find where that encoding happens. So I tossed a few exceptions into the xml serializer and found that the xml serializer calls to_xs on strings before including them in the xml. It's defined in:


So if you need to pattern match the output of your xml generator, you can call to_xs to get the text that it is going to output.