2009年11月7日星期六

[PerlChina] Re: 请教如何把日期中的中文规换为-号?

是的,但是如显用其它中文代替年月日这种情况,单纯替换中文似乎不行.

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教如何把日期中的中文规换为-号?

把年和月都替换成- 日去掉貌似就行了吧。

2009/11/8 蓝天下云层上 <imx365ster@gmail.com>
$datatime="2009年11月05日 10:23";
 $datetime=~s/\u4e00-\u9fa5/-/gi;

以便转换为$datatime="2009-11-05 10:23";

请指教该如何处理这种模式?




--
大明童鞋
特价blog一个http://daminger.net
我的翻墙代理http://proxy.daminger.net
记得帮我点广告- -.



--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] 请教如何把日期中的中文规换为-号?

$datatime="2009年11月05日 10:23";
$datetime=~s/\u4e00-\u9fa5/-/gi;

以便转换为$datatime="2009-11-05 10:23";

请指教该如何处理这种模式?
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

Re: 答复: [PerlChina] 寻找更快的数据搜寻方案

grep, sed

或者,解析放到数据库里,再建个索引,嗖嗖的

2009/11/7 <alexe.cn@gmail.com>
Berkeley DB or Tokyo Cabinet也不是我想要的方案。
我自己再看看吧。好像记得在perlchina会上和李俊良或者是agentzhang谈起过。记不清了。

2009/11/6 cnhack TNT <cnhacktnt@gmail.com>

Berkeley DB or Tokyo Cabinet ?

2009/11/6 joe jiang <lamp.purl@gmail.com>

Hash 的 Hash 也许是个办法,或者用 Load Balance 来实现多节点的分担。

减少 Hash 的数据量可能会提高效率。

2009/11/6 <alexe.cn@gmail.com>

...具体说一下:数据条数在100-1200万之间吧。读入后内存占用量到10G左右。
现在,我需要在这10G数据中快速查找到我想要的数据,现在用hash存储这些数据然后来查找的话我感觉速度不是很快,所以想问问大家有没有更好的解决方案,或者是相关的算法。
或者遇到这种问题,该从哪方面入手?

Thank You,
Alexe

2009/11/6 宇捷 <hfahe@163.com>

100万条记录其实不多,要看你的记录是什么数据类型,这不是perl的问题,而是算法的问题。

 

发件人: grbounce-_mwj1quaaadplfc8fq-7oyyqfcvs3wxt=hfahe=163.com@googlegroups.com [mailto:grbounce-_mwj1quaaadplfc8fq-7oyyqfcvs3wxt=hfahe=163.com@googlegroups.com] 代表 alexe.cn@gmail.com
发送时间: 2009115 22:02
收件人: perlchina@googlegroups.com
主题: [PerlChina] 寻找更快的数据搜寻方案

 

Hi all,

 

我现在需要将大约100万条记录存储到hash中,然后在这个hash中查找某一个数据,或者删除某个数据。

因为hash本身遇到这么大的数据量不占优势,例如会比数据本身多占用更多的内存,数据量太大以后搜索的速度并不是很快等等

 

谁有更好的Perl方案适合这种项目?

 

 

 

Thank You,

Alexe


















--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

Re: 答复: [PerlChina] 寻找更快的数据搜寻方案

Berkeley DB or Tokyo Cabinet也不是我想要的方案。
我自己再看看吧。好像记得在perlchina会上和李俊良或者是agentzhang谈起过。记不清了。

2009/11/6 cnhack TNT <cnhacktnt@gmail.com>
Berkeley DB or Tokyo Cabinet ?

2009/11/6 joe jiang <lamp.purl@gmail.com>

Hash 的 Hash 也许是个办法,或者用 Load Balance 来实现多节点的分担。

减少 Hash 的数据量可能会提高效率。

2009/11/6 <alexe.cn@gmail.com>

...具体说一下:数据条数在100-1200万之间吧。读入后内存占用量到10G左右。
现在,我需要在这10G数据中快速查找到我想要的数据,现在用hash存储这些数据然后来查找的话我感觉速度不是很快,所以想问问大家有没有更好的解决方案,或者是相关的算法。
或者遇到这种问题,该从哪方面入手?

Thank You,
Alexe

2009/11/6 宇捷 <hfahe@163.com>

100万条记录其实不多,要看你的记录是什么数据类型,这不是perl的问题,而是算法的问题。

 

发件人: grbounce-_mwj1quaaadplfc8fq-7oyyqfcvs3wxt=hfahe=163.com@googlegroups.com [mailto:grbounce-_mwj1quaaadplfc8fq-7oyyqfcvs3wxt=hfahe=163.com@googlegroups.com] 代表 alexe.cn@gmail.com
发送时间: 2009115 22:02
收件人: perlchina@googlegroups.com
主题: [PerlChina] 寻找更快的数据搜寻方案

 

Hi all,

 

我现在需要将大约100万条记录存储到hash中,然后在这个hash中查找某一个数据,或者删除某个数据。

因为hash本身遇到这么大的数据量不占优势,例如会比数据本身多占用更多的内存,数据量太大以后搜索的速度并不是很快等等

 

谁有更好的Perl方案适合这种项目?

 

 

 

Thank You,

Alexe















--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教哈:将文件中重复的行,替换,只保留一行

收益匪浅。谢谢哈 ^_^

----- Original Message -----
From: "perlw01f" <p3r1w01f@gmail.com>
To: "PerlChina Mongers 讨论组" <perlchina@googlegroups.com>
Sent: Saturday, November 07, 2009 11:01 AM
Subject: [PerlChina] Re: 请教哈:将文件中重复的行,替换,只保留一行


>
> sub omit_dupli () {
> my @array = @_;
> my %count;
> my @unique = grep { ++$count{$_} < 2 } @array;
> return @unique;
> }
> >
>


--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教下,perl如何在替换文件里的字符串并写回文件

请问 -i 不带参数是怎么实现的? 是不是也是生成一个临时文件? 或者是对这个文件边读编修改, +< 模式?

On 11月5日, 下午2时05分, Rainbird <chinakapal...@gmail.com> wrote:
> perl -i -pe 's/root/rainbird/g' passwd
>
> 希望你能从这句话中得到灵感:)
>
> 2009/11/5 Ruixian Zhu <zhur...@gmail.com>
>
>
>
> > 好 多谢
>
> > 2009/11/5 WangKevin <kevin-w...@hotmail.com>:
> > > 直接写回去就覆盖了
>
> > > undef $/;
>
> > > open FILE, $filepath;
> > > $C = <FILE>;
> > > close FILE;
> > > $/="\n";
>
> > > $C =~ s/str1/str2/gi
>
> > > open( FILE, ">$filepath");
>
> > > print FILE $C;
> > > close(FILE);
>
> > > 你也可以试试 >+
> > > 打开一次看行不行
>
> > > MALA WANG
>
> > > ________________________________
> > > Date: Thu, 5 Nov 2009 13:40:00 +0800
> > > Subject: [PerlChina] Re: 请教下,perl如何在替换文件里的字符串并写回文件
> > > From: smallfish...@gmail.com
> > > To: perlchina@googlegroups.com
>
> > > 替换完直接把内容写入当前文件就可以了
> > > --
> > >http://pythonchina.org
> > >http://hi.baidu.com/smallfish_xy
>
> > > 2009/11/5 Nestle <zhur...@gmail.com>
>
> > > 请教下,perl如何在替换文件里的字符串并写回文件。我现在的做法是,打开一个文件,替换内容,写到新文件,最后删除旧文件,用原文件名重新命名新文
> > > 件,有没有直接写回的办法?我不想创建新的文件。
>
> --
> 态度决定高度,技术成就梦想
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

Re: 回复:[PerlChina] Re: 谁有Google Wave的邀请码呀?

不知道这个有什么用,有个wave但不知道怎么用他 :)

2009/11/6 Beckheng Lam <bi.ken.lam@gmail.com>:
> 收到Google Wave的邀请了。
>
> xiZZZZZZZZZZZge has invited you to preview Google Wave!
>
> Thanks a lot!!!
>
> /Heng
>
> Anders wrote:
>
> 貌似一天没看,就这么大的变化。
> 又失之交臂了
>
> On 11月5日, 上午9时37分, Charles <yifan....@gmail.com> wrote:
>
>
> 希望能邀请我啊!
> yifan....@gmail.com
>
> 谢谢啦!
>
> On 11月4日, 下午10时41分, langq 235 <langq...@gmail.com> wrote:
>
>
>
>
>
> 可以邀请我吗,langq...@gmail.com
>
>
>
>
> --
> Perl乐事 -- http://www.perlersh.org
> 我的博客 -- http://www.perlersh.org/blog.html
> 揭谛揭谛,波罗揭谛,波罗僧揭谛,菩提萨婆诃。
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教, 这样是不是多个关键字在文件中替换的最优方法?

