摘要: August 1st, 2011 by David KesslerOverviewI’ve been asked several times to explain the difference between injecting Spring beans with ‘@Resource’, ‘@Autowired’, and ‘@Inject’. While I received a few opinions from colleagues and read a couple of posts on this topic I didn’t feel like I had a complete 阅读全文
posted @ 2014-02-11 10:56 Kevin Liu Blog 阅读(774) 评论(0) 推荐(0)
摘要: 此代码仿照jquery源码中$.when()的实现function test(i) { var dfd = $.Deferred(); if(i%2 == 0) { console.log("resolve " + i); dfd.resolve(); } else { console.log("failure " + i); dfd.reject(); } return dfd.promise();}function call() { var dfd = $.Deferred(); va... 阅读全文
posted @ 2014-01-21 22:48 Kevin Liu Blog 阅读(346) 评论(0) 推荐(0)
摘要: var User = { count: 1, getCount: function() { return this.count; }};console.log(User.getCount());var func = User.getCount;console.log(func()); 这种情况下,正确的答案是1和undefined。你会很吃惊,因为有很多人被这种最基础的上下文问题绊倒。func是在winodw的上下文中被执行的,所以会访问不到count属性。我向侯选人解释了这点,然后问他们怎么样保证User总是能访问到func的上下文,即返回正即的值:1 正确的答案是使用Fun... 阅读全文
posted @ 2014-01-02 13:01 Kevin Liu Blog 阅读(230) 评论(0) 推荐(0)
摘要: 1.命令方式: 1)Create the top-level root: mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=pom-root -DarchetypeVersion=RELEASE 2)cdinto your newly created root dir 3)每一个子模块: mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArt... 阅读全文
posted @ 2013-12-13 13:22 Kevin Liu Blog 阅读(1301) 评论(0) 推荐(0)
摘要: ISO 8601國際標準化組織的国际标准ISO 8601是日期和时间的表示方法,全称为《数据存储和交换形式·信息交换·日期和时间的表示方法》。目前是第三版ISO8601:2004以替代第一版ISO8601:1988與第二版ISO8601:2000。目录1 日期表示法1.1 日历日期表示法1.2 顺序日期表示法1.3 日历星期和日表示法2 日的时间表示法3 日期和时间的组合表示法4 时间段表示法5 重复时间表示法6 對應的各地標準7 外部連結日期表示法年由4位数组成,以公历公元1年为0001年,以公元前1年为0000年,公元前2年为-0001年,其他以此类推。应用其他纪年法要 阅读全文
posted @ 2013-09-02 13:31 Kevin Liu Blog 阅读(630) 评论(0) 推荐(0)
摘要: 1. 什么是用户故事? 用户故事描述了对用户或客户有价值的功能。用户故事由以下三方面组成(3C):一份书面的故事描述,用来做计划和作为提示(Card)。有关故事的对话,用于具体化故事细节(Conversation)。测试,用于表达和编档故事细节且可用于确定故事何时完成(Confirmation)。可以用故事卡来记录用户故事,在故事卡的正面记录故事的简短描述,背面则记录测试要点。2. 什么是优秀的用户故事?优秀的用户故事应该具备以下6个特点(INVEST):独立的(Independent)。可讨论的(Negotiable)。对用户或客户有价值的(Valuable to users or cust 阅读全文
posted @ 2013-09-02 12:07 Kevin Liu Blog 阅读(541) 评论(0) 推荐(0)
摘要: Java Synchronized(转载)Java语言的关键字,当它用来修饰一个方法或者一个代码块的时候,能够保证在同一时刻最多只有一个线程执行该段代码。 一、当两个并发线程访问同一个对象object中的这个synchronized(this)同步代码块时,一个时间内只能有一个线程得到执行。另一个线程必须等待当前线程执行完这个代码块以后才能执行该代码块。 二、然而,当一个线程访问object的一个synchronized(this)同步代码块时,另一个线程仍然可以访问该object中的非synchronized(this)同步代码块。 三、尤其关键的是,当一个线程访问object的一个sync 阅读全文
posted @ 2013-05-14 13:23 Kevin Liu Blog 阅读(197) 评论(0) 推荐(0)
摘要: 转载自:http://www.cxybase.com/201011/linux%E4%B8%8B%E4%BD%BF%E7%94%A8yum%E5%AE%89%E8%A3%85mysql/查看有没有安装包# yum list mysql安装mysql客户端# yum install mysql# yum list mysql-server安装mysql 服务器端# yum install mysql-server安装过后需要启动mysql服务,我们可以通过一下两总方法:1、service mysqld start2、/etc/init.d/mysqld start启动过后需要给mysql创建一个 阅读全文
posted @ 2013-04-25 11:08 Kevin Liu Blog 阅读(149) 评论(0) 推荐(0)
摘要: Linux下安装maven (转载)1.首先到Maven官网下载安装文件,目前最新版本为3.0.3,下载文件为apache-maven-3.0.3-bin.tar.gz,下载可以使用wget命令;2.进入下载文件夹,找到下载的文件,运行如下命令解压tar-xvfapache-maven-2.2.1-bin.tar.gz解压后的文件夹名为apache-maven-3.0.33.使用mv命令将apache-maven-3.0.3文件夹拷贝到自己指定的文件夹,比如/usr/local/下mv-rfapache-maven-3.0.3/usr/local/4.配置环境变量,编辑/etc/profile 阅读全文
posted @ 2013-04-25 11:03 Kevin Liu Blog 阅读(158) 评论(0) 推荐(0)
摘要: 转载自:http://www.php100.com/html/webkaifa/javascript/2012/0405/10197.html设置cookie 每个cookie都是一个名/值对,可以把下面这样一个字符串赋值给document.cookie: document.cookie="userId=828"; 如果要一次存储多个名/值对,可以使用分号加空格(; )隔开,例如:document.cookie="userId=828; userName=hulk"; 在cookie的名或值中不能使用分号(;)、逗号(,)、等号(=)以及空格。在cook 阅读全文
posted @ 2013-03-28 14:13 Kevin Liu Blog 阅读(139) 评论(0) 推荐(0)