Monday, April 26, 2010

Facebook Open Graph has an impact on me!

Watching the live F8 coverage, I had some vision about Facebook new Open Graph. I remember that part when FriendFeed CEO talked about his experience and the magic 5 (on average, a new user won't become active unless he/she find 5 friends using the same site). I thought at that moment: "Oh well, sound amazing. The Open Graph with all the new social plugins will be good". It's not really true.

Today, when I visited a site. I was stunned seeing a few (Facebook) friends of mine did some activities on that site. OMG. It's a really strange feeling!

I believe the Open Graph with all the new social plugins will be GREAT! The idea is just... brilliant. Except the issue about privacy: the Instant Personalization is opt-out (which means everybody has it turned on automatically, user must explicitly turn it off, more about opt-out). Many people complained about it and they are warning people to turn off in order to protect privacy but I think most of them will just leave it on because they don't read all those nerdy sites. And basically, most of 500 million people is... quite a lot! I'm having it on anyway, the personalize experiences are fun and useful, love it!

Saturday, April 24, 2010

Facebook loves  

Just recently, Facebook has messed up all instances of a unicode character "à" (latin small letter A with grave, code: U+00E0). My biggest guess is they (Facebook Team) ran into a UI problem so they decide to make dirty str_replace before sending output for both the main site and mobile site. I said it's just some kind of search and replace for the output because getting posts directly with Facebook API works just fine

The replacement originally is "&nbsp;" but for some reasons, it gets displayed as "?nbsp;". FYI, &nbsp; is a html entity which means "no break space". What the hell is it? Normally, all browser will ignore multiple spaces placed together. This is used as a trick to bypass character count in replying post: just type an emoticon (":D", 2 characters), hold the space bar for a few seconds to generate around 20 spaces, type anything else (a period is enough). The post will be displayed with only 1 space between the emoticon and the period. Note that if you don't type the period, it's high chance that the post will be trimed (remove spaces at the beginning and the end) so your post will failed the character count validation. Back to &nbsp;, using it just like space but browser will keep them as it. You put 20 of them, they will be displayed all. Some people even used &nbsp; to indent their stuffs! Actually, it's sometime useful to use &nbsp;, for example when you have to leave an empty <div>
or <td>, you should place a &nbsp; inside to make the XHTML document validated. See the demonstration below: they both have 20 spaces between the emoticon and the period.

  • Using spaces: ":D ."
  • Using &nbsp;: ":D                    ."

Anyway, a bug has been filed but I think Vietnamese users will have to wait. Stay calm, everybody.

Thursday, April 22, 2010

OAuth with Google, Twitter and... Facebook!

This is sick!

Just a few days ago, I ran into OAuth as I want to get my GMail feed based on Google Data API. I succeeded. With a little help of an OAuth open source (here, available in several programming languages).

Then I remember that I once heard that Twitter also uses OAuth as an authentication option so I turned into Twitter and had a good read. Finally, I found out that they are basically the same (hehe, it's obvious since OAuth 1.0 is a worldwide standard). I had an idea of writing a universal class which can handle both Google and Twitter OAuth functionalities. It's not too hard. I took most of the idea from the PHP example (here, PHP only). I also made a small script which accepts URI to send and intercept response from Google & Twitter servers.

At that moment, I was so excited with all the ideas but actually it has no real world benefit so I just left it there... Until today, in the F8 (says "fate") conference of Facebook, I was stunned finding out that Facebook implements OAuth too! That's so awesome! Oh, actually, Facebook implements a newer version of OAuth (2.0, which hasn't been well documented yet) but no problem. I managed to rewrite the universal script to handle all Google, Twitter and Facebook now. If you want to check it out, follow these links:

  1. For Google:
  2. For Twitter:
  3. For Facebook:
The 3 scripts must be seperate because each one use different configuration (the ID, the secret string, etc) but they shares the same class and each scripts has the same structure like this (from facebook.php)

I'm still looking for the best way to implement something useful. Let's see

Monday, April 19, 2010

Buy me an "iDevice"

Buy me an iDevice (which including iPod Touch, iPhone, iPad) and you will get 70% of whatever I build with it for 3 years. That's the deal ;)

Sunday, April 11, 2010

Implementing Quick Sort

I never wants to re-implement classical stuffs as it will be useless but this time, it's an assignment at the college so... here it is. Quick Sort implementation of mine which supports arrays and lists.

Using the class's (static) methods is very simple.

For those who don't know what the heck Quick Sort is, check it out here. Have a nice day!

Saturday, April 10, 2010

Survival Simulator Game (a closer look)

As mentioned earlier (in this post), I have built several modules for a Survival Simulator Game. You can see it in action in the old post. And now, I have finished documenting the source files (my modules only) and you can get source file and document from MediaFire or BlueHost. You can also view document online here: Using the TextUserInterface is very simple (code copied from, provided by the instructor):

Using my GraphicalUserInterface is pretty the same way:

There are 2 notes:
  1. I modified the Game class ( to make it run infinitely
  2. If you double click the gui.jar file, you won't be able to view debug messages. If you want to view them, you have to invoke from console using something like this:
    java -jar gui.jar

Friday, April 9, 2010

Survival Simulator Game

Ran into this from a note by mr Ha. Pretty interesting assignment and now I have finished completely. I'm so glad!

Thursday, April 8, 2010

vBulletin 4.0.3

vBulletin 4.0.3 has just been released with a new feature: Facebook Connect. Well, this thing kinda pissed me off the first time I read about it but it turned out to be not a big deal. The really near future plan is to make YAFB connected users vBulletin Core feature connected users. Well, I will see since I haven't had a version of 4.0.3 yet. Yay me.

Tuesday, April 6, 2010

Keyboard Shortcut for vBulletin

It started from a night (like tonight) when I'm reading a lengthy thread some where and then when I wanted to go to the next page, I pressed K just like in Gmail when I want to go to next conversation. But unfortunately, it didn't go to the next page. Well, I thought for a moment then decided to do this: Keyboard Shortcut for vBulletin (both version 3 and version 4). I hope someday I can use keyboard shortcuts with my favourite sites, in my favourite threads. Uh oh. Some screenshots:

Firefox. vBulletin 4. Forum display page

Google Chrome. vBulletin 4. Album page

Safari. vBulletin 4. Picture page

And of course, Internet Explorer. vBulletin 3. Forum display page (again)

Monday, April 5, 2010

Lazy developer

Have you ever heard a joke about developers? Actually it's not a joke since I personally think it's true (at least to me) but it's always fun to hear: Developers are very lazy. (Oh yeah, I'm). They can't afford to finish a 15-minute job at all. (Oops). They will spend 3 hours coding to be able to finish that job in 1 minute. (Uh oh, that's 14-minute laziness. LOL)

