<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9484269</id><updated>2026-07-31T16:34:36.287+08:00</updated><category term="Mac"/><category term="iOS"/><category term="LearningNotes"/><category term="Xcode4"/><category term="WWDC2010"/><category term="General"/><category term="Lion"/><category term="Animation"/><category term="Block"/><category term="GrandCentralDispatch"/><category term="Web"/><category term="Cocos2D"/><category term="Git"/><category term="LLVM"/><category term="WWDC2011"/><category term="AppExtension"/><category term="AppKit"/><category term="CoffeeScript"/><category term="Emoji"/><category term="Forever"/><category term="Game"/><category term="Keyboard"/><category term="Node.js"/><category term="RubyOnRails"/><category term="SocialNetwork"/><category term="TimeMachine"/><category term="testing"/><title type='text'>Vince Yuan&#39;s blog (ABANDONED, please visit http://vinceyuan.github.io )</title><subtitle type='html'>This site is ABANDONED. Please visit http://vinceyuan.github.io</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>52</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9484269.post-2130916651838657559</id><published>2015-09-04T08:53:00.001+08:00</published><updated>2015-09-04T08:53:08.508+08:00</updated><title type='text'>I migrated my blogs to http://vinceyuan.github.io</title><summary type="text">This site is ABANDONED. Please visit http://vinceyuan.github.io.</summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/2130916651838657559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/2130916651838657559' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/2130916651838657559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/2130916651838657559'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2015/09/i-migrated-my-blogs-to.html' title='I migrated my blogs to http://vinceyuan.github.io'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-3341465296943063205</id><published>2015-06-08T12:39:00.002+08:00</published><updated>2015-06-08T12:39:20.469+08:00</updated><title type='text'>Managing Docker images with tags</title><summary type="text">When you build Docker images many times, you will find it is very necessary to manage images with tags.
If you build an image without a tag, the default tag &#39;latest&#39; is created automatically.
docker build -t company/myimage .
The complete name is company/myimage:latest

When you need to update a new version of company/myimage, you don&#39;t need to create an image company/myimage_v2. You should </summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/3341465296943063205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/3341465296943063205' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/3341465296943063205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/3341465296943063205'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2015/06/managing-docker-images-with-tags.html' title='Managing Docker images with tags'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-7980051633832795504</id><published>2015-05-30T12:09:00.002+08:00</published><updated>2015-05-30T12:09:41.454+08:00</updated><title type='text'>Docker Tricks and Tips</title><summary type="text">Recently I deployed my node.js app, Redis, Postgres, Nginx with Docker and wrote a tutorial. I want to share you with some tricks and tips about Docker.


Choose Debian as the base image.
Debian image is much smaller than other OS images. It is recommended in Docker&#39;s official best practices. A problem is the packages in Debian apt are not always latest. I think Debian only likes the very stable </summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/7980051633832795504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/7980051633832795504' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/7980051633832795504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/7980051633832795504'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2015/05/docker-tricks-and-tips.html' title='Docker Tricks and Tips'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-5684853015110654006</id><published>2015-05-29T23:33:00.000+08:00</published><updated>2015-05-30T12:11:35.279+08:00</updated><title type='text'>Restoring/Backing up Postgres Database in a Docker Container</title><summary type="text">In the previous tutorial, I show you how to deploy a web app, Redis, Postgres, Nginx with Docker. This post shows you how to restore and backup Postgres database which is running in a Docker container. You can get all source code at&amp;nbsp;https://github.com/vinceyuan/DockerizingWebAppTutorial.

I use pg_dump to dump a database to a text file. And then zip and upload it to Amazon S3 with a handy </summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/5684853015110654006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/5684853015110654006' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/5684853015110654006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/5684853015110654006'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2015/05/restoringbacking-up-postgres-database.html' title='Restoring/Backing up Postgres Database in a Docker Container'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-4360445124973298541</id><published>2015-05-29T21:56:00.002+08:00</published><updated>2015-05-30T12:10:48.029+08:00</updated><title type='text'>Deploying a Web App, Redis, Postgres and Nginx with Docker</title><summary type="text">This tutorial introduces how to deploy a web app, Redis, Postgres and Nginx with Docker on the same server. In this tutorial, the web app is a node.js(express) app. We use Redis as a cache store, Postgres as the database, and Nginx as the reverse proxy server. You can get all source code at&amp;nbsp;https://github.com/vinceyuan/DockerizingWebAppTutorial.



