ITeye博客

kuchaguangjie的博客

kuchaguangjie · 共 158 篇文章

java: lib & classpath

classpath, is the path to search for third-part or user-defined classes, refer to: * linux docs.oracle.com/javase/6/docs/technotes/tools/solaris/classpath.html docs.oracle.com/javase/6/docs/technotes/guides/extensions/extensions.html docs.oracle.com/javase/7/docs/technotes/tools/solaris/jdkfiles.ht…

2014-08-21 10:14 · J2SE · 评论(0)

Scan classes with specified annotation under specified package

Scan classes with specified annotation under specified package. steps: * define annotation * use annotation on class * get class set with specified annotations under specified packages, 2 approach: * spring (preferred) use util class from spring: ClassPathScanningCandidateComponentProvider * reflec…

2014-08-05 13:41 · J2SE · 评论(0)

ubuntu grub config

grub config for ubuntu 10.04 ~ 13.04, steps to edit: * sudo cp /etc/default/grub /etc/default/grub.bak * sudo vi /etc/default/grub do changes * sudo update-grub this will re-generate /boot/grub/grub.cfg automatically, * * ok * tip: "/boot/grub/grub.cfg" can't be edited directly,

2014-04-10 23:14 · linux & ubuntu · 评论(0)

(转) IP, TCP, and HTTP

(转自:) http://www.objc.io/issue-10/ip-tcp-http.html When an app communicates with a server, more often than not, that communication happens over HTTP. HTTP was developed for web browsers: when you enter http://www.objc.io into your browser, the browser talks to the server named www.objc.io using HTT…

2014-03-09 01:19 · http · tcp & ip · 评论(0)

change encoding of folder recusively

use shell to change encodeing of files under a folder recusively, the script use a tool called "enca", install it if not yet, there will be error info during execution, ignore that, it doesnot matter, encode_util.sh: #! /bin/bash # change encode of files to utf8 recusively # # how to use: # way 1: …

2014-03-08 17:37 · linux & ubuntu · 评论(0)

http - simple server & client

Simple http server & client implementation by pure j2se. http - client: package eric.j2se.net.http; import java.io.IOException; import java.io.InputStreamReader; import java.io.LineNumberReader; import java.io.PrintWriter; import java.net.Socket; /** * <p> * A simple http client. * </p> * * @author…

2014-01-10 11:53 · J2SE · web · 评论(0)

lucene - demo

demo - location: * download lucene there is a "demo" folder, it include a war file, * download lucene source it include source code for demo, * demo - doc: in lucene's doc, in "Getting Started" section, there is a part about demo, ------ demo - command line demo - command line, is run under command…

2013-12-04 00:56 · lucene · 评论(0)

unity - why ubuntu still using it?

I want to say **** Unity! Just bring gnome-classic back, it's so perfect, so easy to use & to do customization. You might say, you can find ways to use gnome-classic, but I want to say, if most people want to use gnome by default, why do you still put unity as default, and it's very difficult to ma…

2013-11-02 02:08 · linux & ubuntu · 评论(0)

sql - group & having example

problem: there is table store course score of students, now write a sql to query student who has at least 2 course failed, means score<60, sql: (mysql) # drop table drop table if exists score; # create table create table score( id integer AUTO_INCREMENT primary key, student_num varchar(32) not null…

2013-08-29 22:53 · db · 评论(0)

Java proxy

Java proxy proxy, a design pattern base on reflect, it handle method invocation on object with a proxy instance, ------ class & interface include: * java.lang.reflect.Proxy help to create proxy instance, * java.lang.reflect.InvocationHandler implement it to specify the proxy logic, ------ create & …

2012-12-07 18:14 · J2SE · 评论(0)

Java lock & condition

java Lock & Condition, provide a similar, yet more extensive locking mechanism than synchronized, Lock: similar to the monitor lock used by synchronized, but more powerfull, Condition: bound to lock, provide methods similar to wait()/notify()/notifyAll() of Object, ------ class & interface * Lock i…

2012-08-14 23:49 · J2SE · 评论(0)

assembly - record in file

maintain record in file using assembly, ------ table & record design a simple table which has several fields with fixed-length, the records are saved in file permanently, ------ operations on records insert: add a record to end of file, select: get a record by line number, and print it, ------ code…

2012-07-25 02:43 · assembly · 评论(0)

assembly - file

assembly operate file, ------ unix/linux file linux use the same file concept of unix, any file could be accessed as a sequential stream of bytes, step to use file: * open file open file by file path, and will get a number called file descriptor, which will be used to refer to the file later, * rea…

2012-07-15 15:13 · assembly · 评论(0)

assembly - function

function, enable program broken into pieces, so that for reuse & easy to maintain, ------ define function function is the same as normal assembly instructions, it has a label, and use ".type label_name, @function" to tell that this is a function, .type label_name, @function label_name is a label, t…

2012-07-11 14:01 · assembly · 评论(0)

视频网站 广告 屏蔽 - 彻底版

参考: http://joys.name/2011/09/block-youku-ad.html 原因: youku 放的广告太恶心了,又长又恶心,一点广告水准都没有,严重影响我看视频的心情,所以去互联网找了个方法把 优酷 阉割了, 彻底的 ... 另外 youku 老是放着放着 或者 快进之后 就突然不能放了,还得刷新,然后又是一遍广告,实在太坑爹了, ------- 屏蔽视频网站广告基本步骤 *** 在 hosts 文件中屏蔽相关 ip** hosts 文件位置: linux: /etc/hosts, windows: C:\Windows\System32\drivers\etc\ho…

2012-07-07 14:06 · other · 评论(0)