孤独的猫

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

09 2012 档案

摘要:#!/usr/bin/perl -wuse File::Temp qw(tempdir);use File::Spec::Functions;use LWP::Simple qw(getstore);my ($temp_dir)=tempdir(CLEARUP => 1);my %searches = ( google =>'http://www.google.com/#h1=en&q=perl', yahoo => 'http://search.yahoo.com/search?p=perl', microsoft =>  阅读全文
posted @ 2012-09-28 22:11 孤独的猫 阅读(316) 评论(0) 推荐(0)

摘要:#!/usr/bin/perl -wuse 5.010;open my ($points),'<','points.txt' or die "couldn't read points data: $!\n";while (<$points>) { next if /^\s*#.*$/; #跳过注释 push @xyz,[split];}foreach my $pt (@xyz) { print "point ",$i++,": x=$pt->[0],y=$pt->[1], & 阅读全文
posted @ 2012-09-28 22:00 孤独的猫 阅读(317) 评论(0) 推荐(0)

摘要:1 #!/usr/bin/env python 2 #coding=utf-8 3 import os,sys 4 import shutil,re 5 6 def getparam(str): 7 file_re=re.compile(r'(\w*)(#{1,})(\w*)') 8 m=file_re.search(str) 9 return m.groups10 11 12 def changename(dir):13 filenum=014 i=int(sys.argv[3])15 list=os.listdir(dir) ... 阅读全文
posted @ 2012-09-20 21:00 孤独的猫 阅读(228) 评论(0) 推荐(0)

摘要:useBean动作标签 这个标签是笔者认为最重要的标签,所以放在了最后。 首先介绍Java Bean的特点:可以实现代码服用,易编写,易维护,易使用,可以在任何有JVM的机器上使用而不许重新编译。1.编写JavaBean的规则:(1)如果类的成员变量的名字是xxx,那么为了更改或获取成员变量的值在类中可以定义两个方法:getXxx()来获取属性和setXxx()来设置属性,要注意大小写。(2)对于boolean类型的成员变量,允许使用is来代替get和set。(3)类中的方法属性必须是Public的。(4)类中如果有构造方法,那么这个构造方法也是public的,并且是无参数的。例:一个简单be 阅读全文
posted @ 2012-09-12 22:18 孤独的猫 阅读(1015) 评论(1) 推荐(1)

摘要:Function InsertIntoDoc(strPath as string)   Set fso=CreateObject("Scripting.FileSystem") 阅读全文
posted @ 2012-09-11 21:28 孤独的猫 阅读(426) 评论(0) 推荐(0)