如果只是单词替换的话 s/(\w+)/$replace{$1} || $1/eg 也可以。

2009/11/7 Ruixian Zhu <zhurx4g@gmail.com>
好的 多谢。

2009/11/7 Qiang (James) <shijialee@gmail.com>

直接 local $/ = undef; 然后打开文件全部读入,直接替换然后重新写入即可。

>       $count=0;
>       while($count<scalar(@keyword)){
>               $_=$C;
>               $C =~ s/@keyword[$count]/@replacekeyword[$count]/gi;
>               $count++;
>       }

这一部分可以用 hash 更省事些。

my %k_to_replace = ( k_1 => 'new_k_1', ... );

for my $k (keys %k_to_replace) {
   $C =~ s/$k/$k_to_replace{$k}/gi;
}

另外,代码里声明变量通常要用 my,还要使用 warnings 和 string; 建议你把这
篇文章先看看 http://wiki.perlchina.org/Use_Strict_And_Warnings

Qiang

Nestle wrote:
> 这样是不是文件多个关键字替换的最佳方法
>
> sub replaceInFile{
>       print "Process File:".$_[0]."\n";
>       undef $/;
>       open TARGET_FILE,$_[0];
>         $C = <TARGET_FILE>;
>       close TARGET_FILE;
>       $/="\n";
>
>       $count=0;
>       while($count<scalar(@keyword)){
>               $_=$C;
>               $C =~ s/@keyword[$count]/@replacekeyword[$count]/gi;
>               $count++;
>       }
>
>       open( FILE, ">$_[0]");
>       print FILE $C;
>       close(FILE);
> }
> >








--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

2009年11月6日星期五

[PerlChina] Re: 请教, 这样是不是多个关键字在文件中替换的最优方法?

好的 多谢。

2009/11/7 Qiang (James) <shijialee@gmail.com>
直接 local $/ = undef; 然后打开文件全部读入,直接替换然后重新写入即可。

>       $count=0;
>       while($count<scalar(@keyword)){
>               $_=$C;
>               $C =~ s/@keyword[$count]/@replacekeyword[$count]/gi;
>               $count++;
>       }

这一部分可以用 hash 更省事些。

my %k_to_replace = ( k_1 => 'new_k_1', ... );

for my $k (keys %k_to_replace) {
   $C =~ s/$k/$k_to_replace{$k}/gi;
}

另外,代码里声明变量通常要用 my,还要使用 warnings 和 string; 建议你把这
篇文章先看看 http://wiki.perlchina.org/Use_Strict_And_Warnings

Qiang

Nestle wrote:
> 这样是不是文件多个关键字替换的最佳方法
>
> sub replaceInFile{
>       print "Process File:".$_[0]."\n";
>       undef $/;
>       open TARGET_FILE,$_[0];
>         $C = <TARGET_FILE>;
>       close TARGET_FILE;
>       $/="\n";
>
>       $count=0;
>       while($count<scalar(@keyword)){
>               $_=$C;
>               $C =~ s/@keyword[$count]/@replacekeyword[$count]/gi;
>               $count++;
>       }
>
>       open( FILE, ">$_[0]");
>       print FILE $C;
>       close(FILE);
> }
> >





--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教, 这样是不是多个关键字在文件中替换的最优方法?

直接 local $/ = undef; 然后打开文件全部读入,直接替换然后重新写入即可。

> $count=0;
> while($count<scalar(@keyword)){
> $_=$C;
> $C =~ s/@keyword[$count]/@replacekeyword[$count]/gi;
> $count++;
> }

这一部分可以用 hash 更省事些。

my %k_to_replace = ( k_1 => 'new_k_1', ... );

for my $k (keys %k_to_replace) {
$C =~ s/$k/$k_to_replace{$k}/gi;
}

另外,代码里声明变量通常要用 my,还要使用 warnings 和 string; 建议你把这
篇文章先看看 http://wiki.perlchina.org/Use_Strict_And_Warnings

Qiang

Nestle wrote:
> 这样是不是文件多个关键字替换的最佳方法
>
> sub replaceInFile{
> print "Process File:".$_[0]."\n";
> undef $/;
> open TARGET_FILE,$_[0];
> $C = <TARGET_FILE>;
> close TARGET_FILE;
> $/="\n";
>
> $count=0;
> while($count<scalar(@keyword)){
> $_=$C;
> $C =~ s/@keyword[$count]/@replacekeyword[$count]/gi;
> $count++;
> }
>
> open( FILE, ">$_[0]");
> print FILE $C;
> close(FILE);
> }
> >


--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教哈:将文件中重复的行,替换,只保留一行

sub omit_dupli () {
my @array = @_;
my %count;
my @unique = grep { ++$count{$_} < 2 } @array;
return @unique;
}
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教哈:将文件中重复的行,替换,只保留一行

哇塞!经你们一说,思路一下打开了。谢谢各位。
              
----- Original Message -----
From: WangKevin
Sent: Friday, November 06, 2009 5:17 PM
Subject: [PerlChina] Re: 请教哈:将文件中重复的行,替换,只保留一行


用hash 当键值,重复的自然就覆盖了,你试试
 
MALA WANG



 

Date: Fri, 6 Nov 2009 17:10:37 +0800
Subject: [PerlChina] Re: 请教哈:将文件中重复的行,替换,只保留一行
From: smallfish.xy@gmail.com
To: perlchina@googlegroups.com

uniq命令不管?
或者你把文件每一行值当一个hash的key,最后把key写进文件就ok拉
--
http://pythonchina.org
http://hi.baidu.com/smallfish_xy


2009/11/6 linhy <linhy0120@gmail.com>
将文件中重复的行,替换,只保留一行.我的思路是,对文件逐行与其它行分析,然后写入到另一个文件.但感觉这样效率不高。请问各味大虾有没有好一点的思
路或是方法?谢谢先



--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教, 这样是不是多个关键字在文件中替换的最优方法?

应该不是最好的写法,比较难看
 
你试试下面的,不过好像有点bug, 就是key1, key2 有包含的情况
比如 a , ab  , abc
 
my %hash =  (
   key1 =>  replace_key1,
  key2 =>   replace_key2 ,
   ......
) ;
 
open my $F1, '<' ,  $file ;
 
my $info = do {local $/ ; <$F1> } ;
 
my $regexp =  join "|" ,  keys %hash ;
 
$info =~  s/($regexp)/$hash{$1}/mg ;
 


 
2009/11/5 sunshine <zy.netsec@gmail.com>
               $_=$C;
为什么还用这个呢?下面不是有瞄定符了吗?

用s///mgi会不会更好点呢,多行替换?不清楚,还是perl新手 
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教哈:将文件中重复的行,替换,只保留一行

sort file.txt| uniq > file1.txt

2009/11/6 Michael Zeng <galaxy2004@gmail.com>
是啊,最快的就是 sort -u  了
 


 
2009/11/6 Michael Zeng <galaxy2004@gmail.com>

use List::MoreUtils qw/ uniq / ;
 
my @data = <F> ;
 
my @unique = uniq  @data;
 
 


 
2009/11/6 linhy <linhy0120@gmail.com>
将文件中重复的行,替换,只保留一行.我的思路是,对文件逐行与其它行分析,然后写入到另一个文件.但感觉这样效率不高。请问各味大虾有没有好一点的思

路或是方法?谢谢先

--
           Yours Sincerely
                   Zeng Hong




--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教哈:将文件中重复的行,替换,只保留一行

是啊,最快的就是 sort -u  了
 


 
2009/11/6 Michael Zeng <galaxy2004@gmail.com>
use List::MoreUtils qw/ uniq / ;
 
my @data = <F> ;
 
my @unique = uniq  @data;
 
 


 
2009/11/6 linhy <linhy0120@gmail.com>
将文件中重复的行,替换,只保留一行.我的思路是,对文件逐行与其它行分析,然后写入到另一个文件.但感觉这样效率不高。请问各味大虾有没有好一点的思

路或是方法?谢谢先

--
           Yours Sincerely
                   Zeng Hong

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教哈:将文件中重复的行,替换,只保留一行


