Vinh Pham

  • Home
  • About
  • Resume
RSS Feed

Archive for May, 2008

Gambling for a living

Posted on May 8th, 2008 in Uncategorized | 1 Comment »

Yesterday my girlfriend and I got into an argument because I mentioned that I could make a career out of playing Poker. This happened during one of my extreme fiend-sessions, which I am still in now.

But first off, let me try to explain something. Even though I used the title “Gambling for a living”, or more appropriately “Gambling as a job”, I do not believe that playing GOOD Poker is considered “gambling”. It is true that MOST poker players are gambling, but that is only because they play bad poker: fishing, counting on seat changes for luck, playing with emotions, and betting more than they can afford to loose. However, if you if you really understand the game and have the discipline, you are not “gambling”. You are simply taking advantage of favorable statistics.

But regardless of what I think, there are always two sides to every story, so here are a few pros and cons:

CONS
1. Potential of Loss - You could end up loosing everything. I see these people in the poker rooms everyday. Hanging on to the last chip, asking random strangers for a loan, going into massive debt just to make a bet.
2. Lack of prestige / Stigma - A professional poker player does not have the moral bargaining chip of a brain surgeon, a firefighter, or a teacher. As a poker player, you realize your dreams by shattering someone else’s dream. It’s like selling crack for a living.
3. Nothing to fall back on - You can’t really take the skills you have at the poker table to any other job. Plus, it wouldn’t fit anywhere on your resume.

PROS
1. Easy life style - No need to worry about climbing the corporate ladder, wearing a tie, or preparing a resume.
2. Potential of Huge Winnings - You could become the next Phil Ivy, or win enough tourneys to make more than just a comfortable living.
3. Freedom - go wherever, whenever, you want.

But anyways, all of this is a moot point.

1. My girlfriend wouldn’t let me do it anyways
2. I think I can get rich faster doing web stuff.
3. I already enjoy most of the benefits listed in the PROS section.

How to fix strange characters in MySQL database

Posted on May 2nd, 2008 in Internet | 1 Comment »

So, as a result of bad programming, my database got FILLED with strange characters like this:

 ’ … – “ †‘ 

These characters are representations of double quotes, single quotes, triple dots, etc… in different encoding formats.
I read that his happens when you copy lines from programs like Word, Wordpad, etc…
It has something to do with using latin-1 as the collation in your database. The many sites that talks about this issue recommends converting your table to use UTF-8.

Anyways, after hours of tedious research, I found a way to fix an existing table that has these weird characters in them.

The code is like this:

update <table_name>
set <field> = replace(<field>,'’','\'');
update <table_name>
set <field>= replace(<field>,'…','...');
update <table_name>
set <field>= replace(<field>,'–','-');
update <table_name>
set <field>= replace(<field>,'“','"');
update <table_name>
set <field>= replace(<field>,'”','"');
update <table_name>
set <field>= replace(<field>,'‘','\'');
update <table_name>
set <field>= replace(<field>,'•','-');
update <table_name>
set <field>= replace(<field>,'‡','c');

replace <table_name> with table name, and <field> with the field you are targeting.

This runs through the database and replaces all the strange characters with normal ones.

CSS: Overflow hidden helps clear float elements

Posted on May 2nd, 2008 in Uncategorized | No Comments »

This is something I should have known a long time ago, had I actually read a CSS book.
But here is what I learned today.

If you have two floated blocks sitting next to each other, and you want to be able to use a “clear” INSIDE one element, without having it also clear the OUTSIDE block, put “overflow: hidden” in the block you have a “clear” in.

So for example, if you have a #sidebar floating next to a #main. Inside the #main you have two floating images, now you want to clear the floating image inside #main, without it also clearing the floating #sidebar. To accomplish this just put “overflow: hidden” in the #main.

I am guessing this works because the “clear” inside the #main is trapped inside the #main because any overflow of the “clear” is cut off. That make sense right??

This explanation probably makes no sense, but I hope it helps someone.

  • You are currently browsing the Vinh Pham weblog archives for May, 2008.

  • Categories

    • Environment (2)
    • Internet (17)
    • Personal (12)
    • Politics (6)
    • Rant (7)
    • Uncategorized (208)
  • Archives

    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
    • December 2006
    • November 2006
    • October 2006
    • September 2006
    • August 2006
    • July 2006
    • June 2006
    • May 2006

Powered by Wordpress | ColdBlue v1.0 — A theme by WebRevolutionary