变量及常量: 如果要定义一个变量等于1,只需要写 var = 1,Swift会自动做出类型推断。 如果要定义一个常量PI等于3.14,只需要写let PI = 3.14,常量只能被赋值一次。输出语句: 可以直接使用printf函数来输出一段任意类型的信息:prinft("Hello Swift...
分类:
编程语言 时间:
2015-07-03 01:39:38
阅读次数:
397
/*********************************************** Swift 数组
***********************************************///在swift中,Array也没有可变和不可变类型之分,而且取决于用什么关键字来修饰,var就是可变,let就是不可变 在swift中,使用字面量来给一个...
分类:
编程语言 时间:
2015-07-02 22:43:28
阅读次数:
164
#!/bin/bash
#斐波那契数列
#不要用递归,深度大于30就老火了。
function fun_test()
{
if [ $1 -lt 3 ];then
echo 1
return
fi
sum1=1
sum2=1
let count=$1-2
sum=0
while [ $count -gt 0 ];...
分类:
系统相关 时间:
2015-07-02 22:37:24
阅读次数:
238
因为只是笔记,所以只记录自己觉得要注意与需要理解的地方,其他就不记了函数定义上F#有自己的写法:[]let main argv = let f1 = fun x -> x * x - 2 * x let f2 x = let x1 = x - 2 x * ...
分类:
其他好文 时间:
2015-07-02 22:29:14
阅读次数:
645
Page 54
另一个奇怪的问题是:我们使用了_left和_right来命名.下划线是怎么回事?我们并没有计划在加锁时使用这两个变量.我们仅仅只想要得到它.因此,Rust会警告我们并没有使用这些值.通过使用下划线,我们告诉Rust这就是我们想要的,它就不会抛出警告了.
如何释放锁呢?_left和_right离开自己的作用域之后就会自动释放.
let table = Arc::...
分类:
其他好文 时间:
2015-07-02 14:10:39
阅读次数:
129
//: Playground - noun: a place where people can play
import UIKit
//使用 if
和 switch 作为条件控制。使用 for-in
、 for
、 while 、 do-while
作为循环。小括号不是必须的,但主
体的大括号是必需的。
let individualS...
分类:
编程语言 时间:
2015-07-01 18:32:58
阅读次数:
139
//内购Demo,看代码说话吧class IAPTestViewController: UIViewController ,SKProductsRequestDelegate, SKPaymentTransactionObserver{ let VERIFY_RECEIPT_URL = "ht...
分类:
移动开发 时间:
2015-07-01 17:29:20
阅读次数:
279
首先我们可以去使用Playground来编码,并且会实时的显示对应的编码信息,这样我们就不用每次都去运行程序来显示输出的东西了哦,也方便了我们对某些语句的验证,这个是比较赞的var与let前者为可变修饰符,后者为不可变从字面意思我们就可以很好的区分了
letname="KuTian"
varan..
分类:
编程语言 时间:
2015-06-30 18:39:49
阅读次数:
116
Magento default installation already has a predefined custom 404 page (no-route). But is it enough to help visitor/customer get back on right track!?. Let’s look over a few examples of custom designed...
分类:
其他好文 时间:
2015-06-30 16:24:58
阅读次数:
197
1.定义Define an interface for creating an object,but let subclasses decide which class to instantiate.Factory method let a class defer instantiation to ...
分类:
其他好文 时间:
2015-06-30 01:23:32
阅读次数:
222