用hash 当键值,重复的自然就覆盖了,你试试
 
MALA WANG



 

Date: Fri, 6 Nov 2009 17:10:37 +0800
Subject: [PerlChina] Re: 请教哈:将文件中重复的行,替换,只保留一行
From: smallfish.xy@gmail.com
To: perlchina@googlegroups.com

uniq命令不管?
或者你把文件每一行值当一个hash的key,最后把key写进文件就ok拉
--
http://pythonchina.org
http://hi.baidu.com/smallfish_xy


2009/11/6 linhy <linhy0120@gmail.com>
将文件中重复的行,替换,只保留一行.我的思路是,对文件逐行与其它行分析,然后写入到另一个文件.但感觉这样效率不高。请问各味大虾有没有好一点的思
路或是方法?谢谢先



--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教哈:将文件中重复的行,替换,只保留一行

use List::MoreUtils qw/ uniq / ;
 
my @data = <F> ;
 
my @unique = uniq  @data;
 
 


 
2009/11/6 linhy <linhy0120@gmail.com>
将文件中重复的行,替换,只保留一行.我的思路是,对文件逐行与其它行分析,然后写入到另一个文件.但感觉这样效率不高。请问各味大虾有没有好一点的思
路或是方法?谢谢先



--
           Yours Sincerely
                   Zeng Hong

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教哈:将文件中重复的行,替换,只保留一行

uniq命令不管?
或者你把文件每一行值当一个hash的key,最后把key写进文件就ok拉
--
http://pythonchina.org
http://hi.baidu.com/smallfish_xy


2009/11/6 linhy <linhy0120@gmail.com>
将文件中重复的行,替换,只保留一行.我的思路是,对文件逐行与其它行分析,然后写入到另一个文件.但感觉这样效率不高。请问各味大虾有没有好一点的思
路或是方法?谢谢先



--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教哈:将文件中重复的行,替换,只保留一行

hash

2009/11/6 linhy <linhy0120@gmail.com>
将文件中重复的行,替换,只保留一行.我的思路是,对文件逐行与其它行分析,然后写入到另一个文件.但感觉这样效率不高。请问各味大虾有没有好一点的思
路或是方法?谢谢先




--
态度决定高度,技术成就梦想

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] 请教哈:将文件中重复的行,替换,只保留一行

将文件中重复的行,替换,只保留一行.我的思路是,对文件逐行与其它行分析,然后写入到另一个文件.但感觉这样效率不高。请问各味大虾有没有好一点的思
路或是方法?谢谢先
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

Re: 答复: [PerlChina] 寻找更快的数据搜寻方案

hash已经很快了,你要看看  具体的脚本写法

2009/11/6 YY H <gxglhyy@gmail.com>
想问一下你查找的时候是怎么查找的,有用到hash值?要是有用到的话,应该不慢吧。

2009/11/6 <alexe.cn@gmail.com>
...具体说一下:数据条数在100-1200万之间吧。读入后内存占用量到10G左右。
现在,我需要在这10G数据中快速查找到我想要的数据,现在用hash存储这些数据然后来查找的话我感觉速度不是很快,所以想问问大家有没有更好的解决方案,或者是相关的算法。
或者遇到这种问题,该从哪方面入手?

Thank You,
Alexe

2009/11/6 宇捷 <hfahe@163.com>

100万条记录其实不多,要看你的记录是什么数据类型,这不是perl的问题,而是算法的问题。

 

发件人: grbounce-_mwj1quaaadplfc8fq-7oyyqfcvs3wxt=hfahe=163.com@googlegroups.com [mailto:grbounce-_mwj1quaaadplfc8fq-7oyyqfcvs3wxt=hfahe=163.com@googlegroups.com] 代表 alexe.cn@gmail.com
发送时间: 2009115 22:02
收件人: perlchina@googlegroups.com
主题: [PerlChina] 寻找更快的数据搜寻方案

 

Hi all,

 

我现在需要将大约100万条记录存储到hash中,然后在这个hash中查找某一个数据,或者删除某个数据。

因为hash本身遇到这么大的数据量不占优势,例如会比数据本身多占用更多的内存,数据量太大以后搜索的速度并不是很快等等

 

谁有更好的Perl方案适合这种项目?

 

 

 

Thank You,

Alexe





--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教Perl -> (反引用操作符?)的用法

调用方法, 调用模块里面的方法  ,  面向对象编程应用
 


 
2009/11/6 Fangyuan <chengfangyuan2008@gmail.com>
遇到一行代码:
 my %p = @_;
return $p{table}->name . '_t' if $p{type} eq 'table';
这里的->,如果是调用模块里的一个函数,经常会这样用,在这里是什么意思呢?
我查过资料,说是反引用操作符,但没有具体的说明。
希望高手能解释一下,谢谢! --~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

Re: 答复: [PerlChina] 寻找更快的数据搜寻方案

想问一下你查找的时候是怎么查找的,有用到hash值?要是有用到的话,应该不慢吧。

2009/11/6 <alexe.cn@gmail.com>
...具体说一下:数据条数在100-1200万之间吧。读入后内存占用量到10G左右。
现在,我需要在这10G数据中快速查找到我想要的数据,现在用hash存储这些数据然后来查找的话我感觉速度不是很快,所以想问问大家有没有更好的解决方案,或者是相关的算法。
或者遇到这种问题,该从哪方面入手?

Thank You,
Alexe

2009/11/6 宇捷 <hfahe@163.com>

100万条记录其实不多,要看你的记录是什么数据类型,这不是perl的问题,而是算法的问题。

 

发件人: grbounce-_mwj1quaaadplfc8fq-7oyyqfcvs3wxt=hfahe=163.com@googlegroups.com [mailto:grbounce-_mwj1quaaadplfc8fq-7oyyqfcvs3wxt=hfahe=163.com@googlegroups.com] 代表 alexe.cn@gmail.com
发送时间: 2009115 22:02
收件人: perlchina@googlegroups.com
主题: [PerlChina] 寻找更快的数据搜寻方案

 

Hi all,

 

我现在需要将大约100万条记录存储到hash中,然后在这个hash中查找某一个数据,或者删除某个数据。

因为hash本身遇到这么大的数据量不占优势,例如会比数据本身多占用更多的内存,数据量太大以后搜索的速度并不是很快等等

 

谁有更好的Perl方案适合这种项目?

 

 

 

Thank You,

Alexe





--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

2009年11月5日星期四

[PerlChina] Re: Net::SSH::Perl 在strawberry perl 下安装失败

这是 getpwuid 的问题,测试脚本没考虑到 windows 上的安装,可以考虑 force install 这个模块.

2009/11/6 Zhang JiaQiang <zhangjiaqiang@gmail.com>

失败信息如下,有人成功过么?

cpan> install Net::SSH::Perl
Running install for module 'Net::SSH::Perl'
Running make for T/TU/TURNSTEP/Net-SSH-Perl-1.34.tar.gz
Checksum for C:\strawberry\cpan\sources\authors\id\T\TU\TURNSTEP\Net-
SSH-Perl-1.
34.tar.gz ok

 CPAN.pm: Going to build T/TU/TURNSTEP/Net-SSH-Perl-1.34.tar.gz

This is Net::SSH::Perl.

As of version 1.00, Net::SSH::Perl supports both the SSH1 and
SSH2 protocols natively. The two protocols have different
module prerequisitives, so you need to decide which protocol(s)
you plan to use. If you use one or the other, only those modules
for your chosen protocol will be installed; if you choose both,
all of the supporting modules will be installed. Please choose
the protocols you'd like to use from the following list ("Both"
is the default).

   [1] SSH1
   [2] SSH2
   [3] Both SSH1 and SSH2

Which protocol(s) do you plan to use? [3]

Some of the Net::SSH::Perl ciphers depend on a Crypt:: module from
CPAN. You may already have the necessary modules installed, in which
case you don't need to bother with this step. Otherwise you'll need
to install at least one cipher to use Net::SSH::Perl. Please choose
at least one from the following list (Crypt::IDEA is the default).

   [1] IDEA
   [2] DES
   [3] DES3
   [4] Blowfish
   [5] RC4

Enter your choices, separated by spaces: [1]

Checking for optional modules

