下面这些代码可以在playground中展现出来
import UIKit
/* 实例化一个 UIView
的对象,保存在堆中
[[UIView alloc] initWithXXX:xxx] 所有 OC中以这种格式的实例化方法,在 swift
中都可以使用
类(XXX:)*/
let view =
UIView(frame: CGRe...
分类:
编程语言 时间:
2015-05-10 09:53:02
阅读次数:
153
1.常量&变量
使用var关键字定义变量,可以修改
使用let关键字定义常量,不可修改
提示:在Swift开发中,通常先定义常量let,只有必须要修改的时候,才定义成var,这样会更安全。
2.类型转换
Swift是一个对类型要求及其严格的语言,任何数据类型之间,都不能隐式转换。如果要在不同的类型之间进行计算,必须转换格式
解决方案一...
分类:
编程语言 时间:
2015-05-10 09:48:01
阅读次数:
207
1、archive 归档 数据的保存 1: let result = NSKeyedArchiver.archiveRootObject(contacts, toFile: path as String) 2: println("保存结果\(result)") 数据的读取: 1:...
分类:
移动开发 时间:
2015-05-10 08:29:49
阅读次数:
132
SOJ1678, Mountains,数论,递推,二分
A mountain consists of one or more hills, each of which consists of upwards, which we denote with `/', and downwards, which we denote with '\'. We call upwards and downwards together as wards. Let /n be an upward of length n, an...
分类:
其他好文 时间:
2015-05-09 10:19:14
阅读次数:
194
SOJ1678, Mountains,数论,递推,二分
A mountain consists of one or more hills, each of which consists of upwards, which we denote with `/', and downwards, which we denote with '\'. We call upwards and downwards together as wards. Let /n be an upward of length n, an...
分类:
其他好文 时间:
2015-05-09 10:18:56
阅读次数:
189
先看看题目这题让我崩溃了两小时,提交了10次才对,说明能力太渣了,得加油,加油!本题我的迷糊点:1、题目的输出是一次实例一个输出,我刚开始将他一起输出,提交了好多次,后来运行了网上的结果,才知道,题目理解错了。本题题目是:先输入一个n,紧接着n输入n个颜色,然后将输出颜色最多的那种颜色,注意如果有颜...
分类:
其他好文 时间:
2015-05-08 21:55:43
阅读次数:
138
本文章由cartzhang编写,转载请注明出处。 所有权利保留。
文章链接:
作者:cartzhang
最近用UE4搭建的一个kinect 骨骼映射的avatar。
视频链接: Kinect骨骼映射——让我为你跳支舞
视频地址:http://v.youku.com/v_show/id_XOTQ0OTYwNDg4.html?from=y1.4-2...
分类:
其他好文 时间:
2015-05-08 20:25:12
阅读次数:
288
Description
Let N be the set of all natural numbers {0 , 1 , 2 , … }, and R be the set of all real numbers. wi, hi for i = 1 … n are some elements in N, and w0 = 0.
Define set B = { | x, y ∈...
分类:
其他好文 时间:
2015-05-07 22:09:58
阅读次数:
139
转自:http://blog.163.com/xychenbaihu@yeah/blog/static/132229655201131055455754/数值运算:在bash中只提供了整数运算,一般shell通过let和expr这两个指令来实现。使用格式为: let "x=$x+1" 或者 x=`e...
分类:
系统相关 时间:
2015-05-07 16:23:15
阅读次数:
152
1 import sys 2 3 4 def count_holes(letter): 5 hole_2 = ['A', 'D', 'O', 'P', 'Q', 'R'] 6 if letter == 'B': 7 return 2 8 elif let...
分类:
其他好文 时间:
2015-05-05 18:32:35
阅读次数:
125