John's Musings (Blog)


Los Angeles Python Data Science Meetup Talk

posted Nov 29, 2014, 3:42 PM by John Lin   [ updated Nov 29, 2014, 3:43 PM ]

Wow, it's been an embarrassingly long time since I wrote anything here.  No fear, here is the link to the latest public talk that I gave at the inaugural Los Angeles Python Data Science Meetup.

Parsers Do Matter

posted Mar 22, 2013, 2:53 PM by John Lin

I have been scratching my head at how to parse out a list of ordered list using the BeautifulSoup library.  I am viewing the html through Firebug and typing out the Python code snippets through the ipython notebook.  For the longest time I was having inconsistent results, then I realized that the DOM being used by BeautifulSoup may not be what I was seeing on Firebug.  Sure enough, when I switched the BeautifulSoup parser to "lxml", the DOM now matches up.  Thank God!

Parking Structures and Group Theory

posted Feb 17, 2013, 10:19 PM by John Lin   [ updated Mar 22, 2013, 2:54 PM ]

Some of the things that fascinated me to no end when I started my work at USC were the parking structures.  It seems that if I want to park at the corner that was closest to my office, I would always end up on odd numbered floors.  Why was that?  It turns out that in that particular structure (PSA for USC folks), there were two separate ramps that connect one floor to another.  One ramp would connect the first and second floor from east to west, while the second ramp would connect the two floors from west to east.  If you enter the parking structure in one end, and follows the natural progression, you would only get to one side of the structure every other floor.

What made this even more interesting was that not all parking structures at USC were the same.  PSX is similar to PSA, but without the outer loops on each floor.  In PSA, you can get from one ramp to another on the same floor by going around the outer loop.  In PSX, there were no outer loop.  A consequence of this is that cars that are parked on different ends of the same floor cannot be reached by driving around the same floor.  The only way to get to the other side is by driving all the way to the top or the bottom floors to get to the other side.  This is probably why Jerry and the gang had problem finding parking in the Parking Garage episode of Seinfeld.

After this set of experiences, I paid closer attentions to other large parking structures at airports (LAX and Burbank) and at shopping centers (Old Town and Third Street Promenade).  All of them were similar to the PSA structure at USC, with the exception of the Third Street Promenade parking structure.  At the Third Street structure, smaller connecting ramps were made between the two opposing ramps on the same floor.  Fascinating.

Online Dating and Mechanism Design

posted Nov 28, 2012, 9:54 AM by John Lin   [ updated Nov 28, 2012, 9:54 AM ]

When I was doing online dating, I noticed there were a number of interesting technologies that were employed.  I am now thinking about the technologies under the hood and if there are ways to improve the experience for the end-user.

The dating sites fall into two broad categories: eHarmony and everything else.  The main demarcation line between these two categories is that eHarmony decides the profiles that you see, and other sites allow you the freedom to filter the profiles however you like.  eHarmony uses its own secret sauce to do the matching.

I wonder if eHarmony uses the choice data of a user to determine which other profiles to show a person.  The closest analogy I can think of is the algorithm that is used in administering SAT and GRE exams, where the level of difficulty is dynamically adjusted based on the success of a person answering a question.  It seems reasonable to assume that the preference set of dating for a person is relatively stable (it might be multi-dimensional, but stable).

1-4 of 4