困扰很久的问题,可能是由于新立得安装和cpan安装冲突出现不支持PNG或者JPG的情况。据其他同事反映,全部使用新立得安装是可以支持的。如果遇到这种情况,需要删除全部相关模块重新进行安装。在新立得里删除libgd2-xpm-dev/libgd2-xpm/libgd-gd2-perl。下载安装gd-2.0.35/libpng-1.2.33/zlib-1.2.3/jpeg-6bb. The gd graphics library: http://www.boutell.com/gd/c. The PNG graphics library: http://www.libpng.org/pub/p.. Read More
posted @ 2010-04-16 20:38 javawebsoa Views(218) Comments(0) Diggs(0) Edit
从学习Perl/Mason开始,长久以来,我都是在ubuntu下搭建Mason的开发、运行环境的,因为Perl是ubuntu的原生语言,而且通过新立得安装组件、模块来的非常方便。组内所有Mason开发环境,也是基于我研究的ubuntu平台。但是如何在windows下搭建Mason的运行、开发环境一直是我所困扰、想实现的。这样我们就可以不再限定于特定开发平台,无论对于开发、还是部署都有新的意义。通过反复尝试,终于在windows下顺利搭建好了Mason的环境,以下是搭建的步骤。安装ActivePerl:下载地址http://www.skycn.com/soft/1211.html。安装Apach Read More
posted @ 2010-04-16 20:25 javawebsoa Views(434) Comments(0) Diggs(0) Edit
Perl中文/unicode/utf8/GB2312编码之间的转换是一件很让人头疼的事情,我总结了以下主要的转换方法,供大家了解参考。# author: jiangyujieuse utf8;use Encode;use URI::Escape;$/ = "/n";#从unicode得到utf8编码$str = '%u6536';$str =~ s//%u([0-9a-fA-F]{4})/pack("U",hex($1))/eg;$str = encode( "utf8", $str );print uc unpack Read More
posted @ 2010-04-16 20:20 javawebsoa Views(305) Comments(0) Diggs(0) Edit
在Perl和PHP中生成中文图片最关键的一点是需要设置一个可以显示中文的字体。在Linux平台上,我们可以把windows下的雅黑文件拷过去。在控制面板-字体里可以拷贝雅黑字体文件:放在Ubuntu的/usr/share/fonts/vista下。Perl的关键代码类似下面所示:GD::Image->trueColor(1);my $image = newFromPng GD::Image($imagepath) || die "can't open image: $!";my $white = $image->colorAllocate(255,255 Read More
posted @ 2010-04-16 20:18 javawebsoa Views(196) Comments(0) Diggs(0) Edit
饭否的图片插件可用于论坛,博客,将用户的信息和一些最新动态用图片的形式表现出来。我们如果需要自行开发此功能的话,需要设置某种格式(或某个地址)的图片采用脚本来处理。在Perl中的话例如可以使用Apache的LocationMatch或者FilesMatch指令来进行设置,让某个Perl模块来进行处理。如果使用Mason的话,更为简单,不需要修改服务器,只需利用dhandler的特性,就可以让指定的脚本来处理。基本流程如下:主要代码如下: my $uri = $r->uri; if($uri =~ /.jpg$/) { $uid = substr($uid, 1, -4); # 从uri里 Read More
posted @ 2010-04-16 20:18 javawebsoa Views(167) Comments(0) Diggs(0) Edit
我们平常Mason的开发环境都是部署在Ubuntu平台上的,因为通过新立得安装某些必要的软件时非常方便。以下是部署的经验总结:需要通过新立得安装的模块包括:Apache2 mod_perl2(libapache2-mod-perl2) dbi(libdbi-perl,即DBI模块,可通过cpan安装)dbd(libdbd-mysql-perl/libdbd-mysql)libapreq2(包括libapache2-mod-apreq2,libapache2-request-perl,Apache2::Request/Apache2::Upload/Apache2::Cookie模块)mason Read More
posted @ 2010-04-16 20:11 javawebsoa Views(180) Comments(0) Diggs(0) Edit
UIImage+ColorAtPixelcategory#import <UIKit/UIKit.h>/*A category on UIImage that enables you to query the color value of arbitrarypixels of the image.*/@interface UIImage (ColorAtPixel)- (UIColor *)colorAtPixel:(CGPoint)point;@end#import <CoreGraphics/CoreGraphics.h>#import "UIImage+ Read More
posted @ 2010-02-09 09:54 javawebsoa Views(209) Comments(0) Diggs(0) Edit
本人2007年大学毕业,为生计所迫,先就职于某世界大工厂,终日游手好闲,无所事事,料想如此三年五年下去,必定前程荒废,不得翻身。自觉对不住大学期间的学费,更无颜面对乡下日夜辛劳的父母。于是决定转战他行。遂于2008年10月结束合约,获得解放。 11月开始投身iPhone开发,算是国内较早的开发者。由于昔日的老本荒废已久,本来就没有太多编程经验,外加新生事物的参考资源甚少,中间困难重重。常混迹于国内外各大论坛和博客,每当发现一点有价值的东西总是迫不及待地收藏下来,万分珍惜。期间,感谢各位达人的鼓励,提点,砖拍,甚至冷嘲热讽。这样一年多下来,积累了一些经验,从构架到代码,从程序,发布到营销逐... Read More
posted @ 2010-02-08 16:18 javawebsoa Views(128) Comments(0) Diggs(0) Edit
UIWindow *myWindow = [[UIWindow alloc] initWithFrame:[UIApplication sharedApplication].statusBarFrame]; [myWindow setBackgroundColor:[UIColor clearColor]]; [myWindow setWindowLevel:UIWindowLevelStatusBar]; UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(280.0f, 5.0f, 10.0f, .. Read More
posted @ 2010-02-08 16:11 javawebsoa Views(140) Comments(0) Diggs(0) Edit
下面这段代码可以实现邻近检测功能,当你的身体靠近iPhone而不是触摸的时候,iPhone将会做出反应。(需要一定的面的影射,约5mm左右的时候就会触发)在程序初始化处,添加一个监听UIDevice *device = [UIDevice currentDevice];device.proximityMonitoringEnabled = YES;if (device.proximityMonitoringEnabled ==YES)[[NSNotificationCenter defaultCenter]addObserver:selfselector:@selector(proximity Read More
posted @ 2010-02-08 15:47 javawebsoa Views(312) Comments(0) Diggs(0) Edit