Tuesday, December 18, 2012

Windows 8 WinKey+Space

Today while I was playing around with Windows 8 (inside Parallels only, couldn't afford a new computer) I pressed WinKey+Space out of habit then just typed away... I meant to open Skype (on Mac) but I was still in Parallels so the Search Charm appears from the right side and start searching for Skype (on Windows 8). Doing a quick Google search didn't yield any results so this must be new eh?

Edit: Pressing WinKey+Space alone won't trigger anything but if some character key follows, the charm will appear...

Monday, December 3, 2012

Google freeandopen campaign special touch

Today, I was a bit surprised to see this post in my Facebook feed:

The post is from the official Google Facebook page. Amazing right? Blah blah Vietnam ICT scene is becoming larger and larger blah blah. However, I quickly saw the Sponsored tag and figured they must have post multiple posts in different languages then use the sponsor thingy to promote post to specific audience. I came to the Facebook page but only saw 2 posts (one in Vietnamese and the other in English). Strange. There are much larger market and this sounds just wrong...

Turned out, they used another nice feature for Facebook page:

Page admin can guard their posts by user location and language. Pretty useful feature from Facebook and nice touch from Google!

If you haven't signed it yet, go here and sign for #freeandopen web.

Monday, November 12, 2012

WOWZAPP 2012 Post-moterm

So I participated in WOWZAPP 2012 hackathon event in Hanoi, failed to win but nonetheless had fun. Below are some tips, writing down for the next time I go to a hackathon:

  1. If you have the chance to join a hackathon, do it! Big plus if you are young (not to say the events are not for old people).
  2. Project choice: do not build something that relies heavy on network connection. It's okie if the product uses a server but during development you should be able to put in some stub data for it to work. No matter how many wifi APs, the connection at a hackathon will be slow and troublesome, expect a lot of lost packets. Yesterday our team built a collaboration drawing app -- big mistake! We have to repeatedly perform this routine: find an available network, join it (do this at least 2 times for one client machine and one server machine), run "ifconfig en1" to get server address, put the new address in client config, run. Drove us crazy! If you have to, BYO router. We planned to bring ours but overlooked the problem and didn't do that.
  3. Planning: make as many preparations as possible. I'm not sure about other hackathon events but at WOWZAPP, they allow teams to implement server/service at home, prepare all the graphics, etc. The teams which do that won hand down. We didn't do any proper planning with the exception of discussing the product idea. I was blown away how well prepared other teams are.
  4. Eat and drink: I have no scientific data to back this up but I felt pretty good during the 36-hour hackathon. I don't eat much (only at meal time, no junk food). I don't drink anything heavy (coffee, etc., I did drink some energy drink but not much). I just consumed a lot of water. It also helps in keeping me awake (because I have to visit the toilet every so often I guess).
  5. Sleep: Our team didn't sleep much. Each member has 2-3 hours I think. We took turn to sleep too. I heard nothing about lost properties but it seems to be a good practice. Some other teams brought blanket and pillow, they may comfort you better but for just a couple of hours it may be not worth it.
That's it. 

Talking about our app a bit:
  • Idea: Collaboration Board. People can join a (drawing) board and do stuff together
    • Drawing
    • Sharing images (files or captured with a webcam)
    • Posting videos (YouTube)
    • Sharing location (Bing Maps -- it's a Microsoft event after all)
  • Implementation
    • Server: node.js
    • Connection: Socket.IO (Websocket or polling)
    • Client: Windows 8 Javascript/HTML5 app
  • What we have done
    • Server: all features
    • Client:
      • Collections view (a collection can hold many boards)
      • Boards view
      • Board view
        • Sharing images (files + webcam)
  • Repo (my forks)

Sunday, November 4, 2012

Garbage locations on Facebook

People need to stop doing this, seriously. What's the point of checking in at "my lovely home"?! At least create one checkin location for your neighborhood!


Yeah, why bothered telling people then?

Good kid.

These make sense...

And probably the most mind boggling... You know your geolocation is attached to the post, right, right? *sigh*

Sunday, October 21, 2012

Silly Visual Studio 2012 is silly

Having a little free time today, I spent the afternoon to download Windows 8 Preview Release and Visual Studio Express 2012 for Windows 8 in order to try out the new OS and its development process. Eagerly fired up Parallels installing Windows 8 just to be greeted with this error message:

The .NET Framework installed on this machine does not meet the minimum required version: 4.5.50709

WHAT?! I'm running the new shiny Windows 8, directly downloaded from Microsoft and you told me I'm not running the latest framework? How often is .NET Framework got released?! Incredible! However, bugs happen sometimes and maybe this is required. No problem, I downloaded .NET Framework 4.5 (again, directly from Microsoft) but it just told me the machine is already running the latest version.


Fortunately, I found this gem (couldn't deep link to the comment): Archiebass suggested people to go to edit a registry value using regedit, basically faking the version number for .NET Framework. And it works! Silly.

Update: And now I'm getting DEP0700 when I run any kinds of projects. Turned out I have downloaded Visual Studio RTM and this guy (no deep linking again!) pointed out that VS RTM requires W8 RTM too. Why don't you state this in your download page, Microsoft? What a big waste of time (and bandwidth, and time). Unbelievable.

Friday, August 10, 2012

IMAP module for PHP in Mac OS X Mountain Lion

So here it comes again. I have recently upgraded to Mountain Lion and for whatever reason, Apple decided to nuked all my previous PHP (among other things) configurations so I have to setup IMAP in PHP again. A simple Google search may point you to this post with detailed instruction for Lion however, some steps have been changed a bit...

Step 1: Install prerequisites

You may choose to download Xcode (FREE) from the App Store then go to menu Xcode > menu item Preferences > tab Downloads, select to install Command Line Tools OR you can go to Apple Developer to get it, you may need to login.

Step 2: Compile IMAP

Get the IMAP source code from University of Washington website. Please do me a favor and check that website for the latest version, it's good practice. If you that lazy, try to click the "y" to get direct link to 2007f version.

Extract the package and open the Terminal to the new directory before executing these command:

  1. make osx EXTRACFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp"
  2. sudo mkdir /usr/local/include/
  3. sudo cp c-client/*.h /usr/local/include/
  4. sudo mkdir /usr/local/lib/
  5. sudo cp c-client/*.c /usr/local/lib
  6. sudo cp c-client/c-client.a /usr/local/lib/libc-client.a

(1) may take a while because the machine need to compile quite a few files for IMAP. Warnings are okie (I got 3 warnings) but if you see some error, that's not good. Please use some Google-fu to figure it out before continuing.
(2) and (4) may tell you the directory has already exists, that's okie and expected.

Step 3: Compile IMAP module for PHP

Following the instruction from PHP: Git Access page to get the source code of PHP. Please note that you should get the same version as the installed PHP engine. By default, Mountain Lion uses PHP 5.3.13 (check this by executing "php -v" in your Terminal).

Basically, you will need to execute 2 commands:
  1. git clone https://github.com/php/php-src.git php-src
  2. cd php-src
  3. git checkout PHP-5.3.13
(1) may take a long time depending on your internet connection because the repo is huge.
(2) will check out the branch for a specific PHP version, because my machine uses PHP 5.3.13, I choose the branch "PHP-5.3.13", switch it to match your system.

In order to compile the IMAP module, execute these commands:
  1. cd ext/imap/
  2. phpize
  3. ./configure --with-imap=/usr/local/imap-2007 --with-kerberos --with-imap-ssl
  4. make
  5. sudo cp modules/imap.so /usr/lib/php/extensions/no-debug-non-zts-20090626/
I don't know why Daniel (the author of the original instruction post) got problem compiling IMAP module for PHP (he said PCRE is missing). Probably the PHP shipped with Mountain Lion got PCRE already so the above 5 commands is all I need. Ivan pointed out that Mountain Lion is not shipped with PCRE so you will need to install it yourself.

Now you only need to modify the php.ini file to include the new imap.so module. Use your favourite editor to open the file /etc/php.ini (sudo is required to save it FYI), and add this at the end of the file:

; added IMAP module at

Step 4: Enjoy

You are now good to go. Restart Apache as necessary using this: "sudo apachectl graceful".

That's it. Good luck!

Happy I got some follower!


The little things that matter!
More sites should do this. But they should have some limit in place because users will not want to receive this kind of mail every day. Once a month is too much already. For the record, this is the first one I got from Tumblr -- that's why I'm so excited!

Wednesday, August 8, 2012


It has been such a long time but today, August 8th, 2012, I have just found out that a homepage which was designed by me years ago (circa 2007?) is still up and running here http://www.updatesofts.com/.

It is the homepage for UpdateSofts forums. A kinda underground one where I used to come to get warez in the early days. It was the largest one in Vietnam for quite a long time (in warez, probably the second largest one in general being below DDTH). But no more now I think, people are now a little bit better when it comes to software piracy, they will try to buy it when it's possible especially when many international software companies have resellers in Vietnam (namely Kaspersky, Microsoft, etc.) with a good pricing for the market. I remember the time when software and game store popped up everywhere. It's so easy for highschool boys to visit one of them on the way home, spent a few minutes reading the "NEW GAME" list and paid eight thousand VND (an equivalent of $0.5 at the time) to buy the game CD. So easy! Getting the operating system or utilities is basically the same, just get to the store, pick up some CDes: one for the Microsoft Windows XP SP3 Professional, one for Microsoft Office 2003 Professional, etc. (I feel bad for Microsoft now hehe). When internet access became better, people only need the OS disc, the rest can be downloaded from sites like UpdateSofts. Good days! I was the 338th member of the site. I think I joined the same month it lauched. Mostly because one of the site founder is my all time favourite people (ngocha85, please do not think it's a girl, he chose his wife's name as his username across almost every site I know).

Back to the homepage, looking back to the source code I'm glad I put a few credits to myself back then.

This is the second line in the source code

Not sure why it's here though. Probably because I put the HTML page up in my website so Mr. QAD can get it easily. Back in that days, I was "feelXtheXlife" in "The Life Corp" with my buddies in highschool. Good a picture that I took a long time ago here too, haha:

And this is taken from the metadata section of the HTML page:

content=Pon name=author>
content="© Pon" name=copyright>

Not bad I would say. I knew enough back then to use quotes with string like "© Pon" but skip them when it's possible. Quite smart eh!? But as I looked further into the mark up, it's clear that I used something like Microsoft Frontpage to create the page (all the tags are in UPPERCASE, perfect-but-inconsistent usage of quotes, generator as "MSHTML 6.00.5700.6" in the metatag). But it's still quite good of myself I think.

Talking about the CSS, I made the page not long after learning about a technique that create smooth border without images (back in that time, border-radius haven't existed yet, people have to use images to create them). The trick was using 3 level of containers and make them a few pixels smaller than each other so we have a quote-smooth border effect. In the HTML page, the main CSS selector is ".kutebox", so cute!

I have put the entire HTML page up here just in case the site decides to remove it in the future. I certainly do not hope so! http://files.daohoangson.com/public/www.updatesofts.com.html

Saturday, March 31, 2012

Announcing Vietnames Input Method for XenForo

(tiếng Việt ở dưới)

Today I'm announcing the release of Vietnamese Input Method for XenForo as an extremely easy to use add-on.

This add-on does not just insert a simple <script /> tag into every page of your site. It went far than that and create a few additional option in account/preferences page so logged in users will be able to configure their typing preferences once and for all (so if a user uses multiple machine, it still works as expected).


Add-on này tích hợp bộ gõ mudim cho XenForo. Hỗ trợ trình soạn thảo WYSIWYG trên máy tính để bàn cũng như trình soạn thảo chuẩn cho các thiết bị di động (Android, iOS,...). Sau khi cài đặt thành viên có thể vào trang account/preferences để cấu hình bộ gõ theo mong muốn, các lần đăng nhập sau hệ thống sẽ tự động cấu hình bộ gõ (như vậy nếu có ai sử dụng nhiều máy tình khác nhau thì các tuỳ chọn vẫn được giữ cố định). Trong trường hợp không đăng nhập (khách), sẽ hiển thị khung cấu hình ở cuối trang.

  • Download add-on tại đây: xfrocks.com
  • Bản dịch tiếng Việt (mặc định là tiếng Anh) đã có sẵn trong file .zip 

Friday, March 16, 2012

Silly Wordpress (dot com)

Today when I tried to make a comment on my friend's blog. This happened to me

That email address is associated with an existing WordPress.com account, please log in to use it.
I thought that was cool and tried to log in with my email address but because I have never logged before (didn't remember that I signed up), I couldn't  and ended up selecting the "forgot password" link.  Clicked the "reset password" link in the incoming email. Typed a new password twice and then logged in (typed the same password again). Went back via Chrome history to open the blog trying to comment. Noticed the black bar at the top indicating that it recognized me as a logged in user. Typed my comment again (fortunately, it was quite short). And then... BOOM. The same error message! Confused, I swiped back to the page, ⌘+R to refresh the page, typed the comment one more time (it was much shorter fyi) and once again, the same message. This is so frustrating! Hey WordPress dot com, you did so many things wrong!

  1. If I don't create an account in your server, please do not do it for me! I know I didn't create an account because after logging in, I found no blog associated with the account. Who on Earth registers on WordPress dot com without creating a blog?!
  2. If something is not broken, please don't fix it. This quote is so famous (I got it slightly incorrect, it should be "If it ain't broke, don't fix it") but why you still did that? The original WordPress comment procedure is too good for you to keep it? At first it surprised me because you can comment without registering, just put your email and address and be done with it. And then I was thrilled because I can comment pseudo-anonymously on a huge network of sites with my avatar attached, that's soooo cool (it utilizes Gravatar fyi). Lastly, it remember my information so next time I visit the same site I can comment as easy as possible.
  3. This one is minor but.. whatever, here it goes: if I typed a new password twice, can't you just save me the trouble and log me in automatically? Why I have to type it for the third time? Some modern sites don't even require password confirmation, you can always reset it via email. You are asking me about email confirmation? Hell, if I mis-typed my email address, I may just throw it away and create a new account. The old one isn't mine anyway LOL
  4. And finally: if I spent the time to log in, at least allows me to comment on a blog!

Saturday, March 10, 2012

When I said vibrate, you should do that

So I upgraded my old-ish P500 to ICS one or two weeks ago. Nothing complicated, step by step below

  1. Download the ROM here. The thread specifically mentioned "GEEK ONLY". At the time of this writing, the latest version is beta 4. It's quite solid. Good battery mileage. All fundamental modules are working with the exception of Camera.
  2. Reboot into recovery and flash it. Before trying ICS, I used CM7 + CMW so it should be easy. In case you are curious, I was using this ROM. I used version 6.6. Now it's a little out dated but when I tried it, it was the first and the only CM7 ROM for P500. 
  3. After the flash, not reading the instruction very carefully, I wiped basically everything and boot it up. OMG IT WORKED. Beautiful home screen and the new overall style. I was quite satisfied.
  4. Browsing around for a while then I tried to go to the Market only to realize I have no Google apps installed. This is a common thing so I wasn't surprised so much, just need to grab the latest gapps package and flash it together (the package is here). 
  5. Another problem: I have no signal whatever! Wifi is working very good (which is a rare thing with new ROM) but no phone signal. I started to freaked out a bit since this is the only phone I got and I need it to work as a phone (to call and text).
    1. Wiping didn't solve the problem.
    2. Reflashing didn't work out.
    3. Reading through the first few pages and last few pages didn't yield any useful piece of information. Nobody encountered this before me? Hmm, maybe there's some problem with Viettel network? Anyway, I stumbled upon a quoted post of the instruction, basically it said the ROM only supports new baseband. Hmm, did my phone have the new baseband? I didn't remember anything about updating baseband. Hmm, the baseband line in the info page showed "Unknown". Not a good thing at all so I went out and use this tool to update the baseband.
    4. The biggest problem is it's a Windows app. Lucky me, still have the old IBM T42 laying around so booting it up is not a big problem. Took a while to install the LGE drivers though. And then praying! The app is ridiculously slow! And then it failed! Scared the sh!t out of me!
    5. Booting the phone gave me a black screen with alien text. J/k, it was English but very unfriendly. Basically the boot sequence is fcuked up so the phone couldn't boot! Agrrrr!
    6. Searching around with the error message didn't help at all but at least I found out that the app actually saves a backup copy before it starts working so it should be possible to restore using the backup.
    7. And it worked! The phone booted normally again and with phone signal! LOL, I have no idea why it turned out like that. Actually, the app reported error messages after the restoration so I just guess that app is poorly coded or something like that.
  6. So now I have the shiny new ICS installed and working on my P500. Restoring apps with Titanium Backup is fast. Contacts and other stuff are restored from Google's servers. All is well... so far.
A few days in, I turned on 3G but the battery dies too fast so I have to use 2G only and it's better. 3G is known to kill battery so I don't complain anything. But then it hit me: the one important reason why I sticked with CM7 for so long is because the phone vibrates when I call and the receiver pick up. Because of that feature, I can press call then do something else instead of put the phone to my ear. This is simply a convenient thing, not that I think it will reduce cancer or else... I just love that feature and this ROM doesn't have it! Searched around and there are a few apps available but they all seems to be not good enough so I decided to modify the Phone app to make it vibrate! Again, step by step below
  1. Grab the CM9 source code (reading this).
    1. There is no instruction for P500 at the time so just use SGS instruction instead.
    2. I don't follow the instruction all the way though, I skipped steps that are too complicated or steps that I thought is not related (mostly because I'm lazy, LOL)
    3. In the "Install the repository" step, instead of the given "repo init" command, you should use this instead "repo init -u git://github.com/CyanogenMod/android.git -b ics" (to get the ICS branch)
    4. After "repo sync", go to step 2. You don't need to copy priority files and such
  2. Get the device files from here. You will need to create the directory /device/lge, step by step below (assuming you are at the disk root)
    1. cd device
    2. mkdir lge
    3. git clone https://github.com/lupohirp/android_device_lge_p500.git p500
  3. Get the vendor files from here. Step by step (assuming you are at the disk root)
    1. cd vendor
    2. git clone https://github.com/lupohirp/android_vendor_lge_p500.git lge
  4. I had to read quite a bit of code + do many experiments but in the end, the required change is just a few lines. I got the diff uploaded here.
  5. To build the Phone app, type this into Terminal (assuming you are at the disk root)
    1. lunch cm_p500-userdebug (I knew about this because I read the file device/lge/p500/vendorsetup.sh, if you are building for other devices you will find the lunch combo in a similar place)
    2. make Phone
  6. To get it on your phone, it's a little bit complicated but here are the basic steps (assuming you are at disk root + have adb in your PATH)
    1. adb remount
    2. adb shell
      1. rm /system/app/Phone.apk 
      2. exit
    3. adb push out/target/product/p500/system/app/Phone.apk /system/app/Phone.apk (the built apk file path will be presented to you after it's generated)
That's it. I thought this is a short post but it's quite long actually. Sorry. Below are some search phrases that people may use to search for this kind of thing (like I did and found nothing!)
  • how to build android from source (hmm, this is too generic I think)
  • how to build cm for p500
  • how to build cm9 for lg (I cheated a bit here)
  • how to build individual app from android source (yeah, I searched for this)
  • how to build stock app for android
  • how to build android phone app (use "make Phone" like I did)
  • how to build android contacts app (use "make Contacts")
  • (I ran out of ideas, hehe)