<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Kernel Panic</title>
 <link href="http://www.kernelpanic.im/atom.xml" rel="self"/>
 <link href="http://www.kernelpanic.im"/>
 <updated>2016-05-09T06:14:39+00:00</updated>
 <id>http://www.kernelpanic.im</id>
 <author>
   <name>hewigovens</name>
   <email>hewigovens@gmail.com</email>
 </author>

 
 <entry>
   <title>2014, 2015</title>
   <link href="http://www.kernelpanic.im/2015/01/05/2014-2015"/>
   <updated>2015-01-05T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2015/01/05/2014-2015</id>
   <content type="html">&lt;p&gt;最近听 &lt;a href=&quot;http://edgecasesshow.com&quot;&gt;Edge Cases&lt;/a&gt;，&lt;a href=&quot;https://twitter.com/rentzsch&quot;&gt;Wolf Rentzsch&lt;/a&gt;提到他是如何使用 &lt;a href=&quot;https://dayone.me/&quot;&gt;Day One&lt;/a&gt; 的，他会记下很多东西，不仅仅是传统意义的日记，比如学习了什么技术，遇到什么问题，为什么要做某些决定。如果有些他不理解的地方，他会记一个问号，之后要是理解了，会回头改成感叹号。&lt;/p&gt;

&lt;p&gt;我在也决定效仿一下。Day One是一个写日记的 App，iOS/Mac客户端常年被推荐，它默认是 private 的，但你可以选择性的publish；Day One支持 tag，photo，location，markdown，Mac 下还有cli。我现在选择的是 iCloud 同步 + Dropbox备份，也算双保险了。&lt;/p&gt;

&lt;p&gt;jekyll/ghost与之相比，就相当于重型武器了，现在比较喜欢轻量级的工具（比如最近的&lt;a href=&quot;https://qdan.me&quot;&gt;轻单&lt;/a&gt;)，上一年没写什么什么文章，一方面主要是工作上的东西没啥好分享的:(，二是有些没有经过严肃思考的就不了了之了。没有 DPS 的重武器是不是不如有 DPS 的轻型武器呢？当然工具只是一方面，坚持下来更重要，写作还有一个效果是，虽然只是简单的写下来，客观上什么都没改变，主观上却能让人平静下来（效果因人而异）。&lt;/p&gt;

&lt;p&gt;P.S. 如果你不知道 Wolf Rentzsch，他是&lt;a href=&quot;https://github.com/rentzsch/mach_inject&quot;&gt;mach_inject&lt;/a&gt;/&lt;a href=&quot;https://github.com/rentzsch/mach_override&quot;&gt;mach_override&lt;/a&gt;/&lt;a href=&quot;https://github.com/rentzsch/jrswizzle&quot;&gt;jrswizzle&lt;/a&gt;/&lt;a href=&quot;https://github.com/rentzsch/mogenerator&quot;&gt;mogenerator&lt;/a&gt;的作者，现在比较流行的一些双栏 markdown 编辑器，都能看到从&lt;a href=&quot;https://github.com/rentzsch/markdownlive&quot;&gt;markdownlive&lt;/a&gt;看出影子。&lt;/p&gt;

&lt;p&gt;P.P.S. 本来打算写在这里的总结，现在放到了这里&lt;a href=&quot;https://dayone.me/1eSqztn&quot;&gt;https://dayone.me/1eSqztn&lt;/a&gt;，负能量较重，慎点。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>WWDC2014纪行</title>
   <link href="http://www.kernelpanic.im/2014/06/30/wwdc-2014"/>
   <updated>2014-06-30T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2014/06/30/wwdc-2014</id>
   <content type="html">&lt;p&gt;本文首发于《程序员》杂志2014年7月刊&lt;/p&gt;

&lt;p&gt;6月2日~6月6日，一年一度的WWDC（World Wide Developer Conference)在 San Francisco的 Moscone Center West举行，笔者有幸亲身体会了这次大会，获益良多。&lt;/p&gt;

&lt;p&gt;从十年前的门口罗雀到如今的门庭若市，WWDC 见证了 Apple 及其开发者社区的兴盛与繁荣。2012年的 WWDC，门票在两小时内售罄，2013年更是不到两分钟就一抢而空，而今年Apple 改成了较为公平抽签方式，4月3日就提示你使用开发者账号&lt;a href=&quot;https://developer.apple.com/wwdc/tickets/?cid=CDM-US-DM-P0014289-195576&amp;amp;&amp;amp;cp=em-P0014289-195576&amp;amp;sr=em&quot;&gt;注册登记&lt;/a&gt;，然后一周之后就出抽签结果。如果是学生的话，还可以申请&lt;a href=&quot;https://developer.apple.com/wwdc/students/&quot;&gt;WWDC Scholarship&lt;/a&gt;。&lt;/p&gt;

&lt;p&gt;最近几年，媒体总会猜测 WWDC 会发布那些硬件设备，这次也不例外：iPhone 6、Mac mini、iWatch、Retina Macbook Air 据传可能会发布；但这次的主题是&lt;code&gt;Write the code Change the world&lt;/code&gt;, 这才是WWDC的本源。&lt;/p&gt;

&lt;h2&gt;Keynote&lt;/h2&gt;

&lt;p&gt;每次WWDC，Keynote都是重中之重。开场的一段视频很好的诠释了今年的主题：人们可能不了解背后的开发者，但是开发者们的一个又一个的App极大的改变了人们的生活。&lt;/p&gt;

&lt;p&gt;Tim Cook列举了一些很有意思的数据统计：&lt;/p&gt;

&lt;h4&gt;关于WWDC&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;今年是WWDC 25周年，一个重大的里程碑&lt;/li&gt;
&lt;li&gt;1990年只有1300名开发者，只有1个lab；今年则有超过100场session、120个lab、超过1000名的Apple工程师现场帮助你解决问题。&lt;/li&gt;
&lt;li&gt;今年参会的开发者来至69个不同国家，70%是第一次参加；最小的学生开发者仅13岁。&lt;/li&gt;
&lt;li&gt;超过900万注册开发者，其中47%是去年新增加的，史上最多的一年。&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;OS X/iOS的开发社区事实上已经是非常成熟了，在这种情况下仍然有这么多新的开发者加入，不得不佩服Apple的吸引力。&lt;/p&gt;

&lt;h4&gt;关于Mac&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;PC整体上销量下降了5%，而Mac逆势上扬增长了12%&lt;/li&gt;
&lt;li&gt;Mac已经卖出了超过8千万台&lt;/li&gt;
&lt;li&gt;OS X Mavericks安装了4千万份，51%的占有率，史上被接受最快的OS&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;与Windows 8相比，仅仅14%的占有率&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;关于iOS&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;消费者对iOS7的满意度高达97%&lt;/li&gt;
&lt;li&gt;iPad卖出了2亿台（200M)，iPhone卖出了5亿台（500M)&lt;/li&gt;
&lt;li&gt;去年有1.3亿新用户第一次使用Apple设备&lt;/li&gt;
&lt;li&gt;超过98%的世界500强部署了iOS设备&lt;/li&gt;
&lt;li&gt;iOS7系统占有率高达89%，与Android Kitkat（4.4）相比，仅占有9%&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;Android还贡献了99%的Mobile malware&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;关于App Store&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;120万应用，750亿次下载&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;接下来Yosemite和iOS 8的介绍和Demo基本都是Apple的主管软件工程的SVP--Craig Federighi来进行的，他被Cook称为Superman，演讲风趣幽默，极富感染力。&lt;/p&gt;

&lt;h2&gt;OS X Yosemite&lt;/h2&gt;

&lt;p&gt;新的OS X代号为Yosemite，是加州著名的风景名胜。Craig还调侃了它的由来。&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/blog/wwdc_2014_csdn/overview_design_hero_2x_zpsb72182c1.jpg&quot; max-width=&quot;100%&quot;&gt;&lt;/p&gt;

&lt;p&gt;Yosemite是一次重大的更新，主要改动在三个方面：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;界面&lt;/li&gt;
&lt;li&gt;应用&lt;/li&gt;
&lt;li&gt;连续性（Continuity）&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;首先界面扁平化了，基本的窗口控件，Dock，应用图标，新的系统字体（Helvetica Neue）都进行了重新设计；加入了iOS7引入的半透明、高斯模糊效果；新加入了Vibrancy，一种先进的动态渲染技术，融合了当前窗口前台与后台的内容。&lt;/p&gt;

&lt;p&gt;Yosemite 还贴心的提供了Dark mode。&lt;/p&gt;

&lt;p&gt;大量内置的App也更新了：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;通知中心，添加了“今天”视图，支持Widget，可以扩展出更多显示空间。传统的Dashboard显得有些鸡肋了，Yosemite默认不会被启用&lt;/li&gt;
&lt;li&gt;Spotlight，弹出式搜索框，有点像Alfred，除了传统Spotlight能搜索的内容外，还支持从维基百科，Bing，地图等来源搜索。&lt;/li&gt;
&lt;li&gt;iCloud Drive，类似Dropbox，Apple的跨平台个人云存储服务，可以存储任意类型的文件，直接集成在Finder里。这样一来几乎所有的大公司都有自己的解决方案了，名字惊人的相似：Google有Google Drive，微软有OneDrive，亚马逊有Cloud Drive&lt;/li&gt;
&lt;li&gt;Mail，界面大幅更新，支持Mail Drop，收发高达5G附件的邮件；支持Markup，直接就可以在邮件里对图片进行标注，Markup实际上是一个Action Extension，后面会再提到Extension。&lt;/li&gt;
&lt;li&gt;Safari，更紧凑的工具栏，更大的显示空间，多Tab下更加高效节能，支持新的web标准，支持SPDY。&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Continuity是个Apple倡导的新概念，让你的Mac/iOS设备能够更和谐，更无缝的一起协作。比如Air Drop，现在可以支持Mac和iOS之间互相传递内容了。Apple更进一步提出了&lt;code&gt;Handoff&lt;/code&gt;，Mac知道你在iOS设备上最后做的事情，反之亦然；这样用户可以在不同设备中实时完成任务切换而无需复杂的操作。如在iPhone上邮件写到一半，转到Mac上继续写；你还可以通过Mac来拨打电话，收发消息；Instant Hotspot则可以快速打开iPhone上的热点功能。&lt;/p&gt;

&lt;p&gt;最后，Yosemite仍然免费，今秋发布。&lt;/p&gt;

&lt;h2&gt;iOS 8&lt;/h2&gt;

&lt;p&gt;去年iOS 7大幅更新的时候，很多OS X部门的工程师都参与了iOS 7的开发；而今年则是iOS部门的工程师参与了OS X的开发。所以相比Yosemite，iOS 8的改动显得并不太大，更多是细节上的改进，例如：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;交互式通知，短信，邮件，日历通知直接可以操作，回复。相信广大Android用户早就体会到了这种便利的方式。&lt;/li&gt;
&lt;li&gt;Mail，支持手势操作，有点像Mailbox；可以暂时隐藏当前编写的邮件，还能自动判别哪些邮件可以直接加入到日历里&lt;/li&gt;
&lt;li&gt;Spotlight，提供维基百科，新闻，iTunes Store的搜索结果，还能智能的识别当前地理位置信息。&lt;/li&gt;
&lt;li&gt;键盘，更加智能，根据上下文来提供输入建议。&lt;/li&gt;
&lt;li&gt;Message，支持了很多OTT的功能，如群聊，共享地理位置，语音消息等。&lt;/li&gt;
&lt;li&gt;照片，每张照片都会通过iCloud同步到其他设备上，尺寸和分辨率, 原生支持滤镜功能，搜索还支持通过时间和地理位置，5G免费空间。&lt;/li&gt;
&lt;li&gt;Siri，集成了Shazam，支持直接从iTunes里购买内容，支持22新语言，还支持新的触发命令：&quot;Hey Siri&quot;，这个明显带有Google Glass的&quot;OK, Glass&quot;的痕迹。&lt;/li&gt;
&lt;li&gt;多任务切换界面最上方将会出现最近联系过的联系人列表，这一点见仁见智，相信是更方便用户操作了。&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;App Store&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;新增探索，可以发现并搜索流行的App，更好的展示结果, 还有编辑推荐；还记得之前被下架们的各类推荐类App吗？Apple在这一点上相当强势。&lt;/li&gt;
&lt;li&gt;新增App bundle；Mac用户一定不陌生，StackSocial和MacHeist经常会搞一些特价bundle，很多著名的App都有大幅折扣；Apple把这个模式搬到了App Store上，开发者们可以选择更灵活的促销策略，相信帮助开发者更好的&lt;/li&gt;
&lt;li&gt;新增App preview，终于可以放Demo视频了，同样，Android用户早就体会过这一点了。&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;新增加的一些App：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;iCloud Drive，类似Dropbox，前面也提到过，Apple的加入使得个人云存储市场竞争更加激烈，iCloud Drive的优势是内置的，对于还没有使用类似服务的用户来说，iCloud Drive将会是首选。&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/blog/wwdc_2014_csdn/desktop_icloud_drive_hero_2x_zps67c116ed.png&quot; width=&quot;50%&quot; max-width=&quot;100%&quot;&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;家庭共享，可以共享照片，日历，备忘录，购买的Apps/Books等等，支持最多6人。最赞的是支持家长控制，这样小孩想购买应用就会像家长发出授权请求，这样还能避免误操作。&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/blog/wwdc_2014_csdn/desktop_family_sharing_hero_2x_zps2d9c145a.jpg&quot; width=&quot;50%&quot; max-width=&quot;100%&quot;&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Health，健康类的App信息可以汇总在一起，互相分享，用户能在Dashboard看到所有信息，直观的了解自己的健康状态。&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/blog/wwdc_2014_csdn/desktop_health_hero_2x_zpscca0499d.jpg&quot; width=&quot;50%&quot; max-width=&quot;100%&quot;&gt;&lt;/p&gt;

&lt;p&gt;当然还有Handoff，这是笔者最喜欢的功能；平时我会使用Safari中的Cloud Tab以及第三方Push类应用，如Pushbullet。而Handoff互联这种体验更进了一步，几乎不用任何复杂操作，你就能把正在浏览的网页切到iPad上，在Mac上接着写iPhone上回到的一半的邮件；当你在工作的时候，还能通过Mac来收发Message，甚至打电话。在外界纷纷猜测Apple会如何解决iPhone大屏幕交互问题时，Apple聪明的提出了Handoff，让更合适的设备做更合适的事情；相信Mac将会在智能家居中扮演处理中心的重要角色。&lt;/p&gt;

&lt;h2&gt;Developer Tools&lt;/h2&gt;

&lt;p&gt;仅仅Yosemite和iOS 8，也能称为一次巨大的发布了，不过Tim Cook所提到的故事的第二部分才刚刚开始；有人说iOS 8会干掉一大批第三方应用，Apple的确&quot;借鉴&quot;了很多第三方App的创意，但是Apple很有诚意的对开发者工具进了大幅更新，让第三方App有了更多创意发挥的空间。&lt;/p&gt;

&lt;p&gt;这是自从App Store发布以来最大的一次SDK更新，提供了超过4000个新的API。这次SDK的更新也体现了两大关键词：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Continuity&lt;/li&gt;
&lt;li&gt;Extensibility&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Continuity&lt;/h3&gt;

&lt;p&gt;Apple重新思考了iOS的设计哲学（orientations/sizes/margins），提出了Adaptive Layout的概念，目的是一份代码能运行在所有设备上，并且通用，易于复用。&lt;/p&gt;

&lt;p&gt;iOS 8 SDK中，同一个Storyboard可以用在iPhone和iPad上；在新的iOS模拟器中还可以在测试不同的尺寸、不同的分辨率（Resizable iPhone/iPad选项）。&lt;/p&gt;

&lt;p&gt;值得一提的是不仅仅是iOS，从Yosemite开始，Cocoa开发也可以使用Storyboard了。当笔者看到这个的时候，立刻决定下个Mac App将会使用Storyboard。&lt;/p&gt;

&lt;p&gt;如果你也是一名OS X开发者，相信你已经对OS X上的开发有不少抱怨了吧，为什么实现一个自定义UI效果这么复杂？为什么第三方开源的UI控件这么少？&lt;/p&gt;

&lt;p&gt;Cocoa有着20多年的悠久历史，很多设计在现在看来已经显得不合时宜了，CocoaTouch则好很多，我们知道，在CocoaTouch中，ViewController是一个很重要的概念，而在Cocoa中则显得比较鸡肋；这次Cocoa中的ViewController做了很多改动，比如自动出现在事件响应的职责链（Response Chain）中；增加了更多类似UIView的Delegate方法，比如&lt;code&gt;viewDidLoad&lt;/code&gt;/&lt;code&gt;viewWillAppear&lt;/code&gt;等等。这样你就可以使用相同的理念与模型来开发Cocoa和CocoaTouch应用了。&lt;/p&gt;

&lt;p&gt;由于移动互联网的火热，Apple的重点自然是iOS，大势所趋，比如曾经Mac上著名&lt;code&gt;BWtoolkit&lt;/code&gt;UI库的作者&lt;a href=&quot;http://brandonwalkin.com/&quot;&gt;Brandon Walkin&lt;/a&gt;，现在是Facebook Paper主要Designer。不过笔者相信OS X将会追上iOS的开发体验，降低开发门槛，让我们拭目以待。&lt;/p&gt;

&lt;h3&gt;Extensibility&lt;/h3&gt;

&lt;p&gt;普通用户越狱的一个主要理由是可以安装Tweak、Widget、输入法；从iOS 8开始，你可以给iOS写扩展了，普通用户几乎没有越狱的理由了，扩展的出现也让Apple的跨应用共享数据变得更加容易了。扩展将会打包在App的bundle里，运行在独立的进程中，Apple并没有牺牲iOS的安全性：&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/blog/wwdc_2014_csdn/extension_detailed_communication_zps841bcc35.png&quot; max-width=&quot;100%&quot;&gt;&lt;/p&gt;

&lt;p&gt;iOS支持的扩展类型：&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/blog/wwdc_2014_csdn/ios_extensions_zpscdf6366b.png&quot; max-width=&quot;100%&quot;&gt;&lt;/p&gt;

&lt;p&gt;通知中心的widget，自定义分享扩展，第三方滤镜，并且终于支持第三方键盘了~&lt;/p&gt;

&lt;p&gt;OS X支持的扩展类型：&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/blog/wwdc_2014_csdn/osx_extensions_zps5c716a94.png&quot; max-width=&quot;100%&quot;&gt;&lt;/p&gt;

&lt;p&gt;同样支持通知中心Widget和分享扩展；Finder Sync扩展值得一提，Dropbox之类的App再也不需要对Finder进行hack就能显示同步文件夹的状态了，一大利好。最主要是因为要支持自家的iCloud Drive才开放接口的吧，不过今年的NDA限制也变得没那么严格了，开发者不用像以往只能憋着了，我们正看到一个逐步开放的Apple。&lt;/p&gt;

&lt;h3&gt;新增的重要Framework&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Touch ID&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;没有Touch ID之前用户设置密码的比率是49%，有Touch ID之后这个比率变成了83%&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;现在第三方App也可以使用Touch ID了，可与预见密码管理类，财务类等App的体验将会更好&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;CloudKit&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;Apple的BAAS(Backend as a Service)服务, 有点类似被Facebook收购的Parse；开发者不用操心hosting server的事情，简单集成CloudKit就可以使用搜索、push，存储，认证等服务。不过CloudKit应该不会跨平台，普通开发者应该还是会选择跨平台的解决方案。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;iCloud Drive/Photo是在CloudKit的基础上开发，品质绝对有保证；而且比较大方：免费1PB assets存储, 10TB数据库存储&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;HealthKit，通过统一的数据接口，第三方健康应用能整合在一起。&lt;/li&gt;
&lt;li&gt;HomeKit，Apple的智能家居解决方案，能够和Siri无缝集成，不过现在还没有多少设备支持。&lt;/li&gt;
&lt;li&gt;SpriteKit/SceneKit/Metal，游戏开发者的福音, Metal专门针对A7优化，3D性能大幅提升；开发休闲类游戏也更容易&lt;/li&gt;
&lt;li&gt;Camera API/PhotoKit&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;第三方App可以手动控制曝光，白平衡，对焦等，更容易开发出更好的相机应用&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;通过PhotoKit现在可以读写用户的Library了，如果你开发过相册类应用就知道这个改动相当重要。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;或许没有出现在Keynote中但是仍然值得一提的Framework：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;WKWebView，其他App也能使用Safari的Nitro引擎了，这样第三方浏览器在性能上终于可以媲美Safari了，我们知道Chrome在iOS上比不过Safari就是因为只能使用性能孱弱的UIWebview，没办法使用自家的V8引擎；不过也有弊端，使用WKWebView可能会有些安全上的隐患，不少次越狱都是从Safari打开的突破口。&lt;/li&gt;
&lt;li&gt;Hypervisor.framework，让第三方虚拟化厂商不需要部署Kext（Kernel Extension）就能利用CPU的虚拟化技术；从Mavericks就可以看出Apple在收紧Kext，编写不当的Kext将会导致Kernel Panic，Apple此举会让系统运行的更可靠和稳定。&lt;/li&gt;
&lt;li&gt;XCode6支持创建iOS Dynamic Framework了, 广大开发者的&lt;a href=&quot;http://fixradarorgtfo.com/&quot;&gt;呼声&lt;/a&gt;得到了回应，如果你还不了解这一点的重要性，可以查看这篇文章 &lt;a href=&quot;http://landonf.bikemonkey.org/code/ios/Radar_15800975_iOS_Frameworks.20140112.html&quot;&gt;iOS Static Libraries Are, Like, Really Bad, And Stuff&lt;/a&gt;，新的Extension就利用上了这一特性。&lt;/li&gt;
&lt;li&gt;Accessibility API，大幅降低了使用难度，你可能不会想到之前仅仅是拿到一个UI元素的属性会这么复杂。&lt;/li&gt;
&lt;li&gt;Core Location 支持室内定位。&lt;/li&gt;
&lt;li&gt;TestFlight，App Store终于也支持beta测试了。&lt;/li&gt;
&lt;li&gt;XCode 6支持View Debugging/GCD Queue Debugging&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;著名的Reveal受到了一次重击，同意动态查看视图结构，而且还免费；&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;支持查看Block是如何加入到GCD队列这个改动实在是太贴心了~&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;JavaScript for Automation，这点也值得一提，之前在Mac下进行自动化测试基本上都是用AppleScript或者是Script-binding的Accessibility库；现在Javascript也能进行自动化测试了，&lt;a href=&quot;http://blog.codinghorror.com/&quot;&gt;Jeff Atwood&lt;/a&gt;关于JS的预言再次验证：&lt;/li&gt;
&lt;/ul&gt;


&lt;blockquote&gt;&lt;p&gt;any application that can be written in JavaScript, will eventually be written in JavaScript.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h3&gt;Swift&lt;/h3&gt;

&lt;p&gt;除了Extension，最让开发者兴奋的就是Swift了，在Craig介绍Swift的时候，他特意停顿了一下，&lt;code&gt;Objective-C without the baggage of C&lt;/code&gt;? 真是万万没想到，居然是一门新的编程语言。现场一片也是欢呼，可以预见的是Swift会吸引其他领域的开发者开始iOS开发，多少次你因为Objective-C的怪异语法而放弃学习iOS了？&lt;/p&gt;

&lt;p&gt;Swift秘密开发了四年，轻装上阵，博采众长，吸收了众多编程语言的优点，甩掉了Objective-C的很多历史包袱。WWDC中很多session的示例代码已经用Swift来编写了；而Apple的WWDC app是第一个上架的Swift应用。&lt;/p&gt;

&lt;p&gt;Swift的主要作者是&lt;a href=&quot;http://nondot.org/sabre/&quot;&gt;Chris Lattner&lt;/a&gt;，他同时也是LLVM的主要开发者。&lt;/p&gt;

&lt;p&gt;Swift宣布不久Github上就出现了很多用Swift改写的App、Library等，比如FlappySwift；Twitter上迅速出现了接受Swift的各种账号，SwiftDev/SwiftGuru等；Hacker News/Reddit上也很快出现了Swift热烈讨论，各种带Swift的域名也被注册一空；这些都从侧面反映了Swift多么受欢迎。&lt;/p&gt;

&lt;p&gt;Swift的语言特性：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;快速（Fast）&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;使用llvm静态编译成原生代码，精简的runtime，面向library的设计&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;媲美脚本语言的开发效率，高运行效率&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;现代（Modern）&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;闭包（Closures）&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;命名空间（Namespace）&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;泛型（Generics）&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;类型推断（Type inference）&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;多返回值（Multi return types）&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;安全（Safe）行为可预测，没有不确定性的JIT和GC，使用ARC进行自动内存管理。&lt;/li&gt;
&lt;li&gt;Cocoa/Cocoa Touch无缝集成，和Objective同样的runtime&lt;/li&gt;
&lt;li&gt;交互性强（Interactive），提供了强大的Playground。&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/blog/wwdc_2014_csdn/swift-screenshot_2x_zps8b67bcff.jpg&quot; max-width=&quot;100%&quot;&gt;&lt;/p&gt;

&lt;p&gt;如果你有其他编程语言的经验，比如Python、Javascript、Ruby、C#、Rust、Scala等，相信你会很快就能上手Swift。&lt;/p&gt;

&lt;p&gt;Swift第一眼看上去像是解释执行的动态语言，但是你如果在Playground中输出Swift的运行路径的话你会看到形如:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;/var/folders/m4/vgfzvfg57b17yzk8_05rxdv00000gn/T/com.apple.dt.Xcode.pg/applications/MyPlayground-18261-1.app&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;这样的路径，实际上还是通过LLVM编译成了native代码，只是在Playground中速度比较快，让你产生了错觉。实际的Swift应用中会把Swift运行时带上，放入App bundle的Framework路径下，笔者相信，这只是暂时的，未来Swift的运行库应该会内置在iOS、OS X系统库中。&lt;/p&gt;

&lt;p&gt;由于Swift还没有决定是否开源，所以目前从一些逆向的结果显示，Swift可以简单理解成Objective-C without message，加上LLVM的强力优化，高性能是值得保证的。一旦开源，说不定很快就有server side Swfit了~&lt;/p&gt;

&lt;p&gt;Swift是静态类型语言，并试图从设计的角度保证安全，Swift强调显式和不可变性，没有显式的指针，鼓励你使用&lt;code&gt;let&lt;/code&gt;定义常亮，使用&lt;code&gt;var&lt;/code&gt;定义的变量则必须初始化才能使用，类型不匹配连编译都通不过，还记得之前的OpenSSL的HeartBleeding bug吗？在Swift中强制使用&lt;code&gt;{}&lt;/code&gt;，这种bug就不会出现了。&lt;/p&gt;

&lt;p&gt;Swift语言语法简洁，之前Objective-C被人诟病的冗长的毛病得到了很大的改观，通过使用Optional，能够简化很多嵌套的if的写法。你还可以重载操作符来实现你想要的方言效果。Swift支持自动类型推断，所以很多类型可以不用声明。&lt;/p&gt;

&lt;p&gt;Swift是面向Library设计的语言，运行时很小，扩展性很强，enum、struct、class都可以很容易的给他们加上&lt;code&gt;protocol&lt;/code&gt;，如果你点开Swift生成的“头文件”，可以看到Swift最基本的&lt;code&gt;LogicValue&lt;/code&gt;，&lt;code&gt;Integer&lt;/code&gt;等等都是&lt;code&gt;protocol&lt;/code&gt;。&lt;/p&gt;

&lt;p&gt;Swift主要还是侧重OOP和泛型这两种编程范式的语言，函数是一等公民，也支持闭包，map/filter/reduce等函数式语言的特性。泛型的支持更为彻底一些，比如Optional实际上泛型的enum，标准库的算法也是泛型的。&lt;/p&gt;

&lt;p&gt;Swift和Objective-C的互相交互体现了一些妥协，Swift毕竟只是语言，要想完成实际工作目前还是需要依赖Cocoa和CocoaTouch框架，由于现有框架的其实是可以返回nil的，所以Swift引入了&lt;code&gt;ImplicitlyUnwrappedOptional&amp;lt;T&amp;gt;&lt;/code&gt;；Swift的String、Array、Dictionary可以直接转换成Cocoa中对应的NSString、NSArray、NSDictionary；而在底层，Swift实际上还是Objective-C对象。&lt;/p&gt;

&lt;p&gt;总体而言，Swift是一门值得学习的语言，是iOS/OS X开发的未来，前途不可限量。&lt;/p&gt;

&lt;p&gt;更多关于Swift可以参考iBooks上的&lt;code&gt;The Swift Programming Language&lt;/code&gt;，Rust作者的&lt;a href=&quot;http://graydon2.dreamwidth.org/5785.html&quot;&gt;点评&lt;/a&gt;和&lt;a href=&quot;http://onevcat.com/&quot;&gt;onevcat&lt;/a&gt;的&lt;a href=&quot;http://onevcat.com/2014/06/walk-in-swift/&quot;&gt;行走于 Swift 的世界中&lt;/a&gt;值得一读。&lt;/p&gt;

&lt;h2&gt;小结&lt;/h2&gt;

&lt;p&gt;这次WWDC的信息量实在太大了，很多东西都来比较细写，很多session都来不及看，简单总结下吧：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Apple这次SDK的大更新, 为将来可能的穿戴设备，智能家居，健康应用都打下了坚实的基础，同时也大大减少了普通用户越狱的理由，新的编程语言把大家拉回了同一水平线上，给了大家跨越式发展的机会：）&lt;/li&gt;
&lt;li&gt;Apple能够给用户提供业界无可匹敌的连续、无缝的设备服务体验，正如Cook所言：&lt;code&gt;This is something only apple can do.&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;WWDC Tips&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;今年Checkin是用的Passbook&lt;/li&gt;
&lt;li&gt;Apple总部的Company Store周日会特例开放半天。&lt;/li&gt;
&lt;li&gt;如果想在看Keynote时候位置足够好，现在需要前一天晚上就去排队了。&lt;/li&gt;
&lt;li&gt;WWDC举行的期间，开发者们还自发的举行了很多 Meetup/&lt;a href=&quot;http://wwdcparties.com/&quot;&gt;Parties&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;WWDC可以收藏你感兴趣的session，去之前可以先把WWDC的WiFi添加到手机里&lt;/li&gt;
&lt;li&gt;午饭时间的有些session也不错，比如今年有一个关于Star Trek的session&lt;/li&gt;
&lt;li&gt;各种What&#39;s new建议都听听。&lt;/li&gt;
&lt;li&gt;很多著名开发者都会参加，比如iOS Dev Weekly主要作者&lt;a href=&quot;https://twitter.com/daveverwer&quot;&gt;Dave Verwer&lt;/a&gt;，AFNetworking/NSHipster作者&lt;a href=&quot;http://mattt.me/&quot;&gt;Mattt Thompson&lt;/a&gt;，INAppStoreWindow作者&lt;a href=&quot;http://indragie.com/&quot;&gt;Indragie Karunaratne&lt;/a&gt;，还有参加&lt;a href=&quot;http://www.altconf.com/&quot;&gt;AltConf&lt;/a&gt;Cydia之父&lt;a href=&quot;https://twitter.com/saurik&quot;&gt;Jay Freeman&lt;/a&gt;和《OS X Internals: A Systems Approach》合作者&lt;a href=&quot;http://t.co/ZurYk2dmsF&quot;&gt;Sam Marshall&lt;/a&gt;，可以找他们交流，人都很nice。&lt;/li&gt;
&lt;li&gt;Craig相当亲和，抓住机会就和他合影吧，概率还蛮高的。&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Reference&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.apple.com/videos/wwdc/2014/?id=101&quot;&gt;WWDC 2014 Keynote&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.apple.com/library/prerelease/mac/releasenotes/MacOSX/WhatsNewInOSX/Articles/MacOSX10_10.html&quot;&gt;What&#39;s New in OS X v10.10&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.apple.com/library/prerelease/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS8.html&quot;&gt;What&#39;s New in iOS8&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.apple.com/swift/&quot;&gt;Introducing Swift&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.glimsoft.com/04/24/complete-guide-for-wwdc-newcomers-2014-edition/&quot;&gt;Complete Guide for WWDC Newcomers (2014 edition)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://iphonedevelopment.blogspot.com/2013/04/wwdc-first-timers-guide-2013-edition.html&quot;&gt;WWDC First Timer&#39;s Guide 2013 Edition&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;注：有些链接可能需要开发者账号才能访问。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>GhostTile, 隐藏Dock上运行App</title>
   <link href="http://www.kernelpanic.im/2014/04/07/ghosttile-introduction"/>
   <updated>2014-04-07T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2014/04/07/ghosttile-introduction</id>
   <content type="html">&lt;p&gt;这个想法2月底就冒出来了, 当时快速的验证了下, 还是比较可行的. 最近利用业余时间折腾了下, 发布了第一个正式beta版.&lt;/p&gt;

&lt;p&gt;如果你是Dock隐藏党或者Alfred/Launchbar党, 可能会觉得没什么用. 但是每个人的习惯和用法不一样, 我从去年就踏上了自制各种工具的不归路, 所以就按自己的习惯写了一个.&lt;/p&gt;

&lt;p&gt;我习惯于Command-Tab, 习惯于正下方的Dock, 如果程序开的多, Command-Tab切起来效率就直线性下降了.
对于有些实际上只在后台使用的应用, 比如Vox, TunnelBear. 或者是只需要偶尔切换到前台的如词典, HockeyApp之类的, 希望它们不要出现在⌘+Tab列表里但是又能够快速切到前台.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/Freyr/Blog/boincmanager_dock_icon_zps3c157cec.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/boincmanager_dock_icon_zps3c157cec.png&quot; border=&quot;0&quot; alt=&quot; photo boincmanager_dock_icon_zps3c157cec.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;这个大家都不陌生吧, 我忍它很久了.&lt;/p&gt;

&lt;p&gt;早期其实有类似的一些工具, 比如Dock Dodger和MenuAndDockless. Dock Dodger本质上是修改应用的配置文件, 对于sign过的基本上就跪了. 而MenuAndDockless是SIMBL的插件, 光看截图就觉得很复杂. 所以对比起来GhostTile还是有一些技术上的优势的:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;基本零配置, 无外部依赖&lt;/li&gt;
&lt;li&gt;支持sign过的, sandbox过的应用, 不会去修改本地磁盘上的文件&lt;/li&gt;
&lt;li&gt;提供快捷键支持, 可用性不错&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;下面是一些截图:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/Freyr/Blog/ghosttile_main_window_zps62d9acd0.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/ghosttile_main_window_zps62d9acd0.png&quot; max-width=100% border=&quot;0&quot; alt=&quot; photo ghosttile_main_window_zps62d9acd0.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;主界面&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/Freyr/Blog/ghosttile_quickswitch_window_zpsf722a389.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/ghosttile_quickswitch_window_zpsf722a389.png&quot; max-width=100% border=&quot;0&quot; alt=&quot; photo ghosttile_quickswitch_window_zpsf722a389.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;快速切换界面&lt;/p&gt;

&lt;p&gt;图标是一个叫萌萌的萌妹子帮我设计的, 另外为了捞回开发者账号的钱, GhostTile定价9.99$, 不过实际上没有试用时间的限制, 做法和Sublime差不多, 最多提示一下.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/Freyr/Blog/ghosttile_promote_alert_zps914f0dae.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/ghosttile_promote_alert_zps914f0dae.png&quot; max-width=100% border=&quot;0&quot; alt=&quot; photo ghosttile_promote_alert_zps914f0dae.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;购买提示&lt;/p&gt;

