Monday, August 27, 2012

UIWebview.loading in iOS 6 fixed


Apple changed (or fixed) UIWebView.loading property in iOS 6 (Beta).

Details:
When you load a page with multiple frames, (void)webViewDidFinishLoad:(UIWebView *)webView is notified multiple times. On that notification, if you check uiwebView.loading property

In iOS 6 (beta 4): 
You will get loading == YES, until all the frames are loaded.
// And that's more intuitive

In iOS 5:
You will get loading == NO on the very first frame completion. 
// So it was rather hard to know when all the frames are done loading.

So now showing a spinner until webview is fully loading should be more reliably shown.

Wednesday, May 2, 2012

Git copy repository

Let's say I had test codes in separate repository (e.g. git@bla.com:test.git).

I wanted to get rid of test repo and move its stuffs to main project_x repository (let's say it is  git@bla.com:project_x.git). And of course we want to keep the history of test project.

Quick notes on two git concepts required:

  • git remote:
    try "git remote -v", you will see a list of remote repository locations, with alias 'origin'. Git automatically created origin alias when you cloned. 
  • git pull <a> <b>
    It 'fetch'es the changes in <a> and will merge those to <b>
Now here is how all the 'copy'ing is done:

#go to the projec_x repo
#add the 'test' alias
git remote add test git@bla.com:test.git

# Test if now there is 'test' alias
git remote -v 

# Pull all the changes in test and merge to master
git pull test master

# We no longer need the alias
git remote rm test

# Push
git push

Friday, January 27, 2012

Dell pc suite troubles adb

I suddenly started to have a lot of problems connecting my device to adb.

I was pretty frequently getting this error

** daemon still not running error: cannot connect to daemon


I restarted computer, restarted the device (Samsung galaxy SII)... but no luck.

In the end it turned out, Dell pc suite was causing some problem. And that explains why I suddenly I started to get this problem.. coz I recently installed dell pc suite for my Dell streak.

I uninstalled Dell PC Suite.. and voila!! No more problems!

Thursday, January 5, 2012

HTTP Delete

We needed a api from our server team to remove a few resources in one shot. The server guy implemented a http DELETE rest api, and to support multiple resource removal in one shot, he decided to take the resource ids in the payload.

But one thing he missed, http protocol does not specify that there can be payload in the delete method. (and it's no more a REST api if it contains payload in delete, right?)

Looks like some http implementations in fact allows payload and that's why in his test, there was no problem.

But when I tried to request that from Android, voila... exception telling DELETE cannot write.