Archive for September, 2011

September 27, 2011 Leave a comment

20 JavaScript Frameworks Worth Checking Out

The number of web applications being created and used has grown rapidly since the new millenium. And importantly, so has the sheer complexity of them — specially on the front end. No more static pages, no sir!

You have a ton of sections each interacting with each other and the server and yes, it’s as complicated as it sounds and just as hard to pull off. Today, I’d like to talk about a few, choice JavaScript frameworks that aim to simplify front end application development.

Why We Need Frameworks Like These

If you think jQuery is the answer, you lose a cookie and get an F grade!

Creating responsive, fluid, and maintainable interfaces for web apps isn’t as easy as one would imagine — there is data to be sent back to the server and the results parsed, data stores to be updated, views to be re-rendered and so much else that needs to be done in the background. Desktop developers have it much easier with robust tools and well defined workflows. Us, poor web devs? We’ve been twiddling DOM elements, creating models by hand and pulling our hair out trying to keep everything synched.

The monstrous rise in the number of web apps being built recently has really made it apparent that we need better tools and frameworks and the devs have responded with a staggering amount of solutions. Today, we’re going to go over just a few of these. A couple of these are quite old but I’m certain you can learn a lot from perusing their code base.

Sure, a few of these may be a little old but their code bases have lots of lessons to teach.


Nettuts+ -- JavaScript Frameworks

Sproutcore powers a lot of high profile apps including MobileMe amongst others. Sproutcore has a steeper learning curve compared to the other options but makes up for it with developer productivity once he/she has learned the ropes.

This framework boasts a UI framework, the market standard MVC architecture and well written documentation.

Related links:


Nettuts+ -- JavaScript Frameworks

Cappuccino was created by the 280North team, now owned by Motorola. This framework gained significant coverage with the release of the 280Slides — built completely with Cappuccino.

This framework varies dramatically from the others in that a developers doesn’t need to understand or work with any of the front end trifecta — HTML, CSS or the DOM. All you need to master is the framework!

Related links:


Nettuts+ -- JavaScript Frameworks

Built on jQuery, JavaScriptMVC is a veteran in the front end frameworks battlefield, dating back to 2008. Featuring a familiar, and obvious, MVC architecture, this framework is quite full featured with support for code generators, testing and dependency management.

Related links:

Asana Luna

Nettuts+ -- JavaScript Frameworks

Luna is one of those hush-hush private frameworks that people have been talking about. And for good reason, I must admit.

The framework features a lot of niceties including an evolved MVC architecture, pubsub, caching, routing and authentication.

Related links:


Nettuts+ -- JavaScript Frameworks

Backbone supplies structure to JavaScript-heavy applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface.

Related links:


Nettuts+ -- JavaScript Frameworks

qooxdoo is a universal JavaScript framework that enables you to create applications for a wide range of platforms. With its object-oriented programming model you build rich, interactive applications (RIAs), native-like apps for mobile devices, light-weight traditional web applications or even applications to run outside the browser.

Related links:


Nettuts+ -- JavaScript Frameworks

Spine is a lightweight framework for building JavaScript web applications. Spine gives you a MVC structure and then gets out of your way, allowing you to concentrate on the fun stuff, building awesome web applications.

Related links:


Nettuts+ -- JavaScript Frameworks

ActiveJS is a JavaScript application framework that provides local and REST based data modeling and pure DOM view construction with back button and history support along with framework agnosticm and lack of external dependencies.

Related links:


Nettuts+ -- JavaScript Frameworks

eyeballs.js is a slim javascript library designed to sit on top of a javascript framework, such as jQuery or Prototype. eyeballs.js can sit on top of an already implemented web app with a well thought out object model. It can also be used to build standalone javascript apps, backed by HTML5 local storage or something like CouchDB.

Related links:


Nettuts+ -- JavaScript Frameworks

