// 数组的用法let empetyArray = [] // 空数组let stringArray = [String]() // 字符串数组,限定其值为字符串let intArray = [Int]() // 整型数组,限定其值为整型var shoppingList = ["苹果","香蕉...
分类:
编程语言 时间:
2015-12-22 23:05:59
阅读次数:
474
重定向 shell编辑文本 图形化工具编辑文件 1、重定向 标准输入 标准输出 错误输出 [root@sky kkk]# cat aaa.sh #!/bin/bash a=1 while [ $a -le 5 ] do useradd user$a let a++ done [root@sky kk...
分类:
系统相关 时间:
2015-12-22 16:16:39
阅读次数:
334
1、使用 typeof bar === "object" 判断 bar 是不是一个对象有神马潜在的弊端?如何避免这种弊端?使用 typeof 的弊端是显而易见的(这种弊端同使用 instanceof):let obj = {};
let arr = [];console.log(typeof obj === 'object'); //true
console.log(typeof arr ===...
分类:
编程语言 时间:
2015-12-22 10:28:36
阅读次数:
395
public ActionResult Index() { string title = "Let Me Try"; string show = Request.Cookies["GetValue"] == null ? "" : Reque...
分类:
其他好文 时间:
2015-12-22 10:22:42
阅读次数:
387
Swift可以使用几乎任何字符作为常量和变量名,包括Unicode,但是不能包含数字符号、箭头、无效的Unicode、横线-、制表符、且不能以数字开头。var π = 3.14var 新空气软件 = "开发软件"let 你好 = "你好世界"整形的表现形式二进制:前缀0b八进制:前缀0o十六进制:前...
分类:
编程语言 时间:
2015-12-21 23:15:15
阅读次数:
313
import Foundationprint("Hello, World!")let a = 10var b = 20var c = a + b;c = 3000//重载:函数名相同, 函数类型不同(参数, 返回值不同), 构成重载, 调用的时候, 根据参数确定调用那个函数func hellowor...
分类:
编程语言 时间:
2015-12-21 23:12:44
阅读次数:
399
VirtualBox error: Kernel driver not installed (rc=1908)Hi all, Let me first say that this is my final resort after googling this issue for the last se...
分类:
其他好文 时间:
2015-12-21 21:52:45
阅读次数:
473
突然看到别人写的关于Block的帖子,让我突然有一种想写一篇关于闭包的帖子。在我的认知中,Swift中的闭包,就是Object-C中的Block--(或许我的认知太浅了)。先上一个闭包的简单例子 let isInputEven = { (input:Int)->(Bool) in ...
分类:
编程语言 时间:
2015-12-19 16:28:53
阅读次数:
178
//: Playground - noun: a place where people can playimport UIKit// swift中默认情况下, 传入的参数是不可以修改的, 也就是let类型, 也就是常量参数// 如果想修改这个参数的值, 需要在参数前加"var", 也就是变量参数fu...
分类:
编程语言 时间:
2015-12-17 16:01:53
阅读次数:
155
//: Playground - noun: a place where people can playimport UIKitfunc add(a:Int, b:Int) -> Int{ return a + b}// 其中, (Int, Int) -> Int 就是显式的声明函数类型let...
分类:
编程语言 时间:
2015-12-17 15:58:38
阅读次数:
154