Coming Full Circle "I dream of things that never were, and ask why not." - RFK Mon, 19 Oct 2015 04:14:25 +0000 en-US hourly 1 A long way home Mon, 19 Oct 2015 04:13:12 +0000 0 AI analysis of my blogging style Mon, 27 Dec 2010 17:29:46 +0000 After learning about from a blog I frequently read: Modeled Behavior, I decided to run my own blog through the system and see what it says. is probably written by a male somewhere between 66-100 years old. The writing style is academic and happy most of the time.

Now really? I had no idea I was such a cherry person.. and age 66 – 100? WTF…

]]> 2
In Search of The Good Corporate Citizen Mon, 13 Dec 2010 21:45:56 +0000 In general, I have the belief that most ethics courses whether they be medical ethics or business ethics tend to be taught from too theoretical of a standpoint.  Scenarios are often defined to have black and white answers, and thus the students never actually deal with true moral dilemmas until they are actually on the job.  This is especially true for those who spend their lives in consulting and/or academia, with no real understanding of the pressures that actually happen in an operational environment.  Having gone through some particularly stressful board meetings, I was quite excited when I heard about a new PBS production that will attempt to showcase some of the moral complexity involved:

Banner: In Search of the Good Corporate Citizen

Everyday we hear about business people who gamble on ethics to meet business goals. The ongoing stream of scandals begs the question, “Why does this keep happening?” From an Emmy-winning team of producers, “In Search of the Good Corporate Citizen” weaves together expert panel discussions with personal accounts from real-life white-collar criminals and whistleblowers.

Unable to catch the show on the air, I contacted Light On Production to try and get a copy of the DVD. After several phone calls, Denny Swenson, the producer of the show sent me a *free* copy of their first show, “Hitting the Numbers”!

I think the show is quite well done, and the stories that they showed were truly remarkable. The show leveraged a small panel to discuss each story after they were presented.   The panel was moderated by Thomas Donaldson from the Wharton School of Business and was composed of:

  • William W. George, the former chairman and CEO of Medtronic
  • Ben Heineman, General Counsel of General Electric
  • Donna C. Boehme, former chief compliance officer of BP

Given the show was filmed in 2008, one can reasonably assume that Boehme did not lose her job over the oil scandal.  However, just from the body language of the panelists, it was quite obvious that they were quite dismissive of the idea of having a chief compliance officer and frankly I am as well.  Perhaps such a role is indeed necessary in many large institutions, but it was not clear from the panel discussions how a CCO as described by Boehme would have in anyway contributed to ethical behaviors in an organization.  What was truly disappointing with this panel was that they never really acknowledged how much pressure there was in middle management and how sometimes the decisions are actually not that black and white.  Even with Donaldson offering up truly gray and realistic scenarios, the panel always converged on black and white solutions.  I would assume that the panelists themselves were at least somewhat worried about their professional image if they had mention doubts.  Perhaps true ethical discussions involving business executive can never happen in front of a camera?

]]> 0
Installing Rails, Apache, MySQL and Passenger on Snow Leopard with MacPorts Mon, 13 Sep 2010 18:18:44 +0000 Once in a while, I catch the startup bug due to people like Sean Burgess.  So this post is based on hours of frustration that I had from setting up multiple osx machines to deploy rails.  Much of this is for my own reference and borrows heavily from these sites and my own attempts on 4 different macs:


1. Preparing System

In general, just easiest to start from scratch if you haven’t used ports in a while (or have never used it). Also make sure that web sharing is OFF under System Preferences as we are going to install the apache version from macports instead.

sudo rm -rf \
    /opt/local \
    /Applications/DarwinPorts \
    /Applications/MacPorts \
    /Library/LaunchDaemons/org.macports.* \
    /Library/Receipts/DarwinPorts*.pkg \
    /Library/Receipts/MacPorts*.pkg \
    /Library/StartupItems/DarwinPortsStartup \
    /Library/Tcl/darwinports1.0 \
    /Library/Tcl/macports1.0 \

