reverocean
reverocean · 共 69 篇文章
RSpec 基本语法
describe和context describe和context方法用来组织相关的行为example。 使用一个字符串作为他们的参数,以及使用一个block来定义其上下文的范围。 写model的spec或者其他的unit test时,可以传一个Ruby类作为describe的第一个参数。Doing so also creates an implicit subject for the examples. describe Timesheet do …… end describe可以嵌套 一般使用: describe Timesheet do describe “#test” do ….. …
2012-04-18 23:53 · Ruby Rails · 评论(0)
Android in Practice笔记第三章
第三章 <!--[if !supportLists]-->1. <!--[endif]-->Application生命周期 每个Android的应用都有一个Application对象,我们可以使用该对象共享一些状态,即使我们不继承Application,提供自己的Application对象,Android平台也为我们提供一个默认的Application对象。 生命周期为: <!--[if !supportLists]-->1) <!--[endif]-->onCreate在应用程序开始的时候被调用。该方法一定要实现的快。 <!--[if !supportLists]-->2) <!--[en…
2012-03-27 15:46 · Android · 评论(0)
Android in Practice笔记第二章
第二章 给Application访问网络的权限: Android的权限 Android的每个权限Label保护相关的资源,在应用的manifest文件里声明的users-permission节点会在用户安装应用的时候提示给用户,用户确定之后表示这些相关的权限就授权给应用了。因此,应用程序在runtime是不做相关的检查的。在应用程序中执行一个没有授权的动作时,会抛出SecurityException的异常。 Android的权限定义在常量Manifest.permission类里。 你也可以自定义自己的权限,然后给Intent,Activity,Service和Broadcase使用。 Re…
2012-03-19 16:28 · Android · 评论(0)
air去除边框,及启动画面
编辑air-app.xml中<systemChrome>none</systemChrome> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" showFlexChrome="false">showFlexChrome=false http://www.flexer.cn/blog/?cat=44 这是一篇来自ultravisual blog的文章,向读者讲述如何给一个AIR应用创建一个启动界面,原文地址是: http://ultravisual.co.uk/blog/20…
2011-11-03 09:56 · Flex · 评论(0)
Flash builder安装SVN插件
Flash Builder安装SVN的时候全部选择所有的软件安装会出错误。 只选如下所示的软件安装即可:
2011-10-21 13:42 · Flex · 评论(0)
Bookmarklet
Bookmarklet ? Bookmarklet , 称呼为小书签 。它是一段 JavaScript 脚本,一般网络上的小书签都是一个链接,它的安装非常简单,只需要把链接拖到你的收藏夹里。将其收藏后,即可按其内容直接当功能按钮使用。 Bookmarklets are simple tools that extend the surf and search capabilities of Firefox and Explorer web browsers. Bookmarklets allow you to: Modify the way you see someone else's web…
2011-10-12 21:00 · JavaScript · 评论(0)
Mybatis中传入List条件
传入一个map的参数,map里有一个tenantIds的List,在xml里先判断这个List的size是否大于o,然后通过foreach 构造一个in后面括号里的元素,具体的xml如下: <if test="tenantIds.size() > 0"> AND A.PROC_TARGET_ID IN <foreach collection="tenantIds" item="tenantId" open="(" separator="," close=")"> #{tenantId} </foreach> </if>
2011-08-19 14:55 · Mybaits · 评论(1)
Spring mvc3 tiles
1.创建项目 在eclipse里选择新建Maven Project,然后选择mave-archetype-webapp的Archetype,这样就会创建一个Eclipse WTP能识别的Web项目,能够Run on server。 2.修改POM 为项目加入相关的dependency,包括Spring,tiles等。 2.1添加Spring的依赖 <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${org.springframework.ve…
Maven+Mybatis+Spring配置之第三步:生成Mybatis Bean
1.配置pom.xml 给pom.xml加Mybatis的plugin: <plugin> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-maven-plugin</artifactId> <version>1.3.0</version> </plugin> 还需要Mybatis的repository,在前面已经加过了。另外,需要加一个Mybatis generator的配置文件名的property: <mybatis.generator.configurationFile>generatorCo…
2011-05-31 20:23 · Spring · 评论(0)
Maven+Mybatis+Spring配置之第二步:配置Spring
1.配置Datasource: <bean id="dataSource" class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close"> <property name="driverClass" value="${jdbc.driverClassName}" /> <property name="jdbcUrl" value="${jdbc.url}" /> <property name="username" value="${jdbc.username}" /> <property name="password" va…
2011-05-31 20:13 · Spring · 评论(0)
Maven+Mybatis+Spring配置之第一步:配置pom.xml依赖
1.配置slfj+logback: <!-- Logging --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>${org.slf4j.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> <version>${org.slf4j.version}</version> <scope>runt…
2011-05-31 20:04 · Spring · 评论(1)
Spring的Annotation
Spring支持的JSR-250和JSR-330 (Dependency Injection for Java) 的Annotation有: @Required 检测属性是否被注入 @Autowired 设置属性自动注入,还可以设置required值为@Autowired(required=false) @Resource @PostConstruct @PreDestroy @Inject 和@Autowired一样,除了不能设置required的值,不过它是JSR-330的Annotation。 @Qualifier 和@Autowired一起使用,在使用@Autowired的type时…
2010-12-26 21:26 · Spring · 评论(0)