Why Docker
Docker is a virtualization </summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/4360445124973298541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/4360445124973298541' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/4360445124973298541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/4360445124973298541'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2015/05/deploying-web-app-redis-postgres-and.html' title='Deploying a Web App, Redis, Postgres and Nginx with Docker'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-1440540405320023547</id><published>2015-05-08T14:35:00.000+08:00</published><updated>2015-05-08T14:35:54.718+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AppExtension"/><category scheme="http://www.blogger.com/atom/ns#" term="Emoji"/><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="Keyboard"/><title type='text'>High memory usage of Emojis on iOS</title><summary type="text">Emoji is very popular. I am making a keyboard which contains many Emojis. However, I found the memory usage of Emoji is too high. When the keyboard&#39;s memory usage is high enough, iOS will kill the keyboard immediately. &amp;nbsp;(Looks like the limit is 40mb on iOS 8.3)

The emojis are just unicode characters. Apple renders them with lovely icons, which causes the high memory usage. It&#39;s OK, because </summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/1440540405320023547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/1440540405320023547' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/1440540405320023547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/1440540405320023547'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2015/05/high-memory-usage-of-emojis-on-ios.html' title='High memory usage of Emojis on iOS'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-2161434988311825749</id><published>2014-03-04T23:34:00.000+08:00</published><updated>2014-03-04T23:37:30.351+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Forever"/><category scheme="http://www.blogger.com/atom/ns#" term="Node.js"/><category scheme="http://www.blogger.com/atom/ns#" term="Web"/><title type='text'>Starting Node.js App Automatically on Boot</title><summary type="text">I deployed a node.js app on a server running on CentOS linux. I am using &#39;forever&#39; to keep my node.js app alive. But when the server restarts, we need to let the app run automatically.




We can modify /etc/rc.local to execute commands on boot. The commands should not run under root. And we should set the environment variable NODE_ENV.
sudo vi /etc/rc.local

Add this line at the end of the file.</summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/2161434988311825749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/2161434988311825749' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/2161434988311825749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/2161434988311825749'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2014/03/starting-nodejs-app-on-boot.html' title='Starting Node.js App Automatically on Boot'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-2189638440052811065</id><published>2013-08-26T00:28:00.002+08:00</published><updated>2013-08-26T00:28:55.171+08:00</updated><title type='text'>A Weird Reason Why iOS App is Rejected</title><summary type="text">I made a new iPhone app and submitted to App Store. However, it is rejected because of &#39;Invalid Binary&#39;. And I received an email telling me this:











iPhone 5 Optimization Requirement - Your binary is not optimized for iPhone 5. New iPhone apps and app updates submitted targeting iOS 6 and above must support the 4-inch display on iPhone 5 and must include a launch image with the -568h size</summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/2189638440052811065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/2189638440052811065' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/2189638440052811065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/2189638440052811065'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2013/08/a-weird-reason-why-ios-app-is-rejected.html' title='A Weird Reason Why iOS App is Rejected'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-4591828240138787127</id><published>2013-07-24T00:08:00.000+08:00</published><updated>2013-07-24T01:13:45.688+08:00</updated><title type='text'>Build SQLCipher on Mac OS X</title><summary type="text">SQLCipher is encrypted SQLite. The following are the steps to build it on Mac OS X.

1. Donwload and build OpenSSL code.
$&amp;nbsp;curl -o openssl-1.0.0e.tar.gz http://www.openssl.org/source/openssl-1.0.0e.tar.gz
$&amp;nbsp;tar xzf openssl-1.0.0e.tar.gz
$&amp;nbsp;cd openssl-1.0.0e
$&amp;nbsp;./Configure darwin64-x86_64-cc
$ make
// &#39;make install&#39; if you want to install it
Now we get libcrypto.a in the same </summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/4591828240138787127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/4591828240138787127' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/4591828240138787127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/4591828240138787127'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2013/07/build-sqlcipher-on-mac-os-x.html' title='Build SQLCipher on Mac OS X'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-3206214897136181436</id><published>2012-11-05T09:01:00.000+08:00</published><updated>2013-07-23T22:34:21.435+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CoffeeScript"/><category scheme="http://www.blogger.com/atom/ns#" term="Web"/><title type='text'>Do Not Use CoffeeScript</title><summary type="text">CoffeeScript is not a framework. It is used to generate readable, clean, tight and safe Javascript code.

Pros:
1.&amp;nbsp;Python style whitespacing
2.&amp;nbsp;Ruby styled lightweight syntax

