上海招聘资深perl开发人员,外企,待遇从优 在 2011年9月20日 下午4:19, <[email protected]>写道:
> 今日主题摘要 > > 网上论坛: http://groups.google.com/group/perlchina/topics > > - 关于电子商务的数据挖掘 <#13285eb506922526_group_thread_0> [3 条更新] > - 用Emacs误删了文件 <#13285eb506922526_group_thread_1> [1 条更新] > - Ask help for Perl sort customized > function<#13285eb506922526_group_thread_2>[4 条更新] > > 主题: 关于电子商务的数据挖掘<http://groups.google.com/group/perlchina/t/d41f1ae76932dd08> > > "[email protected]" <[email protected]> Sep 19 09:30PM +0800 > ^<#13285eb506922526_digest_top> > > RT! > 网站是eshop这个cms搭建起来的。现在要分析电子商务数据,获取商品关注情况等,求指点统计思路。 > > > > > zhihua zheng <[email protected]> Sep 19 09:55PM +0800 > ^<#13285eb506922526_digest_top> > > 把网址发来看看? > > 2011/9/19 [email protected] <[email protected]> > > > > > > Du Wayne <[email protected]> Sep 20 09:43AM +0800 > ^<#13285eb506922526_digest_top> > > > > 从广告ROI的角度,你需要知道媒体推广(广告位):展示――点击(着陆网站)――二跳(访问单品数量)――行为(注册/登录/收藏)――消费(订单)数据,包括按媒体、用户跟踪 > > 2011/9/19 zhihua zheng <[email protected]> > > > > > 主题: 用Emacs误删了文件<http://groups.google.com/group/perlchina/t/cbea34ca9d3cd8d9> > > Morya Feng <[email protected]> Sep 19 08:30PM +0800 > ^<#13285eb506922526_digest_top> > > 有git不用,这个…… > 不该啊 > > 在 2011年9月19日 下午2:43,钟声 <[email protected]>写道: > > > > > 主题: Ask help for Perl sort customized > function<http://groups.google.com/group/perlchina/t/fbcb0b1ae5ac36cb> > > Fangyuan <[email protected]> Sep 19 12:41AM -0700 > ^<#13285eb506922526_digest_top> > > 大家好,请教一个自定义sort函数的问题。 > 有一个数组,@a = (1..20, "10+"),我想对这个数组排序,排序的规则是:1)数字优先, > "10+"排在数字后面;2)数字按从小到大 > 我自己写了一个代码,运行没有返回我想要的结果。寻求高手指点一下,谢谢! > > my @a = (0..20, "10+"); > my @b = sort{ > if(m/^\d+$/){ > return $a <=> $b; > } > else{ > return -1; > } > } @a; > print join(",", @b), "\n"; > > > > > Fayland Lam <[email protected]> Sep 19 03:47PM +0800 > ^<#13285eb506922526_digest_top> > > try this. > > my @a = (0..20, "10+", 21 .. 25); > @a = reverse(@a); > my @b = sort{ > if($a =~ /^\d+$/ and $b =~ /^\d+$/){ > return $a <=> $b; > } elsif ($a =~ /^\d+$/) { > return -1; > } elsif ($b =~ /^\d+$/) { > return 1; > } else { > return $a cmp $b; > } > } @a; > print join(",", @b), "\n"; > > if you have > > use warnings; > > it will tell you that > > Use of uninitialized value $_ in pattern match (m//) > > then you know there isn't $_ in sort {} > > Thanks > > > -- > Fayland Lam // http://www.fayland.org/ > > > > > Robin Lee <[email protected]> Sep 19 03:48PM +0800 > ^<#13285eb506922526_digest_top> > > my @b = sort{ > if ($a !~ /^\d+$/) { > return 1; > } > elsif ($b !~ /^\d+$/) { > return -1; > } > else { > return $a <=> $b; > } > } @a; > > > > > > > Fangyuan <[email protected]> Sep 19 02:03AM -0700 > ^<#13285eb506922526_digest_top> > > It works. > Thanks Fayland and Cheese. > > > > -- > 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。 > 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 > 要取消订阅此网上论坛,请发送电子邮件至 [email protected]。 > 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。 > -- 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 要取消订阅此网上论坛,请发送电子邮件至 [email protected]。 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