&lt;p&gt;我分别上传了Demo视频到Youtube和Youku, 有条件的还是看Youtube吧.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=oZ6iX83i32E&quot;&gt;https://www.youtube.com/watch?v=oZ6iX83i32E&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://v.youku.com/v_show/id_XNjk1MjIzNjY4.html&quot;&gt;http://v.youku.com/v_show/id_XNjk1MjIzNjY4.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;欢迎大家测试beta版本, &lt;a href=&quot;https://rink.hockeyapp.net/recruit/e9bc821fe40c4c379111a6dce31de812&quot;&gt;戳这里&lt;/a&gt;的Request access应该就能下载beta版了.&lt;/p&gt;

&lt;p&gt;附上GhostTile的tumblr主页: &lt;a href=&quot;http://ghosttile.kernelpanic.im/&quot;&gt;http://ghosttile.kernelpanic.im/&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>浅谈iOS越狱App开发</title>
   <link href="http://www.kernelpanic.im/2014/01/25/how-to-develop-jailbreak-apps-for-ios"/>
   <updated>2014-01-25T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2014/01/25/how-to-develop-jailbreak-apps-for-ios</id>
   <content type="html">&lt;p&gt;这是一篇科普性质的文章, 内容主要包括:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;基本背景知识&lt;/li&gt;
&lt;li&gt;开发环境&lt;/li&gt;
&lt;li&gt;Root权限&lt;/li&gt;
&lt;li&gt;launchd&lt;/li&gt;
&lt;li&gt;bypass iPhone_NA/sandbox/codesign&lt;/li&gt;
&lt;li&gt;SSH Tips&lt;/li&gt;
&lt;li&gt;Cydia Hosting&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;如果你对这些Topic已经足够了解, 剩下的也不用看了:)&lt;/p&gt;

&lt;p&gt;我最早接触越狱大概是在iPhoneOS(4.0之后才改名成iOS)3.1.3时代, 印象比较深的是&lt;a href=&quot;https://twitter.com/comex&quot;&gt;@comex&lt;/a&gt;的&lt;a href=&quot;https://github.com/comex/spirit&quot;&gt;Spirit&lt;/a&gt;,经典的一键完美越狱; geohot还很活跃, 一己之力搞出&lt;a href=&quot;http://theiphonewiki.com/wiki/Limera1n&quot;&gt;Limera1n&lt;/a&gt;; 中文社区则有著名的&lt;a href=&quot;https://code.google.com/p/gfwinterceptor/&quot;&gt;GFWInterpreter&lt;/a&gt;...&lt;/p&gt;

&lt;p&gt;咳咳, 不怀旧了, 开面是正文:&lt;/p&gt;

&lt;p&gt;iOS和OS X一脉相承, kernel都来至&lt;a href=&quot;https://en.wikipedia.org/wiki/Darwin_(operating_system&quot;&gt;Darwin OS&lt;/a&gt;). iOS6的kernel是Darwin Kernel 13.0.0, iOS7是Darwin Kernel 14.0.0(来源:&lt;a href=&quot;https://en.wikipedia.org/wiki/IOS#Kernel&quot;&gt;维基百科&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;这是Mavericks用的kernel版本, 13.0.2.&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;  &lt;br/&gt;
&lt;span class=&quot;gp&quot;&gt;% &lt;/span&gt;uname -v
Darwin Kernel Version 13.0.2: Sun Sep 29 19:38:57 PDT 2013; root:xnu-2422.75.4~1/RELEASE_X86_64&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;它们主流的开发语言都是Objective-C, 大部分Framework和Library也是通用的, 如Foundation/CoreFoundation, 就算不通用, 它们的设计也基本一致, 如UIKit/AppKit, 还有&lt;a href=&quot;http://chameleonproject.org/&quot;&gt;Chameleon&lt;/a&gt;这种致力于把UIKit搬到Mac的项目.&lt;/p&gt;

&lt;p&gt;iOS下可用的&lt;a href=&quot;http://theiphonewiki.com/wiki//System/Library/Frameworks&quot;&gt;Framework列表&lt;/a&gt;, 在&lt;code&gt;/System/Library/Frameworks&lt;/code&gt;下可以找到.&lt;/p&gt;

&lt;p&gt;文件系统目录结构一致, 默认用户是&lt;code&gt;mobile&lt;/code&gt;; 越狱后的iOS才能算完整的Unix-like系统, 你可以装shell, terminal, 开ssh, 启后台进程, 绕过sanbox, 使用root权限, 使用动态库等等, Mac/Unix的知识全都可以用上.&lt;/p&gt;

&lt;p&gt;正统的iOS App开发直接看Apple的&lt;a href=&quot;https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html&quot;&gt;iOS App Programming Guide&lt;/a&gt;即可.&lt;/p&gt;

&lt;h5&gt;Updates关于动态库, SO上这个&lt;a href=&quot;https://stackoverflow.com/questions/4733847/can-you-build-dynamic-libraries-for-ios-and-load-them-at-runtime&quot;&gt;回答&lt;/a&gt;的很不错&lt;/h5&gt;

&lt;p&gt;一般而言, 你需要一台Mac进行正儿八经的开发, iDevice不是必需的. 但如果是开发越狱App, 你需要一台越狱后的iDevice, Mac反而不是必需的.&lt;/p&gt;

&lt;p&gt;主要的开发环境有两种:&lt;/p&gt;

&lt;h3&gt;On device toolchain&lt;/h3&gt;

&lt;p&gt;最早的toolchain都是自己build的, 大神们的toolchain一般也不公开, 现在情况好一些, 直接装Bigboss提供的即可.&lt;/p&gt;

&lt;p&gt;这种做法好处是兼容性好, 测试方便, 比如你要编译个python的什么库;&lt;/p&gt;

&lt;p&gt;缺点也有不少, 由于不能自定义固件了, 系统区的空间比较少, 编译速度慢, 如果升级iOS并重新越狱的话又得再装一遍环境.&lt;/p&gt;

&lt;p&gt;我第一个SBSetting toggle就是用iphone-gcc编译的~&lt;/p&gt;

&lt;p&gt;对比表格来自&lt;a href=&quot;http://iphonedevwiki.net/index.php/On-device_toolchains&quot;&gt;iPhone Dev Wiki&lt;/a&gt;&lt;/p&gt;

&lt;table class=&quot;wikitable&quot;&gt;

&lt;tbody&gt;&lt;tr&gt;
&lt;th&gt;
&lt;/th&gt;
&lt;th&gt; iphone-gcc
&lt;/th&gt;
&lt;th&gt; LLVM+Clang for iOS
&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;iOS SDK tools version&lt;/b&gt;
&lt;/td&gt;
&lt;td&gt; 2.0
&lt;/td&gt;
&lt;td&gt; 6.1
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Maximum iOS SDK supported&lt;/b&gt;
&lt;/td&gt;
&lt;td&gt; 3.2
&lt;/td&gt;
&lt;td&gt; 7.0
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Supported ARCHS&lt;/b&gt;
&lt;/td&gt;
&lt;td&gt; arm, armv4t, armv6
&lt;/td&gt;
&lt;td&gt; armv4t, armv6, armv7, armv7f
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Compiler Version&lt;/b&gt;
&lt;/td&gt;
&lt;td&gt; GCC 4.0
&lt;/td&gt;
&lt;td&gt; LLVM 3.3
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;CC Tools Version&lt;/b&gt;
&lt;/td&gt;
&lt;td&gt; 286
&lt;/td&gt;
&lt;td&gt; 839
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Cydia Repo Hosted On&lt;/b&gt;
&lt;/td&gt;
&lt;td&gt; Telesphoreo
&lt;/td&gt;
&lt;td&gt; BigBoss
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Last Updated On&lt;/b&gt;
&lt;/td&gt;
&lt;td&gt; July, 2008
&lt;/td&gt;
&lt;td&gt; October, 2013
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Maintainer&lt;/b&gt;
&lt;/td&gt;
&lt;td&gt; saurik
&lt;/td&gt;
&lt;td&gt; coolstar
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Default Target&lt;/b&gt;
&lt;/td&gt;
&lt;td&gt; arm-apple-darwin9
&lt;/td&gt;
&lt;td&gt; armv7-apple-darwin11
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;ARCH built for&lt;/b&gt;
&lt;/td&gt;
&lt;td&gt; arm
&lt;/td&gt;
&lt;td&gt; armv7
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;C++ version supported&lt;/b&gt;
&lt;/td&gt;
&lt;td&gt; C++98 (from 1998)
&lt;/td&gt;
&lt;td&gt; C++11 (from 2011)
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Obj. C Version supported&lt;/b&gt;
&lt;/td&gt;
&lt;td&gt; 2.0
&lt;/td&gt;
&lt;td&gt; 2.0
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Obj. C Blocks (4.0 SDK+) Supported?&lt;/b&gt;
&lt;/td&gt;
&lt;td&gt; No
&lt;/td&gt;
&lt;td&gt; Yes
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Obj. C ARC (5.0 SDK+) Supported?&lt;/b&gt;
&lt;/td&gt;
&lt;td&gt; No
&lt;/td&gt;
&lt;td&gt; Yes
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;b&gt;Obj. C Literals+Autosynthesize (5.1 SDK+) Supported?&lt;/b&gt;
&lt;/td&gt;
&lt;td&gt; No
&lt;/td&gt;
&lt;td&gt; Yes
&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;


&lt;h3&gt;Cross compile&lt;/h3&gt;

&lt;p&gt;交叉编译的话, 主要就是&lt;a href=&quot;https://github.com/DHowett/theos&quot;&gt;Theos&lt;/a&gt;了, 它是跨平台的一套Makefile, 依赖perl, 在iOS也可以用.&lt;/p&gt;

&lt;p&gt;在Theos之前, 你需要手写Makefile, 麻烦不说还容易出错, 还需要自己设置各种环境变量/Flag. 比如最这个&lt;a href=&quot;https://github.com/goagent/goagent-ios/blob/master/goagent-toggle/backup/Makefile.raw&quot;&gt;Makefile&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Theos的&lt;code&gt;nic&lt;/code&gt;命令可以生成很多类型的模板, 主流的都包括了:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;% theos/bin/nic.pl
NIC 2.0 - New Instance Creator
------------------------------
[1.] iphone/application
[2.] iphone/flipswitch_switch
[3.] iphone/library
[4.] iphone/preference_bundle
[5.] iphone/tool
[6.] iphone/tweak
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;简单的解释一下:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;h4&gt;application&lt;/h4&gt;

&lt;p&gt;正常的App, 在Mac下其实意义不大, 因为你可以直接用XCode&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;h4&gt;tool&lt;/h4&gt;

&lt;p&gt;non-GUI工具, 比如写个helper或者daemon什么的.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;h4&gt;library&lt;/h4&gt;

&lt;p&gt;dylib或者Bundle&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;h4&gt;flipswitch_switch&lt;/h4&gt;

&lt;p&gt;flipswtich的模板, ControlCenter插件.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;h4&gt;preference_bundle&lt;/h4&gt;

&lt;p&gt;Preference插件, 依赖Preference Loader, 插在Settings.app里.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;h4&gt;tweak&lt;/h4&gt;

&lt;p&gt;MobileSubstrate插件, 现在叫&lt;a href=&quot;http://www.cydiasubstrate.com/&quot;&gt;CydiaSubstrate&lt;/a&gt;.
一般意义上的tweak大部分都是这类.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;SBSettings Toggle/Preference Bundle/NotificationCenter Widget/FlipSwtich
这些插件都是动态库. 关于动态库, 推荐Apple的这篇:&lt;a href=&quot;https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/000-Introduction/Introduction.html&quot;&gt;Dynamic Library Programming Topics&lt;/a&gt;, 和这篇:&lt;a href=&quot;https://developer.apple.com/library/mac/documentation/cocoa/conceptual/LoadingCode/&quot;&gt;Code Loading Programming Topics&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CydiaSubstrate则是一个代码注入平台, 动态加载并注入dylib, 一般会和classdump/method swizzling配合, 具体可以看看它的&lt;a href=&quot;http://www.cydiasubstrate.com/inject/darwin/&quot;&gt;文档&lt;/a&gt;, iPhone Dev Wiki上的&lt;a href=&quot;http://iphonedevwiki.net/index.php/MobileSubstrate&quot;&gt;介绍&lt;/a&gt;也不错.&lt;/p&gt;

&lt;p&gt;更多的一些Tweak例子可以参考&lt;a href=&quot;http://tweakweek.com/&quot;&gt;Ryan Petrich&#39;s Tweak Week&lt;/a&gt;.&lt;/p&gt;

&lt;h5&gt;Updates: 创建Tweak的Tweak: &lt;a href=&quot;http://www.idownloadblog.com/2014/01/29/flex-2-create-your-own-jailbreak-tweaks-on-ios-7/&quot;&gt;Flex 2&lt;/a&gt;&lt;/h5&gt;

&lt;h5&gt;Updates: 还可以试试&lt;a href=&quot;http://www.iosopendev.com/&quot;&gt;iOSOpenDev&lt;/a&gt;, 我最早装过它的公测版, 当时有bug没用起来, 现在看上去可用多了.&lt;/h5&gt;

&lt;h4&gt;关于Root privilege&lt;/h4&gt;

&lt;p&gt;如何像Cydia那样以Root权限运行呢?&lt;/p&gt;

&lt;p&gt;和传统做法基本一致:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;给你的executable加上&lt;code&gt;setuid/setgid bits&lt;/code&gt;, 比如说在&lt;code&gt;postinst&lt;/code&gt;脚本里加上: &lt;code&gt;chmod 6755 /path/to/executable&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;程序启动的时候调用&lt;code&gt;setuid(0)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;iOS不允许直接以root权限运行, 所以还要一个exec trick.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;关于什么是setuid/setgid, 请直接&lt;code&gt;man chmod&lt;/code&gt;并搜索&lt;code&gt;set-user-ID-on-execution&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;具体可以看GoAgent iOS的这几个文件:&lt;a href=&quot;https://github.com/goagent/goagent-ios/blob/master/package/DEBIAN/postinst#L20&quot;&gt;postinst&lt;/a&gt;, &lt;a href=&quot;https://github.com/goagent/goagent-ios/blob/master/goagent-ios/goagent-ios/main.m#L17&quot;&gt;main.m&lt;/a&gt;, &lt;a href=&quot;https://github.com/goagent/goagent-ios/blob/master/goagent-ios/goagent-ios/goagent#L4&quot;&gt;goagent&lt;/a&gt;, &lt;a href=&quot;https://github.com/goagent/goagent-ios/blob/master/Makefile#L38&quot;&gt;Makefile&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;还有种做法是利用launchd来执行需要root权限的操作. 从权限隔离的角度而言, 这种做法更好, 就是有点绕.&lt;/p&gt;

&lt;h3&gt;关于launchd/launchctl&lt;/h3&gt;