Checking if your kit is complete...
Looks good
Writing Makefile for Net::SSH::Perl
cp lib/Net/SSH/Perl/Agent.pm blib\lib\Net\SSH\Perl\Agent.pm
cp lib/Net/SSH/Perl/Auth/KeyboardInt.pm blib\lib\Net\SSH\Perl\Auth
\KeyboardInt.p
m
cp lib/Net/SSH/Perl/Util/RSA.pm blib\lib\Net\SSH\Perl\Util\RSA.pm
cp lib/Net/SSH/Perl/AuthMgr.pm blib\lib\Net\SSH\Perl\AuthMgr.pm
cp lib/Net/SSH/Perl/Auth/Rhosts.pm blib\lib\Net\SSH\Perl\Auth
\Rhosts.pm
cp lib/Net/SSH/Perl/Cipher/IDEA.pm blib\lib\Net\SSH\Perl\Cipher
\IDEA.pm
cp lib/Net/SSH/Perl/Util/Authfile.pm blib\lib\Net\SSH\Perl\Util
\Authfile.pm
cp lib/Net/SSH/Perl/Handle/SSH2.pm blib\lib\Net\SSH\Perl\Handle
\SSH2.pm
cp lib/Net/SSH/Perl/Util/SSH1MP.pm blib\lib\Net\SSH\Perl\Util
\SSH1MP.pm
cp lib/Net/SSH/Perl/Util/Hosts.pm blib\lib\Net\SSH\Perl\Util\Hosts.pm
cp lib/Net/SSH/Perl/Auth.pm blib\lib\Net\SSH\Perl\Auth.pm
cp lib/Net/SSH/Perl/Util/Term.pm blib\lib\Net\SSH\Perl\Util\Term.pm
cp lib/Net/SSH/Perl/Handle/SSH1.pm blib\lib\Net\SSH\Perl\Handle
\SSH1.pm
cp lib/Net/SSH/Perl/Cipher/CBC.pm blib\lib\Net\SSH\Perl\Cipher\CBC.pm
cp lib/Net/SSH/Perl/Comp.pm blib\lib\Net\SSH\Perl\Comp.pm
cp lib/Net/SSH/Perl/Auth/PublicKey.pm blib\lib\Net\SSH\Perl\Auth
\PublicKey.pm
cp lib/Net/SSH/Perl/Subsystem/Client.pm blib\lib\Net\SSH\Perl\Subsystem
\Client.p
m
cp lib/Net/SSH/Perl/Kex.pm blib\lib\Net\SSH\Perl\Kex.pm
cp lib/Net/SSH/Perl/Auth/Password.pm blib\lib\Net\SSH\Perl\Auth
\Password.pm
cp lib/Net/SSH/Perl/Cipher/Blowfish.pm blib\lib\Net\SSH\Perl\Cipher
\Blowfish.pm
cp lib/Net/SSH/Perl/Auth/Rhosts_RSA.pm blib\lib\Net\SSH\Perl\Auth
\Rhosts_RSA.pm
cp lib/Net/SSH/Perl/Key/RSA1.pm blib\lib\Net\SSH\Perl\Key\RSA1.pm
cp lib/Net/SSH/Perl/Key.pm blib\lib\Net\SSH\Perl\Key.pm
cp lib/Net/SSH/Perl/Buffer.pm blib\lib\Net\SSH\Perl\Buffer.pm
cp lib/Net/SSH/Perl/Key/DSA.pm blib\lib\Net\SSH\Perl\Key\DSA.pm
cp lib/Net/SSH/Perl/Cipher/DES3.pm blib\lib\Net\SSH\Perl\Cipher
\DES3.pm
cp lib/Net/SSH/Perl/Cipher/RC4.pm blib\lib\Net\SSH\Perl\Cipher\RC4.pm
cp lib/Net/SSH/Perl/Cipher.pm blib\lib\Net\SSH\Perl\Cipher.pm
cp lib/Net/SSH/Perl/Constants.pm blib\lib\Net\SSH\Perl\Constants.pm
cp lib/Net/SSH/Perl/ChannelMgr.pm blib\lib\Net\SSH\Perl\ChannelMgr.pm
cp lib/Net/SSH/Perl/Auth/RSA.pm blib\lib\Net\SSH\Perl\Auth\RSA.pm
cp lib/Net/SSH/Perl/Cipher/CFB.pm blib\lib\Net\SSH\Perl\Cipher\CFB.pm
cp lib/Net/SSH/Perl/Util/SSH1Misc.pm blib\lib\Net\SSH\Perl\Util
\SSH1Misc.pm
cp lib/Net/SSH/Perl/Comp/Zlib.pm blib\lib\Net\SSH\Perl\Comp\Zlib.pm
cp lib/Net/SSH/Perl/Mac.pm blib\lib\Net\SSH\Perl\Mac.pm
cp lib/Net/SSH/Perl/Kex/DH1.pm blib\lib\Net\SSH\Perl\Kex\DH1.pm
cp lib/Net/SSH/Perl/SSH2.pm blib\lib\Net\SSH\Perl\SSH2.pm
cp lib/Net/SSH/Perl/Config.pm blib\lib\Net\SSH\Perl\Config.pm
cp lib/Net/SSH/Perl/Subsystem/Server.pm blib\lib\Net\SSH\Perl\Subsystem
\Server.p
m
cp lib/Net/SSH/Perl/Util.pm blib\lib\Net\SSH\Perl\Util.pm
cp lib/Net/SSH/Perl/Handle.pm blib\lib\Net\SSH\Perl\Handle.pm
cp lib/Net/SSH/Perl/Util/SSH2MP.pm blib\lib\Net\SSH\Perl\Util
\SSH2MP.pm
cp lib/Net/SSH/Perl.pm blib\lib\Net\SSH\Perl.pm
cp lib/Net/SSH/Perl/Auth/ChallengeResponse.pm blib\lib\Net\SSH\Perl
\Auth\Challen
geResponse.pm
cp lib/Net/SSH/Perl/Channel.pm blib\lib\Net\SSH\Perl\Channel.pm
cp lib/Net/SSH/Perl/SSH1.pm blib\lib\Net\SSH\Perl\SSH1.pm
cp lib/Net/SSH/Perl/Cipher/DES.pm blib\lib\Net\SSH\Perl\Cipher\DES.pm
cp lib/Net/SSH/Perl/Packet.pm blib\lib\Net\SSH\Perl\Packet.pm
cp lib/Net/SSH/Perl/Key/RSA.pm blib\lib\Net\SSH\Perl\Key\RSA.pm
 TURNSTEP/Net-SSH-Perl-1.34.tar.gz
 C:\strawberry\c\bin\dmake.EXE -- OK
Running make test
C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e"
"test_harness(0,
'blib\lib', 'blib\arch')" t/*.t
t/00-signature.t ... skipped: Set the environment variable
TEST_SIGNATURE to ena
ble this test
t/01-compile.t ..... ok
t/02-buffer.t ...... ok
t/03-packet.t ...... Use of uninitialized value $ENV{"HOME"} in
concatenation (.
) or string at C:\strawberry\cpan\build\Net-SSH-Perl-1.34-q3FdXz\blib
\lib/Net/SS
H/Perl.pm line 108.
The getpwuid function is unimplemented at C:\strawberry\cpan\build\Net-
SSH-Perl-
1.34-q3FdXz\blib\lib/Net/SSH/Perl/SSH1.pm line 30.
# Looks like your test exited with 9 before it could output anything.
t/03-packet.t ...... Dubious, test returned 9 (wstat 2304, 0x900)
Failed 10/10 subtests
t/04-config.t ...... 1/25 Use of uninitialized value $ENV{"HOME"} in
concatenati
on (.) or string at C:\strawberry\cpan\build\Net-SSH-Perl-1.34-q3FdXz
\blib\lib/N
et/SSH/Perl.pm line 108.
t/04-config.t ...... ok
t/05-cipher.t ...... ok
t/06-auth.t ........ skipped: Test not enabled yet
t/06-circular.t .... ok
t/99-perlcritic.t .. skipped: Set the environment variable TEST_CRITIC
to enable
 this test
t/99-pod.t ......... skipped: Test not ready yet.
t/99-spellcheck.t .. skipped: Set the environment variable TEST_SPELL
to enable
this test
t/99-yaml.t ........ skipped: Set the environment variable TEST_AUTHOR
to enable
 this test

Test Summary Report
-------------------
t/03-packet.t    (Wstat: 2304 Tests: 0 Failed: 0)
 Non-zero exit status: 9
 Parse errors: Bad plan.  You planned 10 tests but ran 0.
