博文

Programming for Kids

MIT创建了 Scratch ,对于8岁大的孩子来说,它是一个很好的激发编程兴趣的工具。10岁的小孩就可以更进一步,通过 Greenfoot 开始学习真正地使用Java来编程。 但是我认为,任何12岁以上的孩子,只要对编程有兴趣,就可以一本正经地去学习Java编程了,并且可以使用专业的工具来学。在之前为孩子写的那本书里,我使用Eclipse作为IDE,但在现在这本新书里,我选择了IntelliJ IDEA社区版,它也是免费的。

zepto.js browser compatability

just found something new to me. Zepto.js is a jquery.js compatible JS lib.

Cordova android SSL issue

http://ivancevich.me/articles/ignoring-invalid-ssl-certificates-on-cordova-android-ios/ Ignoring invalid SSL certificates on Cordova for Android and iOS written by  jc ivancevich When developing  mobile apps , it’s very common that we have to connect to web services or APIs which may be secure (https) but are still under development, so its  SSL  certificate is not valid  or self-signed. This would happen unless you want to spend a hundred bucks on a wildcard certificate for development environments. For cases like the mentioned above it’s useful to be able to  ignore errors generated by invalid certificates,  so we can test the app, install it on any device , etc. In order to get rid of this problem, the process changes depending on the platform we’re targeting. iOS (Objective-C / Swift / Cordova) iOS will  always complain  about invalid certificates, either in debug or release mode. To avoid thi...

SVN with Xcode

转自这里: http://blog.csdn.net/brokge/article/details/16807167 http://www.cnblogs.com/gloolo/archive/2011/12/20/2295232.html 首先:xcode目录下的xcode-》preferences-》accounts删除左边栏所有的检出的操作数据 其次:重新打开xcode开始重新checkout 最后:我的成功了Y(^_^)Y http://stackoverflow.com/questions/19177699/using-svn-1-8-3-with-xcode-5 Writing to 'defaults' won't work for Xcode 5. Newer version of Xcode ship with it's own SVN binary located in: /Applications/ Xcode . app / Contents / Developer / usr / bin / You need to replace this binary to upgrade Xcode's SVN client to 1.8. Assuming your new SVN client is located in /usr/local/bin/ (default brew install path) type the following in a terminal: cd / Applications / Xcode . app / Contents / Developer / usr / bin / sudo mv ./ svn ./ svn . org sudo mv ./ svnadmin ./ svnadmin . org sudo mv ./ svndumpfilter ./ svndumpfilter . org sudo mv ./ svnlook ./ svnlook . org sudo mv ./ svnrdump ./ svnrdump . org sudo mv ./ svnserve ./ svnserve . org sudo...

Android Studio SNV 1.8 on MAC

Install xCode Commad Line Tool: http://railsapps.github.io/xcode-command-line-tools.html Upgrade to SVN 1.8: http://www.jarysta.com/2014/10/16/updating-to-svn-1-8-for-mac-os-x-10-10-yosemite/ Make it work with Android Studio: http://andowebsit.es/blog/noteslog.com/post/how-to-upgrade-subversion-on-osx/ SNV 1.8.9 cannot verify the SSL for server use Brew install svn to install 1.8.13 and it works!!! Yay! Finally, it works

JVM垃圾回收优化

JVM参数调优是一个很头痛的问题,可能和应用有关系,下面是本人一些调优的实践经验,希望对读者能有帮助,环境LinuxAS4,resin2.1.17,JDK6.0,2CPU,4G内存,dell2950服务器,网站是shedewang.com,新手可能觉得这文章没有用。  一:串行垃圾回收,也就是默认配置,完成10万request用时153秒,JVM参数配置如下  $JAVA_ARGS .= " -Dresin.home=$SERVER_ROOT -server -Xms2048M -Xmx2048M -Xmn512M -XX:PermSize=256M -XX:MaxPermSize=256M -XX:MaxTenuringThreshold=7 -XX:GCTimeRatio=19 -Xnoclassgc -Xloggc:log/gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps ";  这种配置一般在resin启动24小时内似乎没有大问题,网站可以正常访问,但查看日志发现,在接近24小时时,Full GC执行越来越频繁,大约每隔3分钟就有一次Full GC,每次Full GC系统会停顿6秒左右,作为一个网站来说,用户等待6秒恐怕太长了,所以这种方式有待改善。MaxTenuringThreshold=7表示一个对象如果在救助空间移动7次还没有被回收就放入年老代,GCTimeRatio=19表示java可以用5%的时间来做垃圾回收,1/(1+19)=1 /20=5%。  二:并行回收,完成10万request用时117秒,配置如下:  $JAVA_ARGS .= " -Dresin.home=$SERVER_ROOT -server -Xmx2048M -Xms2048M -Xmn512M -XX:PermSize=256M -XX:MaxPermSize=256M -Xnoclassgc -Xloggc:log/gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+UseParallelGC -XX:ParallelGCThreads=20 -XX:+UseParallelOldGC -XX:MaxGCPauseMi...

S-OFF HTC

Revone Download: http://revolutionary.io/revone Big thanks to the Revolutionary dev team . The original thread can be found here. Written instructions: Download the Revone file above and transfer it to your phone ( or download on your phone) Use a root file explorer and paste the file inside the /data/ local /tmp folder Open a terminal emulator and type of the following: su (enter) cd /data/local/tmp (enter) chmod 755 revone (enter) (IF revone doesn’t work, type revone.bin) ./revone -P (enter) Reboot Open terminal again and type: su (enter) cd /data/local/tmp (enter) ./revone -s 0 -u (That would be a ZERO) (enter) Reboot That’s it! To get rid of the tampered, or relock, follow instructions below To remove “tampered” open terminal cd /data/local/tmp su ./revone.bin -t These are other commands that you can fill in above to  -u – Unlock the device -l – Lock the device (as if it was never unlocked ) -r – Relock the device (mark the device...