本站首页    管理页面    写新日志    退出


«December 2025»
123456
78910111213
14151617181920
21222324252627
28293031


公告

 工作中的Janet.加油!

    生活中的Janet.i-life


我的分类(专题)

日志更新

最新评论

留言板

链接


Blog信息
blog名称:
日志总数:30
评论数量:10
留言数量:0
访问次数:86288
建立时间:2005年8月31日




[Java Tips]JOIN table
文章收藏

janetvsfei 发表于 2006/1/5 12:59:05

Tip time:

(Background: This database is used to keep track of scores for students in my classes.)

So in this case, I have three tables, one has student's "codename" (as posting their real name on the web is a no-no) and an index (there is more data in this table, but this is all you really need to know.) Then there's a table with the assignments, containing the assignment name, and an index for each assignment. Finally, there is a scores


阅读全文(1298) | 回复(0) | 编辑 | 精华 | 删除
 


[Java Tips]My Favorite (Dead) Java Boilerplate
文章收藏

janetvsfei 发表于 2005/11/17 8:59:07

In the Java platform we have tended to focus on adding lots of power and flexibility. That's great, but sometimes that power and flexibility can get in the way of doing common tasks. As part of the Ease-of-Development initiative we have been focusing on simplifying common tasks and getting rid of unnecessary boilerplate code. Here are my five of my favorite cleanups so far: #1: Opening a Text File In JDK 1.1 to 1.4, in order to open a simple text output fil


阅读全文(1592) | 回复(-1) | 编辑 | 精华 | 删除
 


[Java Tips]Java连接各种数据库的实例
网上资源

janetvsfei 发表于 2005/9/28 9:59:20



(下面还有469字)

阅读全文(1368) | 回复(0) | 编辑 | 精华 | 删除
 


[Java Tips]一段判断字符串是不是中文的代码.
网上资源

janetvsfei 发表于 2005/9/22 9:47:00

String aa = "中国China人"; 
     for (int i = 0; i < aa.length(); i++) {
     String bb = aa.substring(i, i+1); 
     //生成一个Pattern,同时编译一个正则表达式  
     boolean cc = java.util.regex.Pattern.matches("[\u4E00-\u9FA5]", bb); 
     System.out.println(bb+" is chinese?->"+cc);

阅读全文(3207) | 回复(0) | 编辑 | 精华 | 删除
 


[Java Tips]有关正则表达式
网上资源

janetvsfei 发表于 2005/9/21 16:51:13

 JAVA 正则表达式实现 JAVA正则表达式4种常用功能

阅读全文(917) | 回复(0) | 编辑 | 精华 | 删除
 


[Java Tips]java中启动本地应用程序
网上资源

janetvsfei 发表于 2005/9/9 23:37:59

(for winnt)
String docName = "c:\\someyourdir\\nameofdoc.doc";
Runtime.getRuntime().exec("cmd.exe /c "+docName);

阅读全文(927) | 回复(0) | 编辑 | 精华 | 删除
 


[Java Tips]精确截取字符串
网上资源

janetvsfei 发表于 2005/9/7 10:52:30

开发中经常遇到,字符串过长,无法完全显示的问题

这时候就需要截取我们所需要的长度,后面显示省略号或其他字符。

由于中文字符占两个字节,而英文字符占用一个字节,所以,单纯地判断字符数,效果往往不尽如人意

下面的方法通过判断字符的类型来进行截取,效果还算可以:)


如果大家有其他的解决方法欢迎贴出来,共同学习:)
**********************************************************************
private String str;
private int counterOfDoubleByte;
private byte b[];
/**
* 设置需要被限制长度的字符串
* @param str 需要被限制长度的字符串
*/
public void setLimitLengthString(String str){
  this.str = str;
}
/**
* @param

阅读全文(1714) | 回复(0) | 编辑 | 精华 | 删除
 


« 1



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.422 second(s), page refreshed 144811769 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号