自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(69)
  • 问答 (1)
  • 收藏
  • 关注

RSpec 基本语法

1. describe和contextdescribe和context方法用来组织相关的行为example。使用一个字符串作为他们的参数,以及使用一个block来定义其上下文的范围。写model的spec或者其他的unit test时,可以传一个Ruby类作为describe的第一个参数。Doing so also creates an implicit subject for the...

2012-04-18 23:53:53 366

原创 Android in Practice笔记第三章

第三章<!--[if !supportLists]-->1.      <!--[endif]-->Application生命周期每个Android的应用都有一个Application对象,我们可以使用该对象共享一些状态,即使我们不继承Application,提供自己的Application对象,Android平台也为我们提供一个默认的Applicatio...

2012-03-27 15:46:09 146

原创 Android in Practice笔记第二章

第二章 1. 给Application访问网络的权限:2. Android的权限Android的每个权限Label保护相关的资源,在应用的manifest文件里声明的users-permission节点会在用户安装应用的时候提示给用户,用户确定之后表示这些相关的权限就授权给应用了。因此,应用程序在runtime是不做相关的检查的。在应用程序中执行一个没有授权的动作时,会抛出...

2012-03-19 16:28:25 109

原创 air去除边框,及启动画面

编辑air-app.xml中<systemChrome>none</systemChrome><mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" showFlexChrome="false">showFlexChrome=f..

2011-11-03 09:56:51 191

原创 要看的电影

永无止境

2011-10-22 14:01:29 126

原创 Flash builder安装SVN插件

Flash Builder安装SVN的时候全部选择所有的软件安装会出错误。只选如下所示的软件安装即可: 

2011-10-21 13:42:53 157

原创 JQuery判断一个元素是否显示

$(element).css("display")=="none"

2011-10-19 17:56:16 86

原创 Bookmarklet

