ITeye博客

小雨

yaojingguo · 共 237 篇文章

PrintStream vs PrintWriter (MEMO)

http://stackoverflow.com/questions/2822005/java-difference-between-printstream-and-printwriter http://stackoverflow.com/questions/11372546/printstream-vs-printwriter

2014-07-11 18:01 · java · 评论(0)

Division and modulo in C/C++, Java and Python

a is an integer, n is a positive integer. C/C++ quotient is rounded towards zero. a mod n = a - n (a/n) Python Same as defined by CRLS.

2013-12-19 12:58 · C/C++ · java · Python · 评论(0)

Hacking Assembly Code Generated by G++

For the following C++ code: class person { public: person() {} person(const person& rhs) {} }; void func(person p) { } int main(int argc, const char *argv[]) { person yao; func(yao); return 0; } Run "g++ -S" produces (some .cfi directives removed): .file "clean.cpp" .section .text._ZN6personC2Ev,"a…

2013-06-09 15:31 · C/C++ · 评论(0)

Synchronous vs. Asynchronous (systems)

In a synchronous system, there are bounds on: - Time of computation - Time of message deliver An asynchronous system is one that is not synchronous.

2013-06-05 16:38 · 评论(0)

IBM HACMP

Standby configurations Standby configurations are the traditional redundant hardware configurations where one or more standby nodes stand idle, waiting for a server node to leave the cluster. Takeover configurations In the takeover configurations, all cluster nodes do useful work, processing part o…

2013-06-04 21:17 · 评论(0)

How do unsynchronized values get updated in Java?

Section Visibility in http://gee.cs.oswego.edu/dl/cpj/jmm.html answesr this question.

2013-05-27 17:59 · java · 评论(0)

Nework

Full Duplex: http://www.intel.com/support/express/switches/sb/CS-014409.htm

2013-05-02 09:55 · 评论(0)

Hard Disk

One disk drive has only one actuator arm. Every plate has 2 surfaces to store data. Throughput: 100MB/s Seek time: 10msec (100 seeks/s)

2013-04-26 17:35 · 评论(0)

About Binary Tree

CLRS ----- 1) full binary tree: an ordered tree in which each internal node has degree 2 2) A complete k-ary tree: k-ary tree in which all leaves have the same depth and all internal nodes have degree k 严版数据结构 ---------- 1)满二叉树:深度为k且有2^k-1个结点的二叉树 2)完全二叉数:深度为k的,有n个结点的二叉树,当且仅当其每一个结点都与深度为k的 满二叉树中编号从1到…

2013-04-18 14:56 · algorithm · 评论(0)

PageRank in Pig

https://github.com/yaojingguo/data-mining/tree/master/PageRank

2013-04-13 15:01 · 评论(0)

Sequential Consistency Paper Reading

Lamport 1979 paper is often cited when talking about sequential consistency [1]. But the paper context is outdated. Robert Morris gives the following requirements which are together equivalent to IR1 and IR2 [2]: IR1: Every processor issues memory requests in the order specified by its program. IR2…

2013-04-12 21:39 · 评论(0)

An Application of Bubble Sort

This problem is inspired by the discussion about ordering specification, BSort in the paper "Aurora: a new model and architecture for data stream management" Problem: There is an array A whose size is n. there is a ascending sorting with some disorder in A. The disorder is specified as this: For an…

2013-04-11 21:03 · C/C++ · algorithm · 评论(0)

Oracle Logging

Oracle uses STEAL NO-FORCE logging. The following content is just my conjecture which is not proved. A log record has 2 parts: undo and redo. For Oracle, undo is treated differently. Undo data is written to pages, which in in turn triggers redo log writing. The following transaction update account'…

2013-04-10 13:53 · 评论(0)

Secondary Sort in Hadoop

I write this stuff since it confused me a lot. First, the input Iterable values for reduce method is not sorted in any order. It is mentioned on Page 277 in Hadoop: The Definitive Guide, Third Edition. Job has three methods related to second sort: setPartitionerClass setSortComparatorClass setGroup…

2013-03-26 16:08 · java · 评论(0)

How to read a reseach paper

1) Have a precise understanding of the key points. 2) Try to recite the main idea. 3) Make simple mental experiments. 4) Read other referenced papers and search google. 5) If too hard, stop. Do it again after skill grows. 6) Sometimes even the classic papers have minor errors, be prepared for it. 7…

2013-03-13 17:12 · 评论(0)