Sammy.js is a tiny JavaScript framework developed to ease the pain and provide a basic structure for developing JavaScript applications.

Sammy tries to achieve this by providing a small ‘core’ framework and an ever-growing list of plugins for specific functionality.

Related links:


Nettuts+ -- JavaScript Frameworks

Choco brings the MVC to the client side! A Choco app consists of only one HTML page, all the interactions are managed by Javascript. Your UI only uses HTML and CSS!

Related links:


Nettuts+ -- JavaScript Frameworks

Agility.js is an MVC library for Javascript that lets you write maintainable and reusable browser code without the verbose or infrastructural overhead found in other MVC libraries. The goal is to enable developers to write web apps at least as quickly as with jQuery, while simplifying long-term maintainability through MVC objects.

Related links:


Nettuts+ -- JavaScript Frameworks

Angular supports the entire development process, provides structure for your web apps, and works with the best JS libraries. With angular, the view and data model are always in sync — there is no need for manual DOM manipulation.

Angular is small, weighing in at 60kb, is compatible with all modern browsers and works great with jQuery.

Related links:


Nettuts+ -- JavaScript Frameworks

Ext JS 4 brings a whole new way to build client applications, by introducing the popular model-view-controller pattern to Ext JS. By allowing the separation of data management, logic and interface elements, Ext JS 4 makes it easier for even large development teams to work independently without worrying about stepping on each other’s toes. Ext JS 4 ships with a helpful MVC guide to get started.

Related links:


Nettuts+ -- JavaScript Frameworks

Knockout is a JavaScript library that helps you to create rich, responsive display and editor user interfaces with a clean underlying data model. Any time you have sections of UI that update dynamically (e.g., changing depending on the user’s actions or when an external data source changes), KO can help you implement it more simply and maintainably.

Related links:


Nettuts+ -- JavaScript Frameworks

Jamal is a set of conventions and small javascript libraries to archieve a complete separation of html, css and javascript in your web application. Jamal is built on jQuery and inspired by MVC frameworks like Ruby on Rails, CakePHP and its derivatives.

Related links:


Nettuts+ -- JavaScript Frameworks

PureMVC is a lightweight framework for creating applications based upon the classic Model, View and Controller concept.

Based upon proven design patterns, this free, open source framework which was originally implemented in the ActionScript 3 language for use with Adobe Flex, Flash and AIR, is now being ported to all major development platforms.

Related links:


Nettuts+ -- JavaScript Frameworks

The open source Junction framework is a conventions-over-configuration, synchronizing web MVC framework for JavaScript. TrimPath Junction is a clone or port of the terrific Ruby on Rails web MVC framework into JavaScript.

Related links:


Nettuts+ -- JavaScript Frameworks

CorMVC is a jQuery-powered Model-View-Controller (MVC) framework that can aide in the development of single-page, web-based applications. CorMVC stands for client-only-required model-view-controller and is designed to be lowest possible entry point to learning about single-page application architecture.

Related links:


Nettuts+ -- JavaScript Frameworks

batman.js is a full-stack microframework extracted from real use and designed to maximize developer and designer happiness. It favors convention over configuration, template-less views, and high performance by simply not doing very much. It all adds up to blazingly fast web apps with a great development process; it’s batman.js.

Related links:

That’s a Wrap!

And we’re done here. The number of options here might border on overdoing things at first glance but each of these are a little different in how they tackle this problem and given a problem, different solutions and choices are always a welcome addition.

As I mentioned earlier, if you think a framework should be here but isn’t, just drop us a line below and we’ll update this roundup accordingly. Thank you so much for reading!

from Nettuts+:

Categories: Uncategorized

September 26, 2011 Leave a comment


正如原作者所言,本文有标题党之嫌,但确实道出了一个众所周知的问题。就是很多NoSQL产品的官方 benchmark 过高。虽然本人并不完全同意作者的观点,但是其不盲从轻信较劲的态度还是值得学习。









