Skip to main content


Showing posts from 2014

The new UISplitViewController, Swift and iOS 7

I was playing around with Swift today and stumbled upon the new awesome UISplitViewController  in iOS 8. This enhanced version of the controller makes it work for all iOS devices (originally, it only works with iPads). With the introduction of the "phablet", Apple had to improved their SDK to make it easier for devs to build app that works across all screen sizes. That's a good thing, but a little too late IMHO. Anyway, back to UISplitViewController, the app created by the Xcode template only works with iOS 8 so I tried to dig in and see if it is possible to support iOS 7 with the same code, same storyboard and everything. It looked like it was possible. Many people tried that, particularly this blog post , but the best solution out there still doesn't have it working smoothly in iPad portrait mode where it should show a button to open the master view in a popup... After a few hours looking around, I finally found the solution and have a demo project available at g

The Cloud

It's such a good feeling to get a new phone and within minutes you have it running exactly as you like, thanks to the Cloud. The Cloud has its up and down ( "Nobody understands the Cloud. It's a fucking mystery!" ), yes but what else doesn't? Even people have their freaking mood swings. All major players are improving their offering to tie users to their Clouds because that strategy pulls in customers for them and also helps with competing in the market. And it works. The Cloud comes in many shapes and forms but in general, user experience is way better. Everyone can do whatever they want fast, securely and conveniently (given that they have a decent internet connection of course). I really think the Cloud will be the future. Everything we are going to do will be on the Cloud. The pieces of hardware we have in the house, at our workplaces or in our pockets are just terminals. They could be broken, water damaged or stolen, who cares! Insurance would just replace

Happy Life it is.

TL;DR #1: Sylvie and I are getting married on July 20th. TL;DR #2: Graphic designing is freaking hard. We intended to design a save the date card to announce it to our friends. We searched for ideas with Google Images + Pinterest and ended up with this particular poster design . At first, Sylvie was supposed to design it but she got so busy that she missed the deadline of March 31st. I took over and came up with the very first draft using Adobe Photoshop CC. The three photos used as the background had the best scores in our vote contest: at first we looked through photos in Picasa (the desktop application) and put everything we liked in an album. Second step, we removed unsuitable ones until five were left. Last step, Sylvie and I gave scores for the last five between 1 and 5, the final score is the sum of her score and mine. The draft pretty much followed the original idea but the background were not very nice so Sylvie used some online tool to add effects to it. The lef

Trying HHVM

So I was trying HHVM on a VPS when I encountered the error "list sub-command REMOVE_AT requires list to be present". Having no idea of what it is, I tried a Google search and ended up with a page of results (5 or something with half of them in Chinese) and no pointer at all... The full stack is like this CMake Error at CMake/EXTFunctions.cmake:8 (list):   list sub-command REMOVE_AT requires list to be present. Call Stack (most recent call first):   hphp/runtime/ext/imagick/config.cmake:12 (HHVM_LINK_LIBRARIES)   hphp/runtime/ext/CMakeLists.txt:24 (include) So I went in... vi CMake/EXTFunctions.cmake Found some macro definitions and some function declarations. The two things that caused error are both macro so I change them to function and it works! See the edited file here . At least CMAKE worked and now I'm running MAKE. I will update this post when I got HHVM running. So HHVM has been compiled and ran smoothly on my box. I submitted a pull req


I read two articles today: One:  We’re F****D, It’s Over: Coming Back from the Brink Two:  How I Fired Myself. These paragraphs stood out: One I remember Hotmail’s CEO Sabeer calling us all in a room. “Hey, Rex (the COO), how long will it take to restore the email from the tape backups?” And I’ll never forget his answer: “Um, those got really expensive, so we stopped doing them about a month ago.” Gulp. Long … painful … silence. Two I found myself on the phone to Rackspace, leaning on a desk for support, listening to their engineer patiently explain that backups for this MySQL instance had been cancelled over 2 months ago. Ah. God, that's painful to read. It gave me chills... Note to self: Backup all the thing. Never cancel backup services. And test backups to make sure they work!

XenForo WordPress bridge (again)

A long long time ago, I started working on WordPress 3 Bridge for XenForo . I think it was one of the first work that I have done, the idea back then was pretty simple: find XenForo directory, load the session then find the connected WordPress user... It worked for awhile but because loading XenForo bootstrap code is slow and the two system architectures are different from each other (XenForo is MVC while WordPress is still procedure), there was a lot of bugs. It took hours to make it work nicely with other WordPress plugins. When XenForo moved to Resource Manager for add-ons, the plugin thread is locked at 37 pages. I haven't work on it since then. In the meantime, a few other solutions popped up but for some reason they died relatively quick... Enter [bd] API , it exposes XenForo data in a systematic way and uses OAuth 2 to authenticate users. Quite powerful. I have developed a bridge solution to connect two XenForo installation and it worked well so this time I went to develop

Text Messaging

Many people asked me to use OTT solutions like WhatsApp, Viber, LINE but I quickly uninstall those apps after a while because of two reasons. Firstly, there is no one-thing-fits-all solutions which means you will need to install a bunch of similar apps because different group of people use different service. God, that's tiresome and kills battery. There are decentralized protocols to fix this very issue but they are too good to be true I guess, even Google backed out from supporting XMPP by dropping their Google Talk service. I believe there are companies working on this front right now (or maybe I should?). They should make a solid server implementation AND clients using established standards, big plus if they stick some open source license in their code and publish them all. Provide good user experiences while allow user to control their data and federate between different system as needed. The second reason is backup. No services that I know of provide a way to conveni