发博文
个人资料
featheast
featheast
  • 博客等级:
  • 博客积分:400
  • 博客访问:40,615
  • 关注人气:72
丢丢&&揪揪

featheast小介
姓名:李羽东
学校:墨尔本大学(University of Melbourne)
专业:分布式计算(Master of Engineering in Distributed Computing)
入学时间:2008年2月
本科:华中科技大学
专业:软件工程
QQ:39003994
Email:featheast.lee@gmail.com
我要啦免费统计
图片播放器
访客
加载中…
评论
加载中…
留言
加载中…
博文
标签:

转载

中国乘客为何老爱换座位

文/迈客1979

 

三名乘客由于在南方航空班机上不听劝阻强行换座被态度强硬的机长以妨碍飞行安全为由驱逐出机仓并拒绝其返机的事件这两天引发一定范围的争议。很多人认为在这件事情上

阅读  ┆ 评论  ┆ 转载原文 ┆ 收藏 
标签:

杂谈

分类: 生活百态
本博客至今日起正式停用,新博客地址为:
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
(2008-12-05 22:15)
标签:

杂谈

分类: 痛苦学习

433-620 Engineering of Web Application

Before this semester, this subject is used to be the most difficult one which leads a consequence that many students decided not to take this one. What surprised us most is that after 4 months, this subject turns to be not only the easiest one for process, but also the easiest one for examination, even the most interesting and practical one. In Uni of Mel, subjects are more likely to prefer academic stuff, the chance to learn industry programming is more possible happended in your own room. But Steve actually gives us a wonderful series introduction of the whole are of web application. To be honestly, nobody will expect to learn a great from such a short time, but his enthusiasm and funny indeed stimulate me a lot to learn something new, and also this is a great opportunity to practice your American English, which made me believe me more American English is really simple and easy to understand. Back to the track, This subject consists of

阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
(2008-12-02 16:55)
标签:

杂谈

I am thinking about change my blogger to WordPress, anybody give some suggestions?
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
(2008-11-19 07:08)
标签:

杂谈

分类: 茫然IT
The following are general comments on the project marking:

Overall good standard of work.
Wide range of features explored in a lot of papers beyond the most  
obvious bag-of-words techniques.

But there are a few areas where lots of people made similar mistakes  
which didn't result in much of a mark reduction on their own but are  
very easy to avoid:

    Use the style file, or try and match the sample documents. At a  
minimum, you should have a two-column conference paper style layout  
and a serif font (another simple thing where people lost marks was not  
running a spell-checker before submission).
    On similar lines, try and stick to the standard conference paper  
structure (along the lines of Introduction, Background, Methodology,  
Results, Discussion) - except where it doesn't make sense - spending  
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
(2008-11-02 18:31)
标签:

it

分类: 茫然IT

今天主要的研究是关于ibatis的DAO。DAO全名是Data Access Object,有它的存在解决了数据库使用中的一个问题,就是如何面对不同的数据库资源进行相同的处理。在DAO下,规定了数据库操作的接口,于是面对不同的数据库资源,只需要分别实现相关接口就可以。提供接口API给用户能是用户更加方便的操作数据库,减少麻烦,避免一些可以避免的错误。

在使用之前,必须下载ibatis的dao包,因为在直接下载的ibatis包中是不含dao部分的。下载页面的右下角就有下载。

首先,来看一下ibatis的DAO结构,其核心就在一个dao.xml配置文件中。
<daoConfig>
 <context id='sqlmap'>
  <transactionManager type='SQLMAP'>
   <property name='SqlMapConfigResource' value='com/featheast/daobasic/SqlMapConfig.xml'/>
  </transactionManager>
  <dao interface='com.featheast.daobasic.UserDao'
   implementation='com.featheast.daobasic.UserDaoImpl'/>
 </context>
</daoConfig>

阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
标签:

it

分类: 茫然IT
在ibatis中,会发现其输入参数只能有一个,于是当出现需要进行多个输入参数的时候,就要想点办法了,我看到的有以下两种比较好的方法能够解决这个问题
1) 用String代替
<select id='checkLogin' parameterClass='java.lang.String' resultClass='java.lang.Integer'>
        SELECT count(*) AS value FROM userinfo WHERE $sql$
</select>
比如如上的map statement代码中,将输入的参数设置为String类型,而在select语句中直接使用该String,于是用户可以在Java程序代码中手工植入需要匹配的参数。

String sql = 'uid = '' + username + '' and pwd='' + password + ''';
Integer r = (Integer) sqlMap.queryForObject('checkLogin', sql);

这个方法很简单,但是弊端也很多。首先得需要用户自己手动写sql语句代码在java中,这与ibatis的本质要将数据层的操作和业务逻辑操作分隔开来是违背的。其次,这个办法可能会被利用造成sql injection的问题。比如在sql语句的最后加上一句;drop some table。这样的结果显而易见,就是灾难性的。

2)用 Map
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
标签:

it

分类: 茫然IT
今天主要对iBatis的各种SQL语句进行了一些测试,iBatis的query一共有三种形式,分别是queryForObject, queryForList, queryForMap

queryForObject返回的是一个一个单独的实例,queryForList返回的是一组实例,而queryForMap返回一个映射表

 

在使用这三个方法之前,首先需要在SqlMap文件中配置好相关的resultMap,这样才能将结果集顺利返回。也就是说,必须需要一个javaBean存在,然后是一个resultMap:

  1. <resultMap 
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
标签:

杂谈

分类: 茫然IT
这一两个星期是学期结束的时候,也是各个项目交的时候,于是大忙特忙之下,人的身体状况也不佳。而且为了machine learning,还熬了在墨尔本的第一次夜。直到现在都还没怎么缓过来。还好,现在闲下来了,离考试时间还有三个星期,闲暇之余,去图书馆逛了逛,看到 了这本崭新的iBatis in Action。很早就听说过这个持久层的框架,一般来说在你听说到Hibernate的时候,iBatis这个名字也会冒出来。一直都觉得 hibernate才是这一层里最有用的东西,就没有关心过太多iBatis,但这次看到了这本书,感觉上心动了一下,想想这几天也没什么事,书也不厚, 就借回来看看好了。于是就这样开始了我的iBatis的学习路程。

目前看了前面的三章,用eclipse小试了一把,感觉这玩意的确很小 巧实在。使用很容易,不用像其他的大型框架配置半天,它就只有一个jar,大小才376K,里面就包括了所有的东西了。这点是最吸引我的地方,毕竟小嘛, 操作容易,上手也快。的确写起来很快,虽然我目前只做了一个很小的select的实验。对于真正的JAVA调用代码,其实就只有四行:
  1.   &n
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
(2008-10-25 16:13)
标签:

杂谈

分类: 残酷就业

惊闻TX的工资已经涨到13W了,真的是比我出国前的世道好多了。看来在经济危机饱受冲击的西方堕落的同时,大中华地区的确表现的非常出色。只是我更加感受到压力了。

 

毕竟这是一笔巨大的投资,还完全不知道结果如何,想象如果当时留在图像所,会是怎么样的结果?谁都说不清楚。

 

只是唯一的想法是,不能再玩了。

阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
  

新浪BLOG意见反馈留言板 不良信息反馈 电话:4006900000 提示音后按1键(按当地市话标准计费) 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 会员注册 | 产品答疑

新浪公司 版权所有