May 26 2008

The $100,000 Customer

In today’s age, customer service has become a oxymoron, or a cliché at best. I recently had a bad customer experience at the Fry’s Electronics that made me think about just how right the customer actually is. On recent trip to Fry’s they employed a bait and switch on a in store sale. This had been the second consecutive time this had happened and I asked the casher to see the manager. After going from the Department Manager to store Manager to Customer Service Manager I finally had it. As a customer I thought I was right, they incorrectly and misleadingly promoted a big sale and placed fliers on half an aisle and they were not owing up to their mistake. I demanded to file a complaint, but only after I told him that this was the second time I fell victim to this sort of bait and switch tactic and that I was personally unsatisfied with the service I was getting did he ask me to put my name and number in a little, white, and meaningless piece of paper, which he undoubtedly threw away after I left the store. But before I left the store, and the additional $200 worth of merchandise I was going to buy, I informed him, and half the store that they had just lost a $100,000 customer.

You might be wondering how I figure I am a $100,000 customer if at I had a little over $200 worth of merchandise. We’ll, I’ve been a customer of Fry’s for over ten years. I bought my first desktop there, paid over $2,400 in cash for it too. Since then I have bought other desktops, laptops, video, SLR, and point and click cameras, books, movies, and a ton of other electronic gadgets and accessories. If you add it all together, I’ve been a loyal customer until now.

In any given year, you may spend up to $5,000 dollars in your local grocery store, 20 years of that makes you a $100,000 customer. Take Amazon for example, how long would it take you to be a $100,000 Amazon customer? Not long, if you are a happy customer. Take apple for example, if you are like me you are reading this on your third or forth mac computer and you own and have given an iPod for just about every gift occasion. A satisfied customer has no qualms about spending on reliable service and quality goods, even at a premium.

The retail business is a tough business. Most retailers have a razor thin profit margin of 1-3 percent, and they just can’t afford to mistreat their customer in a rude, unprofessional, deceiving, unethical fashion. When Amazon often has better deals on just about everything, with free premium shipping, how is Fry’s going to differentiate and win back customers like myself?

In the New York Times best seller The Last Lecture, Randy Pausch tells the story of the $100,000 salt and pepper shaker. The story is about how when, as a child, the authors parents took the whole family to Disney World in Orlando for the first time the author and his kid sister bought a souvenir salt and pepper shaker for their parents. In the excitement, the salt and pepper shaker fell and broke minutes after purchasing it. As any kid would, they were upset to the point of attracting the attention of a fellow guest who suggested for them to ask the casher for it to be replaced. They did and to their surprised the got a new shaker set and apologies for not wrapping it correctly. The salt and pepper shaker that they had bought was not worth $100,000, it was worth no more than $10 dollars. But on learning about this, and having the family vacation of their lives, the authors family gave Disney World over $100,000 in business over the years. The authors father in his capacity as a volunteer in English as Second Language organized student trips to Disney World well worth $100,000.

You are a $100,000 customer, so demand $100,000 customer service. Take back and take control your purchasing power.

Technorati Tags: , , , , , ,


May 19 2008

Using Hpricot

Hpricot is a HTML parser for the Ruby programming language. With Hpricot you can scan and scape a HTML document. To illustrate how to use Hpricot i’ll write a list the code of a short script I recently wrote. The script grabs all the links for the past week from A Rubyist Railstastic Adventure, a tumblelog.

The general structure of the HTML used by the web page that I will be scraping is something like the following.

[source:html]
<div class=”post”>
<div class=”date”>
Sun
<em>
May
<big>18</bi>
</em>
</div>

<div class=”link”>
<a href=”http://www.juixe.com” class=”link”>Juixe TechKnow</a>
</div>
</div>

[/source]

One thing to note about the HTML produced by the site we will scape is that the date is optional in the post. The date is only displayed once for a day, so some posts don’t have a given date. Also, there are several other types of posts such as quotes, images, etc. We are only interested in posts with links. Again, the Ruby/Hpricot script will only gather the links for the past week.

[source:ruby]
require ‘rubygems’
require ‘hpricot’
require ‘open-uri’
require ‘parsedate’

