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!
KISS!

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)