Friday, September 7, 2012

Error: /usr/bin/ld: cannot find -lncurses

I was working with genometools with HMMER enabled. While compiling, I got the following error message:

$ make with-hmmer=yes threads=yes cairo=no
[check for HMMER3]
[build HMMER3]
[compile pdom.o]
[link libgenometools.a]
[link libgenometools.so]
[link skproto]
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make: *** [bin/skproto] Error 1

I checked that libncurses5 was already installed and updated. Anyway, I did
sudo apt-get install libncurses5-dev

again, but the error message was still there. Then I found a post (#23) on https://groups.google.com/group/android-building/tree/browse_frm/month/2010-10/6579583604439ab9?rnum=21&_done=/group/android-building/browse_frm/month/2010-10?&pli=1 and followed the suggestion and did 

sudo apt-get install lib32ncurses5-dev 

Now the error message is gone.

Sunday, July 8, 2012

Remote access ubuntu 11.10 from mac

http://mlepicki.com/2011/10/remote-vnc-login-to-ubuntu-11-10/



Remote VNC login to Ubuntu 11.10


Today I’ve installed Ubuntu 11.10 Oneiric Ocelot on my ASrock 100HT nettop. I’ve wanted to remotely control this box via VNC protocol.
My solution was x11vnc server, so I could share one one session between remote and physical access. I’ve found useful thread about x11vnc on Ubuntu 11.10 – I’ve just added some upstart magic to start x11vnc after lightdm.
First of all, I’ve installed x11vnc:
apt-get install x11vnc
Then, I’ve created /etc/init/x11vnc.conf file:
start on login-session-start
script
x11vnc -xkb -noxrecord -noxfixes -noxdamage -display :0 -auth /var/run/lightdm/root/:0 -forever -bg -o /var/log/x11vnc.log
end script
After restart, x11vnc shoud listen on vnc startard port – 5900.
This script is of course based on upstart event mechanism. Lightdm emits login-session-start event (you can find it in lightdm.conf), and we start x11vnc when this event is emited – that’s first line of x11vnc.conf file.



Then, here is a youtube video showing step by step how to use vnc viewer to connect to the ubuntu machine.
http://www.youtube.com/watch?v=GY75u6TthH4

Sunday, June 24, 2012

Compile BLAT on x86_64 Ubuntu 10.04



http://defsci.blogspot.com/2011/02/compile-blat-on-x8664-ubuntu-1004.html

Compile BLAT on x86_64 Ubuntu 10.04

Recently I needed to compile BLAT for x86_64 on Ubuntu 10.04 server. The BLAT pre-compiled binaries for linux are 32-bit. Here is how you do it:



  1. apt-get install build-essential
  2. Download  BLAT source
  3. remove the -Werror compiler flag to treat warnings as errors
  4. mkdir -p ~/bin/x86_64
  5. export MACHTYPE=x86_64
  6. make
Step (3) above requires editing the /inc/common.mk file, line 17 goes from     


HG_WARN_ERR = -DJK_WARN -Wall -Werror


to 

HG_WARN_ERR = -DJK_WARN -Wall

Make places the executables into ~/bin/x86_64 directory. Either add this to $PATH or copy the files to /usr/local/bin

Saturday, June 9, 2012

book notes

Chimps can pick up human sign language, teach it to younger chimps, and create new combinations of the signs to refer to new objects. They have "cross-modal transfer of information", i.e. relating their perception of an object through touching with things they see later. They have a long span of memory. They have concept of self. They can make plans, making tools for eating termites much before they find a termite mound.

Sunday, May 27, 2012

Multiple page pdf in latex

 Use this package to include multiple pages from one pdf file in latex document.

http://ctan.org/pkg/pdfpages

买车记

周六和Iris一起到Sudeep家做午饭吃,I同学做了Shakshuka , 我做了第三鲜,S同学做了用lentil熬的糊糊。S同学多才多艺, 弹吉他,唱歌,钢琴等等,他还介绍我们看了好多印度舞蹈,据说共有9种民族舞蹈,北方占一种,主要动作就是穿着长裙不停旋转,南方占8种,有一种舞蹈看起来特喜庆,就是和着节奏用一种步伐蹦来蹦去,群体舞蹈还能摆出很多造型。当然我们印象中的传统印度舞蹈也在其中,一般一个女舞蹈演员,兰花指,大眼睛,用眼神摄人心魄的那种。还有一种特诡异的舞蹈,叫Kathakali  去看视频吧,我就不描述了。

在他家玩的差不多,我们就去了他家附近的一个咖啡店,叫paper or plastic cafe ,我在这儿喝到了迄今为止我喝过最好喝的拿铁。他家旁边是一家芭蕾舞蹈室,里面的男生女生都好有气质呀。

晚上回来开始上craigslist继续找车,找到一辆04年的corolla LE,才跑了五十多K,和I,E,望舒去看了车,觉得不错就直接带去修车厂检查了,去的是washington上的pep boys,虽然规模看起来还挺正规的,但是服务确实不够周到,检查的report特别简单就是几个方框,几个勾。Mechanic 谈起来还挺有经验的,总归车况很好,没什么毛病,最多就是再过个8千迈最好去换一下timing belt。 我还是不会降价,Lina给出9300最低价,比kbb报价低个700多刀,我觉得已经挺值了。 周二去交钱办手续,希望一切顺利。

Friday, May 18, 2012

R barplot with error bar

Go check this blog.
http://monkeysuncle.stanford.edu/?p=485

 
arrows(x,y+upper, x, y-lower, angle=90, code=3, length=length, ...)

Friday, April 27, 2012

12年4月

有意思,跟大树打电话的时候就能记起来很多故事,打开blog反而不知道从哪儿写起了。

好吧,从4月11号写起。那天,两个同学遇难了,最开始听到消息的时候还很兴奋,觉得有刺激的新闻了。当时只知道一个人是USC学生,然后说是两个亚裔,再然后说是两个中国学生。然后我就没有感觉了,一天里,出了消沉不知道该有什么情绪。晚上到tommy trojan聚会悼念死者,也只是莫名的难过,没掉过眼泪。

4月12号我生日,给家里打电话报平安,跟爸爸聊了挺久,他最后告诉我妈妈病了,还想满住病情不让我担心。还好我爸爸很冷静,该检查,联系医院之类的事情都已经安排妥当了。于是两天里,从想像失去自己孩子的父母的心情,到想像如果不幸最终发生我可能有什么心情。

4月18号,在shrine开更正式的追悼会,各种人讲话,校长和viterbi dean的讲话都很真诚,联系到他们自己当年求学的经历,怀有的理想和遇到的困难。接着是中国驻洛杉矶使馆代表讲话。原来流程单上写的是副总领事讲话,临时换成了总领事讲话。可以猜到那讲稿一定是秘书拟定的,不管是哪个官员站上去都可以直接念出来,自然感染力就大打折扣。最感人的是两个同学的好朋友上台回忆他们一起经历的点滴。女生的朋友是在USC才认识的同学,但短短一两个学期她的善良,勤奋,对朋友的关怀已经赢得了她朋友们的心,也感动了在场的与她并不相识的我们。男生的朋友是从本科开始就住一个寝室的兄弟,六七年里他的憨厚,对朋友间的支持鼓励,一个人在海外艰辛和奋斗,都是我们感同身受的。到这里我就哭得不行了,我不知道我还能做什么。

Saturday, March 31, 2012

03/31/12

这个周末开会,mike 70岁生日和simon60岁生日加上MCB项目10周年的聚会。牛人来了不少,David Haussler,Wing H Wong, Terry Speed, Barry, Ron 好多牛人,还有很多MCB毕业的学生博士后。看着自己桃李满园,他俩一定特开心,虽然不是所有的talk质量都很好。

遇到了一个越南人,在圣彼德堡大学和UCSD作博士生,看起来很学术,他是N同学的硕士毕业时候的指导者之一。世界还挺小的。他的导师是个很有意思的俄国人,二十多年前来USC跟mike和simon讲De bruin graph,当时苏联还不允许外国货币进入苏联,他就只带了15马克在洛杉矶待了一周,到了LA,mike接他到宾馆,Pavel很兴奋,跟mike说我们来讨论bioinformatics吧,mike很diplomatic地跟他说“你累了”,他很憋屈,凌晨4点睡不着就到Downtown去逛了一圈。第二天,m和s知道了这事儿之后就明白"they're in trouble"了。 等P同学给了talk之后,m和s明白了几件事,P knows nothing about possion approximation, and he doesn't speak english.


今天晚上去K和J家吃饭,I同学带我去的,玩guitar hero,draw sth。我觉得K对I格外好。

Monday, February 27, 2012

ggplot

> head(tmp)
    V1     V2     V3 hcg     hmeth mch      mmeth class       h_m
1 chr1 884000 885000 107 0.0105356  55 0.00406504     M 0.2890211
2 chr1 885000 886000 103 0.0158201  30 0.01015230     M 0.5357160
3 chr1 886000 887000 119 0.0170750  36 0.41832700     L 0.5192445
4 chr1 887000 888000  50 0.5725810  16 0.94303800     L 0.4948500
5 chr1 888000 889000  51 0.8819190  29 0.95502600     M 0.2451722
6 chr1 889000 890000  73 0.8581730  21 0.94063900     M 0.5411036






pdf("Human_mouse_cg.pdf")
ggplot(tmp, aes(x=h_m, colour=class)) + geom_density(adjust=5)
dev.off()


where the adjust  option adjusts the smoothness of the density plot.




http://had.co.nz/ggplot2/stat_density.html






Change axis labels 

By default, ggplot uses the variable name as the axis labels. Change it to something else using scale_x_continuous or scale_y_continuous
p = ggplot(diamonds)+geom_point()+aes(x=carat,y=price)

p + scale_x_continuous('x axis label') + scale_y_continuous('y axis label')


Colors
look at here:
http://wiki.stdout.org/rcookbook/Graphs/Colors%20(ggplot2)/

Wednesday, February 22, 2012

02/22/12

好吧,最近不爽,很不爽。科研停滞不前,跟老板沟通有障碍。我觉得我就是爱走极端,陷到自己的情绪里无法自拔。真傻,怎么能跟老板怄气呢,老板对我那么好,怎么能把对自己的不满发泄到老板身上呢? 好想哭,乱七八糟的,越叫我有条理我就越乱。

今天09年化学诺奖得主跟大家聊天,嗯 好奇心最重要,可是我现在的好奇心降到奇低的水平,没有方向,何言进度!怎么能洗心革面,重新做研究僧呢? 想骂街骂街骂街骂街!

Wednesday, February 1, 2012

01/02/12

在冷泉实验室,昨天一切顺利,跟着安团做了两三步。今天BStreatment也还好,可是到下午最关键时候,安团同学去开会了剩下我跟艾米莉做Egel,然后我就倒霉了。

明天给大家讲HMM,希望不会掉链子。

Wednesday, January 11, 2012

01/11/12

1. 要解决的问题
2. 现行方法缺陷
3. 创新之处,为什么新方法能解决问题
4. 新方法的应用前景

Wednesday, January 4, 2012

Paul Baran

The chances are you've never heard of him, but without his pioneering work in the 1960s, you wouldn't be reading this web page, because there wouldn't be a web for you to read it on.
His name is Paul Baran, and he died March 26, aged 84. Baran, a Polish-born engineer at the RAND corporation, invented one of the most fundamental aspects of internet technology, the concept that later became known as "packet switching".
Put simply, packet switching is the way data is chopped up into smaller chunks, and each chunk is sent across a distributed network to end up at its destination.
The chunks, or packets, might not all take the same route. The whole point is that there are many different routes available to them. Each packet has something called a header — a summary of metadata, information about the packet and its contents.
As the packets arrive at their destination, the packet headers tell the computer there how to re-assemble them in the right order.
Baran shares some of the credit for packet switching with researchers Donald Davies and Leonard Kleinrock, who were working independently along similar lines; before they came up with the idea, information had to go from point A to point B using what's called circuit switching. (Think of old footage of manual telephone exchanges, where operators plugged wires to connect one circuit with another.) With packet switching, a single circuit could be used more efficiently, to send more data between more people.
Baran's pioneering work in this field was a direct precursor to the creation of the government-sponsored network Arpanet, which itself was one of the first building blocks of the internet as we know it today.
A version of this text originally appeared on TIME.com on March 28, 2011.


Read more: http://www.time.com/time/specials/packages/article/0,28804,2101745_2102136_2102369,00.html #ixzz1iY27cuxm

Monday, January 2, 2012

纽约Day14

起来以后到星巴克吃了早餐,然后去Path站门口的UPS店打印了帝国大厦的票和rent的票,打印要50美分一张,真是贵,唉。然后直奔中央公园,在湖边转了小半圈以后做公车到39街的草堂小餐吃午饭,点了干煸四季豆,干烧鱼片,和春笋排骨汤。午饭后已经三点左右了,走路到42街看了一下中央车站 Grand Central Station,昊爷在那儿花了不到2分钟时间买了一个iPad。然后继续走到33街的帝国大厦,排队过安检,再排队上电梯,再排队爬楼梯到86层,看了落日,然后看了夜景,又走回草堂小餐要了碗酸辣粉,还点了钵钵鸡和肉末酸豆角,然后奔去50街看Rent,中间还在一家店里买了一小碗冰淇凌。Off-broadway的阵容果然不够强大,Mimi除了出场的一首歌唱的还行,其他的solo嗓音都不亮,有点失望。不过Maureen很给力,又能演又能唱,Angel也是,竟然是个高中生,不知道是不是真的gay。

Sunday, January 1, 2012

纽约Day13

今天到1号线南面终点south ferry站坐渡轮去Staten Island,一去一回,中途经过自由女神像,相机拉到最长焦能把雕像照的充满相机屏幕,回头还能看到曼哈顿,Jersey City,和布鲁克林三个岛,以及布鲁克林大桥和曼哈顿大桥。渡轮有三层,每层都有甲板可以出去回看景色。今天纽约天气很好,温度适中,但我穿少了,还是觉得有点凉。明天降温,多捂一点出去。下了渡轮之后,找了一家pizza pizza店吃饭,yelp上一个刀的果然是便宜,一片veggie披萨才不到4刀。之后,我们沿着broad St往北走,看到了Trinity Church,然后找世贸大厦。两座高楼正在重建,911纪念馆/碑啥的没有去看,因为要提前一天或者早上很早去领票。但是围观到了旁边消防队楼角上的纪念浮雕,还有人在上面贴了逝去亲人的照片和想念的话。之后我们去了华尔街,感觉没有之前想像的繁华。街道很窄,好看的建筑也就是经常出现在电视屏幕上的那几座。照铜牛的时间不太好,正好是下午背光的时候。本来想去Greenwich村逛,但地铁做过站,索性坐到时代广场逛街,人山人海啊。店里打折的东西有限,我在Forever21买了两件衣服,在ToysRus买了两个玩具,在M&M买了一个钥匙链,一个五角盒的mm豆,又装了一袋mm花生豆。晚饭在‘五粮液’吃的,yelp上两个刀,有点小贵,但量很足,还挺好吃的。