由买买提看人间百态

topics

全部话题 - 话题: whitespace
1 (共1页)
g*****g
发帖数: 34805
1
【 以下文字转载自 Programming 讨论区 】
发信人: goodbug (好虫), 信区: Programming
标 题: regular expression for whitespace in path
发信站: BBS 未名空间站 (Mon Dec 11 15:10:02 2006), 转信
I am writing a shell like program which should be able to parse
mycommand path="/path/my program/..." file=....
how do I write a regex that will split strings with space but not
between matching quotations marks like in path? Thanks for any input.
c********a
发帖数: 6466
2
来自主题: LosAngeles版 - how connect to mitbbs with ssh

cindy@cindy-Latitude-E6420:~$ ssh -vvv c********[email protected]
OpenSSH_5.8p1 Debian-1ubuntu3, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to mitbbs.com [74.53.4.74] port 22.
debug1: Connection established.
debug1: identity file /home/cindy/.ssh/id_rsa type -1
debug1: identity file /home/cindy/.ssh/id_rsa-cert type -1
debug3: Incorrect RSA1 identifier
debug3: Could not load "/hom... 阅读全帖
B*******1
发帖数: 2454
3
来自主题: JobHunting版 - 为什么做了400道算法题还是那么菜
你这个skip了开头的whitespace了吗?
The function first discards as many whitespace characters as necessary until
the first non-whitespace character is found. Then, starting from this
character, takes an optional initial plus or minus sign followed by as many
numerical digits as possible, and interprets them as a numerical value.
b***c
发帖数: 1460
4
来自主题: Faculty版 - matlab关于树形结构的一个问题
我们需要从Excel导入数据建模,主要是方便管理和可视化
然后用matlab来导入输出成特定的格式,现在碰到问题了
我们的数据导入到matlab里面就成了下面的样子,有很多whitespace
'animal' '' ''
'' 'bird' ''
'' '' 'bird_01'
'' '' 'bird_02'
'' '' 'bird_03'
'' '' 'bird_04'
'' '' 'bird_05'
'' '' 'bird_06'
'' 'pig' ''
'' '' 'pig_01'
'' '' 'pig_02'
... 阅读全帖
B*******1
发帖数: 2454
5
来自主题: JobHunting版 - 任意输入STRING,转换为INTEGER,
atoi
function

