自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(37)
  • 收藏
  • 关注

原创 PhantomReference

在java中,引用的强度有以下四个级别:1.Strong Referece 2. soft reference 3. weak reference 4 PhantomReference关于PhantomReference有以下几点需要注意:1 the PhantomReference.get() method always returns null2 another differe...

2010-06-01 13:36:07 163

summary of best practices for exception handling

The nature of Exceptionsthere are three different situations that cause exceptions to be thrown:1. Exceptions due to programming errors2. Exceptions due to client code errors3. Exceptions due ...

2010-04-29 16:53:17 155

内部类 inner class

内部类,静态类,reference to the following link:http://viralpatel.net/blogs/2009/10/inner-classes-in-java.html

2010-04-07 20:24:19 114

text file vs binary file

[url]http://www.cs.umd.edu/class/sum2003/cmsc311/Notes/BitOp/asciiBin.html[/url]

2010-03-11 21:45:53 193

LL VS LR文法

[url]http://www.panopticoncentral.net/archive/2009/03/13/24813.aspx[/url]

2010-03-06 23:44:31 279

Java 注意字符

原来JAVA中转义字符就很简单的四种:1.八进制转义序列:\ + 1到3位5数字;范围'\000'~'\377' \0:空字符2.Unicode转义字符:\u + 四个十六进制数字;0~65535 \u0000:空字符3.特殊字符:就3个 \":双引号 \':单引号 \\:反斜线4.控制字符:5个 \'...

2010-03-03 22:48:02 127

词法分析

今天项目碰到一个小问题,需要利用到词法分析。 可惜大学的时候没有好好学习编译原理啊 :? ,在网上搜索到了一篇文件,讲的很基础,大家分享一下。[url]http://www.blogjava.net/qujinlong123/archive/2007/05/08/113773.html[/url]...

2010-03-03 22:30:20 132

some links maybe useful

http://www.jarbao.com/index.htm //jar包下载中心 http://www.cn-java.com //中文Java技术网 http://java.chinaitlab.com //中国IT实验室 http://www.iteye.com //JavaEye 软件开发交流社区 http://www.qpsh.com ...

2010-03-01 14:40:41 88

Some readings in distributed systems

You can find some good readings in distributed systems on this page[url]http://bytepawn.com/readings-in-distributed-systems/[/url]

2010-02-27 18:14:17 84

原创 Some notes about disk

Disk:~100MB/S sequential writes~1.5MB/S random writes --~10ms to seek --~5ms on expensive 15k rpm disksSSD~100MB/s random writes.also ,you can find more information about disk fr...

2010-02-27 11:40:47 86

what is a thread

thread到底是什么,在程序中到底表示什么?Simply put, a thread is a program's path of execution. Most programs written today run as a single thread, causing problems when multiple events or actions need to occur at ...

2010-02-24 22:32:37 100

sleep,wait,notify in java And how to stop a thread

对于多线程之间的交互和如何有效的停止一个线程。这边文章讲的比较详细How to stop a thread or a task[url]http://forward.com.au/javaProgramming/HowToStopAThread.html[/url]对于sleep,wait, notify的讲解:[url]http://www.blogjava.net/fhtdy200...

2010-02-24 20:59:35 89

原创 Vi 打开txt文件乱码问题

.vimrc中或.exrc中设置Q:1)通常在非中文编码方式的文本中输入中文后,vi不能保存文件.错误信息如下:test.txt" 不能写入 -- 转换失败请按 ENTER 或其它命令继续2)而且删除中文字符时,总是半个半个的删除,过长的行还会显示乱码.A:在用户的home目录下的.vimrc或.exrc文件中,加入set encoding=cp936或set ...

2010-01-07 16:36:02 792

原创 字符,字节和编码

[url]http://www.regexlab.com/zh/encoding.htm[/url]

2010-01-07 15:36:27 68

原创 java 的转义字符,在正则表达式中应用

