星期一, 十月 31, 2011

星期二, 十月 25, 2011

物理之歌

作者:牛肉汤

作者按:看到北大周其凤校长的"化学是什么", 觉得需要更多的人站出来参加科普. 抛砖引玉, 贡献一首 "物理之歌". 见笑, 欢迎指正...

星星闪动眼睛
光在空气中穿行,
十字路口, 为什么绿行红停?
手机接收信息,
电子被电波感应,
良好的导线, 为什么非铜即银?
玉指拨动琴弦,
微风吹响风铃,
"焦桐", "绿绮", 为什么音色动听?
物理让我们了解自然,
不再迷信.
物理让我们创造发明,
不断前行.

冰箱冷藏食品,
铁碳组成合金,
地球变暖, 为什么有温室效应?
动车呼啸而过,
高桥斜拉钢索,
神州火箭, 为什么能力达天庭?

硬盘存储数据,
磁铁相互吸引,
信用卡里, 为什么有我们的姓名?
物理让我们了解自然,
不再迷信.
物理让我们创造发明,
不断前行.

按:虽然以前学的那点东西都忘了,但至少学那些东西让我感到快乐。

星期六, 十月 22, 2011

孔丘的出身

上个月我称孔丘为孔老二,有几个博士候选人于是对我极不满,就如同我掘了他们的祖坟一样。当然那些人对我不满也有其他的原因。今天有闲,俺就聊一聊这位所谓的“圣”。此是其一。

星期五, 十月 21, 2011

Fedora LaTeX CJK

I wrote some scripts to utilize true type Chinese fonts (ttf) in LaTeX. They have made life much easier for those who are struggling to make CJK work on their Fedora systems.

星期四, 十月 13, 2011

G-matrix 一二

花了点时间写了一个计算利用SNP基因型计算G-matrix(Yang et al, Nature Genetics 2010)的程序。

一如既往,我写的该程序超级快。小数据量时很容易通过,但是大数据量总是会产生各种意想不到的问题;LAPACK Cholesky 分解遇到非正定不给出错信息,一定注意;最令我惊奇的是作为一个方差-协方差矩阵,我模拟了很多组数据,居然没有一个是正定的。看来不知道哪里出了很有意思的问题。

星期二, 十月 11, 2011

Internal error: 0_13171

I was reading two large matrices to multiply them later.

The code:
#include<iostream>
#include<fstream>
#include<iomanip>

using namespace std;
int main(int argc, char*argv[])
{
  const int nid(13276);
  const int len(nid*nid);
  double gmat[len], ginv[len], prod[len];
  int iid, jid, ii;
  ifstream fge("rst");

  fge>>iid;
  for(iid=ii=0; iid<nid; ++iid)
    for(jid=0; jid<nid; ++jid)
      fge>>gmat[ii++];

  for(iid=ii=0; iid<nid; ++iid)
    for(jid=0; jid<nid; ++jid)
      fge>>ginv[ii++];

  return 0;
}
Then I got an error message when compiling it with icpc:
test.cpp(8) (col. 1): internal error: 0_13171
compilation aborted for test.cpp (code 4) 
Commenting out any one of the two reading blocks will eliminate the error.

This error turned out to be a bug of an old version of Intel compiler icpc (12.0.5 20110719).  Upgrade to the current version (12.1.0 20110811) will solve the problem.

星期六, 十月 08, 2011

The Puzzle of Pancreatic Cancer: How Steve Jobs Did Not Beat the Odds—but Nobel Winner Ralph Steinman Did

Despite having the same name, the diseases that killed Apple co-founder Steve Jobs and 2011 Nobel laureate Ralph Steinman are different kinds of cancer. Researchers are looking for new ways to diagnose and treat both

Full story is here

星期五, 十月 07, 2011

超新星与暗能量的发现--今年诺贝尔物理奖工作的介绍

陈学雷

今年的诺贝尔物理奖授予了三位在发现宇宙加速膨胀的研究中做出杰出贡献的学者:Perlmutter, Schmidt和Riess。应该说,由于这项工作无可争辩的巨大重要性,几年来他们一直是获奖的热门人选。但是,导致宇宙加速膨胀的暗能量是什么仍是一个未解决的问题,而相关的许多理论和观测还处在研究的前沿,存在许多疑问和争论,诺贝尔奖评委会素有稳重、保守的传统,所以我原以为他们还要再过若干年才会获奖。因此,作为一名宇宙学研究者,我为他们今年获得这项殊荣感到非常高兴。

星期一, 十月 03, 2011

工作心得之二

Business management and file organization are never exaggerated for my work efficiency.  I currently use org-mode quite a lot.  I will keep on using it till the end maybe.  A screen shot is put below.  More explanations will be added later if I have time.


Pdf file to text

A friend of mine asked me how to convert pdf file to text.  There are plenty of tools in Linux world.  Two situations need to be considered.