无题
看到同住的Kwoon lim正在为病怏怏Joshua煮晚餐,我称赞他说,不愧是哥们儿啊。他回答道:没什么嘛,顺手牵羊而已嘛。
Super Lazy Cat
看到同住的Kwoon lim正在为病怏怏Joshua煮晚餐,我称赞他说,不愧是哥们儿啊。他回答道:没什么嘛,顺手牵羊而已嘛。
Written by Pan Yu at 8:26 PM 3 comments
Written by Pan Yu at 5:05 PM 3 comments
Labels: cuda, gpgpu, programming
关上灯,耳机中响起《gone too soon》的旋律。歌声中夹杂的气息,呼吸声,点点的喉音,一切听起来都那么清晰,那么近,就像那个人还在耳边歌唱,还没有离去。
我们的这个时代,没有披头士,没有猫王,但是却很幸运的有MJ。他其实一直都是一个天真的孩子。只是,这个世界太复杂。May you rest in peace,默默的,祝福。
Written by Pan Yu at 8:33 PM 2 comments
Article is "statistical confidence levels for estimating error probability".
The first function calculates the confidence level (CL) given the number bit errors measured (n), the total number of bits tested (N), and the expected BER (ph).
// CL = 1 - (\Sigma^{0}_{N}(n * ph)^k/(k!)) * e^{-n * ph}
double solve_CL_from_N_n_ph(unsigned N, double n, double ph)
{
double emnp = exp(-n * ph);
double sum = 1;
double product = 1;
for(unsigned k = 1; k <= N; k++)
{
product *= (n * ph / k);
sum += product;
}
sum *= emnp;
return(1 - sum);
}
double solve_n_from_ph_CL_N(double ph, double CL, unsigned N)
{
if(N==0)
return(-log(1-CL)/ph);
else
{
// solve n using binary search, based on "solve_CL_from_N_n_ph"
double upper_n = N/ph * max(100, N), // enlarge at least 100 times
lower_n = 100000, // at least 100000 data
cur_n = upper_n, next_n;
double min_interval = 100; // minimum internal to break the search
while(1)
{
double cur_CL = solve_CL_from_N_n_ph(N, cur_n, ph);
if(cur_CL >= CL) // if calculated value is more confident, try to reduce n
{
upper_n = cur_n;
next_n = lower_n + (upper_n - lower_n)/2;
} else
{
lower_n = cur_n;
next_n = upper_n - (upper_n - lower_n)/2;
}
if(fabs(next_n - cur_n) < min_interval)
break;
cur_n = next_n;
}
return(cur_n);
}
}
Written by Pan Yu at 4:08 PM 3 comments
What's best of being an Christian?
You can do anything you want. In the end, you just confess and get forgiveness from the GOD.
Written by Pan Yu at 1:47 PM 1 comments
Ng不是not good,而是“黄”,新加坡人很多姓这个的。Ng是2个辅音字母,很多人读不出来,实际就读N。大街上老远看到一个熟人姓Ng的,大叫Mr N,喊破嗓子也听不见。哦,不对,不可能喊破嗓子。
Written by Pan Yu at 8:20 PM 1 comments
Labels: singapore
刚知道Jurong Point新开了家Fair Price,因为规模大,名字也不一样,叫X Fair Price。听起来觉得挺别扭,总觉得和ex-wife很像。遂感叹新加坡真是 昔非今比啊。
Written by Pan Yu at 2:01 PM 2 comments
Labels: singapore