2009年11月6日星期五

Tips in Mex Fortran, linux version

Starting from the day before yesterday, I need to write a Matlab interface for a Fortran source code, which is almost a black box for me, so that I can use "mex" to compile it and call it in Matlab.

The first thing is the compiler. In Windows, you can only choose a specific compiler, say, C/C++ or Fortran. So if you work with both C and Fortran code, you will have to use "mex -setup" from time to time, which is kinda annoying for a lazy person like me. But in Linux, you can work on a configuration file so that Matlab will automatically select the compiler for you.

First, in "/opt/R2009a/unix/bin/mexopts.sh", you can see the following segment:

#
FC='g95'
FFLAGS='-fexceptions'
FFLAGS="$FFLAGS -fPIC -fno-omit-frame-pointer"
FLIBS="$RPATH $MLIBS -lm"
FOPTIMFLAGS='-O'
FDEBUGFLAGS='-g'
#

The first line indicates the compiler for Fortran. "g95" is not provided, so, we will change it to gfortran which I think comes with Ubuntu. Thus, change this segement into:

#
FC='gfortran'
FFLAGS='-fexceptions'
FFLAGS="$FFLAGS -fPIC -fno-omit-frame-pointer"
FLIBS="$RPATH $MLIBS -lm"
FOPTIMFLAGS='-O'
FDEBUGFLAGS='-g'
#

Then, in Matlab, if you type
mex -setup

You will see something like:
The options files available for mex are:

1: /opt/R2009a/unix/bin/gccopts.sh :
Template Options file for building gcc MEX-files

2: /opt/R2009a/unix/bin/mexopts.sh :
Template Options file for building MEX-files via the system ANSI compiler

Choose 2. Then it's ok to compile.

The next thing is the interface. The help in Matlab has everything you know to create a wrapper, even some examples for you to follow. So although I know nothing about Fortran, I managed to write a "almost" complete interface which passed the compilation.

However, there're several important tips that costs me a whole day to figure out.
  1. The name of the source file must be ".F", otherwise it won't compile.
  2. If the source code you want to wrap was not developed by you, be very careful about all the data types in that code. For example, if one input for that function is "REAL", then it is 4-byte floating number. And in Matlab, unless specified, everything will be "double", which is 8-byte floating number. If you pass the double value directly into it, the value will NOT be preserved. So when you call the function in Matlab, use something like "nlam = int32(nlam);

    beta = single(beta);" Also, inside the interface, use something like "mxCopyPtrToReal4(beta_pr,beta,size)".
  3. The next thing is managing the output. When you create the output matrices, do not use mxCreateDoubleMatrix. Use "mxCreateNumericMatrix", which will let you to specify the output types like int32 or single.

2009年11月5日星期四

How-To: What should you do if you deleted files in NTFS by mistake

OK. Here is how it happens. One day, I was using the filezilla, pulling down a tiny little file to my hard disk of the desktop machine in my office. It is the major machine I use for research, and all my LaTeX papers, matlab codes are there.

Then, I select the whole "Research" disk, and downloaded that file into it. Then, assuming I am still selecting the tiny file on the remote server, I hit "delete" button. The computer seems to be hanging there with no response, which happens quite a lot when I use filezilla, by the way. So I force quit (thank god).

Then, after maybe a few minutes, I found that all my codes are gone somehow. WTF?!

It was all my fault, can't blame anyone.

So what I did was I delete almost everything in a NTFS disk, when I was using Ubuntu Linux. Bad news. There is no trash can, and everything is somehow "gone forever".

OK, enough for my miserable story.

The first thing I try is under Windows, a commercial software called "Recover my files". It will recover a lot of files, only without the file names. But file names and original locations are SO important because there are thousands of them and most of them are codes, which basically called by its name.

Then, I tried free wares in Ubuntu, such as ntfsundelete and photorec. They all can recover the files, but not the name and location. Well, at least I can recover them, it just takes time. My final choice is photorec.

There is one oerticular software that can recover your file, name and location, though. It is called: "Autopsy". Also a linux free ware, but it works like a webpage, and you can only recover the file one by one. But I did use it to recover a lot of vital source code.

One tip is, after you hurt your disk, you can use "ddrescue" to mirror the whole disk to another externel hard disk (should be much bigger than the one you want to backup). Then, the file you create works just like a disk, and yu can recover based on that without further damage.

