## 苹果推送异常处理

I solved the issue in jdk 1.7 and using p12 after changing the passwd length of p12 file greater than or equal 6. Otherwise, the following error happens:
[[1] not transmitted to token 595d8..725bf javapns.communication.exceptions.InvalidCertificateChainException: Invalid certificate chain (Received fatal alert: certificate_unknown)! Verify that the keystore you provided was produced according to specs...]

## MacBookPro自动切换网络和代理

### 困惑

mac电脑这么高级的东西，不至于要让我们自己来做这个重复的工作吧，答案当然是不会。

1. 设置某无线网络的IP
2. 设置是否自动发现代理

## mac安装cocoapods不成功解决办法

cocoapods的安装办法，请参见cocoapods官网
sudo gem install cocoapods

rvm reinstall ruby-2.0.0-p247 --with-gcc=clang --verify-downloads 1 gem install xcodeproj gem install cocoapods 
I found this answer in some old Github issue.

## [Ruby]gemfile.lock文件引发的困惑

Gemfile.lock的英文说明：

When you run bundle install, Bundler will persist the full names and versions of all gems that you used (including dependencies of the gems specified in the Gemfile(5)) into a file called Gemfile.lock.

Bundler uses this file in all subsequent calls to bundle install, which guarantees that you always use the same exact code, even as your application moves across machines.

Because of the way dependency resolution works, even a seemingly small change (for instance, an update to a point-release of a dependency of a gem in your Gemfile(5)) can result in radically different gems being needed to satisfy all dependencies.

As a result, you SHOULD check your Gemfile.lock into version control. If you do not, every machine that checks out your repository (including your production server) will resolve all dependencies again, which will result in different versions of third-party code being used if any of the gems in the Gemfile(5) or any of their dependencies have been updated.

Gemfile.lock用来记录Application中的依赖Gem包，并详细记录了依赖Gem包的版本。当Application的环境发生变化时，我们可以用Bundle update来更新相关依赖包，也可以保持Gemfile.lock不变.

Gemfile的管理是由bundle来做的。下面简单介绍bundle的用法。

bundle show #显示所有的依赖包
bundle check #检查系统中缺少那些项目以来的gem包
bundle install #安装项目依赖的所有gem包
bundle update #更新系统中存在的项目依赖包，并同时更新项目Gemfile.lock文件

## fastjson加载读取json文件

Java的json解析库（fastjson）, 出品于阿里牛人@温高铁

1. VO是我们要解析json的结果对象值。
2. 读取的json一定要合法