Javascript:
&amp;nbsp; &amp;nbsp; var validate = function(form) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; var required_field_names = [&#39;name&#39;,&#39;email&#39;];
&amp;nbsp; &amp;nbsp; &amp;nbsp; return false;
&amp;nbsp; &amp;nbsp; }
Coffee:
&amp;nbsp; &amp;nbsp; validate = (form</summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/3206214897136181436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/3206214897136181436' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/3206214897136181436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/3206214897136181436'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2012/11/learning-coffeescript.html' title='Do Not Use CoffeeScript'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-1136857859435666672</id><published>2012-07-20T14:58:00.000+08:00</published><updated>2012-07-20T14:58:15.677+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><title type='text'>Can&#39;t dismiss keyboard on iPad (Solution inside)</title><summary type="text">Sometimes, you see the following code of dismissing keyboard not working on iPad but working on iPhone:

[_textField resignFirstResponder];

That&#39;s because a modal view in&amp;nbsp;UIModalPresentationFormSheet mode on iPad ignores it by default.

To let it work, we need to add this method into your view controller:

- (BOOL)disablesAutomaticKeyboardDismissal {
&amp;nbsp; &amp;nbsp; return NO;
}



If your </summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/1136857859435666672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/1136857859435666672' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/1136857859435666672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/1136857859435666672'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2012/07/cant-dismiss-keyboard-on-ipad-solution.html' title='Can&#39;t dismiss keyboard on iPad (Solution inside)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-4881814703768689872</id><published>2012-07-20T14:29:00.001+08:00</published><updated>2012-07-20T14:29:41.679+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><title type='text'>Can&#39;t change UITableView background colour on iPad (Solution Inside)</title><summary type="text">If your app is an universal app and you changed the background colour of an UITableView, you will see it works on iPhone but does not work on iPad.

The reason is we can&#39;t modify the background colour of the backgroundView of the tableview on iPad. (I think it is a bug. But Apple does not fix it for years.)

Solution: create a new backgroundView.



_tableView.backgroundView = nil;

</summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/4881814703768689872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/4881814703768689872' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/4881814703768689872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/4881814703768689872'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2012/07/cant-change-uitableview-background.html' title='Can&#39;t change UITableView background colour on iPad (Solution Inside)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-2103176089505425756</id><published>2012-07-12T01:11:00.001+08:00</published><updated>2012-07-12T01:11:27.931+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mac"/><title type='text'>Validate Mac App Store Receipt 2012</title><summary type="text">As many Mac developer did to validate Mac app store receipt, I use roddi&#39;s code (https://github.com/roddi/ValidateStoreReceipt Thanks!). But recently I found it does not work! The code fails to validate the sample receipt.
Because I just restored my machine from TimeMachine. I thought maybe there was something wrong in my dev environment. I spent a lot of hours to make sure my development </summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/2103176089505425756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/2103176089505425756' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/2103176089505425756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/2103176089505425756'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2012/07/validate-mac-app-store-receipt-2012.html' title='Validate Mac App Store Receipt 2012'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-3617920935863460007</id><published>2012-05-11T21:22:00.001+08:00</published><updated>2012-05-11T21:22:50.705+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="RubyOnRails"/><category scheme="http://www.blogger.com/atom/ns#" term="Web"/><title type='text'>Debug Ruby on Rails with Aptana Studio 3</title><summary type="text">1. Check if ruby-debug-ide is installed
$ gem list
2. If not installed, install ruby-debug-ide
$ gem install ruby-debug-ide3. Open the project in Aptana Studio 3, App Explorer -&amp;gt; Gear icon&#39;s drop down menu -&amp;gt; Debug Server



4. Set a breakpoint in a file, e.g. index.html.erb
5. Open http://localhost:3000/&amp;lt;your path&amp;gt;/index.html in your browser
6. Aptana will ask you if open Debug </summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/3617920935863460007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/3617920935863460007' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/3617920935863460007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/3617920935863460007'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2012/05/debug-ruby-on-rails-with-aptana-studio.html' title='Debug Ruby on Rails with Aptana Studio 3'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-7377018013043230387</id><published>2012-03-14T18:14:00.001+08:00</published><updated>2012-03-14T18:14:39.530+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="Mac"/><category scheme="http://www.blogger.com/atom/ns#" term="Xcode4"/><title type='text'>Rebuilding Code Sense and Syntax Highlighting on Xcode 4</title><summary type="text">Sometimes syntax highlighting does not work on Xcode 4. Syntax highlighting is an important feature to developers. But there is no &quot;Rebuild Code Sense&quot; menu on Xcode 4. We can do it with following steps:
1. Xcode menu: Window-&amp;gt;Organizer
2. Go to Projects tab
3. Choose your project on the left panel.
4. Click &quot;Delete…&quot; button after the Derived Data on the right panel.
Xcode will start to </summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/7377018013043230387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/7377018013043230387' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/7377018013043230387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/7377018013043230387'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2012/03/rebuilding-code-sense-and-syntax.html' title='Rebuilding Code Sense and Syntax Highlighting on Xcode 4'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-944061137138197691</id><published>2012-03-08T14:42:00.001+08:00</published><updated>2012-03-08T14:42:52.342+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Git"/><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="Mac"/><title type='text'>Diff and Merge Localizable.strings in git</title><summary type="text">The default code set of Localizable.strings is UTF-16. Actually I don&#39;t care what code set it is. But git/gitX/SourceTree does not recognize UTF-16 (Stupid!). They treat UTF-16 Localizable.strings as a binary file and reject to diff or merge. This is a very big problem if you work in a team.
Google says we can make git support UTF-16. I tried, but failed. I have to convert Localizable.strings </summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/944061137138197691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/944061137138197691' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/944061137138197691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/944061137138197691'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2012/03/diff-and-merge-localizablestrings-in.html' title='Diff and Merge Localizable.strings in git'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-5619131076514891211</id><published>2012-02-16T09:26:00.001+08:00</published><updated>2012-02-16T09:26:17.445+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><title type='text'>Keyboard notification bug on iOS 5</title><summary type="text">When the soft keyboard appears, we need to re-arrange the UI controls. I move the control up a little bit in keyboardWillShow handler:
frame.origin.y -= CONSTANT;
control.frame = frame;
But there is an annoying bug (or behavior) about non-English language keyboard on iOS 5. If you are using English keyboard, you will receive keyboardWillShow notification once. It is good. But if you are using </summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/5619131076514891211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/5619131076514891211' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/5619131076514891211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/5619131076514891211'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2012/02/keyboard-notification-bug-on-ios-5.html' title='Keyboard notification bug on iOS 5'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-1059982260520946715</id><published>2011-12-27T23:29:00.001+08:00</published><updated>2011-12-27T23:29:09.813+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AppKit"/><category scheme="http://www.blogger.com/atom/ns#" term="Mac"/><title type='text'>Scroll NSScrollView to Top</title><summary type="text">AppKit is old and is not as convenient as UIKit. But we have to use it on Mac app development.
&quot;Scroll a scrollview to top&quot; sounds easy, but actually it isn&#39;t. If you assign a documentView to a NSScrollView, you will see it scrolls to the bottom. (Very stupid!) The doc did not mention how to scroll to top. I found a way to control the vertical scroller. I can set the scroller to top, but the </summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/1059982260520946715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/1059982260520946715' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/1059982260520946715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/1059982260520946715'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2011/12/scroll-nsscrollview-to-top.html' title='Scroll NSScrollView to Top'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-8298429791139292557</id><published>2011-12-09T20:03:00.001+08:00</published><updated>2011-12-09T20:03:21.295+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mac"/><title type='text'>Wrong info from proc_pidinfo</title><summary type="text">proc_pidinfo is a very useful function to get a Mac OS X process&#39;s info such as the size of resident memory, consumed CPU time.
However, sometimes, the returned info is not correct. For example, a little process&#39;s resident memory becomes 4GB. Apple does not provide any document about this function, and I did not see useful comments in the header files.
I am lucky enough to see code snippet in the</summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/8298429791139292557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/8298429791139292557' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/8298429791139292557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/8298429791139292557'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2011/12/wrong-info-from-procpidinfo.html' title='Wrong info from proc_pidinfo'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-4214542769750622341</id><published>2011-10-18T22:25:00.000+08:00</published><updated>2011-10-18T22:26:04.680+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="SocialNetwork"/><title type='text'>Let Several Apps Use the same Facebook App ID</title><summary type="text">If you want to let your user post something from your app onto Facebook, you need to register a Facebook app and call Facebook SDK to post messages. But if you have a free version and a paid version, you would like to share the same Facebook App ID.
Just follow Facebook tutorial to register Facebook App and config your apps. https://developers.facebook.com/docs/mobile/ios/build/
The only one </summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/4214542769750622341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/4214542769750622341' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/4214542769750622341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/4214542769750622341'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2011/10/let-several-apps-use-same-facebook-app.html' title='Let Several Apps Use the same Facebook App ID'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-5819071528137627144</id><published>2011-10-09T17:35:00.001+08:00</published><updated>2011-11-30T11:48:08.821+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Git"/><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="Mac"/><category scheme="http://www.blogger.com/atom/ns#" term="Xcode4"/><title type='text'>Xcode 4 and Git</title><summary type="text">I am new to Git. I used Perforce (P4) before, so I thought it is easy to use Git. Actually I was wrong. Git is not complex, but it has different concept.
In P4, we just check out and check in files. In Git, checking in has a new name Commit. When I committed my first change, I was surprised to see it does not appear in the server. Actually, Git did not really submit my code to the server. It was </summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/5819071528137627144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/5819071528137627144' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/5819071528137627144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/5819071528137627144'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2011/10/xcode-4-and-git.html' title='Xcode 4 and Git'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-1635314930007630320</id><published>2011-10-04T23:23:00.001+08:00</published><updated>2011-10-04T23:23:45.088+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cocos2D"/><title type='text'>Fixing the Problem of Cocos2D Game Disappearing in iPhone Simulator</title><summary type="text">I Created a new Cocos2D game. But it did not work well in iPhone simulator. It often disappeared in the simulator. I had to relaunch the simulator or relaunch Xcode. It was very boring. I didn&#39;t know why, because this project was still very simple.
I noticed there is a warning that Info.plist is included in the target. I did the following things:
1. Renamed Info.plist to ProjectName-Info.plist
2.</summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/1635314930007630320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/1635314930007630320' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/1635314930007630320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/1635314930007630320'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2011/10/fixing-problem-of-cocos2d-game.html' title='Fixing the Problem of Cocos2D Game Disappearing in iPhone Simulator'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-7244870319854504665</id><published>2011-09-29T15:26:00.001+08:00</published><updated>2011-10-04T23:26:03.707+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cocos2D"/><category scheme="http://www.blogger.com/atom/ns#" term="Game"/><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><title type='text'>Why Use Cocos2D Instead of UIKit to Develop Games</title><summary type="text">I am leaning Cocos2D for iPhone. I am thinking why we should use cocos2D instead of UIKit to develop games.
Here are the reasons:
1. Cocos2D is built on OpenGL. You may not know OpenGL.
2. Cocos2D supports tiled map.
3. Cocos2D helps you reduce memory cost by supporting atlas images and providing CCSpriteBatchNode.
4. Cocos2D supports parallax backgrounds.
5. Cocos2D has more animations and </summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/7244870319854504665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/7244870319854504665' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/7244870319854504665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/7244870319854504665'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2011/09/why-use-cocos2d-instead-of-uikit-to.html' title='Why Use Cocos2D Instead of UIKit to Develop Games'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-8083942340353894862</id><published>2011-08-19T22:50:00.001+08:00</published><updated>2011-08-19T22:53:28.318+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mac"/><category scheme="http://www.blogger.com/atom/ns#" term="Xcode4"/><title type='text'>Add Tool Tip to Controls with Xcode4</title><summary type="text">Like many Apple developers, I was a developer on Windows platform before. It is very easy to add tool tip to a control (e.g. a button) in Visual Studio. But I don&#39;t know how to do it in Xcode. When I am working on iPhone apps, it is not a problem because iPhone apps need not tool tip. But it is a problem when I am working on Mac apps.
Actually it is easy to add tool tip in Xcode 4. Looks like </summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/8083942340353894862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/8083942340353894862' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/8083942340353894862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/8083942340353894862'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2011/08/add-tool-tip-to-controls-with-xcode4.html' title='Add Tool Tip to Controls with Xcode4'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9484269.post-8171965947952153020</id><published>2011-07-18T19:40:00.001+08:00</published><updated>2011-07-22T11:17:34.700+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="General"/><category scheme="http://www.blogger.com/atom/ns#" term="Mac"/><title type='text'>Making Your Mac App Support Full Screen in 1 Minute</title><summary type="text">Full screen mode is a cool feature on Mac OS X Lion. I&#39;d like to let my app support full screen. I googled, but did not find any tutorial. I thought there would be an option like&#39;Support full screen&#39; when a new project is created with the new Xcode 4.1 on Lion. Surprisingly, there is no that option. Today I watched a video of WWDC2011 and made this article. I am sure you can follow the steps to </summary><link rel='replies' type='application/atom+xml' href='http://vinceyuan.blogspot.com/feeds/8171965947952153020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9484269/8171965947952153020' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/8171965947952153020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9484269/posts/default/8171965947952153020'/><link rel='alternate' type='text/html' href='http://vinceyuan.blogspot.com/2011/07/making-your-mac-app-support-full-screen.html' title='Making Your Mac App Support Full Screen in 1 Minute'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07268121275972731120</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry></feed>