Blog

  • Update your To Do List from Your Cell and Share Flowcharts with Everyone

    To make flowcharts Web 2.0 style check out Gliffy.com.

    Looking for a To Do list that works off-line as well as on-line? Do you also need to send your To Do items via SMS from your cell phone?

    I love Remember The Milk just for this sort of thing.

  • Sun Breaks MySQL’s Source Install

    I was supposed to go to Medjool to meet up with the Zappos crew, but instead I ended up helping a pal with a MySQL database upgrade problem with version 5.1.24-rc.

    The upgrade was a cluster fuck!

    These steps for upgrading MySQL have served me well for the past 9 years.

    tar cvf backup_data.tar /usr/local/mysql/var/*
    gzip backup_data.tar
    cd /usr/local/src/mysql-5.1.24-rc
    ./configure --prefix=/usr/local/mysql --with-mysqld-user=mysql --with-ssl
    make
    make install
    scripts/mysql_install_db
    

    Then I’d just run ‘/usr/local/libexec/mysqld –user=mysql &’ and I’d be on my merry way to happily computing on the web.

    But now wiith version 5.1.24-rc of MySQL, I’d have to ask what the heck are they doing at Sun to MySQL?

    When I started the server, I noticed that the state files were running in /var . Big fail there, since the prefix is defined as /usr/local/mysql .

    Also, I noticed that when I ran scripts/mysql_install_db there were more path errors:

    FATAL ERROR: Could not find /fill_help_tables.sql

    Then the biggest source of fail occured when I ran this:

    /usr/local/libexec/mysqld –print-defaults

    /usr/local/mysql/libexec/mysqld would have been started with the following arguments:

    --port=3306 --socket=/tmp/mysql.sock --skip-locking --key_buffer=16M 
    --max_allowed_packet=1M --table_cache=64 --sort_buffer_size=512K 
    --net_buffer_length=8K --read_buffer_size=256K 
    --read_rnd_buffer_size=512K --myisam_sort_buffer_size=8M 
    --log-bin=mysql-bin --server-id=1 --user=mysql 
    --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock
    --port=3306 --basedir=/usr --datadir=/var/lib/mysql --tmpdir=/tmp
    --language=/usr/share/mysql/english --skip-external-locking --bind-address=127.0.0.1
    --key_buffer=16M --max_allowed_packet=16M --thread_stack=128K --thread_cache_size=8
    --query_cache_limit=1M --query_cache_size=16M --expire_logs_days=10 --max_binlog_size=100M
    --skip-bdb 
    

    Once again, path errors, and –skip-bdb is an option that doesn’t even exist for mysqld!!!!!!

    Here was my fix for the scripts’ install:

    ./scripts/mysql_install_db --no-defaults --port=3306 --socket=/tmp/mysql.sock \ 
    --skip-locking --key_buffer=16M --max_allowed_packet=1M --table_cache=64 \
    --sort_buffer_size=512K --net_buffer_length=8K --read_buffer_size=256K  \
    --read_rnd_buffer_size=512K --myisam_sort_buffer_size=8M --log-bin=mysql-bin \ 
    --server-id=1 --user=mysql --pid-file=/var/run/mysqld/mysqld.pid \
    --socket=/var/run/mysqld/mysqld.sock \
     --port=3306 --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var \
    --tmpdir=/tmp --language=/usr/local/mysql/share/mysql/english --skip-external-locking \
    --bind-address=127.0.0.1 --key_buffer=16M --max_allowed_packet=16M \
    --thread_stack=128K --thread_cache_size=8 --query_cache_limit=1M \
    --query_cache_size=16M --expire_logs_days=10 --max_binlog_size=100M
    

    Here’s my fix for how the server must start from now on:

    /usr/local/mysql/bin/mysqld_safe --no-defaults --port=3306  \
    --socket=/tmp/mysql.sock --skip-locking --key_buffer=16M  \
    --max_allowed_packet=1M --table_cache=64 --sort_buffer_size=512K  \
    --net_buffer_length=8K --read_buffer_size=256K  \
    --read_rnd_buffer_size=512K --myisam_sort_buffer_size=8M  \
    --log-bin=mysql-bin --server-id=1 --user=mysql  \
    --pid-file=/var/run/mysqld/mysqld.pid  \
    --socket=/var/run/mysqld/mysqld.sock --port=3306  \
    --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var  \
    --tmpdir=/tmp --language=/usr/local/mysql/share/mysql/english  \
    --skip-external-locking --bind-address=127.0.0.1 --key_buffer=16M  \
    --max_allowed_packet=16M --thread_stack=128K --thread_cache_size=8  \
    --query_cache_limit=1M --query_cache_size=16M  \
    --expire_logs_days=10 --max_binlog_size=100M &
    

    All that just to start a server, so now, I’m totally telling my friends to use PostgreSQL instead. Sure it’s slower and doesn’t scale as much by a factor of 4 compared to MySQL, but hey, maybe it’s time for something new.

  • What’s Your Favorite Open Source Project?

    I’m a big fan of OAuth, because they’re coding a way of sharing your private data between different websites without having to give any 3rd party your password.

    What’s your favorite open source project and why?

  • Keeping It Real On Social Networking

    I un-friended 50 people today and it feels good.

    I applauded Twitter’s decision in July of 2007 to change “friend” to “follow”. It took one more falsehood out of the pile of lies that is the Internet.

    I had to look at my Twitter followers and who I was following. I did the same with Facebook. I saw quite a few spammers, posers, users, and those who were a combination of all three.


    A pic of how easy it is to fake friendship
    figure 1. It’s easy to fake friends.

    There was one person, who shall remain nameless, that really used me and hurt me. This person has managed to “friend” the top people in the Web 2.0 industry and has made it appear like s/he was the friend of all these top people thanks to carefully placed comments and strategic friending on Twitter, Facebook, Flickr, and Upcoming.

    Imagine my embarrassment when I showed up at a function with this person and my real friends revealed that they didn’t know this person at all.

    Anyway, one of my goals is to keep my Twitter and Facebook connections real and I won’t hastily add “friends” anytime soon.

    It’s a sad thing that nobody reads Book 8 of Aristotle’s Ethics anymore.

    Here are two quotes that serve as a commentary of our age of easy friending:

    “Those who quickly show the marks of friendship to each other wish to be friends, but are not friends unless they both are lovable and know the fact; for a wish for friendship may arise quickly, but friendship does not.”

    “Those who are friends for the sake of utility part when the advantage is at an end; for they were lovers not of each other but of profit.”

    And what am I going to do about it?

    I’m planning on making a social network where it’s actually difficult to friend people. The idea is that you can’t be someone’s friend unless you complete a task that shows your friendship for someone and have that verified.

    Crazy?

    Yes.

    Doable?

    Definitely.

    Let me know if you want to work on this project.

  • What’s the Oldest Program You Have That You Wrote?

    The oldest piece of code I have that I wrote is a text-based poker program.

    Here’s a screenshot:

    Picture of a text-based poker game

    I wrote it for my first college computer programming class in 1995.

    To use the code on a unix machine:
    tar zxvf Poker-1.0.tar.gz
    cd poker-1.0
    make
    ./poker

    What’s the oldest program you have that you wrote?

  • Laptop-less Meetings and No Wifi Cafes

    It seems that out is the new in.

    At Dogster, we have laptop-less meetings.

    At the Reverie Coffee Shop, there’s no wi-fi, which is great for having a place where folks still meet, greet and have conversations.

    no tech in meetings

    Here’s the LA Times article.

  • Come to Next Wednesday’s Web Analytics Mixer at the Supperclub

    The next San Francisco Web Analytics Mixer is going to held at the Supperclub in San Francisco next Wednesday, the 2nd of April. RSVP at the Web Analytics Demystified Site.

    These events have gotten really classy and you’ll be able to ask your burning questions to the web analytics pros present.

    Host:
    June Dershewitz and David Rogers (Email)
    Date:
    Wednesday, April 02, 2008 at 6:00 PM
    Venue:
    Supperclub
    Address:
    657 Harrison St, San Francisco CA

    (Venue | Map | Group)

    Sponsor:
    Event sponsored by BizRate
  • Free WiFi in San Francisco through Meraki

    Meraki hopes to cover San Francisco in a sea of Free Wifi.

    If you take a look at their map, you can see that they’ve got a good bit of coverage in San Francisco.

    Look for the “Free the Net” SSID to hook up.

    I really like the fact that they are looking into solar for their routers.

    Green Solar Router

    Thanks to Leef for this info.

  • Migrating to the Newest Youtube API

    You’ve got until August 30th, 2008 to migrate your code to the latest Youtube API. After that date, your current code base might not work.

    I used 3 important coding concepts while working on migrating my Youtube Facebook App to the newest Youtube API:

    Youtube

    The strategy pattern allows you to define common behaviors that will be shared among your set of classes. In this case, I’ve got a class for the old Youtube API, and a class for the new Youtube API. Although the URLs used for accessing the two APIs are different, I’ll define a method common to each class for accessing URLs. In this case it’s the setURL method.

    In PHP I do this like so:


    interface apiCalls
    {

    public function setUrl();

    }

    The factory pattern allows me to create an instance of an object for using the old API or the new API on the fly. Factory methods just return the new instance of an object.

    $dynamic_fave = FaveFactory::Create(“cyphgenic”, ‘yes’, 2, ‘on’, ‘2.0’);
    $dynamic_fave->setUrl();
    print $dynamic_fave->url . “\n”;

    $dynamic_fave = FaveFactory::Create(“cyphgenic”, ‘yes’, 2, ‘on’, ‘1.0’);
    $dynamic_fave->setUrl();
    print $dynamic_fave->url . “\n”;

    If you take a look at the code I’ve got and compare the old version with the new one, you can also see that I’ve cleaned up the nested if-else statements with arrays.

    BAD NESTED IF-ELSE:

          if ($showUploaded == 'on') {
            $method   = "youtube.videos.list_by_user";
          } else {
            $method   = "youtube.users.list_favorite_videos";
          }
    

    YAY! NO IF-ELSE:

          $h_method['on'] = "youtube.videos.list_by_user";
          $h_method['off'] = "youtube.videos.list_by_user";
          $method = $h_method[$this->showUploaded];
    

    Below are the links to the bits of the code that I had to migrate. I just use one particular method, setUrl() as an example.

    You might be wondering why two classes for the old and new API. If any new features need to be coded, or bugs need to be fixed in either API, I can do so within a particular class, and not add more obfuscation to the code. The two classes don’t violate the DRY principle because each models a particular thing.

  • Youtube Censors Won’t Censor Full Length Chic Flicks

    Youtube’s censors hate geeks. You can’t watch the Matrix because it’s been removed, but ya, you can jack off all you want to all of Jane Austen’s books turned into movies. To me this is such a joke, but I think there’s an explanation:

    You can no longer see a lot of the scenes from the Matrix on youtube:

    CANNOT HAZ
    Youtube hates geeks! No Matrix for you!

    CAN HAZ

    If it’s a chic flick like Pride and Prejudice or Persuasion? Guess what – you still can see the whole film in its entirety.

    WTF?

    The makers of Merchant Ivory type films see their films on Youtube as advertising… maybe there are a few die hard cultural conservatives who see it as reviving a long-gone era of classism and good manners. The owners of the Matrix, Warner Bros., see films on Youtube as cutting into their profits. They probably hate all the radical lefty politics in it, too.

    Can any insiders confirm this?