&lt;p&gt;launchd是iOS/OS X的关键程序, 类似于init/upstart, 用来管理所有的进程. 你在Activity Monitor随便找个进程, 它的直接或者间接父进程都是launchd.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/Freyr/Blog/active_monitor_view_hierarchically_zpsbe835ca2.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/active_monitor_view_hierarchically_zpsbe835ca2.png&quot; max-widght=&quot;100%&quot; border=&quot;0&quot; alt=&quot; photo active_monitor_view_hierarchically_zpsbe835ca2.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;launchd托管了很多job, 它们可以是进程, 可以是Timer; launchd还可以监控文件, socket等等. 功能相当强大, 更多可以查看手册:&lt;code&gt;man lauchd.plist&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;launchctl是launchd的命令行管理工具, 这次iOS7完美越狱也用到了(&lt;a href=&quot;http://theiphonewiki.com/wiki/Shebang_Trick&quot;&gt;Shebang Trick&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;launchd/launchctl是&lt;a href=&quot;http://www.opensource.apple.com/source/launchd/&quot;&gt;开源的&lt;/a&gt;, 如果你想通过写代码来控制, 可以参考launchctl的实现.&lt;/p&gt;

&lt;p&gt;顺带提一句, 现在GoAgent的&lt;a href=&quot;https://github.com/goagent/goagent-ios/blob/master/goagent-local/org.goagent.local.ios.plist&quot;&gt;启动&lt;/a&gt;/&lt;a href=&quot;https://github.com/goagent/goagent-ios/blob/master/goagent-local/org.goagent.local.ios.stop.plist&quot;&gt;停止&lt;/a&gt;, 也是通过launchd的两个job实现的.&lt;/p&gt;

&lt;h3&gt;bypass iPhone_NA&lt;/h3&gt;

&lt;p&gt;有时候你会看到这样的宏:&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c&quot; data-lang=&quot;c&quot;&gt;&lt;span class=&quot;n&quot;&gt;&lt;strong&gt;OSX_AVAILABLE_STARTING&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;&lt;/strong&gt;MAC_10_1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;__IPHONE_NA&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;它说明这个API仅在10.1之后的OS X下可用, iOS上不可用, 直接调用它编译器会报错.&lt;/p&gt;

&lt;p&gt;如何绕过呢?&lt;/p&gt;

&lt;p&gt;我们是可以动态加载lib的, 利用dlopen/dlsym(上面的动态库介绍有详细介绍)即可:&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c&quot; data-lang=&quot;c&quot;&gt;&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;libHandle&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dlopen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;RTLD_LAZY&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;n&quot;&gt;CFStringRef&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_SCDynamicStoreKeyCreateProxies&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;CFAllocatorRef&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dlsym&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;libHandle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;SCDynamicStoreKeyCreateProxies&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;o&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;调用&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_SCDynamicStoreKeyCreateProxies&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;还有一种做法是AppProxyCap这种, 链接&lt;code&gt;SystemConfiguration.framework&lt;/code&gt;之后直接&lt;a href=&quot;https://github.com/freewizard/AppProxyCap/blob/master/lib/AppProxyCap.m#L85&quot;&gt;取地址&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c&quot; data-lang=&quot;c&quot;&gt;&lt;span class=&quot;k&quot;&gt;typedef&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;CFDictionaryRef&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;&lt;em&gt;SCDynamicStoreCopyProxies&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SCDynamicStoreRef&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;store&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;&lt;/em&gt;SCDynamicStoreCopyProxies&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;origin_SCDynamicStoreCopyProxies&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;n&quot;&gt;origin_SCDynamicStoreCopyProxies&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SCDynamicStoreCopyProxies&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;这种做法也可以用来判断OS版本, 比如某个API是5.0之后加入的, 那么之前的版本取地址将会得到空值.&lt;/p&gt;

&lt;h5&gt;Updates: 还可以把这个宏给undef掉~&lt;/h5&gt;

&lt;h3&gt;bypass sandbox&lt;/h3&gt;

&lt;p&gt;直接安装到&lt;code&gt;/Applications&lt;/code&gt;即可.&lt;/p&gt;

&lt;h3&gt;bypass codesign&lt;/h3&gt;

&lt;p&gt;直接看Saurik的这篇文章即可:&lt;a href=&quot;http://www.saurik.com/id/8&quot;&gt;Bypassing iPhone Code Signatures&lt;/a&gt;, 有证书的话还是签下名吧.&lt;/p&gt;

&lt;h3&gt;SSH Tips&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;记得把默认的&lt;code&gt;alpine&lt;/code&gt;密码改掉, iOS下也是有病毒的:&lt;a href=&quot;http://www.f-secure.com/v-descs/worm_iphoneos_ikee.shtml&quot;&gt;ikee&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;没有WiFi的情况下, 可以考虑ssh over usb, 具体可以看&lt;a href=&quot;http://iphonedevwiki.net/index.php/SSH_Over_USB&quot;&gt;这里&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;开启ssh公钥认证, 可以节省很多时间, 比如Theos的make install和scp就不用输密码了.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;顺带提下, 我的&lt;a href=&quot;https://github.com/hewigovens/vim-config/blob/master/scripts/install_ios_configs.sh&quot;&gt;vim-config&lt;/a&gt;也基本支持iOS, 主要是.vimrc/.bashrc&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Cydia Repo Hosting&lt;/h3&gt;

&lt;p&gt;Cydia的source/repo基本上是Debian的APT repo, 只需要提供:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Release, repo描述文件&lt;/li&gt;
&lt;li&gt;Packages|Pacakges.gz/bz2, repo的package清单&lt;/li&gt;
&lt;li&gt;*.deb, 实际package文件&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Release文件几乎不用改, 只要准备好deb文件, 然后用&lt;code&gt;dpkg-scanpackage&lt;/code&gt;命令生成Packages就可以了, 比如&lt;code&gt;update_packages.sh&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
dpkg-scanpackages . &amp;gt; Packages &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; gzip -c Packages &amp;gt; Packages.gz&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;之后可以通过rsync同步到服务器上, 跑个文件下载的web服务就可以了, 比如当初学node写的&lt;code&gt;serve_cydia.js&lt;/code&gt;, 依赖&lt;code&gt;node-static&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;&lt;span class=&quot;cp&quot;&gt;#!/usr/bin/env node
&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;node_static&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;node-static&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;http&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;http&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;url&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;url&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;cydia_files&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;node_static&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Server&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;./files&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nx&quot;&gt;http&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;createServer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;addListener&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;end&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;cydia&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;non cydia request:&#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;url&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39; from &#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;remoteAddress&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;cydia_files&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;serve&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;&#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;remoteAddress&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39; &#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;method&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39; &#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;url&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39; &#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;status&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39; &#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
                &lt;span class=&quot;nx&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;writeHead&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
                &lt;span class=&quot;nx&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;&#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;remoteAddress&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39; &#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;method&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39; &#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;listen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;80&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;不想自己hosting的话, 可以提交给&lt;a href=&quot;http://thebigboss.org/&quot;&gt;Bigboss&lt;/a&gt;或者是尝试下&lt;a href=&quot;http://www.myrepospace.com/&quot;&gt;myrepospace&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;一些参考资源&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://cydia.saurik.com/faq/developing.html&quot;&gt;Cydia Dev FAQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://iphonedevwiki.net/index.php/Main_Page&quot;&gt;iPhone Dev wiki&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://theiphonewiki.com/wiki/Main_Page&quot;&gt;the iPhone wiki&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.saurik.com/&quot;&gt;Saurik&#39;s blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/DHowett/theos&quot;&gt;Theos&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://tweakweek.com/&quot;&gt;Ryan Petrich&#39;s Tweak Week&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.jailbreakqa.com/&quot;&gt;JailbreakQA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://openjailbreak.org/&quot;&gt;OpenJailbreak&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://twitter.com/hewigovens/jailbreak-hackers/members&quot;&gt;大神们的Twitter列表&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/hewigovens/hewigovens.github.com/wiki/Develop-Jailbreak-Apps&quot;&gt;之前整理的wiki&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Books:&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.amazon.com/iOS-Hackers-Handbook-Charlie-Miller/dp/1118204123&quot;&gt;iOS Hacker&#39;s Handbook&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://shop.oreilly.com/product/0636920023234.do&quot;&gt;Hacking and Securing iOS Applications&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;--END&lt;/p&gt;

&lt;hr /&gt;
</content>
 </entry>
 
 <entry>
   <title>我的2013</title>
   <link href="http://www.kernelpanic.im/2013/12/30/year-2013-retrospection"/>
   <updated>2013-12-30T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2013/12/30/year-2013-retrospection</id>
   <content type="html">&lt;p&gt;2013年结束了, 翻了一下去年的计划和总结, 同样是感觉时光飞逝, 只是今年有种强烈的时不我待的感觉.&lt;/p&gt;

&lt;h3&gt;关于阅读:&lt;/h3&gt;

&lt;p&gt;今年只读了6本:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/Freyr/Blog/2013_year_end_reading_zps347ba3b5.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2013_year_end_reading_zps347ba3b5.png&quot; border=&quot;0&quot; alt=&quot; photo 2013_year_end_reading_zps347ba3b5.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;统计来自&lt;a href=&quot;http://www.mzread.com/annual_report/2013?include_douban=1&quot;&gt;这里&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;对比下往年:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/Freyr/Blog/2013_year_end_reading2_zpsa0c6d909.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2013_year_end_reading2_zpsa0c6d909.png&quot; border=&quot;0&quot; alt=&quot; photo 2013_year_end_reading2_zpsa0c6d909.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;统计来自&lt;a href=&quot;www.yuedudna.com/users/11396691/book/all_years&quot;&gt;这里&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;正所谓买书一时爽, 搬家泪两行; 2013年印象中就没买过实体书, 12月初的时候还把海淘的DXG给卖掉了.&lt;/p&gt;

&lt;p&gt;未来的阅读不会是实体书, 不会是Kindle, 至少不是DXG.&lt;/p&gt;

&lt;p&gt;我现在的阅读时间比较零碎的, 主要读全文RSS,邮件订阅,各种途径的推荐,PDF. 如果RSS不提供全文的就自己搞, 比如&lt;a href=&quot;http://pipes.yahoo.com/pipes/person.info?display=pipes&amp;amp;guid=VW7RWCXJFLGGS35XYOJ2DWC5XI&quot;&gt;yahoo pipes&lt;/a&gt;(是的, 它还活着), &lt;a href=&quot;http://fullrss.net&quot;&gt;fullrss.net&lt;/a&gt;, 对于reddit这种就需要写代码了, 如&lt;a href=&quot;https://github.com/hewigovens/reddit-fun&quot;&gt;reddit-fun&lt;/a&gt;, 托管在heroku上, 用readability的库抓全文, 输出score至少10的文章.&lt;/p&gt;

&lt;p&gt;PDF的话主要用Adobe, 跨平台同步, 可以给PDF加标注. 以前学新技术喜欢看实体书, 现在的话直接看官方文档和例子, 然后上手折腾, 后面再补全知识.&lt;/p&gt;

&lt;h3&gt;关于博客/Wiki&lt;/h3&gt;

&lt;p&gt;博客写了11篇, 技术性好像越来越低, 很多都进了wiki和Trello. 这次准备开一个坑, 打算写一系列介绍文章, 比如某个Mac App背后的公司.&lt;/p&gt;

&lt;p&gt;今年花了不少功夫在Wiki上面, 用&lt;a href=&quot;https://gitstats.sourceforge.net&quot;&gt;GitStats&lt;/a&gt;统计了下:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Project name:
    wiki
Generated:
    2014-01-01 13:30:17 (in 2 seconds)
Report Period:
    2012-10-20 08:30:29 to 2013-12-24 21:18:07
Age:
    431 days, 81 active days (18.79%)
Total Files:
    51
Total Lines of Code:
    1908 (2561 added, 653 removed)
Total Commits:
    316 (average 3.9 commits per active day, 0.7 per all days)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;两千多行应该也不算少, 毕竟这不是代码.&lt;/p&gt;

&lt;p&gt;加上了sidebar和footer, 是不是看上去专业不少?&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/Freyr/Blog/2013_year_end_wiki_sidebar_zps3844b3be.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2013_year_end_wiki_sidebar_zps3844b3be.png&quot; border=&quot;0&quot; alt=&quot; photo 2013_year_end_wiki_sidebar_zps3844b3be.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;关于Weekend Project&lt;/h3&gt;

&lt;p&gt;今年略遗憾, 没有学习新的编程语言也没有参加新的MOOC. 倒是喜欢上了自制工具:&lt;/p&gt;

&lt;h5&gt;&lt;a href=&quot;https://github.com/hewigovens/CurrencyConvert&quot;&gt;CurrencyConvert&lt;/a&gt;&lt;/h5&gt;

&lt;p&gt;Popclip插件, 不同货币转换成人民币&lt;/p&gt;

&lt;h5&gt;&lt;a href=&quot;https://github.com/hewigovens/trello-this&quot;&gt;Card this to Trello&lt;/a&gt;&lt;/h5&gt;

&lt;p&gt;Trello-Bookmarklet的Chrome插件版本, 本来叫Trello This的, 后来Trello的一个哥们联系我说这个命名违反了ToS&lt;/p&gt;

&lt;h5&gt;&lt;a href=&quot;https://github.com/hewigovens/git-trello-hook&quot;&gt;git-trello-hook&lt;/a&gt;&lt;/h5&gt;

&lt;p&gt;github/gitlab webhook, 如果commit信息了有[card #1], 则会把trello的card给更新下, 现在配置略烦, 以后可以简化下&lt;/p&gt;

&lt;h5&gt;&lt;a href=&quot;https://github.com/hewigovens/PackageUninstaller&quot;&gt;PackageUninstaller&lt;/a&gt;&lt;/h5&gt;

&lt;p&gt;pkg卸载器, 之前有写博客介绍, 再要增强就得些kext了. 昨天&lt;a href=&quot;https://github.com/hewigovens/PackageUninstaller/commit/0df4db15fc06209ceb80f8ce9b8772d28a8d5e8e&quot;&gt;重构了一下&lt;/a&gt;是因为看到了这篇文章:&lt;a href=&quot;http://blog.securemacprogramming.com/2013/06/the-code-you-wrote-six-months-ago/&quot;&gt;The code you wrote six months ago&lt;/a&gt;, 果然发现几个月前写的代码不忍直视...&lt;/p&gt;

&lt;h5&gt;&lt;a href=&quot;https://github.com/hewigovens/copymate&quot;&gt;CopyMate&lt;/a&gt;&lt;/h5&gt;

&lt;p&gt;剪贴板辅助工具, 之前也有介绍&lt;/p&gt;

&lt;h5&gt;&lt;a href=&quot;https://github.com/hewigovens/BookmarkSpell&quot;&gt;BookmarkSpell&lt;/a&gt;&lt;/h5&gt;

&lt;p&gt;Chrome插件, 最开始是想做成基于书签的Automator, 现在则是想自己帮助学习的知识管理系统, 其实我从来都不是学霸, 学习新东西能够带来给我带来乐趣就够了.自用了一段时间, 查了下DB, 有133条记录, 大部分是认真读过并且加了标签和笔记.&lt;/p&gt;

&lt;p&gt;下一步准备自己搭server, 把数据从Dropbox Datastore迁移过来, 然后自己分词建索引, 实现全文搜索的功能.&lt;/p&gt;

&lt;p&gt;现在的样子:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/Freyr/Blog/2013_year_end_bookmark_spell_zps536ef287.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2013_year_end_bookmark_spell_zps536ef287.png&quot; border=&quot;0&quot; alt=&quot; photo 2013_year_end_bookmark_spell_zps536ef287.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;前几天写了个简单的Android客户端, 从手机上也可以容易的添加书签和笔记了:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/Freyr/Blog/2013_year_end_bookmarkspell_android_zpsa309046f.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2013_year_end_bookmarkspell_android_zpsa309046f.png&quot; border=&quot;0&quot; alt=&quot; photo 2013_year_end_bookmarkspell_android_zpsa309046f.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;关于生活&lt;/h3&gt;

&lt;p&gt;Quora上面有不少有趣的问题, 比如&lt;a href=&quot;http://www.quora.com/Productivity/What-are-the-best-day-to-day-time-saving-hacks&quot;&gt;What are the best day to day time saving hacks?&lt;/a&gt;, 可以直接看原文, 或者是&lt;a href=&quot;http://blog.littlelin.info/posts/2013/12/04/quora-translation-what-are-the-best-day-to-day-time-saving-hacks&quot;&gt;翻译版&lt;/a&gt;, 最赞的是Marius Ursache的回答:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;It&#39;s not about time. It&#39;s about energy.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We try to squeeze as many hours in one work day, to be &quot;productive&quot;, but in the &gt;end everything depends less on time, and more on your focus, motivation and overall well-being (all of them linked directly with energy levels).&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;我感触挺深, 这真是一针见血, 所谓的拖延症不就是low energy么; 除了作者提到的focus/motivation外, 我认为还有一点是ability, 很多时候拖延只是因为能力值不够而已.&lt;/p&gt;

&lt;p&gt;另外一个问题&lt;a href=&quot;http://www.quora.com/Self-Improvement/How-can-I-accelerate-my-personal-growth&quot;&gt;How can I accelerate my personal growth&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;最赞的是Jim Stone的回答:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;In other words, choose &quot;anxiety-driven growth&quot; over &quot;boredom-driven growth&quot;.&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;img src=&quot;http://qph.is.quoracdn.net/main-qimg-307add6b8883d02db6c1d174b791dbc9?convert_to_webp=true&quot; /&gt;&lt;/p&gt;

&lt;p&gt;这个图的横坐标是Skills, 纵坐标是Challenges. 从A1到A4就是提高的目标, 两种途径:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A1-&gt;A3-&gt;A4, 当前的Challenge超过当前的Skill, 这是&lt;em&gt;anxiety-driven growth&lt;/em&gt;,&lt;/li&gt;
&lt;li&gt;A1-&gt;A2-&gt;A4, 当前的Skill超过当前的Challenge, 这是&lt;em&gt;boredom-driven growth&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;一般&lt;em&gt;anxiety-driven&lt;/em&gt;提高的更快, 这也取决与你是否能容忍远离你的舒适区, 以及能远离多远.&lt;/p&gt;

&lt;p&gt;这应该是我从南京-&gt;杭州的主要原因, 工作的本质或许没有改变(换个时间/路程变长的地方写代码), 但是环境的确变了.&lt;/p&gt;

&lt;p&gt;最后是lifehacker的这篇:&lt;a href=&quot;http://www.lifehack.org/articles/lifehack/7-reasons-you-havent-found-your-passion-yet.html&quot;&gt;7 Reasons You Haven’t Found Your Passion Yet&lt;/a&gt;(纳豆有&lt;a href=&quot;http://www.naadou.com/7-reasons-you-havent-found-your-passion-yet.html&quot;&gt;翻译版&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;中枪不少, 生活就应该不断尝试.&lt;/p&gt;

&lt;h3&gt;台湾之行&lt;/h3&gt;

&lt;p&gt;今年最值的应该是台湾之行了, 7天时间根本不够, 很多地方都没去成, 是我之前攻略的不够仔细和充分造成的; 旗津半岛给我们领路的大叔如是说: 年轻的时候没经验, 等到有经验的时候说明你已经老了. 重要的旅途的过程, 开心就好. 有机会一定要再去一次, 弥补一下.&lt;/p&gt;

&lt;h3&gt;新年&lt;/h3&gt;

&lt;p&gt;新年的计划暂时还没想全, 但是有件事情一定要去做:把GoAgent iOS给重构下并支持iOS7,尽管现在没什么人在用了; 很多人都在讨论越狱还有没有意义, 输入法, 控制中心什么的系统都自带了, 我还是赞同@linusyang看法, 即现代越狱观(^_^), 追求自由是一种态度, 而且越狱对于我来说还有另外一层意义, 越狱后的iTouch3, 这是我最早接触的iOS开发环境, 第一个插件完全没有用Mac机器~&lt;/p&gt;

&lt;p&gt;走出去多交流也很重要, 毕竟留给中国队的时间不多了.&lt;/p&gt;

&lt;p&gt;--End&lt;/p&gt;

&lt;hr /&gt;
</content>
 </entry>
 
 <entry>
   <title>CopyMate小结</title>
   <link href="http://www.kernelpanic.im/2013/12/12/copymate-summary"/>
   <updated>2013-12-12T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2013/12/12/copymate-summary</id>
   <content type="html">&lt;p&gt;CopyMate是一个Mac剪贴板辅助工具，
虽然口号是&lt;em&gt;Copy Anywhere, Paste Once&lt;/em&gt;，但是目前暂时只支持复制文本，只支持10.8以上系统；CopyMate 希望能够在如下场景中派上用场：&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;从一段代码中选择性复制几行；作为一名主要靠复制粘贴吃饭的程序员(笑)，你肯定有过这种需求。&lt;/li&gt;
&lt;li&gt;从不同的应用程序中复制片段；比如浏览器复制链接，终端复制命令行，IDE复制代码，然后一次粘贴出来。&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;CopyMate的动机来源很简单：最近维护的一个项目是从Windows下移植过来的，代码很久没有同步了，现在要加点新功能，需要参考最新的Windows代码。得益于开源项目，最核心的功能一天就跑通了，UI，自动升级，自动打包发布反而花了更多的时间。&lt;/p&gt;

&lt;h3&gt;屏幕取词&lt;/h3&gt;

&lt;p&gt;做的最好的应该是Apple自家的词典了，然后是Popclip，有道这种需要装插件的做法基本上不用考虑了。总结起来就是: 没有通吃的做法, 一般是各种方法组合:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;It uses various techniques to obtain the text from the application (Text
Service Manager and TSM Document Access CarbonEvents, along with
Accessibility APIs.)&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;参考&lt;a href=&quot;http://www.cocoabuilder.com/archive/cocoa/200106-reading-word-at-mouse-pointer-o-universal-access.html&quot;&gt;cocoabuilder的帖子&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;还有一种比较tricky的做法是模拟CMD+C，一开始我直接尝试&lt;code&gt;CGEventPost&lt;/code&gt;没搞定，后来发现了&lt;a href=&quot;https://github.com/jessegrosjean/quickcursor&quot;&gt;QuickCursor&lt;/a&gt;，它的做法是利用Accessibility API来模拟CMD+C, Popclip在Sublime里也是这种做法. 所以就采用这种做法了, CopyMate本来也要读写粘贴板.&lt;/p&gt;

&lt;p&gt;基本流程如下:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;快捷键 -&amp;gt; 读取剪贴板并保存 -&amp;gt; 模拟复制 -&amp;gt; 格式化 -&amp;gt; 写回剪贴板 -&amp;gt; 粘贴
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;快捷键&lt;/h3&gt;

&lt;p&gt;用了&lt;a href=&quot;https://github.com/shpakovski/MASShortcut&quot;&gt;MASShortcut&lt;/a&gt;，顾名思义，能通过MAS审核的快捷键库. 但是CopyMate用了Accessibility API的好像就无法Sandbox了，还是会被MAS给reject掉. 为了显示快捷键的效果, 我特定
还录了一段demo视频, 用的ScreenFlow试用版, 编辑功能相当赞, 就是略贵.&lt;/p&gt;

&lt;h3&gt;Build/Publish/Update&lt;/h3&gt;

&lt;p&gt;Build托管给了&lt;a href=&quot;https://travis-ci.org/hewigovens/copymate&quot;&gt;Travis&lt;/a&gt;, 看见&lt;a href=&quot;https://travis-ci.org/hewigovens/copymate&quot;&gt;&lt;img src=&quot;https://travis-ci.org/hewigovens/copymate.png&quot; alt=&quot;Build Status&quot; /&gt;&lt;/a&gt;成功的标志心情大好.&lt;/p&gt;

&lt;p&gt;Travis现在已经越来越成熟了, 具体教程可以参考objc.io的这篇&lt;a href=&quot;http://www.objc.io/issue-6/travis-ci.html&quot;&gt;教程&lt;/a&gt;, 写的很详细. 不过我遇到一个&lt;a href=&quot;https://github.com/facebook/xctool%E2%80%8E&quot;&gt;xctool&lt;/a&gt;的问题, 在本地xctool 1.4可以正常build, 在travis的xctool 1.3就一直失败, 无奈直接改用xcodebuild了.&lt;/p&gt;

&lt;p&gt;Publish的话, 集成了七牛存储, 只要你push一把, travis build成功之后会调用七牛的python sdk把zip包给上传上去. 你可以访问&lt;a href=&quot;http://dn-copymate.qbox.me/&quot;&gt;http://dn-copymate.qbox.me/&lt;/a&gt;来获取最新的build.&lt;/p&gt;

&lt;p&gt;七牛的文档上千叮万嘱你不用泄露app secret, 结果回头他自己就在travis的&lt;a href=&quot;https://travis-ci.org/qiniu/python-sdk/jobs/15213806&quot;&gt;log&lt;/a&gt;给泄漏了, ==!; 另外七牛给空间&quot;自定义&quot;404的功能也很弱, 自定义来自定义去还是只能文件名是&lt;code&gt;errno-404&lt;/code&gt;, 而且不支持默认页面, 所以我把404页面当成首页来用了:显示最新build的下载地址, 这个404文件也是在travis build过程中生成上传到七牛的.&lt;/p&gt;

&lt;p&gt;升级的话, 集成了最流行的Sparkle, 这就不用多介绍了吧. 这里有个误区: Info.plist里的 &lt;code&gt;CFBundleShortVersionString&lt;/code&gt;主要是用来给UI呈现用, 不应该用来实际判断版本高低, 举个例子, 每次OS X大版本升级, 总有些软件不兼容而被Apple给禁掉(一般会挪到这里: &lt;code&gt;/Incompatible Software&lt;/code&gt;), 这个时候你更新&lt;code&gt;CFBundleShortVersionString&lt;/code&gt;是没用的, 你需要更新&lt;code&gt;CFBundleVersion&lt;/code&gt;, 而Sparkle正确处理了这个地方.&lt;/p&gt;

&lt;p&gt;Sparkle的feed放在github上了, 推送更新还是手动比较保险, 就没有放到build中去了.&lt;/p&gt;

&lt;p&gt;最后这部分就是programming和engineering的区别了, Programming负责解决问题, Engineering的话还得包括其他部分.&lt;/p&gt;

&lt;p&gt;--End&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>ME865入手记</title>
   <link href="http://www.kernelpanic.im/2013/12/05/my-first-macbook"/>
   <updated>2013-12-05T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2013/12/05/my-first-macbook</id>
   <content type="html">&lt;p&gt;这是我的第二台笔记本，早在九月份就想买rMBP了，后来看了下&lt;a href=&quot;http://buyersguide.macrumors.com/&quot;&gt;MacRumors&lt;/a&gt;的消息，决定等新款，然后就等到了现在。由于是第三次在团里买东西了，所以星期天很快就下了单，周二到手。&lt;/p&gt;

&lt;p&gt;简单的开箱图, 包装的很严实, 我是拆到最里面才签收的&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://ww4.sinaimg.cn/mw690/44f79696gw1eb7e659kxej21kw16o1in.jpg&quot; width=&quot;100%&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://ww2.sinaimg.cn/mw690/44f79696gw1eb7e75b7wej21kw16oh0t.jpg&quot; width=&quot;100%&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://ww3.sinaimg.cn/mw690/44f79696gw1eb7e74bem3j21kw16oasq.jpg&quot; width=&quot;100%&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;开机中&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://ww4.sinaimg.cn/mw690/44f79696gw1eb7e73ajftj21kw16oe05.jpg&quot; width=&quot;100%&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;前面其实都不是重点，重点是我如何快速的把它变成可工作状态。&lt;/p&gt;

&lt;p&gt;第一步是Safari下载iTerm2, Chrome, Dropbox, 之后基本上是多线并行操作的:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Dropbox登录, 不少配置文件和不常用软件都在里面&lt;/li&gt;
&lt;li&gt;iTerm2先敲git, 安装命令行工具, 配置好ssh key, 然后git clone vim-config/goagent, 会自动安装和配好oh-my-zsh和vim, 然后安装homebrew&lt;/li&gt;
&lt;li&gt;Chrome登录, 同步各种插件和书签, 配好goagent/SwitchySharp和LastPass, 然后是按需下载一些软件了, 输入法, 开发工具, 效率工具等等.&lt;/li&gt;
&lt;li&gt;打开AppStore, 更新和安装已经购买的软件, 主要是XCode, iWork&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;花了两个小时吧, 好像也不是很快? 不过就像这篇文章&lt;a href=&quot;http://www.geekpark.net/read/view/102848&quot;&gt;你不再拥有数据&lt;/a&gt;说的那样,&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;可以看到人们对数据的权利发生了变化：从对数据的所有权转变成为了数据的访问权（和编辑权）
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;代码在github/bitbucket, 文件/照片在Dropbox, Google里...&lt;/p&gt;

&lt;p&gt;时代在进步, 也在轮回.&lt;/p&gt;

&lt;p&gt;P.S: 我的常用&lt;a href=&quot;https://github.com/hewigovens/hewigovens.github.com/wiki/Mac-Apps&quot;&gt;MacApps&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;--End&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>从Evernote到Trello</title>
   <link href="http://www.kernelpanic.im/2013/09/13/replace-evernote-with-trello"/>
   <updated>2013-09-13T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2013/09/13/replace-evernote-with-trello</id>
   <content type="html">&lt;p&gt;Trello是Joel Spolsky(软件随想录作者, StackOverflow创始人之一)基于&lt;a href=&quot;https://en.wikipedia.org/wiki/Kanban&quot;&gt;看板&lt;/a&gt;理论开发的项目管理网站, 口号是&quot;Organize anything, together&quot;; Evernote是著名的笔记工具, 口号是&quot;Remember everything&quot;. 按理说两者定位不同, 没什么可比性, 由于我用Evernote始终觉着不爽, Trello又很对我的胃口, 所以打算把Evernote里的东西都移动到Trello.&lt;/p&gt;

&lt;p&gt;下面是一些我觉得有用的一些工具:&lt;/p&gt;

&lt;h3&gt;&lt;a href=&quot;https://chrome.google.com/webstore/detail/boards-for-trello/eknhddnoflchkcccjgdddmnimjggiona&quot;&gt;Boards for Trello&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Chrome Extension, 列出你所有Board, 可以比较便捷的导航.&lt;/p&gt;

&lt;h3&gt;&lt;a href=&quot;https://github.com/hewigovens/Trello-Bookmarklet&quot;&gt;Trello-Bookmarklet&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Bookmarklet, 快速创建卡片, 除了支持FogBugz/JIRA/Github的case页面外, 还支持从任意页面选中的内容创建. 配合&lt;a href=&quot;https://chrome.google.com/webstore/detail/ihckioenbbjedpocnnennnehjaacojil&quot;&gt;SpellBook&lt;/a&gt;效果极佳.
原来的Trello-Bookmarklet选择卡片列表的时候会把已经关闭的Board也列出来, 所以我fork了一份, 会过滤掉已经关闭的Board. 这里要吐槽一下, Trello的Board/List目前是不能删除的, 只能Archive.&lt;/p&gt;

&lt;p&gt;这个就是选中一段文字创建的:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/Freyr/Blog/trello_card_wide_zps02375d86.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/trello_card_wide_zps02375d86.png&quot; width=&quot;100%&quot; border=&quot;0&quot; alt=&quot; photo trello_card_wide_zps02375d86.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;&lt;a href=&quot;https://chrome.google.com/webstore/detail/trello-this/llapjidoaciepmfjchefhhachlmehfdl&quot;&gt;Card this to Trello&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Bookmarklet还是有些不爽, 于是我又搞了个Chrome Extension, 主要改进在于:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;不用输多次App Key了&lt;/li&gt;
&lt;li&gt;添加了右键菜单, 不需要SpellBook也可以了&lt;/li&gt;
&lt;li&gt;把原来的通知改成了Desktop Notification&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;&lt;a href=&quot;http://userstyles.org/styles/92916/wider-trello-card&quot;&gt;Wider Trello Card&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;细心的同学可能发现了, 上面那张截图似乎有点宽? 这是因为我觉得Trello默认的卡片宽度有点窄, 文字一多就看着不太舒服, 所以就写了这个user style脚本, 把卡片的宽度给加大了200px. 顺带提一句, Trello卡片是支持Markdown的, Evernote至今还不支持.&lt;/p&gt;

&lt;p&gt;最后, Trello的移动客户端体验也不错, 很喜欢卡片这种设计, 简单而又一目了然. &lt;a href=&quot;https://trello.com/docs/#tools-and-projects-using-the-api&quot;&gt;这里&lt;/a&gt;能看到更多的工具, 如果没有满意的, 还可以考虑自己动手利用Trello开放的&lt;a href=&quot;https://trello.com/docs/gettingstarted/index.html&quot;&gt;API&lt;/a&gt;来实现.&lt;/p&gt;

&lt;p&gt;--End&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>关于Package Uninstaller</title>
   <link href="http://www.kernelpanic.im/2013/09/12/some-ideas-about-package-uninstaller"/>
   <updated>2013-09-12T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2013/09/12/some-ideas-about-package-uninstaller</id>
   <content type="html">&lt;h3&gt;2013/12/18 Update&lt;/h3&gt;

&lt;p&gt;Apple的EvenBetterAuthorizationSample的例子(非Sandbox)用NSXPCConnection和SMJobBless, 效果一样, NSXPCConnection相当于xpc的Cocoa接口, 不过10.8之后才能用.&lt;/p&gt;

&lt;h3&gt;End&lt;/h3&gt;

&lt;p&gt;在Mac下你肯定有过这种体验: 通过Installer安装的有些App并没有提供卸载工具; 简单的从/Applications移除在MAS安装的App其实会残留很多文件.&lt;/p&gt;

&lt;p&gt;Pacakge Uninstaller旨在提供一种通用的方法来卸载由Installer安装的App(下文将简写成PU), 特别是那些没有提供卸载工具的App. 代码托管在&lt;a href=&quot;https://github.com/hewigovens/PackageUninstaller&quot;&gt;这里&lt;/a&gt;, 下载放在&lt;a href=&quot;https://github.com/hewigovens/PackageUninstaller/wiki&quot;&gt;这里&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;PU目前只是个Proof-of-Concept, 还不支持卸载像MS Office或者Cisco WebEx这类不是很标准的装法的程序: 先安装到临时目录, 然后在postinstall脚本里移动到目的地. 另外安装过程中通过脚本创建的文件也不支持. 如果要做到这些, 可能就需要hook Apple Installer了.&lt;/p&gt;

&lt;p&gt;这里要吐槽下Office, 简直有滥用pkg文件的嫌疑, 安装的时候就是100+的pkg, 每次升级又是几百个, 如果你真想彻底删除, 建议参考微软提供的这个KB
&lt;a href=&quot;http://support.microsoft.com/kb/2398768&quot;&gt;How to completely remove Office for Mac 2011&lt;/a&gt;. 祝你好运, :)&lt;/p&gt;

&lt;p&gt;PU本来是想做像Windows控制面板那样, 是System Preferences的一个面板, 但是Apple的&lt;code&gt;AuthorizationExecuteWithPrivileges&lt;/code&gt;的替代API&lt;code&gt;SMJobBless&lt;/code&gt;似乎只从main bundle里去找helper? 所以最后改成了独立的App.&lt;/p&gt;

&lt;p&gt;PU的原理也蛮简单的, 如果你熟悉Apple的Installer的话, 你肯定知道Installer或者storeagent(MAS的App实际上是通过它安装的)安装完pkg后会在&lt;code&gt;/var/db/receipts/&lt;/code&gt;下生成一份receipt, receipt里记录了安装的路径,权限,大小等信息. PU会去遍历并过滤所有的receipts; 真正删除的动作是交给后台的helper去做的.&lt;/p&gt;

&lt;p&gt;后台的helper是一个以root权限运行的xpc service, 虽然xpc service的设计目的并不想让人这么用, 但是据我观察, Github的Mac客户端也是这么干的, SourceTree的Mac客户端做法略有不同, 可能是自己用domain socket实现的IPC或者是直接用的&lt;code&gt;launch_msg&lt;/code&gt;. 我这么怀疑是因为helper里也用到了&lt;code&gt;launch_msg&lt;/code&gt;, 作用是卸载的时候尝试移除同名的launchd job. 不管怎么说, 看来比起命令行传参数或者执行某个脚本, 大家觉得还是IPC比较优雅.&lt;/p&gt;

&lt;p&gt;PU的最开始是考虑用DO的, 除去传统Unix的一些IPC方法, 用的多的就是DO了. 这篇文章值得一读&lt;a href=&quot;http://www.mikeash.com/pyblog/friday-qa-2009-02-20-the-good-and-bad-of-distributed-objects.html&quot;&gt;The Good and Bad of Distributed Objects&lt;/a&gt;, 这里主要提一下DO不好的地方, 我是因为第3条才不用的:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;对基本类型没什么支持, 需要实现NSCoding的对象才可以.&lt;/li&gt;
&lt;li&gt;对于error handle支持不太符合OC的通常做法, 连接断掉DO会抛出异常, 而大部分OC的代码对异常支持不太友好. 我们之前遇到过这个坑, 解法是加上try/catch.&lt;/li&gt;
&lt;li&gt;安全问题, 默认DO没有加密, 也没有比较好的机制来保证安全性. 还有就是因为OC的特性, 可以很容易用class-dump来看出你的方法名. 这里可以看看&lt;a href=&quot;https://github.com/JaviSoto/iOS7-Runtime-Headers/commit/6ccf9c4526992fec0dc414d48e4a3f7446e9822f&quot;&gt;Apple是怎么隐藏新feature&lt;/a&gt;的: 开发过程中先把方法命名成这种外人猜不到的&lt;code&gt;isYoMamaWearsCombatBootsSupported&lt;/code&gt;, 然后在GM的时候改回正式命名. 不过这种最后时刻改方法名真的大丈夫?&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;helper里还有一个trick是用&lt;code&gt;stat /dev/console&lt;/code&gt;来判断当前的登录用户, 然后通过&lt;code&gt;getpwuid&lt;/code&gt;来取得用户的home路径, 后来发现这种做法可能会有问题, 因为用户的HOME环境变量可能会和getpwuid的结果不一致, 可以考虑通过IPC作为参数传过来.&lt;/p&gt;

&lt;p&gt;helper在卸载的时候会尝试搜索用户的Caches/Containers/Preferences路径, 如果有bundle id相同的文件或文件夹也会删掉. 根据我自己的测试, 基本效果还不错, MAS下的App基本无压力, 我司带kext, TP-Link带kext的App也能删掉. 不过也有误伤的情况, 比如你装了一个SIMBL的插件, 然后删除的时候会把整个SIMBL的文件夹也给删掉, 因为SIMBL不在PU自带的白名单里. 以后改成让用户确认下删除的列表会比较保险.&lt;/p&gt;

&lt;p&gt;--End&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>BookmarkSpell Introduction</title>
   <link href="http://www.kernelpanic.im/2013/08/09/bookmarkspell-introduction"/>
   <updated>2013-08-09T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2013/08/09/bookmarkspell-introduction</id>
   <content type="html">&lt;p&gt;BookmarkSpell是一个Chrome的浏览器插件, 虽然号称理念是&lt;code&gt;bookmark based automator&lt;/code&gt;, 但是目前已经实现的功能只是试图解决这篇&lt;a href=&quot;http://www.kernelpanic.im/2013/05/03/collection-fragment-1/&quot;&gt;博客&lt;/a&gt;提出的问题:基于浏览器书签的知识管理.&lt;/p&gt;

&lt;p&gt;BookmarkSpell监听了Chrome的书签事件, 在你保存之后会弹出一个窗口让你输入标签和笔记, 点OK之后会BookmarkSpell调用Readability的API来抓取全文并保存到Dropbox的Datastore里.&lt;/p&gt;

&lt;p&gt;具体的代码和使用截图都放在&lt;a href=&quot;https://github.com/hewigovens/BookmarkSpell/&quot;&gt;Github&lt;/a&gt;上了, 第一次写Chrome插件, 遇到不少坑, 求轻拍. Chrome Store链接&lt;a href=&quot;https://chrome.google.com/webstore/detail/hgimfomnnbecdjlndbhkcblaeoegpafn&quot;&gt;在此&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;由于&lt;a href=&quot;https://www.dropbox.com/developers/datastore&quot;&gt;Datastore API&lt;/a&gt;还在Beta阶段, 并没有提供server端可用的SDK(我有尝试把JS的SDK放到nodejs的环境下跑, 可耻的失败了=_=!), 所以最重要的搜索功能还没实现.&lt;/p&gt;

&lt;p&gt;其实有很多人吐槽这个没什么用, 可能他们并没有我这样的需求吧. 另一个原因是现在觉得很多服务都变的不可靠了, 比如上个月底, 我之前的主力笔记工具&lt;a href=&quot;https://catch.com/&quot;&gt;Catch.com&lt;/a&gt;宣布要&lt;a href=&quot;http://support.catch.com/customer/portal/articles/1239367-catch-is-closing-down&quot;&gt;停止服务&lt;/a&gt;了, 之前写的reddit feed也是, 试了很多App, 都不好用. 与其依赖于别人, 还不如自己动手.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>recent interesting things about Objective-C/Cocoa</title>
   <link href="http://www.kernelpanic.im/2013/07/08/recent-interesting-things-about-objective-c-cocoa"/>
   <updated>2013-07-08T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2013/07/08/recent-interesting-things-about-objective-c-cocoa</id>
   <content type="html">&lt;p&gt;最近看到一些有趣的, 和Objective-C/Cocoa有关的事情.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3&gt;▶ &lt;a href=&quot;https://objectivechackathon.appspot.com/&quot;&gt;Objective-C hackathon&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;这次hackathon的口号很有意思:叫&quot;Back on the map&quot;, 在最近TIOBE的排名中, Objective-C的排名一直很高.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/Freyr/Blog/Tiobe_20130711_zps725e3b02.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/Tiobe_20130711_zps725e3b02.png&quot; border=&quot;0&quot; alt=&quot; photo Tiobe_20130711_zps725e3b02.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;不过最近Github的Top Languages列表里, CoffeeScript把Objective-C的前十给挤掉了,这就是口号的由来~, 于是Cue就发起了这次hackathon.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/Freyr/Blog/TopLang_20130711_zps37614a82.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/TopLang_20130711_zps37614a82.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo TopLang_20130711_zps37614a82.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;现在可以在(&lt;a href=&quot;http://tech.cueup.com/blog/2013/07/01/objective-c-hackathon-recap&quot;&gt;Objective-C Hackathon: Recap&lt;/a&gt;)查看结果&lt;/p&gt;

&lt;p&gt;这篇blog中有类似编辑选择奖的东西, 其中就有&lt;a href=&quot;https://github.com/mattt&quot;&gt;Mattt Thompson&lt;/a&gt;, 我也是最近才认识到这位大神的, 他是&lt;a href=&quot;https://www.heroku.com/&quot;&gt;Heroku&lt;/a&gt;的Mobile Lead, 在Github上非常活跃, 参加的组织高达11个, 著名的AFNetworking就是出自他手, 还有&lt;a href=&quot;http://nomad-cli.com/&quot;&gt;Nomad-CLI&lt;/a&gt;, 和&lt;a href=&quot;http://helios.io/&quot;&gt;Helios&lt;/a&gt;, 这两个的项目主页创意都非常棒, 尤其是nomad, cupertino-&gt;houston-&gt;dubai-&gt;venice-&gt;shenzen,从库布提诺到深圳, 串成了完整的&quot;生态链&quot;, 壮哉我天朝大寨都~&lt;/p&gt;

&lt;p&gt;组织的&lt;a href=&quot;https://www.cueup.com/&quot;&gt;Cue&lt;/a&gt;也值得一提, 早在他们还叫&lt;a href=&quot;http://www.greplin.com&quot;&gt;Greplin&lt;/a&gt;的时候我就了, 现在的Cue不但打磨的更漂亮, 还有着更大的愿景:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Know what&#39;s next.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;不过对我来说最有用的还是能够搜索自己的各种数据吧, 非公开的个人搜索引擎和Google刚好形成了互补, 不过Google其实也知道你这些数据吧...&lt;/p&gt;

&lt;h3&gt;▶ &lt;a href=&quot;http://www.kaleidoscopeapp.com/&quot;&gt;Kaleidoscope&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Kaleidoscope是一个光看介绍就觉得像神器, 长久以来难求的Diff工具: 支持文件/文件夹比较, 甚至还支持图片; 漂亮的图标和界面; 支持命令行, 支持各种VCS, 就连名字都那么不俗; 它的&lt;a href=&quot;https://twitter.com/kaleidoscopeapp&quot;&gt;twitter账号&lt;/a&gt;还写着 &quot;The world&#39;s most advanced file comparison application.&quot;, 的确不是滥得虚名. 我曾经用过的FileMerge/DiffMerge/P4Merge/Wine+BeyondCompare与之相比简直就是lamware. 70$绝对是物有所值.&lt;/p&gt;

&lt;p&gt;硬要说美中不足的话, 就是好像不支持比较的时候忽略空格/空白行/制表符?&lt;/p&gt;

&lt;p&gt;KaleidoScope的背后是&lt;a href=&quot;http://www.blackpixel.com/&quot;&gt;Black Pixel&lt;/a&gt;, 他们的另一产品&lt;a href=&quot;http://versionsapp.com/&quot;&gt;Versions&lt;/a&gt;光看介绍也觉得像神器, 不过我基本不用svn, 所以就没有试了. Black Pixel除了做产品, 还提供Service, 从前到后都会的顶级工作室.&lt;/p&gt;

&lt;p&gt;我是从这篇&lt;a href=&quot;http://blackpixel.com/blog/2013/04/interview-questions-for-ios-and-mac-developers-1.html&quot;&gt;blog&lt;/a&gt;了解到Black Pixel的:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;At Black Pixel, most of the developers on our staff have 7 to 10 years of Cocoa experience, and many of them are ex-Apple product engineers. The few &#39;junior&#39; developers we have would be considered very senior anywhere else.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;这就是我说顶级的原因了, 从blog中的问题来看, 还有很多我没怎么接触的Framework, 比如Core Animation/Graphics.&lt;/p&gt;

&lt;p&gt;Black Pixel的&lt;a href=&quot;http://blackpixel.com/team.html&quot;&gt;团队介绍&lt;/a&gt;也很有意思:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Not just a majestic shaolin temple renowned for its kung fu fighting monks.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;自比为少林的高手的大胡子们~&lt;/p&gt;

&lt;h3&gt;▶ &lt;a href=&quot;http://www.plausible.coop/software&quot;&gt;Plausible Labs&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;和Black Pixel很像, Plausible Labs也是一家很酷的工作室, 号称什么都能做(servers, operating systems, graphics pipelines, audio processing), 开发了很多著名的应用和开源类库:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/Freyr/Blog/PJLabs_20130711_zpsf42f6e31.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/PJLabs_20130711_zpsf42f6e31.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo PJLabs_20130711_zpsf42f6e31.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;HockeyApp, Atlassian JMC和Flurry都用到了&lt;a href=&quot;https://www.plcrashreporter.org/&quot;&gt;PLCrashReporter&lt;/a&gt;, 肯定是比iTunes Connect.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://code.google.com/p/plblocks/&quot;&gt;PLBlocks&lt;/a&gt;, 当时也想做类似的东西的. 最后还是放弃在10.5上用block了, 如果当时知道它, 说不定就用上了~&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Block-capable Toolchain/Runtime for Mac OS X 10.5 and iPhone OS 2.2+&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://code.google.com/p/plactorkit/&quot;&gt;PLActorKit&lt;/a&gt;看上去还不错, 不过好像是用pthread实现了actor模型?&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;有时候你真的会很羡慕这些家伙, 兴趣驱动, 良好的氛围, 光是看到这些也能感受到他们的技术热情, 这也难怪国外会有很多&quot;高龄&quot;程序员吧, 或许就像就像Matt在自己&lt;a href=&quot;http://mattt.me/2012/open-source-and-commercial-support/&quot;&gt;blog&lt;/a&gt;里说的那样, Code is our passion.&lt;/p&gt;

&lt;p&gt;The End.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>hack电信HG8245</title>
   <link href="http://www.kernelpanic.im/2013/06/05/hack-telecom-modem-hg8245"/>
   <updated>2013-06-05T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2013/06/05/hack-telecom-modem-hg8245</id>
   <content type="html">&lt;p&gt;迁移宽带的时候发现光猫换成了华为的HG8425, 搜索了下&quot;HG8425 破解&quot;发现相当容易, 这样就可以省下一个路由器了.&lt;/p&gt;

&lt;p&gt;查看HG8425的背面, 上面有默认的WiFI SSID和密码, WiFi连上后直接用root/admin telnet上, 找到telecomadmin的密码.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;hewig@192.168.1.3 ➜  /Users/hewig
% telnet 192.168.1.1
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is &#39;^]&#39;.

Welcome Visiting Huawei Home Gateway
Copyright by Huawei Technologies Co., Ltd.

Login:root
Password:*****
WAP&amp;gt;shell

BusyBox v1.4.1 (2011-07-29 10:25:20 HKT) Built-in shell (ash)
Enter &#39;help&#39; for a list of built-in commands.

WAP(Dopra Linux) # uname -a
Linux EchoLife_WAP 2.6.21.7-hrt1 #4 Sat Apr 14 16:36:05 HKT 2012 armv6l unknown
WAP(Dopra Linux) # cd /mnt/
/mnt/jffs2/   /mnt/nfs/     /mnt/usb1_1/
WAP(Dopra Linux) # cd /mnt/jffs2/
WAP(Dopra Linux) # ls
InformFlag            hw_boardinfo.xml      hw_spec.xml
customizepara.txt     hw_boardinfo.xml.bak  hwontlog.txt
custunpara.txt        hw_bootcfg.xml        main_version
cwmp_rebootsave       hw_ctree.xml          ontstatusfile
eponroguestatus       hw_ctree_bak.xml      watchdogInfo
fsok                  hw_default_ctree.xml
WAP(Dopra Linux) # grep telecomadmin hw_ctree.xml
&amp;lt;X_HW_WebUserInfoInstance InstanceID=&quot;2&quot; UserName=&quot;telecomadmin&quot; Password=&quot;XXXXXXXX&quot; UserLevel=&quot;0&quot; Enable=&quot;1&quot;/&amp;gt;
WAP(Dopra Linux) # exit

success!
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;在网络-&gt;宽带设置里把原来连接类型为桥接的删掉, 再创建连接类型为路由的连接, 填上你的账号密码点应用就OK了.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/Freyr/Blog/hw8245_network_settings_zps575cb968.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/hw8245_network_settings_zps575cb968.png&quot; border=&quot;0&quot; alt=&quot; photo hw8245_network_settings_zps575cb968.png&quot; width=100%/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/Freyr/Blog/hw8245_network_settings2_zps6022b285.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/hw8245_network_settings2_zps6022b285.png&quot; border=&quot;0&quot; alt=&quot; photo hw8245_network_settings2_zps6022b285.png&quot; width=100%/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Update&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;hw_ctree.xml&lt;/code&gt;里有个&lt;code&gt;TotalTerminalNumber&lt;/code&gt;配置项, 是用来限制同时上网的终端数, 默认是4, 改成8就允许8台电脑同时上网了.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>从程序员角度思考驾驶</title>
   <link href="http://www.kernelpanic.im/2013/06/03/thinking-driving-in-programmer-perspective"/>
   <updated>2013-06-03T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2013/06/03/thinking-driving-in-programmer-perspective</id>
   <content type="html">&lt;p&gt;驾驶和技术其实有些相通的:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;需要勤练习, 不练就会手生.&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;这和写代码是一样一样的&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;从一开始就养成好习惯, 避免驾驶陋习&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;这不就是一上来就用best practice?&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;从错误中学习, 不在同样的地方跌倒&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;有点像防御性编程&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;手动挡汽车暴露了过多的细节: 离合/换挡&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;类似于C/C++, 手动管理内存, 指针操作&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;手动挡汽车熄火&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;EXC_BAD_ACCESS or SIGBUS&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;自动挡汽车不用担心熄火问题, 操作简单, 解放左脚&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;Python/Ruby, 显著提高开发效率&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Google的无人驾驶汽车才是未来&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;declarative language, 你只要告诉去哪就好了, 不用管怎么去&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;暂时就想到这些, 以上.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>collection fragment 2</title>
   <link href="http://www.kernelpanic.im/2013/05/05/collection-fragment-2"/>
   <updated>2013-05-05T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2013/05/05/collection-fragment-2</id>
   <content type="html">&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Program-or-Be-Programmed&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;http://www.scribd.com/doc/47990572/Rushkoff-Douglas-Program-or-Be-Programmed-Ten-Commands-for-a-Digital-Age&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;In the emerging, highly programmed landscape ahead,you will either create the sofware or you will be the sofware.It’s really that simple: Program, or be programmed. Choose the former, and you gain access to the control panel of civilization.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;book&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;programming&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;编程将成为驾驶之类的普通技能之一&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Simplify&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;http://paulstamatiou.com/simplify&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;I had a revelation one day when I realized I didn&#39;t have to read everything I found on the Internet.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;blog&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;life&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;simplify&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;略有感触&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;helios&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;http://helios.io/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Helios is an open-source framework that provides essential backend services for iOS apps, from data synchronization and push notifications to in-app purchases and passbook integration. It allows developers to get a client-server app up-and-running in just a few minutes, and seamlessly incorporate functionality as necessary.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;library&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;iOS&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ruby&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;heroku&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;backend&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;有点像开源版的Parse?&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;乔布斯：遗失的访谈_中英双语字幕版&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;http://v.youku.com/v_show/id_XNTUxNDY1NDY4.html&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;video&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;steve jobs&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;interview&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;It comes down to taste!&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;xctool&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://github.com/facebook/xctool&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;xctool is a replacement for Apple&#39;s xcodebuild that makes it easier to build and test iOS and Mac projects.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;tool&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;build&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;facebook&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;下次就用上, 比xcodebuild输出友好多了, 而且还能显示花费的时间&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Python in Practice: Create Better Programs Using Concurrency, Libraries, and Patterns&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;http://my.safaribooksonline.com/book/programming/python/9780133373271&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;book&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;python&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;好像还没写完, 此safari非彼safari&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Redis 设计与实现&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;http://www.redisbook.com/en/latest/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;本书的目标是以简明易懂的方式讲解 Redis 的内部运行机制， 通过阅读本书， 你可以了解到 Redis 从数据结构到服务器构造在内的几乎所有知识。&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;book&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;redis&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;开源方式写书的越来越多了&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;BitTorrent Sync&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;http://labs.bittorrent.com/experiments/sync.html&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Automatically sync files via secure, distributed technology.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;tool&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;BT&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Sync&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;分布式技术来同步, 没有存储限制, 更安全&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;SkyFonts&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://skyfonts.com/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Syncing desktop fonts to your machines&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;tool&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;font&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;sync&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;哈, 这个想法还蛮好的, 可以考虑利用dropbox clone一个免费版出来?&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>collection fragment 1</title>
   <link href="http://www.kernelpanic.im/2013/05/03/collection-fragment-1"/>
   <updated>2013-05-03T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2013/05/03/collection-fragment-1</id>
   <content type="html">&lt;p&gt;一直觉得浏览器的书签收藏功能起不到知识管理的作用:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;原有的链接可能会失效&lt;/li&gt;
&lt;li&gt;添加起来容易,但是搜索起来很困难&lt;/li&gt;
&lt;li&gt;不能添加notes&lt;/li&gt;
&lt;li&gt;不能分类, 加tag&lt;/li&gt;
&lt;li&gt;Reader之后, 对各种服务的持久性产生了怀疑&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;各种各样的书签工具都用过, &lt;a href=&quot;http://zootool.com/&quot;&gt;Zootool&lt;/a&gt;和&lt;a href=&quot;http://ikeepu.com/&quot;&gt;爱库&lt;/a&gt;还有之前的&lt;a href=&quot;https://delicious.com&quot;&gt;Delicious&lt;/a&gt;注重social功能和预览图; &lt;a href=&quot;www.pearltrees&quot;&gt;PearlTree&lt;/a&gt;的可视化和分类管理做的很炫,但是维护起来麻烦. &lt;a href=&quot;http://historio.us&quot;&gt;historio.us&lt;/a&gt;很不错, 不过免费版只能添加50条书签, 要是能和PearlTree结合起来就好了.&lt;a href=&quot;https://chrome.google.com/webstore/detail/holmes/gokficnebmomagijbakglkcmhdbchbhn&quot;&gt;Holmes&lt;/a&gt;是chrome的搜索书签的一个插件, 比自带的要好用.&lt;/p&gt;

&lt;p&gt;我期望的工具可能是更好的historio.us吧:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;定期的sync chrome的bookmarks&lt;/li&gt;
&lt;li&gt;浏览器插件添加书签的时候还能够edit, 添加注释和分类&lt;/li&gt;
&lt;li&gt;更好的可视化展现&lt;/li&gt;
&lt;li&gt;更可读导出和备份格式, 不喜欢bookmark.htm这种&lt;/li&gt;
&lt;li&gt;开源, 能够自己搭建服务&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;暂时只想到这些, 为了以后能够容易的导入导出, 打算先用json记录下.&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span class=&quot;w&quot;&gt;&lt;/p&gt;

&lt;p&gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;How Developers Stop Learning: Rise of the Expert Beginner&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;http://www.daedtech.com/how-developers-stop-learning-rise-of-the-expert-beginner&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;blog&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;programming&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Death sea effect&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Dunning–Kruger_effect&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;井底之蛙的一种, 停止学习的expert就不是expert了&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Firebase&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://www.firebase.com/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Scalable real-time backend Build apps fast without managing servers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;service&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;realtime&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;storage&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;cloud db, 不需要操心backend/server, js真是无所不能&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Backlift Data persistence&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;http://backlift.github.io/docs/persistence.html&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;In Backlift any app can store data on the server and retreive it later. This allows apps to implement complex functionality, such as collecting data from users via forms and visualizing that data in meaningful ways, or cordinating moves in a multiplayer game. You don&#39;t need to understand databases or SQL to store and retrieve data, just a basic understanding of javascript and jQuery. If you know how to fetch data jusing jQuery&#39;s ajax() methods, you can use the Backlift persistence API.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;wiki&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;backbone.js&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;backlift&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ALTWWDC&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;http://altwwdc.com/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot; free and open alternative to Apple&#39;s Worldwide Developer Conference - June 10th-14th, 2013. Five days of talks, food, co-working, and mingling with other developers all without the bar noise. Got a WWDC ticket? Didn&#39;t get a WWDC ticket? Doesn&#39;t matter - the conference happens outside the conference.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;conference&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;WWDC&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;WWDC一票难求, 退而求其次?&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;PQL&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://github.com/alonho/pql&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;PQL stands for Python-Query-Language. PQL translates python expressions to MongoDB queries.PQL uses the builtin python ast module for parsing and analysis of python expressions.PQL is resilient to code injections as it doesn&#39;t evaluate the code.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;library&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;python&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;mongodb&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;pythonic way&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Falcon&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;http://falconframework.org/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;The high-performance cloud API framework&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;library&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;python&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;web&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;api&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;framework&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;叫Falcon的项目还真多&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Porting Python 2 Code to Python 3&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;http://docs.python.org/dev/howto/pyporting.html&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;With Python 3 being the future of Python while Python 2 is still in active use, it is good to have your project available for both major releases of Python. This guide is meant to help you choose which strategy works best for your project to support both Python 2 &amp;amp; 3 along with how to execute that strategy.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;wiki&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;python&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;python3&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;portable&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Sleep: Everything You Need To Know&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://medium.com/the-healthy-life&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;1. Set Up A Sleep Schedule 2. Quiet, Dark and Cool 3. Relaxation 4. Track It.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;life&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;sleep&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ReactiveCocoa&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://github.com/ReactiveCocoa/ReactiveCocoa&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ReactiveCocoa (RAC) is an Objective-C framework for Functional Reactive Programming. It provides APIs for composing and transforming streams of values.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;library&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;FRP&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Cocoa&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Objective-C&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Cocoa FRP framework&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;函数式反应型编程(FRP) —— 实时互动应用开发的新思路&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;link&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;http://www.infoq.com/cn/articles/functional-reactive-programming&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;summary&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;描述系统中数据(消息)流的结构关系，至于环境变化如何导致某些数据流变化，这些变化了的数据流又如何导致其它的相关数据流变化，压根儿不需要关心。这是一种编程范式，称之为Reactive Programming。&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;blog&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;tag&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;FRP&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&quot;notes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;基本概念解释的不错&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>overdued 2013 goals</title>
   <link href="http://www.kernelpanic.im/2013/05/02/overdued-2013-goals"/>
   <updated>2013-05-02T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2013/05/02/overdued-2013-goals</id>
   <content type="html">&lt;p&gt;落在Catch的notes里, 都忘记贴上来了:&lt;/p&gt;

&lt;h3&gt;Basic 2013 Goals&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Keep reading/blogging/wiki&lt;/li&gt;
&lt;li&gt;Attending mooc course&lt;/li&gt;
&lt;li&gt;Get Driving license&lt;/li&gt;
&lt;li&gt;Go Taiwan&lt;/li&gt;
&lt;li&gt;Interesting projects&lt;/li&gt;
&lt;li&gt;English words&lt;/li&gt;
&lt;li&gt;Improve economy condition&lt;/li&gt;
&lt;li&gt;Improve server skills&lt;/li&gt;
&lt;li&gt;&lt;del&gt;new Glasses&lt;/del&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
 </entry>
 
 <entry>
   <title>The Review of Year 2012</title>
   <link href="http://www.kernelpanic.im/2013/01/01/the-review-of-y2012"/>
   <updated>2013-01-01T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2013/01/01/the-review-of-y2012</id>
   <content type="html">&lt;hr /&gt;

&lt;p&gt;2012年结束了, 这一年似乎找不到一个关键字来形容. 只觉得时光飞逝, 太多的事情还没来得及做.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;一月份&lt;/strong&gt;, 过年期间去了张家界, 自我感觉挺失败的: 先是给人木讷之感, 后来更是水土不服导致上吐下泻..&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.beta.photobucket.com/user/hewigovens/media/Freyr/Blog/2012_1_zhangjiajie_panoramic_view.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2012_1_zhangjiajie_panoramic_view.jpg&quot; border=&quot;0&quot; alt=&quot;Photobucket&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;黄石寨上拍的伪全景, 四季的张家界各有不同的风味&lt;/h5&gt;

&lt;p&gt;&lt;strong&gt;二月份&lt;/strong&gt;, 入手了Touchpad, 那个时候webOS3.x在平板上的体验比Android要强上不少, 微博等应用做的比官方的还好, Carbon/Graphite更是刷推神器, 我相当喜欢的sliding panels现在也出现在了很多iOS应用上, 比如Path, 新的Gmail等. 后来Touchpad还能刷4.0/4.1, 很有成为一代神器的潜力.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;三月份&lt;/strong&gt;, 开始忙项目了, 那时候还是Mac新手, 各种不会&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;四月份&lt;/strong&gt;, 基本也在忙项目. 入手了第三代iPad, 高分辨率的屏幕还是相当值得的, 至于iPad主要用途么: 还是娱乐为主, 看视频, 打游戏等. 后来有在公司Demo的时候自动循环播放slides过, 哈, 别看这个需求挺常见的, 但是基本没什么好的解决方案(我用的SlideShark). 当然越狱和伪开发也是少不了的, 替代了之前的Touch3, 速度快太多了~&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;五月份&lt;/strong&gt;, 项目进入了Beta阶段, 两个Beta之间改动还蛮多的. 现在想起来, 当时用launchd替代之前的global login item的决定是十分正确的, 只是略显草率, 有些legacy的代码, 你永远也不知道有什么陷阱在等着你. 记得印象很深的一个bug: install的脚本改了几行, 导致装完后一堆问题, 而且并不是100%重现; 那天在公司搞到12点多, 还是没搞定, 第二天review最近check in的代码, 最后怀疑到了改动的install部分, 改回去就OK. 还好后来也找到原因了, 要不然肯定还会喷到类似的问题的.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;六月份&lt;/strong&gt;, 经历了一次Hot issue, 导致周六周日都没了, 原因是在10.4上压根就没测过, 也没有测复杂的升级场景.&lt;/p&gt;

&lt;p&gt;6月份还和绿岛的前辈去了渔山岛, 纯腐败之行; 本来说好的唐同学一起去的, 结果这小子当天早上我都出门了才放我鸽子, 害得我相机都没带..&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.beta.photobucket.com/user/hewigovens/media/Freyr/Blog/2012_6_yushan_ship.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2012_6_yushan_ship.jpg&quot; border=&quot;0&quot; alt=&quot;Photobucket&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;乘的这个船, 速度也就和自行车差不多, 一行人吐的稀里哗啦的…&lt;/h5&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.beta.photobucket.com/user/hewigovens/media/Freyr/Blog/2012_6_yushan_island_stone.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2012_6_yushan_island_stone.jpg&quot; border=&quot;0&quot; alt=&quot;Photobucket&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;渔山岛标志&lt;/h5&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.beta.photobucket.com/user/hewigovens/media/Freyr/Blog/2012_6_yushan_island_overview.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2012_6_yushan_island_overview.jpg&quot; border=&quot;0&quot; alt=&quot;Photobucket&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;岛的一角, 环岛下来也不过30分钟吧, 有种世外的感觉&lt;/h5&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.beta.photobucket.com/user/hewigovens/media/Freyr/Blog/2012_6_yushan_dusk.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2012_6_yushan_dusk.jpg&quot; border=&quot;0&quot; alt=&quot;Photobucket&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;黄昏&lt;/h5&gt;

&lt;p&gt;&lt;strong&gt;七月份&lt;/strong&gt;, 还是legacy代码的问题, 要支持新的Mountain Lion, 又要兼顾旧版本: Gatekeeper带来的sign问题, 又是一阵大改.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;八月份&lt;/strong&gt;, 说来惭愧, 8月份才真正开始写GoAgent iOS独立App, 而且也是个半吊子, 后来大修了一次, 基本改成了root权限运行, 并且用launchd job来控制. 剩下的就是写个比较好用的内置浏览器了~&lt;/p&gt;

&lt;p&gt;邱包子来南京出差, 聚了半天~&lt;/p&gt;

&lt;p&gt;还去了杭州, 可能感觉玩的时间短, 感觉略坑.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.beta.photobucket.com/user/hewigovens/media/Freyr/Blog/2012_8_hangzhou_west_lake2.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2012_8_hangzhou_west_lake2.jpg&quot; border=&quot;0&quot; alt=&quot;Photobucket&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;西湖…&lt;/h5&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.beta.photobucket.com/user/hewigovens/media/Freyr/Blog/2012_8_hangzhou_west_lake.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2012_8_hangzhou_west_lake.jpg&quot; border=&quot;0&quot; alt=&quot;Photobucket&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;雷峰塔…&lt;/h5&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.beta.photobucket.com/user/hewigovens/media/Freyr/Blog/2012_8_hangzhou_wetland.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2012_8_hangzhou_wetland.jpg&quot; border=&quot;0&quot; alt=&quot;Photobucket&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;西溪湿地, 相机后来没电了, 汗, 只拍了这个. 感觉湿地还是很不错的, 我们暴走了一天.&lt;/h5&gt;

&lt;p&gt;&lt;strong&gt;九月份&lt;/strong&gt; 去马尼拉待了两周, night shift, 所以没怎么出去玩, 略遗憾.&lt;/p&gt;

&lt;p&gt;菲律宾由于官方语言是英语, 所以很多的Call Center都建立在马尼拉, 据我的见闻, 大部分年轻人英语都不错, 年长的可能口音重一点, 开始很难听懂.&lt;/p&gt;

&lt;p&gt;吃的基本上是重口味的, 一开始实在是不习惯, 他们米饭也是像菜一样上上来, 这种吃法基本上是西班牙的风格, 而历史上菲律宾也的确是被西班牙殖民统治过.&lt;/p&gt;

&lt;p&gt;还有不知是否是我的错觉, 感觉菲律宾人民大部分过的比较开心, 不像我们, 很多人缺乏幸福感; 听同事讲, 他们的工资是按week来发的, 因为不这样控制下, 很多人很快就没钱了, 他们的钱都拿去happy了~&lt;/p&gt;

&lt;p&gt;另外交通也值得吐槽, 大部分地方是没有红绿灯的, 除了很大的路口, 这样的结果就是马路上车乱的很, 不过他们对过马路的行人都很照顾, 大部分人都会减速甚至停下来让你先过.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.beta.photobucket.com/user/hewigovens/media/Freyr/Blog/2012_9_ph_airport.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2012_9_ph_airport.jpg&quot; border=&quot;0&quot; alt=&quot;Photobucket&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;入境的时候出了点问题, 貌似有护照同名的在他们的黑名单上…&lt;/h5&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.beta.photobucket.com/user/hewigovens/media/Freyr/Blog/2012_9_ph_discovery.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2012_9_ph_discovery.jpg&quot; border=&quot;0&quot; alt=&quot;Photobucket&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;住的酒店&lt;/h5&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.beta.photobucket.com/user/hewigovens/media/Freyr/Blog/2012_9_ph_immigration_bureau.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2012_9_ph_immigration_bureau.jpg&quot; border=&quot;0&quot; alt=&quot;Photobucket&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;坑爹的移民署, 在Intramuros里, 因为入境的事情, 又跑了一趟; 衣冠不整是不让进的哦&lt;/h5&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.beta.photobucket.com/user/hewigovens/media/Freyr/Blog/2012_9_ph_volcano.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2012_9_ph_volcano.jpg&quot; border=&quot;0&quot; alt=&quot;Photobucket&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;本来要去的火山湖, 结果刚到外围就下大雨了&lt;/h5&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.beta.photobucket.com/user/hewigovens/media/Freyr/Blog/2012_9_ph_eastwood.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2012_9_ph_eastwood.jpg&quot; border=&quot;0&quot; alt=&quot;Photobucket&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;Eastwood, 凌晨的时候也是灯火通明&lt;/h5&gt;

&lt;p&gt;&lt;strong&gt;十月份&lt;/strong&gt; 回家了, 与一月份相对应, 把我的笔记本带回去了, 正式宣告全面转向Mac~&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;十一月&lt;/strong&gt; 基本在补去年的计划, Wiki总算搭建起来了, 整理了不少东西, 每天都有在学习~&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;十二月&lt;/strong&gt; 莫民奇妙的开始忙起来了, 先是被TOI了一份略奇葩的代码, 然后又是各种会议.&lt;/p&gt;

&lt;p&gt;月底的时候帮领导入手了iPhone5, 用了一天, 我勉强可以单手操作, 但是屏幕显得窄, 不太喜欢. iOS6其实挺不错的, 很多细节都有改进, 虽然地图略差, 但是Google Maps不也出来了么, 唯一的障碍就是越狱了.&lt;/p&gt;

&lt;p&gt;还有小米同学从棒子国回来了, 小聚了一下, 留学生活果然很不错~&lt;/p&gt;

&lt;p&gt;goagent.org终于挂上去了, 这个也是拖了很久的事情了; goagent拿到了开源中国评选的最受欢迎的开源软件, 在经历了各中被黑后, 2012年总算有了一个好的结局.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;仔细回顾下&lt;/strong&gt;, 2012过的也不是那么苍白, 对照下&lt;a href=&quot;http://www.kernelpanic.im/2012/01/02/the-review-of-y2011/&quot;&gt;2011年的期望&lt;/a&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;后面有统计图, 基本能说明问题, GR阅读确实减少了很多; SNS的话也是显著减少了使用; Kindle在入了iPad后基本处于闲置状态, 至于阅读有价值的内容基本是个伪命题, 因为你不看完是不知道对你是不是有价值的. 看书方面则是逐年减半, 2012年勉强月均一本, 虽说数量减少了, 但是书都是好书, 我只能这么自我安慰了.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/hewigovens/hewigovens.github.com/wiki/_pages&quot;&gt;Wiki&lt;/a&gt;总算是搞起来了, 形式其实不太重要(现在基本上是markdown的纯文本, 要迁移也很容易), 重要的是不停的思考+记录; Blog的话也是勉强月均1篇, 之前的草稿很多直接进了wiki&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;略遗憾, 没有做到; 不过对git/github的使用明显重度了: 看完了Pro Git, 自己搭建过git server,现在的wiki/blog/vim,shell config/snippts 基本全在github上, 甚至还试用了perforce的git fusion(烂东西…)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;去了几个地方, 应该算合格.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;英语听力应该提高不少(WWDC视频, MongoDB的Online课程), 但是现在很多以前记住的单词反而不会写了啊, 这是怎么一回事啊&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&lt;a href=&quot;http://s750.beta.photobucket.com/user/hewigovens/media/Freyr/Blog/2012_12_google_reader_stats.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2012_12_google_reader_stats.png&quot; border=&quot;0&quot; alt=&quot;Photobucket&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;Google Reader statistics&lt;/h5&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.beta.photobucket.com/user/hewigovens/media/Freyr/Blog/2012_12_reading_dna.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/Blog/2012_12_reading_dna.png&quot; border=&quot;0&quot; alt=&quot;Photobucket&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;阅读DNA分析的豆瓣数据&lt;/h5&gt;

&lt;p&gt;不知不觉也写了这么长了, 新年的期望留在下篇吧~&lt;/p&gt;

&lt;p&gt;--END--&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Mac下挂载可写NTFS分区</title>
   <link href="http://www.kernelpanic.im/2012/12/29/mount-writable-ntfs-partition-for-mac"/>
   <updated>2012-12-29T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2012/12/29/mount-writable-ntfs-partition-for-mac</id>
   <content type="html">&lt;hr /&gt;

&lt;p&gt;在Mac下, 默认挂载的NTFS分区是只读的, 有时候会很不方便. 商业的解决方案有￼￼&lt;a href=&quot;http://www.tuxera.com/products/tuxera-ntfs-for-mac/&quot;&gt;Tuxera&lt;/a&gt;和&lt;a href=&quot;http://www.paragon-software.com/home/ntfs-mac/&quot;&gt;Paragon&lt;/a&gt;, 开源的就是&lt;a href=&quot;http://macntfs-3g.blogspot.com/&quot;&gt;ntfs-3g&lt;/a&gt;和&lt;a href=&quot;http://osxfuse.github.com/&quot;&gt;FUSE for OSX&lt;/a&gt;了(MacFUSE的继任者~). 折腾过Linux的同学应该很熟悉他们了.&lt;/p&gt;

&lt;h3&gt;安装步骤:&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;下载&lt;a href=&quot;http://sourceforge.net/projects/catacombae/files/latest/download?source=dlp&quot;&gt;ntfs-3g-2010.10.2-macosx.dmg&lt;/a&gt;, 打开并安装, 记得勾掉&quot;MacFUSE&quot;.&lt;/li&gt;
&lt;li&gt;下载&lt;a href=&quot;https://github.com/downloads/osxfuse/osxfuse/OSXFUSE-2.5.4.dmg&quot;&gt;OSXFUSE-2.5.4.dmg&lt;/a&gt;, 打开并安装, 注意记得勾上&quot;MacFUSE Compatibility Layer&quot;. 原因是ntfs-3g的版本比较老, link的还是MacFUSE的libary.&lt;/li&gt;
&lt;li&gt;如果是10.7以后的系统, 还需要下载&lt;a href=&quot;https://github.com/downloads/bfleischer/fuse_wait/fuse_wait-1.1.pkg&quot;&gt;fuse_wait-1.1.pkg&lt;/a&gt;并安装. 这是个workaround, 具体可以看&lt;a href=&quot;https://github.com/bfleischer/fuse_wait/blob/master/README.md&quot;&gt;这里&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;h3&gt;Reference:&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/osxfuse/osxfuse/wiki/NTFS-3G&quot;&gt;NTFS-3G for Mac OS X&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>MongoDB学习笔记(Final)</title>
   <link href="http://www.kernelpanic.im/2012/12/23/mongodb-learning-note-final"/>
   <updated>2012-12-23T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2012/12/23/mongodb-learning-note-final</id>
   <content type="html">&lt;hr /&gt;

&lt;p&gt;为期7周的M101 MongoDB for Developers上周结束了, 成绩也出来了:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/images/m101_final_score.png&quot; width=100%&gt;&lt;/p&gt;

&lt;p&gt;Question 7是选错答案了, 因为我只看了计算出来的一串数字的首尾几个数字, 然后就选了; 另外一题则是漏选了~&lt;/p&gt;

&lt;p&gt;算起来, 这是我第一个完整的上完的在线课程，这和一定要完整的从头到尾的读完一本书一样，值得纪念一下~&lt;/p&gt;

&lt;p&gt;在线的课程应该是未来的趋势，&lt;a href=&quot;http://en.wikipedia.org/wiki/Massive_open_online_course&quot;&gt;MOOC&lt;/a&gt;这样的术语也应运而生, 这能一定程度解决天朝教育资源分配不均的问题, 比如有些学校的计算机教育实在是落后.&lt;/p&gt;

&lt;p&gt;补上之前的笔记:&lt;/p&gt;

&lt;h2&gt;Week4 Performance&lt;/h2&gt;

&lt;p&gt;这周主要是介绍Performance, 主要讲了索引. MongoDB为了保持key有序使用的是B树. 建立正确的索引能显著提高读的性能, 写由于需要更新index反而会变慢.&lt;/p&gt;

&lt;p&gt;使用的一些例子:&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;students&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ensureIndex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;student_id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;unique&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;dropDups&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;sparse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//创建索引&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//unique参数, 保证index中的key是唯一的&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//dropDups参数, 移除重复的key, 行为是随机的&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//sparse参数, only contain entries for documents that have the indexed &lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//field. Any document that is missing the field is not indexed. &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ensureIndex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//multikey index(key:[array])&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//invalid:db.foo.insert({a:[1,2,3], b:[5,6,7]})&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;places&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ensureIndex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;2d&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;places&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;$near&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;74&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;140&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]}}).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;limit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//geo index~&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;system&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;indexes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//查看当前db的所有索引&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;students&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getIndexes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//查看studens集合的索引&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;students&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;dropIndex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;student_id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//删除索引&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;students&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;stats&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;students&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;tootalIndexSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//索引的大小, not free&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;students&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({}).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;hint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//suggest mongodb use which index&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//In pymongon, the parameters of hint() is a list of tuples.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;system&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;profile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;system&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;profile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;millis&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;$gt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}}).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;sort&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;ts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;mongdod&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;profile&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;slowms&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;setProfileingLevel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getProfilingLevel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//Useful for performance tuning&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;c1&quot;&gt;//Some Comments:&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;c1&quot;&gt;//Use dot notation for embeded part&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//Index creation is in forground by default, &lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//It&#39;s faster but mayblock other writers&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//A background index creation still blocks the mongo shell that &lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//you are using to create the index.Although the database server &lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//will continue to take requests, &lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//A mongod instance can only build one background index at a time &lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//per database.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//$gt/$lt/$ne/$existes/$regex not efficient in using index&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;c1&quot;&gt;//index cardinality&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;c1&quot;&gt;//regular  : 1:1&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//sparse   : &amp;lt;= collection documents&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//multikey : &amp;gt;&amp;gt; collection documents&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;h3&gt;Explain command&lt;/h3&gt;

&lt;p&gt;具体每项的解释可以看这里:&lt;a href=&quot;http://docs.mongodb.org/manual/reference/explain/&quot;&gt;http://docs.mongodb.org/manual/reference/explain/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;zips&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;em&gt;id&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;35004&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;explain&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;cursor&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;BtreeCursor &lt;/em&gt;id&lt;em&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// use index, if BasicCursor, not use index&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;isMultiKey&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;n&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;            &lt;span class=&quot;c1&quot;&gt;// return documents&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;nscannedObjects&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;nscanned&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;nscannedObjectsAllPlans&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;nscannedAllPlans&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;scanAndOrder&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;indexOnly&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;nYields&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;nChunkSkips&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;millis&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;       &lt;span class=&quot;c1&quot;&gt;// query time, a slow query &amp;gt; build in 100ms&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;indexBounds&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;start&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/em&gt;id&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;35004&quot;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;end&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;s2&quot;&gt;&quot;_id&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;35004&quot;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;freyr.lan:27017&quot;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;h2&gt;Week5 Aggregation&lt;/h2&gt;

&lt;p&gt;这周主要介绍了Aggregation框架, 与传统SQL对比可以看
&lt;a href=&quot;http://docs.mongodb.org/manual/reference/sql-aggregation-comparison/&quot;&gt;SQL mapping chart&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Pipeline concept&lt;/h3&gt;

&lt;p&gt;Aggregation的基本理念基本和Unix的管道类似, 链式的一系列操作:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$project -&amp;gt; $match -&amp;gt; $group -&amp;gt; $sort -&amp;gt; $skip -&amp;gt; $limit -&amp;gt; $unwind (unjoin data)
1:1      -&amp;gt; n:1    -&amp;gt;    n:1 -&amp;gt;   1:1 -&amp;gt;   n:1 -&amp;gt;    n:1 -&amp;gt; n:1
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;使用的一些例子:&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;products&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;aggregate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([{&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;$group&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;_id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;$category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;num_products&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nl&quot;&gt;$sum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}])&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//A little like upsert, iterate all documents, return new collections&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&lt;em&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;manufacture&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;$manufacture&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;category&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;$category&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}}&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//group by multiple key:&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//compound id&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//&lt;/em&gt;id can be document, must unique &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;zips&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;aggregate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([{&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;$group&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;_id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;$state&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;population&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;na&quot;&gt;$sum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;$pop&quot;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}])&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//计算每个state的总人口数&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;zips&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;aggregate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([{&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;$group&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;&lt;em&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;$state&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;postal_codes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;na&quot;&gt;$addToSet&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;$&lt;/em&gt;id&quot;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}])&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//统计每个state的所有邮编&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;zips&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;aggregate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([{&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;$project&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;&lt;em&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;city&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;na&quot;&gt;$toLower&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;$city&quot;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;pop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;$pop&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;$state&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;zip&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;$&lt;/em&gt;id&quot;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}])&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//or&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;zips&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;aggregate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([{&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;$project&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;&lt;em&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;city&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;na&quot;&gt;$toLower&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;$city&quot;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;pop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;zip&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;$&lt;/em&gt;id&quot;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}])&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//Reshape~&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;zips&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;aggregate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;$match&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;pop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;$gt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}}}])&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//人口大于100000的state&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;zips&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;aggregate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;$sort&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;city&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}}])&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//排序&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;h3&gt;Limitations:&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;16MB document&lt;/li&gt;
&lt;li&gt;10% of the memory on a machine&lt;/li&gt;
&lt;li&gt;sharding, mongos&lt;/li&gt;
&lt;li&gt;mapreduce/hadoop&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;Week6 Application Engineering&lt;/h2&gt;

&lt;p&gt;这周主要探讨了如下几个话题:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Durability of writes&lt;/li&gt;
&lt;li&gt;Avalibility fault tolerance&lt;/li&gt;
&lt;li&gt;Scaling&lt;/li&gt;
&lt;/ol&gt;


&lt;h3&gt;Write concern&lt;/h3&gt;

&lt;p&gt;通常在mongodb的driver可以配置, 如pymongo. 值得一提的是课程还没结束pymongo就release新版本了&lt;a href=&quot;http://api.mongodb.org/python/current/&quot;&gt;pymongo 2.4&lt;/a&gt;~&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Warning DEPRECATED: Please use mongo_client instead.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-py&quot; data-lang=&quot;py&quot;&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;pymongo&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pymongo&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;MongoClient&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;write_concern&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# {}&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;write_concern&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;w&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&#39;wtimeout&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;write_concern&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# {&#39;wtimeout&#39;: 1000, &#39;w&#39;: 2}&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;write_concern&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;j&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;write_concern&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# {&#39;wtimeout&#39;: 1000, &#39;j&#39;: True, &#39;w&#39;: 2}&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;write_concern&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;j&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;write_concern&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# {&#39;j&#39;: True}&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;write_concern&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&#39;w&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#Disable write acknowledgement and write concern&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;c&quot;&gt;# SafeMode == {&#39;w&#39;: 1,&#39;j&#39;:False}&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# w=n: write ack back from n nodes&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# j: journal, complete inserted to db&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# w=&#39;majority&#39;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;c&quot;&gt;# wtimeout=1000&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# if mongod nodes is 3, &#39;w&#39; is 4 and not set wtimeout&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# wait tcp timeout maybe more than 10 mintues&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;h3&gt;Possiable Network errors&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;The network TCP network connection between the application and the server was reset between the time of the write and the time of the getLastError call.&lt;/li&gt;
&lt;li&gt;The MongoDB server terminates between the write and the getLastError call.&lt;/li&gt;
&lt;li&gt;The network fails between the time of the write and the time of the getLastError call&lt;/li&gt;
&lt;/ol&gt;


&lt;h3&gt;Replication&lt;/h3&gt;

&lt;p&gt;At least 3 mongod nodes, If primary is down, secondary will elect new primary. It&#39;s transparently for client. If primary is up after down.(Failover and Rollback or copy data from currently primary).&lt;/p&gt;

&lt;p&gt;Both primary and secondary can read, But only primary can write.&lt;/p&gt;

&lt;p&gt;Replication sync between primary and secnodary is asynchronous:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;secondary query primary&#39;s oplog.rs collection acoording to timestamp.
type `show collections` in mongo shell can see more details
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Replicate set nodes type:&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;regular&lt;/li&gt;
&lt;li&gt;arbiter&lt;/li&gt;
&lt;li&gt;delayed -&gt; can not become primary&lt;/li&gt;
&lt;li&gt;hidden  -&gt; never primary&lt;/li&gt;
&lt;/ol&gt;


&lt;h4&gt;Create:&lt;/h4&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;mongod --replSet rs1 --logpath &lt;span class=&quot;s2&quot;&gt;&quot;1.log&quot;&lt;/span&gt; --dbpath ~/data/rs1 --port 27017 --fork --shardsvr/--configsvr
mongo --port xxxx&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;h4&gt;Config:&lt;/h4&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;&lt;span class=&quot;nx&quot;&gt;config&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{}&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;rs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;initiate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;rs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;rs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;slaveOk&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//can read from secondary now&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nx&quot;&gt;rs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;isMaster&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;rs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;rs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;help&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;h4&gt;Client&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;pymongo.MongoReplicaSetClient&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Sharding&lt;/h3&gt;

&lt;p&gt;Need a config server(another mongod instance)&lt;/p&gt;

&lt;p&gt;Sharding implications:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;1. every documents contains the shard key
2. shard key is immutable
3. Should index the shard key
4. shard key update must set parameter `multi`
5. Query without shard key -&amp;gt; query all shards
6. no unqiue key unless / begin or part of shard key
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;-END-&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Programming on iPad</title>
   <link href="http://www.kernelpanic.im/2012/11/13/programming-on-ipad"/>
   <updated>2012-11-13T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2012/11/13/programming-on-ipad</id>
   <content type="html">&lt;p&gt;Tim Cook说人们喜欢他们的iPad，以至于什么地方都想用上，比如外出拍照啦，在iPad上写代码啦。。。&lt;/p&gt;

&lt;p&gt;写代码的话至少需要一个无线键盘，罗技的&lt;a href=&quot;http://www.logitech.com/tablet-accessories/keyboard-cases/ultrathin-keyboard-cover&quot;&gt;Ultrathin keyboard cover&lt;/a&gt;看上去不错，Apple自家的无线键盘手感也很好，更cool的是&lt;a href=&quot;http://www.cruxcase.com/products/cruxskunk/&quot;&gt;CruxSKUNK&lt;/a&gt;和&lt;a href=&quot;http://www.kickstarter.com/projects/552506690/brydge-ipad-do-more&quot;&gt;Brydge&lt;/a&gt;，外形媲美MBA了。&lt;/p&gt;

&lt;p&gt;我十分DT的总结了以下几种方案：&lt;/p&gt;

&lt;h3&gt;方案1:iPad + VPS&lt;/h3&gt;

&lt;p&gt;优点：iPad压力小，计算能力取决于VPS的强力程度，无需越狱&lt;br/&gt;
缺点：需要联网，不能开发iOS程序&lt;/p&gt;

&lt;p&gt;真有这么人干哦，而且持续时间长达一年：&lt;br/&gt;
&lt;a href=&quot;http://yieldthought.com/post/12239282034/swapped-my-macbook-for-an-ipad?b5a5f730&quot;&gt;Swapped my macbook for an iPad&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://yieldthought.com/post/31857050698/ipad-linode-1-year-later&quot;&gt;iPad &amp;amp; Linode 1 year later&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;方案2:iPad Programming Apps&lt;/h3&gt;

&lt;p&gt;优点：无需越狱，无需联网，可以开发一些iOS程序（主要是Codea，其他也是玩具。。。）&lt;br/&gt;
缺点：受限于iOS的安全限制&lt;/p&gt;

&lt;p&gt;以下依次是：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Codea, Lua开发iOS程序，并且App Store已经有用它开发的游戏了~&lt;/li&gt;
&lt;li&gt;Python，只要是Apple允许内的行为，还是能做不少事情的&lt;/li&gt;
&lt;li&gt;JsAnyWhere，练习JS&lt;/li&gt;
&lt;li&gt;Vim，无须多言，学习成本略高，但是你会发现到处都能用&lt;/li&gt;
&lt;li&gt;iConsole，看Log，Debug用&lt;/li&gt;
&lt;li&gt;Github Issues, 随时随地回复Issue&lt;/li&gt;
&lt;li&gt;JSON Desinger，GUI设计JSON数据结构，好像没什么用?&lt;/li&gt;
&lt;li&gt;其他。。。&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/images/ipad_codea.png&quot; width=100%&gt;
&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/images/ipad_python.png&quot; width=100%&gt;
&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/images/ipad_jsanywhere.png&quot; width=100%&gt;
&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/images/ipad_vim.png&quot; width=100%&gt;
&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/images/ipad_iconsole.png&quot; width=100%&gt;
&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/images/ipad_github_issues.png&quot; width=100%&gt;
&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/images/ipad_json_designer.jpg&quot; width=100%&gt;&lt;/p&gt;

&lt;h3&gt;方案3:Jailbroken iPad + MobileTerminal + Toolchain&lt;/h3&gt;

&lt;p&gt;优点：几乎什么都能干(C/C++/Python/Lua/Ruby)&lt;br/&gt;
缺点：需要越狱&lt;/p&gt;

&lt;p&gt;直接上效果图：
&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/Freyr/images/ipad_mobile_terminal_2.jpg&quot; width=100%&gt;&lt;/p&gt;

&lt;h3&gt;关于键盘的一些Tips&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://vim.wikia.com/wiki/Avoid_the_escape_key&quot;&gt;Avoid escape key&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.testfreaks.com/information/15-tips-apple-wireless-keyboard-ipad/&quot;&gt;15 Tips Apple wireless keyboard&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://gigaom.com/apple/ipad-keyboard-shortcuts/&quot;&gt;iPad keyboard shotcuts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
 </entry>
 
 <entry>
   <title>Port gevent to iOS</title>
   <link href="http://www.kernelpanic.im/2012/11/13/port-gevent-to-ios"/>
   <updated>2012-11-13T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2012/11/13/port-gevent-to-ios</id>
   <content type="html">&lt;p&gt;什么是&lt;a href=&quot;http://www.gevent.org/&quot;&gt;gevent&lt;/a&gt;：&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;gevent is a coroutine-based Python networking library that uses greenlet to provide a high-level synchronous API on top of the libevent event loop.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;GoAgent local从2.x之后，用gevent重写了，一般来说gevent还是比较适合写server程序，但是GoAgent比较特殊，proxy本来也算server。用gevent好处有很多，比如改善并发的效率，减少内存使用，写起来也很顺手；坏处是gevent并非属于标准库，而且含有C的extension，所以每个平台都需要至少编译一遍，其关键依赖--greenlet的切换基本上通过寄存器保存当前执行栈的情况，这个也是和硬件、平台密切相关的。&lt;/p&gt;

&lt;p&gt;总结起来其实还蛮简单的：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;在iOS设备上搭建编译环境并安装python，具体可以参考wiki:&lt;a href=&quot;https://github.com/hewigovens/hewigovens.github.com/wiki/Develop-Jailbreak-Apps&quot;&gt;Develop Jailbreak Apps&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;git clone https://github.com/hewigovens/gevent-for-ios&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;----这次移植的版本是1.0b4，最新的应该是rc1，看了下&lt;a href=&quot;https://github.com/SiteSupport/gevent/blob/master/changelog.rst&quot;&gt;Changelog&lt;/a&gt; 改动还不少，不过还好greenlet满足要求，所以问题应该不大&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;git clone git://github.com/snaury/greenlet&lt;/code&gt; 然后 &lt;code&gt;git checkout wip-iphone&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;----这个是Snaury移植的greenlet 0.3.4，关键~&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;分别python setup build&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;当然在Mac上cross compile也是可以的~&lt;/p&gt;

&lt;h2&gt;Pre-built binaries&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://code.google.com/p/goagent/downloads/detail?name=gevent-1.0b4-py2.7-macosx-5.1-iPad3%2C1.egg&quot;&gt;Download gevent python egg&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://code.google.com/p/goagent/downloads/detail?name=greenlet.so&quot;&gt;Download greenlet so&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>MongoDB学习笔记(3)</title>
   <link href="http://www.kernelpanic.im/2012/11/13/mongodb-learning-note3"/>
   <updated>2012-11-13T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2012/11/13/mongodb-learning-note3</id>
   <content type="html">&lt;p&gt;Week3主要介绍的是MongoDB的schema desgin。&lt;/p&gt;

&lt;p&gt;在传统关系型数据库设计schmea的时候，经常会有规范化的要求：&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Three goals of normalization relational world?

1. free the database of modification anomalies(一致性，eg,email)
2. minimize redesign efforts
3. avoid biasing any particular aceess parttern
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;我对这个没有太多的接触，体会不多，但是在MongoDB里，主要是application driven design：根据实际的data access pattern来设计，如访问数据的频率？读的多还是写的多？那部分数据经常更新？是否需要原子操作等。&lt;/p&gt;

&lt;p&gt;MongoDB是Document Oriented，基本上也不需要什么ORM中间件了，一大优势~，不过MongoDB不支持常见的一些约束，如外键约束、事务等，这些就需要应用程序或者程序员来保证了。&lt;/p&gt;

&lt;p&gt;总结起来MongoDB的schema design推荐的做法是尽量prejoin/embed数据，MongoDB支持multi key index（可以在mongo shell调用cursor的explain方法来查看是否启用了索引），所以对embeding支持的很好，读取的效率也很高。&lt;/p&gt;

&lt;p&gt;那什么时候不建议embeding呢？主要有如下两个原因：&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;超过16MB的Document&lt;/li&gt;
&lt;li&gt;减少working sets, 比如只想更新部分数据&lt;/li&gt;
&lt;/ol&gt;


&lt;h3&gt;其他&lt;/h3&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;&lt;span class=&quot;c1&quot;&gt;//表示树型结构&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//Given the following typical document for a e-commerce&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//category hierarchy collection called categories&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;_id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;34&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Snorkeling&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;parent_id&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;ancestors&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;35&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;90&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;categories&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;ancestors&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;34&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;c&quot;&gt;#存储大文件&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#store large files(&amp;gt;16MB)&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;gridfs&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Install dpkg on Mac</title>
   <link href="http://www.kernelpanic.im/2012/11/06/install-dpkg-on-mac"/>
   <updated>2012-11-06T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2012/11/06/install-dpkg-on-mac</id>
   <content type="html">&lt;p&gt;最近需要在Mac下生成Cydia源的Packages文件，结果遇到一堆问题，现在记录下过程。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step1&lt;/strong&gt;. &lt;a href=&quot;http://mxcl.github.com/homebrew/&quot;&gt;brew&lt;/a&gt;安装dpkg:&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;
    &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;brew install dpkg&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;dpkg-deb命令基本可以用了，但是dpkg-scanpackages会提示找不到Dpkg.pm&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step2&lt;/strong&gt;. 下载&lt;a href=&quot;http://packages.debian.org/sid/libdpkg-perl&quot;&gt;libdpkg-perl&lt;/a&gt; 解压并放入Perl目录下：&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;
    &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;dpkg-deb -x libdpkg-perl_1.16.9_all.deb tmp&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;
    &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sudo cp -Rf tmp/usr/share/perl5/Dpkg&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; /Library/Perl/5.12&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step3&lt;/strong&gt;. brew安装coreutils和md5sha1sum:&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;brew install coreutils md5sha1sum &lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;如果下载md5sha1sum的时候提示403错误，可以手动从&lt;a href=&quot;http://www.sourcefiles.org/Utilities/Console/M-P/md5sha1sum-0.9.5.tar.gz&quot;&gt;镜像处&lt;/a&gt;下载并放入/Library/Caches/Homebrew，再brew install 一遍应该就好了。&lt;/p&gt;

&lt;p&gt;另外coreutils安装之后所有的命令都有g的前缀，运行dpkg-scanpackages会提示找不到sha256sum，可以简单给gsha256sum创建一个符号链接，或者是在bashrc/zshrc下添加一行:&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;
&lt;span class=&quot;nv&quot;&gt;PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$(&lt;/span&gt;brew --prefix coreutils&lt;span class=&quot;k&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/libexec/gnubin:&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$PATH&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step4&lt;/strong&gt;. patch dpkg-scanpackages&lt;br/&gt;
生成的Packages中Filename路径不正确，多了个/，需要修改下dpkg-scanpackages&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;
    vim &lt;span class=&quot;sb&quot;&gt;&lt;code&gt;&amp;lt;/span&amp;gt;which dpkg-scanpackages&amp;lt;span class=&quot;sb&quot;&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt; 跳到line 187, 添加一行:&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-perl&quot; data-lang=&quot;perl&quot;&gt;    &lt;span class=&quot;nv&quot;&gt;$fn&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=~&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;s/.\/\//.\//g&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;这下dpkg应该基本没问题了~&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>MongoDB学习笔记(2)</title>
   <link href="http://www.kernelpanic.im/2012/10/31/mongodb-learning-note2"/>
   <updated>2012-10-31T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2012/10/31/mongodb-learning-note2</id>
   <content type="html">&lt;p&gt;Week2介绍的是MongoDB的CRUD，主要是mongo shell和pymongo的使用。&lt;/p&gt;

&lt;p&gt;在MongoDB中，和CRUD基本对应的是：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;C -&gt; Insert&lt;/li&gt;
&lt;li&gt;R -&gt; Find&lt;/li&gt;
&lt;li&gt;U -&gt; Update&lt;/li&gt;
&lt;li&gt;D -&gt; Remove&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;总体来说，MongoDB的操作对程序员来说是非常友好的，以programming language APIs(object/function call)的方式操作DB。&lt;/p&gt;

&lt;p&gt;实际和MongoDB server通信使用的是&lt;a href=&quot;http://www.mongodb.org/display/DOCS/Mongo+Wire+Protocol&quot;&gt;Mongo Wire Protocol&lt;/a&gt;：&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;The Mongo Wire Protocol is a simple socket-based,
request-response style protocol.
Clients communicate with the database server through a 
regular TCP/IP socket
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;简单来说就是将描述操作的JSON Object序列化成&lt;a href=&quot;http://bsonspec.org/&quot;&gt;BSON&lt;/a&gt;，通过socket扔给mongod解析并处理。&lt;/p&gt;

&lt;p&gt;MongoDB内部实际使用的都是BSON，binary格式的JSON超集，而mongo shell实际上是个交互式的javascript解释器，你可以运行基本的js语句。&lt;/p&gt;

&lt;p&gt;每个MongoDB存储的Document都有一个唯一标示的字段：_id ，如果你没有明确指定，MongoDB会自动给你生成一个，形如&lt;code&gt;&quot;_id&quot; : ObjectId(&quot;50906d7fa3c412bb040eb577&quot;)&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Insert/Update的一些例子:&lt;/h3&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;&lt;span class=&quot;o&quot;&gt;&lt;em&gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;collection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;/em&gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//添加一个document，参数直接是json object&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;em&gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;collection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;findOne&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;/em&gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//随机返回一个document&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;em&gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;findOne&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;username&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;dwight&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},{&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;email&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;_id&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;/em&gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//查找username为dwight的所有documents，只显示email字段&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;em&gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;collection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;/em&gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//只会返回20项，默认情况下server 10min后会关闭这个cursor&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;h3&gt;Query operator一些例子：&lt;/h3&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;&lt;span class=&quot;o&quot;&gt;&lt;em&gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//mongodb中的Query operator基本上是以embeded document的方式来处理的:&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;/em&gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;grades&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;findOne&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;student_id&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;$gt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}})&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;em&gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//还有$gt $lte&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;/em&gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$exists&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;em&gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//看字段是否存在&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;/em&gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$type&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;em&gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//根据字段的类型来查找&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;/em&gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;$regex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;q&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;$exists&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}})&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;em&gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//$regex 支持正则表达式，libpcre/perl&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;/em&gt;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;$or&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;score&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;$lt:50&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},{}]&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;em&gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//逻辑or，特别之处是一个prefix operator，原因主要是为了符合json的格式&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;/em&gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scores&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;score&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;$gt&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;50&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;score&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;$lt&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;60&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//$and, 如果两个相同的key，起作用的是会是后一个key的值，这是个小陷阱&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;h3&gt;多态查询:&lt;/h3&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;movies&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;em&gt;id&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ObjectId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;5098fa4d1d45e3ddd35f98a1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;name&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;gone with the wind&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/em&gt;id&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ObjectId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;5098fa8a1d45e3ddd35f98a2&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;name&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;inception&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;killer&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;em&gt;id&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ObjectId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;5098faa41d45e3ddd35f98a3&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;name&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;inception&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;movies&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;name&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;inception&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/em&gt;id&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ObjectId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;5098fa8a1d45e3ddd35f98a2&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;name&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;inception&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;killer&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;_id&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ObjectId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;5098faa41d45e3ddd35f98a3&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;name&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;inception&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;h3&gt;Dot notation&lt;/h3&gt;

&lt;p&gt;如果要查询embeded document，MongoDB也提供了dot notation的方式，值得注意的是dot notaion必须用引号括起来才行。&lt;/p&gt;

&lt;h3&gt;sort/skip/limit:&lt;/h3&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;&lt;span class=&quot;o&quot;&gt;&lt;em&gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scores&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;type&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;exam&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;sort&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;score&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;skip&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;limit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;/em&gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//find()返回的是一个cursor, 可以进行排序，或者跳过，返回限定数目的结果，&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;em&gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//这里值得注意的地方是，sort/skip/limit实际上都是在server上处理的&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;/em&gt;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;而且顺序一定是&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;sort&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;skip&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;limit&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;，真正执行&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;实际返回结果的时候&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;h3&gt;Update/Remove/Drop&lt;/h3&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;&lt;span class=&quot;o&quot;&gt;&lt;em&gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scores&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;…&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;/em&gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//update默认的行为除了_id，替换成新的json document&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//如果需要删除某个key，可以使用$unset:{key:1}，修改可以使用$set/$inc:&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;o&quot;&gt;&lt;em&gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scores&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;score&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;$lt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;70&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}},{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;$inc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;score&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}},{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;multi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;/em&gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//给所有分数低于70的加上20, multi很重要  &lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;em&gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//默认update只会更新一个返回的结果，这个多半是随机的  &lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;/em&gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//multi的意思是更新所有，实现上是cooperative的write/yeild.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scores&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;remove&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;drop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//drop比remove快很多，remove相当于批量update，drop则时直接删除数据结构&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;h3&gt;Misc&lt;/h3&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;&lt;span class=&quot;o&quot;&gt;&lt;em&gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;runCommand&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;getLastError&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;/em&gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//error field 如果是空则表明命令执行成功了，否则会有出错信息&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;em&gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scores&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&lt;/em&gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//计数&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;h3&gt;pymongo&lt;/h3&gt;

&lt;p&gt;pymongo风格和python基本保持一致，这也可以算做对程序员友好~，比如：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;findOne()在python中就是find_one()&lt;/li&gt;
&lt;li&gt;还有一些参数上的略微不同：比如cursor的sort()，参数是tuple的数组，原因是dict是无序的，这里也是个小陷阱。&lt;/li&gt;
&lt;li&gt;update()的第三个参数不是json object而是直接&lt;code&gt;multi=True upsert=True&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;一些helper func：save()/find_and_modify()&lt;/li&gt;
&lt;/ul&gt;

</content>
 </entry>
 
 <entry>
   <title>MongoDB学习笔记(1)</title>
   <link href="http://www.kernelpanic.im/2012/10/31/mongodb-learning-note1"/>
   <updated>2012-10-31T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2012/10/31/mongodb-learning-note1</id>
   <content type="html">&lt;p&gt;记录一下学习10genM101 MongoDB for Developers的笔记。&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MongoDB是非关系型的数据库，自我定位是高性能+足够多的feature。&lt;/li&gt;
&lt;li&gt;MongoDB存储JSON Document，不同于传统数据库的表记录，而且JSON&lt;/li&gt;
&lt;li&gt;Document是schema less的，不同的JSON Document里的数据结构可以不同&lt;/li&gt;
&lt;li&gt;MongoDB不支持SQL/Join/事务&lt;/li&gt;
&lt;li&gt;Scale up，垂直扩展，即升级硬件，如CPU，内存，硬盘等。Scale out，水平扩展，即增加节点。MongoDB易于Scale out&lt;/li&gt;
&lt;li&gt;MongoDB使用的默认端口是27017，db的位置/data/db，可以--dbpath指定，第一次启动的时候需要创建这个目录&lt;/li&gt;
&lt;li&gt;mongo shell：&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;db.collection.find()/save().pretty()&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;如果collection不存在会自动创建&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;默认情况下MongoDB在存储JSON Document的时候会立刻返回，所以可能会fail quitely&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;mongodump/mongorestore是用来dump和restore db命令&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;我是直接&lt;code&gt;brew install mongodb&lt;/code&gt;安装的，当然也可以直接下载安装。总的来说课程还不错，介绍了MongoDB的基本情况，并且是以实际的bottle+pymongo+mongodb来实现一个blog为主线来讲的，还介绍了一些bottle/python的基本知识。&lt;/p&gt;

&lt;p&gt;唯一想吐槽的地方是，有些视频实际时间很短可以适当合并的。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>迁移到github</title>
   <link href="http://www.kernelpanic.im/2012/10/21/migrate-to-github"/>
   <updated>2012-10-21T00:00:00+00:00</updated>
   <id>http://www.kernelpanic.im/2012/10/21/migrate-to-github</id>
   <content type="html">&lt;p&gt;终于全部迁移到github上了，blog经历了从CSDN到wordpress的过程，wiki终于开始搭建了，代码片段则可以全交给gist了。&lt;/p&gt;

&lt;p&gt;你会发现人们会逐步认清楚自己的需求，写blog就应该像纸上一样简单:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;静态纯文本，简单的格式 --&gt;   Markdown&lt;/li&gt;
&lt;li&gt;随时随地能写 --&gt; Dropbox/Git repo&lt;/li&gt;
&lt;li&gt;几乎无成本 --&gt; 免费的Github Page&lt;/li&gt;
&lt;li&gt;几乎不需要考虑什么后端，数据库，服务器这些问题&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;关于wiki，现在书签同步，Evernote之类的工具收集起来很方便，但是就是因为太方便了，反而很难记住这些知识，按理说配合强大的搜索如Cue(原greplin)或者时自动智能的分类组织才是正解，只是好像并没有类似的工具，之前和@mytharcher也有讨论过这个问题，说不定下次就自己去做了~&lt;/p&gt;

&lt;p&gt;所以现在的做法还是自己整理出&lt;a href=&quot;https://github.com/hewigovens/hewigovens.github.com/wiki&quot;&gt;wiki&lt;/a&gt;，主要目的是整理的过程中加入了思考，才能固化知识；初步的计划是将之前散落在wordpress中的blog draft、Firefox bookmarks、Evernote、Google Docs甚至notepad.cc中的内容整理进来。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>shell下操作json</title>
   <link href="http://www.kernelpanic.im/2012/03/08/shell-manipulate-json"/>
   <updated>2012-03-08T23:39:52+00:00</updated>
   <id>http://www.kernelpanic.im/2012/03/08/shell-manipulate-json</id>
   <content type="html">&lt;p&gt;最近需要在shell下操作json，当然正常情况下直接python -c &quot;import json ooxxx&quot;就ok了。考虑到脚本会被部署到不同的客户环境下，python版本会有些差异，如Mac 10.5默认的python版本是2.5，10.6默认的是2.6，10.7默认的是2.7，而貌似json库是在2.6才引入的，2.5的话只能用simplejson之类的第三方库。
索性搜索了一下，看有没有直接在shell下直接操作json文件的方法。&lt;/p&gt;

&lt;p&gt;Json.org推荐了两个：&lt;a href=&quot;http://kmkeen.com/jshon/&quot;&gt;Jshon&lt;/a&gt;和&lt;a href=&quot;https://github.com/dominictarr/JSON.sh&quot;&gt;JSON.sh&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;其中JSON.sh是完全用shell实现的json parser，似乎不能做到添加/修改/删除原有json的结构。而jshon是用c实现的，依赖于jansson，使用MIT协议，目的就是为了替代由grep/sed/awk写的fragile adhoc parsers，相比之下python/perl/ruby显得过于笨重了。&lt;/p&gt;

&lt;p&gt;至于使用，参照jshon的文档，拿个json文件试验一下就知道了，对shell很友好：从stdin读入，操作，输出到stdout，和其他的*nix文本处理命令结合使用也很容易。&lt;/p&gt;

&lt;p&gt;下面说说我的使用场景，向json文件插入对象，然后必要的时候容易的插入的对象删除。比如：&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;    &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;test2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;json&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
     &lt;span class=&quot;s2&quot;&gt;&quot;nbndkplefmmhmcmfjanjaakhhkiegogd&quot;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;s2&quot;&gt;&quot;external_crx&quot;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;extension.crx&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;s2&quot;&gt;&quot;external_version&quot;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;1.0&quot;&lt;/span&gt;
     &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;插入对象的话，执行：&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;    &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;jshon&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;key&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;key&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;value1&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;key1&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;value2&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;key2&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;test2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;json&lt;/span&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;span class=&quot;p&quot;&amp;gt;{&amp;lt;/span&amp;gt;
 &amp;lt;span class=&quot;s2&quot;&amp;gt;&quot;nbndkplefmmhmcmfjanjaakhhkiegogd&quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;err&quot;&amp;gt;:&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;p&quot;&amp;gt;{&amp;lt;/span&amp;gt;
  &amp;lt;span class=&quot;s2&quot;&amp;gt;&quot;external_crx&quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;err&quot;&amp;gt;:&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;s2&quot;&amp;gt;&quot;extension.crx&quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;,&amp;lt;/span&amp;gt;
  &amp;lt;span class=&quot;s2&quot;&amp;gt;&quot;external_version&quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;err&quot;&amp;gt;:&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;s2&quot;&amp;gt;&quot;1.0&quot;&amp;lt;/span&amp;gt;
 &amp;lt;span class=&quot;p&quot;&amp;gt;},&amp;lt;/span&amp;gt;
 &amp;lt;span class=&quot;s2&quot;&amp;gt;&quot;key&quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;err&quot;&amp;gt;:&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;p&quot;&amp;gt;{&amp;lt;/span&amp;gt;
  &amp;lt;span class=&quot;s2&quot;&amp;gt;&quot;key1&quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;err&quot;&amp;gt;:&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;s2&quot;&amp;gt;&quot;value1&quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;,&amp;lt;/span&amp;gt;
  &amp;lt;span class=&quot;s2&quot;&amp;gt;&quot;key2&quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;err&quot;&amp;gt;:&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;s2&quot;&amp;gt;&quot;value2&quot;&amp;lt;/span&amp;gt;
 &amp;lt;span class=&quot;p&quot;&amp;gt;}&amp;lt;/span&amp;gt;
&amp;lt;span class=&quot;p&quot;&amp;gt;}&amp;lt;/span&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/figure&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;-i是insert的意思，-n表示新建非string的对象，如object，-s表示是新建string，-e，extract，我理解为进入某一级，-p，则退回上一级；删除的话，会简单一点，指定key就好了，如&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot; data-lang=&quot;js&quot;&gt;    &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;jshon&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;nbndkplefmmhmcmfjanjaakhhkiegogd&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;test2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;json&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;由于jshon依赖于Jansson，如果能将jansson静态链接进jshon，只需要带一个文件就好了，方便一些；这在Linux下很容易做到
只静态链接Jansson，其他的还是动态链接。如：&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-basemake&quot; data-lang=&quot;basemake&quot;&gt;    gcc -o jshon jshon.o -Wl,-Bstatic -ljansson  -Wl,-Bdynamic&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;但在Mac底下就不太好做，apple提供的ld根本就不认识-Bstatic或者-Bdynamic这样的编译选项，没办法只好动态链接了，但是Mac底下的动态链接只会搜索特定的位置，如/usr/local/lib，只好使用otool和install_name_tool来修改之，让jshon从当前路径中搜索libjansson.4.dylib，具体可以参考霍叔的这篇&lt;a href=&quot;http://blog.devep.net/virushuo/2009/07/01/xcodecocoadylib.html&quot;&gt;如何使用第三方的dylib&lt;/a&gt;。&lt;/p&gt;

&lt;p&gt;顺带提下，在64位机器下如果需要编译32位版本jshon的，需要在编译jansson的时候指定为i386. 即./configure -arch i386，编译jshon的时候也要给CFLAGS和LDFLAGS加上-m32 -arch i386的参数。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>修复win7图标异常</title>
   <link href="http://www.kernelpanic.im/2012/03/04/fix-win7-lnkfile-ico"/>
   <updated>2012-03-04T20:39:50+00:00</updated>
   <id>http://www.kernelpanic.im/2012/03/04/fix-win7-lnkfile-ico</id>
   <content type="html">&lt;p&gt;某天突然发现桌面图标异常了：&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2012/03/44f79696gw1dq8y001ibcj_zps7448da15.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2012/03/44f79696gw1dq8y001ibcj_zps7448da15.jpg&quot; border=&quot;0&quot; alt=&quot; photo 44f79696gw1dq8y001ibcj_zps7448da15.jpg&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;清理了桌面图标缓存也没有效果，想到桌面图标基本上是注册表HKEY_CLASSES_ROOT\lnkfile控制，报着试试的想法，备份了下HKEY_CLASSES_ROOT\lnkfile的所有键值，然后删除之，重启explorer。很好，桌面图标都打不开了，再重新导入刚刚备份的reg文件，再重启explorer，奇迹般的好了~&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2012/03/2_zps57c1d22f.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2012/03/2_zps57c1d22f.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo 2_zps57c1d22f.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Linux下安装Dropbox</title>
   <link href="http://www.kernelpanic.im/2012/03/04/linux-manually-installdropbox"/>
   <updated>2012-03-04T20:29:36+00:00</updated>
   <id>http://www.kernelpanic.im/2012/03/04/linux-manually-installdropbox</id>
   <content type="html">&lt;p&gt;上周想在Ubuntu底下接着写一个未完成的shell脚本，直接扔进Dropbox里了。回来的时候发现笔记本上的Ubuntu并没有安装Dropbox，话说以前我一直用Ubuntu One的，从Dropbox官网下载了对应的deb包，安装完运行的时候总是提示无法连接到服务器，设置http代理、ssh代理，改host均无效（也有可能是我姿势不对）。后来在Fanxi的提醒下找到了原因。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www2.dropbox.com/install?os=lnx&quot;&gt;Dropbox for linux&lt;/a&gt;其实只是nautilus-dropbox，并不完整，nautilus-dropbox运行之后需要从Dropbox的网站下载缺少的binary文件，而始终无法连接不到服务器的提示其实是指无法下载这个依赖文件(dropbox-lnx.x86.xxx.tar.gz). wireshark抓包截图说明了这一点，链接直接被RST了，原因嘛。。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2012/03/Selection_001_zpsf8ce642b.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2012/03/Selection_001_zpsf8ce642b.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo Selection_001_zpsf8ce642b.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;知道这一点就好办了，根据wireshark抓包的那个Get请求手动从Dropbox网站下载这个dropbox-lnx.x86.xxx.tar.gz，然后解压之，注意它是个隐藏文件夹.dropbox-dist&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2012/03/Selection_002_zpsd445a687.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2012/03/Selection_002_zpsd445a687.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo Selection_002_zpsd445a687.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;然后mv到~目录下，dropbox start -i 应该就可以运行了.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2012/03/Selection_003_zpsa9c89055.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2012/03/Selection_003_zpsa9c89055.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo Selection_003_zpsa9c89055.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;已经在同步了~&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2012/03/Selection_004_zpsc8cc3de1.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2012/03/Selection_004_zpsc8cc3de1.png&quot; border=&quot;0&quot; alt=&quot; photo Selection_004_zpsc8cc3de1.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>The Review of Y2011</title>
   <link href="http://www.kernelpanic.im/2012/01/02/the-review-of-y2011"/>
   <updated>2012-01-02T01:22:54+00:00</updated>
   <id>http://www.kernelpanic.im/2012/01/02/the-review-of-y2011</id>
   <content type="html">&lt;hr /&gt;

&lt;h3&gt;过去的2011年，关键词是Change：&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;School→Society&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;QA Intern→RD&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;TMMS→Safesync→iTis&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;尽管公司的文化一直提倡Change，但是过于频繁的变动问题更加明显：时间都消耗在了进程的切换上。而且大部分是被动变化，接受和适应还要一段时间。&lt;/p&gt;

&lt;p&gt;缺少&lt;strong&gt;主动的变化&lt;/strong&gt;，缺少&lt;strong&gt;主动的记录&lt;/strong&gt;，缺少&lt;strong&gt;回顾与反省&lt;/strong&gt;，所以回想起来，过去的一年显得很不充实；几乎没写过什么技术贴，有的只是无病呻吟式的抱怨吐槽贴，blog里还躺着好几篇草稿，RIL里都超过50页；经常找不到看过的东西，写过的代码想不起来。&lt;/p&gt;

&lt;p&gt;聊胜于无，权当记录吧：&lt;/p&gt;

&lt;p&gt;2月份，找了一个星期总算租到了还算令人满意的单室套&lt;/p&gt;

&lt;p&gt;4月份，绿岛十年;GoAgent发布了，那时我还在用Wallproxy，哈哈&lt;/p&gt;

&lt;p&gt;5月份，基本是在写毕业论文和demo，速度之慢让人发指，我找到了我拖延症的最大的病因：并非是完美主义，而是看的过多带来的&lt;strong&gt;虚假感&lt;/strong&gt;+没有系统、持续学习技术使得解决问题的&lt;strong&gt;无力感&lt;/strong&gt;+不愿意思考复杂问题的&lt;strong&gt;逃避感&lt;/strong&gt;。&lt;/p&gt;

&lt;p&gt;6月份，我很水的混毕业了，毕业设计是用python和js写的一个小demo。然后是大家各奔东西，唐同学先我一步准备远赴美帝求学。连云港之行&lt;/p&gt;

&lt;p&gt;7月份，正式入职，两个星期的入职培训。&lt;/p&gt;

&lt;p&gt;8月份，正式参与对日本OEM的一个项目；GoAgent支持了iOS&lt;/p&gt;

&lt;p&gt;9月份，项目做到beta时公司进行了调整，项目TOI给日本了&lt;/p&gt;

&lt;p&gt;10月份，经过半个月的等待，被Transfer到了Safesync Team，有了真正意义的Mentor，开始了Mac编程，练手写了个第一个简单的GUI程序，GoAgent Mac&lt;/p&gt;

&lt;p&gt;11月份，参加了公司的EngineerCamp，练手写了相应的iOS版Handbook，哈，完全是巧合编程；GoAgent支持了webOS&lt;/p&gt;

&lt;p&gt;12月份,项目再次调整，被Transfer到了iTis Team；第一次海购，在亚马逊购买了Kindle DX&lt;/p&gt;

&lt;p&gt;乏善可陈吧，我也这么觉得。。&lt;/p&gt;

&lt;h3&gt;2012年，如果世界没有毁灭，我希望做到：&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;减少GReader的订阅和阅读量，减少SNS的使用，多进行深度阅读（Kindle），阅读有价值的内容而不是浮光掠影的表面文章。&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;继续&lt;a href=&quot;http://kernelpanic.im/blog/2011/10/03/xjump/&quot;&gt;XJump计划&lt;/a&gt;；多整理Wiki，固化知识；系统学习技术，多练手，多写Blog；&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;发起或参与新的开源项目&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;进行一次远足旅行&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;提高英语听力+写作&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;暂时只想到这么多吧，话说Markdown写blog真心爽啊&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>HP Pre3使用手记</title>
   <link href="http://www.kernelpanic.im/2011/10/23/hp-pre3-notes"/>
   <updated>2011-10-23T23:46:46+00:00</updated>
   <id>http://www.kernelpanic.im/2011/10/23/hp-pre3-notes</id>
   <content type="html">&lt;p&gt;HP Pre3入手了好几天了，于是有了这篇blog。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;为什么是HP Pre3?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;用了4年的nokia 6120c，也该换了，那为什么选Pre3呢，惠普已经撒手不管呀？原因很简单：1K5左右的非Android，非iOS，非Symbian，非山寨的高性价比的智能机去哪找？主要参数如下，详细参数&lt;a href=&quot;http://www.gsmarena.com/hp_pre_3-3770.php&quot;&gt;在此&lt;/a&gt;。&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Qualcomm MSM8255 Snapdragon 1.4 GHz&lt;/li&gt;
&lt;li&gt;8GB storage, 512 MB RAM&lt;/li&gt;
&lt;li&gt;5MP Camera&lt;/li&gt;
&lt;li&gt;480 x 800 3.58 inches touch screen&lt;/li&gt;
&lt;li&gt;QWERTY keyboard&lt;/li&gt;
&lt;li&gt;WebOS 2.2&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;如果以后RIM的QNX、Nokia N9价格合适说不定也会换过来玩玩。下面开始上图：&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/DSCF1166_zpsa011e2c2.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/DSCF1166_zpsa011e2c2.jpg&quot; border=&quot;0&quot; alt=&quot; photo DSCF1166_zpsa011e2c2.jpg&quot;/&gt;&lt;/a&gt;
全家福&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/DSCF1169_zps817e111d.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/DSCF1169_zps817e111d.jpg&quot; border=&quot;0&quot; alt=&quot; photo DSCF1169_zps817e111d.jpg&quot;/&gt;&lt;/a&gt;
拿在手上刚刚好&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;传说中的WebOS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/unknown_2011-22-10_145806_zpse66bcee7.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/unknown_2011-22-10_145806_zpse66bcee7.png&quot; border=&quot;0&quot; alt=&quot; photo unknown_2011-22-10_145806_zpse66bcee7.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/unknown_2011-22-10_145755_zps5a764af0.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/unknown_2011-22-10_145755_zps5a764af0.png&quot; border=&quot;0&quot; alt=&quot; photo unknown_2011-22-10_145755_zps5a764af0.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/unknown_2011-22-10_145738_zps568a3507.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/unknown_2011-22-10_145738_zps568a3507.png&quot; border=&quot;0&quot; alt=&quot; photo unknown_2011-22-10_145738_zps568a3507.png&quot;/&gt;&lt;/a&gt;
安装的一些应用&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/CIMG0012_zpsbae2578e.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/CIMG0012_zpsbae2578e.jpg&quot; border=&quot;0&quot; alt=&quot; photo CIMG0012_zpsbae2578e.jpg&quot;/&gt;&lt;/a&gt;
随手拍，测试一下相机效果&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/browser_2011-23-10_125454_zpsb9189499.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/browser_2011-23-10_125454_zpsb9189499.png&quot; border=&quot;0&quot; alt=&quot; photo browser_2011-23-10_125454_zpsb9189499.png&quot;/&gt;&lt;/a&gt;
卡片式多任务&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/unknown_2011-21-10_224528_zps99b156ab.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/unknown_2011-21-10_224528_zps99b156ab.png&quot; border=&quot;0&quot; alt=&quot; photo unknown_2011-21-10_224528_zps99b156ab.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/unknown_2011-21-10_224404_zps1879bb24.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/unknown_2011-21-10_224404_zps1879bb24.png&quot; border=&quot;0&quot; alt=&quot; photo unknown_2011-21-10_224404_zps1879bb24.png&quot;/&gt;&lt;/a&gt;
优雅的通知方式&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/updates_2011-21-10_224614_zps21960cf7.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/updates_2011-21-10_224614_zps21960cf7.png&quot; border=&quot;0&quot; alt=&quot; photo updates_2011-21-10_224614_zps21960cf7.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/updates_2011-21-10_225113-150x150_zpsb5f3f72c.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/updates_2011-21-10_225113-150x150_zpsb5f3f72c.png&quot; border=&quot;0&quot; alt=&quot; photo updates_2011-21-10_225113-150x150_zpsb5f3f72c.png&quot;/&gt;&lt;/a&gt;
OTA更新竟然没有挂&lt;/p&gt;

&lt;p&gt;Pre3总体来说体验不错，正常情况下操作十分流畅，WebOS优雅的通知方式，便捷的手势区操作，卡片式多任务，Just type Search，手感很好的QWERTY全键盘，并且整合了Gtalk,GMail,Google Contacts和Goolge Calendar，并且能够备份到HP的server上。这些都是它的优点。缺点就很多了，最大的缺点是在细节的处理，iPhone 4S号称的两百多项改进中，不少都是细节上的，而WebOS很多”基础“的应用，如输入法，地图，浏览器等都差强人意，实在谈不上好用：&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;WebOS基于webkit内核的默认的浏览器，在&lt;a href=&quot;http://acid3.acidtests.org/&quot;&gt;acid3&lt;/a&gt;的兼容性测试得分只有94，而mobile safari满分通过，而&lt;a href=&quot;http://html5test.com/&quot;&gt;html5&lt;/a&gt;测试得分195，远低于mobile safari的296。很多Google Mobile应用都跑不起来，加上尴尬的User-Agent，许多网站都不自动跳转到相应的mobile页面。&lt;/li&gt;
&lt;li&gt;默认无法设置代理，而且默认的VPN只支持IPSEC和Cicso两种，不支持最普通常见的PPTP和L2TP；要不把GoAgent移植上去一下？&lt;/li&gt;
&lt;li&gt;没有统一的设置中心，很多选项甚至需要patch才能启用。&lt;/li&gt;
&lt;li&gt;默认只能改来电的铃声，短信的铃声无法更改，需要patch。&lt;/li&gt;
&lt;li&gt;更换主题需要重启，而Pre3启动非常慢。&lt;/li&gt;
&lt;li&gt;本地化做的很不好，没有靠谱的输入法，SIM Toolkit显示乱码。&lt;/li&gt;
&lt;li&gt;应用太少，而且很多应用操作方式迥异，一致性差&lt;/li&gt;
&lt;li&gt;性能有点糟糕：默认的浏览器在加载很多图片的web网页会导致整个系统hang住；GTalk一次性接收数十条消息也会hang住（tweet.im），下载大文件（如300mb的navit的地图）时也会导致系统hang住，这个时候就只能拔电池,WTF..&lt;/li&gt;
&lt;li&gt;提供的sdk有点寒碜，可能是由于js或者enyo、mojo框架的限制，感觉webos的应用能做的事情很少，这一点和iOS和Android没法相比；&lt;/li&gt;
&lt;li&gt;不能Lock Screen Rotation。&lt;/li&gt;
&lt;li&gt;音频解码支持的不全，有些mp3无法识别播放
。。。
。。。
其他的我已经无力吐槽了
。。。
。。。&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&lt;strong&gt;使用小Tips&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/weq_zps024639d5.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/weq_zps024639d5.png&quot; border=&quot;0&quot; alt=&quot; photo weq_zps024639d5.png&quot;/&gt;&lt;/a&gt;
Webos Quick install，安装ipk必备&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/wifi_media_sync_zps8a31a4e6.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/wifi_media_sync_zps8a31a4e6.png&quot; border=&quot;0&quot; alt=&quot; photo wifi_media_sync_zps8a31a4e6.png&quot;/&gt;&lt;/a&gt;
Wifi media sync，webos“也能“无线同步了&lt;/p&gt;

&lt;p&gt;拿到Pre3后，第一件事情应该是安装preware，这个类似Cydia，不过webos没有越狱的概念？然后安装Impostah，在Activation下创建个Profile，这样就能进入HP App Catalog了。不过很多中文的应用，包括输入法只能在&lt;a href=&quot;www.zoopda.com&quot;&gt;煮机网&lt;/a&gt;、&lt;a href=&quot;http://www.92webos.com&quot;&gt;92webos&lt;/a&gt;，&lt;a href=&quot;http://www.palmjoy.com/&quot;&gt;胖鱼&lt;/a&gt;等论坛或博客下载，这时候WebOS Quick Install就派上用场了。&lt;/p&gt;

&lt;p&gt;WebOS的包文件是ipk，毕竟是基于linux的系统，所以类似deb。&lt;/p&gt;

&lt;p&gt;一些快捷键比较方便：&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;手势区 + A：全选当前文字
手势区 + X：剪切选中的文字
手势区 + C ：复制当前的文字
手势区 + V：粘贴当前的文字

Option + Sym + P：全屏截图
Option + Sym + R：重启WebOS（软重启）
Option + Sym + U：在连接电脑时启动U盘模式
Option + 点击某个程序图标：删除该程序
Option指左边的白色方块键盘。
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;最后的最后，如果你不是不折腾会死星人，最好不要入手，要不然你会后悔的。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>GoAgent小结--技术篇</title>
   <link href="http://www.kernelpanic.im/2011/10/08/goagent-summaries-technical"/>
   <updated>2011-10-08T23:30:07+00:00</updated>
   <id>http://www.kernelpanic.im/2011/10/08/goagent-summaries-technical</id>
   <content type="html">&lt;p&gt;&lt;strong&gt;2012/11/13 Update&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;本文基本过时，最近请参考&lt;a href=&quot;http://www.slideshare.net/phuslu/golang-in-goagent&quot;&gt;GoLang in GoAgent&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2011/12/8 Update&lt;/strong&gt;
具体实现细节，请访问goagent-dev之&lt;a href=&quot;https://groups.google.com/forum/#!topic/goagent-dev/QLrWFUkdT_0&quot;&gt;goagent做了哪些改进？&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GoAgent 一直号称简单快速，不是没有道理的。proxy.py不到800行的代码实现了：跨平台运行、多appid负载均衡、RangeFetch、支持NTLM、支持内网代理、支持ipv6、支持php fetch等诸多feature，其考虑到的一个重要原则是依赖尽可能小，这体现在了：&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;0.代码即程序，Windows下绿色运行，连GAE的sdk都不用装，这得益于先进的打包技术。&lt;br/&gt;
1.实现基本上都是标准库，openssl库也很常见，移植容易。&lt;br/&gt;
2.fetch.php对服务器端的要求较低。需要preg/zlib/curl模块支持，前两个属于标准模块，curl也是常见模块。&lt;br/&gt;
3.合理的默认值，只需要配置appid就可以用了。&lt;br/&gt;
4.不支持gfwlist&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;GoAgent 另一个原则就是追求速度，不断在优化，看看&lt;a href=&quot;https://code.google.com/p/goagent/wiki/ChangeLog&quot;&gt;ChangeLog&lt;/a&gt;就知道了：&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;0.压缩传输，不支持强加密，因为连GMail都被天朝黑客入侵过，保证local到AppEngine的绝对完全并没有太多的意义。。&lt;br/&gt;
1.再如之前整合了gevent或者线程池，为了速度后来又拿掉了；&lt;br/&gt;
2.为了加快启动速度，将读取proxy.ini 放入了全局变量中，代码因此丑陋了；&lt;br/&gt;
3.修正了socket关闭速度慢的问题；&lt;br/&gt;
4.多次重新打包python解释器(proxy.exe)；&lt;br/&gt;
5.简单到极致的GUI，在启动时完成大部分初始化设置并减少if的使用；&lt;br/&gt;
6.为了优化php fetch的规则匹配，干脆将其和GAE的监听端口分开；&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;GoAgent的优势在于在客户端做了大量工作，由本身维护session的状态， 因为GoAgent 既是Client又是Server，本地相当于一个http server（采用了BaseHTTPServer），同时又是Client端，与部署在AppEngine的fetch.py进行通信。所以当我得知有些代理软件使用mysql来维护代理服务器的session状态时，觉得有点惊讶，明显不合理了嘛。另外基于GAE的代理最快的就是直连北京google了，因为Google的很多服务都是云服务，所以一个IP能够提供多种服务，其中就包括AppEngine，因此访问google自家的服务速度很快，而GoAgent 从一开始就是这么做的。&lt;/p&gt;

&lt;p&gt;关于Porting的问题，比如支持iOS，我认为移植平台本身更为容易，所以才有很多人打Android应用的主意，比如最开始的Alien Dalvik，号称让MeeGo支持Andorid 25W应用的&lt;a href=&quot;http://tech.weiphone.com/2011-09-23/translator_fail_241650.shtml&quot;&gt;ACL for MeeGo&lt;/a&gt;，裁剪VirtualBox的&lt;a href=&quot;http://www.bluestack.com&quot;&gt;BlueStack&lt;/a&gt;，一直不温不火的&lt;a href=&quot;http://www.google.com/search?q=mobile+virtualization&quot;&gt;Mobile Virtualization&lt;/a&gt;，尽管这些目前看来还不太实用，比如BlueStack，我就挺好奇它如何解决ABI不同的问题，但是都是移植平台的例子~&lt;/p&gt;

&lt;p&gt;咳，有点扯远了，所以支持iOS最关键的无非就是：1.交叉编译python2.6 for iOS 2.编译pyOpenSSL for iOS。其他的都是如何让设置变得简单，操作简便而已。顺带提一句，pyOpenSSL和SBSetting GoAgent toggle都是在我的ipod上编译的，越狱开发其实门槛也不高，只要搞定了toolchain就ok。&lt;/p&gt;

&lt;p&gt;最后再八卦几句，GoAgent 最开始是托管在github上（其实现在也是），后来为了不&quot;牵连“github，迁移到了Google Code上，在首页上用了一个空的bit.ly 链接指向了真实的地址，原因也是如此；GoAgent 的名字是因为不想再用已经泛滥的proxy。。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>GoAgent小结--统计篇</title>
   <link href="http://www.kernelpanic.im/2011/10/06/goagent-summary-statistics"/>
   <updated>2011-10-06T16:47:19+00:00</updated>
   <id>http://www.kernelpanic.im/2011/10/06/goagent-summary-statistics</id>
   <content type="html">&lt;p&gt;GoAgent 发布快半年了，打算写两篇小结一下，&lt;a href=&quot;http://kernelpanic.im/blog/2011/10/08/goagent-summaries-technical/&quot;&gt;另一篇&lt;/a&gt;会讲技术相关的内容~&lt;/p&gt;

&lt;p&gt;如果没有最开始的随意&lt;a href=&quot;http://internet.solidot.org/article.pl?sid=11/04/11/014244&quot;&gt;发布&lt;/a&gt;，GoAgent 或许还只是个内部使用的小玩意，这是当时的新闻：&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/solidot_news_zps9954881f.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/solidot_news_zps9954881f.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo solidot_news_zps9954881f.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;而现在，GoAgent 在Google Code上star数超过了850，issue数超过了1000，&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/goagent_star_zps1e90bfbe.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/goagent_star_zps1e90bfbe.png&quot; border=&quot;0&quot; alt=&quot; photo goagent_star_zps1e90bfbe.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;这实在是有点意外，不信可以看看上千的都是什么project，CyanogenMod也不过860而已：&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/famous_stars_zps68ad53ed.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/famous_stars_zps68ad53ed.png&quot; border=&quot;0&quot; alt=&quot; photo famous_stars_zps68ad53ed.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;在Google Trends搜索流行度已经超过了老前辈gappproxy。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/trends_zps95ea0382.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/trends_zps95ea0382.png&quot; border=&quot;0&quot; alt=&quot; photo trends_zps95ea0382.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;和最流行的目田门相比，差距也有变小的趋势。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/trends2_zpsb32366bb.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/trends2_zpsb32366bb.png&quot; border=&quot;0&quot; alt=&quot; photo trends2_zpsb32366bb.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;根据Google Analytics 最近三个月的统计，GoAgent 首页PV有23W，独立访问才3.8W，可以推测除了作者之外，有人也每天刷GoAgent的首页。。中间的peak貌似是宣布支持iOS的时候，九月底的另一个peak貌似是支持php的延后效应。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/overview_zpsf17614e3.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/overview_zpsf17614e3.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo overview_zpsf17614e3.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GoAgent 的下载数和用户数很难估计，因为github并没有下载的统计，很多人更新GoAgent也是git remote update这种方式，而且下载了并不代表就会使用。几万用户估计应该有，分布在“全球”。。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/vistors_zps0b050410.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/vistors_zps0b050410.png&quot; border=&quot;0&quot; alt=&quot; photo vistors_zps0b050410.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;很显然，Windows和Chrome用户是主流。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/browsers_os-1024x341_zps37c750de.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/browsers_os-1024x341_zps37c750de.png&quot; border=&quot;0&quot; alt=&quot; photo browsers_os-1024x341_zps37c750de.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GoAgent iOS好一点，提供了Google Code和cydia源的下载，结合Google code和这个简单的&lt;a href=&quot;https://gist.github.com/1266796&quot;&gt;脚本&lt;/a&gt;进行统计，GoAgent iOS大概下载了1500次，而python2.6下载2200次左右，用户数应该不到1千。。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/goagent_ios_down_zps451ccf77.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/goagent_ios_down_zps451ccf77.png&quot; border=&quot;0&quot; alt=&quot; photo goagent_ios_down_zps451ccf77.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GoAgent 的搜索流行度得到了Google Analytics数据的支持，一半以上流量都是通过搜索而来，说明在首页放置下载链接和Google +1是相当正确的。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/search_traffic_zpseceef113.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/search_traffic_zpseceef113.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo search_traffic_zpseceef113.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;顺带提下，还有个ezproxy的事情，具体可以看v2ex的&lt;a href=&quot;http://www.v2ex.com/t/13674&quot;&gt;帖子&lt;/a&gt;和这个&lt;a href=&quot;http://www.ufula.com/vip.html&quot;&gt;链接&lt;/a&gt;，我根据淘宝显示的最近成交记录估算了一下，那个哥们利用GoAgent赚了大概1000块，不过这也从侧面证明了GoAgent的速度和可用性，都可以拿来卖钱了~&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>jsToolbox Update</title>
   <link href="http://www.kernelpanic.im/2011/10/03/jstoolbox-update"/>
   <updated>2011-10-03T09:19:27+00:00</updated>
   <id>http://www.kernelpanic.im/2011/10/03/jstoolbox-update</id>
   <content type="html">&lt;p&gt;把jsToolbox改成了快捷键触发的方式（Ctrl+Alt+Shift+o），默认是隐藏的；添加了几个bookmarklet， &lt;a href=&quot;http://www.faveous.com&quot;&gt;Faveous&lt;/a&gt;，&lt;a href=&quot;http://markzhi.com/&quot;&gt;Mark之&lt;/a&gt;，&lt;a href=&quot;http://getspool.com&quot;&gt;Spool&lt;/a&gt; 最近的几个不错的收藏、整理、阅读网站&lt;/p&gt;

&lt;p&gt;效果图如下：
&lt;a href=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/jstoolbox2.png&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/jstoolbox2-300x122.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;安装路径：http://userscripts.org/scripts/show/105562&lt;/p&gt;

&lt;p&gt;由于Vimperator的关系，快捷键都被它hook掉了，所以使用得先ignore它，Chrome上面的类似Vimperator的extension的做法应该也是user.js这种，突然觉得好没有意思，应该是不会再更新了:(，还不如写写过滤新浪微博垃圾信息的脚本。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>XJump计划</title>
   <link href="http://www.kernelpanic.im/2011/10/03/xjump"/>
   <updated>2011-10-03T00:48:30+00:00</updated>
   <id>http://www.kernelpanic.im/2011/10/03/xjump</id>
   <content type="html">&lt;p&gt;很久没有更新blog了，之前的一条&lt;a href=&quot;http://twitter.com/#!/hewigovens/status/111764208248565760&quot;&gt;tweet&lt;/a&gt;已经抱怨过了，一来是很多web应用确实很方便实用，二来是没有什么值得可以写的东西。但是最近的一些变动让我产生了这个为期一年的XJump计划，嗯，名字明显山寨了《周刊少年Jump》，具体来说:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;1.多写blog：锻炼写作，整理记录，严肃思考
2.多参与开源项目：server side为主，增加自己的选择面
3.多读书：主要是晨读&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;当然了，这些都是建立在较高的执行力的基础之上，用术语来说叫持续交付。自实习、工作以来，一直觉得自己的提高不够速度，还经常发生panic的现象，这种感觉相当不好，加上最近：&lt;/p&gt;

&lt;p&gt;1.MeeGo&lt;a href=&quot;https://meego.com/community/blogs/imad/2011/whats-next-meego&quot;&gt;彻底挂了&lt;/a&gt;，和一个没听说过的LiMo Foundation的另一个项目合并成了Tizen（天真？）。。（好吧，这只是一个感慨而已）
2.换Team了，工作转向了Mac，Android实际做了不到3个月的时间，对Android有点无爱，具体表现在不会主动去折腾，Java高级特性一个没学。Mac的话还可以顺带折腾下iPhone越狱开发，或者为goagent写个设置用的App。
3.多次被“你到底想做什么”这个问题所问住，不够专注，没有强悍到主动选择的地步，有空得把个人wiki好好整理一下。&lt;/p&gt;

&lt;p&gt;嗯，大概情况就是这样子，由于之前的域名神经质的被关键词了，于是我新注册了&lt;a href=&quot;http://kernelpanic.im&quot;&gt;kernelpanic.im&lt;/a&gt;个域名，倒过来读很好记，而且和博客标题很匹配，还配置了一下&lt;a href=&quot;http://www.cloudflare.com&quot;&gt;Cloudflare&lt;/a&gt;,使渣DH主机访问速度也还可以接受，当然挂在Linux Tech Club的VPS上肯定会更快，因为我帮忙迁移到东京机房去了~&lt;/p&gt;

&lt;p&gt;最后附图一张，lion的kernel panic，要重新启动了。
&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/10/mac_zps5ea8b590.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/10/mac_zps5ea8b590.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo mac_zps5ea8b590.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>JSToolbox</title>
   <link href="http://www.kernelpanic.im/2011/06/26/jstoolbox"/>
   <updated>2011-06-26T23:12:42+00:00</updated>
   <id>http://www.kernelpanic.im/2011/06/26/jstoolbox</id>
   <content type="html">&lt;p&gt;最近写了个Greasemonkey脚本&lt;a href=&quot;http://userscripts.org/scripts/show/105562&quot;&gt;jstoolbox&lt;/a&gt;，将一些bookmarklet（爱库，QQ输入法，有道翻译，Instapaper）做成了一个下拉列表，在页面顶上就能点击使用。为什么要多此一举呢？点书签不是很方便吗？原因其实是在我使用Firefox的时候，只会保留地址栏、Tab栏、和右下角的扩展栏，没有书签栏；而且我多年的收藏经验表示，我最讨厌点击书签了，收藏夹里的书签基本上没点过，一是数量比较大，组织的麻烦，二是收藏夹每次打开都是密密麻麻的，根本不想细看。直到我发现了&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/fast-dial-5721/&quot;&gt;Fastdial&lt;/a&gt;，不点收藏夹的情况才有所改观。快速拨号这个功能最早是opera发明的，Firefox上也有很多扩展，但是都用的不太顺手，Fastdial有点不一样，很简单，如同它的名字一样，打开速度很快，支持文件夹的功能，生成的缩略图基本上不看标题也知道是什么网站，而且对应到收藏夹里就一个Fastdial的文件夹，所以我就把Fastdial当成收藏夹来用了。&lt;/p&gt;

&lt;p&gt;这个问题一直存在就对了，不过真正让我写脚本的原因是爱库的Firefox扩展，&lt;a href=&quot;http://ikeepu.com/&quot;&gt;爱库网&lt;/a&gt;是一个用于整理（collect），组织（organize），分享（share）任何互联网上面的网站、图片、视频等资源的在线服务，并且致力于让用户发现（discover）更多有意思的互联网资源。而且爱库网收藏的内容都以缩略图的方式来展示这一点我很满意，为此我还弃用了delicious。安装爱库的Firefox扩展后，它会hook住新Tab的打开页面，效果是不错但是这样一来Fastdial就不能用了；而且必须要到菜单-&gt;工具才能点到爱库的选项。因为菜单栏一般都是隐藏的，所以就相当不爽了。好在爱库提供了一个bookmarklet，顺带我就把其他的一些我觉得有用的bookmarklet给加进来了，代码也很简单，把li元素createElement出来，然后绑定上对应的function，最后添加到当前页面。因为bookmarklet其实就是浏览器执行一段js，所以那些function其实就是bookmarklet。目前已知的问题是在一些web mail里，如网易邮箱会被insert多次，所以把网易邮箱添加到了exclude里。&lt;/p&gt;

&lt;p&gt;效果图如下：&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/06/image_zps36d56bd3.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/06/image_zps36d56bd3.png&quot; border=&quot;0&quot; alt=&quot; photo image_zps36d56bd3.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;鼠标移到JS-Toolbox会出现一个下拉列表，点击即可。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/06/image1_zps674649fc.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/06/image1_zps674649fc.png&quot; border=&quot;0&quot; alt=&quot; photo image1_zps674649fc.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;后续可能的工作：1.添加别的功能，现成的bookmarklet或者其他的js小工具。2.修改代码使得易于修改配置，可以选择哪些打开，哪些关闭。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>GFWED.</title>
   <link href="http://www.kernelpanic.im/2011/06/14/gfwed"/>
   <updated>2011-06-14T13:33:54+00:00</updated>
   <id>http://www.kernelpanic.im/2011/06/14/gfwed</id>
   <content type="html">&lt;p&gt;上周外出的时候突然发现自己的博客上不去了，域名解析的结果正常，ssh连接正常，同时使用这个dreamhost主机的其他人也访问正常，挂代理后访问一切正常。看来很不幸，应该是被墙了。
原因我现在也不太清楚，不知道是白名单正在逐步实施还是某个关键字导致，不过考虑到天朝官员的神经质敏感和偏低的智商，误伤的可能性也相当大。
也好，趁着这个机会，我把博客改名了，由原来的core dump改成了kernel panic；dump这个词给人感觉更为主动，因为一般而言，除了一些自动dump的机制外（如windows蓝屏默认会进行mini dump），发生assert错误，抛出未知exception，或者是segment fault，默认都是终止运行的，不会主动dump。kernel panic一般会出现在roofs挂载失败，找不到kernel等场景，不过这里取的就是字面上的意思，因为内心恐慌而挣扎的瞎折腾；副标题本来想用折腾这个词的，翻译了半天也没找到能像panic这么贴切的词，索性用了playing；不知道是哪位大牛说过的，大意是，计算机只要能给出某种可能性，就会有人实现哗哗哗的实现出来并且衍生出各种。。for possibility寄托了这种美好的愿景。顺带一提的是现在开始用Instapaper了，之前一直用Read it later，不过基本上只用作临时的链接存放处，很符合Later的意思，而Instapaper从字面上理解就更侧重与阅读，而且体验做的很好，包括保存到Evernote，发送到移动设备，和其他社交网站连接等。
我还把Google +1给加上了，测试一下看看。最后贴两张图，是用gimp做的，gimp好难，学不会啊～
&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/06/gfwed2_zpsa61bdd11.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/06/gfwed2_zpsa61bdd11.png&quot; border=&quot;0&quot; alt=&quot; photo gfwed2_zpsa61bdd11.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Mac OS X远程体验</title>
   <link href="http://www.kernelpanic.im/2011/05/19/mac-os-remote-experience"/>
   <updated>2011-05-19T23:21:08+00:00</updated>
   <id>http://www.kernelpanic.im/2011/05/19/mac-os-remote-experience</id>
   <content type="html">&lt;p&gt;在V2ex偶然发现了苹果派的&lt;a href=&quot;http://www.a-pie.com/2011/04/%E5%85%8D%E8%B4%B9os-x%E8%BF%9C%E7%A8%8B%E4%BD%93%E9%AA%8C%E7%8E%AF%E5%A2%83%E5%8D%B3%E5%B0%86%E6%8E%A8%E5%87%BA%EF%BC%8C%E5%BC%80%E6%94%BE%E9%A2%84%E7%BA%A6/&quot;&gt;免费os X远程体验环境即将推出，开放预约&lt;/a&gt;这个帖子，就预约了，其实我主要是想看下pppoe在mac底下命令行是如何配置的。算起来当年也和小唐子折腾过一阵子黑苹果，在家的台式机也装过10.4.7，后来装显卡驱动挂掉了，再后来就是在虚拟机上和苹果体验店。还没有远程体验过mac。这个环境配置用的是vnc，我最早是在用rhel的时候用过，不过现在都是直接ssh了。&lt;/p&gt;

&lt;p&gt;我使用的客户端是开源的tightvnc，注意选择High-speed network，见下图，这是最省事的方法，这个选项主要是为了打开全屏，否则连上后屏幕会一闪而过。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/05/image2_zps7ede537a.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/05/image2_zps7ede537a.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo image2_zps7ede537a.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;输入用户名密码，登录。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/05/image3_zps876dee5a.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/05/image3_zps876dee5a.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo image3_zps876dee5a.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;可以看到，安装的是10.5.2，CPU是AMD的，这和在intel x86机器上装mac没什么区别，皓龙支持的指令集就包括x86。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/05/image4_zps8df6fb84.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/05/image4_zps8df6fb84.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo image4_zps8df6fb84.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;现在对OS的没什么特别的要求，因为很多服务都可以通过浏览器来搞定，10.5.2自带的是safari 3，传说中的safari reader mode好像在5.0版本才支持。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/05/image5_zps9d857f42.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/05/image5_zps9d857f42.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo image5_zps9d857f42.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;也不支持mac app store，snow leopard才支持。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/05/image6_zps4f466612.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/05/image6_zps4f466612.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo image6_zps4f466612.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;dashboard，widget平铺的效果很华丽；dock就不用说了吧&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/05/image7_zps9e6462d1.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/05/image7_zps9e6462d1.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo image7_zps9e6462d1.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;似乎默认没有装pppoe或者pon，由于没有权限本来想使用下安装和使用下macports或者homebrew的，终端感觉没有gnome-terminal或者konsole好用。。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/05/image8_zps22759386.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/05/image8_zps22759386.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo image8_zps22759386.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Application目录下有不少应用程序，其中Textmate被誉为mac下最好用的编辑器之一。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/05/image9_zpscb0077e2.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/05/image9_zpscb0077e2.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo image9_zpscb0077e2.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;不过windows底下有替代品~&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/05/image10_zps054db17d.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/05/image10_zps054db17d.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo image10_zps054db17d.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;自带了ruby,python,java等环境，再mac底下写code应该蛮爽的&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/05/image11_zps57c9aa16.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/05/image11_zps57c9aa16.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo image11_zps57c9aa16.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;体验到这一步就结束了吧，远程连上去有点卡，像播放slide一样，而且mac的不仅仅是mac os x而已，因为苹果现在仍然是软硬都做，mac机器细节部分做的很好，总而言之，mac os x还是值得尝试的。&lt;/p&gt;

&lt;p&gt;再次感谢Michael Won和提供的体验环境~&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>kernel panic</title>
   <link href="http://www.kernelpanic.im/2011/05/19/kernel-panic"/>
   <updated>2011-05-19T12:00:08+00:00</updated>
   <id>http://www.kernelpanic.im/2011/05/19/kernel-panic</id>
   <content type="html">&lt;p&gt;标题党，和编程没有关系，和linux也没有任何关系，不过panic能够很好的形容我目前的状态。许久没有写博客了，这几个月真是barren month，一来是之前做的QA工作实在是没有什么想写的东西，之前写过一篇Automation的入门篇的草稿，关于autoit &amp;amp; sikuli教程与应用，最终还是没有发出来，同样是coding，但是似乎成就感远不如RD。二来好像是见过越来越多的牛人后，觉得自己的见解实在浅薄，特别当你才听过一个名词，人家已经精通的那种感觉，还有就是自己一直“想”做却没有开始，人家三两下就搞定那种；甚至有点害怕交流，失掉了一种折腾精神。。三来似乎是&lt;strong&gt;拖延症|信息强迫症|晚睡强迫症&lt;/strong&gt;越来越严重了，而且最近十分焦虑，甚至有点恐慌，焦虑到经常处于什么事情都不想干的境界，论文还没写完呢，应用还要修改呢，还有那么多idea要实现呢，我是典型的古老的工程谚语：“如果它还能执行，就不要动它”，而且有时会符合帕金森定律的一种表述：“工作总是在最后时刻完成”。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/05/image_zps036834e3.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/05/image_zps036834e3.png&quot; border=&quot;0&quot; alt=&quot; photo image_zps036834e3.png&quot;/&gt;&lt;/a&gt;看看上周的时间都干嘛去了吧，前三毫无疑问是娱乐。。&lt;/p&gt;

&lt;p&gt; 作为一个拖延症患者想解决拖拉问题必然会导致拖延，之前买过的两本《战胜拖拉》、《拖延心理学》除了最开始就再也没有翻过了；加上信息强迫症和晚睡强迫症，才导致目前处于这种状况。晚睡强迫症状，我是借用的一个词，因为我哪怕是很困了，如果不是晚上也不会主动去就休息，而是会发呆或者在网上闲逛干耗时间。我从4月初开始坚持早起（7：20左右，呃，不算早？），早上的时间用来看书，在实习的期间里好像看了5，6本，技术非技术的都有。但是一到晚上就特别困，所以最近打算坚持午休，我用&lt;a href=&quot;http://www.commitie.com/&quot;&gt;Committee&lt;/a&gt;进行记录，类似的有&lt;a href=&quot;http://www.getupp.com/&quot;&gt;Getupp&lt;/a&gt;，中文的有&lt;a href=&quot;http://types.yuzeli.com/habit/&quot;&gt;心理成长|养成习惯&lt;/a&gt;，这种social committee或许又是一个热点，可以和SNS、LBS结合。&lt;/p&gt;

&lt;p&gt; 有点跑题了，拖延症，参照维基百科的定义：&lt;/p&gt;

&lt;p&gt; &lt;strong&gt;“延宕&lt;/strong&gt;（&lt;strong&gt;Procrastination&lt;/strong&gt;）是一种将行为或者任务推迟到稍后时间的个性行为。延宕者通常将延宕作为一种机制，以应付开始或完成任何任务或决定的焦虑。心理学研究者有三个标准来界定延宕:这种行为会阻碍你达到预期目标，它是没有必要的，仅仅是（对应完成事务的）一种推拖延。 延宕经常会带来压力，&lt;strong&gt;负罪感，效率底下，恐慌&lt;/strong&gt;，及其他人对你不能完成任务，不能尽责的不良评价。并且会恶性循环，导致进一步的延宕行为。 对个人来说，轻微程度的延宕是正常的，当其开始阻碍你的正常工作，就需要认真对待它了。慢性/长期的延宕行为，暗示着潜在的心理及生理紊乱。&lt;strong&gt;”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt; &lt;strong&gt;不过真正给我的工作（实习时的工作），我好像不会拖延，拖拉的都是自己想做的事情。&lt;/strong&gt;信息强迫症，百度经验上的说明是：&lt;/p&gt;

&lt;p&gt; &lt;strong&gt;&quot;信息强迫症&lt;/strong&gt;：个人强迫自己去了解一些信息，害怕信息被遗漏的心理现象。是指某些人对信息的渴求，依赖而产生的一种来源于自我，又不能有意识控制的自我强迫状况。你是否每隔一个小时就会看看手机，是不是会感觉手机在震动，或者一天不带手机你会坐立不安，那么你就拥有新时代的通病——信息强迫症。       &lt;br/&gt;
心理专家表示，“信息强迫症”是个人面对大量信息时产生的一种不确定和不安全感，为了不错过可能有价值的信息，逼迫自己不断关注搜集所有信息，它是强迫症延伸出的一种单纯性心理疾病，目前，已经成为上班族的常见问题。&lt;strong&gt;&quot;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt; 这个描述，我太明显了，经常不停的刷Twitter，GoogleReader，GMail，SNS等等，用@&lt;a href=&quot;http://www.wangxiaofeng.net/&quot;&gt;带三个表&lt;/a&gt;在《&lt;a href=&quot;http://www.wangxiaofeng.net/?p=7441&quot;&gt;你说上网有多耽误事吧&lt;/a&gt;》的话来说就是：“现在人们都患上了“信息优越症”，就是这件事我第一个知道，并发布出去，你第二个知道，第一个人就会鄙视你：“好久以前我就看过了。”我的博客后面经常有这样的人留言，以显示自己知道的快。掌握信息更多、更快有啥意思，小强老师很在乎这个，至少可以通过时间差和量差在某一瞬间满足自己的&lt;strong&gt;优越感&lt;/strong&gt;——不管这些信息对人是否有用。”&lt;/p&gt;

&lt;p&gt; 最近的一个例子是&lt;a href=&quot;http://www.bitcoin.org/&quot;&gt;bitcoin&lt;/a&gt;，最近的讨论又热门起来了，不过我确实在两个月前就了解过了，有截图为证。
 &lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/05/image1_zpsfeb27d10.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/05/image1_zpsfeb27d10.png&quot; border=&quot;0&quot; alt=&quot; photo image1_zpsfeb27d10.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; 问题就在于，由于每次都是浮光掠影般的获取信息，很难有深入的见解，这就是为什么好像懂很多,但是在Quora,知乎,甚至Stack Overflow上很多主题不知道怎么回答。这和编程上的一个myth：&lt;strong&gt;&lt;em&gt;“I will learn it when I need it – &lt;/em&gt;我会在我需要的时候再学&lt;em&gt;“&lt;/em&gt;&lt;/strong&gt;是类似的：你了解过了，有需要的时候它会派上用场，&lt;a href=&quot;http://coolshell.cn/&quot;&gt;coolshell&lt;/a&gt;在&lt;a href=&quot;http://coolshell.cn/articles/4235.html&quot;&gt;程序员的谎谬之言还是至理名言？&lt;/a&gt;中做出了很好的解释：&lt;strong&gt;&lt;em&gt;“&lt;/em&gt;这句话伪装在于其听上去像是一个智慧的有经验的开发者说的，但是人们只是以此为借口而随波逐流”，&lt;/strong&gt;语言的学习亦是如此，这段时间我&lt;strong&gt;真正&lt;/strong&gt;开始使用python写程序，正则表达式也开始&lt;strong&gt;真正&lt;/strong&gt;用了起来，现学现用其实很不好，因为很容易陷入某个陷阱，如果你对你使用的语言或者工具没有全局的概念，很容易浪费时间，而且不知道究竟错在哪里，借由Google搜索出来的solution，这实际上就是一个个的magic number和所谓的巧合编程，学习的过程一定要动手写哪怕那些你之前认为很不屑的小东西，这是常识了，无需多言。&lt;/p&gt;

&lt;p&gt; 我试图总结一下造成目前窘境的原因：&lt;/p&gt;

&lt;p&gt; 1.挫败感，这属于信息强迫症的原因，这个东西的结果怎么不是我的预期？[浮光掠影，没有全面深入导致]&lt;/p&gt;

&lt;p&gt;2.沉溺于臆想，拖延症的表现，一个恶习，只想到如何实现就停止了，没有action。[从最小的地方开始入手，坚持行动]&lt;/p&gt;

&lt;p&gt;3.时间观念，必须要”整块的时间“才能开始，或许我应该看看《&lt;a href=&quot;http://book.douban.com/subject/5246820/&quot;&gt;津巴多时间心理学&lt;/a&gt;》&lt;/p&gt;

&lt;p&gt;4.不喜欢做的工作，这个没什么好方法，论文毕设就是如此，而且会导致整块的时间也会被浪费掉。&lt;/p&gt;

&lt;p&gt;5.缺乏一些动力。&lt;/p&gt;

&lt;p&gt;我觉得，不从最根本的心理上解决，什么GTD，番茄时间方法，都不会有什么效果的，所以还是要想方法解决这些问题，嗯。&lt;/p&gt;

&lt;p&gt;写到最后了，这篇博客写作源于上周回学校碰到现在绿岛硬件部现任负责人,聊了几句，他说会把硬件部改名（我之前就想过），然后主要用Java写Android应用，但是他想让下面的人去搞，因为他要参加SRT（人脸识别算法方面？）和XX大赛。转型没有问题，因为就算是现在我也跳不出当时的想法局限，而我当时的主要两个想法就是1.不能太过时了2.这个应用|软件|系统是怎么实现的？可能是我的思考水平一直没有进步的原因吧，换一换会有所改观也不说定。Java和Android方向也没有什么大的问题，主流趋势么，当初绿岛成立不也是赶web的潮流么；问题就在于按之前的C++路线，你不得不对OS，runtime，语言本身甚至其他奇技淫巧都有些了解，才能写出像样的东西，不是说用java就不能了解这些了，用C++能够深入对计算机本身的理解，这点不会有人反对吧，写起来麻烦那是另外的事情了，我其实担心的主要是这个。至于负责人让比自己小的学弟去搞这些，我是不赞同的，你拿什么去指导他们？没有讨论交流，又如何进步？现在的绿岛更多的成为了一个学习的平台，有nb的产出反而不是最重要的了，最起码要让绿岛的成员自身得到成长，这和俱乐部搞青训是一致的，拿没拿到青年组的冠军不是关键，更重要的是最终有多少人能够进入一线队并且能够立足。尽管如此，绿岛十年了，实在是不容易，希望能够看到20周年，甚至30周年的庆典，到时我会回去和你们吹牛的，哈哈。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>4G,64bit,PAE</title>
   <link href="http://www.kernelpanic.im/2011/02/24/4g-64bit-pae"/>
   <updated>2011-02-24T17:52:56+00:00</updated>
   <id>http://www.kernelpanic.im/2011/02/24/4g-64bit-pae</id>
   <content type="html">&lt;p&gt;上周末把内存加到了4G，缘由是在正常的工作环境下：win7下开着Outlook、Communicator，IE，Firefox，VMware或者某个IDE，后台运行着MSE、有道词典、wakoopa、Evernote、gae代理，进程总数70+，内存使用率会80%+，实在是高了点，而且Aero，这些特性都是关掉的。为了缓解这种情况，所以买了两根Kingston 2G 800，不过由于Intel GM965的&lt;a href=&quot;http://www.intel.com/Assets/PDF/datasheet/316273.pdf&quot;&gt;白皮书&lt;/a&gt;上写着只支持DDR2 667和533，如下图，所以那两根条子是降频运行在667频率上的：&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/02/gm965_mem_zps5fa683e0.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/02/gm965_mem_zps5fa683e0.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo gm965_mem_zps5fa683e0.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CPU-Z检测出来为332.5MHz，因为是DDR，乘以2就是667.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/02/dram_fre_zps19a7079b.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/02/dram_fre_zps19a7079b.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo dram_fre_zps19a7079b.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;如何使得内存工作在800Mhz呢？一开始我想使用&lt;a href=&quot;http://www.overclock.net/downloads/255892-setfsb-2-0-a.html&quot;&gt;SetFSB&lt;/a&gt;和SPD tool超频（overlook），说起SetFSB，还有个好玩的事情，若干年前好像就有中国用户fool了SetFSB作者一把，现在还需要激活码才能使用，而且还会弹出警告信息，下图：&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/02/setfsb_warning_zps12cae4eb.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/02/setfsb_warning_zps12cae4eb.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo setfsb_warning_zps12cae4eb.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;后来一想，我从T5500升级到T8100，性能提升已经很明显了，就算超到T9300肯定也改观不大，更关键的是，SetFSB似乎不支持GM965。不过作者一直在&lt;a href=&quot;http://www13.plala.or.jp/setfsb/&quot;&gt;更新&lt;/a&gt;，说不定支持了。&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“当然，无论是用ClockGen还是SetFSB，要改变外频就必须知道PLL的型号。然而市面上有上千种规格不同的东西，ClockGen的作者因为这件令人头痛的事情已经暂停发布很长时间了。目前市面上的PM965 ,GM965系列总共在使用十几种PLL晶振芯片，像主流大厂：惠普，宏基，富士通，东芝的965系列的笔记本主板上基本上都是用的&lt;strong&gt;ICS9LPR363DGLF&lt;/strong&gt;这个型号。还有一些国内厂商比如神州，七喜为了降低成本，PM965主板上用的是SLG8SP510T等廉价芯片，比如神州的825D系列L23XT/L5X5T/L7XXT系列。这些晶振芯片在日本市场上很稀少，目前还没有被SETFSB支持，其作者也增加和改进中”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“能不能用，跟CPU无关，关键是此软件中是否包含你主板上频率发生器的型号？      &lt;br/&gt;
ICS型号，在CPU跟北桥附近，类似于&lt;strong&gt;“9LPRS365BGLF&lt;/strong&gt;”之类的”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;盗用神舟论坛的一张图：&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/02/ppl_zpsa0117d43.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/02/ppl_zpsa0117d43.jpg&quot; border=&quot;0&quot; alt=&quot; photo ppl_zpsa0117d43.jpg&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;内存的话，就算通过修改SPD信息，在主板不支持的情况下也是很不稳定的，而且我的BIOS好像有点老，上次待机的时候蓝屏，windows提醒我考虑一下升级BIOS。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/02/bios_zpsceeadd74.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/02/bios_zpsceeadd74.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo bios_zpsceeadd74.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;上面好像有点扯远了，附一张现在的截图，还是正常的工作环境，效果很明显，响应速度明显变快，就算是高峰的情况也不过是60%+&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/02/22_zps868e8efb.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/02/22_zps868e8efb.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo 22_zps868e8efb.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;系统属性页上的信息如下，上周顺带更新到了windows 7 sp1&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/02/23_zpsc8429a44.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/02/23_zpsc8429a44.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo 23_zpsc8429a44.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;我装的是32位的windows 7，默认情况下实际会显示“4.00GB(2.99GB Usable)”，当然32位肯定也是能够支持超过4G的内存的，要不然那些运行着32位的OS的服务器怎么解释呢（服务器技术比普通PC技术起码领先5年。。）。&lt;/p&gt;

&lt;p&gt;说起64位，为了赶时髦，在win7刚出RC的时候我就告别了xp，安装的却是windows server 2008 x64，而且为了支持CPUVT技术才去换的cpu，当时对服务器的东西比较感兴趣，想法也很奇怪，就想用用服务器硬件、系统，当时还折腾过vmware esxi（硬件不支持啊），xen server，hyper-v（家里的台式安装过）。&lt;/p&gt;

&lt;p&gt;我当时装着双系统，另一个是CentOS 64位，后来换过Gentoo的x64版本。虽然是基于64位的硬件，但是并没有觉得64位的OS运行的更快，就算是现在，原生支持64位的软件也是比较少的，如果通过32位子系统(SysWoW64目录有印象的吧）运行32位的应用程序，速度反而会有些损失，还有驱动程序，不当当是硬件驱动程序，连For ODBC的许多数据库连接驱动很多都没有64位的，不过可以运行32位的ODBC数据源管理程序就是了。&lt;/p&gt;

&lt;p&gt;同样的，在linux下，情况稍微好一点，因为很多package都是可以从source编译安装的，但是也会有些程序需要32位的library，这样又会浪费不少硬盘空间（lib,lib32,lib64目录），算起来，我的笔记本除了主板，像cpu，硬盘，内存，风扇，蓝牙都换掉了，光驱还没想好，找到一个改下螺丝接口就可以换上去的光驱，之前的光驱刻录了几百张后牺牲了；也许还可以买个光驱位的硬盘盒，原来的硬盘位置可以考虑加块SSD硬盘，这样启动加载OS就更快了，而且现在使用USB装系统方便多了。&lt;/p&gt;

&lt;p&gt;平时说的64位，大多数时候指的是Intel 64 (EM64T / AMD64 / x86-64 / x64)，还有安腾处理的IA64，除了在服务器上，基本上碰不到；64位的优势在于，&lt;/p&gt;

&lt;p&gt;1.64位的地址空间，理论上可以支持2的64次方，16 Eb的内存；&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;2.扩展的寄存器集（extended register set），我的理解是这样可以使得函数的调用惯例一致，而且参数，返回值的指针都可以通过寄存器来传递，这样效率更高而且可以避免一些传统的栈溢出的漏洞&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;3.对于开发者来说，cpu指令集变化不算大，相当于做了个并集；&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;4.能通过WoW64 (Windows-on-Windows 64)类似技术来向前兼容应用程序和操作系统&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/02/windows_mem_zpse8b2eb2c.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/02/windows_mem_zpse8b2eb2c.png&quot; border=&quot;0&quot; alt=&quot; photo windows_mem_zpse8b2eb2c.png&quot;/&gt;&lt;/a&gt; Windows实际能支持的最大内存&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;32位OS如何支持超过4G的内存呢？通过PAE（physical address exetension）就可以实现，具体原理可以参考这篇&lt;a href=&quot;http://www.geoffchappell.com/viewer.htm?doc=notes/windows/license/memory.htm&quot;&gt;文章&lt;/a&gt;，讲的非常到位。&lt;/p&gt;

&lt;p&gt;我使用的是ReadyFor4GB这个工具，patch完成重启动后右下角会显示“测试模式”的水印，这样：&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/02/test_mode_zpsf1d4647a.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/02/test_mode_zpsf1d4647a.png&quot; border=&quot;0&quot; alt=&quot; photo test_mode_zpsf1d4647a.png&quot;/&gt;&lt;/a&gt;不过可以通过另一个starforce工具来去掉，留着不也挺cool的。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/02/12_zps26928e6f.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/02/12_zps26928e6f.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo 12_zps26928e6f.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;选择去掉水印&lt;/p&gt;

&lt;p&gt;至于在linux下，就简单了，可以参考这篇&lt;a href=&quot;http://www.cyberciti.biz/faq/ubuntu-linux-4gb-ram-limitation-solution/&quot;&gt;文章&lt;/a&gt;，Ubuntu下直接sudo apt-get install linux-server，重启就OK了。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/02/123_zps80be9d6e.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/02/123_zps80be9d6e.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo 123_zps80be9d6e.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;默认32位的Ubuntu也只识别了3G&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/02/221_zps532e781d.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/02/221_zps532e781d.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo 221_zps532e781d.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;安装linux-image-server,linux-headers-generic-pae，package的名称说明了其主要用途&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/02/1_zps9c133f69.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/02/1_zps9c133f69.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo 1_zps9c133f69.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;正常识别了&lt;/p&gt;&lt;/blockquote&gt;
</content>
 </entry>
 
 <entry>
   <title>iBooks真的检测越狱了</title>
   <link href="http://www.kernelpanic.im/2011/02/22/ibooks-check-jailbreak"/>
   <updated>2011-02-22T21:34:50+00:00</updated>
   <id>http://www.kernelpanic.im/2011/02/22/ibooks-check-jailbreak</id>
   <content type="html">&lt;p&gt;前段时间看&lt;a href=&quot;http://www.weiphone.com/apple/news/2011-02-16/Apple_iBooks_in_the_latest_version_of_the_anti-escape_measures_added_230787.shtml&quot;&gt;新闻&lt;/a&gt;，听说新版的iBooks加入了检测越狱的代码，原理和反向继电器挺像的，接电反而断开：在载入任何受数字版权保护的图书前（例如你从iBookstore里购买的任何图书），iBooks会尝试运行一小段代码。未越狱的系统由于用户没有足够的权限，会拒绝运行这个程序，iBooks侦测到这个异常反而会正常启动。而经过越狱的系统默认情况下会运行这个程序，没有检测到异常的iBooks便拒绝启动。结果我今天碰到了：&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/02/IMG_0137_zps3a9497b2.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/02/IMG_0137_zps3a9497b2.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo IMG_0137_zps3a9497b2.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;正好刚刚刷cydia的package时看到comex的破解补丁，于是安装之，再打开就好了，comex果然是大神，而且还那么年轻，看看人家，不提也罢。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/02/IMG_0139_zps3ee67c3b.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/02/IMG_0139_zps3ee67c3b.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo IMG_0139_zps3ee67c3b.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>SSH over USB</title>
   <link href="http://www.kernelpanic.im/2011/01/09/ssh-over-usb"/>
   <updated>2011-01-09T21:54:11+00:00</updated>
   <id>http://www.kernelpanic.im/2011/01/09/ssh-over-usb</id>
   <content type="html">&lt;p&gt;某天在wiki上闲逛，发现一个&lt;a href=&quot;http://www.iphonedevwiki.net/index.php/SSH_Over_USB&quot;&gt;SSH_Over_USB&lt;/a&gt;的entry，可以让SSH通过USB数据线来连接iOS，上面说的是在Mac OS下，当然在linux和Windows下也是可以的。原理是什么呢，是在Local运行一个usb多路复用（multiplexor）的daemon，然后运行client程序通过它建立本地&amp;lt;—&gt;远程端口转发，最后就可以使用ssh进行基于usb tunnel的连接了。这个有什么用呢？对于jb/unlock肯定是有帮助的，还可以开发cydia上的app，折腾（可以装web server，或者在上面写python，java），甚至crack wifi密码都可以（现在暂时还不行）。&lt;/p&gt;

&lt;p&gt;1.安装usbmuxd，可以看到在Ubuntu源里已经包含了，这里八卦一下，Mac App Store发布了，里面包含了1000多个应用，你可以下载/购买，更新，sounds familiar，linux folks？（see ：&lt;a href=&quot;http://www.networkworld.com/community/node/70405&quot;&gt;Apple, Linux welcomes you to 1998!&lt;/a&gt;）&lt;/p&gt;

&lt;h1&gt;sudo apt-get install usbmuxd&lt;/h1&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/01/usbmxd_zpsaf58be48.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/01/usbmxd_zpsaf58be48.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo usbmxd_zpsaf58be48.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2.usbmuxd的&lt;a href=&quot;http://marcansoft.com/blog/iphonelinux/usbmuxd/&quot;&gt;作者&lt;/a&gt;提供了一个简易的python-client，运行它，可以看到将本地的2222端口转发到了远程的22端口（即被将被连接的iDevice）&lt;/p&gt;

&lt;h1&gt;./tcprelay.py –t 22:2222&lt;/h1&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/01/daemon_listen_zps0eebb8bd.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/01/daemon_listen_zps0eebb8bd.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo daemon_listen_zps0eebb8bd.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3.建立ssh连接，#ssh &lt;a href=&quot;mailto:root@127.0.0.1&quot;&gt;root@127.0.0.1&lt;/a&gt; –p 2222&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/01/ssh_ipod_zps764e5609.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/01/ssh_ipod_zps764e5609.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo ssh_ipod_zps764e5609.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;python-client的回显，连接建立了&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/01/daemon_accept_zps6d0518cf.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/01/daemon_accept_zps6d0518cf.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo daemon_accept_zps6d0518cf.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;在Windows下就很简单了，最新版本的ifunbox，提供了USB Tunnel的功能，点击下USB Tunneling，如图&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/01/Untitled4_zps8a177e8e.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/01/Untitled4_zps8a177e8e.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo Untitled4_zps8a177e8e.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;将本地的22端口转发到远程的22端口&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/01/Untitled3_zpsacf466be.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/01/Untitled3_zpsacf466be.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo Untitled3_zpsacf466be.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ssh连接之，现在可以干很多事情了~&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2011/01/Untitled5_zpsb85f9a49.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2011/01/Untitled5_zpsb85f9a49.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo Untitled5_zpsb85f9a49.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>也谈恶意竞争</title>
   <link href="http://www.kernelpanic.im/2010/12/28/malicious-competition"/>
   <updated>2010-12-28T21:54:26+00:00</updated>
   <id>http://www.kernelpanic.im/2010/12/28/malicious-competition</id>
   <content type="html">&lt;p&gt;今天早上本来想通过网银充手机话费，结果江苏移动网上营业厅的验证码老是刷不出来，结果导致无法登录。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2010/12/direct_thumb_zpsb25e137c.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2010/12/direct_thumb_zpsb25e137c.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo direct_thumb_zpsb25e137c.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;firefox直接访问&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2010/12/direct_ie_zps71500c1b.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2010/12/direct_ie_zps71500c1b.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo direct_ie_zps71500c1b.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;IE直接访问&lt;/p&gt;

&lt;p&gt;我第一时间的想法是用代理试一下，看看是不是有问题，于是挂上ssh~&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2010/12/proxy_zps391b7845.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2010/12/proxy_zps391b7845.png&quot; width=100%  border=&quot;0&quot; alt=&quot; photo proxy_zps391b7845.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;firefox代理访问，一切正常，但是由于不思进取的各大网银系统，加上IE Tab还不能把安全插件加进去，最终无法也完成支付，无奈之下，经过一番设置，把IE挂上了ssh的代理&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2010/12/proxy_ie_zpsfd465b34.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2010/12/proxy_ie_zpsfd465b34.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo proxy_ie_zpsfd465b34.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;IE代理访问也正常了&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;IE 使用ssh代理，要注意一点：由于ssh tunnel转发是socks的方式，所以在IE设置时应该在“advanced”最后一行socks里填写地址和端口，并且清空http/https/ftp栏的设置，如下图：
&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2010/12/ie_proxy_zps1688cc9f.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2010/12/ie_proxy_zps1688cc9f.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo ie_proxy_zps1688cc9f.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;设置好了之后，可以考虑安装proxypal，ie下的代理开关小工具，功能弱了点，但是还能用用，开心了可以自己拿bat或者py操作注册表，就是几个键值的问题，这主要是受对面phus的影响，工具使得很溜。&lt;/p&gt;

&lt;p&gt;后来我无意中看到一篇文章--&lt;a href=&quot;http://www.shanzhaiji.cn/opinion/20101212/21898.html&quot;&gt;江苏电信封杀江苏移动网上营业厅?通信业3Q大战&lt;/a&gt;，时间也是12月份的，然后我查了下ip，果然是电信的IP:
&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2010/12/no_proxy_ip_thumb_zpsd0a6643d.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2010/12/no_proxy_ip_thumb_zpsd0a6643d.png&quot; width=100%  border=&quot;0&quot; alt=&quot; photo no_proxy_ip_thumb_zpsd0a6643d.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;这就是赤果果的恶意竞争啊，在不健全的体制下更是如此，网易科技的一篇&lt;a href=&quot;http://tech.163.com/10/1228/08/6OVRHA0500094IR6.html&quot;&gt;TD：最坏的自主创新&lt;/a&gt;，道出了中国特色的创新，有人会说之前怎么不说，很明显，之前被集体禁声，反对的声音根本发不出来，还有一个搞笑的&lt;a href=&quot;http://www.ftchinese.com/story/001036182&quot;&gt;中国高铁偏爱英文操作手册？&lt;/a&gt;，戳穿了所谓的中国高铁自主知识产权。。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>pending，resolved</title>
   <link href="http://www.kernelpanic.im/2010/12/28/pending-resolved"/>
   <updated>2010-12-28T21:06:14+00:00</updated>
   <id>http://www.kernelpanic.im/2010/12/28/pending-resolved</id>
   <content type="html">&lt;p&gt;折腾了半天，终于可以见人了，这是我的博客新家--&lt;a href=&quot;http://kernelpanic.im/&quot;&gt;Core Dump&lt;/a&gt;，意为核心转存储，通常发生在程序运行时错误时由内核或者运行库完成现场维护工作，主要用于debug分析，例如分析Windows发生BSod（Blue Screen of Death蓝屏）的可能原因。借用这个词，主要是取dump之意，积累、记录、思考，说不定以后能用于某种分析，这才是dump的真正意义。不过我其实还想了另外的一个名字：Free Memory，内存释放，最后还是觉得dump更贴切一点。&lt;/p&gt;

&lt;p&gt;域名是在name.com购买的&lt;a href=&quot;http://kernelpanic.im/&quot;&gt;kernelpanic.im&lt;/a&gt;，至于为什么不用国内的域名提供商，这就不用多说了吧~，hewig是我最早在fifa 2005中创建的年轻球员使用的名字，那是一个年少成名的青年才俊，司职CAM，现在被我用来当成通行的ID了。本来也想买com的域名，但是觉得com比较普通，不太好玩，现在有个性的都是us，mp之类的域名，还能组合起来，比如j.mp，fwd4.me，del.icio.us，bookfor.us。空间是合租的dreamhost，感谢&lt;a href=&quot;http://blog.lvdaocn.com/&quot;&gt;花哥&lt;/a&gt;。。&lt;/p&gt;

&lt;p&gt;在买域名的过程中发现，国外的有些服务已经提供支付宝的支付方式了，Paypal也能支持银联的银行卡，所以说不能再找支付不便的借口来进行盗版，觉得有价值的服务或者app还是可以入手的~&lt;/p&gt;

&lt;p&gt;在这里我可能会写些乱七八糟的东西，至于在&lt;a href=&quot;http://blog.csdn.net/xutaozero21&quot;&gt;CSDN上的博客&lt;/a&gt;也会继续更新，只不过只会把技术类的文章发过去，原先在wordpress.com的博客反正也没人知道，就不去管它了（主要是老是会被墙）&lt;/p&gt;

&lt;p&gt;算起来，已经很久动笔写博客了，pending了很久，上一次还是九月底，在实习的末段，走之前，整理了meego相关的几篇，现在已然年末，期间近三个月的时间，其实发生了不少事情：找工作，图书馆实习等等。。&lt;/p&gt;

&lt;p&gt;十一回家了，在家的状态很糟糕，都忘了是怎么过的了，反正什么也没做就对了。这可能刚辞掉工作的关系，有点没底。但是回过头去看，焦虑其实也有促进作用，因为confidence也好，trustworthy也好，都是一点一点build up起来的，下次遇到同样的境地，心境将会是不一样的。基本上十月初到十一月，都是在为工作而奔走，宣讲会，笔试，面试，不是在南大就是在东大，偶尔也有南理工的场。找工作的都是这样，找到后来才明确了本应该早就明确的方向，目标，行业。我的要求其实挺简单的，目标的话，基本上都是做研发的职位，最好是linux方向，我对技术的好恶感已经没有那么强烈了；然后基本上是要以做产品为主，这主要因为有过outsource的经历，所带来的印象实在是太差；然后是行业，阿里系代表的电子商务，三星诺基亚代表的移动平台方向，趋势代表的基础性业务--安全等，这些都是很明显有发展潜力的行业或者可以持续给力的领域。还有后来才意识到的amazon的kindle实际上是一个很有前途的ecosystem、因为纯粹个人喜好跑去参加opera的宣讲，笔试，上机等。因为今年形势大好，最后的结果还算不错，不过实在是没法和那些牛人比，拿N个顶级offer的，同样是海投，因为专业，学校，学历的原因，被刷掉的几率确实高了一点，加上不是很牛掰的算法和数据结构。。我觉得最惨的是阿里系全部歇菜，要知道我学魔方的动力就是因为阿里出的某本书；然后是因为抱着玩的心态去的帝都，可能是挂在HR面的amazon，opera很大原因是上机时主动放弃了，而三星纯粹是因为管理太严了，每天过安检的滋味实在是不好受。至于之前找实习莫明被鄙视的Archermind，富士通在得知趋势的结果后直接就放弃了，趋势的话是，比较具有戏剧化，九月底就参加了笔试，然后十月底才开始连续的三天面试，期间还穿插着阿里巴巴、淘宝的笔试和面试。这个月初就和趋势已经签了卖身契了。&lt;/p&gt;

&lt;p&gt;找工作其实没什么好提的，不过还算有一点感想：有时候，你所做的一些积累也好，记录也好，会在不经意间给你一些惊喜：诺基亚北京研发中心给我提供了一个几个月的实习机会，但是不保证转正，就是因为我在CSDN博客写的几篇不值一提的meego相关的博文，完全是意外，没花什么功夫。还有就是可以追溯到四月份参加共享内存数据库的比赛，到被支付宝的GG面的体无完肤，再到和amazon的charles探讨（event trigger），再到了解server端的所谓设计模式，我了解到我困惑很久的，其实本质是在于I/O的问题，然后才是是基于异步IO实现的事件驱动模型；引申了一下，发现我之所以喜好同步化操作，大块连续的时间，其实是没有找到一种足够好的异步事件通知的机制，这也算是无意中的发现吧。所以你会发现其实读书也是如此，有时候你不知道什么时候会用到上面的知识，有时候却会从某些看似不相关的内容中得到启发，从这种意义上来说，读书，学习，都是一种探索，不同的是有人乐此不疲，有人却觉得难以为继。&lt;/p&gt;

&lt;p&gt;pending表示挂起的操作，resolved表示已决议过的符号。不管怎样，重新上路的感觉还算不错，对于远行的人而言，短暂的休息只是为了再次出发。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>用QML开发MeeGo应用程序</title>
   <link href="http://www.kernelpanic.im/2010/09/24/qml-develop-meego-apps"/>
   <updated>2010-09-24T20:51:12+00:00</updated>
   <id>http://www.kernelpanic.im/2010/09/24/qml-develop-meego-apps</id>
   <content type="html">&lt;p&gt;什么是&lt;a href=&quot;http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeintroduction.html&quot;&gt;QML&lt;/a&gt;？&lt;/p&gt;

&lt;p&gt;QML是一种描述应用程序UI的声明式语言，包括应用程序的外观（菜单、按钮、布局等）以及行为（点击事件）的描述。在QML中，UI界面被描述成一种树状的带属性对象的结构（类似于DOM）&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://developer.mozilla.org/en/JavaScript&quot;&gt;JavaScript&lt;/a&gt;是QML中使用的脚本语言, 所以你最好是对它有一定程度了解再深入进行QML的学习（可以参考&lt;a href=&quot;http://www.davidflanagan.com/javascript5/&quot;&gt;JavaScript: The Definitive Guide&lt;/a&gt;)。如果对HTML和CSS等Web技术有所理解是会有帮助的，但不是必需的。&lt;/p&gt;

&lt;p&gt;上面是官方介绍的前两段，具体中文教程可以看看&lt;a href=&quot;http://www.cuteqt.com/blog/?s=qml&quot;&gt;Qt技术分享博客的系列教程&lt;/a&gt;，QML实际上是&lt;a href=&quot;http://doc.qt.nokia.com/4.7-snapshot/qtquick.html&quot;&gt;Qt Quick&lt;/a&gt;（Qt4.7.0中的新特性）核心组件之一：Qt Quick是一组旨在帮助开发者创建在移动电话，媒体播放器，机顶盒和其他便携设备上使用越来越多的直观、现代、流畅UI的工具集合。Qt Quick包括一组丰富的用户界面元素，一种用于描述用户界面的声明性语言（QML）及运行时，一组用于将这些高层次特性集成到经典的Qt应用程序的C++ API。&lt;/p&gt;

&lt;p&gt;从官方的介绍可以看出，Qt Quick是为移动平台快速开发所量身打造的，先看一个实际例子：在MeeGo上运行的MeeNotes，除了业务逻辑，界面UI都是使用QML实现的&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://lh5.googleusercontent.com/MjsIJ3hE2ShXgMy7l8hAsxqTtXnNAtPjOUfuogxUpxdOGhtbh9MyFGwmHRI1DyFDdkN7TFdBvg7tmlhy8gntQHM7MSUw7_qzggWIVsCkG-6hmIGx1Q&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;MeeNotes运行效果&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://lh4.googleusercontent.com/td4qP4XYL_g0CGEKHrxFhC7O7AdYPdqilTavmvm9Z4zddAXZngAPOxC9qlblD-6_9DgBdVvHDNE2AfPMh1Yo_o5EWCie4YWsMf5Lk4zJ_G4eWVtwvw&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;横竖屏幕切换（点击那个星号～）&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://lh6.googleusercontent.com/TQ0IPh9Mm-UfRY12upue_JxXUMxXW5F0NRByS68wxmU1OrXaLNsW8RPWTLScKi4y7qSQZWS5qp5XGcXsV5UG-fwRJRW0vWGq3o984iIeI6jpmXHfPA&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;在模拟器中运行效果&lt;/p&gt;

&lt;p&gt;MeeNotes可以在&lt;a href=&quot;http://qt.gitorious.org/qt-components&quot;&gt;这里&lt;/a&gt;找到：使用git把qt-components和meenotes clone下来，然后先编译qt-components，这个依赖于qt4.7，是使用QML快速开发meego应用程序的关键，它实现了一套meego的QML Module，之后可以编译运行下MeeNotes，如果运行不了，请检查Qt安装目录里是否有 com.nokia.meego这个module（我的位于/usr/local/Trolltech/Qt-4.7.0/imports/com /meego）如果没有，则需要在qt-components解压目录下的 src/MeeGo 手动执行qmake/make/make install，进行编译安装。&lt;/p&gt;

&lt;p&gt;简单看看MeeNotes下的实际代码
src目录下的&lt;strong&gt;src.pro&lt;/strong&gt;，红色部分即是与使用libmeegotouch开发所不同之处 ：&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;TEMPLATE = app  

TARGET = ../MeeNotes 

LIBS += -lQtComponents  

HEADERS += models/meenotesmodel.h
           models/notemodel.h 

SOURCES += main.cpp  
           models/meenotesmodel.cpp  
           models/notemodel.cpp 

QT += declarative 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;再看主入口main.cpp：&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-cpp&quot; data-lang=&quot;cpp&quot;&gt;&lt;span class=&quot;cp&quot;&gt;#include &quot;models/meenotesmodel.h&quot;&lt;/p&gt;

&lt;h1&gt;include &amp;lt;QApplication&amp;gt;&lt;/h1&gt;

&lt;h1&gt;include &amp;lt;QDeclarativeContext&amp;gt;&lt;/h1&gt;

&lt;h1&gt;include &amp;lt;QDeclarativeComponent&amp;gt;&lt;/h1&gt;

&lt;h1&gt;include &amp;lt;QDir&amp;gt;&lt;/h1&gt;

&lt;h1&gt;include &amp;lt;QtComponents/qdeclarativewindow.h&amp;gt;&lt;/h1&gt;

&lt;p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;argc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;QApplication&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;argc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;br/&gt;
    &lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;setApplicationName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;MeeNotes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;span class=&quot;c1&quot;&amp;gt;//MeeNotesModel 是Model类
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;qmlRegisterType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;NoteModel&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;&lt;br/&gt;
    &lt;span class=&quot;n&quot;&gt;MeeNotesModel&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;setSource&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;notes/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;span class=&quot;c1&quot;&amp;gt;//在哪查找main.qml
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#ifndef MEENOTES_RESOURCE_DIR &lt;br/&gt;
&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;QDir&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dir&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;QApplication&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;applicationDirPath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;());&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;QUrl&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;qmlPath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dir&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;absoluteFilePath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;resource/default/main.qml&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#else &lt;br/&gt;
&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;QDir&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dir&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;MEENOTES_RESOURCE_DIR&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;br/&gt;
    &lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;QUrl&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;qmlPath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dir&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;absoluteFilePath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;main.qml&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#endif &lt;br/&gt;
&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//创建能够解释qml运行的window
&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;QDeclarativeWindow&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;qmlPath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;span class=&quot;n&quot;&amp;gt;window&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;n&quot;&amp;gt;rootContext&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;()&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;o&quot;&amp;gt;-&amp;amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;n&quot;&amp;gt;setContextProperty&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;(&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;s&quot;&amp;gt;&quot;meenotes&quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;,&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;o&quot;&amp;gt;&amp;amp;amp;&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;n&quot;&amp;gt;model&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;);&amp;lt;/span&amp;gt;   
&amp;lt;span class=&quot;n&quot;&amp;gt;window&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;n&quot;&amp;gt;window&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;()&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;o&quot;&amp;gt;-&amp;amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;n&quot;&amp;gt;show&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;();&amp;lt;/span&amp;gt;   
&amp;lt;span class=&quot;k&quot;&amp;gt;return&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;n&quot;&amp;gt;app&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;n&quot;&amp;gt;exec&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;();&amp;lt;/span&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;查看main.qml：&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;Qt&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;4.7&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;com.meego&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;1.0&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;n&quot;&gt;Window&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;window&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Component&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;onCompleted&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nextPage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Qt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;createComponent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;NoteList.qml&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;br/&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;**查看NoteList.qml：&lt;/p&gt;

&lt;p&gt;**import Qt 4.7&lt;/p&gt;

&lt;p&gt;&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;com.meego&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;1.0&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;n&quot;&gt;Page&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;span class=&quot;n&quot;&amp;gt;title&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;:&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;s&quot;&amp;gt;&quot;MeeNotes&quot;&amp;lt;/span&amp;gt;
&amp;lt;span class=&quot;n&quot;&amp;gt;actions&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;:&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;p&quot;&amp;gt;[&amp;lt;/span&amp;gt; 

    &amp;lt;span class=&quot;n&quot;&amp;gt;Action&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;p&quot;&amp;gt;{&amp;lt;/span&amp;gt; 
            &amp;lt;span class=&quot;n&quot;&amp;gt;iconId&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;:&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;s&quot;&amp;gt;&quot;icon-m-toolbar-add&quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;o&quot;&amp;gt;//&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;err&quot;&amp;gt;新建&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;n&quot;&amp;gt;note&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;err&quot;&amp;gt;按钮的处理&amp;lt;/span&amp;gt;
            &amp;lt;span class=&quot;n&quot;&amp;gt;onTriggered&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;:&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;p&quot;&amp;gt;{&amp;lt;/span&amp;gt; 
                    &amp;lt;span class=&quot;n&quot;&amp;gt;var&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;n&quot;&amp;gt;note&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;o&quot;&amp;gt;=&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;n&quot;&amp;gt;meenotes&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;o&quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;n&quot;&amp;gt;newNote&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;();&amp;lt;/span&amp;gt; 
                    &amp;lt;span class=&quot;n&quot;&amp;gt;note&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;o&quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;n&quot;&amp;gt;title&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;o&quot;&amp;gt;=&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;p&quot;&amp;gt;(&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;n&quot;&amp;gt;Math&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;o&quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;n&quot;&amp;gt;random&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;()&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;o&quot;&amp;gt;&amp;amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;mf&quot;&amp;gt;0.5&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;)&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;err&quot;&amp;gt;?&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;s&quot;&amp;gt;&quot;Cool title!&quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;p&quot;&amp;gt;:&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;s&quot;&amp;gt;&quot;&quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;;&amp;lt;/span&amp;gt; 
                    &amp;lt;span class=&quot;n&quot;&amp;gt;viewNote&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;(&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;n&quot;&amp;gt;note&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;);&amp;lt;/span&amp;gt; 
                &amp;lt;span class=&quot;p&quot;&amp;gt;}&amp;lt;/span&amp;gt; 
            &amp;lt;span class=&quot;p&quot;&amp;gt;},&amp;lt;/span&amp;gt; 

    &amp;lt;span class=&quot;n&quot;&amp;gt;Action&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;p&quot;&amp;gt;{&amp;lt;/span&amp;gt; 
         &amp;lt;span class=&quot;n&quot;&amp;gt;iconId&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;:&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;s&quot;&amp;gt;&quot;icon-m-toolbar-favorite-mark&quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;o&quot;&amp;gt;//&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;err&quot;&amp;gt;横竖屏切换的按钮处理&amp;lt;/span&amp;gt;  
        &amp;lt;span class=&quot;n&quot;&amp;gt;onTriggered&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;:&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;p&quot;&amp;gt;{&amp;lt;/span&amp;gt; 
            &amp;lt;span class=&quot;n&quot;&amp;gt;screen&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;o&quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;n&quot;&amp;gt;orientation&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;o&quot;&amp;gt;=&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;n&quot;&amp;gt;screen&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;o&quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;n&quot;&amp;gt;orientation&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;o&quot;&amp;gt;==&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;n&quot;&amp;gt;Screen&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;o&quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;n&quot;&amp;gt;Portrait&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;err&quot;&amp;gt;?&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;n&quot;&amp;gt;Screen&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;o&quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;n&quot;&amp;gt;Landscape&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;p&quot;&amp;gt;:&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;n&quot;&amp;gt;Screen&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;o&quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;n&quot;&amp;gt;Portrait&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;;&amp;lt;/span&amp;gt; 
            &amp;lt;span class=&quot;p&quot;&amp;gt;}&amp;lt;/span&amp;gt; 
        &amp;lt;span class=&quot;p&quot;&amp;gt;}&amp;lt;/span&amp;gt; 
&amp;lt;span class=&quot;p&quot;&amp;gt;]&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;span class=&quot;n&quot;&gt;Component&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;br/&gt;
    &lt;span class=&quot;err&quot;&gt;…&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;…&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;…&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;省略&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;n&quot;&gt;Rectangle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;span class=&quot;n&quot;&amp;gt;color&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;:&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;s&quot;&amp;gt;&quot;white&quot;&amp;lt;/span&amp;gt;
&amp;lt;span class=&quot;n&quot;&amp;gt;anchors&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;o&quot;&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;n&quot;&amp;gt;fill&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;p&quot;&amp;gt;:&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;n&quot;&amp;gt;parent&amp;lt;/span&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;n&quot;&gt;GridView&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;grid&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;anchors&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fill&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parent&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;meenotes&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cellWidth&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;250&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cellHeight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;210&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;delegate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;noteDelegate&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;n&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;viewNote&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;note&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nextPage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Qt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;createComponent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Note.qml&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;currentPage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;note&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;note&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;鉴于QML类似于web网页css的编写方式，效率已经很高了，但是似乎Qt Designer被我们忽视了，其实2.01版的Desinger已经可以使用meegotouch风格进行预览了，效果如下图：&lt;img src=&quot;https://lh6.googleusercontent.com/5z7ZjbX8IQpupTJZFj3WOQikTjaD8fp_xPNP68w5R-3cipwLzvpTxbTeE2IQvQJhe1L3DgFurWJ0iExmDrYCXKm3bRYKOnmao8cNlEr7xxDzSid8Jw&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;目前Designer并不能直接生成QML文件，下一个版本的Desinger以及在计划之中了，可以叫他Qt Quick Designer，在Qt Roadmap中已经可以体现出来了：&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://lh4.googleusercontent.com/nYL_bzp-N-RIFKleE9-g0pbghYo9xj2PvOmpgzdr8pyoSKMrQ2e4iXpOTyCgtfK3PAx34SdsIq5wuEF2EYey3a7F-Yy-J5lE1vfo4M8JeMIrYJdP_g&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>MeeGo开发Tips（0）非Intel图形芯片使用Xephyr模拟器</title>
   <link href="http://www.kernelpanic.im/2010/09/24/meego-tip-non-intel-xephyr-emulator"/>
   <updated>2010-09-24T18:41:47+00:00</updated>
   <id>http://www.kernelpanic.im/2010/09/24/meego-tip-non-intel-xephyr-emulator</id>
   <content type="html">&lt;h3&gt;根据MeeGo Wiki上的&lt;a href=&quot;http://wiki.meego.com/MeeGo_SDK_with_Xephyr&quot;&gt;MeeGo SDK with Xephyr&lt;/a&gt;教程，执行：&lt;/h3&gt;

&lt;p&gt;$ lspci | grep VGA&lt;/p&gt;

&lt;p&gt;如果不是intel的图形芯片（比如杯具的nvidia，不知为何ati的反倒是可以使用），就得see the&lt;a href=&quot;http://wiki.meego.com/MeeGo_SDK_Development_Options&quot;&gt; other SDK options&lt;/a&gt;（MeeGo SDK本身可以使用，如libmeegotouch，不能使用的是基于Xephyr的emulator，会黑屏）。&lt;/p&gt;

&lt;p&gt;怎样在非intel图形芯片上使用Xephyr呢？intel的合作伙伴nokia论坛出了个&lt;a href=&quot;http://wiki.forum.nokia.com/index.php/Qt_MeeGo_handset_SDK_how_to_install_and_use_on_Linux_Ubuntu_10.04_LTS&quot;&gt;教程&lt;/a&gt;，详细的一笔。&lt;/p&gt;

&lt;h4&gt;简单来说就是安装并运行外部的Xserver-Xephyr（nested x server），DISPLAY设置为:2，然后在MeeGo SDK中启动emulator时，设置DISPLAY为:2。&lt;/h4&gt;

&lt;p&gt;$ sudo apt-get install xserver-xephyr&lt;/p&gt;

&lt;p&gt;//根据教程，在运行xhost命令之后执行：&lt;/p&gt;

&lt;p&gt;$Xephyr :2 -host-cursor -screen 1024x768x16 -dpi 192 -ac &amp;amp;&lt;/p&gt;

&lt;p&gt;$export DISPLAY=:2&lt;/p&gt;

&lt;p&gt;//chroot到meego sdk路径后&lt;/p&gt;

&lt;p&gt;$startmeego &amp;amp;&lt;/p&gt;

&lt;p&gt;不过每次都这么敲命令会很麻烦，可以写入一个文件里，然source执行&lt;img src=&quot;https://lh3.googleusercontent.com/ziHvfgiAYt02R81VDelMlKUTBS4ysRfBsxbYmd1Bp0t1pKPf3uOHWT_WV5jq3xIvdvc3VYIXJNZxVUfLuEBGwdPPip2Keh3L8F0aDITcEWp-DNKgxg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;效果如下，不过运行的很慢。。&lt;img src=&quot;https://lh6.googleusercontent.com/j-Dap3Zf8d56M4I-hTwgM3GZEVhSbpRuonxdMgWVJ7zm90aWQGxD_d0w7GhqaNUC38af1YFKaXUTrKU-xGfyghoAbTTezpD0buPcGZqBNAXRPqFFGA&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;最后普及一下：什么是Xephyr呢？参考&lt;a href=&quot;http://www.freedesktop.org/wiki/Software/Xephyr&quot;&gt;这里&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Xephyr is a kdrive based X Server which targets a window on a host X Server as its framebuffer. Unlike Xnest it supports modern X extensions ( even if host server doesn&#39;t ) such as Composite, Damage, randr etc (no GLX support now). It uses SHM Images and shadow framebuffer updates to provide good performance. It also has a visual debugging mode for observing screen updates.&lt;/p&gt;

&lt;p&gt;Xephyr 是一个 Xnest 的替代产品，因为 Xnest 不提供现代 X server 的一些高级特性，比如图形加速的支持。简而言之，Xephyr 是一个 X server，但是它执行在一个存在的 X server 里面，这个可以用来做很多事情，比如需要通过 XDMCP 连接到另外一台主机，那么不需要另外打开一个新的 X server；又比如正在写一个 window manager，那么在一个 X server 里面打开的 X server 里面调试，将会比直接在现有的 X server 里面替换现有的 window manager 方便很多。对于热衷于更换自己的 window manager 的狂热爱好者，Xephyr 提供了绝佳的试验环境。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>“盗梦空间”--我的制造</title>
   <link href="http://www.kernelpanic.im/2010/09/17/inception-made-by-myself"/>
   <updated>2010-09-17T01:32:25+00:00</updated>
   <id>http://www.kernelpanic.im/2010/09/17/inception-made-by-myself</id>
   <content type="html">&lt;p&gt;上周去看了《盗梦空间》，十分精彩，鉴于之前有人给我进行了小规模剧透，所以看完我有这样一种感觉：盗梦空间其实讲述的就是几层递归的function call，在最后时刻发生了exception，还好足够健壮catch了并执行了finally里的return…&lt;/p&gt;

&lt;p&gt;网上已经有人玩出了各种盗梦版：&lt;a href=&quot;http://www.ibentu.org/2010/09/09/how-to-inception-to-1000-level.html&quot;&gt;盗梦终端：如何进入第1000层梦境&lt;/a&gt;，这个是利用bash开N个子shell。。还有这个&lt;a href=&quot;http://www.techcrunchchina.com/4216&quot;&gt;Webqq 2.0的盗梦空间：为何我只能进入第二层......&lt;/a&gt;，受了一点启发，我也制造了几个。&lt;/p&gt;

&lt;p&gt;0.webqq2盗梦版&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2010/09/webqq2e79b97e6a2a6_zps48b5b398.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2010/09/webqq2e79b97e6a2a6_zps48b5b398.jpg&quot; width=100% border=&quot;0&quot; alt=&quot; photo webqq2e79b97e6a2a6_zps48b5b398.jpg&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;1.花生壳远程控制盗梦版（这是很久之前玩出来的）&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2010/09/e88ab1e7949fe5a3b3e8bf9ce7a88be68ea7e588b6_zps2e2c1aef.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2010/09/e88ab1e7949fe5a3b3e8bf9ce7a88be68ea7e588b6_zps2e2c1aef.jpg&quot; width=100% border=&quot;0&quot; alt=&quot; photo e88ab1e7949fe5a3b3e8bf9ce7a88be68ea7e588b6_zps2e2c1aef.jpg&quot;/&gt;&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>MeeGo-Handset开发入门小结</title>
   <link href="http://www.kernelpanic.im/2010/09/14/meego-handset-development-tutorial"/>
   <updated>2010-09-14T11:52:26+00:00</updated>
   <id>http://www.kernelpanic.im/2010/09/14/meego-handset-development-tutorial</id>
   <content type="html">&lt;p&gt;&lt;strong&gt;关于MeeGo的版本&lt;/strong&gt;
在MeeGo&lt;a href=&quot;http://meego.com/downloads/releases&quot;&gt;官网&lt;/a&gt;主要有3个：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://meego.com/downloads/releases/1.0.80.8/meego-handset-day1-developer-preview&quot;&gt;MeeGo Handset Day1 Developer Preview&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://meego.com/downloads/releases/1.0/meego-v1.0-in-vehicle-infotainment-ivi&quot;&gt;MeeGo v1.0 for In-Vehicle Infotainment (IVI)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://meego.com/downloads/releases/1.0/meego-v1.0-netbooks-google-chrome-browser&quot;&gt;MeeGo v1.0 for Netbooks (Google Chrome Browser)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;分别代表手机版，上网本（可能之后平板？），车载设备（GPS之类的）下载下来文件名如下&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;meego-handset-ia32-netbook-mtf-1.0.80.12.20100723.1.img&lt;/li&gt;
&lt;li&gt;meego-ivi-ia32-noemgd-1.0.1-20100729.1.iso&lt;/li&gt;
&lt;li&gt;meego-netbook-chromium-ia32-1.0-20100524.1.img&lt;/li&gt;
&lt;li&gt;meego-netbook-ia32-1.0.80.11.20100720.1.img&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;这些都是安装在真机的OS镜像，稍微解释一下&lt;/p&gt;

&lt;p&gt;handset-ia32-netbook-mtf是指在ia32（x86）上运行handset版的meego，mtf代表meego touch framework，体验得是触碰屏才行&lt;/p&gt;

&lt;p&gt;ivi-ia32-noemgd是指使用x86芯片的车载设备，用pc也是可以引导的&lt;/p&gt;

&lt;p&gt;netbook-chromium是指默认浏览器是chromium(chrome的开源版本)的上网本OS
这 3个版本，主要是UX层不同，其中meego core都是相同的，但是SDK也会相应不同&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;关于MeeGo App开发与SDK&lt;/strong&gt;
MeeGo的SDK有三种&lt;a href=&quot;http://wiki.meego.com/MeeGo_SDK_Development_Options&quot;&gt;方式&lt;/a&gt;，这里讨论的方式均指的是&lt;a href=&quot;http://wiki.meego.com/MeeGo_SDK_with_Xephyr&quot;&gt;Change Root (chroot) with Xephyr&lt;/a&gt; ，这种方式是速度最快的，这种方式下的sdk其实就是一个可以chroot进去的linux系统（维护过linux肯定都知道，linux挂掉的时候可以使用livecd或别的引导一下，然后挂载原来的分区并chroot进去）下载下来文件如下：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;meego-sdk-0524.tar.bz2&lt;/li&gt;
&lt;li&gt;meego-netbook-ia32-1.0.80.12.20100727.1-sdk-pre0729.tar.bz2&lt;/li&gt;
&lt;li&gt;meego-handset-ia32-1.0.80.9.20100706.1-sdk-pre0729.tar.bz2&lt;/li&gt;
&lt;li&gt;meego-handset-ia32-1.0.80.9.20100706.1-sdk-pre0901.raw.tar.bz2&lt;/li&gt;
&lt;li&gt;meego-handset-ia32-1.0.80.9.20100706.1-sdk-pre0901.raw.tar.bz2&lt;/li&gt;
&lt;li&gt;meego-netbook-ia32-1.0.80.12.20100727.1-sdk-pre0901.raw.tar.bz2&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;meego-sdk-0524：意思是5月24日发布的，这是最早的sdk版本，网上还有些教程是拿这个做的，这个解压就能用，不需要挂载
剩下的几个都是pre版，7月29日/9月1日发布的（pre就是很不完善的意思,==）
解开之后个是raw文件，这个是可以挂载的镜像&lt;/p&gt;

&lt;p&gt;现在主要工作研究handset下的开发，毕竟和iOS/Android/RIM等竞争的是这个。开发MeeGo  App可以直接使用Qt，libmeegotouch，web runtime这几种方式（这是官方推荐的）如下图，其中web  runtime(html/css/js)也是在中间那一层。&lt;img src=&quot;https://lh6.googleusercontent.com/6ZfNUKGG0iDKIxTtdXpIQtBJbjynJ7bTgL6LkUQ9pTtdHWN5l5toAavI0_mZ-CFAoq6ktxumN9HhcRIz7SJ5YZxqgOZ_splW7ttiu5X6Q3yb93hmGg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;直接使用Qt是可以的，Qt4.7新增加的&lt;a href=&quot;http://doc.qt.nokia.com/4.7-snapshot/qml-intro.html&quot;&gt;Qt Quick&lt;/a&gt;（提供了QML）会使得开发效率更高；还可以使用libmeegotouch(MeeGo Touch Framework核心lib），这两种有什么区别？参考&lt;a href=&quot;http://labs.trolltech.com/blogs/2010/09/10/building-the-future-reintroducing-the-qt-quick-components/&quot;&gt;这里&lt;/a&gt;：Alan  Alpert@niqt：MeegoTouch provides a C++ widget library. If you are  writing an application UI in C++ and want native look and feel on  MeegoTouch devices, you just use it.
web runtime就直接无视了，==&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MeeGo应用程序简介&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;主要由MApplication,MApplicationPage,MApplicationWindow,MLayout,MWidgets(MButton,
MComboBox,MContainer,MDialog,MMessageBox,MInfoBanner,MLabel,MList) 类组成，位置关系就如下图右边所示，都是现代GUI框架的东西，很好理解。&lt;img src=&quot;https://lh5.googleusercontent.com/uzd3Hjuk2R6warhUHQc_lk14cKk7_70Yoj6EeEHT7hiPobXWSacsLiW7v8rn5sgUr0e7rczcgybOapiJrWTV7Lo_wcDo8idstwrFDC_SiOE9LzWX9w&quot; alt=&quot;&quot; /&gt;
实际的calculator，在xephyr里运行效果图&lt;img src=&quot;https://lh5.googleusercontent.com/WVFfUde7xnwp6uO0YYRRbOiiHMKiUJ_HrDi_hTwXozjaNGy4fcI0urC0V_Kp9n2PDVUfIvy4gd0bSCcc8aAtbrVu7h1B6izudYoVSKaXk8pYoPFNGA&quot; alt=&quot;&quot; /&gt;
&lt;img src=&quot;https://lh3.googleusercontent.com/avY7xYfMvR3VeJUrF3ZM9gYlzddGO9MtBPuLnHM9x4BuRqGWf8miQY0Bkcto2ZDrdYHt_m3w_FS3ygLqfEr1vxyQUlyvDLjExpMVxlxxIp_kSZdafQ&quot; alt=&quot;&quot; /&gt;
开发API参考：&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://apidocs.meego.com/mtf/index.html&quot;&gt;http://apidocs.meego.com/mtf/index.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://doc.qt.nokia.com/4.7-snapshot/index.html&quot;&gt;http://doc.qt.nokia.com/4.7-snapshot/index.html&lt;/a&gt;
&lt;strong&gt;使用MeeGo Touch Framework开发App&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;第一种方法：普通linux发行版安装libmeegotouch库（参考&lt;a href=&quot;http://apidocs.meego.com/mtf/installation.html&quot;&gt;这里&lt;/a&gt;）&lt;/p&gt;

&lt;p&gt;0.安装linux
安装的是Ubuntu10.04 LTS,由于要使用到Qt4.7  最好使用gnome桌面的发行版（其实我很喜欢KDE,但是采用KDE的发行版在默认/usr/lib下会带有稳定版本的Qt,如4.6.2,这样到编译 libmeegotouch时容易造成链接库不正确而编译失败，可能出&lt;a href=&quot;http:///#&quot;&gt;这个错误&lt;/a&gt;）&lt;/p&gt;

&lt;p&gt;1.更新系统【非必须】
    #sudo apt-get upgrade&lt;/p&gt;

&lt;p&gt;2.安装toolchain，主要是git、g++和X11的libX*-dev
    #sudo apt-get install git-core build-essential libgl1-mesa-dev  libglu1-mesa-dev libxdamage-dev libX11-dev libXext-dev libXtst-dev  libXrender-dev libxcursor-dev libxfixes-dev libxft-dev libxi-dev  libxrandr-dev libdbus-1-dev&lt;/p&gt;

&lt;p&gt;3.编译Qt4.7
&lt;a href=&quot;http://qt.nokia.com/developer/qt-qtcreator-prerelease#download&quot;&gt;下载&lt;/a&gt;Qt4.7 源代码版（qt-everywhere-opensource-src-4.7.0-rc1.tar.gz）或者二进制版（qt-sdk-linux- x86-opensource-2010.05-rc1.bin）,前者需要手动编译，虽然时间长但是可以控制；后者安装方便，以源代码为例：
    #tar xvjf qt-everywhere-opensource-src-4.7.0-rc1.tar.gz
    #cd qt-everywhere-opensource-src-4.7.0-rc1
    #./configure -dbus
    #make
    #sudo make install&lt;/p&gt;

&lt;p&gt;完成后设置环境变量:
export QTDIR=/usr/local/Trolltech/Qt-4.7.0
export PATH=$QTDIR/bin:$PATH
若要每次生效请修改~/.bashrc,加上上面两句export命令&lt;/p&gt;

&lt;p&gt;3.git clone libmeegotouch相关代码
    #git clone git://gitorious.org/meegotouch/libmeegotouch.git
    #git clone git://gitorious.org/meegotouch/meegotouch-theme.git&lt;/p&gt;

&lt;p&gt;4.Qt4.7编译完成后,编译安装meegotouch-theme和libmeegotouch&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#cd meegotouch-theme
#qmake &amp;amp;&amp;amp; sudo make install

#cd libmeegotouch
#./configure
#make &amp;amp;&amp;amp; sudo make install
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;5.运行examples测试
    #cd libmeegotouch/examples/calculator
    #qmake &amp;amp;&amp;amp; make
    #sudo ./calculator&lt;/p&gt;

&lt;p&gt;6.安装IDE
1.qtcreator&lt;a href=&quot;http://qt.nokia.com/developer/qt-qtcreator-prerelease#download&quot;&gt;下载&lt;/a&gt;： qt-creator-linux-x86-opensource-2.0.1.bin
2.也可以考虑eclipse+cdt+qt-eclipse-integration的组合
    #sudo apt-get install eclispse
打开eclipse-&gt;Help-&gt;Install New  Software,添加一下cdt的update-url(注意版本，这里是galileo),http://download.eclipse.org /tools/cdt/releases/galileo
http://qt.nokia.com/developer/eclipse-integration/，下载并解压放入对应eclipse安装路径(我的是/usr/lib/eclipse)&lt;/p&gt;

&lt;p&gt;第二种方法：直接在sdk中安装libmeegotouch-devel&lt;/p&gt;

&lt;p&gt;sdk版目前还是pre-release版本,里面带有的qt4.7和libmeegotouch基本上不是最新版，所有会有些examples无法编译通过，SDK安装可以参考meego的&lt;a href=&quot;http://wiki.meego.com/MeeGo_SDK_with_Xephyr&quot;&gt;wiki或者&lt;/a&gt;是我上一篇&lt;a href=&quot;http://blog.csdn.net/xutaozero21/archive/2010/07/31/5779591.aspx&quot;&gt;博客&lt;/a&gt;。安装完成并成功chroot后：&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#zypper install libmeegotouch-devel
##复制examples中的代码测试一下
#cd libmeegotouch/examples/calculator
#qmake &amp;amp;&amp;amp; make
#./calculator
&lt;/code&gt;&lt;/pre&gt;
</content>
 </entry>
 
 <entry>
   <title>tofuture.me</title>
   <link href="http://www.kernelpanic.im/2010/09/05/tofuture-me"/>
   <updated>2010-09-05T16:22:52+00:00</updated>
   <id>http://www.kernelpanic.im/2010/09/05/tofuture-me</id>
   <content type="html">&lt;p&gt;这是一封写给三年后的我的信，三年前的夜间，我正懒散的坐在迈皋桥房子里的电脑写下了这段文字，静已经在旁边睡着了。懒散是对近期，特别是实习期间我表现的一个评价。固然与每天往返于江宁与栖霞区所用时间太多有关，但是最重要的还是由于本身的原因。&lt;/p&gt;

&lt;p&gt;一直以来，我通过不断的所谓学习，了解很多技术，软件，产品，服务，开阔自己的视野。但是，一直以来似乎做的东西很少，哪怕是在公司实习期间亦是如此，近期想对一些事件发表自己的见解时发现，我只是知道有这个东西而已，未来的趋势，有深度的见解，居然提不出来什么。这真是令人沮丧。我终于意识到：现在的我，是在紧跟潮流，不断阅读新的feed/news，购买新的《程序员》，但是缺少真正的思考，这导致了很少的行动，也就说现在的我只是个信息搜集者而已，最明显的就是，现在移动平台大势所趋，但是我关注的meego的前景，与其他平台的对比，都说不上个所以然来，能说出来的也是很浅显的东西。而且，很多萌芽之出就了解到的信息，等到很火的时候，才意识到之前好像看到过，却没有去深入研究过。对于新出现的事物，技术，产品，思想没有丝毫的敏锐感，老是想着这和XXX不是很类似嘛。甚至是英语阅读时也会发现，我所干的，很多只是把单词读正确而以，而句子的意思，如果不提醒自己，基本都不做理解，直接skip掉了。我想，要是我一直这么下去，充其量只是个switcher罢了，信息的中转，去无法route到我期望的目标。我期望的目标目前有三个，一个是技术大牛，每次看到技术大牛相关的新闻，简介，访谈，演讲总会激动不已，也想着拥有那样的技术；二是成为一个出色的产品经理，注重用户体验，拿出真正好的产品，这是我不算太渴望的创业梦想吧，三是能够感受国外的学习，工作，生活环境。&lt;/p&gt;

&lt;p&gt;因此需要作出各种改变，改变阅读习惯，在空闲的时间进行真正的思考；规划下三年内要达成的目标；尽量减少睡眠，做更多事情。换一个能够真正锻炼动手能力的环境等等&lt;/p&gt;

&lt;p&gt;下面是我三年后的目标，三年后，我会回来挖坟。。   &lt;br/&gt;
1.精通linux系统开发    &lt;br/&gt;
2.能够用python快速实现自己的想法    &lt;br/&gt;
3.能够清晰的表示自己的观点，对象不限，场合不限    &lt;br/&gt;
4.英语阅读速度与理解能力，技术podcast基本能听懂&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Meego & Meego SDK体验</title>
   <link href="http://www.kernelpanic.im/2010/08/02/meego-meego-sdk-experience"/>
   <updated>2010-08-02T06:48:00+00:00</updated>
   <id>http://www.kernelpanic.im/2010/08/02/meego-meego-sdk-experience</id>
   <content type="html">&lt;h4&gt;MeeGo &amp;amp; MeeGo SDK 体验教程&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;0.MeeGo简介&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;MeeGo项目结合英特尔的Moblin和诺基亚的Maemo, 为下一代计算设备打造了一个基于Linux的开源软件平台。MeeGo软件平台为开发人员的应用程序提供了最大范围的设备选择，包括上网本和入门级桌面设备，便携式计算和通讯设备，车载信息娱乐设备，联网电视，媒体电话等等－均使用共同的开发框架Qt。MeeGo将帮助消费者从不同的设备中获得创新的应用程序体验。MeeGo项目由Linux基金会管理。MeeGo为Linux基金会商标。（来源&lt;a href=&quot;http://meegozone.csdn.net/meego.aspx&quot;&gt;MeegoZone中文站&lt;/a&gt;）&lt;/p&gt;

&lt;p&gt;MeeGo的&lt;a href=&quot;http://meego.com/developers/meego-architecture&quot;&gt;MeeGo架构设计&lt;/a&gt;，可以去看看，如下图：
&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2010/08/clip_image002_thumb_zps01012d3f.gif.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2010/08/clip_image002_thumb_zps01012d3f.gif&quot; width=100% border=&quot;0&quot; alt=&quot; photo clip_image002_thumb_zps01012d3f.gif&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;MeeGo很大一个特点是开源，多平台，并交由Linux基金会管理；产品种类可包括笔记型电脑，智慧型手机，小笔电，平板电脑，互联网电视和车载资讯娱乐系统等。为此，诺基亚还分别调整了Symbian和MeeGo的策略与定位，原有的Symbian平台将继续致力于智能手机的大众化（应该是现有的主流S60/S40，之后的Symbian&lt;sup&gt;3&lt;/sup&gt;/4好像不大现实，首款采用&lt;a href=&quot;http://news.mydrivers.com/1/170/170746.htm&quot;&gt;Symbian&lt;sup&gt;3&lt;/sup&gt;系统--N8&lt;/a&gt;报价469欧）MeeGo则主要定位于高端市场。诺基亚收购Qt，将跨平台的开发特性带给了Desktop、Symbian、MeeGo，其中Meego的编程接口,除了QT 4.7 和WRT还有MeeGo多点触摸界面框架(MeeGo Touch UI Framework 简称MTF)。这种开放的姿态很受开发者欢迎，至于消费用户可能就不会这么看了。MeeGo系统目前也未发布什么像样的产品，只是放出了MeeGo-handset/notebook的img镜像，以及Meego SDK。根据&lt;a href=&quot;http://www.infoq.com/cn/news/2010/07/Mobile-Survey&quot;&gt;InfoQ上一篇移动开发调查报告&lt;/a&gt;，与Iphone/Android高关注相比，MeeGo就像一个仓促上阵的参赛者（两个发行版的整合好像费一些时间，毕竟一个是基于稳定代名词的Debian，另一个则基于“不稳定”代名词的Fedora），在调查报告中都没提到。造成诺基亚的危机主要是在市场占有率常年第一时的不思进取，这和微软最初对待互联网、几年不更新的IE6很像；不过这一次玩的有点大，Symbian系统的用户体验一直没有什么进步，Symbian的开发效率更是让人诟病。。。不过话说回来诺基亚向来是后发先制，UCD大社区有篇文章&lt;a href=&quot;http://ucdchina.com/snap/7488&quot;&gt;相信诺基亚&lt;/a&gt;，就提到了这个观点，就让时间去证明吧。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Meego安装体验&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;0&gt; MeeGo 1.0运行目前是有一些限制的：&lt;/p&gt;

&lt;p&gt;a) 处理器：英特尔Atom或32位的Intel Core 2处理器（支持SSSE3）&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2010/08/cei5tram0ydzy_zps6dc41a0e.jpg.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2010/08/cei5tram0ydzy_zps6dc41a0e.jpg&quot; width=100% border=&quot;0&quot; alt=&quot; photo cei5tram0ydzy_zps6dc41a0e.jpg&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;b) 显卡：一个兼容的Intel图形芯片组。不支持GMA-500/Nvidia/ATI的芯片组。
备注：MeeGo将不能在非SSSE3处理器上运行，更多的硬件配置将在系统的后续更新中获得支持。&lt;/p&gt;

&lt;p&gt;c) 不支持NTFS文件系统（不过这不是问题，因为它是Linux，自己动手）&lt;/p&gt;

&lt;p&gt;d) 官方承诺可以运行MeeGo操作系统的几款上网本分别为：ASUS EeePC 901/1000H/1005HA/1008HA/1005PE、Eeetop ET1602、DELL mini10v、Inspiron Mini 1012、Acer Aspire One D250、AO532-21S、Revo GN40、Aspire 5740-6025
lenovo S10、MSI U130、AE1900、&lt;a href=&quot;http://www.hbea3w.com/Search.asp?KeyWord=HP&quot;&gt;HP&lt;/a&gt; mini 210-1044、Toshiba NB302，支持触控操作。&lt;/p&gt;