I have an example here: got an exercise in discrete mathematics which involve using the Dijkstra algorithm to find the shortest way between a vertex to another in a graph. There are enough vertex in the graph that made me lazy (5, LMAO). Oops, I have just opened up the source code and found out it's about Hamiltonian path, anyway, I was lazy and finally came up with this PHP script to solve the problem quickly (hundreds millisecond is considered quick, isn't it?)

The script is intelligent enough to sort out all duplicated paths. Lazy meeee!

Thursday, April 1, 2010

Reason why it is great to be a geek!

You must have read many articles saying how bad a geek is in a relationship: He loves the computers more than everything. Nothing else matters once he gets stuck with a few (hundred?) lines of code. It's very high chance that he shows up in front of your home just in time for a dinner with your parent (with untidy clothes and messy hairstyle). And so on... Well, it sounds really scary, isn't it?

And then you can read other articles also, saying how great a geek in a relationship, specifically in bed (oops). I don't have references for the first type of articles but with this one, I have plenty of them, go check it yourself:

  1. Why geeks make the best lovers
  2. 7 reasons to date a geek
  3. 10 reasons you should marry a geek (wow!)
  4. and so on...
Hell yeah, everything has advantages and disadvantages. If you want to take something, you have to accept both the positive and the negative things. The problem is you have to decide if it's worth to take the risk. Right?

To me, it's so great to be a geek (or at least, I claim myself one). Why? Because Sylvie Truong has just posted a blog entry in her My Opera blog. It showed her interest in geeks, pretty much! That's more than enough for me. A really good reason, isn't it?