#相关代码, [四号程序员]
void test_fseek_set()
    long offset;
    FILE*fp = NULL;
    long i;

    fp = fopen(FILE_NAME, "r");
        printf("Open file fail.\n");

    for(i=0; i<TIMES; i++)
        //Because random max is 1<<30 - 1
        offset = random() * 10 % MAX_FILE;
        if(fseek(fp, offset, SEEK_SET))
            printf("fseek error.\n");





#相关代码, [四号程序员]
sync; echo 3 > /proc/sys/vm/drop_caches



我有一个120GB的Tokyo Cabinet数据文件,把内存开满,它默认会用mmap,然后你会发现top中“VIRT”一列,会显示为120GB+(换算后),而我得机器内存却只有32GB。这时,当你访问恰好不在内存中的那部分数据时,操作系统会进行非常耗时的换入换出操作(首先就需要fseek等)。在这台24核、32GB的机器上,QPS勉强能达到3000(这已经远远低于标称的QPS),而一旦清空缓存,QPS会迅速跌落到70左右……


机器不是给你一个NoSQL进程服务的,很多系统其他服务都需要访问磁盘,读取文件,渐渐的就会把你Cache起来的内存全部换掉,根据实际测试的情况,一台完全闲置的机器,开TT能达到3000, 闲置放置48小时(不开其他服务), 性能就会骤降到1000左右,再放置72小时左右,就回归到70的qps了,此时Cache已经基本完全换出。






  • 1.要充分发挥NoSQL性能,并不是一定要尽量把所有数据放到内存,实际上只要保证了热数据都能装在内存中就够了。(这里的热数据,包含了索引数据及系统开销)
  • 2.作者举例中的程序,主要用了磁盘seek,磁盘的seek速度慢,原本就是磁盘物理结构的硬伤,所以许多NoSQL存储采用了变随机写为顺序写的方式,减少磁盘seek操作,也是提升IO性能的良方。









from NoSQLfan:

Categories: Uncategorized

September 23, 2011 Leave a comment