&lt;p&gt;1&gt; 在&lt;a href=&quot;http://meego.com/downloads&quot;&gt;MeeGo官网&lt;/a&gt;下载最新镜像，img格式，handset对应手机，notebook对应笔记本。。&lt;/p&gt;

&lt;p&gt;2&gt; 如果想在虚拟机上安装Meego，会比较失望，主流的VMWare和VirtualBox均不能显示启动Meego的图形界面，因为不是Intel图形芯片组。不过Meego SDK中的模拟器还是可以启动的，然后可以体验一下meego。在Windows上建议使用VirtualBox，相比于VMWare，virtualbox快多了；在Linux下其实就没有必要用虚拟机了，SDK本身就可以用，如果要安装的话，qemu或者virtualbox都是不错的选择，可以参考&lt;a href=&quot;http://wiki.meego.com/MeeGo_1.0_Netbook_VirtualBox&quot;&gt;MeeGo Wiki&lt;/a&gt;，下图是Qemu的截图&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2010/08/meegoiviqemu011_zps2b5f7a9e.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2010/08/meegoiviqemu011_zps2b5f7a9e.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo meegoiviqemu011_zps2b5f7a9e.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3&gt; 如果在虚拟机上选择“Boot Meego”：会停留在黑屏界面，下面步骤可解决～&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2010/08/boot_menu_zpseab761df.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2010/08/boot_menu_zpseab761df.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo boot_menu_zpseab761df.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;a) Press ESC when the boot begins to get into GRUB boot menu.&lt;/p&gt;