Files=12, Tests=106,  6 wallclock secs ( 0.16 usr +  0.14 sys =  0.30
CPU)
Result: FAIL
Failed 1/12 test programs. 0/106 subtests failed.
dmake.EXE:  Error code 255, while making 'test_dynamic'
 TURNSTEP/Net-SSH-Perl-1.34.tar.gz
 C:\strawberry\c\bin\dmake.EXE test -- NOT OK
//hint// to see the cpan-testers results for installing this module,
try:
 reports TURNSTEP/Net-SSH-Perl-1.34.tar.gz
Running make install
 make test had returned bad status, won't install without force
Failed during this command:
 TURNSTEP/Net-SSH-Perl-1.34.tar.gz            : make_test NO





--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: Net::SSH::Perl 在strawberry perl 下安装失败

没有仔细看,扫到了一眼:Use of uninitialized value $ENV{"HOME"}
环境变量的问题?

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] 请教Perl -> (反引用操作符?)的用法

遇到一行代码:
my %p = @_;
return $p{table}->name . '_t' if $p{type} eq 'table';
这里的->,如果是调用模块里的一个函数,经常会这样用,在这里是什么意思呢?
我查过资料,说是反引用操作符,但没有具体的说明。
希望高手能解释一下,谢谢!
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Net::SSH::Perl 在strawberry perl 下安装失败

失败信息如下,有人成功过么?

cpan> install Net::SSH::Perl
Running install for module 'Net::SSH::Perl'
Running make for T/TU/TURNSTEP/Net-SSH-Perl-1.34.tar.gz
Checksum for C:\strawberry\cpan\sources\authors\id\T\TU\TURNSTEP\Net-
SSH-Perl-1.
34.tar.gz ok

CPAN.pm: Going to build T/TU/TURNSTEP/Net-SSH-Perl-1.34.tar.gz

This is Net::SSH::Perl.

As of version 1.00, Net::SSH::Perl supports both the SSH1 and
SSH2 protocols natively. The two protocols have different
module prerequisitives, so you need to decide which protocol(s)
you plan to use. If you use one or the other, only those modules
for your chosen protocol will be installed; if you choose both,
all of the supporting modules will be installed. Please choose
the protocols you'd like to use from the following list ("Both"
is the default).

[1] SSH1
[2] SSH2
[3] Both SSH1 and SSH2

Which protocol(s) do you plan to use? [3]

Some of the Net::SSH::Perl ciphers depend on a Crypt:: module from
CPAN. You may already have the necessary modules installed, in which
case you don't need to bother with this step. Otherwise you'll need
to install at least one cipher to use Net::SSH::Perl. Please choose
at least one from the following list (Crypt::IDEA is the default).

[1] IDEA
[2] DES
[3] DES3
[4] Blowfish
[5] RC4

Enter your choices, separated by spaces: [1]

Checking for optional modules

Checking if your kit is complete...
Looks good
Writing Makefile for Net::SSH::Perl
cp lib/Net/SSH/Perl/Agent.pm blib\lib\Net\SSH\Perl\Agent.pm
cp lib/Net/SSH/Perl/Auth/KeyboardInt.pm blib\lib\Net\SSH\Perl\Auth
\KeyboardInt.p
m
cp lib/Net/SSH/Perl/Util/RSA.pm blib\lib\Net\SSH\Perl\Util\RSA.pm
cp lib/Net/SSH/Perl/AuthMgr.pm blib\lib\Net\SSH\Perl\AuthMgr.pm
cp lib/Net/SSH/Perl/Auth/Rhosts.pm blib\lib\Net\SSH\Perl\Auth
\Rhosts.pm
cp lib/Net/SSH/Perl/Cipher/IDEA.pm blib\lib\Net\SSH\Perl\Cipher
\IDEA.pm
cp lib/Net/SSH/Perl/Util/Authfile.pm blib\lib\Net\SSH\Perl\Util
\Authfile.pm
cp lib/Net/SSH/Perl/Handle/SSH2.pm blib\lib\Net\SSH\Perl\Handle
\SSH2.pm
cp lib/Net/SSH/Perl/Util/SSH1MP.pm blib\lib\Net\SSH\Perl\Util
\SSH1MP.pm
cp lib/Net/SSH/Perl/Util/Hosts.pm blib\lib\Net\SSH\Perl\Util\Hosts.pm
cp lib/Net/SSH/Perl/Auth.pm blib\lib\Net\SSH\Perl\Auth.pm
cp lib/Net/SSH/Perl/Util/Term.pm blib\lib\Net\SSH\Perl\Util\Term.pm
cp lib/Net/SSH/Perl/Handle/SSH1.pm blib\lib\Net\SSH\Perl\Handle
\SSH1.pm
cp lib/Net/SSH/Perl/Cipher/CBC.pm blib\lib\Net\SSH\Perl\Cipher\CBC.pm
cp lib/Net/SSH/Perl/Comp.pm blib\lib\Net\SSH\Perl\Comp.pm
cp lib/Net/SSH/Perl/Auth/PublicKey.pm blib\lib\Net\SSH\Perl\Auth
\PublicKey.pm
cp lib/Net/SSH/Perl/Subsystem/Client.pm blib\lib\Net\SSH\Perl\Subsystem
\Client.p
m
cp lib/Net/SSH/Perl/Kex.pm blib\lib\Net\SSH\Perl\Kex.pm
cp lib/Net/SSH/Perl/Auth/Password.pm blib\lib\Net\SSH\Perl\Auth
\Password.pm
cp lib/Net/SSH/Perl/Cipher/Blowfish.pm blib\lib\Net\SSH\Perl\Cipher
\Blowfish.pm
cp lib/Net/SSH/Perl/Auth/Rhosts_RSA.pm blib\lib\Net\SSH\Perl\Auth
\Rhosts_RSA.pm
cp lib/Net/SSH/Perl/Key/RSA1.pm blib\lib\Net\SSH\Perl\Key\RSA1.pm
cp lib/Net/SSH/Perl/Key.pm blib\lib\Net\SSH\Perl\Key.pm
cp lib/Net/SSH/Perl/Buffer.pm blib\lib\Net\SSH\Perl\Buffer.pm
cp lib/Net/SSH/Perl/Key/DSA.pm blib\lib\Net\SSH\Perl\Key\DSA.pm
cp lib/Net/SSH/Perl/Cipher/DES3.pm blib\lib\Net\SSH\Perl\Cipher
\DES3.pm
cp lib/Net/SSH/Perl/Cipher/RC4.pm blib\lib\Net\SSH\Perl\Cipher\RC4.pm
cp lib/Net/SSH/Perl/Cipher.pm blib\lib\Net\SSH\Perl\Cipher.pm
cp lib/Net/SSH/Perl/Constants.pm blib\lib\Net\SSH\Perl\Constants.pm
cp lib/Net/SSH/Perl/ChannelMgr.pm blib\lib\Net\SSH\Perl\ChannelMgr.pm
cp lib/Net/SSH/Perl/Auth/RSA.pm blib\lib\Net\SSH\Perl\Auth\RSA.pm
cp lib/Net/SSH/Perl/Cipher/CFB.pm blib\lib\Net\SSH\Perl\Cipher\CFB.pm
cp lib/Net/SSH/Perl/Util/SSH1Misc.pm blib\lib\Net\SSH\Perl\Util
\SSH1Misc.pm
cp lib/Net/SSH/Perl/Comp/Zlib.pm blib\lib\Net\SSH\Perl\Comp\Zlib.pm
cp lib/Net/SSH/Perl/Mac.pm blib\lib\Net\SSH\Perl\Mac.pm
cp lib/Net/SSH/Perl/Kex/DH1.pm blib\lib\Net\SSH\Perl\Kex\DH1.pm
cp lib/Net/SSH/Perl/SSH2.pm blib\lib\Net\SSH\Perl\SSH2.pm
cp lib/Net/SSH/Perl/Config.pm blib\lib\Net\SSH\Perl\Config.pm
cp lib/Net/SSH/Perl/Subsystem/Server.pm blib\lib\Net\SSH\Perl\Subsystem
\Server.p
m
cp lib/Net/SSH/Perl/Util.pm blib\lib\Net\SSH\Perl\Util.pm
cp lib/Net/SSH/Perl/Handle.pm blib\lib\Net\SSH\Perl\Handle.pm
cp lib/Net/SSH/Perl/Util/SSH2MP.pm blib\lib\Net\SSH\Perl\Util
\SSH2MP.pm
cp lib/Net/SSH/Perl.pm blib\lib\Net\SSH\Perl.pm
cp lib/Net/SSH/Perl/Auth/ChallengeResponse.pm blib\lib\Net\SSH\Perl
\Auth\Challen
geResponse.pm
cp lib/Net/SSH/Perl/Channel.pm blib\lib\Net\SSH\Perl\Channel.pm
cp lib/Net/SSH/Perl/SSH1.pm blib\lib\Net\SSH\Perl\SSH1.pm
cp lib/Net/SSH/Perl/Cipher/DES.pm blib\lib\Net\SSH\Perl\Cipher\DES.pm
cp lib/Net/SSH/Perl/Packet.pm blib\lib\Net\SSH\Perl\Packet.pm
cp lib/Net/SSH/Perl/Key/RSA.pm blib\lib\Net\SSH\Perl\Key\RSA.pm
TURNSTEP/Net-SSH-Perl-1.34.tar.gz
C:\strawberry\c\bin\dmake.EXE -- OK
Running make test
C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e"
"test_harness(0,
'blib\lib', 'blib\arch')" t/*.t
t/00-signature.t ... skipped: Set the environment variable
TEST_SIGNATURE to ena
ble this test
t/01-compile.t ..... ok
t/02-buffer.t ...... ok
t/03-packet.t ...... Use of uninitialized value $ENV{"HOME"} in
concatenation (.
) or string at C:\strawberry\cpan\build\Net-SSH-Perl-1.34-q3FdXz\blib
\lib/Net/SS
H/Perl.pm line 108.
The getpwuid function is unimplemented at C:\strawberry\cpan\build\Net-
SSH-Perl-
1.34-q3FdXz\blib\lib/Net/SSH/Perl/SSH1.pm line 30.
# Looks like your test exited with 9 before it could output anything.
t/03-packet.t ...... Dubious, test returned 9 (wstat 2304, 0x900)
Failed 10/10 subtests
t/04-config.t ...... 1/25 Use of uninitialized value $ENV{"HOME"} in
concatenati
on (.) or string at C:\strawberry\cpan\build\Net-SSH-Perl-1.34-q3FdXz
\blib\lib/N
et/SSH/Perl.pm line 108.
t/04-config.t ...... ok
t/05-cipher.t ...... ok
t/06-auth.t ........ skipped: Test not enabled yet
t/06-circular.t .... ok
t/99-perlcritic.t .. skipped: Set the environment variable TEST_CRITIC
to enable
this test
t/99-pod.t ......... skipped: Test not ready yet.
t/99-spellcheck.t .. skipped: Set the environment variable TEST_SPELL
to enable
this test
t/99-yaml.t ........ skipped: Set the environment variable TEST_AUTHOR
to enable
this test