# Convert days to number to seconds
def days_to_sec(days)
secs = days.to_i
secs *= 24
secs *= 60
secs *= 60
secs
end

# pretty print the link in a list
def print_link(link)
print ” <li>”,
“<a href=’#{link.attributes[‘href’]}’>”,
“#{link.inner_html.strip}”,
“</a>”,
“</li>\n”
end

def get_links(doc)
curr_date = Time.new
(doc/”div.post”).each do |post|
post_date_elem = (post/”div.date/em”)
date = post_date_elem.inner_html.strip

# Parse the date of the post
if date != “”
date_day = (post_date_elem/”big”).text
date_mon = nil
date.each_line do |line|
date_mon = line.strip if date_mon.nil?
break if date_mon.nil?
end
date_str = “#{date_mon} #{date_day}, #{$week_ago.year}”
data = ParseDate.parsedate date_str
curr_date = Time.local data[0], data[1], data[2]
end

# Stop if already looking past one week
break if curr_date < $week_ago

# Handle all links in post
(post/”a.link”).each do |link|
print_link link
end
end

if curr_date > $week_ago
next_page = Hpricot(open($rubyist_next))
get_links next_page
end
end

# The Rubyist home page to be scraped
$rubyist_home = “http://rubyist.tumblr.com/”
$rubyist_next = “http://rubyist.tumblr.com/page/2”
# Scrape one weeks worth of links
$week_ago = Time.new – days_to_sec(7)

# Run the script
doc = Hpricot(open($rubyist_home))
get_links doc
[/source]

Technorati Tags: , , , ,


May 18 2008

This Week in Ruby

This week we saw news of Rails running on Rubinius and several news items regarding Passenger (mod_rails), in particular Dreamhost now has Passenger support. Links for This Week in Ruby are provided by A Rubyist Railstastic Adventure, a tumblelog.

Technorati Tags: , , , , , ,


May 13 2008

Perforce Report

I’m a really competitive developer and I like to see how many files I checked in a week compared to my fellow coworkers. I know that counting then number of changed files is no way near a correct accounting of my productivity but it is an easily quantifiable metric. Perforce has an optional P4Report download that can be used create reports on the code repository. P4Report has a command-line client, P4SQL. With P4SQL you can write SQL-like statements to query the whole repository.

Download P4Report and make sure it is in your path. Once you have it in your path, start the p4sql command.

The first useful SQL statement is to find all the available tables in the system. To list all tables, you can use the following.

select * from systabs;

Perforce has a large number of database tables of which I find the following the most useful, changes, files, users, clients, fixes, and branches.

To list all the changes that you have committed you can execute a command like the following, just replace the ‘juixe’ with your own username.

select * from changes where lcase(user) = 'juixe';

I was curious and wanted to find the largest revision any single file has attained, meaning most modified file, to accomplish this I executed the following command.

select max(revision) from files;

If you use Perforce version control, you can use P4Report to query your teams check-ins and use it as an additional metric or tool in your development process.

Technorati Tags: , , , , ,


Apr 30 2008

Ruby on Twitter

Here is a short list of 21 fellow rubyist that also use twitter. By no means is this a complete list, this is just all the ruby/rails hackers that I follow. If you like to follow me just befriend me and I’ll be sure to add you to my friend list.

Technorati Tags: , , , , ,


Apr 27 2008

In A Startup

After working for upstart startup, I thought of a few axioms of working for a small and agile team in a fast and merciless marketplace.

  • In a startup, you can have any title you want, say VP of Version Control, but no one reports to you other than yourself.
  • In a startup, if you code it, break it, test it, or fix it then you own it.
  • In a startup, if one guy call in sick a third of your development team is out.
  • In a startup, if you been there longer than 3 years you are most likely been there longer than your CEO.
  • In a startup, you have more hats than the Queen of England, and you wear multiple hats at the same time.
  • One year in a startup equals 2.7 in a large corporations.
  • Would you rather start a startup or upstart a business?

If you have any advice or experience from working in a startup, feel free to share them in the comments.

Technorati Tags: , , , ,