&lt;p&gt;b) Press TAB to edit boot line.&lt;/p&gt;

&lt;p&gt;c) Remove quiet from boot line and append 3 to start with a shell and then boot.&lt;/p&gt;

&lt;p&gt;d) After boot is complete, press ALT-F1 to get into console and login using your user account. 这两步是关键，卡在黑屏的时Alt+F1切换到控制台登录模式，可以使用root登录,密码meego；进入后执行init 3，要不然老是会跳到无法启动的图形界面去&lt;/p&gt;

&lt;p&gt;e) Type sudo startx to start X11 with TWM :) TWM还是能够启动的，不过相当“简陋”，下图&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2010/08/meegox11twmvirtualbox_zpsbd4382c4.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2010/08/meegox11twmvirtualbox_zpsbd4382c4.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo meegox11twmvirtualbox_zpsbd4382c4.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4&gt; 最好不要尝试“Installtion Only”，我试过好几回，安装完成后的第二次重启会一直卡在背景处，连文本模式都进不去，原因不明，如果你找到了解决方法，请告诉我～&lt;/p&gt;

&lt;p&gt;5&gt; 如果你有满足MeeGo目前限制的笔记本，最好的体验方法就是刻盘启动Meego，或者是将MeeGo安装到U盘或者移动硬盘上（一般的Linux都是支持的，一个小工具Unetbin就能搞定），这样能够体验到完整的Meego环境。不过由于不是触屏设备，普通笔记本上的MeeGo给人的第一印象只是一个界面可爱华丽的Linux普通发行版而已，同样采用了yum进行包管理，集成了常见的一些软件。不上图了，图效果同最后模拟器。。&lt;/p&gt;

