<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[阿权的书房]]></title> 
<link>http://www.aslibra.com/blog/index.php</link> 
<description><![CDATA[技术经验分享，资料收集，偶尔晾几张相片，感言生活]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[阿权的书房]]></copyright>
<item>
<link>http://www.aslibra.com/blog/read.php/1671.htm</link>
<title><![CDATA[分享：创新工场5位创业者2011创业感悟]]></title> 
<author>hqlulu &lt;hqlulu@163.com&gt;</author>
<category><![CDATA[文摘资讯]]></category>
<pubDate>Sat, 31 Dec 2011 04:59:10 +0000</pubDate> 
<guid>http://www.aslibra.com/blog/read.php/1671.htm</guid> 
<description>
<![CDATA[ 
	<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9">对创业者来说，2011年是一个最好的创业时间，也是一个最坏的创业时间。最好是因为，这一年，移动互联网开启了新一轮产业大变革，百花争鸣的趋势愈演愈烈;最坏是因为，电子商务的过山车行情揭开了资本寒冬的序幕，很多创业企业提前过冬。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9">然而无论最好还是最坏，对于创业者来说，成功的核心要素始终不曾改变过。他们依靠敏锐的嗅觉，发现创业的引爆点;用自己的方式，改变游戏规则;凭智慧和勇气，规避可能存在的风险乃至出奇制胜迅速占据市场，并引领行业潮流。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9">回顾这一年，哪些事情让创意创业者感触最深?是创业的艰辛还是前进的喜悦?在腾讯科技昨日举办的#微论坛#上，创新工场孵化的5家创业企业的CEO&mdash;&mdash;应用汇罗川 、布丁徐磊 、知乎周源 、安全宝马杰及杀价帮彭林，分享了他们2011年的创业感悟。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9"><strong>应用汇CEO罗川：小团队创业需要专注</strong></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9"></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: #f9f9f9; text-align: center"><a style="color: #333333; text-decoration: none" href="http://app.umiwi.com/photo.php?img=http://i1.umivi.net/2011/1231/1325293002100.jpg"><img style="border-style: initial; border-color: initial; border-image: initial; border-width: 0px" src="http://i1.umivi.net/2011/1231/1325293002100.jpg" border="0" width="250" height="337" /></a></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9"></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9">这一年发生的变化非常大，我觉得最重要的可能是两件事情，两个词，一个叫放下，另外一个叫舍得。放下就是放下自己过去的那些所有的，不管是身份也好，光环也好，还是过去的历史也好，通通放下，然后把自己想象成一个非常简单的创业者，这个是一个心态上的改变。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9">那么舍得呢，就是你要舍弃很多，舍得这个词更多的是对你所进行的服务而言。过去我都是在大企业，大企业一开始嚷嚷着要做大平台，你肯定得做一个大的平台之后，才能让老板满意，才能让公司满意。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9">但是作为小的创业公司就不一样，包括我开始跟应用汇原来的同事们在一块儿工作时，大家也有很多的想法，因为移动互联网刚刚开始，很 新，Android市场这个事也是苦活累活，很多人出现动摇情绪，说我们要不要做一个游戏运营，我们要不要做一个PC助手，最后这些想法都被我灭掉了。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9">我为什么要灭掉这些想法?最重要的就是小团队必须要专注，你一定要把很多东西舍了，才能得到。这个电子市场虽然做着很苦，但它也是壁垒，因为大公司要想这么苦下来，不太可能，而你才能有活下去的理由。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9">互联网我经历了有十多年了，最重要的是剩者为王，最后能够剩下来的就是王，这个剩者为王，你怎么能够坚持下来?就是你一定要把你自己做的服务，能够产品化和产业化，你一定要跟大伙儿绑成一体，你死了，别人也死得很难看，这就比较麻烦。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9">比如现在的应用汇用户量不是非常大，但如果应用汇真的不玩了，包括知乎、杀价帮、布丁都少了推广平台，他们也觉得很可惜，所以我们存活的价值就在于说帮助大家能够成功，这样这个企业剩者为王的可能性就大很多。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9">我心态最大的变化是以前都是在台上跟大家握手，现在变得重要的是跟各种大佬们，比如见到&ldquo;雷布斯&rdquo;，赶紧迎上去，跟他们握手，贴近一下关系，这在以前是不会的。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9">这个听起来觉得有点凄惨，但其实不是这样，创业还是有很多很快乐的事情。最快乐的事是什么呢?就是能按照你自己想象的方向去做。要按照你自己的方向 去做也不容易，因为你要灭掉很多别的想法，那些人跟你创业，他们也有自己的方向，你怎么去做耐心细致的思想工作，让这个团队能够聚到一起，让方向非常专 一，其实是个很有意思的事情。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9">当然你可以凭权利，老板说这么干就这么干，或者你引诱他，你要不完成这个指标，都拿不着奖金。但现在你没有这样的权威，就要靠你的智慧和经验，还有 你的沟通能力，才能把这个事情做好。我觉得最快乐的时候，是把这个思想终于兜售给了另外一个有狂热思想的人，这时我就感觉到特别快乐，这是创业里头最有乐 趣的一件事。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9"><strong>布丁CEO徐磊：创业是一种生活方式的选择</strong></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9"></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: #f9f9f9; text-align: center"><a style="color: #333333; text-decoration: none" href="http://app.umiwi.com/photo.php?img=http://i1.umivi.net/2011/1231/1325293022824.jpg"><img style="border-style: initial; border-color: initial; border-image: initial; border-width: 0px" src="http://i1.umivi.net/2011/1231/1325293022824.jpg" border="0" width="250" height="337" /></a></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9"></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9">创业其实是一件苦事，没有那么多光环。创业不是一件容易的事，为什么还有这么多创业者?或者说总有一种按捺不住的创业冲动?</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9">我觉得很多公司发展到一定阶段，他很难提供给你一个合适的环境，因为每个公司规模越来越大，它要靠制度的流程。制度是应该有，制度是什么呢?就是一种防范风险的工具，所以公司到了一定的规模，就必须要有制度。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9">作为个体来说，你想在一些框架下去做一些创新一点的事情，或者出格一点的事情，没那么容易。其实我的第一个公司，我也待了九年，前四年干的就跟打了 鸡血一样，没日没夜的工作。但是慢慢发展到一定的阶段，公司进入正轨了，各方面抗风险的需求就会越来越强，你可做的事情就会越来越少。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9">所以我慢慢发现自己没有锋芒，没有棱角，每天就是按部就班去完成。所以我在离开的时候就告诉自己，如果再不离开，可能就被自己惯懒了，三十多岁就把自己惯懒了，是挺可怕的事情。这个时候我就觉得我应该给自己找一些能让自己兴奋起来的事情。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; color: #333333; font-family: SimSun, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #f9f9f9"></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">今天挺凑巧，今天我们在办公室的时候，有另外一个伙伴在工作时就说，我现在工作好多，列了一长的表，排着队要干，但是他觉得很兴奋。这样的人，才能适合去创业。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">创业不是适合每一个人都应该去干的事情，我曾经也说过一句话，如果你愿意把自己打游戏，或者打麻将，或者唱歌跳舞抽烟的这种精力都放在工作上，那你 是适合创业，如果你觉得你的生活应该多姿多彩，应该朝九晚六，应该每天有一段时间去打打球，有一段时间看看电视，也是一种非常正常，或者说大多数人应该过 的生活。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">但是创业是一种需要破釜沉舟，义无反顾的生活姿态，不管你是领导者，还是早期团队的联合创始人也好，其实你们要付出的、牺牲的还是非常多，但是还是 有这么多人创业，就意味着创业还是一件热血澎湃的事情。人的一辈子，可能需要有一段这样的记忆，我的第一个公司给我留下了四五年这样的记忆，我的第二个公 司现在才一年，我觉得今天的记忆，可能跟我以前，甚至已经超过了以前的那种感觉。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em"><strong>知乎CEO周源：创业是一个自我修正的过程</strong></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em"></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; text-align: center"><a style="color: #333333; text-decoration: none" href="http://app.umiwi.com/photo.php?img=http://i1.umivi.net/2011/1231/1325293034831.jpg"><img style="border-style: initial; border-color: initial; border-image: initial; border-width: 0px" src="http://i1.umivi.net/2011/1231/1325293034831.jpg" border="0" width="250" height="337" /></a></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em"></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">第一次创业和第二次创业，我的变化是非常大。我第一次创业是一个什么情况呢?我是一个控制欲特别强的人，怎么讲?这个产品是什么颜色，多大，从这样的事情到公司三个月做什么事情等所有的事情我都要决定。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">我现在回过头去想，我发现其实当时我自己变成了公司的一个瓶颈，所有都需要你来做的话，你就变成了公司的一个天花板，其实你一个人是做不到的。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">从知乎开始，我发生了一个很大的转变。第一点，就是足够信任团队和队友，把非常专业和他们更擅长的事情交给他们去做，这样才有可能把自己的事情做好，这是我个人一个很深的体会。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">正好昨天我在知乎上看到一个媒体人在线，我当时提了一个问题，因为我以前做过媒体，我说为什么记者写稿的时候，到最后一天往往都很痛苦，对方是这么回答的，他说往往都是写到最后一天才发现这个稿子没价值，所以就痛苦，又不得不写。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">我当时看完以后，我挺有感触的，怎么讲?创业者的心态他可能是反过来的，当你看到一个事情它很难，或者很痛苦的时候，你通常不会觉得那个事有问题，你通常都是觉得自己有问题，你觉得自己没有做到位，他痛苦的来源是不一样的。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">所以我过去最深的一个体会就是，你如果真的要做到位，你就得不断地改变，你每天改变1%，你一年就改变37倍，如果你能做到这一点，那你一年下来你就不会痛苦。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em"><strong>杀价帮CEO彭林：创业需要韧性</strong></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em"></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; text-align: center"><a style="color: #333333; text-decoration: none" href="http://app.umiwi.com/photo.php?img=http://i1.umivi.net/2011/1231/1325293047903.jpg"><img style="border-style: initial; border-color: initial; border-image: initial; border-width: 0px" src="http://i1.umivi.net/2011/1231/1325293047903.jpg" border="0" width="250" height="337" /></a></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em"></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">2011年对于我来说，是人生中最关键的一年，我也希望各位网友今天能有一些收获回去。我今年最大的一个感触，创业非常重要的一点就是韧性，当然有 理想就不用说了，今天来到这儿的人都是有理想的人。这个韧性我觉得分几个层面，不是说能吃苦就叫韧性，首先最基本的一点，个人荣辱是不是能够放得下?</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">比如说我们每天跟同事，跟好朋友晚上喝酒聊天的时候，骂社会，骂领导，骂公司，骂环境，最后喝到高兴的时候，把酒瓶子一摔，说老子出去创业的时候， 绝对比他们强，我相信这个场景每个人身边都发生过。但是第二天早上一想到别人叫我这个总，那个总，觉得还不错。这个时候，个人的荣辱是不是能放下?对于很 多创业者，很多人能够放下。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">第二点，自己生活的由奢入俭。比如说以前我去成都，那是什么待遇级别，那都是车接车送，成都的各个娱乐场所都已经很清楚了，你自己创业怎么办?住一个特别偏远的小房子，成都那个地方晾衣服一个礼拜都不带干的，这种变化，大家是不是能够适应，能够接受?</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">其实这个韧性很多人也能够挺过来，但是下一步呢?涉及到家人的责任，比如说你老婆，你孩子是靠你养的，你自己的荣辱可以放下，假如说有一天，你老婆 怀孕了，马上住院了，这时候我找老婆说，我们员工工资发不下去了，你借我几万块钱吧，这种话你能不能张开口。尤其是家里对你那些期盼，你能不能放得下，这 个层面确实很难达到。但是做到这一点的人也有不少，为什么?</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">你心里面有一个理想，有一个信念在支撑你，你可以把这些东西都做到。但当你这个理想受挫了，你的方向被投资人抨击了，投资人说你这个想法不对，你从 一开始就错了，我不会给你钱的，你的团队这时候突然受到打击，大家的想法都变化了，这时候你还能不能有韧性，你还能不能坚信自己做的是对的，还能不能把这 件事情坚持下来?这背后是有很多辛酸的。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">所以说今年这样一个转变，我觉得对于大家来说，是非常好的事情，现在正好是大浪淘沙的时候，我坚信自己不会是那个沙子，不会被踢出去。所以不管未来创业环境多差，我觉得能够剩下唯一的那家企业都是我，如果大家有这样的心态的话，今天的收获就很大。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em"><strong>安全宝CEO马杰：准备好，创业会很顺利</strong></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em"></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; text-align: center"><a style="color: #333333; text-decoration: none" href="http://app.umiwi.com/photo.php?img=http://i1.umivi.net/2011/1231/1325293059491.jpg"><img style="border-style: initial; border-color: initial; border-image: initial; border-width: 0px" src="http://i1.umivi.net/2011/1231/1325293059491.jpg" border="0" width="250" height="337" /></a></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em"></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">过去这么多年，我做了很多年安全之后的一个感觉，个人用户以前很多公司，包括我的前公司瑞星在内的多家公司，做了很多的推动工作，让用户逐渐的重视 到了安全，并且最后在几个特定的安全事件里推波助澜下，比方说红色代码，晚期的熊猫烧香等等这些事件的推动下，用户认识到安全的重要性。网站本身呢，它是 一个发展的过程，前些年应该说网站很重要，现在网站挣钱了，这才真正重要了。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">在这个前提之下，大家才能逐渐意识到在这上需要进行安全的投入。我之所以创业来做这个网站安全这块，也是做了很多年安全之后，我个人的一个感觉网络 安全这块，是一个成长很好，但现在又没有领导型的企业的这么一个地方。并且我们又适时的看到了很多问题，本来我想大家对这个问题的认识过程，可能还需要稍 微再长一点这个周期，这次几家公司在密码问题上所暴露出来的安全性上的严重缺乏，使得这一天稍微早一点的被大家意识到了网站本身安全的重要性，现在是全民 改密码。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">通过这个事件体现出来即使像我们这种大型的社区，或者大型的论坛，它们都缺乏很多基础的安全性的建设工作。我觉得这次这个事件是一个灾难，同时也是一个好的事情，让我们互联网公司意识到安全的重要性。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">相比其他公司，我们融资很顺利，为什么很顺利呢?是源于我们一贯做事的风格，所有的事情都想好，都准备好，它应该很顺利。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">我可以说说简单的故事，我们做这个事情的想法，我也想过很多年，包括业内的很多人也都聊过天，以前瑞星的董事长也聊过，但是因为对原有的产品和公司 结构的很多影响，所以很难推行成功。跟开复聊得比较顺利，他很支持我们，然后我就去做这个商业计划。看我好几个月都没动静，一直到我约定的这个期限的前几 天，我才把商业计划拿出来，之前我其实一直在想，在思考一个问题，在做很多准备。当我拿出来的那天，所有的东西都是一次通过，我们算的各种费用，到需要融 多少钱，基本上都是一次通过。所以整个过程没有任何的意外，这个可能是做了一些准备工作吧，所以刚才你说的那个问题，我无从回答。这可能也是因为做企业级 产品养成的一种习惯吧，把事情想清楚，做稳妥。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">我想我们团队做这个事情，有一个很朴实的，但是也很狂妄的一个梦想，我们做了这么多年的计算机，有幸做到了计算机发展这么快的行业里面来，有幸能做 到安全这个行业里面来，我们能在这个计算机发展历史上，能在互联网发展的历史上，或者能在安全发展的历史上，留下我们自己的一些痕迹吗?我们做一辈子，或 者说做安全的人，找工作真的很容易，我们在这儿也可以干，在那儿也可以干，我们想要做什么，想要做成一点什么?我想我们很多人还是想最终能做成一点什么事 情。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em">我们团队有一个人说过一句话我觉得不错，把我们这个想法用更朴实的方法阐述了一下，他说怎么着我们老了以后，也得有个跟孙子吹牛的资本吧。我想我们还是热血中年吧，希望能做成一点真的能改变这个历史的什么样的事情，哪怕从一些很小的角度上。</p><p></p>
]]>
</description>
</item><item>
<link>http://www.aslibra.com/blog/read.php/1669.htm</link>
<title><![CDATA[转：游戏设计的一点思考]]></title> 
<author>hqlulu &lt;hqlulu@163.com&gt;</author>
<category><![CDATA[文摘资讯]]></category>
<pubDate>Sat, 31 Dec 2011 01:07:23 +0000</pubDate> 
<guid>http://www.aslibra.com/blog/read.php/1669.htm</guid> 
<description>
<![CDATA[ 
	&nbsp;&nbsp;&nbsp;&nbsp;最近想要设计款手机游戏，游戏设计我是零起点，于是开始找一些flash小游戏来学习一下。渐渐发现那些设计精美制作精良的小游戏的魅力丝毫不比像EA，GAMELOFT这类大公司的巨作逊色。游戏的魅力在与能让人沉醉其中，可以说能让人痴迷上瘾的游戏无一例外都是成功的游戏。从这个角度来说游戏设计者的初衷就应该是让无差别的玩家痴迷在自己的作品中。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp; 到底怎么才能做到的呢？每个游戏都是一个独特的世界，存在于画面上的世界，通过键盘和鼠标等设备将玩家的身体和意识“拉进”这个虚拟世界里。使得玩家在意识上把自己视作这个世界里的一部分（通常是游戏的hero或actor），遵循着虚拟世界的每个规则，最好使之暂时忘记现实世界的规则。这种意识替换的作用越强，游戏的可玩性越好，越能使人沉迷其中。<br/>比如：愤怒的小鸟营造的是一个模拟物理的世界，基本规则与现实世界相同，但重力阻力等却有与真实世界有所区别，加上卡通的画风，构成了一个完整的卡通世界。玩家能专心于应用自己的物理经验，将自己的意识关注在操作弹弓上，把自己想象成这个卡通世界的参与者、行为者。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp; 再比如超级玛丽，是一个幻化的世界，有各种物体和角色组成，玩家的意识化作马里奥，通过有限的动作和能力使玩家参与这个世界的活动。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp; 所以说制作游戏的基本目标就是创造一个世界，制定行为规则或者创造一个角色让玩家的意识依附其中。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp; 游戏的乐趣来源于人的本性，最基本的比如求胜心理，比如大富翁；还有收集物品、金钱的满足感；再有高度精神紧张后的忽然如释重负，比如CS。越是能实现现实社会里很少被满足的心理需求越容易受人欢迎，越容易使人沉迷。我想这也是为什么青春期的学生是游戏沉迷的主要群体，一方面他们简单的生活只能给他们展现很有限的满足心理需求的机会，一方面伴随着青春期而来的越来越多的欲望和烦恼驱使他们追求更多的心理满足感。一款好的游戏，恰恰可以一方面带给他们实现心理满足感的机会，一方面也会激发更多的心理需求。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp; 人的本性之一性就常被游戏设计者拿来做文章，且屡试不爽。各种男性向女性向的游戏在不和谐的国家卖得火热。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp; 至于游戏世界的规则，玩家作为actor的时候，规则复杂了玩家会抵触，甚至产生挫败感放弃游戏。简单了没有挑战，失去过关后的成就感。规则变化太多让人应接不暇，太少又枯燥乏味。CutTheRope是这方面权衡的很好的例子，游戏分几个世界，每个世界增加一到两种新物品丰富世界的规则，易于学习，同时也逐步增加难度，让过关后的满足感随之递增。超级玛丽世界的规则除了水下关都大体相同，难度增加不大，其变化源于不同关卡里变化丰富的敌人和，隐藏物品也是画龙点睛之笔，直接增加重玩次数。<br/>总之规则层级变化，难度逐渐增加都是游戏的变化方式。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp; 故事的必要性。有些游戏有故事，有些没有，无疑有故事的游戏创造的世界更能让人信服，从而更快的融入其中，而且也是不同关卡过度的好方法。比如植物大战僵尸，故事就是保卫你得房子免于僵尸的入侵。如果没有故事，没有神经兮兮的邻居，背后的不是房子而是划地为界，植物换成手枪大炮，游戏主线变成不让僵尸过界，恐怕可玩性大打折扣。玩家会不仅想为什么那么多手枪大炮，又是哪来得那么多僵尸呢？加上个故事就好了，爱国为家匹夫有责，管他娘的哪来的僵尸。而如果还是手枪大炮的话，这款游戏很可能会演变成一款血腥打僵尸游戏，受众会大大受限，至少女性玩家和孩子不喜欢这类游戏。我一直认为走可爱、简约路线是手机游戏的倾向，毕竟男女老少都会是手机用户，只有张开怀抱拥抱所有人的设计者才是聪明的设计者。反过来想，改造一些受众受限的恶俗游戏，把他们“萌化”，让他们从良不失为一个好的设计路子。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;关于游戏风格。风格很重要，可以区别你得游戏和其他人的游戏，同样是方块消除游戏，卡通化跟写实化，现代派和古典风又有区别。风格独树一帜，就算玩法再俗也能让人记住。风格的营造全靠画面、音效的统一，画面不能一会卡通一会写实变化突兀，一会是圆润的水晶按钮，一会是平坦的网页按钮。音效也是，一会摇滚一会古典，一会灵异一会激昂会让人迷惑。音效符合画面环境跟游戏节奏最重要。比如休闲游戏画面要简单明快，音效也要轻松舒缓才好。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp; 对于手机游戏需要考虑的问题我归结以下几点：<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;首先受限与屏幕大小，各种按钮和触摸部件的大小需要合理，比如手指触摸物体不应小于0.6cm-0.8cm，否则容易误触。小物体能不用触摸点击尽量不用，反倒是滑动更好控制而且趣味性更强。游<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;戏背景不应太多，因为这类图最大，加载耗时耗内存，不宜设计成每关单独一个背景。反倒是设计成不同World每个World包含若干关，每个World背景相同。这样兼顾了性能和UI的变化。UI元素分为两类，共同部分——游戏菜单按钮，背景，英雄的Sprite、音效，独特部分——关卡特有的Sprite、关卡设计数据。共同部分启动时仅载入一次，特有部分在切换关卡或者World的时候载入。这点在CutTheRope里体现的很好，关卡切换动画是载入资源和释放资源的好机会。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;性能上避免把大运算量的工作一次性完成，应该把工作量在各次更新或线程里分步分量均匀的去做。否则画面会不稳定忽快忽慢。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;此外，个人开发的话，设计灵活很重要。因为没有完整的规划和详细的设计，好的设计便于后期改动。也能减少开发周期。比如我现在能想到的几点，基于AndEngine：<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;先行开发通用的界面功能，MainMenu，HighScore，Credit，LevelChooser， EndGame，ResourceManager，SceneManager等类。把游戏主体放在Scene类里，开发的时候主要精力放在游戏Scene上，再根据需要开发各个游戏元素类。通用界面只需修改载入图面的名称、大小、位置就能轻松的把界面改头换面。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;共同的关卡参数放在全局访问的类里，一些关卡特定的数据——重力等，可能会在关卡初始化的时候有个初始值，游戏中某个按钮或事件还会修改重力，那么把PhysicsWorld放在全局类里是个好主意。考虑CutTheRope的开发，如果设计前几个World的时候没有考虑重力的改变，后面又忽发奇想想加入重力按钮的话，你只需要加入重力按钮类，生成关卡元素的代码里加入重力按钮的部分就可以了。PhysicsWorld 可以被重力按钮类和关卡数据读入类访问，放在静态数据里比较合适。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;元素的生成和消除，一起消除一起隐藏。如果速度不快处理又多，界面元素逐个出现或逐个消失看起来会很奇怪。<br/>&nbsp;&nbsp;&nbsp;&nbsp;Box2d里，如果不在绘制线程里消除Body会导致崩溃，在碰撞检测的beginContact，postContact 等几个函数里也是不能消除Body的。一些触摸操作也会导致崩溃，除非在EngineOption里设置把触摸事件放在绘制线程里处理。<br/>&nbsp;&nbsp;&nbsp;&nbsp;各种类对象避免互相引用，尤其是涉及静态类和资源的情况，否则会出现内存无法释放。总之，高内聚低耦合。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;开发过程，应该尽可能想得长远些，前期调查的充分些，把需求尽早固定下来，减少后期的改动。需要尽早确定的有：游戏世界的规则和玩法、游戏世界的参数（重力、粒子池元素数等）、各种元素的能力以及涉及到的游戏世界的参数、关卡数据结构……然后根据这些信息，确定程序结构：哪些值需要是全局的哪些是类成员。这些都确定了，游戏Scene的结构和流程就明了了。千万别把游戏规则和元素的设计留到后面修改，游戏主体修改会很大很麻烦的，而直接导致BUG。美工的设计，最好绘制矢量图，在生成PNG，美工可能会改来改去，有矢量图工程方便些。 音效我不会设计，从小不识谱，只能盗版其他游戏跟网站的。这个不急，可以有时间陆续找，找到合适主题的音效也不容易。Google的音乐库也许是个找音效的好办法，毕竟能根据节奏和心情描述找曲子。<br/><br/>阅读原文：<a href="http://blog.sina.com.cn/s/blog_670f9b990100wokd.html" target="_blank">http://blog.sina.com.cn/s/blog_670f9b990100wokd.html</a>
]]>
</description>
</item><item>
<link>http://www.aslibra.com/blog/post/OpenSourceiPhoneApplicationsToLearnFrom.php</link>
<title><![CDATA[20+ Open Source iPhone Applications To Learn From]]></title> 
<author>hqlulu &lt;hqlulu@163.com&gt;</author>
<category><![CDATA[Phone]]></category>
<pubDate>Sat, 03 Dec 2011 15:37:47 +0000</pubDate> 
<guid>http://www.aslibra.com/blog/post/OpenSourceiPhoneApplicationsToLearnFrom.php</guid> 
<description>
<![CDATA[ 
	<div class="forMobile">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<p>When developing something in a language that you're not so experienced with, <strong>looking for the examples and digging them deeply is a good way of learning</strong>.</p> <p>Same with the iPhone application development and considering it is&nbsp;&nbsp;something new for many developers, viewing the codes of real-world&nbsp;&nbsp;applications and re-using them when needed is very valuable.</p> <p>Here are <strong>20+ open source iPhone apps</strong> to learn and get inspired from:</p> <div class="PostList"> <ul> <li> <h3><a href="http://ios.wordpress.org/" target="_blank">WordPress for iOS</a></h3> <p><a href="http://ios.wordpress.org/" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/wordpress-ios.jpg" border="0" alt="WordPress for iOS" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The official WordPress application for iOS.</p> <p>Besides strong content or comment editing features, it can share your&nbsp;&nbsp;location while publishing a post as well (download exists under the &quot;<a href="http://ios.wordpress.org/development/" target="_blank">development menu</a>&quot;).</p><p>&nbsp;</p> </li> <li> <h3><a href="http://community.freshbooks.com/addons/view/minibooks/" target="_blank">MiniBooks</a></h3> <p><a href="http://community.freshbooks.com/addons/view/minibooks/" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/minibooks.jpg" border="0" alt="MiniBooks" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The open source iPhone application of the FreshBooks invoicing service.</p> <p>It connects to the FreshBooks account and enables you to use most of the features (source is offered <a href="http://github.com/freshbooks-addons/freshbooks-iphone-project" target="_blank">here</a>).</p><p>&nbsp;</p> </li> <li> <h3><a href="http://code.google.com/p/remail-iphone/" target="_blank">reMail</a></h3> <p><a href="http://code.google.com/p/remail-iphone/" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/remail.jpg" border="0" alt="reMail" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; An e-mail search application (acquired by Google) that downloads all your e-mail and makes full-text searches.</p><p>&nbsp;</p><p>&nbsp;</p> </li> <p>&nbsp;</p> <li> <h3><a href="http://code.google.com/p/tubestatus/" target="_blank">TubeStatus</a></h3> <p><a href="http://code.google.com/p/tubestatus/" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/tube-status.gif" border="0" alt="Tube Status" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; It displays the London Underground tube lines by parsing the HTML from the official TFL website.</p> <p>And, once a line is clicked, <strong>TubeStatus</strong> shows detailed information about it.</p><p>&nbsp;</p> </li> <li> <h3><a href="http://www.vellios.com/spacebubble/" target="_blank">SpaceBubble</a></h3> <p><a href="http://www.vellios.com/spacebubble/" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/spacebubble.gif" border="0" alt="SpaceBubble" width="200" height="113" align="left" /></a> <strong>SpaceBubble</strong> is a fast-paced arcade game which is also <strong>optimized for the iPhone 4 retina display</strong>.</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p> </li> <li> <h3><a href="http://www.wikihow.com/wikiHow:IPhone" target="_blank">wikiHow</a></h3> <p><a href="http://www.wikihow.com/wikiHow:IPhone" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/wikihow-iphone.jpg" border="0" alt="WikiHow iPhone" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; It enables you to read wikiHow's featured article feed, search and browse them.</p> <p>And, you can bookmark articles to store them for later reading, and watch YouTube videos embedded into articles.</p> </li> <li> <h3><a href="http://iphone.natsulion.org/" target="_blank">NatsuLiphone</a></h3> <p><a href="http://iphone.natsulion.org/" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/natsuliphone.jpg" border="0" alt="NatsuLiphone" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A <strong>Twitter client</strong> which can display the friend timeline and post a status message.</p> <p>It can show a specific user's timeline and has an autopagerize method that can display older tweets while scrolling.</p><p>&nbsp;</p> </li> <li> <h3><a href="http://www.sunsetlakesoftware.com/molecules" target="_blank">Molecules</a></h3> <p><a href="http://www.sunsetlakesoftware.com/molecules" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/molecules.gif" border="0" alt="Molecules" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; An application that allows you to view three-dimensional renderings of molecules and manipulate them using your fingers.</p> <p>Molecules can be <strong>rotated by moving your finger</strong> and zoom in or out by using two-finger pinch gesture.</p><p>&nbsp;</p> </li> <li> <h3><a href="http://www.sunsetlakesoftware.com/molecules" target="_blank">HP Calculator Emulator</a></h3> <p><a href="http://code.google.com/p/hpcalc-iphone/" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/iphone-hp-calculator.jpg" border="0" alt="HP Calculator Emulator" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The application emulates various versions of the popular HP scientific calculators.</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p> </li> <li> <h3><a href="http://code.google.com/p/iphoneebooks/" target="_blank">Books</a></h3> <p><a href="http://code.google.com/p/iphoneebooks/" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/iphone-books.gif" border="0" alt="Books" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A simple eBook reader for the iPhone which reads HTML and text files stored in your ~/Media/EBooks folder.</p> <p>And, it is smart enough to enter subdirectories, if for instance, you've broken a book down by chapters.</p><p>&nbsp;</p> </li> <li> <h3><a href="http://code.google.com/p/tweetero/" target="_blank">Yfrog For iPhone</a></h3> <p><a href="http://code.google.com/p/tweetero/" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/yfrog-iphone.gif" border="0" alt="Yfrog For iPhone" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A Twitter application where you can view friends timeline,&nbsp;&nbsp;following/follower lists, post status updates or send direct messages.</p> <p>Also, you can add geo information into tweets.</p><p>&nbsp;</p> </li> <li> <h3><a href="http://code.google.com/p/mobilesynth/" target="_blank">MobileSynth</a></h3> <p><a href="http://code.google.com/p/mobilesynth/" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/mobilesynth.gif" border="0" alt="MobileSynth" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A classic monophonic (playing one note at a time) synthesizer, designed for live performance.</p><p>&nbsp;</p><p>&nbsp;</p> </li> <li> <h3><a href="http://code.google.com/p/metasyntactic/wiki/PocketFlix" target="_blank">PocketFlicks</a></h3> <p><a href="http://code.google.com/p/metasyntactic/wiki/PocketFlix" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/pocketflix.jpg" border="0" alt="PocketFlicks" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The application helps finding movies and managing your Netflix information.</p> <p>Using <strong>PocketFlicks</strong>, add movies to your queue, add/update ratings and more.</p><p>&nbsp;</p><p>&nbsp;</p> </li> <li> <h3><a href="http://github.com/c99koder/lastfm-iphone" target="_blank">Official Last.fm Application</a></h3> <p><a href="http://github.com/c99koder/lastfm-iphone" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/last-fm-iphone.jpg" border="0" alt="Last.fm iPhone Application" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The iPhone application of Last.fm for listening to free streaming radio anywhere.</p> <p>It also helps to share music via your phone contacts, purchase tracks and albums from the iTunes Music Store.</p><p>&nbsp;</p> </li> <li> <h3><a href="http://colloquy.info/project/browser/trunk/Mobile" target="_blank">Colloquy</a></h3> <p><a href="http://colloquy.info/project/browser/trunk/Mobile" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/colloquy.gif" border="0" alt="Colloquy" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The iPhone version of the well-known Mac OS X IRC client.</p> <p>It is a complete chat application with support for all IRC functions, push notifications, highlighting messages, etc.</p><p>&nbsp;</p> </li> <li> <h3><a href="http://code.google.com/p/metasyntactic/wiki/NowPlaying" target="_blank">Now Playing</a></h3> <p><a href="http://code.google.com/p/metasyntactic/wiki/NowPlaying" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/now-playing.gif" border="0" alt="Now Playing" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Browse theaters, the movies they are playing, show times, ratings, play trailers and their distances.</p> <p>The application is currently down due to an issue with the data provider but the source is still available.</p><p>&nbsp;</p> </li> <li> <h3><a href="http://github.com/millenomi/diceshaker" target="_blank">Diceshaker</a></h3> <p><a href="http://github.com/millenomi/diceshaker" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/diceshaker.gif" border="0" alt="Diceshaker" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A dice-rolling application for iPhone, Android and JavaScript-based&nbsp;&nbsp;environments for your roleplaying sessions and board games.</p><p>&nbsp;</p><p>&nbsp;</p> </li> <li> <h3><a href="http://gorillas.lhunath.com/" target="_blank">Gorillas</a></h3> <p><a href="http://gorillas.lhunath.com/" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/gorillas.gif" border="0" alt="Gorillas" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The iPhone version of the cult QBasic game. Its source can be found <a href="http://wiki.github.com/Lamentum/Gorillas/" target="_blank">here</a>.</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p> </li> <li> <h3><a href="http://www.mitapp.com/en/applications2/ecological-footprint/" target="_blank">Ecological Footprint</a></h3> <p><a href="http://www.mitapp.com/en/applications2/ecological-footprint/" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/ecological-footprint.jpg" border="0" alt="Ecological Footprint" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; An application for quickly calculating a person's ecological impact&nbsp;&nbsp;with inputs like eating or traveling habits and its source can be found <a href="http://www.mitapp.com/opensource/EcoFootprint.zip" target="_blank">here</a>.</p><p>&nbsp;</p><p>&nbsp;</p> </li> <li> <h3><a href="http://zbar.sourceforge.net/iphone/" target="_blank">ZBar Barcode Reader</a></h3> <p><a href="http://zbar.sourceforge.net/iphone/" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/zbarcode.gif" border="0" alt="ZBar" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A simple demonstration for the usage of ZBar library on iPhone.</p> <p>It can scan barcodes and samples for making product searches on Google or Amazon are also included.</p><p>&nbsp;</p> </li> <li> <h3><a href="http://appremix.com/packlog/" target="_blank">PackLog</a></h3> <p><a href="http://appremix.com/packlog/" target="_blank"><img style="margin-right: 5px" src="http://www.webresourcesdepot.com/wp-content/uploads/packlog.jpg" border="0" alt="PackLog" width="200" height="113" align="left" /></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; An application for updating your Backpack status and journal entries easily.</p> <p>The developer mentions that he is not proud of the code however it is not always the good ones that we can learn from.</p><p>&nbsp;</p><p>&nbsp;</p><p>摘自：&nbsp;http://www.webresourcesdepot.com/20-open-source-iphone-applications-to-learn-from/</p> </li> </ul> </div></div>
]]>
</description>
</item><item>
<link>http://www.aslibra.com/blog/post/iOS_open_source_code.php</link>
<title><![CDATA[iOS open source code]]></title> 
<author>hqlulu &lt;hqlulu@163.com&gt;</author>
<category><![CDATA[Phone]]></category>
<pubDate>Sat, 03 Dec 2011 15:30:38 +0000</pubDate> 
<guid>http://www.aslibra.com/blog/post/iOS_open_source_code.php</guid> 
<description>
<![CDATA[ 
	<p>扫描wifi信息：</p><p><a href="http://code.google.com/p/uwecaugmentedrealityproject/">http://code.google.com/p/uwecaugmentedrealityproject/</a></p><p><a href="http://code.google.com/p/iphone-wireless/">http://code.google.com/p/iphone-wireless/</a></p><p>条形码扫描：</p><p><a href="http://zbar.sourceforge.net/iphone/sdkdoc/install.html">http://zbar.sourceforge.net/iphone/sdkdoc/install.html</a></p><p>tcp/ip的通讯协议：</p><p><a href="http://code.google.com/p/cocoaasyncsocket/">http://code.google.com/p/cocoaasyncsocket/</a></p><p>voip/sip：</p><p><a href="http://code.google.com/p/siphon/">http://code.google.com/p/siphon/</a></p><p><a href="http://code.google.com/p/asterisk-voicemail-for-iphone/">http://code.google.com/p/asterisk-voicemail-for-iphone/</a></p><p><a href="http://code.google.com/p/voiphone/">http://code.google.com/p/voiphone/</a> </p><p>three20&nbsp;http://three20.info/</p><p>google gdata</p><p><a href="http://code.google.com/p/gdata-objectivec-client/">http://code.google.com/p/gdata-objectivec-client/</a></p><p>720全景显示panoramagl</p><p><a href="http://code.google.com/p/panoramagl/">http://code.google.com/p/panoramagl/</a></p><p>jabber client</p><p><a href="http://code.google.com/p/ichabber/">http://code.google.com/p/ichabber/</a></p><p>PLBlocks</p><p><a href="http://code.google.com/p/plblocks/">http://code.google.com/p/plblocks/</a></p><p>image processing</p><p><a href="http://code.google.com/p/simple-iphone-image-processing/">http://code.google.com/p/simple-iphone-image-processing/</a></p><p>json编码解码:<a href="http://code.google.com/p/json-framework">http://code.google.com/p/json-framework</a></p><p>base64编码解码:<a href="http://code.google.com/p/google-toolbox-for-mac/source/browse/trunk/Foundation/?r=87">http://code.google.com/p/google-toolbox-for-mac/source/browse/trunk/Foundation/?r=87</a></p><p>xml解析:</p><p>安全保存用户密码到keychain中:</p><p>加载等待特效框架(private api):</p><p>http等相关协议封装:<a href="http://allseeing-i.com/ASIHTTPRequest">http://allseeing-i.com/ASIHTTPRequest</a></p><p>下拉刷新代码:</p><p>异步加载图片并缓存代码:<a href="http://www.markj.net/iphone-asynchronous-table-image/">http://www.markj.net/iphone-asynchronous-table-image/</a></p><p>iphone TTS:</p><p>iphone cook book 源码:</p><p>iphone正则表达式:<a href="http://regexkit.sourceforge.net/RegexKitLite/">http://regexkit.sourceforge.net/RegexKitLite/</a></p><p>OAuth认证:&nbsp;&nbsp;<a href="http://code.google.com/p/oauth/">http://code.google.com/p/oauth/</a><br /><a href="http://code.google.com/p/oauthconsumer/">http://code.google.com/p/oauthconsumer/</a></p><p>蓝牙协议栈:<a href="http://code.google.com/p/btstack/">http://code.google.com/p/btstack/</a></p><p>语音识别:<a href="http://www.politepix.com/openears/">http://www.politepix.com/openears/</a></p><p>ShareKit:<a href="http://www.getsharekit.com/install/">http://www.getsharekit.com/install/</a></p><p>日历控件:<a href="http://code.google.com/p/iphonecal/">http://code.google.com/p/iphonecal/</a></p><p>&nbsp;</p><p>zlib, openssl:<a href="http://code.google.com/p/ios-static-libraries/">http://code.google.com/p/ios-static-libraries/</a></p><p>地球显示信息：<a href="http://code.google.com/p/whirlyglobe/">http://code.google.com/p/whirlyglobe/</a></p>
]]>
</description>
</item><item>
<link>http://www.aslibra.com/blog/read.php/1666.htm</link>
<title><![CDATA[android反编译]]></title> 
<author>hqlulu &lt;hqlulu@163.com&gt;</author>
<category><![CDATA[Phone]]></category>
<pubDate>Sat, 03 Dec 2011 09:59:21 +0000</pubDate> 
<guid>http://www.aslibra.com/blog/read.php/1666.htm</guid> 
<description>
<![CDATA[ 
	备忘贴，详见原文：<br/><br/>Android APK反编译详解（附图）<br/><a href="http://blog.csdn.net/sunboy_2050/article/details/6727581" target="_blank">http://blog.csdn.net/sunboy_2050/article/details/6727581</a><br/><br/>Android如何防止apk程序被反编译<br/><a href="http://blog.csdn.net/sunboy_2050/article/details/6727640" target="_blank">http://blog.csdn.net/sunboy_2050/article/details/6727640</a>
]]>
</description>
</item><item>
<link>http://www.aslibra.com/blog/post/umount_fuser.php</link>
<title><![CDATA[umount的小技巧]]></title> 
<author>hqlulu &lt;hqlulu@163.com&gt;</author>
<category><![CDATA[linux]]></category>
<pubDate>Sat, 03 Dec 2011 09:56:39 +0000</pubDate> 
<guid>http://www.aslibra.com/blog/post/umount_fuser.php</guid> 
<description>
<![CDATA[ 
	umount如果提示设备忙，可以用 umount -l <br/>会立刻卸载了，但是只是df上看不到，设备还是在占用，但此时你可以挂载新设备上来了<br/>新文件读写应该都可以在新设备，要使用旧设备，可以用fuser找到占用的进程，kill掉就可以了<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">当Umount一个目录时，提示device is busy，umount加参数f，是强制执行umount，但是许多时候均不会成功。 <br/>原理上要想umount，首先要kill正在使用这个目录的进程。*假设无法卸载的设备为/dev/sdb1 <br/>1)运行下面命令看一下哪个用户哪个进程占用着此设备 <br/>fuser -m -v /dev/sdb1<br/><br/>2)运行下面命令杀掉占用此设备的进程 <br/>fuser -m -v -k /dev/sdb1 <br/>或者fuser -m -v -k -i&nbsp;&nbsp;/dev/sdb1(每杀掉一下进程会让你确认） <br/>3)再umount<br/><br/>*杀掉所有以任何形式访问文件系统 /dev/sdb1的进程： <br/>$fuser -km /dev/sdb1 <br/>这个办法是一个比较粗鲁的办法，通常适用于在测试等非正式环境。比较正规的要配合ps等命令，查出使用的用户、进程、命令等，然后做出综合判断，必要时先通知(signal或口头等)用户，确认安全时才可以强制kill此进程。 <br/>但有时fuser执行时，仍然会有报错，其实umount强制退出，可以考虑用参数l（Lazy），这个参数是比f(Force)更强大的终极命令。 <br/>Man Umount 查看f和l的参数说明如下： <br/>-f&nbsp;&nbsp;&nbsp;&nbsp; Force&nbsp;&nbsp;unmount.&nbsp;&nbsp;This&nbsp;&nbsp;allows&nbsp;&nbsp;an&nbsp;&nbsp;NFS-mounted&nbsp;&nbsp;filesystem&nbsp;&nbsp;to be unmounted if the NFS server is unreachable. Note: when using umount -f on an NFS filesystem, the <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;filesystem must be mounted using either the soft, or intr options (see nfs(5).&nbsp;&nbsp;This option&nbsp;&nbsp;will&nbsp;&nbsp;not&nbsp;&nbsp;force&nbsp;&nbsp;unmount&nbsp;&nbsp;a&nbsp;&nbsp;<A1><AE>busy<A1><AF>&nbsp;&nbsp;filesystem&nbsp;&nbsp;(use&nbsp;&nbsp;-l <br/>&nbsp;&nbsp;instead). <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Requires kernel 2.1.116 or later.)<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -l&nbsp;&nbsp;&nbsp;&nbsp; Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore. This option <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;allows a <A1><AE>busy<A1><AF> filesystem to be unmounted.&nbsp;&nbsp;(Requires kernel 2.4.11 or later.) <br/>本次操作过程如下： <br/>[root@FUHOST /]# umount /home/swebapp/apache-tomcat-5.5.17/webapps/upload/ <br/>umount: /home/swebapp/apache-tomcat-5.5.17/webapps/upload: device is busy <br/>umount: /home/swebapp/apache-tomcat-5.5.17/webapps/upload: device is busy<br/><br/>[root@FJ-WEB-02 sbin]# umount -f /home/swebapp/apache-tomcat-5.5.17/webapps/upload/ <br/>umount2: 设备或资源忙 <br/>umount: /home/swebapp/apache-tomcat-5.5.17/webapps/upload: device is busy <br/>umount2: 设备或资源忙 <br/>umount: /home/swebapp/apache-tomcat-5.5.17/webapps/upload: device is busy<br/><br/>[root@FJ-WEB-02 sbin]# fuser -km&nbsp;&nbsp;/home/swebapp/apache-tomcat-5.5.17/webapps/upload/ <br/>/home/swebapp/apache-tomcat-5.5.17/webapps/upload/: 输入/输出错误<br/><br/>[root@FJ-WEB-02 sbin]# fuser -um&nbsp;&nbsp;/home/swebapp/apache-tomcat-5.5.17/webapps/upload/ <br/>/home/swebapp/apache-tomcat-5.5.17/webapps/upload/: 输入/输出错误<br/><br/>[root@FJ-WEB-02 upload]# umount -l /home/swebapp/apache-tomcat-5.5.17/webapps/upload/</div></div><br/><br/>参考阅读<br/>1 强制Umount NFS终极手法 http://tonnyxs.blog.163.com/blog/static/27937985201102202028695/<br/>2 linux 下强制umount+Fuser命令详解 http://yangzhongfei.blog.163.com/blog/static/4610987520102311081367/
]]>
</description>
</item><item>
<link>http://www.aslibra.com/blog/post/ios_json.php</link>
<title><![CDATA[iOS上使用json]]></title> 
<author>hqlulu &lt;hqlulu@163.com&gt;</author>
<category><![CDATA[Phone]]></category>
<pubDate>Sat, 03 Dec 2011 09:51:08 +0000</pubDate> 
<guid>http://www.aslibra.com/blog/post/ios_json.php</guid> 
<description>
<![CDATA[ 
	1 SBJson <a href="http://stig.github.com/json-framework/" target="_blank">http://stig.github.com/json-framework/</a><br/><br/>2 Tutorial: JSON Over HTTP On The iPhone<br/><a href="http://mobileorchard.com/tutorial-json-over-http-on-the-iphone/" target="_blank">http://mobileorchard.com/tutorial-json-over-http-on-the-iphone/</a><br/><br/>3 code: <a href="https://github.com/dcgrigsby/luckynumbers" target="_blank">https://github.com/dcgrigsby/luckynumbers</a><br/><br/>4 iPhone上的JSON（三）JSON+UITableView<br/><a href="http://c.gzl.name/archives/tag/uitableview" target="_blank">http://c.gzl.name/archives/tag/uitableview</a>
]]>
</description>
</item><item>
<link>http://www.aslibra.com/blog/post/iphone_network_check.php</link>
<title><![CDATA[iphone里检查网络状况]]></title> 
<author>hqlulu &lt;hqlulu@163.com&gt;</author>
<category><![CDATA[Phone]]></category>
<pubDate>Fri, 02 Dec 2011 07:27:11 +0000</pubDate> 
<guid>http://www.aslibra.com/blog/post/iphone_network_check.php</guid> 
<description>
<![CDATA[ 
	Iphone里可以借助官方提供的<a href="http://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.html" target="_blank">Reachability</a>来处理<br/>1 包含官方提供的m/h文件<br/>2 包含SystemConfiguration.framework<br/><br/><div class="code">//网络检查<br/>Reachability *r = &#91;Reachability reachabilityWithHostName:@&quot;www.aslibra.com&quot;&#93;;<br/>switch (&#91;r currentReachabilityStatus&#93;) &#123;<br/>&nbsp;&nbsp;case NotReachable:<br/>&nbsp;&nbsp;&nbsp;&nbsp;// 没有网络连接<br/>&nbsp;&nbsp;&nbsp;&nbsp;NSLog(@&quot;NotReachable&quot;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;UIAlertView * alert&nbsp;&nbsp;= &#91;&#91;UIAlertView alloc&#93; initWithTitle:@&quot;Network Failed&quot; message:@&quot;Please check your connection and try again.&quot; delegate:nil cancelButtonTitle:@&quot;OK&quot; otherButtonTitles:nil &#93;;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#91;alert show&#93;;<br/>&nbsp;&nbsp;&nbsp;&nbsp;return;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;break;<br/>&nbsp;&nbsp;case ReachableViaWWAN:<br/>&nbsp;&nbsp;&nbsp;&nbsp;// 使用3G网络<br/>&nbsp;&nbsp;&nbsp;&nbsp;NSLog(@&quot;ReachableViaWWAN&quot;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;break;<br/>&nbsp;&nbsp;case ReachableViaWiFi:<br/>&nbsp;&nbsp;&nbsp;&nbsp;// 使用WiFi网络<br/>&nbsp;&nbsp;&nbsp;&nbsp;NSLog(@&quot;ReachableViaWiFi&quot;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;break;<br/>&#125;<br/><br/>//后续代码</div><br/><br/>可以参考阅读更多资料：<br/><br/>1 <a href="http://www.raddonline.com/blogs/geek-journal/iphone-sdk-testing-network-reachability/" target="_blank">iPhone SDK: Testing Network Reachability</a><br/>2 <a href="http://www.yifeiyang.net/iphone-web-development-skills-of-the-article-4-make-sure-the-network-environment-3gwifi/" target="_blank">iPhone开发技巧之网络篇（4）— 确认网络环境 3G/WIFI</a><br/>3 <a href="http://stackoverflow.com/questions/1083701/how-to-check-for-an-active-internet-connection-on-iphone-sdk" target="_blank">How to check for an active Internet Connection on iPhone SDK?</a><br/>4 <a href="http://blog.csdn.net/favormm/article/details/5352656" target="_blank">iPhone 网络连接检测(Wifi,3G,Edge)，功能有点像Reachability</a><br/>5 <a href="http://stackoverflow.com/questions/4772173/ios-iphone-reachability-how-to-only-check-when-internet-is-lost-not-reachable" target="_blank">iOS/iPhone Reachability - How to only check when internet is lost/not reachable using Reachability.m/.h</a><br/>6 <a href="http://stackoverflow.com/questions/5662298/how-to-check-network-status-in-iphone-app" target="_blank">How to check network status in iphone app?</a><br/>7 <a href="http://blog.csdn.net/koupoo/article/details/6347341" target="_blank">如何在ios中检测网络连接</a><br/>Tags - <a href="http://www.aslibra.com/blog/go.php/tags/iphone/" rel="tag">iphone</a> , <a href="http://www.aslibra.com/blog/go.php/tags/network/" rel="tag">network</a> , <a href="http://www.aslibra.com/blog/go.php/tags/sdk/" rel="tag">sdk</a>
]]>
</description>
</item><item>
<link>http://www.aslibra.com/blog/post/iphone_hjcache.php</link>
<title><![CDATA[转：iphone网络图片缓存处理代码HJCache]]></title> 
<author>hqlulu &lt;hqlulu@163.com&gt;</author>
<category><![CDATA[Phone]]></category>
<pubDate>Thu, 01 Dec 2011 16:36:40 +0000</pubDate> 
<guid>http://www.aslibra.com/blog/post/iphone_hjcache.php</guid> 
<description>
<![CDATA[ 
	<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px"><strong>HJCache is an iOS library that makes it very easy to asynchronously load images from URLs, display them in smooth scrolling tables, and cache the images in file storage.</strong>&nbsp;Think about any app that loads lots of images over the net and displays them as you use the app: eg scrolling through a list of tweets or facebook posts; swiping through a photo album from a remote server. For apps like that you want the images to load asynchronously in the background so that a slow network connection doesn&rsquo;t make the UI freeze. You also maybe want :</p><ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px"><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 18px; list-style-type: none; background-image: url('http://www.markj.net/wp/wp-content/themes/corporate/images/sidebar-list.png'); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 0% 0%; background-repeat: no-repeat no-repeat">To cache them locally so they appear faster the next time the app is used;</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 18px; list-style-type: none; background-image: url('http://www.markj.net/wp/wp-content/themes/corporate/images/sidebar-list.png'); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 0% 0%; background-repeat: no-repeat no-repeat">The cache can trim its size;</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 18px; list-style-type: none; background-image: url('http://www.markj.net/wp/wp-content/themes/corporate/images/sidebar-list.png'); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 0% 0%; background-repeat: no-repeat no-repeat">The images to be shared within the app, eg so that if you are looking at a list of posts by the same person, their profile pic is loaded and just once and the UIImage object is shared;</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 18px; list-style-type: none; background-image: url('http://www.markj.net/wp/wp-content/themes/corporate/images/sidebar-list.png'); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 0% 0%; background-repeat: no-repeat no-repeat">That interrupted downloads don&rsquo;t mess up the cache with incomplete images;</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 18px; list-style-type: none; background-image: url('http://www.markj.net/wp/wp-content/themes/corporate/images/sidebar-list.png'); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 0% 0%; background-repeat: no-repeat no-repeat">That normal memory management just works, even though an object in one place may also be shared in other places, and in different parts of the cache.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 18px; list-style-type: none; background-image: url('http://www.markj.net/wp/wp-content/themes/corporate/images/sidebar-list.png'); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 0% 0%; background-repeat: no-repeat no-repeat">Restrict use of the network to images that are on the screen now, if for example you scroll though a long table of images, the one&rsquo;s that the user scrolled past and are not off the top of the screen don&rsquo;t need to be loaded.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 18px; list-style-type: none; background-image: url('http://www.markj.net/wp/wp-content/themes/corporate/images/sidebar-list.png'); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 0% 0%; background-repeat: no-repeat no-repeat">Allow images to finish loading to the cache in some cases, even if the views they will be used in are removed because the user went back to a previous screen right away.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 18px; list-style-type: none; background-image: url('http://www.markj.net/wp/wp-content/themes/corporate/images/sidebar-list.png'); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 0% 0%; background-repeat: no-repeat no-repeat">Sometimes load a few image ahead of when they are needed, eg for a swipe through photo album.</li></ul><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px">HJCache implements all this and more. (BTW, HJCache was first called HJ Object Manager, it&rsquo;s the same things and the class names didn&rsquo;t change.)</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px"><strong>HJCache is free to use in free or paid iOS and Mac apps</strong>, and its been in use in one form or another since 2009 in several commercial iPhone apps made by us. For example we use it in our own app&nbsp;<a style="color: #3a87dd; text-decoration: none" href="http://www.focusedapps.com/">Focus for Facebook</a>.&nbsp;The basis of HJCache is explained in this blog post &lsquo;<a style="color: #3a87dd; text-decoration: none" href="http://www.markj.net/iphone-asynchronous-table-image/">Asynchronous Image Loading in UITableView</a>&lsquo;, but its come a long way since then.</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px"></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px"><strong>The design goals of this library are, in order:</strong></p><ol style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px"><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 25px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px">Make it easy to use asynchronously loaded images in iOS apps.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 25px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px">Make it easy to use a shared file cache.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 25px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px">Make memory management &lsquo;just work&rsquo; according to Cocoa norms.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 25px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px">Support typical cases of viewing images, eg scrolling through a list of tweets showing the tweeters profile pic, swiping through a photo album loaded over the net.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 25px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px">Allow the library to be used for other kinds of data too.</li></ol><h2 style="color: #222222; font-family: Calibri, Arial; text-decoration: none; margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; font-size: 20px; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #cccccc">How to Use HJCache</h2><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px">To start with, somewhere in your app initialization, you create a shared instance of the object manager&nbsp;<strong><em>HJObjManager</em></strong>, and if you want to use file caching you also create an&nbsp;<strong><em>HJMOFileCache</em></strong>&nbsp;for it to use:</p><pre style="white-space: pre-wrap; background-image: none; background-attachment: scroll; background-origin: initial; background-clip: initial; color: #222222; font-family: 'Bitstream Vera Sans Mono', Monaco, 'Andale Mono', monospace; font-size: 10px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-bottom: 0pt; margin-left: 0pt; background-position: 0px 0px; background-repeat: repeat repeat">objMan = [[HJObjManager alloc] init]; //if you are using for full screen images, you'll need a smaller memory cache: //objMan = [[HJObjManager alloc] initWithLoadingBufferSize:2 memCacheSize:2]];&nbsp;&nbsp;NSString* cacheDirectory = [NSHomeDirectory() stringByAppendingString:@&quot;/Library/Caches/imgcache/flickr/&quot;] ; HJMOFileCache* fileCache = [[[HJMOFileCache alloc] initWithRootPath:cacheDirectory] autorelease]; objMan.fileCache = fileCache; </pre><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px"><strong><em>HJManagedImageV</em></strong>&nbsp;is a subclass of UIView used for showing images that are being managed (asynchronously loaded from a url, share UIImage objects, and cache image data in files). You can use an instance of an HJManagedImageV anywhere you would normally use a UIImageView, including in Interface Builder.</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px">To get your managed image to load and display, you set its url, and then tell the object manager to manage it:</p><pre style="white-space: pre-wrap; background-image: none; background-attachment: scroll; background-origin: initial; background-clip: initial; color: #222222; font-family: 'Bitstream Vera Sans Mono', Monaco, 'Andale Mono', monospace; font-size: 10px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-bottom: 0pt; margin-left: 0pt; background-position: 0px 0px; background-repeat: repeat repeat">managedImage.url = imageUrlForCurrentRow; [self.objectManager manage:managedImage]; //NB, the library wants to be used from the main thread, so if you're not in the main thread, use: //[self.objectManager performSelectorOnMainThread:@selector(manage:) withObject:managedImage waitUntilDone:YES];</pre><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px">That&rsquo;s all there is to it! The object manager keeps track of the views&nbsp;that are using the shared UIImage objects, and as long as you do normal memory management of your managed image objects just like any other UIView, then the object manager will clean up everything once its no longer on the screen, or cache a certain number of UIImages in memory for reuse, and/or cache the images in files.</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px">Please note that HJManagedImageV is really a user of HJCache, its a class that has an object in it that&rsquo;s managed by the object manager. It won&rsquo;t do everything that everyone needs to display and interact with cached images for all apps. If it doesn&rsquo;t do what you need, just subclass and modify, or make your own version, using HJManagedImageV and the documentation in the header files to guide you. HJCache can be used for more than just images too. Again, take a look at the simple HJManagedImageV class to see how you can make your own classes that use managed objects. The hard work is done in HJObjManager, the handler and the file cache, which are all agnostic about what kind of objects they are managing. It shouldn&rsquo;t be too scary to replace HJManagedImageV with something that does what you need.</p><h2 style="color: #222222; font-family: Calibri, Arial; text-decoration: none; margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; font-size: 20px; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #cccccc">Getting HJCache</h2><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px"><strong>HJCache is up on github here:&nbsp;<a style="color: #3a87dd; text-decoration: none" href="https://github.com/markofjohnson/HJCache">https://github.com/markofjohnson/HJCache</a></strong>. The distribution includes some very simple demo apps. (Don&rsquo;t use these apps to see how to construct great looking tables with images because they don&rsquo;t demonstrate good practices for customizing UITableViewCell, but you can use them to see how to use the lib). Note, this lib isn&rsquo;t just for putting dynamically loaded images in tables, it can be used with images in any kind of view, and it can be used for non-image data too.</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px">Please respond in the comments with questions, let us know what you think, report bugs, and please post a comment telling us about your app thats using HJCache. I&rsquo;m pretty busy, so I won&rsquo;t respond to questions like &lsquo;how do I use UITableView&rsquo;. If you are a beginner, check out all the&nbsp;<a style="color: #3a87dd; text-decoration: none" href="http://www.markj.net/iphone-development-books-learning-ios-programming/">awesome books on iOS programming</a>. We (Hunter and Johnson) are a boutique consultancy providing design, programming and marketing of iOS apps, and we publish our own apps too. If you are a company building something with HJCache, we can make some consulting hours available to you if you need help.</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px">If I get time, I might write detailed documentation showing step by step how to use all the features, and how to customize the library to do really neat stuff like automagically resize images and add rounded corners. If and when I do so, the detailed documentation will probably be packaged as an ebook for sale.</p><h2 style="color: #222222; font-family: Calibri, Arial; text-decoration: none; margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; font-size: 20px; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #cccccc">Main Classes of HJ Managed Objects</h2><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px"><strong><em>HJObjManager</em></strong>&nbsp;is the object manager class. You typically make one shared instance of this class. It encapsulates all the sharing and caching. If you need separate caches that work differently or store different data you can have more than one. HJObjManager can be given an instance of a HJMOFileCache if you want to cache data in files during and between runs of the app. Internally the object manager has a list of active managed objects, ie ones that are currently being used in the app or are being loaded. It&rsquo;s a FIFO list of configurable size, its function is to limit how many shared objects are live and being loaded at once. When an object gets booted off the end of the list its loading is cancelled. This means that the object manager seamlessly deals with a large table of images where the user is quickly scrolling through many screen fulls of images and it focuses on loading the images on the screen when the user stops scrolling. This also makes it easy to do stuff like photo album viewers that load images ahead of where the user is without having to keep track of everything manually.</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px"><strong><em>HJMOFileCache</em></strong>&nbsp;does all of the file caching for the object manager. Its a separate class so that you can replace it with your own caching code if you need to. It has a trim method that can be used to limit the file cache size. Note that trimming the cache takes longer the larger the cache is. There&rsquo;s another cache class, HJMOBigFileCache, which is better if you want your cache size to be thousands of files big. It scales better because it only trims 1/10th of the cache at a time.</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px"><strong><em>HJMOUser</em></strong>&nbsp;is a protocol that is implemented by any class that has a managed object that you want to use with HJCache. You can write your own classes to be managed by implementing HJMOUser, there&rsquo;s a base class you can optionally extend: HJMOUserBase. An HJMOUser has the following responsibilities:</p><ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px"><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 18px; list-style-type: none; background-image: url('http://www.markj.net/wp/wp-content/themes/corporate/images/sidebar-list.png'); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 0% 0%; background-repeat: no-repeat no-repeat">Provide a URL for the data you want to load</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 18px; list-style-type: none; background-image: url('http://www.markj.net/wp/wp-content/themes/corporate/images/sidebar-list.png'); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 0% 0%; background-repeat: no-repeat no-repeat">Optionally provide an oid &lsquo;object id&rsquo; that is used to identify the shared data, instead of the url. The oid is useful for cases where the same data can be loaded from different urls, which is sometimes the case due to websites load balancing design.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 18px; list-style-type: none; background-image: url('http://www.markj.net/wp/wp-content/themes/corporate/images/sidebar-list.png'); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 0% 0%; background-repeat: no-repeat no-repeat">Provide a&nbsp;changeManagedObjStateFromLoadedToReady method. This method is called by the handler object to turn data loaded from the url into the actual managed object that gets shared and cached. For example, make a UIImage from an NSData. This is the mechanism that allows HJCache to manage any kind of data / object, not just UIImage.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 18px; list-style-type: none; background-image: url('http://www.markj.net/wp/wp-content/themes/corporate/images/sidebar-list.png'); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 0% 0%; background-repeat: no-repeat no-repeat">Provide&nbsp;managedObjReady and managedObjFailed methods so the HJMOUser can be told when its shared managed object is ready to use.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 18px; list-style-type: none; background-image: url('http://www.markj.net/wp/wp-content/themes/corporate/images/sidebar-list.png'); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 0% 0%; background-repeat: no-repeat no-repeat">Store a reference to an HJMOHandler object which is set by the object manager, so that in the dealloc method it can call&nbsp;[moHandler removeUser:self]; . This is necessary to make memory management within HJCache work.</li></ul><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px">To load data using the library, an instance of a HJMOUser object is made for the url you need to load from, and then its passed to a shared object manager: [myObjectManager manage:myManagedObject]; The callback methods are the called when the managed object is loaded and ready, or if there is an error.</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px"><strong><em>HJManagedImageV</em></strong>&nbsp;is an a subclass of UIView that also implements the HJMOUser protocol, and does everything needed to display UIImages with the managed object framework. HJManagedImageV can be used in Interface Builder in place of a UIView. If you want to use HJCache for images, you should probably use it or a customized version of it. Also use this class a reference if you want to use HJCache with non-image data, so you can see how to make your own HJMOUser classes.</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px"><strong><em>HJMOHandler</em></strong>&nbsp;is where much of the code is. There&rsquo;s one for every shared object and it takes care of loading data from URLs, etc. For the most part HJMOHandlers stay encapsulated inside HJObjManager, so users of the library don&rsquo;t need to worry much about them. The handlers internally use a weak mutable array of HJMOUsers that are using the shared object its handling. The handlers have references to the users, and the users have reference to the handler, but because weak references are used in the handler, HJMOUser objects will get dealloced as normal if they are coded using normal memory management practices. The dealloc method of the HJMOUser object needs to call&nbsp;[moHandler removeUser:self] so that the handler and the object manager can manage their memory. This design decouples the memory management of the shared objets from the user objects, so programmers can just treat user objects like any other objective-C object or UIView, even though there&rsquo;s some hairy shared and cached objects underneath.</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; color: #333333; font-family: Calibri, Arial; font-size: 16px">参考：http://www.markj.net/hjcache-iphone-image-cache/</p><br/>Tags - <a href="http://www.aslibra.com/blog/go.php/tags/iphone/" rel="tag">iphone</a>
]]>
</description>
</item><item>
<link>http://www.aslibra.com/blog/post/NSDictionary_allKeys.php</link>
<title><![CDATA[NSDictionary的遍历]]></title> 
<author>hqlulu &lt;hqlulu@163.com&gt;</author>
<category><![CDATA[Phone]]></category>
<pubDate>Tue, 29 Nov 2011 09:19:55 +0000</pubDate> 
<guid>http://www.aslibra.com/blog/post/NSDictionary_allKeys.php</guid> 
<description>
<![CDATA[ 
	在NSDictionary里用objectAtIndex方法不行，报错，查得此招：<br/><br/>Enumerating all the Keys and Values<br/><br/>Sometime, you need to iterate over all the key/value pairs in a dictionary. To do this, you use the method -allKeys to retrieve an array of all the keys in the dictionary; this array contains all the keys, in no particular (ie random) order. You can then cycle over this array, and for each key retrieve its value. The following example prints out all the key-values in a dictionary:<br/><br/><div class="code">void describeDictionary (NSDictionary *dict)<br/>&#123; <br/>&nbsp;&nbsp;NSArray *keys;<br/>&nbsp;&nbsp;int i, count;<br/>&nbsp;&nbsp;id key, value;<br/><br/>&nbsp;&nbsp;keys = &#91;dict allKeys&#93;;<br/>&nbsp;&nbsp;count = &#91;keys count&#93;;<br/>&nbsp;&nbsp;for (i = 0; i &lt; count; i++)<br/>&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;key = &#91;keys objectAtIndex: i&#93;;<br/>&nbsp;&nbsp;&nbsp;&nbsp;value = &#91;dict objectForKey: key&#93;;<br/>&nbsp;&nbsp;&nbsp;&nbsp;NSLog (@&quot;Key: %@ for value: %@&quot;, key, value);<br/>&nbsp;&nbsp;&#125;<br/>&#125;</div><br/><br/>As usual, this code is just an example of how to enumerate all the entries in a dictionary; in real life, to get a description of a NSDictionary, you just do NSLog (@"%@", myDictionary);. <br/><br/>原文：<a href="http://www.gnustep.it/nicola/Tutorials/BasicClasses/node27.html" target="_blank">http://www.gnustep.it/nicola/Tutorials/BasicClasses/node27.html</a><br/>Tags - <a href="http://www.aslibra.com/blog/go.php/tags/iphone/" rel="tag">iphone</a>
]]>
</description>
</item>
</channel>
</rss>
