Monday, June 18, 2007

Perl下如何安装一个模块和使用smtp发送邮件

Active Perl和Cpan的Perl有些不一样,安装的时候使用ppm,具体的操作即在命令行模式下运行ppm

启动ppm后使用命令search xxx 模块名搜索模块,如果网络连接正常,过会就会返回找到的模块名称,我前面找的是sasl。
找到后运行 install authen-sasl,active perl会自动下载需要的文件并完成安装,看到Successfully installed authen-sasl version 2.10 in ActivePerl 5.8.3.809.
即成功完成安装。
下面是发送smtp邮件的方法
use Net::SMTP;
my $MailHost = "mailhost";
my $MailFrom = "xxxx\@mailhost.com";
my $MailTo = "xxxx\@mailhost.com";
my $subject = "Subject Line here";
my $MailBody = "This is the mail body";
my $smtp = Net::SMTP->new($MailHost) or die "Can't create smtp!";
$smtp->auth('user','pass');
# Send the From and Recipient for the mail servers that require it$smtp->mail($MailFrom); $smtp->to($MailTo);
# Start the mail$smtp->data();
# Send the header. $smtp->datasend("To: $MailTo\n"); $smtp->datasend("From: $MailFrom\n"); $smtp->datasend("Subject: $subject\n"); $smtp->datasend("\n");
# Send the message $smtp->datasend("$MailBody\n\n");
# Send the termination string $smtp->dataend();
$smtp->quit;

Sunday, June 17, 2007

使用winrar做备份

命令行如下

首先将rar命令行工具的路径添加到path中去
path=%path%;"RAR_PATH";
接着转到工作目录下
cd c:\project
运行rar,附带一下参数
rar a -r -agyyyy-mm-dd-hh-mm-ss bak test
这个命令行参数的意义是,a 代表添加到一个压缩文档, -r代表压缩的时候包括子目录,-agyyyy-mm-dd-hh-mm-ss代表在生成的压缩文档的名字后面加入一个时间,以yyyy-mm-dd-hh-mm-ss的格式,bak 为压缩文件的名字,结果会是bakyyyy-mm-dd-hh-mm-ss.rar,test是指定要压缩的目录或者文件名。

把上面的压缩脚本放入一个bat文件,然后用windows计划任务,就可以每周自动按时备份了:)

Saturday, June 16, 2007

跨平台开发游戏引擎-EGDELIB Mobile Game SDK

最新的版本是3.1
包括 Lite, Standard ,Full ,Eval 四个不同版本,前面3个版本需要 License Fee, 评估版仅限非商业用途使用。
官方网站地址http://www.edgelib.com/

LicenseLiteStdFullEval
Non-commercial useYYYY
Commercial useYYY-


Supported PlatformsLiteStdFullEval
Windows Mobile Pocket PC up to 5.0YYYY
Windows Mobile Smartphone up to 5.0YYYY
Symbian Series 60 up to S60 3rd editionYYYY
Symbian UIQ up to 3.0YYYY
Symbian Series 80 (Nokia Communicator)YYYY
Symbian Series 90 (Nokia 7710)YYYY
Gamepark Holdings GP2X handheldYYYY
Windows desktopYYYY
Upcoming supported platformsYYYY


2D GraphicsLiteStdFullEval
2D surfacesYYYY
Screen orientation awarenessYYYY
Drawing primitivesYYYY
Color key transparencyYYYY
Advanced color filtersYYYY
Dynamic clippingYYYY
Advanced rasterized font text drawingYYYY
Surface rotation and scalingYYYY
DirectDraw hardware support for WindowsYYYY
Direct Screen Access for SymbianYYYY
Bounding box collision detectionYYYY
Pixel precise collision detection-YYY
RGBA surfaces--YY
Built-in screen wipes--YY
Custom pixel shaders--YY


Optimized Blitlet SupportLiteStdFullEval
Lite optimized blitlet setYYYY
Standard optimized blitlet set-YYY
Full optimized blitlet set--YY


Supported Image and 3D FormatsLiteStdFullEval
BMP (Windows bitmap)YYYY
PNG (Portable Network Graphics)-YYY
GIF (Graphics Interchange Format)-YYY
TGA (Targa)--YY
JPEG (Joint Photographic Experts Group)--YY
3DS (3D Studio)--YY
MS3D (MilkShape 3D)--YY


3D GraphicsLiteStdFullEval
3D surfaces--YY
OpenGL?ES 1.1 support--YY
Internal EDGELIB 3D renderer--YY
3D skeletal animation--YY
OpenGL?ES helper functions--YY
3D collision detection (TBA)--YY


Network ConnectivityLiteStdFullEval
Bluetooth-YYY
TCP/IP (wifi/gprs/umts)-YYY
HTTP functionality-YYY
Chillingo ClickPayGo support-YYY


File HandlingLiteStdFullEval
Basic file reading and writingYYYY
Reading from Edge Resource PacksYYYY
Writing to Edge Resource Packs-YYY
Reading from INI configuration files-YYY
Writing to INI configuration files--YY
Folder manipulation--YY


InputLiteStdFullEval
Supported input devices and buttonsYYYY
Key mappingsYYYY
TiltCONTROL hardware device support-YYY


MiscellaneousLiteStdFullEval
Standard classYYYY
Memory classYYYY
Sound library plug-in supportYYYY
Timer classYYYY
Math classYYYY
Debugging toolsYYYY
Dynamic registration classYYYY
Device information classYYYY
Event recording-YYY


SDK ToolsLiteStdFullEval
EDGELIB BuilderYYYY
EDGELIB PackerYYYY
EDGELIB Animation Strip MakerYYYY
EDGELIB Font OrganizerYYYY
EDGELIB Tile ScannerYYYY


Provided SupportLiteStdFullEval
Public forumYYYY
E-mail-YY-
Instant Messaging--Y-