The only thing you can do to prevent this from happening is to back up your system regularly. The reason that I can survive this with only one week of frustraion is that I uploaded the most vital part of my work to a remote server, for computation purpose. Because of that, I only need to recover a very small ratio, using the combanation of those softwares.

But starting from now, I will start to use file sync softwares to back up my works to another disk on a regular basis. My recommendation is Grsync. You can setup some commonly profiles, and just click excecute it will sync by only dealing with the differences. Very fast.

You can also write a script to automaticly sync the folders, say, every night. I do not have the time right now. Here are some useful links:

https://help.ubuntu.com/community/BackupYourSystem#grsync
http://www.unixgeeks.org/security/newbie/unix/cron-1.html
http://linuxbasement.com/content/backups-using-rsync-bash-cron
http://linuxgazette.net/104/odonovan.html

2009年10月6日星期二

我父母的母校竟然会作出这样的事情

我基本不开QQ的,今天突然想找人问一件事情,就点开了,不出意外各个群都蹦了出来。在握大学班级的群里,我看到了这样的一段话:

ICQ 04:12:07:
京理工大学也是很久没有消息了,我就是被南京理工大学隐藏起来的秘密,我的同学都很少有知道我的情况的。我本想把自己的经历写下来,但是,由于校方当初的 承诺,我一直在苦苦等待。熬了一年了,我也自费了一年,母亲累的连临时工都打不了了,我最近一直在发烧,生怕哪天没机会再写动了。我现在已经烧了2个月 了,其中高烧39度以上就熬了10多天,平常最少也是38度左右,这便使我完全与南京失去了联系。

看看南京理工大学是如何对待自己的学生的吧。在校的研究生,自己的学生生了病都不理不管。希望大家看看,帮我四处院校bbs上传传,谢谢大家。

ICQ 04:13:08:
南京理工大学是如何对待自己的学生的,在校研究生因患白血病而不与报销医疗费用!至使我曾因没钱治疗而复发两次!

给我留下唯一的就是我同学和大学母校关爱,以及南京理工大学把责任退给穷苦的大学生,而不率而自己的义务。

我叫赵磊,男,23岁,曾经是南京邮电大学的学生。2008年在南京理工大学读研期间检查不幸患上了急性淋巴白血病。因为顾虑到经费问题(北京治疗相对江 苏省会便宜一些,而且,要是在南京治疗还要租房,吃饭,等等。再三考虑下,回京治疗会便宜一些),在北京的母亲在我检查出来的当天就要求我的导师把我送回 北京治疗,校方当时也保证相关的医疗问题会在南京那边帮忙询问解决。
但是,南京理工大学除了鼓动学生捐款之外基本上没有任何举动,只是一味的安抚我和我的母亲。在北京因为我的档案问题而不能报销

他 是我大学的室友,就睡在我的对床。知道他的消息之后我一直以来的校内状态都是为他祈福。因为距离的缘故,我除了寄钱也做不了太多。可是看着这个可能只是部 分的留言,我实在不能平静。南京理工是我父母的母校,我一直将它当作我的第二故乡来崇敬。可是学生在学校生了重病,校方却没有任何实质上的帮助。鼓动学生 捐款又能捐多少呢?公费医疗难道是墙上画的饼么?学生身体好的时候就从学生身上榨取各种杂费,学生真正需要帮助的时候呢?怎么能不让人心寒?

2009年9月14日星期一

Installation of a fancy network visualization tool: Circos

http://mkweb.bcgsc.ca/circos/

I just found this very nice visualization tool, but the installation is kinda tricky :-)

First, you have to have UNIX or Linux on your machine (long live open source!!)

sudo apt-get install libgd-gd2-perl

After downloading and extracting, install these perl modules by:

sudo perl -MCPAN -e 'install Class::Base'
sudo perl -MCPAN -e 'install Math::Random'
sudo perl -MCPAN -e 'install Graphics::ColorObject'
sudo perl -MCPAN -e 'install List::MoreUtils'
sudo perl -MCPAN -e 'install Clone'
sudo perl -MCPAN -e 'install Config::General'
sudo perl -MCPAN -e 'install Readonly'
sudo perl -MCPAN -e 'install GD::Polyline'
sudo perl -MCPAN -e 'install GD'
sudo perl -MCPAN -e 'install Math::Bezier'
sudo perl -MCPAN -e 'install Math::Round'
sudo perl -MCPAN -e 'install Math::VecStat'
sudo perl -MCPAN -e 'install Params::Validate'
sudo perl -MCPAN -e 'install Set::IntSpan'
sudo perl -MCPAN -e 'install Statistics::Descriptive'

