O*****c 发帖数: 171 | 1 Python: 有一个混合了子list和string的list, 如何判断元素是list还是string?
比如一个 isstring, islist之类的function or methods
thanks |
|
z***e 发帖数: 5393 | 2 【 以下文字转载自 JobHunting 讨论区 】
发信人: zlike (最终幻想), 信区: JobHunting
标 题: 问一个题,1 billion string如何处理
发信站: BBS 未名空间站 (Thu Nov 8 22:43:37 2007)
两个文件,每个文件里面有one billion 个string
找两个文件中重复的string.
我想出来的办法用了外部文件。
请指点,谢谢。 |
|
c***g 发帖数: 472 | 3 the return type of + of string is a string
and one of the operands of + must be string |
|
t*i 发帖数: 72 | 4 我有些数据存在文件中,我想用C++读入这个文件。 读入的时候一般都读成String
type. 我需要用文件中变量做计算的时候就要把他们换成int or fload type. C++支持
Cstring and string class. 请问我必须要用cstring才能完成char-->int, float转换
,还是用String class也可以。如果两种都可以,能不能比较一下两者的优劣。
非常感谢。 |
|
x****t 发帖数: 389 | 5 比如我有一个
string A="God";
string B=a.at(0);
编译通不过,我只是想把第一个G赋值给string B,有没有其他办法?谢谢! |
|
b***i 发帖数: 3043 | 6 suppose "is" is the istreamstring varaible, which contains the whole line:
txt1 txt2 , 1, 2, 0, 3 ,
what I did was, to use is>>string1; to read first string, because space is
the delination char, then I use getline(is, sring2, ","); to read the second
string, such as txt2. then, I use a while loop to read the numbers
while(getline(is, ss, ','))
{
cout<
istringstream(ss)>>i;
cout<
}
but string thing is, the last number, was 0 if I use ato |
|
l*****c 发帖数: 1153 | 7 竟然被强迫用JAVA,唉。
怎么样reallocate一个指定长度的String?我需要对一个output String做大量的
append操作(Million级别),需要尽可能的efficient的来做。最终String的总长度是
事先知道的。所以照C++来说,当然是preallocate space然后往里填效率高。 |
|
d****n 发帖数: 130 | 8 用C-style string不安全, 用STL string效率不高啊, 因为string是immutable, 插入
字符什么的很不方便, 用vector, deque也看着很笨.
大家一般用什么? |
|
b******w 发帖数: 52 | 9 I am a little confused about the sizeof(string) = 4.
Since string is a specialized basic_string, and basic_string is derived
from _String_base.
_String_base has three protected pointers:
_Tp* _M_start;
_Tp* _M_finish;
_Tp* _M_end_of_storage;
thus sizeof(string) should be 12 instead of 4?
is there anybody to elaborate on this?
template
class _Traits = char_traits<_CharT>,
class _Alloc = __STL_DEFAULT_ALLOCATOR(_CharT) >
class basic_string;
typedef basic_ |
|
g*****g 发帖数: 34805 | 10 immutable string is not a problem, you just need a mutable string
builder when you need efficiency. Actually immutable string improves
memory efficiency, there's only one copy in the VM.
For java you can find StringBuilder/StringBuffer, I guess python
would have something similar. |
|
c*m 发帖数: 1114 | 11 .net里面的string也是immutable的,这个好像是趋势。原因是string支持连接等操作,
定义成immutable可以避免出现一个string一部分在内存这里,一部分在那里的内存处理
麻烦。。
分片连起来的话可以用stringbuilder,不影响效率。 |
|
r****t 发帖数: 10904 | 12 Seriously, strings in python need to be immutable, otherwise they cannot
be used as keys of dicts. I did not know 3.0 has string mutable now.
For your need, StringIO/struct may work just fine. Its there for years. Or
maybe you need to switch to use list instead of string. |
|
d****p 发帖数: 685 | 13 #include
std::vector tokens;
boost::split(tokens, "value1;value2;value3;value4", boost:is_any_of(";");
// now tokens[i] = "value"
a |
|
g*****g 发帖数: 34805 | 14 As I say, you can't share storage between 2 string instances
unless it's the same immutable string.
If you want to use a linked list, you have to duplicate the
linked list, which negate all the benefits of faster concatenation.
And if you don't, let's say String a = b + c, now you make a change
to c, a is changed too, probably not what you want.
memory
two. |
|
l********a 发帖数: 1154 | 15 测试没问题啊,把字符串里面的\改成\\
测试代码
void dos2u(string& path)
{
string newpath = path+"abcd";
cout << newpath.c_str() << endl;
}
int main()
{
string path("c:\\test");
cout << path.c_str() << endl;
dos2u(path);
return 0;
} |
|
m*********a 发帖数: 3299 | 16 啥也不会发生,在c++中"\0"就是string中的一个char。
c++的string是一个object,他有他的fields,methods(如size,insert,erase,append,
replace),constructors and destructors。
c中string是一个array 完全不同 |
|
w**2 发帖数: 724 | 17 【 以下文字转载自 Linux 讨论区 】
发信人: wds2 (阿旺), 信区: Linux
标 题: Hex byte string syntax in perl please
发信站: BBS 未名空间站 (Thu Feb 26 18:21:00 2015, 美东)
so i have a ascii string: 11, 22, 33 ,
(ascii 22 is not readable),
what's the syntax in perl for this string pls,
$str = "0x112233" ?
thanks ! |
|
t***q 发帖数: 418 | 18 如题,要建一个 web service, 有 query string 的功能。主要是,有一个 影视作品
的title 进来,用 web service 里的 一些function, 和已有的一个 flat file, 那个
flat file里,有许多影视作品的 title , 及其他一些信息, 用这个 flat file, 和
已输入的 title, 算出与之最相似的影视作品的title, 然后 call 相关 url 后, 能
有一个 hash table 输出, 其中有最相近的 title , 和 相似率, 一个类似
confidence level 的东西。
例子如下:
http://www.dreamsyssoft.com/python-scripting-tutorial/create-si
现在就是不知道如何把query string , 还有算 相似度的function 加进去。其实自己
也不知道这个例子到底有没有用,对这个问题。谁能说说?还有就是哪位能给个 web
service 用 query string的标准的例子,链接之类的。多谢! |
|
|
p*****R 发帖数: 74 | 20 I want to replace a string with another string in all files
under a directory, including subdirectories. Could you tell
me what UNIX command can do this? btw, can I use grep to
find a string in all the
subdirectories recursively? |
|
M*****t 发帖数: 40 | 21 I know how to do in Unix script.
but I don't know how to do it in Windows(NT) DOS script.
string is "c:\a\b\c\d\file"
How can I write the script to return "file" only from above string?
[Note: the above string is just an example, it stands for any path with any
length.]
Thanks a lot! |
|
O*****c 发帖数: 171 | 22 Find string file* 怎么才能让不含 string的文件名别出现? |
|
d******g 发帖数: 550 | 23 I am tring to print a long string len>2000 in VB.
I tried a simple
print #2, temp$
temp$ is the long string.
But my eiditor shows an error. probably my editor can not handle that long
string. What can I do to fix that? thanks |
|
T*********r 发帖数: 11175 | 24
??
你太高估string了吧
string预言hierarchy问题一定要low energy susy解决?
string对低能本来就没什么好说的 |
|
a**u 发帖数: 99 | 25 Why did string enter the story?
Particle physics interactions (top) occur at zero distance, but string
interactions (bottom) don't. That's what makes string theory more
successful as quantum theory of gravity.
Relativistic quantum field theory has worked very well to describe
the observed behaviors and properties of elementary particles. But the
theory itself only works well when gravity is so weak that it can be
neglected. Particle theory only works when we pretend gravity doesn't
exist.
Genera |
|
S*********g 发帖数: 5298 | 26 LINK of this post:
http://www.physics.ucsb.edu/~jpierre/strings/basics.htm
SUPERSTRINGS! String Basics
We are used to thinking of fundamental particles (like
electrons) as point-like 0-dimensional objects. A
generalization of this is fundamental strings which are
1-dimensional objects. They have no thickness but do have a
length, typically 10^(-33) cm [that's a decimal point
followed by 32 zeros and a 1]. This is very small compared
to the length scales that we can reasonably measure, so
these |
|
S*********g 发帖数: 5298 | 27 " target="_blank" class="a2">http://www.physics.ucsb.edu/~jpierre/strings/susy.htm
——————————————————————————————————————————
SUPERSTRINGS! Supersymmetric Strings
There are two types of particles in nature - fermions and bosons. A fundamental
theory of nature must contain both of these types. When we include fermions in the worldsheet theory of the string, we automatically get a new type of
symmetry called supersymmetry which relates bosons and fermions. Fermions and
bosons are grouped together |
|
l*****8 发帖数: 483 | 28 aa=substr(string,1,length(string)-length(scan(string,-1,' '))); |
|
l*****8 发帖数: 483 | 29 第一个 ‘_‘ aa=indexc(string, '_');
第二个 ’_‘ aa=length(string)-length(scan(string,-1,'_')); |
|
g******d 发帖数: 231 | 30 想把一个string variable A 变成一个numeric variable B, 有这么两种情况 -
1、如果A的value是四位的string,转换后应 X 100。比如,A='9506', then B=950600
; or A='0007', then B=700。
2、如果A的value是六位的string, 转换后应保持不变。比如,A='100591', then B=
100591; or A='000802', then B=802。
只要处理这两种情况就好了。请问有什么简便的方法没有?多谢!! |
|
u*****o 发帖数: 1224 | 31 我是菜鸟。。。刚刚上班不久就遇到一个不太解决的了的问题,希望牛牛们给点指点,
让我好知道如何下手,马上要和老板谈思路,怕自己什么也说不出来。
我现在有两组数据,第一组是navigator的User-agent string,我们叫它A
一个例子就是
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0;
SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media
Center PC 6.0; .NET4.0C; .NET4.0E; BRI/1; MDDC; InfoPath.1; BRI/2)
另一组数据时browser的user-agent string,我们叫它B
一个例子是
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)
我不太清楚具体两组数据是如何收集的,但都是针对同一个user的browser收集的数据,
我现... 阅读全帖 |
|
m*******I 发帖数: 1049 | 32 no string attached是一个爱情喜剧,是曾经十三岁时
出演这个杀手不太冷的犹太人natalie portman和戴米-摩尔
的帅哥魅力老公ashton kutcher一起合演的。natalie portman
是一个住院医生,和其他的住院医生一起,住一个大房子里。
kutcher是她偶然碰到的,然后他们开始做爱,但是他们有一个
口头的协议,就是只有性,不谈情,也就是no strings attached。
当然,后面发生了好多故事,好莱坞的故事套路成为一个模版,
他俩从sex开始,发现最后彼此喜欢,难以割舍,最后轰轰烈烈,
荡气回肠,以欢笑和团聚为结尾。
然而现实生活里这样的no strings attached的操作性如何,能
有多少人知道,毕竟纯粹因为sex而见面相约的应该不多吧,
而且不必彼此付出情,和责任,sex变的简单而又简单。
电影当然因为portman和kutcher的参与而吸引大家去看,晚场,
稀稀拉拉的就几十个人吧,有三个单身年轻女性聚堆看,有的
是年轻的一对,中间有笑的片段,整体来说好不错,如果你喜欢
主角中的任何一个,这个电影还是值得看的。 |
|
u*****o 发帖数: 1224 | 33 我是菜鸟。。。刚刚上班不久就遇到一个不太解决的了的问题,希望牛牛们给点指点,
让我好知道如何下手,马上要和老板谈思路,怕自己什么也说不出来。
我现在有两组数据,第一组是navigator的User-agent string,我们叫它A
一个例子就是
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0;
SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media
Center PC 6.0; .NET4.0C; .NET4.0E; BRI/1; MDDC; InfoPath.1; BRI/2)
另一组数据时browser的user-agent string,我们叫它B
一个例子是
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)
我不太清楚具体两组数据是如何收集的,但都是针对同一个user的browser收集的数据,
我现... 阅读全帖 |
|
w*******y 发帖数: 60932 | 34 Elmer's Education KinderReady Eric Carle String Along
Elmer's kinder ready series features the eye-catching artwork of eric carle
Each activity has great visuals tons of fun and loads of learning
In the string along skill building kit you find 16 activity cards 1 lace for
stringing 24 colored beads
This develops hand eye coordination as it teaches recognition of patterns
and sequences
For ages 3 and up
now just $3.90 with Free Super Saver Shipping!
Next lowest price on Google is $11.95
Click HER |
|
|
w*******y 发帖数: 60932 | 36 Home Depot is offering $3 trade-in of incandescent lighting to apply to
purchase of LED Christmas light strings, valid from 11/4/10 through 11/14/10
.
Lights are on sale for $5.97 - less $3.00 trade-in, making final cost $2.97.
Received this today in my e-mail as Home Depot Garden Club Member.
Happily Holidays!
See attached for details.
|
|
w*******y 发帖数: 60932 | 37 Here you go.
Link:
http://www.musiciansfriend.com/orchestral-strings/super-sensiti
Super-Sensitive's Red-Label is one the most popular student strings in
America. Economically priced, the strings are made with high quality winding
and core materials providing the durability and dependability required by
the school orchestra programs. Made in USA.
|
|
w*******y 发帖数: 60932 | 38 Best Buy has Schecter - C1 Blood Moon 6-String Full-Size Electric Guitar -
Blood Red @ $399 + tax + FS
Description from the site
The spooky blood moon inlays on this guitar give it a hard rock look, but
the 2 Duncan Designed HB-102 humbuckers, quilted maple top and mahogany body
will appeal to players of all styles.
WHAT'S INCLUDED
Schecter C1 Blood Moon 6-String Full-Size Electric Guitar
Owner's manual
PRODUCT FEATURES
From our expanded online assortment; not available in all Best Buy stores
Qu... 阅读全帖 |
|
S**n 发帖数: 486 | 39 Hi All,
Shen Stringing will open for business during XiYu Open. It'll usually take
about 45 min for me to string a racket without any other thing that catch my
attention. Feel free to drop off the racket for me anytime. However, I only
have limited strings available (BG 65, BG 65Ti, BG 85, Nano 95).
Thanks!!! |
|
S**n 发帖数: 486 | 40 $18 is not that bad, I used to get my racket string about $25 using their
strings, even if I have my own strings, they still charged me $14 for the
labor. Actually, I charge $10 for the labor, and $4 for BG65 and BG65Ti. So
I am not exactlly that cheap.... |
|
S**n 发帖数: 486 | 41 Hi All,
Sorry to inform all my new stringing price. Due to recent price increase in
strings, I have to increase my stringing as well too. Here are the breakdown:
Labor: $10 (same as usual)
BG65: $ 5
BG65Ti: $6
BG85: $7
Nano95: $8
Sorry for the price change........>< All I can do is not increase my labor..
... |
|
s********n 发帖数: 56 | 42 我想卖的物品:
AA voucher $[email protected]
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
过期日:11-05-2014
单张面值:
200
可接受价格(必须明码标价!):
200*0.86=172
物品新旧要求:
邮寄方式要求:
买卖双方谁承担邮寄损失(Required if not code only):
... 阅读全帖 |
|
h****n 发帖数: 4960 | 43
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){... 阅读全帖 |
|
t**0 发帖数: 1991 | 44 二手交易风险自负!请自行验证是否合法和一手卡!:
我想卖的物品:
$600 ToysRus [email protected]
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
单张面值:
$25
可接受价格(必须明码标价!):
0.9
物品新旧要求:
new
邮寄方式要求:
free code or you choose you pay
买卖... 阅读全帖 |
|
p*******y 发帖数: 89 | 45 二手交易风险自负!请自行验证是否合法和一手卡!:
我想卖的物品:
AA e-voucher [email protected]
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
, 250x3
单张面值:
250
可接受价格(必须明码标价!):
[email protected]
(function(){try{var s,a,i,j,r,c,... 阅读全帖 |
|
n***e 发帖数: 651 | 46 二手交易风险自负!请自行验证是否合法和一手卡!:
y
我想卖的物品:
Walmart GC [email protected]
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
0.96 for RMB
单张面值:
可接受价格(必须明码标价!):
@0.95
0.96 for RMB
物品新旧要求:
邮寄方式要求:
买卖双方谁承担邮寄损失(R... 阅读全帖 |
|
d*******6 发帖数: 1247 | 47 ***只要帖子还在 就一直有货***
*****************************
二手交易风险自负!请自行验证是否合法和一手卡!:
Y
我想卖的物品:
AT&T prepaid REFILL CARD $[email protected]
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
单张面值:
100
可接受价格(必须明码... 阅读全帖 |
|
s*****a 发帖数: 545 | 48 二手交易风险自负!请自行验证是否合法和一手卡!:
Y
我想卖的物品:
Dell GC 单张$[email protected]
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
单张面值:
$550
可接受价格(必须明码标价!):
0.92
物品新旧要求:
邮寄方式要求:
email code or ycyp
买卖双方谁承担邮寄损失(Requi... 阅读全帖 |
|
x******e 发帖数: 1428 | 49 二手交易风险自负!请自行验证是否合法和一手卡!:
y
我想买的物品:
Walmart GC [email protected]
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
单张面值:
可接受价格(必须明码标价!):
@0.95
物品新旧要求:
邮寄方式要求:
买卖双方谁承担邮寄损失(Required if not code only):
... 阅读全帖 |
|
y*****7 发帖数: 1555 | 50 二手交易风险自负!请自行验证是否合法和一手卡!:
y
我想卖的物品:
12 * 10 Itunes [email protected]
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
单张面值:
10
可接受价格(必须明码标价!):
@0.86
物品新旧要求:
New
邮寄方式要求:
code only
买卖双方谁承担邮寄损失(Require... 阅读全帖 |
|