This tutorial is heavily based on Rupert’s article here. However, the steps in this article are very different on some points. There are some steps that I had to figure out using other sources. Generating OpenStreetMap tiles database We’re going to use downloadosmtiles.pl to download OSM tiles for a specific region. Download, compile, and install [...]
In Android, if you provide custom background images for buttons, you will lose the pressed and disabled image effects. The common way to fix that is to provide additional images for those states. I’m lazy and I find this inconvenient especially during the prototyping phase of app development. I’ve always liked the way iOS automatically [...]
I discovered this by accident. It’s probably been there for a long time but I just noticed it now. Normally, if you have very few rows in your table, it would look like this: Notice that I only have 2 rows. The other empty ones still have empty separator lines. Sometimes that’s not what you [...]
We have switched from Apache to Nginx a month ago. PHP is running on FastCGI using PHP-FPM. I have just recently tried to debug our app using FirePHP and got a 502 Bad Gateway response from Nginx. It looks like Nginx by default limits the header output. This is the error in Nginx’s error log: [...]
I was working on a utility class and was playing with the idea of using the id of an object (e.g. NSObject) as a key in NSDictionary. Setting it directly doesn’t work though: NSObject *obj = [[[NSObject alloc] init] autorelease]; // we’ll use this as the key NSMutableDictionary *dict = [[[NSMutableDictionary alloc] init] autorelease]; [dict [...]
So I was able to partition a Macbook Pro 2010 (Snow Leopard) using Boot Camp in order to install Windows 7. I just want to point out this possible solution when you get this error when trying to create a partition: Your Disk Cannot Be Partitioned Because Some Files Cannot Be Moved Back up the [...]
This is a quick fix for PHP errors like these on a Media Temple DV: Warning: include_once() [function.include-once]: open_basedir restriction in effect. I got this a few days ago when trying to setup an app. There are instructions in Media Temple’s site on how to fix this but this set of steps is what worked [...]
This article assumes that you are familiar with the Facebook SDK Core Concepts and know how to request a user’s access token. This also uses the Facebook PHP SDK. Getting the list of friends You can get the friends of a Facebook user using this FQL query: SELECT uid FROM user WHERE uid IN (SELECT [...]
This was tested on CentOS 5.6 on a fresh MediaTemple (dv) setup. I figure it should be the same for any CentOS install. This set of instructions is a result of hours spent on installation troubleshooting; google searches; and trial and errors. Hopefully this can help other people. Install dependencies These are needed to enable [...]
To integrate libraries using namespaces into a Yii Framework project, you can simply use Yii::setPathOfAlias to have the classes autoloaded by Yii when needed. Just specify the root namespace as the alias and the physical location of that root alias as the path. Using Predis as an example, if we put the code in: /vendors/predis/lib/Predis [...]