Don't copy them to the terminal directly, execute them line by line.

Then, in the cricos-*.** directory, execute
./install-unix
and specify your path of perl (/usr/bin/perl)

Then,
perl ./Build.PL
./Build

In the same directory, try this:
./bin/circos -conf tutorials/2/2/circos.conf

It will create a PNG file in /tmp

I'll start to learn how to use it soon...

2009年9月1日星期二

Link to files in Excel

Just a little trick to remember.

Fill in the cell with this:

=HYPERLINK("c:\test\test.bmp","Click Me")

2009年8月22日星期六

Round up numbers in Matlab, leaving given numbers of digits after dot

The easiest way is to try to
num = num*10;
num = round(num);
num = num / 10;
kind of thing...

Other way is:
the vpa function.

2009年8月20日星期四

Install the GUI in R for Ubuntu

First,

sudo apt-get install r-base

Then, type sudo R in command line to invoke R. Type in

install.packages('Rcmdr')

then

q()

Then use R to invoke it,

library(Rcmdr).

2009年7月17日星期五

Convert Excel Chart to EPS without any loss of fanciness

OK, I should confess that this web-log contains a whole bunch of stuff related to Microsoft and Non-free software... Well, I am in ASU now, as long as I can use all of them free of charge legally, who cares...

First of all, I checked a lot of articles on the web, regarding how to do this. But most of them just save the chart to as a image file, and convert it into EPS. WTH is that? All the nice properties of eps that you won't loss any resolution when inserted into your LaTeX file, the whole purpose of vector graphics!

OK. You should have Adobe Professional installed on your computer.

Now the steps looks kinda weird, but it is true...

Select the chart in Excel, paste it into a random Power Point file. Then select it in PPTX, paste it into a Visio file. Then, in Visio, set the page to fit the chart, and print it as PDF. Open PDF in Adobe professional, save it as eps. Vola...

2009年7月13日星期一

Solving the wired sound problem

My desktop in BioDesign has tons of wired sound problems. I found a fix on the web and actually I don't know if it is a fix or not...

Anyway, I applied it, reboot and MPlayer works again (maybe the reboot works... OTZ...)

sudo apt-get install libsdl1.2debian-pulseaudio padevchooser