1.1 Download and Install Xcode & Macports

Download Page:

1.3.1 Update macports

sudo port -v selfupdate
port upgrade outdated

2. Apache, php5, mysql & PhpMyAdmin

2.1 Install Apache, php5, PhpMyAdmin and misc

sudo port -v install phpmyadmin php5 php5-mysql apache2 mysql5-server mysql5 memcached libmemcached wget sqlite3 +apache2 +pear

2.2 Make apache, mysql autoload on startup

sudo -u mysql mysql_install_db5
sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
sudo port load memcached

2.3 Activating PHP5

cd /opt/local/apache2/modules
sudo /opt/local/apache2/bin/apxs -a -e -n "php5"

2.4 Add index.php to the dir_module directive

Open /opt/local/apache2/conf/httpd.conf in your favorite text editor.

<IfModule dir_module>
    DirectoryIndex index.html index.php

2.5 Add mod_php and phpmyadmin

Also, at the end of the httpd.conf file, add the following lines so that Apache includes the mod_php and phpmyadmin file

#Include PHP configurations
Include conf/extra/mod_php.conf
# Local access to phpmyadmin installation
Include conf/extra/httpd-phpmyadmin.conf

Set up your PHP configuration files

cd /opt/local/etc/php5
sudo cp php.ini-development php.ini

Setup the MySQL default socket to use the CentOS MySQL socket location by editing php.ini


2.6 Building my.cnf and changing the MySQL default socket to conform to CentOS (optional)

Open /opt/local/apache2/conf/httpd.conf in your favorite text editor. Add a new mimetype so that Apache will direct files ending in .php to the PHP module for processing. Add the following within the block. Without this, all you’ll see is the text of your PHP scripts

sudo cp /opt/local/share/mysql5/mysql/my-medium.cnf /etc/my.cnf
sudo mkdir /var/lib/mysql/
sudo chown -R _mysql:_mysql /var/lib/mysql

Change the TWO lines in /etc/my.cnf that says

socket = /opt/local/var/run/mysql5/mysqld.sock


socket = /var/lib/mysql/mysql.sock

2.7 Create the phpmyadmin configuration file

create a file /opt/local/apache2/conf/extra/httpd-phpmyadmin.conf containing this text:

AliasMatch ^/phpmyadmin(?:/)?(/.*)?$ "/opt/local/www/phpmyadmin$1"

<Directory "/opt/local/www/phpmyadmin">
  Options -Indexes
  AllowOverride None
  Order allow,deny
  Allow from all

  LanguagePriority en de es fr ja ko pt-br ru
  ForceLanguagePriority Prefer Fallback

2.8 Setup aliases to control the two services

sudo  ln -s /opt/local/apache2/bin/apachectl /usr/sbin/apache2
sudo ln -s /opt/local/share/mysql5/mysql/mysql.server /usr/sbin/mysql.server
sudo apache2 restart
sudo mysql.server restart

2.9 Setup the mysql root password

Set the MySQL root password. Where is your new desired root password. You will be prompted for your existing password (“Enter password:”); since it’s empty, just press Return.

mysqladmin5 -u root -p password <new-password>

Then log into the mysql connection and use these commands (replacing your root password of course) to update all the root accoutns

shell> mysql -u root -p
mysql> UPDATE mysql.user SET Password = PASSWORD('newpwd')
    ->     WHERE User = 'root';

2.10 Test the PHP server

Make an index.php in /opt/local/apache2/htdocs and put the following in it:


2.11 Install and Test phpmyadmin

First make these changes in /opt/local/www/phpmyadmin/

$cfg['blowfish_secret'] = WHATEVER YOU WANT THIS TO BE

You should see quite a bit of information regarding your php installation.

3. Ruby, Rubygems, Rails, other gems

3.1 Install Ruby from macports

sudo port -v install ruby
$ ruby -v
ruby 1.8.7 (2010-08-08 patchlevel 302) [x86_64-darwin10]

