- 博客(238)
- 资源 (53)
- 收藏
- 关注
原创 PrintStream vs PrintWriter (MEMO)
http://stackoverflow.com/questions/2822005/java-difference-between-printstream-and-printwriterhttp://stackoverflow.com/questions/11372546/printstream-vs-printwriter
2014-07-11 18:01:59
232
原创 Division and modulo in C/C++, Java and Python
[quote]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.[/quote]
2013-12-19 12:58:08
247
原创 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 y...
2013-06-09 15:31:59
309
原创 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:33
299
IBM HACMP
Standby configurationsStandby configurations are the traditional redundant hardware configurations where one or more standby nodes stand idle, waiting for a server node to leave the cluster.Takeo...
2013-06-04 21:17:45
145
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:58
192
Nework
Full Duplex:http://www.intel.com/support/express/switches/sb/CS-014409.htm
2013-05-02 09:55:19
174
Hard Disk
One disk drive has only one actuator arm.Every plate has 2 surfaces to store data.Throughput: 100MB/sSeek time: 10msec (100 seeks/s)
2013-04-26 17:35:05
137
About Binary Tree
CLRS-----1) full binary tree: an ordered tree in which each internal node has degree 22) A complete k-ary tree: k-ary tree in which all leaves have the same depth and all internal nodes h...
2013-04-18 14:56:25
118
PageRank in Pig
https://github.com/yaojingguo/data-mining/tree/master/PageRank
2013-04-13 15:01:07
157
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 ...
2013-04-12 21:39:50
137
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 who...
2013-04-11 21:03:51
109
原创 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 ...
2013-04-10 13:53:25
203
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 ...
2013-03-26 16:08:17
114
原创 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 ...
2013-03-13 17:12:24
194
Canned SQL (MEMO)
http://www.simple-talk.com/sql/t-sql-programming/a-case-for-canned-sql/
2012-12-24 10:15:27
140
原创 SSH Agent Forwarding
https://help.github.com/articles/using-ssh-agent-forwardinghttp://www.unixwiz.net/techtips/ssh-agent-forwarding.html
2012-09-15 18:09:50
210
Clone a web site
Clone http://www.abc.com/refererence. Only follow links in directory /reference. wget -k -m -I /reference http://www.abc.com/refererence.
2012-07-06 15:00:31
136
Check the final definition of a typedef
Refer to http://stackoverflow.com/questions/471248/what-is-ultimately-a-time-t-typedef-to. Read Quassnoi's answer.
2012-07-04 10:43:59
109
Customize NERD Commenter
NERD_commenter.vim: \ 'c': { 'left': '// ', 'leftAlt': '/*', 'rightAlt': '*/' }, \ 'cpp': { 'left': '// ', 'leftAlt': '/*', 'rightAlt': '*/' },
2012-05-21 14:07:59
202
Turing machine
A computer architecture can be seen as a turing machine. But how to express interrupt in turing machine? I think that we can see interrupt a the flowing condition statement. This statement get exe...
2012-05-11 14:41:54
191
Usage of grep
Find error or exception in a log file: grep -i -E '((error)|(exception))' log
2012-05-07 10:05:10
98
C symbol table
C source code: #include <stdio.h>void sub(int x) {}void xiao() { static int x = 10; sub(x);}void yu(){ static int x = 20; sub(x);}int main(int argc, co...
2012-05-06 10:38:55
489
GCC options: -ffunction-sections and -fdata-sections
C code: struct person { int age; int no;};int plus_one(int no){ return no + 1;}int minus_one(int no){ return no - 1;} Run 'gcc -S -ffunction-sections -fdata-sect...
2012-05-05 11:21:16
158
Source code change effect on object code
C code: #include <stdio.h>// change no's type from int to long longlong long func(long long no) { return no + 1; }int main(int argc, const char *argv[]) { int i; i = 100...
2012-05-05 11:15:01
124
gcov tutorial
tmp.c#include <stdio.h>int main(int argc, const char *argv[]) { int i, j; for (i = 0; i < 10; i++) if (i > 100) j += 3; else j += 2; return 0;} S...
2012-05-03 21:01:43
131
x86 64 assembly tutorial (MEMO)
Refer to http://os-blog.com/x86-64-assembly-programming-hello-world/. Check /usr/include/unistd.h for system call numbers. Note that syscall numbers may be different for the same system call on 32...
2012-04-24 15:50:01
171
Multiline String in a Bash Script
#!/bin/bashTEST1=$(cat <<_EOF_Dogs and catsliving togetherThe worldUpside down_EOF_)echo "$TEST1"
2012-04-20 14:23:26
176
原创 The New C: X Macros (memo)
The code:#include <stdio.h>#define COLOR_TABLE \X(red, "red") \X(green, "green") \X(blue, "blue")#define X(a, b) a,enum COLOR { COLOR_TABLE};#undef X#defi...
2012-04-20 10:42:23
145
svn diff
Diff between differerent revisions. Example: svn diff -r 13401:13747 bi/data-integrator/src/clojure/di/di.clj Colordiff: http://www.zalas.eu/viewing-svn-diff-result-in-colors
2012-04-19 13:26:05
116
Assembly code for stack array initialization
I develop the code with x86 gcc. The C code: #include <stdio.h>void test() { int i; int array[3] = {0}; for (i = 0; i < 3; i++) printf("array[%d] = %d\n", i, arr...
2012-04-14 10:28:02
134
C array initialization
For fewer initializers, refer to 4.9 Initialization in K&R and 6.7.8 Initialization in C99 standard. #include <stdio.h>// in bss section. static storage. initialized to 0int ...
2012-04-14 10:18:35
174
Example of snprintf
#include <stdio.h>int main(int argc, const char *argv[]) { int count; int i; char buf[10]; for (i = 0; i < 10; i++) buf[i] = 1; count = snprintf(buf, 10, "%s", "abc");...
2012-04-09 18:18:33
119
Array and its first element
#include <stdio.h>struct rx_desc { int len; int status;};struct rx_desc rx_ring[2];int main(int argc, const char *argv[]) { struct rx_desc* rx; // Intialization rx_r...
2012-04-09 17:46:01
119
Struct array member
C code:#include <stdio.h>// This struct does not store jp_data: // +-+-+-+-+ // 0+-+-+-+-+ jp_len // 3 2 1 0struct zero_size_array_struct { int jp_len; ch...
2012-04-08 10:59:49
141
Relationship between union and its members
Code:#include <stdio.h>struct Nsreq_accept { int req_s;};struct Nsreq_shutdown { int req_s; int req_how;};union Nsipc { struct Nsreq_accept accept; struct Nsreq_sh...
2012-04-08 09:42:42
151
#if and #ifdef in C
#include <stdio.h>#define debug 0int main(int argc, const char *argv[]) {#if debug printf("#if\n");#endif#ifdef debug printf("#ifdef\n");#endif}
2012-04-06 22:19:12
297
Optional comma in C initialization
#include <stdio.h>struct person { int sex; int no;};int main(int argc, const char *argv[]) { int array_1[3] = {1, 2, 3}; int array_2[3] = {1, 2, 3,}; struct person xiao_y...
2012-04-06 14:09:51
112
Algorithmics: The Spirit of Computing
2009-03-10
Computer Architecture A Quantitative Approach, Fourth Edition
2008-07-27
Smart and Gets Things Done
2008-07-09
Essentials of Programming Languages Second Edition
2008-05-31
The Craft of Functional Programming, 2ed
2008-04-12
Behind Closed Doors Secrets of Great Management
2007-12-25
Hadoop: The Definitive Guide (Second Edition)
2010-10-26
The_Definitive_Guide_To_Django_2nd_Edition.pdf
2010-04-29
Discrete Mathematics and Its Applications, 6th edition
2010-02-03
Algorithms - A Functional Programming Approach
2009-12-23
Designing and Engineering Time: The Psychology of Time Perception in Software
2009-12-23
Software for Data Analysis Programming with R
2009-10-29
Natural Language Processing with Python, first edition
2009-08-09
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人