渴死的火烈鸟
standalone · 共 356 篇文章
How to add a favicon to your site?
Read this: http://blog.miniasp.com/post/2007/12/17/Introduce-faviconico-and-important-concept.aspx
2012-08-23 14:01 · web · 评论(0)
prepare or prepare_cached
If you are also confused about what benefits prepare_cached will bring to you like me, please read this article. http://gssg-www.stanford.edu/public/preparecached.html
2012-08-23 10:52 · perl · 评论(0)
Passing a regex pattern as a varaible in perl?
Look at this example: http://stackoverflow.com/questions/125171/passing-a-regex-substitution-as-a-variable-in-perl
2012-08-02 12:10 · perl · 评论(0)
can we create an object of an interface?
Definitely, the answer is no! But look at the code below: import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.List; public class EmployeeSort { static Comparator<Employee> NAMESORT = new Comparator<Employee>(){ public int …
2012-07-25 15:55 · java · 评论(0)
identity gap issue
http://www.sypron.nl/idgaps_txt.html Why "identity gaps" occur Identity gaps can occur following a rough server shutdown ("shutdown with nowait") or a crash of the server process. This is related to the algorithm the server uses to generate identity column values: essentially, a counter is kept in …
2012-07-24 10:59 · 评论(0)
Insufficiently Synchronized Java Code
I'm reading "Java Concurrency in Practice". Section 3.1.1 talks about it may cause surprising results when you do not provide enough synchronization to your shared variables. Take a look at the example in the book: public class NoVisibility { private static boolean ready; private static int number;…
2012-07-09 17:01 · java · 评论(0)
How to make extjs grid selectable
Ext.core.Element.prototype.unselectable = function() { var me = this; if (me.dom.className.match(/(x-grid-table|x-grid-view)/)) { return me; } me.dom.unselectable = "on"; me.swallowEvent("selectstart", true); me.applyStyles("-moz-user-select:none;-khtml-user-select:none;"); me.addCls(Ext.baseCSSPre…
2012-07-05 14:42 · javascript · 评论(0)
vim tips
I read some articles about vim tips. Now I write down the ones I have tried successfully here. 在insert模式下,C-R (register) 插入register里的内容,一个有趣的reg是"=". 假设你想输入123K的具体字节数,不用打开计算器,试试这个“ =1024*123 ”, “125952”就出来了! 另外在命令行里C-R C-W和C-R C-A是必用的技巧,它们将光标下的 和 考到命令行里,省了你无数的typing。 %用来匹配块, 如果你的光标在类似() 或者#ifdef #e…
2012-07-04 13:59 · linux · 评论(0)
how to reverse bits in a byte?
Given a 8-bit byte, assume its bits are b8b7...b1. Provide an algorithm to reverse the bit sequence. Result should be b1b2b3...b8. An simple answer: Suppose the byte is c. c=((c>>1) & 0x55) | ((c<<1) & 0xAA)); // we got 78563412 c=((c>>2) & 0x33) | ((c<<2) & 0xCC)); // we got 56781234 c=((c>>4) | (…
2012-07-03 17:59 · algorithm · 评论(0)
parallel computing vs. distributed computing
I think the explanation below by someone given on this page should be interesting... http://arstechnica.com/civis/viewtopic.php?f=18&t=185623 * Distributed computing has to be less bandwidth intensive. Therefore, the tasks have to be less co-dependent (since there is little cross-node communication…
2012-07-03 14:16 · 评论(0)
one java interview question
int f(int n){ return n*f(n-1); } System.out.print(f(100)); what's the output?
2012-07-02 18:03 · java · 评论(1)
cvs不能更新文件的权限
一个project用到了古老的cvs管理源代码。 一个文件我commit之后发现没有执行权限,于是在自己的working copy改变了文件的mode重新commit,但是发现无法更改cvs repository里面的文件执行权限。 处理办法。。。 要么去cvs里面改,要么去除这个文件,重新添加?
2012-06-28 13:07 · linux · 评论(0)
how to study hadoop?
From StackOverflow http://stackoverflow.com/questions/6385888/what-are-some-good-resources-for-studying-hadoops-source-code Studying Hadoop or MapReduce can be a daunting task if you get your hand dirty at the start. I followed the schedule as follows : Start with very basics of MR with code.google…
2012-04-27 15:34 · hadoop · 评论(0)
Perl的our变量
看了一下下面这篇文章,理解了our变量的意思。 http://www.chinaunix.net/jh/25/556778.html
2012-04-19 15:37 · perl · 评论(0)