3.2 download rubygems from

cd /tmp
tar -xvf rubygems-1.3.7.tgz
cd rubygems-1.3.7
sudo ruby setup.rb

3.3 Install rails, rake, rspec etc.

sudo gem install rake rails thin tzinfo capistrano ruby-debug rspec mysql sqlite3-ruby

4. ImageMagick, Rmagick and mini_magick (Optional)

lets install ImageMagick with support for JPEG, TIFF, WMF, PDF, and PNG images, and for Postscript and TrueType fonts.

sudo port -v install tiff -macosx imagemagick +q8 +gs +wmf
sudo gem install mini_magick rmagick

Test rmagick

$ irb -rubygems -r RMagick
>> puts Magick::Long_version
This is RMagick 2.13.1 ($Date: 2009/12/20 02:33:33 $) Copyright (C) 2009 by Timothy P. Hunter
Built with ImageMagick 6.6.3-0 2010-08-19 Q8
Built for ruby 1.8.7
Web page:
=> nil

5. Passenger

5.1 Install Passenger gem

sudo gem install passenger

5.2 Check Passenger path

passenger-config --root
 -> /opt/local/lib/ruby/gems/1.8/gems/passenger-2.2.15

5.3 Build passenger for apache

and don’t worry about the other steps, we will cover them directly in the guide

sudo passenger-install-apache2-module

5.4 Enable Passenger on apache:

create /etc/apache2/extra/httpd-passenger.conf and change wherever necessary for your directories.
LoadModule passenger_module /opt/local/lib/ruby/gems/1.8/gems/passenger-2.2.15/ext/apache2/
PassengerRoot /opt/local/lib/ruby/gems/1.8/gems/passenger-2.2.15
PassengerRuby /opt/local/bin/ruby
PassengerMaxPoolSize 6  # maximum global rails servers
PassengerMaxInstancesPerApp 2  # maximum rails servers per application
RailsFrameworkSpawnerIdleTime 1800
RailsAppSpawnerIdleTime 600
PassengerPoolIdleTime 600
PassengerMaxRequests 1000  # after 1000 requests will restart server, to skip memory leak 🙂

# Enabling NameBased Virtualhost

# my rails app virtual host 1
    ServerName my-rails-app.local
    DocumentRoot "/Users/jackpo/rails/my-rails-app/public" # change this to match your folder
    RailsEnv "development"
   <Directory /Users/jackpo/rails/my-rails-app/public>
        # change this to match your folder
        # MultiViews must be turned off
        Options -MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
    # logs are optional, change this to match your folder
    CustomLog  "/Users/jackpo/rails/my-rails-app/log/access_log" combined
    ErrorLog   "/Users/jackpo/rails/my-rails-app/log/error_log"

5.5 Enable Virtual host on apache:

Edit /opt/local/apache2/conf/httpd.conf and add this new line at the bottom:

# Include Passenger ModRails config file
Include conf/extra/httpd-passenger.conf

5.6 Add your .local domain to /etc/hosts/

edit /etc/hosts and Add this line to that file and change to the name of your choosen application

You might add as many as you want, each line for each that ServerName on your VirtualHost blocks my-rails-app.local myapp-xyz.local

5.6 Restart Apache

sudo apache2 restart

6. Final

go to your browser and open the url of your application http://my-rails-app.local

If it works, congratulations. If it didn’t.. uh.. try and google. I maybe able to help, but I don’t have that much time!

]]> 3 Our Salt Intakes Sat, 08 May 2010 17:31:33 +0000 I really don’t have very much time to blog these days, so just quick short entries 🙂

]]> 0
Gallery2 to Flickr Migration Fri, 26 Feb 2010 06:48:08 +0000

For half a decade, I have depended on the great open source Gallery2 project to host my photo galleries. Unfortunately, I am finding myself with less and less time to devote to maintaining the installation, and many useful social media features have yet to make it into its code base. So, I finally decided to port my entire gallery into flickr.

