ITeye博客

mrjeye's blog

mrjeye · 共 107 篇文章

手势识别

注册: UISwipeGestureRecognizer *recognizer; recognizer = [[uiswipegesturerecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)]; [recognizer setdirection:(uiswipegesturerecognizerdirectionright)]; [[self view] addGestureRecognizer:recognizer]; [recognizer release]; 处理: - (void)hand…

2011-09-01 13:43 · iphone · 评论(0)

压缩图片

@interface UIImage (Compress) - (UIImage *)compressedImage; - (CGFloat)compressionQuality; - (NSData *)compressedData; - (NSData *)compressedData:(CGFloat)compressionQuality; @end #define MAX_IMAGEPIX 200.0 // max pix 200.0px #define MAX_IMAGEDATA_LEN 50000.0 // max data length 5K @implementation U…

2011-08-22 14:38 · iphone · 评论(0)

mybatis 缓存

pom: <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>${org.mybatis-version}</version> </dependency> <dependency> <groupId>org.mybatis.caches</groupId> <artifactId>mybatis-ehcache</artifactId> <version>1.0.0-RC1</version> </dependency> log4j: <logger name…

2011-08-22 11:06 · java web · 评论(0)

给自己的应用程序添加系统偏好设置二

Root.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>StringsTable</key> <string>Root</string> <key>PreferenceSpecifiers</key> <array> <dict> <key>Type</key> <string>…

2011-08-18 15:22 · iphone · 评论(0)

打开了优化选项后不打印log

.pch #ifndef __OPTIMIZE__ #define NSLog(...) NSLog(__VA_ARGS__) #else #define NSLog(...) {} #endif

2011-08-18 14:34 · iphone · 评论(0)

给自己的应用程序添加系统偏好设置

在 传统的桌面应用程序中,偏好设置是一些专门面向应用程序的设置,用于配置应用程序的行为和外观。iPhone OS也支持应用程序偏好设置,但并不将它作为应用程序整体的一部分。在iPhone OS上,应用程序级别的偏好设置并不由各个程序本身的定制界面来显示,而是由系统提供的Settings程序统一显示。 为了将定制的应用程序偏好设置集成到Settings程序中,您必须在应用程序包的顶级目录中包含一个特殊格式的Settings 程序包 , 由它负责将应用程序的偏好设置信息提供给Settings程序,而Settings程序则负责对其进行显示,并将用户提供的值写入偏好设置数据库。在运行 时,您的应用程…

2011-08-18 14:12 · iphone · 评论(0)

嗯,就是内存方面的

UIScrollView* scroll = [[uiscrollview alloc] init]; NSLog(@"scroll retain count 1 is %d", [scroll retaincount]); ControlPanel* cp = [[controlpanel alloc] init]; NSLog(@"control panel retain count 1 is %d", [cp retaincount]); [scroll addsubview:cp]; NSLog(@"control panel retain count 2 is %d", [cp r…

2011-08-18 09:59 · iphone · 评论(0)

UITextField密码框

[txtpass setsecuretextentry:yes];

2011-08-17 14:25 · iphone · 评论(0)

jsp 删除无用空行

<%@ tag trimDirectiveWhitespaces="true" %>

2011-08-12 13:59 · java web · 评论(0)

mybatis错误备忘

刚在mybatis里遇到的几个错误 Mapped Statements collection does not contain value for ... 原因之一可能是:Mapper配置的namespace不唯一,需要指定不一样的命名空间给mapper标签。 **org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already co…

2011-08-10 10:12 · java web · 评论(0)

mac环境变量

cd vim .profile 加入行:export PATH=${PATH}:/usr/local/mysql/bin source .profile

2011-08-10 09:31 · iphone · other · 评论(0)

添加阴影和设置圆角

圆角: CALayer * layer = [theview layer]; [layer setmaskstobounds:yes]; [layer setcornerradius:theradius]; [layer setborderwidth:theborderwidth]; [layer setbordercolor:thecolor.cgcolor]; 其中:theView(UIView)为目标view theRadius(float)为圆角半径 theBorderWidth(float)为边框大小 theColor(UIColor)为边框颜色 -----------------…

2011-07-07 15:08 · iphone · 评论(0)

国际化

一、获取系统所支持的国际化信息 在国际化之前,你可以在iphone中的”设置->通用->多语言环境->语言”中来查看你的iphone支持哪些语言,当然也可以写一段代码测试一下你的iphone都支持哪些语言.测试代码如下: NSUserDefaults *defaults = ; NSArray *languages = ; NSLog(@"%@", languages); 注:NSUserDefaults类用来取得用户人默认信息. 二、在Xcode中建立多语言文档 1.在Resources分类下新建文档(右鍵/Add/New File…) 2.在模板对话框中选择Other,然后再选择Stri…

2011-07-05 15:38 · iphone · 评论(0)

在LED上显示一串数字

#include <reg51.h> #include <delay.h> #define uint unsigned int #define uchar unsigned char /** 显示一个LONG数据类型(显示最大值是99999999) @param val 要显示的数字 @param deg 小数点位置(从后向前数) */ void printLong(long val,uint deg); void main() { while(1) { printLong(1234,0); delay(50); } } void printLong(long val,uint deg) {…

2011-05-19 10:53 · 51 · 评论(0)

Linux通过FTP下载MYSQL

mysql $ftp ftp.cn.freebsd.org $cd pub/FreeBSD/distfiles $ls mysql* $get mysql-5.0.18.tar.gz $bye $tar -zxvf mysql-5.0.18.tar.gz

2011-05-19 10:48 · linux · 评论(0)