1. 交换两个数值
x, y = y, x; //等价于 x = y, y =x;
2. 变量初始化问题
a, b, c = 0;
print(a,b,c); --> 0 nil nil
仅对第一个值复制,所以要初始化一组变量,应该提供多个初始值
a, b, c = 0, 0, 0;
print(a, b, c); --> 0 0 0
3. "尽可能...
分类:
其他好文 时间:
2014-05-10 10:17:39
阅读次数:
272
1、函数是一种 “第一类值”
a = {p = print};
a.p("hello");
a = print;
a("Hi");
2、 table 提供的函数 table.sort
network = {
{name = "lua", IP = "192.168.1.1"},
{name = "CPP", IP = "192.168.1.2"}
};
f...
分类:
其他好文 时间:
2014-05-10 09:21:02
阅读次数:
273
SPSecurity.RunWithElevatedPrivileges(delegate() {
using (SPSite oSite = new SPSite(siteUrl)) { ...
分类:
其他好文 时间:
2014-05-08 20:36:52
阅读次数:
454
XCode 内置GDB,我们可以在命令行中使用 GDB
命令来调试我们的程序。下面将介绍一些常用的命令以及调试技巧。po 命令:为 print object 的缩写,显示对象的文本描述(显示从对象的
description 消息获得的字符串信息)。比如:上图中,我使用 po 命令显示一个 NSDic...
分类:
其他好文 时间:
2014-05-08 20:08:55
阅读次数:
368
原创不易,转载请注明出处:java随机动态生成汉字验证码图片的实例代码分享
代码下载地址:http://www.zuidaima.com/share/1809721113234432.htm
汉字验证码实现原理
将汉字和干扰线生成图片并将汉字保存到session,前台获取每次生成验证码图片并用文本框值和session值比较,功能相对来说还是比较简单的。
效果图,如下:
...
分类:
编程语言 时间:
2014-05-07 07:31:47
阅读次数:
358
import org.junit.Test;
public class Multiple {
public void printMultiple99() {
int i = 1;
for (; i < 10; i++)
for (int j = 1; j <= i; j++)
System.out.print(j + "*" + i + "=" + i * j + " ...
分类:
其他好文 时间:
2014-05-07 06:46:25
阅读次数:
359
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the code, print the sequence of gr...
分类:
其他好文 时间:
2014-05-07 06:10:17
阅读次数:
370
简单谈谈 Python 中容器的遍历和一下小技巧。
1、遍历单个容器
下面代码遍历一个 List 结构,同样适用于 Tuple、Set 结构类型
>>> x = [1, 2, 3, 'p' , 'y']
>>> for v in x:
... print(x)
...
1
2
3
p
y
遍历字典 Dict 结构也是...
分类:
编程语言 时间:
2014-05-07 04:12:39
阅读次数:
395
spring框架中多数据源创建加载并且实现动态切换的配置实例代码,代码下载地址:http://www.zuidaima.com/share/1774074130205696.htm...
分类:
编程语言 时间:
2014-05-07 03:18:33
阅读次数:
442
1.ubuntu14.04安装依赖sudo apt-get install
build-essential gawk m4 libasound2-dev libcups2-dev libxrender-dev xorg-dev
xutils-dev x11proto-print-dev binuti...
分类:
其他好文 时间:
2014-05-06 14:19:33
阅读次数:
343