(http://ubuntuforums.org/archive/index.php/t-765095.html)

2009年7月6日星期一

Get Citrix for Linux to work for ASU MyApps

Finally...

First, download and install the Client. It can be found in MyApps.
Then, sudo apt-get install libmotif3

OK. Now we have to import a certificate.
This is the one I use:
http://www.geotrust.com/resources/root_certificates/certificates/Equifax_Secure_Certificate_Authority.cer

http://www.geotrust.com/resources/root-certificates/index.html

and copy it to /usr/lib/ICAClient/keystore/cacerts/citrite.crt
Then it's working :-)

2009年5月19日星期二

Emacs + LaTeX, even easier

OK.

sudo apt-get install auctex

This thing can give you a whole new style of syntax highlighting dedicated to make your LaTeX life easier.

Changing fonts
C-c C-f C-i \textit{} - Italics
C-c C-f C-b \textbf{} - Bold face (In math mode, this will invoke the \mathbf{} font)
C-c C-f C-e \emph{} - Emphasized
C-c C-f C-s \textsl{} - Slanted
C-c C-f C-r \textrm{} - Roman
C-c C-f C-f \textsf{} - Serif
C-c C-f C-t \texttt{} - Typewriter
C-c C-f C-c \textsc{} - Small Caps
If you want to change font attributes of existing text, mark it as a region, and then invoke the commands.

Sections, Environments, formatting, etc
C-c C-s \section{} \chapter{} \subsection{} - Sections
C-c C-e \begin{} & \end{} - Environment
C-c ] - Close Environment
C-c C-m - Macros
C-c RET(Enter) - Macros
C-c C-j() - Newline with \item inside itemize and so
C-c { - Insert balanced braces
M-q - Fill and indent current paragraph (format it)
C-c C-q C-e - Format current environment

Commenting
C-c ; - Comment current region
C-c : - Uncomment current region
C-c % - Comment current paragraph

Running and viewing
C-c C-c - Run LaTeX on text
C-c C-c after compling - Default View
C-c ` - Go to the next error
C-c C-t C-p - Toggles between DVI and PDF output

Queried search and replace
To do a queried search and replace (with a prompt for replacing each occurrence of a text string), press M-% . You will then be prompted for your search and replace strings. Emacs will find and display each occurrence of the search string and ask you for further instructions. You can respond with any of the following options:
Spacebar Replace text and find the next occurrence
Del Leave text as is and find the next occurrence
. (period) Replace text, then stop looking for occurrences
! (exclamation point) Replace all occurrences without asking
^ (caret) Return the cursor to previously replaced text

If you type any other character, Emacs will stop looking for occurrences and execute the character as a command. To restart the queried search and replace, type:
C-x M- M-RET

2009年5月4日星期一

写在搬家之前

一个下午算是完结了这个学期的 所有课程,效率可谓相当的高。不过出门的时候脑子里除了一锅沸腾的汤汤水水之外并没有什么轻松的感觉,因为接下来还有两门TA课4次作业1次期末考试的卷 子要批,还要在这期间抽空预约医生,还要搬家搬办公室,一切都在一个星期之内完成。不过想想倒不会觉得可怕,因为都是一些不需要费脑子的事情,坐在那里的 时候心里会很确定在多少时间之内我可以完成多大的百分比。可以剥个橘子,听个音乐,浏览那帮小盆有富有新意的错误然后飙粗口。还没有开始的时候就可以看到 的每一个场景的每一个细节,让我很是安心。

在我和眼前的电脑缠绵够了之后,我会在33摄氏度的暖风中晃到车站,等车回家。 然后放上很暴力或者很激昂的歌,开始洗床罩和被单,开始把东西放进纸箱。中间会穿插洗澡和吃饭,Skype,有时间的话没准儿还会看一场电影。"17 Again",就是这部。然后明早朋友们如期而至,大家一起搬家,下午收拾房间,等等。

马上就要离开住了9个月的公寓,没 有任何的感觉。很像链表的操作,指针里面的地址换一下,整个内存波澜不惊。很像去年来美国的时候,或者是寒假回国的时候,旅途上没有分毫的激动,只是在想 各种各样的清单,下一个小时要做什么,明天要做什么,见到谁谁谁脸上的第一个表情会是怎样,对方的表情会是怎样。风未动,幡亦未动。或者这说明我变成了一 个长大了的男生,或者说我变得懒了。或者说两者兼而有之。高二的时候每天心潮澎湃不已,思考各种有一搭没一搭的问题。记得那时有一天跟语文老师侃大山,颇 为担心长大之后是不是这么多的想法就全都没有了,还是会继续把现在没有想明白的问题接着想下去。现在觉得自己还是没有长大,毕竟还是个学生。但当初的我如 果遇到了现在的我,估计也会很无语。不过我懒得去构想这样的见面,相当没救了。

小时候养了很多小乌龟,到了冬天奶奶就会铲 一簸箕土倒进鱼缸里面,然后它们就会冬眠然后在春天的时候爬出来。至今觉得很神奇。每个小乌龟都会在自己的周围整出一个椭球形状的小空间,然后缩在壳子里 睡去。有时鱼缸壁的曲面会和这个椭球体有小小的交集,然后我就可以透过那个剖面看到这个小空间里面的小乌龟,看到它们眯起的眼睛和折起的前爪。小时候也经 常幻想自己周围有一个大大的泡泡,里面恒温而且不会下雨。自己每天就可以顶着这个大泡泡走来走去,看着外面的世界来来往往。

现 在,泡泡外面的自习室变成了一张只有我一个人坐的大桌子,泡泡外面的人变得五颜六色花花绿绿。泡泡外面的天空变成了一成不变的晴天,泡泡外面的中央空调发 出呼呼的喘息。泡泡外面的公寓即将变成一堆满满的箱子再变回一堆空空的箱子,泡泡外面的电脑上一篇好长好长的日志正在被敲完。我就坐在泡泡里面,眯着眼 睛。

2009年4月23日星期四

How to "Exit" full screen in rdesktop

When you hit ctrl+alt+enter in the RDP session, it should exit the full screen mode... But something in Compiz causes a problem.

System > Prefrences > Advanced Desktop Effects Settings Utility > Workarounds > uncheck Legacy Fullscreen Support

That should do it…

The powerful session manager: Screen

After my supervisor bought this fancy new desktop computer for me, while I am still waiting for the release of Ubuntu 9.04, the first thing I did is installing Microsoft Windows on it. Such a shame thing to do...

Well, I have my reasons though. One thing I assumed that I can "only" do on Windows is Remote Desktop Protocol. VNC is as slow as a snail, ssh -X is really fun except for one thing: it is still a ssh session, which means everything stops if the connection is closed, or, when I just want to shut down my own lap-top. So my requirement is really simple. I want something that is really fast (command line OK), and can still running when I close the current session. Thus, I can setup a program at work, go back home, login to see if everything works fine, modify a little bit if necessary, shut down my lap-top and go to sleep, leaving the server to finish my work.

Is that too much to ask for Linux? No! I realized I just missed one really powerful thing, which has been there (obviously) for a LONG time. It is called "screen". It is just a window manager like xterm, but you can detach from it and reattach anytime you want.

Two really helpful How-Tos:
http://www.rackaid.com/resources/linux-tutorials/general-tutorials/using-screen/
http://www.linuxforums.org/applications/the_screen_program.html

To start a session: type "screen".
inside the session, Ctrl-A ? to see a list of short cuts.
Ctrl-A c for a new window, and Ctrl-A n or Ctrl-A p to switch between opened windows. Ctrl-A K will kill the current window (and the running program).
Ctrl-A d to detach, and then you will find yourself back to the shell, with all your program running in a screen session.

Type screen -ls, you will see all the screen sessions running, and by type:
screen -r SESSION_NAME
You will get back to that session.

Thus, I can just ssh to that server, open a screen with a bunch of Matlab, detach, close that ssh, go back home, re-login and see the output during the process. Yea!

2009年3月18日星期三

Python Looping小技巧

Python下面的循环有很多看起来花哨其实很实用的技巧。首当其冲的就是enumerate(),花哨到用语言很难讲清楚...小例子如下:

for i, v in enumerate(['tic', 'tac', 'toe']):
print i, v

0 tic
1 tac
2 toe

在编程的时候大家经常要用到的情况,就是控制循环的index同时是用来访问某一个数组的。比如用Matlab实现:

arr = {'tic', 'tac', 'toe'};

for i = 1:length(arr)
fprintf('%d %s', i, arr{i});
end

相比之下,大家就知道我为什么说enumerate()实在是很fancy的一个东西。

但enumerate()和我们一直理解的循环有一个很重要的区别,那就是循环的进行不是靠i的值控制的,而是靠enumerate来控制的。咱们写循环的时候一个常见的错误就是循环套循环的时候经常用一样的变量“i”来控制,这样就会出很诡异很诡异的问题,debug都不容易找到。但是在Python下面:

for i, season in enumerate(['Spring', 'Summer', 'Fall', 'Winter']):
print i, season
for i, day in enumerate(['Wed', 'Thu', 'Fri', 'Sat']):
print i, day

0 Spring
0 Wed
1 Thu
2 Fri
3 Sat
1 Summer
0 Wed
1 Thu
2 Fri
3 Sat
2 Fall
0 Wed
1 Thu
2 Fri
3 Sat
3 Winter
0 Wed
1 Thu
2 Fri
3 Sat

虽然我在两层循环用了一样的i,但Python根本不鸟这个,只管用enumerate()生成(index, arr[index])对,生成完之后循环结束。如果我用matlab这样写:

S = {'Spring', 'Summer', 'Fall', 'Winter'};
D = {'Wed', 'Thu', 'Fri', 'Sat'};

for i = 1:length(S)
disp(S{i});
for i = 1:length(D)
disp(D{i});
end
end

大家都知道什么后果了吧...

Enumerate还有一个非常Fancy的例子:

fp = open("file", "r")
for i, line in enumerate(fp):
print "line number: " + lineno + ": " + line.rstrip()

可以一行一行把一个文件读出来,而且很省内存,只要你的内存能装下那一行就行了。在需要把一个超大文本文件里的数据读出来处理的时候,这个例子非常有用。

最后再帖一个enumerate之外控制循环的例子,也是相当fancy的:

questions = ['name', 'quest', 'favorite color']
answers = ['lancelot', 'the holy grail', 'blue']
for q, a in zip(questions, answers):
print 'What is your ' + q + '?', 'It is ' + a + '.'

What is your name? It is lancelot.
What is your quest? It is the holy grail.
What is your favorite color? It is blue.

2009年2月8日星期日

从AD到OFFER:我的ASU之路

话说今天早上6 点钟睁眼,看到Gmail 依然是除了Scipy 的digest之外空空如也,当时
心里哇凉哇凉啊……然后想好了一大堆感伤的话准备去实验室给ASU 一直在帮我要钱的
老师打电话。到了实验室打开电脑心想还是看看邮箱吧,然后就看到了TA二字……

当时很困,所以没有太多的激动,只是看完了多少米,免学费否,有医保这些东西,然
后又去学院的网上查了一下开销,心想这个按照土话讲就是全奖了,呵呵,送了一口气。
觉得这么多天的辛苦和等待总算不至于美国落到个颗粒无收的地步,所以就准备从了得
了……

今年的局势要比我想象的艰难得多。本来我觉得我的条件无懈可击,或者说在我的角度
上来说已经做到最好了。我GPA 89.1/100,专业第一,T102,G480+800 +4 ,还辛辛
苦苦的发了两篇不错的国际会议,一篇一作ICMLC ,关于二进制PSO 的,一篇二作ICTAI
,关于改进SVM训练方法。

之所以说很辛苦是因为我身处在一个没有这方面导师的地方,从选自己喜欢的而且有东
西做的方向,到出idea到发表论文然后出国开会,全是我们几个学生自己完成,所以我
们每篇文章都是100%甚至更多的工作量。唯一也是最大的硬伤,就是我的出身,因为我
来自南京邮电大学。附加效应就是我的推荐人都是完全没有名气但对我很nice的老师。
但这个是我无法选择的,只因为我在几年前高考报志愿时的一次失误。

ASU 的AD放的非常早,大约在过年寒假的时候就出来了。当时还不知局势的紧迫性,所
以很高兴之余就耐心的等他们在financial 方面的决定。中间我等啊等啊,等来了无数
的Rej 和AD(而且表明不给钱),但我就一直不觉得有问题,因为还有ASU ……结果不
知不觉中pending 越来越少,OFFER 依然没有一个。

当我很有自信的几个学校相继给我Rej ,拿来保底的学校给我AD之后,已经到了3 月中
旬,这是我才开始觉得不对了……

想到我好歹有了AD,套磁不会被BS了吧,就去套了一个ASU 的教授,热情洋溢地说我有
多么热爱ML、PR和DM,结果他果然很快的回信,说去看一下我的Application ,然后asa
p回复我。

又过了一个星期,ASU 也没动静,教授也没动静……这时在水源上看到一个兄台很快收
到了ASU 的不给钱信,然后第二天就去套磁,然后第三天就拿到OFFER ,我一阵郁闷…
…心想我还不如拿不到钱就得了……结果不幸洛阳地邪啊……

我一天早上很麻木的打开信箱,看到了让人心碎的不给钱几个大字……我一个郁闷……
现在时间这么紧迫了……

这种东西要给早点给啊……

然后我就赶快给那个教授哭啊,我说我们在第三世界国家的第三世界学校,小孩子们那
个苦啊……跑程序没有服务器、写文章没有导师、发文章开会都要自费啊……就这样我
们这些热情于学术的小朋友依然自发组成了一个实验室,在厕所边上作胸透的小屋里靠
捡破烂组成了一个实验室,在研究中度过了最快乐的时光……(以上都是事实,也是我
的原话……)

教授马上给我回信,说我觉得你的条件很不错,我把你的材料递到系里面了,大家一起
hope for the best吧。

我就在这新的希望中度过了又一个星期……

这时NUS 的一个导师给我写信,说你现在定下来没有?定下来要来这里我就送你去MSRA
实习,我其实也一直非常想去,心想这就算摧了呀,可是ASU 又异常安静……

只好赶快给ASU 打了一个电话……电话里导师说我们不是觉得你的出身不好,我们只看
学生是否优秀,我们也收了很多一般出身的学生,比如四川大学的(我严重无语了……
)。
我们只是不知道你的GPA 第一名能代表什么……而且你的论文不算多的,有比你论文还
多的本科生,所以你应该work harder ……我说不会吧,论文要认真做的话一年才能有
一篇呢,我已经很努力了……他说所以我们担心是你的导师不够好,而不好的导师怎么
能培养出好学生呢……(我继续无语……说了半天还是出身问题……)我说我们不是没
有好导师,我们没有导师……所有东西全部是我们自己做的。他这时愣了一下,说原来
是这样,你们自主research 是很重要的……

然后我就说了一下NUS 的条件,他说NUS 给的条件也非常好,他当时也在NUS 和MSRA工
作过,都很不错……

所以即使我们给你offer 你也要选择一下云云……然后他就给我最后期限,他说如果下
周二还没有动静的话你就去NUS 吧,good luck ……

我马上给NUS 写信,说我现在面临人生目前最大的决定,请等到下周二我再告诉你……
结果他很nice的回说我其实没有逼你……我心想唉……早知道我还可以多等几天……话
说SC真的是很nice的一个人。

……

然后就到了今天早晨,如愿拿到了offer.但可惜心里紧张,话筒又出了问题,结果我说
的话对方也没怎么听清楚,其实我就是想表示一下感谢……对方就说你看,拿到钱了吧,
不过你不需要为我干活,我一直帮你要钱就是气不过你怀疑我们歧视南邮……我无语…
…这也管用啊……

就这些了大概:- )

让Ubuntu满天飞Tux:-)

如果是7.10并安装好了稳定版的compiz,首先安装编译所需的包:

sudo apt-get install compiz-bcop compiz-dev build-essential
libxcomposite-dev libpng12-dev libsm-dev libxrandr-dev libxdamage-dev
libxinerama-dev libstartup-notification0-dev libgconf2-dev libgl1-mesa-dev
libglu1-mesa-dev libmetacity-dev librsvg2-dev libdbus-1-dev
libdbus-glib-1-dev libgnome-desktop-dev libgnome-window-settings-dev gitweb
curl autoconf automake automake1.9 libtool intltool libxslt1-dev xsltproc
emerald x11proto-scrnsaver-dev libxss-dev

然后下载各种plugin:

wget -O /tmp/3d.tar.gz
'http://gitweb.opencompositing.org/?p=fusion/plugins/3da=snapshot;h=db3c51d6
c5c0df268fc1ec29a4264ef3d21dbbb3'
wget -O /tmp/atlantis2.tar.gz
'http://gitweb.compiz-fusion.org/?p=users/smspillaz/atlantis2-0.6a=snapshot;
h=d50d17bcdef5a025699e6b1bc0d604a98d1b74b2;sf=tgz'
wget -O /tmp/snow.tar.gz
'http://gitweb.opencompositing.org/?p=fusion/plugins/snowa=snapshot;h=01d0ff
6ec71dae4699bc990e0114569c8ad4e083'
wget -O /tmp/stars.tar.gz 'http://oreaus.googlepages.com/stars.tar.gz
wget -O /tmp/atlantis.tar.gz
'http://gitweb.opencompositing.org/?p=fusion/plugins/atlantisa=snapshot;h=a4
7d7151444faccd66ea5cb884673cdebe5d7dff'
wget -O /tmp/screensaver.tar.gz
'http://gitweb.opencompositing.org/?p=users/pafy/screensavera=snapshot;h=656
5001eb389fb0d18cfead6030054cc8edc6c5f'
wget -O /tmp/anaglyph.tar.gz 'http://oreaus.googlepages.com/anaglyph.tar.gz
wget -O /tmp/wallpaper.tar.gz
'http://gitweb.compiz-fusion.org/?p=fusion/plugins/wallpapera=snapshot;h=c2d
19686e46ae171b6a0c04da9de1adbd74ae8be'
wget -O /tmp/tile.tar.gz
'http://gitweb.opencompositing.org/?p=fusion/plugins/tilea=snapshot;h=550c91
fa188efd39c9cea43f894b45716b5cc6d5'
wget -O /tmp/freewins.tar.gz 'http://oreaus.googlepages.com/freewins.tar.gz
wget -O /tmp/photowheel-0.6.tar.gz
'http://gitweb.opencompositing.org/?p=users/b0le/photowheela=snapshot;h=41d8
090b55b629f72bef55d785beaf468f31662f'

这里面是没有我用的Autumn的。虽然说Snow用起来也差不多,但我总觉得autumn的企鹅
飞地更加飘逸。去ubuntu的forum上有一个帖子上有autumn的下载,安装只需跑一个脚本
。以上的plugin都直接make就可以,都很酷,尤其是screensaver,不过与之后的话题没
太大关系。

帖子位置:
http://forum.ubuntu.org.cn/viewtopic.php?t=89199

装好之后,在Advanced Desktop Effect Settings里面就可以看到Autumn的选项,图标
是一个树叶的话就基本没有问题了。默认的情况下飞的是树叶,但具体飞什么图是由tex
ture决定的,但是在GUI的情况下,一次只能增加一张图,所以像我这种使用一大堆TUX
图片作为texture的人,每重装一次就很郁闷。所以有一个更爽的方法:

首先把当前的profile输出到一个文件里,在里面可以找到[autumn]这一项,as_leaf_te
xtures =这个后面加上所有的图片地址,并使用;隔开。下面这个脚本可以自动将一个文
件夹内所有的图片地址都输出成需要的格式(替换相应的图片文件夹地址):

#!/usr/bin/python

from os import listdir

image_list = listdir('/home/yuanlei/Pictures/Compiz_Related/Crystal_Tux')

str = ''

for file in image_list:
str = str + '/home/yuanlei/Pictures/Compiz_Related/Crystal_Tux/' + file
+ ';'

print str

然后,再把改过的profile文件import进去...

[ECHO御用探雷器]--签经

话说我作为萝格派等人的御用探雷器,开始觉醒认为世界上还有签证这件
事情的时候,貌似已经不早了。我很天真地到Gter上去看,发现居然有那
么多东西...我就很无语...然后就打开Python不去理它了...我一直以为
I20寄不到就不需要考虑签证这件事情,所以我等到学校的正式OFFER到了
之后,才开始看签证的东西。一般学校会在你接受OFFER就马上去办,而
且ASU用的还是FedEX,所以还是很快的。

首先是预约时间。先要去网上买一张专用的电话卡,可以打8分钟。然后打
一个专门的电话预约。我预约的时候天真地以为我先什么时候去就什么时
候去,结果那人以上来就告诉我,最近的一次是6月10号...导致我看着一
个一个同学吃了水果,那叫一个着急啊...当时我约了那天的最后一个时间
段,也就是1:30,因为我不想提前一天去住,会比较花钱...

然后就是准备。其实现在想想所谓准备就是填3张表签几个字交两个钱,签
证问题也只需要准备传说中的25问就可以了,2天足矣,还可以不耽误做别
的。不过当时还是比较紧张的。

然后就到了今天早上。我买的7:52的火车,10点到上海,直接打的到南京路
梅龙镇广场,在附近一个指定地点存包,只能带材料和水,水还要在进去大
厅之前扔掉。进去之后就是超级长时间的排队。预约时间是没有用的,先来
后到,只要是同一天就行了。我10:40进去,13:40排完队,进入大厅排队...
然后就是交必备材料、护照。交过之后继续等,这时是通过叫号的方式来决
定谁可以去面签,这主要取决于你材料有没有问题,如果没有什么问题就会
比较快。叫号之后就会去按指纹,然后就站在一条短队里静静等着面签...

今天的VO全是老外,没有传说中的杀手YYMM。只有一个女VO貌似很严厉,在
她面前的学生都花了挺久才走。

我在11号,那位VO接过我最重要的那些材料(I20和3张表)之后一边翻一边
问我:
1、你学啥子呀?
me: CS.
2、具体一点?
me: ML.
加一段ML的科普知识...
3、ML和AI啊有关系啊?
me: 有交集...
4、祝你好运~

不知是因为紧张还是什么别的原因,我觉得不会超过30秒...

然后就出去到对面中信银行交了45块钱EMS费,over。