&lt;p&gt;6&gt;在线安装软件可以yum search [firefox]，yum install [firefox]，rpm –ivh [firefox-noarch.rpm]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Meeg
o SDK体验&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;0&gt; MeeGo SDK由以下部分构成：&lt;/p&gt;

&lt;p&gt;a) 一个MeeGo chroot环境，这包含了一个基于&lt;a href=&quot;http://www.freedesktop.org/wiki/Software/Xephyr&quot;&gt;Xephyr&lt;/a&gt; 的MeeGo应用程序模拟器（仅支持Linux），一些在Xephyr里启动/停止MeeGo桌面的脚本，以及可以远程配置和部署MeeGo设备的Qt Creator。&lt;/p&gt;

&lt;p&gt;b) 一个启动MeeGo chroot环境，并运行模拟器和Qt Creator的&lt;em&gt;meego-sdk-chroot&lt;/em&gt;脚本&lt;/p&gt;

&lt;p&gt;1&gt; 下载MeeGo SDK大概630M，不过我觉得SDK和Gentoo stage3的tar包很像，不同的是它包含了Qt完整开发toolchain、模拟器的chroot环境。&lt;/p&gt;

&lt;p&gt;2&gt; 按照目前的很常见的开发模式，大家都习惯于在Windows/Linux上开发--&gt;模拟器测试--&gt;真机测试。不过现在由于现在的一些限制，在linux下开发是最简单的。按照&lt;a href=&quot;http://wiki.meego.com/%E5%9C%A8_Linux_%E4%B8%8A%E4%BD%BF%E7%94%A8_MeeGo_SDK&quot;&gt;在Linux 上使用MeeGo SDK&lt;/a&gt;上的步骤，有时会遇到模拟器后启动白屏或者黑屏的问题，这里有一个小bug，meego sdk的mailist提供了一个&lt;a href=&quot;http://lists.meego.com/pipermail/meego-dev/2010-June/003088.html&quot;&gt;解决方法&lt;/a&gt;。&lt;/p&gt;

