12 2012 档案

摘要:只需要在你的HTML里加入如下的代码,就可以体验CoffeeScript了 阅读全文
posted @ 2012-12-26 13:36 卜海清 阅读(182) 评论(0) 推荐(0)
摘要:这个功能要模拟Groovy中Expando和Javascript中的{},这里要用到ruby自带的osstruct库#!C:/Ruby192/bin/ruby.exerequire 'ostruct'def mytest puts "a method"end o = OpenStruct.newo.method1 = mytesto.prop1 = "a property"puts o.method1puts o.prop1 阅读全文
posted @ 2012-12-18 06:15 卜海清 阅读(427) 评论(0) 推荐(0)
摘要:https://github.com/pivotal/jasmine-gem可参考上面的链接在Ruby中使用Jasmine,因为就是独立开发一个JavaScript的项目,所以我会使用 `jasmine init`来初始化一个项目。但当运行 `rake jasmine`的时候发现会错误产生, Google 了一下,找到一文章,试验过后发现可用。要修改对应的rakefile,多引入require 'yaml'sample case:begin require 'jasmine' require 'yaml' //自动生成的代码里是没这一行的 loa 阅读全文
posted @ 2012-12-15 10:11 卜海清 阅读(354) 评论(0) 推荐(0)
摘要:http://devnet.jetbrains.net/thread/435906?tstart=1 上面是论坛的一帖,很好的解释了如何使用。把例子下下来看看就很清楚了。 阅读全文
posted @ 2012-12-12 15:29 卜海清 阅读(226) 评论(0) 推荐(0)
摘要:The rule is: If you add a number and a string, the result will be a string!Example x=5+5;y="5"+5;z="Hello"+5;The result of x,y, and z will be:1055Hello5 阅读全文
posted @ 2012-12-12 09:35 卜海清 阅读(216) 评论(0) 推荐(0)
摘要:今天注意到JavaScript里的一个特性:一个变量被重新声明后,其之前的赋值还是存在的。var test ="test";console.debug(test) ;//output: testvar test;console.debug(test);// also output: test 阅读全文
posted @ 2012-12-12 06:16 卜海清 阅读(158) 评论(0) 推荐(0)
摘要:http://stackoverflow.com/questions/2266789/is-there-an-equivalent-of-the-nosuchmethod-feature-for-properties-or-a-way不过注意到不是所有的浏览器里都支持的。https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/noSuchMethod上面说到的可以再Firefox里跑通,但到了Chrome中就不行了。 阅读全文
posted @ 2012-12-11 10:59 卜海清 阅读(220) 评论(0) 推荐(0)
摘要:http://confluence.jetbrains.net/display/WI/Getting+Started+with+JsTestDriver+IntelliJ+plugin 阅读全文
posted @ 2012-12-06 15:37 卜海清 阅读(217) 评论(0) 推荐(0)
摘要:Link:http://msdn.microsoft.com/en-us/magazine/gg655487.aspx 阅读全文
posted @ 2012-12-06 14:49 卜海清 阅读(136) 评论(0) 推荐(0)
摘要:https://github.com/pivotal/jasmine/pull/181 阅读全文
posted @ 2012-12-06 09:01 卜海清 阅读(171) 评论(0) 推荐(0)
摘要:The operator in can be used to test whether an object has a certain property.var person = {}person.name = "buhaiqing"console.debug( "name" in person) // return : true 阅读全文
posted @ 2012-12-04 11:25 卜海清 阅读(221) 评论(0) 推荐(0)
摘要:Spock is a testing and specification framework for Java and Groovy applications. What makes it stand out from the crowd is its beautiful and highly expressive specification language.Link: http://code.google.com/p/spock/sample Maven pom.xml:http://code.google.com/p/spock/wiki/HelloSpockPom可以使用when/th 阅读全文
posted @ 2012-12-02 15:10 卜海清 阅读(1008) 评论(0) 推荐(1)
摘要:希望是能在使用Singleton模式的时候既能考虑到性能,又能延迟加载。publicclassStaticSingleton{privateStaticSingleton(){System.out.println("StaticSingletoniscreate");}privatestaticclassSingletonHolder{privatestaticStaticSingletoninstance=newStaticSingleton();}publicstaticStaticSingletongetInstance(){returnSingletonHolder 阅读全文
posted @ 2012-12-01 17:04 卜海清 阅读(167) 评论(0) 推荐(0)