今天在bugs.php.net上, 有一个用QQ邮箱的用户发了一个问题(#55731).

他问, 为什么, 如下的代码, 会调用俩遍getter:

class Example{
    private $p1;
    private $p2;
    function __construct($a){
    function __get($elmname){
        echo "Call_get()";
        return $this->$elmname;
    function __isset($name){
        return isset($this->$name);
    function __unset($name){
$example = new Example("v1");
echo $example->p1;

一开始, 我只是简单的回答了下, 和他在__get中再次获取$this->elmname有关系. 后来这个同学又要追问原因, 我只好用我那糟糕的英语给他解释.

可能用英语没太讲明白, 我现在用中文解释下吧.

(补充: 文章发出以后, 有不少同学认为我把简单问题搞复杂了, 他们认为unset($example->p1)也会触发一次getter. 所以我先解答下这一点: “非”读”上下文不会触发对__get的调用”. 这一点也很容易验证, 大家可以试试. 要不然我也不会专门写这个文章来讨论这个问题.)

首先. 这个问题的关键原因是, unset掉一个private的变量.

在我们获取一个对象的变量(“读”上下文)的时候, 其实是首先被翻译成ZEND_FETCH_OBJ_R中间指令(opcode), 那么到了真正执行期的时候, 这条opcode会导致最终调用到zend_read_property, 我把关键代码罗列如下:

    /* make zend_get_property_info silent if we have getter - we may want to use it */
    property_info = zend_get_property_info_quick(zobj->ce, member, (zobj->ce->__get != NULL), key TSRMLS_CC);

    if (UNEXPECTED(!property_info) ||
        ((EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) &&
         property_info->offset >= 0) ?
            (zobj->properties ?
                ((retval = (zval**)zobj->properties_table[property_info->offset]) == NULL) :
                (*(retval = &zobj->properties_table[property_info->offset]) == NULL)) :
            (UNEXPECTED(!zobj->properties) ||
              UNEXPECTED(zend_hash_quick_find(zobj->properties, property_info->name,
                property_info->name_length+1, property_info->h, (void **) &retval) == FAILURE)))) {
        zend_guard *guard = NULL;

        if (zobj->ce->__get &&
            zend_get_property_guard(zobj, property_info, member, &guard) == SUCCESS &&
            !guard->in_get) {
            /* have getter - try with it! */
            if (PZVAL_IS_REF(object)) {
            guard->in_get = 1; /* prevent circular getting */
            rv = zend_std_call_getter(object, member TSRMLS_CC);
            guard->in_get = 0;


1. 首先调用zend_get_property_info_quick, 尝试在对象对应的类(zend_class_entry * zobj->ce)中寻找该属性的声明信息(public, protect, name, hash), zend_get_property_info_quick会在找不到, 或者找到了, 但是不容许访问(外部访问私有,保护变量)的时候, 返回NULL

2. 如果找到对应的属性信息, 则将依照属性信息中的属性名作为接下来查找的属性名(在PHP中, 私有属性的命名为”class_nameproperty_name″, 保护属性的命名为:”*property_name″, 公有属性的命名为”property_name″)

2. 如果没有找到相关的声明信息(未定义属性), 则尝试直接从对象的属性集中寻找(zobj_properties, 这是因为PHP是一个很灵活的语言, 你可以动态的给一个对象则加属性), 如果找到, 成功返回.

3. 如果在对象的属性集合中也没有找到, 则判断对象是否申明了__get魔术方法, 如果没有则报告找不到返回失败.

4. 如果有__get魔术方法, 为了避免发生嵌套递归, 首先查询是否已经存在该属性名的guard, 如果有判断guard->in_get是否为真, 如果为真表示发生递归了,则失败返回. 如果没有, 则设置一个名为属性名的guard(请注意这里), 然后调用__get

5. 调用__get如果找到则成功返回, 否则失败结束.

现在, 让我们来看看文章开头的例子.

1. 调用zend_read_property, zobj是$example, member是p1

2. 调用zend_get_property_info_quick查询p1属性信息, 因为此时的作用域是全局作用域, PHP不容许直接访问对象的私有属性, 所以zend_get_property_info_quick返回NULL

3. 尝试从zobj->properties中寻找p1, 因为p1被unset掉了, 所以不存在, 没找到

4. 发现$example有__get魔术方法.

5. 查找是否有为”p1″设置的guard, 没有.

6. 设置一个名为”p1″的guard, 然后调用$example->__get (输出Call_get())

7. 在$example->__get中, 我们尝试获取$this->p1, 于是再来一次::

8. 调用zend_read_property, zobj是$example, member是p1

9.调用zend_get_property_info_quick查询p1属性信息, 因为此时的作用域是example, 所以zend_get_property_info_quick返回成功

10. 将返回的属性信息中的属性名”examplep1″作为要查询的属性名

11. 尝试从zobj->properties中寻找p1, 因为p1被unset掉了, 所以不存在, 没找到

12. 发现$example有__get魔术方法.

13. 查找是否有为”examplep1″设置的guard, 没有.

14. 设置一个名为”examplep1″的guard, 然后调用$example->__get (输出Call_get())

15. 在$example->__get中, 我们尝试获取$this->p1, 于是再来一次::


16, 查找是否有为”examplep1″设置的guard, 发现有递归产生, 报告错误, 失败返回.


  • 2011/09/22, showframework writes: 没这么复杂吧..
    unset($xample->p1);echo $example->p1;
    echo 后面一次__get
  • 2011/09/22, 雪候鸟 writes: @showframework 呵呵,你可以试试unset($example->p1), 看看有没有调用…
  • 2011/09/22, wynn writes: 楼上这个说法不对,unset的执行过程中不调用__get的,这一点很容易验证,直接沿用正文这段代码,把__get里面的return那行注释掉就可以用来测试了。
  • 2011/09/22, 萝卜青菜 writes: 没细看,对象的定义中有一个变量是用来防止__set,__get方法递归调用的
  • 2011/09/22, rainkid writes: 楼主扩展研究太多了,简单的事情搞复杂了。


    echo $example->p1;


  • 2011/09/22, 雪候鸟 writes: @rainkid sigh, 发表意见前, 一定动手验证下.
  • 2011/09/23, 風之紫色 writes: 楼主说的没错,把unset($this->$name);这行注释掉,就很容易看出来了

Copyright © 2010 风雪之隅 版权所有, 转载务必注明. 该Feed只供个人使用, 禁止未注明的转载或商业应用. 非法应用的, 一切法律后果自负. 如有问题, 可发E-mail至my at Fingerprint: 73540ba0a1738d7d07d4b6038d5615e2)

Related Posts:

from 风雪之隅:

Categories: Uncategorized

September 15, 2011 Leave a comment

谷歌中国发布 Google 时惠,聚合所有大陆团购网站信息



Offer Aggregator is to aggregate all the available deals on the market, and provide a friendly interface to


虽然 Google 拥有强大的语义分析资源,但面对团购网站的花言巧语也显得力不从心。由于很多景德镇团购网站连 sitemap 都没有提供,所以初期发布的Google时惠尽管过滤比较多,但其索引到的内容精准度还比不上景德镇市场上其它的团购汇聚网站,比如百度团购,因为人家有各个团购网站的专用接口。


另外这也透露出了一个信息:谷歌中国已经开始关注本地的团购市场,那么Google Offers是否会进入中国呢?


© musiXboy 发表于 谷奥——探寻谷歌的奥秘 ( ), 2011. |
5 条评论 |
永久链接 |
关于谷奥 |
Post tags: , ,

from 谷奥——探寻谷歌的奥秘:

Categories: Uncategorized

September 15, 2011 Leave a comment

Google+ API 初出茅庐,暂时只专注于公开数据

千呼万唤始出来,今天Google+ API终于揭开了面纱,不过目前这第一步还只专注于公开数据上。




 "kind": "plus#person",
 "id": "108189587050871927619",
 "displayName": "Chris Chabot",
 "image": {
  "url": ""
 "organizations": [
   "name": "Google+ Developer Relations",
   "title": "Developer Advocate & Manager",
   "type": "work"




  • 目前的API只支持RESTful HTTP请求,通过JSON返回
  • 输出的信息为标准语法(个人信息是PoCo ,活动是
  • 使用OAuth 2安全而可信的访问用户数据

关于Google+ API的具体信息可以参考

Via Google Plus Plaform

© musiXboy 发表于 谷奥——探寻谷歌的奥秘 ( ), 2011. |
没有评论 |
永久链接 |
关于谷奥 |
Post tags: , ,

from 谷奥——探寻谷歌的奥秘:

Categories: Uncategorized

September 8, 2011 Leave a comment

《南方周末》报道,有传闻称广电总局将针对卫视娱乐节目颁发“加强版限娱令”。 “限娱令”指的是广电总局历年来针对卫视娱乐节目颁布的限令。比如省级卫视的选秀类节目“原则上每年不超过一项,每项活动播出时间不超过两个月,播出场次不超过10场,不得在黄金时段播出,每场播出时间不超过90分钟”、“电视剧一般不能超过30集(四大名著及其翻拍除外)”等,总共10条。传闻即将颁发的“加强版限娱令”,会从10条变成16条,增加了“17时至22时之间,娱乐节目每周播出不得超过三次”、“邀请港台嘉宾需严格报批手续”等等。

from Solidot:

Categories: Uncategorized

September 6, 2011 Leave a comment

Tags:iPhone  移动应用  电子商务  
from 草根网:互联网界的读者文摘:

Categories: Uncategorized