高山流水
msgbartop
动之则分,静之则合,无过不及,随曲就伸。
msgbarbottom

12 五 09 Tears in Heaven

Tears in Heaven

Eric Clapton

Would you know my name
If I saw you in heaven?
Would you be the same
If I saw you in heaven?
I must be strong and carry on,
Because I know I don’t belong here in heaven.

Would you hold my hand
If I saw you in heaven?
Would you help me stand
If I saw you in heaven?
I’ll find my way through night and day,
Because I know I just can’t stand here in heaven.

Time can bring you down,
Time can bend your knees,
Time can break your heart.
Have you begging please,
Begging please.

Beyond the door there’s peace I’m sure
And I know there’ll be no more tears in heaven.

Would you know my name
If I saw you in heaven?
Would you be the same
If I saw you in heaven?
I must be strong and carry on,
Because I know I don’t belong here in heaven.

Tags: , ,

14 四 09 某师兄贴出来的辞职信

尊敬的XX馆长:  
 
  天要下雨,娘要嫁人,生死有命,富贵在天。本来我想在培养我的XX图书馆里工作终老,但是生活是残酷的,巨大的生活压力迫使我抬起头来,去遥望那碧蓝的天空。这时,我多么羡慕那自由飞翔的小鸟,还有那些坐得起飞机的人啊。每个月的开头,我会满心欢喜的拿着微薄的工资去还上个月的欠债,每个月的月中,我为了省钱会努力勒紧裤带,重复性的,每个月末,生活的本色就变成了借钱和躲债。

  人比人气得死人。这是句俗话,但确实是亘古不变的真理。看着身边一个个兄弟都出口了,这心里跟火烧似的。看着周围的朋友们每月拿着10K的工资,15%的房贴,车贴,5、6百的高温费,几万的年终奖金,这心里就琢磨着,这人与人的差距咋就这么大捏?

  人生数年,弹指一挥间。是的,馆里有培训计划,有培养机制,会尽量把每一位员工培养成为有理想,有道德,有文化,有纪律的四有馆员,职称会升的,工资会涨的,面包会有的,老婆会从天上掉下来的。可俺就想不明白,咋图书馆培养我一个五年计划都过去了,我的一切还是原地踏步捏?

  佛曰:一枯一荣,皆有定数。圣经上说:欠着我的,我会记下。梁朝伟说:出来混,总归是要还的。主席说:哪里有压迫,哪里就有反抗。小平同志说:贫穷不是社会主义。电视上也说:要爽靠自己。

  因此本人因为个人原因,决定离开已经服务多年的XX图书馆。请求馆长批准。

            XXX
          XXXX年XX月XX日

Tags: , ,

14 四 09 打架

MM:我昨晚看电视,男女朋友吵架,那女孩子一生气就用烟灰缸把男孩子敲得头破血流。
GG:很正常啊!
MM:但我觉得打架这样太残忍了,都血流满面了好恐怖。
GG:那打架了肯定是这样啦。男孩子难免吃亏的。
MM:要是我,肯定不会这么干。
GG:嗯~
MM:直接拿把刀子杀死了就好了,干嘛要打得那么疼。
GG:……

13 四 09 收藏:笨也是一个好办法——一个简体转换成繁体的javabean

找了好长一段时间,原文请参考以下地址:

java 实现繁简字体转换(笨方法):http://www.javaeye.com/topic/261542?page=1

javabean:gb2big.java

// Created on 2009-4-13

package util;
public class gb2big
{
String shortChar = “万与丑专业丛东丝….”; //这里输出不完,请从网上的javascript找到完整字库
String longChar = “萬與醜專業叢東絲….”;

public String gb2big(String str)
{
String outputStirng = “”;
for (int i = 0; i < str.length(); i++)
{
if(shortChar.indexOf(str.charAt(i)) != -1)
{
outputStirng += longChar.charAt(shortChar.indexOf(str.charAt(i)));
}
else
{
outputStirng += str.charAt(i);
}
}
return outputStirng;
}
}

测试页面:test.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="java.*"%>
<%@ page import="util.*"%>






<%
String s="万二";
s = gb2big.gb2big(s);
out.print(s);
%>


Tags: , , , , , , , ,

11 四 09 tomcat5.5配置mysql连接池加简单的连接javabean以及测试jsp

tomcat和resin有些许不同,简单的记录一下,高手请随便飘过……

一、配置:

1、拷贝连接mysql的jar包mysql-connector-java-3.1.10-bin.jar到tomcat安装目录下的common/lib/目录下。

2、打开tomcat安装目录下的conf目录,分别修改server.xml、web.xml和context.xml文件:

2.1、在server.xml中,找到,在其前面加入:

type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
maxIdle="2"
maxWait="5000"
username="username" //usernam为连接mysql的账号
password="password" //password为该账号密码
url="jdbc:mysql://localhost:3306/db?autoReconnect=true" //db为数据库名称
maxActive="4"/>

2.2、在web.xml中,在最后之前,加入:


DB Connection
jdbc/mysql
javax.sql.DataSource
Container


2.3、在context.xml(当然也有可能是在conf/Catalina/localhost/下的虚拟目录配置文件)中,找到,在其后面加入:



即可完成配置。

二、简单的连接javabean(放在classes/myPool文件夹下,命名为mysqlpool.java):


/*
* Created on 2009-4-10
* yuanxinz@gmail.com
*/
package myPool;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;

public class mysqlpool {

private javax.sql.DataSource pool;

public mysqlpool()
{
try
{
InitialContext ctx=new InitialContext();
pool=(DataSource)ctx.lookup(”java:comp/env/jdbc/mysql”);
}
catch(Exception e)
{
System.err.println(”Exception error:”+e.getMessage());
}
}

/**
* @return
*/
public javax.sql.DataSource getPool() {
return pool;
}
}

三、测试jsp:

<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="java.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="myPool.*"%>



<%
String strSql;
Connection cn = myPool.getPool().getConnection();
PreparedStatement ps;

strSql = "SELECT id from tmp";
ps=cn.prepareStatement(strSql);
rs =ps.executeQuery();
while(rs.next())
{
out.print(rs.getString("id"));
}
rs.close();
ps.close();
rs=null;
ps=null;
cn.close();
cn=null;
%>


Tags: , , ,