File Uri Scheme and Relative Files

In short, a file URL takes the form of: file://localhost/absolute/path/to/file [ok] or you can omit the host (but not the slash): file:///absolute/path/to/file [ok] but not this: file://file_at_current_dir [no way] nor this: file://./file_at_current_dir [no way] I just confirmed that via Python’s urllib2.urlopen() More detail from http://en.wikipedia.org/wiki/File_URI_scheme: “file:///foo.txt” is okay, while “file://foo.txt” is not, although some interpreters … Read more

REST API DESIGN – Getting a resource through REST with different parameters but same url pattern

In my experience, GET /users/{id} GET /users/email/{email} is the most common approach. I would also expect the methods to return a 404 Not Found if a user doesn’t exist with the provided id or email. I wouldn’t be surprised to see GET /users/id/{id}, either (though in my opinion, it is redundant). Comments on the other … Read more

Open Facebook page from Android app?

This works on the latest version: Go to https://graph.facebook.com/<user_name_here> (https://graph.facebook.com/fsintents for instance) Copy your id Use this method: public static Intent getOpenFacebookIntent(Context context) { try { context.getPackageManager().getPackageInfo(“com.facebook.katana”, 0); return new Intent(Intent.ACTION_VIEW, Uri.parse(“fb://page/<id_here>”)); } catch (Exception e) { return new Intent(Intent.ACTION_VIEW, Uri.parse(“https://www.facebook.com/<user_name_here>”)); } } This will open the Facebook app if the user has it installed. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)