Just a little smile ^ ^

yoyo_zeng

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

2013年9月17日

摘要: block: block是c的一个运行时特性,和函数指针类似,用户回调函数。主要用于并行线程。//创建一个分发队列,第一个参数为队列名,第二个参数是保留的 dispatch_queue 属性,设为null//可使用函数 dispatch_queue_t dispatch_get_global_queue(long priority, unsigned long flags);来获得全局的 dispatch_queue,参数 priority 表示优先级,dispatch_queue_t queue = dispatch_queue_create("test_queue", 阅读全文
posted @ 2013-09-17 12:22 yoyo_zeng 阅读(536) 评论(0) 推荐(0) 编辑

摘要: CGSize imageSize = [UIImage imageNamed:@"s2_1.png"].size; for (int i=0; i offset+self.frame.size.width) { [imageStore removeObject:view]; UIImageView *firstView = [imageStore objectAtIndex:0]; view.frame = CGRectMake(firstView.frame.origin.x-firstView.frame.size.width, view.f... 阅读全文
posted @ 2013-09-17 11:09 yoyo_zeng 阅读(357) 评论(0) 推荐(0) 编辑

摘要: 和c++类似,@try,@catch,@finally,@throw;[NSExceptionraise:@"WebServiceerror"format:@"%@",returnJson4SOAP]; 异常类:NSException,可自定义自己的异常类,继承NSExceptionCup *cup = [[Cupalloc]init];@try{ [cupfill];}@catch(NSException*exception) {NSLog(@"main: Caught %@: %@", [exceptionname], [exce 阅读全文
posted @ 2013-09-17 11:07 yoyo_zeng 阅读(154) 评论(0) 推荐(0) 编辑

2013年9月10日

摘要: //移动- (IBAction)translation:(id)sender { CABasicAnimation *traslation = [CABasicAnimation animationWithKeyPath:@"position"]; traslation.toValue = [NSValue valueWithCGPoint:CGPointMake(320,480)]; traslation.duration = 2.0; //traslation.autoreverses = YES; traslation.repeatCount = 1; ... 阅读全文
posted @ 2013-09-10 09:45 yoyo_zeng 阅读(2716) 评论(0) 推荐(0) 编辑

2013年8月29日

摘要: 1 云测试目前免费的只有testin, web只支持兼容性测试,客户端测试还未试过。2 instrucment automation脚本的录制和回放,在模拟器上,你还可以激活Accessibility 的检测器。启动模拟器,找到“Settings > General > Accessibility > Accessibility Inspector”,然后将它设为“打开”状态。可以查看element的name和value,rect。var target = UIATarget.localTarget();var app = target.frontMostApp();var 阅读全文
posted @ 2013-08-29 16:50 yoyo_zeng 阅读(205) 评论(0) 推荐(0) 编辑

2013年8月22日

摘要: 函数一,合并两个已经排好序的数组:merge(A,p,q,r) //A是数组,p->q, q+1->r都是排好序的 n1 = q-r+1; n2 = r-q; create arrays L[1->n1+1] and R[1->n2+1]; //创建两个数组,最后一个元素是哨兵,为无穷大 L[n1+1] = ∞; R[n1+1] = ∞; for (i = 1->n1) L[i] = A[p+i-1]; for (i = 1->n2) R[i] = A[q+i]; i = 1; j = 1; for (k = p->r) //将两个数组的依次比较最小, 阅读全文
posted @ 2013-08-22 09:27 yoyo_zeng 阅读(282) 评论(0) 推荐(0) 编辑

2013年8月20日

摘要: 类似拿牌:数组 A;for j 0 and A[i]>key //j从2-lenth[A],依次变例j-1->0数组元素,然后后移,直到发现比j小的,将j插入后一个位置。 A[i+1] = A[i]; i--; A[i+1] = key;时间复杂度 o(n的平方) 阅读全文
posted @ 2013-08-20 11:35 yoyo_zeng 阅读(156) 评论(0) 推荐(0) 编辑

2013年8月1日

摘要: 转自:http://jy00361722.blog.163.com/blog/static/96149513201042811212884webservice一般分为http webservice ,soap webservice两种,都是基于http通信协议的,一般返回xml格式的数据,所以也可以叫做xml webservice.http webservice 通过get post 两种方法来调用远程的数据服务,适合简单参数的传递(get 直接在url里带上参数);soap webservice通过soap协议传输数据,soap是基于xml标准的,也是就说可以用xml结构的数据来传输参数,这 阅读全文
posted @ 2013-08-01 00:16 yoyo_zeng 阅读(1489) 评论(0) 推荐(1) 编辑

2013年7月31日

摘要: use LWP::UserAgent;; use HTTP::Request; use HTTP::Response; use HTTP::Request::Common; $agent=new LWP::UserAgent; $request=POST('http://localhost:8080/wm/ab',[name=>'zhangsan']); $request->header('User-Agent'=>'Mozilla/5.0 (Windows NT 5.1; rv:10.0.1) Gecko/201001 阅读全文
posted @ 2013-07-31 14:19 yoyo_zeng 阅读(1520) 评论(0) 推荐(0) 编辑

2013年7月8日

摘要: 转自:http://blog.csdn.net/chengyingzhilian/article/details/7874408注册通知:即要在什么地方接受消息[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(mytest:)name:@" mytest"object:nil];参数介绍:addObserver: 观察者,即在什么地方接收通知; selector: 收到通知后调用何种方法; name: 通知的名字,也是通知的唯一标示,编译器就通过这个找到通知的。发送通知:调用观察者处 阅读全文
posted @ 2013-07-08 13:55 yoyo_zeng 阅读(190) 评论(0) 推荐(0) 编辑

2013年6月27日

摘要: axis2是1.6.2的版本,cfx是2.7.5的版本,从apache官网上下载的,编译器是eclipse,操作系统是mac。最近刚好有用web service,以前都是调用,这次需要发布。对于如何生成一个web service,网上很多例子,大体:下载 axis2 bin1.6.2 -> 在eclipse中配置axis2环境 -> 创建项目 -> 创建service java文件 -> 右键点击create web service, 或者手动配置 -> 启动服务器。cfx差不多:可以参考,http://www.cnblogs.com/frankliiu-java 阅读全文
posted @ 2013-06-27 16:47 yoyo_zeng 阅读(1844) 评论(0) 推荐(0) 编辑

2013年6月24日

摘要: 今天碰到一个很sb的bug。起因是:@Controllerpublic class DemoController { @Autowired private DemoService demoService;}@Servicepublic class DemoService{ @Autowired private DemoRepository demoRespository; @Transactional public void addUser(UserInfo userInfo){ demoRespository.addUser(use... 阅读全文
posted @ 2013-06-24 14:38 yoyo_zeng 阅读(878) 评论(0) 推荐(0) 编辑

2013年6月13日

摘要: @ModelAttribute("attr_name")public return_type method(){ return attr_value}注释一个方法,会在@Controller执行时加载,在@ModelAttribute添加参数.返回于该@Controller返回的所有JSP页面. 从页面接收到了一个名为"attr_name"的model<form:formmodelAttribute="attr_name"></form>public return_type method(@ModelAttri 阅读全文
posted @ 2013-06-13 15:51 yoyo_zeng 阅读(226) 评论(0) 推荐(0) 编辑

2013年5月7日

摘要: 配置Factory bean that configures a VelocityEngine and provides it as bean reference. This bean is intended for any kind of usage of Velocity in application code, e.g. for generating email content. For web views, VelocityConfigurer is used to set up a VelocityEngine for views. <bean id="velocit 阅读全文
posted @ 2013-05-07 09:25 yoyo_zeng 阅读(325) 评论(0) 推荐(0) 编辑

摘要: IPA类 NHHH (0-126)(0-255)(0-255)(0-255) 126个网络,每个网络有256*256*256个主机B类 NNHH (128-191)(0-255)(0-255)(0-255) 64*256个网络,每个网络有256*256个主机C类 NNNH (192-222)(0-255)(0-255)(0-255) 31*256*256个网络,每个网络有256个主机 阅读全文
posted @ 2013-05-07 09:25 yoyo_zeng 阅读(131) 评论(0) 推荐(0) 编辑

摘要: if(){}elsif(){}else{}while(){}until(){}for(; ;){}foreach $word (@words) {if ($word eq "the") {print ("found the word 'the'\n");}}do {statement_block} while_or_until (condexpr);last: 与C中的break作用相同;next: 与C中的continue作用相同;redo: 重复此次循环,即循环变量不变,回到循环起始点,但要注意,redo命令在do循环中不起作用。go 阅读全文
posted @ 2013-05-07 09:24 yoyo_zeng 阅读(217) 评论(0) 推荐(0) 编辑

摘要: sql注入xss(插入恶意html)点击劫持(iframe透明)CSRF Cross-siterequestforgery跨站请求伪造 阅读全文
posted @ 2013-05-07 09:24 yoyo_zeng 阅读(143) 评论(0) 推荐(0) 编辑

摘要: package classname#构造函数sub new{#所谓对象其实是一个哈希表或者数组my $self = shift; bless $self, shift; #将self和类关联,告诉对象,你现在是shift类了,你可以使用shift类的方法了。return $self;}sub virtual_method{}1;对象以.pm文件结尾静态方法: 第一个参数为类名,虚方法: 第一个参数为对象的引用shift方法处理第一个参数的方式决定了它是静态的还是虚的。静态方法一般忽略掉第一个参数,因为它们已经知道自己在哪个类了,构造函数即静态方法。继承# parent classpacka.. 阅读全文
posted @ 2013-05-07 09:15 yoyo_zeng 阅读(200) 评论(0) 推荐(0) 编辑

2013年5月2日

摘要: $相当于C语言中指针的解析*, \相当于C语言中的取地址&数组, 以@开头 @array = (1, $var, "a string"); 列表()中可以为任何值,包括变量,可为不同类型, 同一个名字可以同时用于数组变量和简单变量 取值:$scalar = $array[0]; 对数组中的值通过下标存取,第一个元素下标为0。试图访问不存在的数组元素,则结果为NULL,但如果给超出数组大小的元素赋值,则数组自动增长,原来没有的元素值为NULL。 拷贝:@result = @original; 对变量赋值: @array = (5, 7, 11);($var1, $va 阅读全文
posted @ 2013-05-02 16:20 yoyo_zeng 阅读(164) 评论(0) 推荐(0) 编辑

摘要: 标红为何C不同1 变量:$x = 12345; 弱类型语言可以支持 10+'20'2 8进制以0打头,16进制以0x打头。 例:$var1 = 047; (等于十进制的39) $var2 = 0x1f; (等于十进制的31) $number = 11; $text = "This text contains the number $number.";3 单引号和双引号区别: 1 单引号没有变量替换功能 2 反斜线只在包含单引号和反斜线时起作用 3 单引号可以跨多行 $text = 'This is two lines of text '; 与 阅读全文
posted @ 2013-05-02 16:00 yoyo_zeng 阅读(272) 评论(0) 推荐(0) 编辑