int atoi ( const char * str );
Convert string to integer
Parses the C string str interpreting its content as an integral number,
which is returned as an int value.
The function first discards as many whitespace characters as necessary until
the first non-whitespace character is found. Then, starting from this
character, takes an optional initial plus or minus sign followed by as many
numerical digits as possible, and interprets them as a numerical value.
d****n
发帖数: 1637
6
看了下楼主的《剑指Offer——名企面试官精讲典型编程题》
第7章,第一个实例简直就是面试官装B的一个实例。
说什么atoi 返回0的时候也可能是错误,会设置一个全局变量。
根本就是瞎扯。或者说最近的libc里面根本没有提。害的我找了一圈
###############man 3 atoi :############
DESCRIPTION
The atoi() function converts the initial portion of the string
pointed to by nptr to int. The behaviour is the same as
strtol(nptr, (char **)NULL, 10);
except that atoi() does not detect errors.
###############atoi.c###################
00001 /*
00002 * This file is shared between libc and the kern... 阅读全帖
l********a
发帖数: 1154
7
来自主题: Programming版 - C的fscanf的问题
你能保证|前面的长度吗?如果都是4,下面的可以
int main()
{
FILE *fid = fopen("data.txt","r");
float num = 0.0;
char name[10] = {0};
fscanf(fid,"%4c|%f",&name,&num);
fclose(fid);
printf("Name: %s\nNumber: %f\n",name,num);
return 0;
}
如果分隔符不是|而是空格,用
fscanf(fid,"%s %f",&name,&num)好使
%s String of characters. This will read subsequent characters until a
whitespace is found (whitespace characters are considered to be blank,
newline and tab).
k**********g
发帖数: 989
8
来自主题: Programming版 - 问一段C++ iostringstream的代码

是operation 前和後的分别。
Thrust 的答案也是很重要的。建议再多做几个测试。
In your code, the stream's state is tested first and then the string is read
. in Thrust's code, the string is read first, and then the stream's state is
tested. If the test is bad, the string is thrown away.
You should do a few more tests, e.g. a string that ends with a whitespace (
the delimiter), a string that contains a single word (no whitespace at all),
etc., to make sure the code satisfies all of your needs.
s******u
发帖数: 501
9
来自主题: Programming版 - 说c++不难的欢迎来看看这个
百分之百legal的C++程序,看你能不能理解这是在说什么
name = fhicl::ass [ _val = qi::_1 ];
qualname = fhicl::ass [ _val = qi::_1 ]
>> *((char_('.') > fhicl::ass) [ _val += qi::_1 +
qi::_2 ]
| (char_('[') > fhicl::uint > char_(']')) [ _val += qi::_1
+ qi::_2 + qi::_3]
); // TODO: only some whitespace permitted
// TODO: no whitespace permitted
localref = lit("@local::") > qualname [ _val = qi::_1 ];
dbref = li... 阅读全帖
m********5
发帖数: 17667
10
来自主题: Programming版 - 谁能告诉为啥最后为啥输出两个C
why you use iss.eof()?
The common way to do this is directly check after iss>>temp, because their
can be fail, bad, whitespace, or eof. If either fail/bad signal is True, the
temp is not valid.
###
void test(){
string s = "A B C "; // output is A B C C
// If string s = "A B C", then the output would be A B C
istringstream iss(s);
string temp;
int _i = 0;
while (!iss.eof())
{
cout << _i << " iss stat[good,bad,fail,eof]: [" << iss.good() << iss
.bad() <阅读全帖
i***s
发帖数: 39120
11
“12LVE”的摄影展
小男孩在观看展览
北京时间12月23日早间消息,近日美国数位艺术家迈克尔?汤姆伯特(Michael Tompert)举办了一场名为“12LVE”的摄影展,他采用火车碾压、枪击、电锯和锤子等各种极富创意的方式摧毁iPhone、iPad或 Macbook Air等苹果电子产品,然后拍摄下来并制作成12张巨幅高分辨率照片展出,以此呼吁人们反思人与电子产品之间的关系。
该展览展示了12张被摧毁的苹果产品的图片,其中的苹果产品包括iPhone 3G、iPhone 4、Macbook Air和iPod Nano。这些色彩斑斓、印刷精美的照片目前正在加州帕洛阿尔托WhiteSpace美术馆展出,展出地址距离苹果库伯蒂诺总部距离并不远。
这名艺术家在一份声明中表示,“这些图片将促使人们反思其与偶像、时尚、自由和奴役之间的关系。”
或许有人会因此为汤姆伯特打上憎恶苹果的标签,但事实上,他曾是苹果公司图形设计团队的一员,早期也是苹果产品的粉丝。
他表示,这个展览的创意来自于他的两个儿子。当时,孩子们正在为他送的iPod touch游戏而争吵不休,他不愿再看到两个儿子争吵下去,为了强... 阅读全帖
P********l
发帖数: 452
12
来自主题: JobHunting版 - Facebook Hacker Cup
3rd:
Studious Student
You've been given a list of words to study and memorize. Being a diligent
student of language and the arts, you've decided to not study them at all
and instead make up pointless games based on them. One game you've come up
with is to see how you can concatenate the words to generate the
lexicographically lowest possible string.
Input
As input for playing this game you will receive a text file containing an
integer N, the number of word sets you need to play your game agains... 阅读全帖
l*********y
发帖数: 142
13
来自主题: JobHunting版 - 问一道multiset的题
第一次用multiset,不知道怎么用
题目应该很简单的,蛮力排序的话会超时。
网上的评论是
Easy. Don't use cin or cout and you could use a multiset :)
实在无语。没想出怎么用multiset。
谁给解释一下。谢谢了!
Problem H: Hoax or what
Each Mal-Wart supermarket has prepared a promotion scheme run by the
following
rules:
* A client who wants to participate in the promotion (aka a sucker) must
write down their phone number on the bill of their purchase and put the
bill into a special urn.
* Two bills are selected from the urn at the end of each day: first the
... 阅读全帖
c**********e
发帖数: 2007
14
来自主题: JobHunting版 - 有人在玩 Facebook 的黑客杯吗?
Can anybody look at this problem? The answer seems different from mine. 我觉
得答案不对。
Facebook Hacker Cup 2011 Round 1A
First or Last
As a top driver in European racing circles, you find yourself taking more
than your fair share of risks. You go into every race knowing it may be your
last, but generally with the suspicion it won't be. Today, however, may
turn out to be different. The Fédération Internationale de l'Automobile
has sanctioned a new track in the Bernese Alps that may prove to be death o... 阅读全帖
p*****2
发帖数: 21240
15
来自主题: JobHunting版 - 报个offer@FG,回报版面

Some engineers got tired of dealing with all the different ways of encoding
status messages, so they decided to invent their own. In their new scheme,
an encoded status message consists of a sequence of integers representing
the characters in the message, separated by spaces. Each integer is between
1 and M, inclusive. The integers do not have leading zeroes. Unfortunately
they decided to compress the encoded status messages by removing all the
spaces!
Your task is to figure out how many differ... 阅读全帖
p*****2
发帖数: 21240
16
来自主题: JobHunting版 - 报个offer@FG,回报版面

Some engineers got tired of dealing with all the different ways of encoding
status messages, so they decided to invent their own. In their new scheme,
an encoded status message consists of a sequence of integers representing
the characters in the message, separated by spaces. Each integer is between
1 and M, inclusive. The integers do not have leading zeroes. Unfortunately
they decided to compress the encoded status messages by removing all the
spaces!
Your task is to figure out how many differ... 阅读全帖
l*********8
发帖数: 4642
17
来自主题: JobHunting版 - Text Justification
这个题目很容易出错啊。
我写在纸上的程序好几个bugs。
加上在电脑的调试修改的时间,我总共花了两个小时才让程序基本正确(还不敢保证百分百正确,可能需要更多的测试案例)。这么慢怎么面试啊?
下面是程序(测试程序就不贴了):
void JustifyOneLine(const vector & words, int L, int lineStart, int
& lineEnd, vector & blankNum)
{
blankNum.clear();
int lengthSum = words[lineStart].size();
for (lineEnd = lineStart+1; lineEnd < words.size() && lengthSum + 1 +
words[lineEnd].size() <= L; lineEnd++) {
lengthSum += 1 + words[lineEnd].size();
blankNum.push_back(1);
}
int ... 阅读全帖
l*********8
发帖数: 4642
18
来自主题: JobHunting版 - Text Justification
这个题目很容易出错啊。
我写在纸上的程序好几个bugs。
加上在电脑的调试修改的时间,我总共花了两个小时才让程序基本正确(还不敢保证百分百正确,可能需要更多的测试案例)。这么慢怎么面试啊?
下面是程序(测试程序就不贴了):
void JustifyOneLine(const vector & words, int L, int lineStart, int
& lineEnd, vector & blankNum)
{
blankNum.clear();
int lengthSum = words[lineStart].size();
for (lineEnd = lineStart+1; lineEnd < words.size() && lengthSum + 1 +
words[lineEnd].size() <= L; lineEnd++) {
lengthSum += 1 + words[lineEnd].size();
blankNum.push_back(1);
}
int ... 阅读全帖
z******u
发帖数: 30
19
来自主题: JobHunting版 - twitter 面经(Update)
Update:Recruiter 一直没理我,以为三面面挂了, 结果前两天又给我发信让接着面
。 这都一个月了, 估计是放在waiting list里了。 不过已经拿到很想去的offer,
且被他家恶心到了, 就回复说不想再面了。
希望对要面他家的人有帮助。
1 面,印度女面的。
1。 找出一个array中的所有两数的和是一个给定的值, 我用hashset 作的。
2。 找出一个tree中所有pair of nodes with path of d。
其中tree中的node 给的是个array of nodes, node 只知道自己的父亲。 要先写程序
算出tree。
2面, 貌似美国人。
1。 把一个integer convert 一下, 比如 input 是123, 生成321。 延伸一下如果是
负数怎么办。
2。 给一个tree, 如何计算从root到leaf的最短路径。 我先给出recursive method,
后来又用BFS, level by level visit, 再improve 用两个queue BFS。
这轮面的挺好, 面完recruiter 马上就给了on... 阅读全帖
z******u
发帖数: 30
20
来自主题: JobHunting版 - twitter 面经(Update)
Update:Recruiter 一直没理我,以为三面面挂了, 结果前两天又给我发信让接着面
。 这都一个月了, 估计是放在waiting list里了。 不过已经拿到很想去的offer,
且被他家恶心到了, 就回复说不想再面了。
希望对要面他家的人有帮助。
1 面,印度女面的。
1。 找出一个array中的所有两数的和是一个给定的值, 我用hashset 作的。
2。 找出一个tree中所有pair of nodes with path of d。
其中tree中的node 给的是个array of nodes, node 只知道自己的父亲。 要先写程序
算出tree。
2面, 貌似美国人。
1。 把一个integer convert 一下, 比如 input 是123, 生成321。 延伸一下如果是
负数怎么办。
2。 给一个tree, 如何计算从root到leaf的最短路径。 我先给出recursive method,
后来又用BFS, level by level visit, 再improve 用两个queue BFS。
这轮面的挺好, 面完recruiter 马上就给了on... 阅读全帖
t****a
发帖数: 1212
21
这是多年前的一篇牛文。一家之言,仅供参考。
通天塔导游
(译注:圣经记载:在远古的时候,人类都使用一种语言,全世界的人决定一起造一座
通天的塔,就是巴别塔,后来被上帝知道了,上帝就让人们使用不同的语言,这个塔就
没能造起来。 巴别塔不建自毁,与其说上帝的分化将人类的语言复杂化,不如说是人
类自身心灵和谐不再的分崩离析。之所以后来有了翻译,不仅是为了加强人类之间的交
流,更寄达了一种愿望,希望能以此消除人际的隔阂,获求来自心灵的和谐及慰藉。真
正的译者,把握血脉,抚平创痕,通传天籁,开启心门。)
这是我写的旋风式的编程语言简介—我本来为亚马逊开发者杂志本月的期刊写的,但是
发现我写的东西没法…见人。
首先,我偶尔一不小心口出脏话,或者对上帝不恭的话,所以对很官方很正式的亚马逊
上发表是不合适的; 所以我就把它塞到我的博客里了,我的博客反正没人看的。除了你
以外。是的,只有你会看,你好啊。
其次,这是一项进行中的工程,现在只是东打一耙西搞一下,还没有精加工过的。又一
个把它写到博客里的很大的理由。不需要很好,或很完整。就是我今天想说的一些话。
请随便!
我的旋风式简介会讲C,C++,Lis... 阅读全帖
o****d
发帖数: 2835
22
来自主题: JobHunting版 - 关于atoi的overflow
http://discuss.leetcode.com/questions/192/string-to-integer-ato
Am I right?
We can separate INT_MAX and INT_MIN to first n-1 digits and last one digit,
which can be used to check overflow before the answer really overflows. Note
that abs(INT_MIN)=INT_MAX+1.
class Solution {
public:
int atoi(const char *str) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
int pos=0;
//skip whitespace
while(str[pos]==' ')pos++;
//check if negative
int negative=0;
if(... 阅读全帖
p****o
发帖数: 46
23
来自主题: JobHunting版 - 问一个关于stringstream的诡异问题
you can check output position for insert (tellp) and input position for
extraction (tellg).
string str = "abc xyz";

stringstream stream(str);
// tellp() returns 0; tellg returns 0;

cout << stream.str() <
stream >> str;

// extract: input moves from 0 to 3 (tellg() ==3), which is the
whitespace position
cout << str < stream << str;
// insert: since no insertion so far, output position is still 0,
so it ... 阅读全帖
a**********0
发帖数: 422
24
来自主题: JobHunting版 - 发个我总结的unix常用命令
The Unix Commands
其实就是攒了一下网上的资料
# Create a new tar archive.
# the folder dirname/ is compressed into archive_name.tar
tar cvf archive_name.tar dirname/
# Extract from an existing tar archive
tar xvf archive_name.tar
# View an existing tar archive
tar tvf archive_name.tar
# Search for a given string in a file (case in-sensitive search).
grep -i "the" demo_file
# Print the matched line, along with the 3 lines after it.
grep -A 3 -i "example" demo_text
# Search for a given string in all files recur... 阅读全帖
c***w
发帖数: 134
25
来自主题: JobHunting版 - Amazon入职两个月就被pip 求支招
乱七八糟说几点:
亚麻到处都需要用人,如果你能做基本的修bug,写简单的小feature,他干嘛不用你呢
?LZ就是太懒,这么好的机会不知道抓住。空格,你在eclipse里面可以设置,用
whitespace代替tab,这样CR时候不会有锁进问题。你这个小问题可以问起他随便中国
人都可以。你的manager给你的目标不难实现,但是如果你没有熬夜不睡觉一定搞定的
精神,那你的亚麻之旅就没戏了。
很多事情你可以做去提高大家对你的好感。比如问问题可以,但是不能次数多,不能问
wiki能搜到的问题,大部分问题问一遍,然后就要自己思考。不能在别人忙的时候问不
急的事情。别人有小忙主动帮忙做。关心老板在烦恼什么,主动和他1on1,你都做到了
吗?
亚麻里很多组的经理很aggresive,很push,手下压力很大,但是很容易出成绩,出
feature,做出来的东西也有影响力,现在谁不考虑用AWS?我也在养老公司待过,大家
都很和善,但是日子除了闲就是闲,每天工作几个小时,很无聊。年轻人忙一点不是更
好?
你应该在这次危机过去后待满一年,再考虑去sales组。做AWS的销售是一件非常幸福的
事情,也许... 阅读全帖
c***w
发帖数: 134
26
来自主题: JobHunting版 - Amazon入职两个月就被pip 求支招
乱七八糟说几点:
亚麻到处都需要用人,如果你能做基本的修bug,写简单的小feature,他干嘛不用你呢
?LZ就是太懒,这么好的机会不知道抓住。空格,你在eclipse里面可以设置,用
whitespace代替tab,这样CR时候不会有锁进问题。你这个小问题可以问起他随便中国
人都可以。你的manager给你的目标不难实现,但是如果你没有熬夜不睡觉一定搞定的
精神,那你的亚麻之旅就没戏了。
很多事情你可以做去提高大家对你的好感。比如问问题可以,但是不能次数多,不能问
wiki能搜到的问题,大部分问题问一遍,然后就要自己思考。不能在别人忙的时候问不
急的事情。别人有小忙主动帮忙做。关心老板在烦恼什么,主动和他1on1,你都做到了
吗?
亚麻里很多组的经理很aggresive,很push,手下压力很大,但是很容易出成绩,出
feature,做出来的东西也有影响力,现在谁不考虑用AWS?我也在养老公司待过,大家
都很和善,但是日子除了闲就是闲,每天工作几个小时,很无聊。年轻人忙一点不是更
好?
你应该在这次危机过去后待满一年,再考虑去sales组。做AWS的销售是一件非常幸福的
事情,也许... 阅读全帖
g****w
发帖数: 523
27
这个星球上有实力开发这样内部程序的公司也许有,但一定不是亚麻。听说亚麻连内部
ide都没有,用的就是eclipse。
如果是eclipse的话可以Preferences -> Java -> Editor -> remove trailing
whitespace
实际工作中不建议用,写代码就像写文章,多一个空格少一个空格都有讲究。
h******k
发帖数: 810
28
来自主题: JobHunting版 - 感觉刷题时代真的快过去了
找第一份工的时候,三个公司问了三遍atoi。
最后直接告诉对方:注意正负注意溢出忽略leading whitespaces遇到non-numeral停止
,还有BSD stdlib里atoi是strtol的wrapper。惊得他下巴都掉了。
t******d
发帖数: 1383
29
来自主题: JobHunting版 - 这个isNumber错在哪里?
做了个望上的测试,结果昨天晚上做了,今天被据了。请刷了poj的看看。 这哪里还有
bug?
跑出来的结果是
the number 007 is a number: false
the number 0.5 is a number: true
the number .01 is a number: true
the number 9. is a number: true
the number 1.000 is a number: true
the number 00.5 is a number: false
the number -.005000 is a number: true
我看着没问题
public class IsNumber {
/**
* The IsNumber function takes a String and returns true if that string
is a number, and false otherwise.
* This implementation, however, has several bugs in ... 阅读全帖
h**********9
发帖数: 3252
30
来自主题: Stock版 - NOK有啥消息吗?
有没有大牛能鉴别一下这 White Space Phone 靠不靠谱?
http://www.dailywireless.org/2011/04/01/nokia-microsoft-white-s
http://www.microsoft.com/presspass/emea/presscentre/pressreleas
When Nokia announced that it will drop Symbian for Microsoft’s Windows
Mobile, many in the industry were taken by surprise. Now, according to
industry insiders, the strategy is becoming clear: Nokia will use Microsoft
’s patented “white spaces” radio, enabling wireless devices to use
television frequencies.
The two firms have apparent... 阅读全帖
l*****4
发帖数: 25
31
来自主题: Working版 - Need advice
Seems like a very common issue between different coders.
What I like to go about, if you ask me, is a more passive approach,
considering you are buddies.
Two things you can do to show him. 1. Keep bugging him, when it comes to his
codes. 2. Show him a good example of coding style in, e.g. indentation,
whitespace, commenting and OO structure etc., if you are going to work on a
shared code base.
w***g
发帖数: 5958
32
来自主题: CS版 - Python 很牛逼了么?
没有括号倒无所谓。Pascal也没有括号,用begin和end也挺自在的。最不爽的还是
significant whitespace。Style跟语法是正交的,应该由编辑器支持,而不是由编译
器管。现在大部分人觉得python可以主要还是因为目前还没有比从左边缩进更先进的
style,但保不准哪天就有了呢?再说人家阿拉伯人编程序可能愿意从右边缩进,在
python这边不就没办法啦。要是有一种语言规定变量名必须用匈牙利命名法,我们肯定
都会觉得很可笑。在我看来Python和那也是一回事。
不过我觉得对python过分苛责是不公平的。python出现那阵还是编程语言百家争鸣的时
候,啥东西没有?比起大部分被历史淘汰的语言而言,python的流行还是有他的道理的。
y****r
发帖数: 17
33
is your table MYISAM?
why you put whitespace after Difficult in your 2nd query?

but
why?
)&
')
m**l
发帖数: 306
34
来自主题: Programming版 - whitespace 问题
我先把C++算出来的值转换为字符串(std::string), 比如说是"22333", 因为格式要求
变为"22 333"(仍然是std::string), , 然后把这个值和预先写在XML文件中的"22 333"
比较, 总是说不同, 不知道是为什么?
先谢了!
N*********y
发帖数: 105
35
来自主题: Programming版 - whitespace 问题
"22333"和"22 333"什么关系?你这个格式怎么定义的?跟踪过代码了么?到底你的代
码比较的是两个什么样的串?贴代码吧。

333"
c***d
发帖数: 996
36
☆─────────────────────────────────────☆
goodbug (好虫) 于 (Mon Dec 11 15:10:02 2006) 提到:
I am writing a shell like program which should be able to parse
mycommand path="/path/my program/..." file=....
how do I write a regex that will split strings with space but not
between matching quotations marks like in path? Thanks for any input.
☆─────────────────────────────────────☆
eecareer (聪明人但总办糊涂事) 于 (Mon Dec 11 15:31:01 2006) 提到:
difficult, why don't you just remove any blank spaces in
r****t
发帖数: 10904
37
来自主题: Programming版 - 问一个python的string split问题
a.split?
Type: builtin_function_or_method
Base Class:
String Form:
Namespace: Interactive
Docstring:
S.split([sep [,maxsplit]]) -> list of strings

Return a list of the words in the string S, using sep as the
delimiter string. If maxsplit is given, at most maxsplit
splits are done. If sep is not specified or is None, any
whitespace string is a separator
e*n
发帖数: 1511
38
来自主题: Programming版 - 问一个python的string split问题
缺省没有参数调用的,跳过所有的whitespace.
从python源码看上去是用了c里面的 isspace 函数。
你的问题可以作类似处理,就是自己定义一个函数,把所有你要得东西都替换到一个同
样的字符,然后再用split.
d****e
发帖数: 251
39
来自主题: Programming版 - 关于matlab一问
dlmread will do the job of "option 1"
dist_matrix = dlmread('filename') % by default the delimiter is whitespace
% ignore first column
dist_matrix = dlmread('filename',' ',0,1)
r*******n
发帖数: 3020
40
来自主题: Programming版 - Linux and Shared object
3.4. Creating a Shared Library
Creating a shared library is easy. First, create the object files that will
go into the shared library using the gcc -fPIC or -fpic flag. The -fPIC and
-fpic options enable ``position independent code'' generation, a requirement
for shared libraries; see below for the differences. You pass the soname
using the -Wl gcc option. The -Wl option passes options along to the linker
(in this case the -soname linker option) - the commas after -Wl are not a
typo, and you mus... 阅读全帖
r*********r
发帖数: 1892
41
来自主题: Programming版 - 语言区别
一位美国CS写的,各位大拿如何看?
The Languages
C++ is well-suited for large projects because it has an object-oriented
structure. People can collaborate on one program by breaking it up into
parts and having a small group or even one individual work on each part. The
object-oriented structure also allows code to be reused a lot, which can
cut down development time. C++ is also a fairly efficient language -
although many C programmers will disagree.
C is a popular language, especially in game programming, becau... 阅读全帖
t*********l
发帖数: 30
42
来自主题: Unix版 - some useful (hopefully) sed command
*double space a file
sed G
*under UNIX convert DOS newline (CR/LF) to Unix format:
sed 's/.$//'
sed 's/^M$//' #^M should be input like this: Ctrl-V Ctrl-M
*delete leading whitespaces
sed -e 's/^[ ^t]*//' #^t (table): Ctrl-V Ctrl-I
*delete all CONSECUTIVE blank lines from file except the first
sed '/./,/^$/!d' #this will allows 0 blank at top
#in (t)csh, you may want to use \!
sed '/^$/N;/\n$/D' #allowas 1 blank at top, 0 at EOF
*de
a*****1
发帖数: 11
43
来自主题: Unix版 - 简单的删除文件问题
not working if whitespaces show up in a filename containing 'ss'
w*****s
发帖数: 122
44
来自主题: XML版 - Perl XML FAQ--4
Q16: Is it possible to read in several documents from a stream?
You can read multiple documents from a stream by using the parse_start
method in place of of parse or parse_file, which creates a new instance of
XML::Parser::ExpatNB. Multiple documents are parsed by making successive
calls to the parse_more method. Calling the parse_done method signifies
that you
have are done processing the document.
Q17: How can I filter out extraneous whitespace whilst processing text?
You c
b*****i
发帖数: 491
45
来自主题: XML版 - question: tuple in xml
a xml fragment like this or two values seperated by a whitespace
i***r
发帖数: 6012
46
来自主题: Computation版 - 大家还是bilingual吧
For those who don't know perl, Python is the best thing.
Scripting for everyday data processing, for text processing, for the
bioinfomatics folks, etc.
One reason is that the language forces you to be clean, mandatory whitespace
helps to keep programs clean. Plus, the language has become faster in the past
couple years. Maturity also comes with many libraries, there is at least a
numerical package, and many other ackages.
good luck.

wrong?).
1 (共1页)