Much to my surprise, there are lots of scripts in the gallery database to import photos from flickr, but no functional scripts to export photos out of gallery2 into flickr. Several past attempts have been made, but I can get none of them to work properly. So I did what any good coder would do, I modified the existing scripts until it worked. I am providing the scripts I hacked at the end of this post. There are several caveats with the scripts that I’m including here:

  1. It’s recommended that you run this script (export-gallery.php) using command line php, or else the script might pre-maturely end due to Apache rest times. I also have max_execution_time = 0 set in my php.ini.
  2. It’s recommended that you dramatically increase resource limitations on your mysql server when attempting to run this script. I made no attempt at optimizing mysql calls at all. The script basically makes a new call whenever it wants new data. I have wait_timeout=600 set in my my.cnf.
  3. I offer NO support whatsoever for these scripts. They were created to ease my own personal transitions, and reading them should be fairly easy.
  4. The script utilizes PHPFlickr and is based on‘s version of export-gallery. Several major upgrades to the original script have been made, including the ability to export sub-albums.
  5. I recommend only using getToken.php in phpFlickr, as I personally could not get PHPFlickr’s API authentication to work in any reliable fashion.
  6. You should see a line like this in export-gallery.php i.".DATABASE_COLUMN_PREFIX."ownerId=10 AND . This allows you to export galleries on a per-user basis. You can look up the userid information in the gallery2 tables.

So with that said, click here to download the script. You can run it by typing php export-gallery.php on the command line after editing a few variables at the top of export-gallery.php and setting up the API key / token combination from flickr. I used this very useful link from PHPFlickr to get my token after setting up the API key.

]]> 0
Interesting statistics about sexual relationships and their implications on the spread of HPV Sun, 17 Jan 2010 01:13:27 +0000 College campuses are increasingly turning into hubs for the spread of STDs as college students take on an increasing number of sexual partners. On average, college students now have around 3 sexual partners a year (Martens et al).

It turns out that male students in general would like to be much more promiscuous than their female counterparts. Undergraduate men expressed a desire for a significantly greater mean number of sex partners than did undergraduate women, over a 1-year period, women, on average, were interested in a single sex partner, whereas the average man expressed a desire for about seven partners (Fenigstein et al, 2007). This result did not change in a statistically significant way for those in serious relationships. What was particularly surprising to me is that males are actually successful in being more promiscious, even among the supposedly more conservative asian subgroup (Arliss 2008). As one can observe from the graph below, males have a much higher percentage of being sexually active with more than 3 partners than females.

The implications above are particularly disturbing for the spread of Human papillomavirus (HPV) infections. HPV is mostly harmless in men but might develop into cervical cancer in women. HPV is estimated to be the most commonly transmitted STD. A recent paper from Sexually Transmitted Disease: Influence of Partner’s Infection Status on Prevalent Human Papillomavirus Among Persons With a New Sex Partner included some extremely surprising statistics.

Women attending university or college in Montreal, Canada, and their male partners (N = 263 couples) were enrolled in 2005–2008. HPV was detected in 56% of women and men. 44% have a type that can lead to cancer. New relationships are when HPV transmission is most likely.

The overall prevalence rate of HPV in the US has never been firmly established, with rates ranging from 14% to 90% being published in peer-reviewed literature (Dunne et al, Revzina et al). Studies however, agree on the trend that a much higher incident rate of HPV is being reported on college campuses than in the general public.

The highest prevalence of HPV was identified among women attending sexually transmitted diseases (STD) clinics and college students, identifying them as target populations for prevention interventions. Conversely, the lowest HPV prevalence was among women in the general population.

With the recently released and much publicized HPV vaccine, many women might be lulled into a false sense of security. For one, the vaccine is only mildly effective on a few strains of the HPV virus, and only particularly effective PRIOR to exposure to the virus (Sawaya et al, 2007).