Test Summary Report
-------------------
t/03-packet.t (Wstat: 2304 Tests: 0 Failed: 0)
Non-zero exit status: 9
Parse errors: Bad plan. You planned 10 tests but ran 0.
Files=12, Tests=106, 6 wallclock secs ( 0.16 usr + 0.14 sys = 0.30
CPU)
Result: FAIL
Failed 1/12 test programs. 0/106 subtests failed.
dmake.EXE: Error code 255, while making 'test_dynamic'
TURNSTEP/Net-SSH-Perl-1.34.tar.gz
C:\strawberry\c\bin\dmake.EXE test -- NOT OK
//hint// to see the cpan-testers results for installing this module,
try:
reports TURNSTEP/Net-SSH-Perl-1.34.tar.gz
Running make install
make test had returned bad status, won't install without force
Failed during this command:
TURNSTEP/Net-SSH-Perl-1.34.tar.gz : make_test NO


--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

Re: 回复:[PerlChina] Re: 谁有Google Wave的邀请码呀?

收到Google Wave的邀请了。

xiZZZZZZZZZZZge has invited you to preview Google Wave!

Thanks a lot!!!

/Heng

Anders wrote:
貌似一天没看,就这么大的变化。 又失之交臂了  On 11月5日, 上午9时37分, Charles <yifan....@gmail.com> wrote:   
希望能邀请我啊! yifan....@gmail.com  谢谢啦!  On 11月4日, 下午10时41分, langq 235 <langq...@gmail.com> wrote:        
可以邀请我吗,langq...@gmail.com       
   


--  Perl乐事 -- http://www.perlersh.org 我的博客 -- http://www.perlersh.org/blog.html 揭谛揭谛,波罗揭谛,波罗僧揭谛,菩提萨婆诃。 

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

Re: 答复: [PerlChina] 寻找更快的数据搜寻方案

Berkeley DB or Tokyo Cabinet ?

2009/11/6 joe jiang <lamp.purl@gmail.com>
Hash 的 Hash 也许是个办法,或者用 Load Balance 来实现多节点的分担。

减少 Hash 的数据量可能会提高效率。

2009/11/6 <alexe.cn@gmail.com>

...具体说一下:数据条数在100-1200万之间吧。读入后内存占用量到10G左右。
现在,我需要在这10G数据中快速查找到我想要的数据,现在用hash存储这些数据然后来查找的话我感觉速度不是很快,所以想问问大家有没有更好的解决方案,或者是相关的算法。
或者遇到这种问题,该从哪方面入手?

Thank You,
Alexe

2009/11/6 宇捷 <hfahe@163.com>

100万条记录其实不多,要看你的记录是什么数据类型,这不是perl的问题,而是算法的问题。

 

发件人: grbounce-_mwj1quaaadplfc8fq-7oyyqfcvs3wxt=hfahe=163.com@googlegroups.com [mailto:grbounce-_mwj1quaaadplfc8fq-7oyyqfcvs3wxt=hfahe=163.com@googlegroups.com] 代表 alexe.cn@gmail.com
发送时间: 2009115 22:02
收件人: perlchina@googlegroups.com
主题: [PerlChina] 寻找更快的数据搜寻方案

 

Hi all,

 

我现在需要将大约100万条记录存储到hash中,然后在这个hash中查找某一个数据,或者删除某个数据。

因为hash本身遇到这么大的数据量不占优势,例如会比数据本身多占用更多的内存,数据量太大以后搜索的速度并不是很快等等

 

谁有更好的Perl方案适合这种项目?

 

 

 

Thank You,

Alexe












--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

Re: 答复: [PerlChina] 寻找更快的数据搜寻方案

Hash 的 Hash 也许是个办法,或者用 Load Balance 来实现多节点的分担。

减少 Hash 的数据量可能会提高效率。

2009/11/6 <alexe.cn@gmail.com>
...具体说一下:数据条数在100-1200万之间吧。读入后内存占用量到10G左右。
现在,我需要在这10G数据中快速查找到我想要的数据,现在用hash存储这些数据然后来查找的话我感觉速度不是很快,所以想问问大家有没有更好的解决方案,或者是相关的算法。
或者遇到这种问题,该从哪方面入手?

Thank You,
Alexe

2009/11/6 宇捷 <hfahe@163.com>

100万条记录其实不多,要看你的记录是什么数据类型,这不是perl的问题,而是算法的问题。

 

发件人: grbounce-_mwj1quaaadplfc8fq-7oyyqfcvs3wxt=hfahe=163.com@googlegroups.com [mailto:grbounce-_mwj1quaaadplfc8fq-7oyyqfcvs3wxt=hfahe=163.com@googlegroups.com] 代表 alexe.cn@gmail.com
发送时间: 2009115 22:02
收件人: perlchina@googlegroups.com
主题: [PerlChina] 寻找更快的数据搜寻方案

 

Hi all,

 

我现在需要将大约100万条记录存储到hash中,然后在这个hash中查找某一个数据,或者删除某个数据。

因为hash本身遇到这么大的数据量不占优势,例如会比数据本身多占用更多的内存,数据量太大以后搜索的速度并不是很快等等

 

谁有更好的Perl方案适合这种项目?

 

 

 

Thank You,

Alexe









--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

Re: 答复: [PerlChina] 寻找更快的数据搜寻方案

...具体说一下:数据条数在100-1200万之间吧。读入后内存占用量到10G左右。
现在,我需要在这10G数据中快速查找到我想要的数据,现在用hash存储这些数据然后来查找的话我感觉速度不是很快,所以想问问大家有没有更好的解决方案,或者是相关的算法。
或者遇到这种问题,该从哪方面入手?

Thank You,
Alexe

2009/11/6 宇捷 <hfahe@163.com>

100万条记录其实不多,要看你的记录是什么数据类型,这不是perl的问题,而是算法的问题。

 

