原创文章,欢迎转载。转载请注明:关东升的博客 可选类型:我们先看看如下代码:var n1: Int = 10
n1 = nil //编译错误
let str: String = nil //编译错误
Int和String类型不能接受nil的,但程序运行过程中有时被复制给nil是在所难免的,Swift为每一种数据类型提供一种可选类型(optional),即在某个数据...
分类:
编程语言 时间:
2015-10-26 12:17:27
阅读次数:
214
原创文章,欢迎转载。转载请注明:关东升的博客可选类型:我们先看看如下代码:var n1: Int = 10n1 = nil //编译错误 let str: String = nil //编译错误Int和String类型不能接受nil的,但程序运行过程中有时被复制给nil是在所难...
分类:
编程语言 时间:
2015-10-26 11:59:02
阅读次数:
208
概述:追踪 VDSM 启动后的代码大概流程,是继 vdsm/vdsm 文件学习后的继续。Let's go!从 “def serve_clients(log)” 开始 1 def serve_clients(log): 2 cif = None 3 irs = None 4 s...
分类:
其他好文 时间:
2015-10-26 00:19:01
阅读次数:
398
1 import Foundation 2 3 for var i=1; i<=10; i++ { 4 println(i) 5 } 6 7 let str1="adl;fjasdfl;ouewrouqwperuadf" 8 for c in str1 { 9 swit...
分类:
编程语言 时间:
2015-10-25 16:24:08
阅读次数:
238
swift变量的定义 1 import Foundation 2 3 /* 4 变量的定义 5 变量的类型是可以不用写的 6 var a=10 7 常量的定义 let修饰 8 */ 9 10 var a=1011 print(a)12 let b=1113 prin...
分类:
编程语言 时间:
2015-10-25 16:23:01
阅读次数:
136
DescriptionSeveral currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and perfo...
分类:
其他好文 时间:
2015-10-23 16:20:09
阅读次数:
225
终于开始写技术博了. 虽然没几两干货但是还是会把自己每天学到的东西记录在这里的.开篇就用最经典的 Hello World 程序和 C 语言吧.1 #include 2 3 int main()4 {5 printf("Hello World.\n");6 return 0;7 }Let's ...
分类:
其他好文 时间:
2015-10-23 16:08:06
阅读次数:
124
2-SAT,根据题意建好图,求一下强联通分量,判断一下就可以了#include#include#include#include#include#includeusing namespace std;const int maxn=6005;int T,M;vectorG[maxn];vectorFG[...
分类:
其他好文 时间:
2015-10-23 14:48:20
阅读次数:
157
元数据是数据与一个特定的模式或类型,而不是一个纪录。 ?????? 一个很常见的例子是分页。通常会像下面的代码设置分页: let?result?=?this.store.query(‘post’,?{
??limit:?10,
??offset:?0
}...
分类:
Web程序 时间:
2015-10-22 01:41:21
阅读次数:
208
// 手机号验证正则表达式 1 func validateMobile(phoneNum:String)-> Bool { 2 3 // 手机号以 13 14 15 18 开头 八个 \d 数字字符 4 5 let phoneRegex = "^((13[0-9])|(17[...
分类:
移动开发 时间:
2015-10-21 21:03:57
阅读次数:
229