点的转义:. ==> u002E 美元符号的转义:$ ==> u0024 乘方符号的转义:^ ==> u005E 左大括号的转义:{ ==> u007B 左方括号的转义:[ ==> u005B 左圆括号的转义:( ==> u0028 竖线的转义:| ==> u007C 右圆括号的转义:) ==> u0029 星号的转义:* ==> u002A 加号的转义:+ =...

2010-01-05 14:01:56 251

原创 RPC and Serialization with Hadoop, Thrift, and Protocol Buffers

[url]http://www.cloudera.com/resources/rpc-and-serialization-in-hadoop[/url]RPC and Serialization with Hadoop, Thrift, and Protocol BuffersThis post was originally written by Tom White, publishe...

2009-12-21 11:25:15 89

原创 google protocol buffer 源码简析

protocol buffer(以下简称PB)作为一种效率和兼容性都很优秀的二进制数据传输格式,可以用于诸如网络传输,配置文件,数据存储等诸多领域。本文的分析基于google发布的源码2.0.1版本 PB的源码结构大致如下: PB源码 { PB基础库 { Message抽象层 Descriptor抽象层 ...

2009-12-17 20:57:05 185

String.Fromat

String.format中参数的形式: %[argument_index$][flags][width][.precision]conversion e.g: %1$-10.2s

2009-11-24 10:34:54 162

byte[]数组作为map的key的问题

今天coding的时候,用到了byte[]数组作为hashmap的key值,测试的时候,发现不能够根据相同的byte[],得到相应的value值,google了一下,发现,byte[]数组作为key值,只是数组的地址的引用的hashcode,不能够根据byte[]数组的内容来,创建相应的hashcode,也就是所谓的索引key。所以,如果想用byte[]数组来作为map的key值的话,有三种方法:...

2009-11-05 22:00:29 775

原创 Java tip : How to read files quickly

Java has several classes for reading files, with and without buffering, random access, thread safety, and memory mapping. Some of these are much faster than the others. This tip benchmarks 13 ways to ...

2009-10-12 20:42:12 127

原创 linux文件系统详解

原文:[url]http://www.linuxdiyf.com/blog/?69548/action_viewspace_itemid_1385.html[/url]/bin:存放着一百多个Linux下常用的命令、工具/dev:存放着Linux下所有的设备文件!/home:用户主目录,每建一个用户,就会在这里新建一个与用户同名的目录,给该用户一个自己的空间/lost+fo...

2009-09-27 11:57:22 101

原创 difference of wait ,sleep.

当调用sleep ,yield 的时候,并不释放所拥有的锁,而调用wait的时候,则释放所拥有的锁,Thread.sleep(long milliseconds): sends the current thread into Non-Runnable state for the specified amount of time. But, this doesn’t cause the th...

2009-09-24 15:28:08 102

原创 3 ways MySQL uses indexes

I often see people confuse different ways MySQL can use indexing, getting wrong ideas on what query performance they should expect. There are 3 main ways how MySQL can use the indexes for query execut...

2009-09-18 12:04:20 87

原创 Index Optimization Tips

Index Optimization Tips ***** * Consider creating index on column(s) frequently used in the WHERE, ORDER BY, and GROUP BY clauses. These column(s) are best candidates for index ...

2009-09-18 12:02:19 77

你能看出不合理的地方吗(内存方面)

// BAD CODE - DO NOT EMULATEpublic class LeakyChecksum { private byte[] byteArray; public synchronized int getFileChecksum(String fileName) { int len = getFileSize(fileName)...

2009-09-10 21:59:36 85

原创 weakReference vs softReference

weak reference A weak reference is one that does not prevent the referenced object from being garbage collected. You might use them to manage a HashMap to look up a cache of objects. A weak refer...

2009-09-10 20:49:15 50

原创 threadLocal 笔记

网上搜索的结果,实践验证后记录早在JDK 1.2的版本中就提供java.lang.ThreadLocal,ThreadLocal为解决多线程程序的并发问题提供了一种新的思路。ThreadLocal并不是一个Thread,而是Thread的局部变量,也许把它命名为ThreadLocalVariable更容易让人理解一些。当使用ThreadLocal维护变量时,ThreadLo...

2009-09-09 19:53:35 65

原创 Eclipse(3.3)技巧(二)

1。对于已经建立好的WrokSet,我们如果想直接添加或者减少其中的文件的时候,要打开Edit WrokSet来编辑,比较麻烦,现在Eclipse已经有快捷的工具栏,可以直接把Packager Explorer里面的选择的文件直接添加或除去。 2.有些用户经常编辑代码,又嫌显示器的空间不够,想把toolbar隐藏掉来扩大空间,现在Eclipse提供了这个新功能,直接再Eclipse的工具栏...

2009-09-07 11:28:20 83

原创 Eclipse(3.3)高级技巧(一)

Eclipse(3.3)高级技巧(一)1.当一个类比较大的时候,我们用鼠标滑轮往下移动的时候有时候总觉得比较慢,这时如果我们按住Ctrl键然后再滑动滚轮的时候,那么每滚一下都会翻整个页面,那么浏览的速度就大大加快了。 2.Eclipse中加入了重构脚本(Refactoring Script),如果用户经常有重复的重构的话,可以再refactor菜单里面选择Create Script可以...

2009-09-07 11:26:52 111

(NIO)just for my own reference

介绍NIO,不错的文章:http://www.ibm.com/developerworks/java/library/j-javaio/#resourcesanother good articlehttp://www.javaworld.com/javaworld/jw-09-2001/jw-0907-merlin.html?page=7#sidebar1...

2009-09-03 20:25:32 54

原创 Introduction to RPC

Chapter 2: Introduction to RPCThis chapter provides an overview of the Remote Procedure Call (RPC) model. For more information refer to your DCE publications.2.1 OverviewA Remote Procedure...

2009-09-02 16:13:09 132

原创 the difference between concurrent and parallel

The answer is simple — understanding the difference between concurrent and parallel. I believe these two terms are often used interchangeably while, in my opinion, they are represent two different con...

2009-08-27 19:45:51 105

原创 A Collection of JVM Options

A Collection of JVM Optionscompiled by: Joseph D. Mocker (Sun Microsystems, Inc.)revision: 28.Aug.2007This document is a compilation of all the JVM options for various versions of the JVM on p...

2009-08-27 19:42:53 86

原创 NIO new java I/O

http://java.sun.com/developer/technicalArticles/releases/nio/

2009-08-24 13:00:07 43

原创 characters vs bytes

Characters are NOT the same as bytes. The term character is a logical term (meaning it defines something in terms of the way people think of things). The term byte is a device term (meaning it def...

2009-08-24 12:57:07 280

原创 a SoftReference based HashMap

Implementing a SoftReference based HashMapJava is slow. Java is a memory hog.But, if I have to write a network application, I would not hesitate for a second to use Java. Why? Because Java shi...

2009-08-17 13:20:42 57

原创 JAVA 中的IO流详解及其使用方法、例子

Input和Output1. stream代表的是任何有能力产出数据的数据源,或是任何有能力接收数据的接收源。在Java的IO中,所有的stream(包括Input和Out stream)都包括两种类型:1.1 以字节为导向的stream以字节为导向的stream,表示以字节为单位从stream中读取或往stream中写入信息。以字节为导向的stream包括下面几种类型:i...

2009-07-11 22:43:36 54

空空如也

空空如也

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

TA关注的人

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