UIView *view1=[[UIView alloc] initWithFrame:CGRectMake(50, 50, 100, 100)]; view1.backgroundColor=[UIColor yellowColor]; view1.tag=1; ...
                            
                            
                                分类:
移动开发   时间:
2014-08-26 01:42:45   
                                阅读次数:
223
                             
                         
                    
                        
                            
                            
                                在javascript中按位取反再取反可以将一个浮点数的转化为整形,而且其效率要比parseInt高出将近一倍
var start = new Date().getTime();
	for (var i = 0; i < 10000000; i++) {
		var a = Math.random() * 5;
		~~a;
	}
	console.info(new Date().getTime...
                            
                            
                                分类:
编程语言   时间:
2014-08-26 00:35:45   
                                阅读次数:
221
                             
                         
                    
                        
                            
                            
                                例1:彩票生成器 36选7.方法一:int[] a = new int[7]; Random ran = new Random(); //生成7个数 for (; a[6] == 0; ) { ...
                            
                            
                                分类:
其他好文   时间:
2014-08-25 01:06:43   
                                阅读次数:
185
                             
                         
                    
                        
                            
                            
                                最近忙着新项目的框架搭建,实在是太忙了···boost有很多随机引擎就不一一介绍了,一般常用mt19937内存效率质量折中,rand48算法效率最高内存占用小质量一般 1 #pragma once 2 #include 3 #include 4 #include 5 6 template 7...
                            
                            
                                分类:
其他好文   时间:
2014-08-25 01:03:53   
                                阅读次数:
400
                             
                         
                    
                        
                            
                            
                                +(UIImage *)imageDrawCircleWithImage:(UIImage *)originImage{ CGFloat padding = 5 ; // 圆形图像距离图像的边距 UIColor * epsBackColor = [ UIColor gre...
                            
                            
                                分类:
移动开发   时间:
2014-08-23 19:00:11   
                                阅读次数:
244
                             
                         
                    
                        
                            
                            
                                //36选7生成彩票 不许产生重号 /* Random b = new Random(); int[] a = new int[7]; for (int i = 0; i { int t = a[m - 1]; a[m - 1] = a[m]; a[m] = t; } } } for(int i.....
                            
                            
                                分类:
其他好文   时间:
2014-08-23 16:48:01   
                                阅读次数:
299
                             
                         
                    
                        
                            
                            
                                LeetCode: Copy List with Random PointerA linked list is given such that each node contains an additional random pointer which could point to any node ...
                            
                            
                                分类:
其他好文   时间:
2014-08-23 12:34:30   
                                阅读次数:
193
                             
                         
                    
                        
                            
                            
                                //先创建一个霓虹灯视图
    NSArray *arr = [NSArray arrayWithObjects:[UIColor purpleColor],[UIColor cyanColor],[UIColor blueColor],[UIColor greenColor],[UIColor yellowColor],[UIColor orangeColor],[UIColor redCol...
                            
                            
                                分类:
其他好文   时间:
2014-08-23 11:25:30   
                                阅读次数:
179
                             
                         
                    
                        
                            
                            
                                一.点击textField没有响应
    (1)textField上面还有视图(如下)
    UITextField *tf = [[UITextField alloc] initWithFrame:CGRectMake(50, 100, 220, 40)];
    tf.backgroundColor = [UIColor yellowColor];
    tf.borderSt...
                            
                            
                                分类:
其他好文   时间:
2014-08-23 08:50:00   
                                阅读次数:
149
                             
                         
                    
                        
                            
                            
                                - (void)drawLine{
    
    //view是曲线的背景view
    UIView *view = [[UIView alloc]initWithFrame:CGRectMake(10, 0, 300, 300)];
    view.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:vie...
                            
                            
                                分类:
移动开发   时间:
2014-08-22 16:29:09   
                                阅读次数:
247