- 博客(125)
- 资源 (2)
- 收藏
- 关注
原创 IOS手势识别,捏合,旋转,轻扫等
//点按手势的创建,这里需要实现响应事件的方法UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap)];tap.delegate = self;// 添加到需要手势的视图[_imageView addGestureReco
2016-06-27 17:43:08
1163
原创 NSURLSession的初步理解
自身是对NSURLConnection的进一步封装,相对于来说使用更简单,而且他自身是一个单例;他有三个子类:NSURLSessionDownloadTask,NSURLSessionDataTask,NSURLSessionUploadTask;分别对应下载,获取简单数据、上传任务;Get请求的创建:方法一://1.创建NSURLSessionNSURLSess
2016-06-02 10:10:37
505
原创 IOS杂记
1、内存分为五个区域:栈区:储存局部变量;; 堆区:程序运行时动态开辟的空间; BSS段:没有初始化的全局变量、静态变量; 数据区:初始化的全局变量、静态变量。字符串常量;
2016-05-03 20:05:04
477
原创 IOS-UI设置字体属性
Swift版本:let str:String = "wenzi"; let text = "\(str) button pressed" //运用\符号可以拼接字符创;// 创建一个属性字符创,并且初始化; let styleText = NSMutableAttributedString (string : text);//
2016-04-17 15:48:16
461
原创 IOS-UI学习笔记(超级猜图)
1、iPhone6的屏幕大小375 * 667(4.7英寸)2、让图片不能点击:(1)Highlight Adjust Image; (2)User Interaction Enable; (3)在content中不要勾选Enable接着设置Dis
2016-04-14 14:11:27
581
原创 IOS-UI学习笔记(九宫格应用管理)
封装:为了避免代码的重复使用,提高性能;需求变动的时候,扩展性很强。需要更改的地方不多。1、Xib的加载(Xib这样使用的时候是一个资源文件,所以不要传路径,直接写的文件名字,九宫格就可以用Xib): 返回值是一个数组类型,可以使用UIView接收; [NSBundle mainBundle] loadNibNamed:@“appView” over:nil
2016-04-13 17:19:17
531
原创 IOS9.0中Alert的创建
在IOS9.0中,摒弃了IOS中的UIAlertView控件。所以以往的方法不能使用;下面是在IOS9.0中创建Alert控件的Source Code:UIAlertController *alt = [UIAlertController alertControllerWithTitle:@"提示"
2016-03-31 20:11:28
474
原创 ZOJ-3162-To Go or Not to Go
点击打开题目链接# include # include # include using namespace std;double dp[30][2];void init(){ memset(dp,0,sizeof(dp)); for(int i = 1;i < 30;i++){ dp[i][1] = dp[i-1][1] + dp[i-1
2015-11-13 20:27:10
561
原创 ZOJ-3897-Fiddlesticks
题目链接# include # include using namespace std;int e[1100];int main(){ int t; scanf("%d",&t); while(t--){ int n,c,x = 0,ans; scanf("%d%d",&n,&c); for(
2015-11-05 21:37:51
468
原创 简单的图论题-湖南省第十一届 省赛
点击打开题目链接 # include # include # include # include # include using namespace std;#define INF 0x3f3f3f3fint mmp[510][510],vis[510][510],use[510][510][4],d[4][2]={0,1,0,-1,-1,0,1,0};int
2015-09-27 23:24:16
712
原创 山东省赛-博弈-Game
点击打开题目链接 很明显的一道博弈题目,但是在求SG的时候,子状态写错了,一直都没有AC。最后还是水过去的额;比赛后还是自己写了一遍;# include # include # include using namespace std;int sg[1200];int get(int x){ if(x < 0) return 0; if(s
2015-08-13 09:48:51
678
原创 POJ-3537-Crosses and Crosses
点击打开题目链接 # include # include # include # include using namespace std;int sg[2100];inline int dfs(int x){ if(x < 0) return 0; if(sg[x] >= 0) return sg[x]; int mex[2100]
2015-08-11 08:59:30
717
原创 HUNNU-10307-最优分解问题
点击打开题目连接# include # include # include # include # include using namespace std;int v[4] = {1,10,100,1000},a[100000];struct BigNumber{ int d[1000]; BigNumber() { memset(d,0,si
2015-08-10 17:57:56
928
原创 HDU-1285-拓扑排序-确定比赛名次
点击打开题目链接# include # include # include # include # include # include using namespace std;const int maxn = 500 + 5;vector g[maxn];int n,m,du[maxn],l[maxn];void topsort(){ int tot
2015-08-07 09:33:22
698
原创 滑雪
DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 5 16 17 18 19 6 15 24 25 20 7 14
2015-08-03 20:29:43
525
原创 Wumpus ZOJ月赛-3890
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5560//一道广搜题,扩展时有三个状态左转、右转、前进;//收取宝藏可以在前进的时候判断;状态的标记可以用//一个四维数组标记即:坐标,方向,宝藏是否全部拾取;# include # include # include # include using
2015-07-29 09:34:19
782
原创 Fun House
DescriptionAmerican Carnival Makers Inc. (ACM) has a long history of designing rides and attractions. One of their more popular attractions is a fun house that includes a room of mirrors. Their
2015-07-28 16:40:03
706
原创 Mountain Number
DescriptionOne integer number x is called "Mountain Number" if:(1) x>0 and x is an integer;(2) Assume x=a[0]a[1]...a[len-2]a[len-1](0≤a[i]≤9, a[0] is positive). Any a[2i+1] is larger or equal
2015-03-10 20:32:31
709
原创 Play on Words
Some of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solveit to open that doors. Because there is no other way to open the doors, the puzzle is very imp
2015-03-09 21:08:07
518
原创 GCD Reduce
DescriptionYou are given a sequence {A1, A2, ..., AN}. You task is to change all the element of the sequence to 1 with the following operations (you may need to apply it multiple times):choose
2015-02-08 10:55:23
838
原创 敌兵布阵
Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视
2014-12-30 20:10:36
684
原创 Bomb
DescriptionThe counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to N. If the current numb
2014-12-25 23:17:27
540
原创 Ping pong
DescriptionN(3N20000) ping pong players live along a west-east street(consider the street as a line segment). Each player has a unique skill rank. To improve their skill rank, they often c
2014-12-23 20:49:38
822
原创 基因
Problem Description作为一个基因工程师,Enigma遇到了一个关于基因重组的难题。总所周知,基因可以被看出一个核苷酸序列,这个序列可以简单地用四个字母A,C,G和T表示。Enigma得到了一个基因“ATCC”,他想把它重组为一个新的基因“CTCA”。他可以任意使用下列两种方法:(1) 交换基因的前两个字符; (2) 将第一个字符移到最后。例如:“ATCC”经过方法2重
2014-12-18 21:02:10
907
原创 Ordering Tasks
DescriptionJohn has n tasks to do. Unfortunately, the tasks are not independent and the execution of one task is only possible if other tasks have already been executed.InputThe input wi
2014-12-17 19:25:42
728
原创 Star
DescriptionOverpower often go to the playground with classmates. They play and chat on the playground. One day, there are a lot of stars in the sky. Suddenly, one of Overpower’s classmates ask him:
2014-12-16 19:52:34
827
原创 Solve equation
DescriptionYou are given two positive integers A and B in Base C. For the equation:A=k*B+d We know there always existing many non-negative pairs (k, d) that satisfy the equation above. Now
2014-12-16 19:46:07
667
原创 Audiophobia
Description:Consider yourself lucky! Consider yourself lucky to be still breathing and having fun participating in this contest. But we apprehend that many of your descendants may not have this lu
2014-12-16 19:37:58
705
原创 Calling Circles
Description:If you've seen television commercials for long-distance phone companies lately, you've noticed that many companies have been spending a lot of money trying to convince people that th
2014-12-12 21:11:12
762
原创 Amphiphilic Carbon Molecules
Description:Shanghai Hypercomputers, the world's largest computer chip manufacturer, has invented a new class of nanoparticles called Amphiphilic Carbon Molecules (ACMs). ACMs are semiconductors
2014-12-12 20:31:29
1035
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人