Bookmarklet ?Bookmarklet , 称呼为小书签。它是一段 JavaScript 脚本,一般网络上的小书签都是一个链接,它的安装非常简单,只需要把链接拖到你的收藏夹里。[size=10.5pt; font-family: ]将其收藏后[/size][size=10.5pt; font-family: ],[/size][size=10.5pt; font-family...

2011-10-12 21:00:42 209

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 collectio...

2011-08-19 14:55:43 354

原创 Spring mvc3 tiles

1.创建项目在eclipse里选择新建MavenProject,然后选择mave-archetype-webapp的Archetype,这样就会创建一个EclipseWTP能识别的Web项目,能够Run on server。2.修改POM                为项目加入相关的dependency,包括Spring,tiles等。2.1添加Spring的...

2011-08-05 18:09:55 92

原创 Maven+Mybatis+Spring配置之第三步:生成Mybatis Bean

1.配置pom.xml给pom.xml加Mybatis的plugin:[code="java"] org.mybatis.generator mybatis-generator-maven-plugin 1.3.0[/code]还需要Mybatis的repository,在前面已经加过了。另外,需要加一个Mybatis generator的配置文件名的prope...

2011-05-31 20:23:17 128

原创 Maven+Mybatis+Spring配置之第二步:配置Spring

1.配置Datasource:[code="java"] [/code]2.配置Mybatis:[code="java"] [/code]3.配置Mybatis:[code="java"] ...

2011-05-31 20:13:43 79

原创 Maven+Mybatis+Spring配置之第一步:配置pom.xml依赖

1.配置slfj+logback:[code="java"] org.slf4j slf4j-api ${org.slf4j.version} org.slf4j jcl-over-slf4j ${org.slf4j.version} runtime org.slf4j sl...

2011-05-31 20:04:13 161

原创 Jquery获取RadioButton选中的值

find("input[name=cron-type]:checked").val()

2011-04-12 19:53:01 568

原创 Spring的Annotation

Spring支持的JSR-250和JSR-330 (Dependency Injection for Java) 的Annotation有: @Required 检测属性是否被注入@Autowired 设置属性自动注入,还可以设置required值为@Autowired(required=false)@Resource @PostConstruct@PreDest...

2010-12-26 21:26:27 122

原创 Spring容器的扩展点

摘录自Spring文档的3.8节。[b]1.BeanPostProcessor[/b]BeanPostProcessor接口有两个方法:public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException;public Object postProc...

2010-12-26 20:54:48 141

原创 Spring中多个lifecycle定义一个bean时的调用顺序

初始化方法的调用顺序:1.@PostConstruct修饰的方法2.InitializingBean接口的afterPropertiesSet()方法3.在xml中配置的init()方法Destroy方法的调用顺序:1.@PreDestroy修饰的方法2.DisposableBean接口的destroy()方法3.在xml中定义的destroy()方法...

2010-12-26 18:00:34 157

原创 Spring3.0中对property设值的简化

1.p-namespace在Spring3.0中,使用p-namespace来简化以前对的配置。他们使用对比如下:[code="java"] [/code]这里p:spouse-ref="jane"实际上就是让叫spouse的property的value指向jane的bean...

2010-12-21 20:44:10 103

原创 搭建GAE+Flex+Spring

一、搭建开发环境1.给Eclipse安装Flex Builder插件(Flex4.0之后改为叫Flash Builder)2.给Eclipse安装Google App Engine的插件,这个在Google App Engine官方网站上能找到相关的文档。二、新建GAE项目略过,这个没什么好说的三、给GAE项目加Flex的Nature在项目名上右键==》...

2010-07-09 15:44:56 132

原创 JVM调优总结

转至【http://pengjiaheng.spaces.live.com/blog/cns!2DAA368B386E6AEA!770.entry】一、相关概念基本回收算法引用计数(Reference Counting)比较古老的回收算法。原理是此对象有一个引用,即增加一个计数,删除一个引用则减少一个计数。垃圾回收时,只用收集计数为0的对象。此算法最致命的是无法处理循环...

2010-06-21 15:46:12 87

原创 Ibatis自定义SQL传List参数

其实很简单,但是没有用过,也就没有去研究。今天被别人问起,就看了一下自动生成的Example类的代码里怎么实现in的。只需要把where条件的in后面加上如下的代码就可以了[code="java"] #key[]#[/code]这段代码一看也就明白了,就是遍历key属性里的值,分别以"("开头,")"结尾,并以逗号分隔。...

2010-06-18 15:34:55 236

原创 net use h: /delete

net use h: /delete

2010-06-09 10:09:36 454

原创 jiql----Google APP Engine里的jdbc

据说在GAE里实现的jdbc,暂时记录一下,有时间再研究研究http://www.jiql.org/

2010-05-28 13:41:51 164

原创 哈佛图书馆的二十条训言

 1.此刻打盹,你将做梦;而此刻学习,你将圆梦。  2.我荒废的今日,正是昨日殒身之人祈求的明日。  3.觉得为时已晚的时候,恰恰是最早的时候。  4.勿将今日之事拖到明日。  5.学习时的苦痛是暂时的,未学到的痛苦是终生的。  6.学习这件事,不是缺乏时间,而是缺乏努力。  7.幸福或许不排名次,但成功必排名次。  8.学习并不是人生的全部。但既然连人生的一部分―――...

2010-05-28 12:12:40 92

原创 Declarative caching for AppEngine

I really hate when my source files are bloated with lines and lines of code that do not implement any business logic at all. One of the sources of this was certainly code related to caching. Using Goo...

2010-05-24 16:20:24 100

原创 Google App Engine中使用JDO增强的问题

开始学习Google App Engine了, 在学习过程中发现一个问题,就是使用JDO的POJO没有被自动增强。这个在Google的文档中已经很清楚的描述清楚了,如果使用Google提供的Eclipse插件,他会在编译的时候自动增强JDO的POJO,但是我在做的时候怎么都没有被增强。后来发现其实每次编译的时候他都有一个DataNucleus Enhancer控制台,如果增强有错误,就会讲错误记录...

2010-05-08 01:14:06 100

执行mvn hibernate3:hbm2ddl

在学习Maven的时候,看到http://www.sonatype.com/books/maven-book/reference_zh/ch07s06.html#example_pom-for-simple-webapp运行mvn hibernate3:hbm2ddl报错,到处上网查,发现需要修改pom.xml,在hibernate3-maven-plugin里加一个true就可以了修改之...

2010-04-15 13:37:33 113

在防火墙之后使用Maven访问Repository

因为公司里需要代理才能上网,不能直接上远程的Repository,我自己搭建的私服还不怎么会用,所以特别想了解如何通过代理访问远程Repository。在Better Builds with Maven上看到的,留下做个记录在/.m2/settings.xml文件里加上[code="java"] true ...

2010-04-12 15:14:29 389

原创 Eclipse启动参数

-showlocation -vm "%JAVA_HOME%\bin\javaw.exe" -vmargs -Xms128M -Xmx512M -XX:MaxPermSize=256M

2010-01-14 10:23:49 66

原创 Rails Query Cache Context Plugin

There is a simple query cache in Rails. When you use find method to query and the query cache is active, the result will be save in a hash with the sql key. But it literally keys cached model instance...

2008-11-27 17:24:20 74

Use URLClassLoader load jar files into classpath

[code="java"]import java.io.File;import java.net.MalformedURLException;import java.net.URL;import java.net.URLClassLoader;import java.sql.Connection;import java.sql.Driver;import java.sql....

2008-03-24 21:14:57 100

ActiveRecord

1.        Table and classBydefault,Active Record assumes that the name of the table is the plural form ofthe name of the class.But you can specify the name of the table which the classis cor...

2008-01-14 15:28:24 110

Add the changing message in your java code

When you are developing a java project,you maybe want to log the history of the reason of changing your java code.You can write some comment on the head of a java file,but if there are too many files ...

2008-01-14 11:35:00 75

Migration

1、Generate migrationsl        You can use the “rubyscript/generate model model-name” command to generate model and the correspondingmigration file.l        You can also generate amigration o...

2008-01-08 10:25:58 118

Change your netbeans configuration

This method was wrote by dcaoyuan in one of his blogs.Open the nbrubyide.conf file(in etc directory) and change the default_options value to:default_options="-J-Xms32m -J-Xmx128m -J-XX:PermSize=...

2008-01-03 16:07:33 102

An interesting helper of Rails

"pluralize" is a very insteresting helper of Rails,but it may be not very useful.It can return the plural word of what you pass into it.I have tested the 'knife' word and it returned the right answer:...

2007-12-28 16:26:44 63

Thread in Ruby(1)

Thread is a very important concept in every computer language,for example in java,in c++ or in c.So Ruby have its own Thread concept.[b]Create a new Thread[/b]If you want to create a new threa...

2007-12-07 16:06:28 98

AspectR

The concept of aspect-oriented programming (AOP) is an interesting one. In AOP, we try to deal with programming issues that crosscut the modular structure of the program. In other words, some activiti...

2007-12-05 17:28:04 65

The append_features method of Module

In the same way that the class could include some singleton methods,the Module could include some singleton methods,too.But if we implement a class which include a Module which contians some singleton...

2007-12-05 15:09:18 65

Everyday OOP Tasks in <Ruby Way>

Recently,I'm reading the book.Some people said that the book is suitable for someone who have some experience in Ruby and they must be right.Because there aren't any words to explain how to develop a...

2007-12-05 11:49:58 92

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除