5月 19

【转载】关于程序员的冷笑话

1.面试
面试官:熟悉哪种语言?
应聘者:C#

面试官:知道什么叫类么?
应聘者:我这人实在,工作努力,不知道什么叫累。

面试官:知道什么是包?
应聘者:我这人实在,平常不带包,也不用公司准备了。

面试官:知道什么是接口吗?
应聘者:我这个人工作认真,从来不找借口偷懒。

面试官:知道什么是继承么?
应聘者:我是孤儿没什么可以继承的。

面试官:知道什么叫对象么?
应聘者:知道,不过我工作努力,上进心强,暂时还没有打算找对象。

面试官:知道多态么?
应聘者:知道,我很保守的。我认为让心爱的女人为了自已一时的快乐去堕胎是不道德的行为!请问这和C#有什么关系?

Continue reading

5月 18

【转载】Perl命令行/行命令参数简介

Perl语言中有很多Perl命令行参数。通过它们,我们有机会写出更简单的程序,在这篇文章里我们来了解一些常用的参数。主要包括五部分的内容。

第一部分:Safety Net Options安全网参数

在使用Perl尝试一些聪明(或stupid)的想法时,错误难免会发生.有经验的Perl程序员常常使用三个参数来提前找到错误所在,

1:-c

这个参数编译Perl程序但不会真正运行它,由此检查所有语法错误。

1
perl -c program.pl

2:-w

它会提示你任何潜在的问题。Perl5.6.0之后的版本已经用use warnings;替换了-w。你应该使用use warnings,因为它要比-w更灵活。

3:-T

它把perl放到了tain模式。在这个模式里,Perl会质疑任何程序外传来的数据。例如,从Perl命令行读取,外部文件里读取或是CGI程序里传来的数据。这些数据在-T模式里都会被Tainted掉。
Continue reading

5月 16

Shell与Perl中的颜色控制

1.控制码
e[0m 关闭所有属性
e[1m 设置高亮度
e[4m 下划线
e[5m 闪烁
e[7m 反显
e[8m 消隐
e[30m–33[37m 设置前景色
e[40m–33[47m 设置背景色
e[nA 光标上移n行
e[nB 光标下移n行
e[nC 光标右移n行
e[nD 光标左移n行
e[y;xH 设置光标位置
e[2J 清屏
e[K 清除从光标到行尾的内容
e[s 保存光标位置
e[u 恢复光标位置
e[?25l 隐藏光标
e[?25h 显示光标
Continue reading

5月 16

Perl中的switch实现

switch语句是这样工作的:让多个数值和一个测试值相比较,而执行与测试值相匹配的值,如果任意一个存在的话,执行对应代码。
Perl中没有内建的switch语句,你不得不使用长梯状的if、elsif和else语句进行多重检测。但你可以自己做一个:或者使用Switch模块;或者使用代码块,因为块非常像只执行一次的循环,实际上可以使用诸如last这样的循环控制语句离开这个块。
Continue reading

5月 16

[转载]Perl vs Python – The Final Battle

原文链接(文章后面的不少回复也值得一看)

You might have already seen a lot of Perl vs Python stuff. So I’m telling you in advance that I’ve too have read them all, and what you’re going to read here would be completely different than what you already have.

Firstly, let me start by saying that Perl and Python are great languages. But they have their own differences, which is precisely why we have two different languages. If they were the same, why have two different languages at all?

The people who are biased against a language are the one who try to write Python in Perl or Perl in Python. They want Perl to work like Python or vice versa. And if you’re intelligent enough, you’ll quickly understand that there is no point in having them both work in the exact same way.

I’ll shout out one basic difference between the two. This is one difference a beginner will likely notice. I won’t mention many of the “advanced differences”, for an experienced programmer doesn’t need my help for that.
Continue reading

5月 15

【转载】初品Bioperl

序:让程序读起来更生动
第一篇:让BioPerl在你的电脑上安家
第二篇:构造一条fasta序列
第三篇:从本地文件中获取fasta序列
第四篇:从本地文件中获取Genbank序列
第五篇:序列格式的转换
第六篇:从远程数据库下载序列之一
第六篇:从远程数据库下载序列之二
第七篇:对象的类型……【阅读全文】