发件人: grbounce-_mwj1quaaadplfc8fq-7oyyqfcvs3wxt=hfahe=163.com@googlegroups.com [mailto:grbounce-_mwj1quaaadplfc8fq-7oyyqfcvs3wxt=hfahe=163.com@googlegroups.com] 代表 alexe.cn@gmail.com
发送时间: 2009115 22:02
收件人: perlchina@googlegroups.com
主题: [PerlChina] 寻找更快的数据搜寻方案

 

Hi all,

 

我现在需要将大约100万条记录存储到hash中,然后在这个hash中查找某一个数据,或者删除某个数据。

因为hash本身遇到这么大的数据量不占优势,例如会比数据本身多占用更多的内存,数据量太大以后搜索的速度并不是很快等等

 

谁有更好的Perl方案适合这种项目?

 

 

 

Thank You,

Alexe






--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

答复: [PerlChina] 寻找更快的数据搜寻方案

100万条记录其实不多,要看你的记录是什么数据类型,这不是perl的问题,而是算法的问题。

 

发件人: grbounce-_mwj1quaaadplfc8fq-7oyyqfcvs3wxt=hfahe=163.com@googlegroups.com [mailto:grbounce-_mwj1quaaadplfc8fq-7oyyqfcvs3wxt=hfahe=163.com@googlegroups.com] 代表 alexe.cn@gmail.com
发送时间: 2009115 22:02
收件人: perlchina@googlegroups.com
主题: [PerlChina] 寻找更快的数据搜寻方案

 

Hi all,

 

我现在需要将大约100万条记录存储到hash中,然后在这个hash中查找某一个数据,或者删除某个数据。

因为hash本身遇到这么大的数据量不占优势,例如会比数据本身多占用更多的内存,数据量太大以后搜索的速度并不是很快等等

 

谁有更好的Perl方案适合这种项目?

 

 

 

Thank You,

Alexe



--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教一个bioinformatics问题――质粒作图

这个也很赞!
代码我要学习下,o(∩_∩)o...
谢谢了,这项任务有信心了。

