变量声明1、普通变量swift 像javascript一样是可以智能推断类型的,他会根据我们变量的值来推断变量的类型
var age = 10 // Int
var name ="lily" //编译器会自动推断出String
static let name = "MyClass" //静态常量 通过类名直接访问 eg: ClassName.nam...
分类:
编程语言 时间:
2015-08-19 00:36:52
阅读次数:
140
链接:http://acm.hdu.edu.cn/showproblem.php?pid=1004
Let the Balloon Rise
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 89920 Accepted S...
分类:
其他好文 时间:
2015-08-18 12:09:51
阅读次数:
138
中问题 题意略和HDOJ 3062 一样这里 每个队员都有 选 和 不选 两种, 即 上篇所说的$x$和$x’$建图:队长(a)留下或者其余两名队员(b、c)同时留下 那么就是$a'\Rightarrow b$ 、 $a'\Rightarrow c$ (队长不在 b必须在, 队长不在 c必须在...
分类:
其他好文 时间:
2015-08-17 23:25:55
阅读次数:
194
Sumdiv
Time Limit: 1000MS
Memory Limit: 30000K
Total Submissions: 16109
Accepted: 3992
Description
Consider two natural numbers A and B. Let S be the sum of all natural...
分类:
其他好文 时间:
2015-08-17 21:51:39
阅读次数:
160
5.14 Match
经常,一个简单的if/else还不够,因为你可能会有多于两种情况.而且,条件会变得更加复杂.Rust有一个关键字,match,允许你替代复杂的if/else组合,来实现一些更强大的功能.看一下:
let x = 5;
match x {
1 => println!("one"),
2 => println!("two"),
...
分类:
其他好文 时间:
2015-08-17 19:41:46
阅读次数:
163
1. Creating a project
From the command line, cd into a directory where you’d like to store your code, then
run the following command:
$ django-admin startproject mysite
Let’s look at...
分类:
移动开发 时间:
2015-08-17 01:07:11
阅读次数:
193
Description
Let x and y be two strings over some finite alphabet A. We would like to transform
x into y allowing only operations given below:
Deletion: a letter in x is missing in y at a co...
分类:
其他好文 时间:
2015-08-16 21:32:50
阅读次数:
102
能耗对电池供电的产品来说是一个重大问题,一旦电能耗尽设备将“罢工”。在《MCU低功耗设计(一)理论》中,我们介绍了节能的原理;在《MCU低功耗设计(二)实践》中,实测了STM8L151C8的低功耗值。
本文介绍无线通信产品的低功耗设计,首先实测MCU与射频芯片I/O设置的功耗,然后测试射频芯片不同模式下功耗,其次使用Contiki系统的energest模块实时跟踪能耗值,最后总结低功耗设计和展望无线组网中低功耗特征。Let’s go!...
分类:
其他好文 时间:
2015-08-16 12:28:15
阅读次数:
422
Swift中属性的用法比objective-c中属性的用法丰富了很多。下面我逐一介绍。
一、 存储属性 和 延迟存储属性
Demo如下:
class Dog {
var name = "旺财"
init(){
println("狗被初始化了")
}
}
class Person {
let age = 20
var name = "J...
分类:
编程语言 时间:
2015-08-16 12:23:07
阅读次数:
113
anyway, you can do this with auto layout. You can do it entirely in IB as of Xcode 5.1. Let's start with some views:The light green view has an aspect...
分类:
移动开发 时间:
2015-08-16 10:33:34
阅读次数:
342