With grade 2 or 3 cervical intraepithelial neoplasia or adenocarcinoma in situ as the outcome, the difference in risk so far appears to be modest: 219 of 6087 vaccinated women (3.6%) received this diagnosis over an average of 3 years, as compared with 266 of 6080 unvaccinated women (4.4%). The absolute risk difference of 0.8% indicates that 129 women would need to be vaccinated in order to prevent one case of grade 2 or 3 cervical intraepithelial neoplasia or adenocarcinoma in situ occurring during this period. If grade 3 cervical intraepithelial neoplasia or adenocarcinoma in situ were the most relevant outcome, evidence was insufficient to infer the effectiveness of vaccination.

This does not mean that girls should not be given the HPV vaccine, rather that they should still be careful (condoms) and should still have regular screenings, even when vaccinated.

]]> 1 Sat, 16 Jan 2010 03:07:01 +0000 The Human Genome project was completed at the start of the last decade, and only in the last two years have we really begun to reap the fruits of the immense undertaking. I talk about some of commercial players and legal issues surrounding the wide spread adoption of personal genomic technology in medicine at the First AMA-IEEE Conference on Individualized Healthcare blog.

Incidentally, I’m also on the organizing committee for the conference mentioned above. Consider attending the conference if you are interested in Individualized Healthcare!

First AMA-IEEE EMBS Medical Technology Conference on Individualized Health Care
23-23 March 2010, Renaissance Mayflower Hotel, Washington, DC

]]> 0
HBR’s Top 100 Best-Performing CEOs in the World Sun, 03 Jan 2010 20:58:29 +0000 The Harvard Business Review recently published their article on the Top 100 Best-Performing CEOs in the World. It’s probably not a surprise to many that Steve Jobs is #1 on the list (Apple, Pixar) or that there is only one woman (#8 – Meg Whitman of eBay) on the top 100. I am however, surprised by which woman they picked. Meg Whitman practically ran eBay into the ground. Indra Nooyi of Pepsico would have been a much better choice.

After glancing at a few of their selections, I decided to crunch some of the numbers given to see if there are any interesting trends. First, we can clearly see that HBR has a bias towards western CEOs (specifically, the US and UK).


The industries are pretty much what one expects, with energy and financial services leading the way.


Contrary to the prevalent white knight CEO myth, most good CEOs tend to be insiders, and do not hold MBA degrees. An MBA only seems to be important IF you want to be a white knight CEO.


Though if you do want to try and be a white knight CEO, USA and UK are about the only countries that really has that type of culture.


There’s a lot more analysis that you could run on the data if you want. I’m going to save you some effort in screen scraping and just give you the excel sheet that I used here.

So this concludes my first blog entry in the new decade! As some of you might have noticed, I’ve also completely revamped the website. If you have any comments, (constructive or hateful ones), please let me know! Happy New Year!

]]> 1
Blogging Break! Fri, 02 Jan 2009 04:26:10 +0000 Merry Christmas and Happy New Year to everyone!

As many have noticed, I’m on a blogging break and will continue to be in one for a while. 2008 has ended rather poorly but I have some great things to look forward to in 2009. (whoever stole my car on Dec 31st 2008, please return it…)

  1. The NYCIML will finish its inaugural year as a student run organization under the excellent leadership of Yitian Liu and Maria Guirguis!
  2. The NYMC will begin it’s second full year of operations. For 2009, we will be expanding to include programs to server the middle schools. New programs include two middle school student classes (I will be directing the program in Manhattan), and a middle school teacher program.
  3. My healthcare strike team is shaping up quite nicely and we’ve finally located a project. I can’t reveal much about it yet.. but needless to say.. it kicks ass!
  4. After consulting with a few friends, most notably jenniewang and Jorian, I’ve actually decided to take up Yoga. We’ll see how that goes.
  5. NYCVPF made its first grant to Concrete Safari! Consider joining the organization if you are interested in social philanthropy.

Even though I am in the midst of a blogging break, I am still quite active on twitter.

In the mean time, check out this kickass Christmas card from First Round Capital.

]]> 2