On 11月6日, 上午12时15分, Anthony WU <anthonywu...@gmail.com> wrote:
> GD有個style叫gdEdged,建議看看 libgd 的文檔
> 用法
> $img->filledArc ($cx, $cy, $x , $y, int ($olds / $sum * 360), int
> (($olds + $in) / $sum * 360), $color[$i], gdEdged);
>
>
>
> -------- Original Message --------
> Subject: [PerlChina] Re: 请教一个bioinformatics问题——质粒作图
> From: Fangyuan <chengfangyuan2...@gmail.com>
> To: PerlChina Mongers 讨论组 <perlchina@googlegroups.com>
> Date: 5/11/2009 13:12
> > 恩,非常感谢。
> > 我先试试自己做。
>
> > 谢谢啦!
>
> > On 11月5日, 下午1时02分, "Jester"<jes...@perlchina.org> wrote:
>
> >> 这两天太忙,周末我再仔细找找,可能在我原来的电脑上。
> >> 思路嘛,很简单的,根据基因组大小和每个基因的坐标计算相对位置,
> >> 然后换算成360度的角度位置,用你的平面几何知识算出在图上的坐标,画filledPolygen(好像是这个函数名,好久没用了)
>
> >> Jester,jes...@perlchina.org
> >> 2009-11-05  
>
> >> ----- Original Message -----  
> >> From:   Fangyuan  
> >> To:   PerlChina Mongers 讨论组  
> >> Sent:  2009-11-04, 17:36:57
> >> Subject:  [PerlChina] Re: 请教一个bioinformatics问题----质粒作图
>
> >>> Jester,
>
> >>> 这张图很酷呀,正是我想想的类型。请问这张图是你用GD写的程序得到的结果吗?
>
> >>> 很希望能看到你的源程序,呵呵,这样做起来就容易多了。
>
> >>> 不知你能否提示下具体的思路。
>
> >>> 谢谢你的回复 !
>
> --
> Best Regards,
>         Anthony WU
>
> [pollgd.txt10K ]#!/usr/bin/perl
> #¥»µ{¦¡¶È¨Ñ´ú¸Õ¤§¥Î
> #¦p¹ï¥»µ{¦¡¦³¥ô¦óºÃ°Ý¤Î´£·N
> #Åwªï´£¥X°Q½×
> #µ{¦¡ ²[¼Æ gb2utf8 ¤Î u2utf8 °Ñ·Ówww.phpx.comªº¦³Ãö PHP ¥N½X¼g¦¨
> #¨ä¾l³¡¤À¬° 100%§¹³Ð§@
> #ª©ÅvÂk LeoHacks¶}µo¹Î¶¤©Ò¦³
> #ÄY¸T¹p¶Æ«IÅv¤H¤h¨Ï¥Î¥»¥N½X
> #
> #µ{¦¡Àô¹Ò­n¨D:
> #GD Modules & FreeType support
> BEGIN
> {
>         foreach my $LBPATH ($0, $ENV{'PATH_TRANSLATED'}, $ENV{'SCRIPT_FILENAME'})
>         {
>                 next if ($LBPATH eq '');
>                 $LBPATH =~ s/\\/\//g;
>                 $LBPATH =~ s/\/[^\/]+$//o;
>                 unshift (@INC, $LBPATH);
>         }
>
> }
>
> use CGI::Carp "fatalsToBrowser";
> use LBCGI;
> $LBCGI::POST_MAX = 200000;
> $LBCGI::DISABLE_UPLOADS = 1;
> $LBCGI::HEADERS_ONCE = 1;
> require 'data/boardinfo.cgi';
> require 'bbs.lib.pl';
> require 'data/styles.cgi';
> $| = 1;
> $thisprog = 'pollgd.cgi';
> use LBCGI::forum::topic::poll::read;
> $sss = new LBCGI::forum::topic::poll::read;
> $query = new LBCGI;
>
> my $inmembername = $query->cookie ('amembernamecookie');
> my $inpassword = $query->cookie ('apasswordcookie');
> $inmembername =~ tr/[\a\f\n\e\0\r\t\`\~\!\@\#\$\%\^\&\*\(\)\+\=\\\{\}\;\'\:\"\,\.\/\<\>\?]//d;
> $inpassword =~ tr/[\a\f\n\e\0\r\t\|\@\;\#\{\}\$]//d;
>
> if ($inmembername eq undef)
> {
>         $inmembername = '³X«È';
>         $userregistered = 'no';} else {
>
>         &main::getmember ($inmembername, 'no');
>         &main::error ("´¶³q¿ù»~&$div_will­û $inmembername ¦b¥»½×¾Â¤¤¤£¦s¦b¡I") if ($userregistered eq 'no');
>         &main::error ('´¶³q¿ù»~&½×¾Â±K½X»P$div_will­û¦WºÙ¤£¬Û²Å¡A½Ð­«·sµn¤J¡I') if ($inpassword ne $password);
>
> }
>
> # add
> eval ('use GD;');
> if ($@)
> {
>         &main::error ('GD¿ù»~&¦øªA¾¹¤£¤ä´©GD¡A¥»¥\\¯à¤£¯à¨Ï¥Î');}
>
> &main::error ('¦r§Î¿ù»~&¨S¦³¦r§Î¡A¥»¥\¯à¤£¯à¨Ï¥Î') if (!-e $lbdir . 'MYGD/font/arialuni.ttf');
> #
>
> my $forumid = $query->param ('forumid');
> my $postid = $query->param ('postid');
> my $errortype = $sss->readfile ($forumid, $postid);
> if ($errortype eq -1 || $errortype eq -2)
> {
>         &main::error ("´¶³q¿ù$div_wrong&¦Ñ¤j¡A½Ð¤£­n§ðÀ»µ{¦¡¡I");} elsif ($errortype eq -3) {
>
>         &main::error ("´¶³q¿ù$div_wrong&§ä¤£¨ì¦³Ãö§ë²¼¡I");}
>
> &main::moderator ($forumid);
> &main::error ('¶i¤J½×¾Â&¤@¯ë$div_will­û¤£¤¹³\¶i¤J¦¹½×¾Â¡I') if (($startnewthreads eq 'cert')&&(($membercode ne 'ad' && $membercode ne 'smo' && $membercode ne 'cmo' && $membercode ne 'mo' && $membercode ne 'amo' && $membercode !~ /^rz/)||($inmembername eq '³X«È'))&&($userincert eq 'no'));
> if ($allowusers ne '')
> {
>         &main::error ('¶i¤J½×¾Â&§A¤£¤¹³\¶i¤J¦¹½×¾Â¡I') if (",$allowusers," !~ /\Q,$inmembername,\E/i && $membercode ne 'ad');}
>
> if ($sss->{poll}->{$forumid}->{$postid}->{hidepoll} && !grep (/^\Q$inmembername\E$/i, keys (%{$sss->{poll}->{$forumid}->{$postid}->{poller}})))
> {
>         &main::error ('´¶³q¿ù»~&¹ï¤£°_¡A§A¥²»Ý¥ý§ë²¼¤~¥i¬Ýµ²ªG¡I');
>
> }
>
> #use GD;
> my $sum = $sss->{poll}->{$forumid}->{$postid}->{pollcount};
> my @list = ();
> my ($imgx, $imgy) = (600, 600);
> my ($x, $y) = (399, 399);
> #my $img = GD::Simple->new ($imgx, $imgy);
> my $img = new GD::Image ($imgx, $imgy);
> my $white = $img->colorAllocate (255, 255, 255);
> my $black = $img->colorAllocate (0, 0, 0);
> $img->transparent ($white);
> $img->interlaced ('true');
> my $i = 0;
>
> my @color = ();
> $color[0] = $img->colorAllocate (218, 165, 32); #goldenrod
> $color[1] = $img->colorAllocate (128, 128, 128); #gray
> $color[2] = $img->colorAllocate (255, 215, 0); #gold
> $color[3] = $img->colorAllocate (250, 235, 215); #antiquewhite
> $color[4] = $img->colorAllocate (0, 255, 255); #aqua
> $color[5] = $img->colorAllocate (127, 255, 212); #aquamarine
> $color[6] = $img->colorAllocate (240, 255, 255); #azure
> $color[7] = $img->colorAllocate (220, 220, 220); #gainsboro
> $color[8] = $img->colorAllocate (178, 34, 34); #firebrick
> $color[9] = $img->colorAllocate (34, 139, 34); #forestgreen
> $color[10] = $img->colorAllocate (0, 0, 255); #blue
> $color[11] = $img->colorAllocate (138, 43, 226); #blueviolet
> $color[12] = $img->colorAllocate (165, 42, 42); #brown
> $color[13] = $img->colorAllocate (222, 184, 135); #burlywood
> $color[14] = $img->colorAllocate (95, 158, 160); #cadetblue
> $color[15] = $img->colorAllocate (127, 255, 0); #chartreuse
> $color[16] = $img->colorAllocate (210, 105, 30); #chocolate
> $color[17] = $img->colorAllocate (255, 127, 80); #coral
> $color[18] = $img->colorAllocate (100, 149, 237); #cornflowerblue
> $color[19] = $img->colorAllocate (255, 248, 220); #cornsilk
> $color[20] = $img->colorAllocate (220, 20, 60); #crimson
> $color[21] = $img->colorAllocate (0, 255, 255); #cyan
> $color[22] = $img->colorAllocate (0, 0, 139); #darkblue
> $color[23] = $img->colorAllocate (0, 139, 139); #darkcyan
> $color[24] = $img->colorAllocate (184, 134, 11); #darkgoldenrod
> $color[25] = $img->colorAllocate (169, 169, 169); #darkgray
> $color[26] = $img->colorAllocate (0, 100, 0); #darkgreen
> $color[27] = $img->colorAllocate (189, 183, 107); #darkkhaki
> $color[28] = $img->colorAllocate (139, 0, 139); #darkmagenta
> $color[29] = $img->colorAllocate (85, 107, 47); #darkolivegreen
> $color[30] = $img->colorAllocate (255, 140, 0); #darkorange
> $color[31] = $img->colorAllocate (153, 50, 204); #darkorchid
> $color[32] = $img->colorAllocate (139, 0, 0); #darkred
> $color[33] = $img->colorAllocate (233, 150, 122); #darksalmon
> $color[34] = $img->colorAllocate (143, 188, 143); #darkseagreen
> $color[35] = $img->colorAllocate (72, 61, 139); #darkslateblue
> $color[36] = $img->colorAllocate (47, 79, 79); #darkslategray
> $color[37] = $img->colorAllocate (0, 206, 209); #darkturquoise
> $color[38] = $img->colorAllocate (148, 0, 211); #darkviolet
> $color[39] = $img->colorAllocate (255, 20, 256); #deeppink
> $color[40] = $img->colorAllocate (0, 191, 255); #deepskyblue
> $color[41] = $img->colorAllocate (105, 105, 105); #dimgray
> $color[42] = $img->colorAllocate (30, 144, 255); #dodgerblue
> $color[43] = $img->colorAllocate (255, 250, 240); #floralwhite
> my $fontname = $lbdir . 'MYGD/font/arialuni.ttf';
> my $fgcolor = $black;
> $img->stringFT ($fgcolor, $fontname, 15, 0, 100, 500, &main::big52utf8 ($sss->{poll}->{$forumid}->{$postid}->{topic}));
> $img->stringFT ($fgcolor, $fontname, 9, 0, 1, 520, "$boardurl/topic.cgi?forum=$forumid&topic=$postid");
> #$img->stringFT ($fgcolor, $fontname, 9, 0, 350, 530, &main::big52utf8 ('µ{¦¡»s§@³Ð·N¡GAnthony@LEOHACKS'));
> foreach (keys %{$sss->{poll}->{$forumid}->{$postid}->{item}})
> {
>         push (@list, $sss->{poll}->{$forumid}->{$postid}->{item}->{$_}->{pollcount});
>         my @topleft  = (410, 50 + $i * 15);
>         my @botright = (425, 50 + ($i + 1) * 15);
>         $img->rectangle (@topleft, @botright, $black);
>         $img->fill (int (($topleft[0] + $botright[0]) / 2), int (($topleft[1] + $botright[1]) / 2), $color[$i]);
>         $img->stringFT ($fgcolor, $fontname, 9, 0, $botright[0] + 3, $botright[1], &main::big52utf8 ($sss->{poll}->{$forumid}->{$postid}->{item}->{$_}->{itemname}));
>         $i++;}
>
> undef ($i);
> my ($cx, $cy) = (int ($x / 2), int ($y / 2));
> my $olds = 0;
> my $i = 0;
> foreach my $in (@list)
> {
>         $img->filledArc ($cx, $cy, $x , $y, int ($olds / $sum * 360), int (($olds + $in) / $sum * 360), $color[$i], gdEdged);
>         $olds += $in;
>         $i++;}
>
> $img->arc ($cx, $cy, $x , $y, 0, 360, $black);
> undef ($i);
> undef ($olds);
> print $query->header (-type => 'image/png');
> binmode (STDOUT);
> print $img->png;
> #$img->clear;
> undef ($img);
> exit;
>
> sub u2utf8
> {
>         my $c = shift;
>         $c = unpack ('H4', $c);
>         $c =~ s/(..)(..)/$2$1/;
>         $c = hex ($c);
>         my $str;
>         if ($c<0x80)
>         {
>                 return pack ('C', $c);
>         } elsif ($c<0x800) {
>                 $str = (0xC0|$c>>6);
>                 $str .= (0x80|$c&0x3F);
>         } elsif ($c<0x10000) {
>                 $str = (0xE0|$c>>12);
>                 $str .= (0x80|$c>>6&0x3F);
>                 $str .= (0x80|$c&0x3F);
>         } elsif ($c<0x200000) {
>                 $str = (0xF0|$c>>18);
>                 $str .= (0x80|$c>>12&0x3F);
>                 $str .= (0x80|$c>>6&0x3F);
>                 $str .= (0x80|$c&0x3F);
>         }
>         return pack ('C3', unpack ('A3A3A3', $str));
>
> }
>
> sub big52utf8
> {
>         my $str = $_[0];
>         my $ref = '';
>         open (FILE, '<', $lbdir . 'MYGD/unicode/big5_unicode.bin');
>         binmode (FILE);
>         for (my $i=0;$i<length ($str);$i++)
>         {
>                 my $tmp = substr ($str, $i, 1);
>                 if (ord ($tmp) > 127)
>                 {
>                         $tmp = substr ($str, $i++, 2);
>                         seek (FILE, hex (unpack ('H4', $tmp)) * 2, 0);
>                         read (FILE, $tmp, 2);
>                         $tmp = &main::u2utf8 ($tmp);
>                 }
>                 $ref .= $tmp;
>         }
>         close (FILE);
>         $ref;
>
> }
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---