&lt;p&gt;3&gt; 由于每次启动sdk需要配置xhost,以及执行chroot命令，还有可能存在上面的一个小bug，我建立了一个脚本start_meego，然后使用source命令执行，这样可以省事不少。&lt;/p&gt;

&lt;h1&gt;start_meego&lt;/h1&gt;

&lt;h1&gt;[ ]内替换为你当前路径&lt;/h1&gt;

&lt;p&gt;export DISPLAY=:0&lt;/p&gt;

&lt;p&gt;export DBUS_SESSION_BUS_ADDRESS=&quot;&quot;&lt;/p&gt;

&lt;p&gt;xhost &amp;amp;&amp;amp; xhost +SI:localuser:[root]&lt;/p&gt;

&lt;p&gt;[./meego-sdk-chroot] [./meego-sdk-0524]&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2010/08/source_meego_zps8ceb9e9d.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2010/08/source_meego_zps8ceb9e9d.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo source_meego_zps8ceb9e9d.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4&gt; 在Windows下要想体验meego sdk,目前好像只有使用虚拟机安装Linux这一种方法，比如Ubuntu之类的。而我这次安装的是gentoo使用的是install-x86-minimal镜像，光emerge kde-meta就花了三天时间，期间还安装了X，和Virtualbox Guest Addtions，才让它工作正常。所以最好还是安装集成版，或者安装轻量级的X Window。下面是MeeGo模拟器的一些截图，和真机跑效果是差不多的～&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2010/08/meego_emu_zps096f14e8.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2010/08/meego_emu_zps096f14e8.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo meego_emu_zps096f14e8.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;欢迎界面&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2010/08/meego_develop_zps388fd5ff.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2010/08/meego_develop_zps388fd5ff.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo meego_develop_zps388fd5ff.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;应用软件&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2010/08/meego_multi_task_zps54f263ac.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2010/08/meego_multi_task_zps54f263ac.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo meego_multi_task_zps54f263ac.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;多桌面切换&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://s750.photobucket.com/user/hewigovens/media/wp-migrate/uploads/2010/08/meego_device1_zpsb020268b.png.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://i750.photobucket.com/albums/xx144/hewigovens/wp-migrate/uploads/2010/08/meego_device1_zpsb020268b.png&quot; width=100% border=&quot;0&quot; alt=&quot; photo meego_device1_zpsb020268b.png&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;设备界面，由于是模拟器，电池，无线不可用&lt;/p&gt;

&lt;p&gt;5&gt; 剩下的就是打开Qt Creator/Desinger，创建应用了。体验Over~&lt;/p&gt;
</content>
 </entry>
 
 
</feed>