1. 函数可以返回多个值 return a, b, c; 但是如果函数不是作为表达式的最后一个元素的话,仅返回第一个
如:
function f2() return "a", "b" end;
x, y = f2() -> x = "a", y = "b";
x, y = f2(), 1 -> x = "a", y = nil;
2. 可以将一个函数调用放入一对圆括...
分类:
其他好文 时间:
2014-05-10 09:21:56
阅读次数:
317
一个简单的迭代器示例
--迭代工厂函数
function value(t)
local i = 0;
return
function()
i = i+1;
return t[i];
end;
end;
t = {10,20,30};
iter = va...
分类:
其他好文 时间:
2014-05-10 08:36:53
阅读次数:
268
登陆mysql
harvey@harvey-Virtual-Machine:~/ruby/mydiary$ mysql -u root -pEnter password:
Welcome to the MySQL monitor. Commands end with ; or \g. 查看所有的数据...
分类:
数据库 时间:
2014-05-07 20:06:47
阅读次数:
452
#import "RootViewController.h"@interface
RootViewController ()@end@implementation RootViewController{ UILabel
*txtInteger; UILabel *txtFloat; ...
分类:
其他好文 时间:
2014-05-07 19:59:59
阅读次数:
461
xtrabackup
binary最重要的两个过程是backup和prepare,对应的函数分别是xtrabackup_backup_func()和xtrabackup_prepare_func(),这里做一些阅读代码时的笔记。xtrabackup
backup的线程模型:1. 一个log拷贝线程;...
分类:
其他好文 时间:
2014-05-07 19:20:21
阅读次数:
505
备份站点Backup-SPSite -Identity -Path [-Force]
[-NoSiteLock] [-UseSqlSnapshot] [-Verbose] 那么就按照上面的代码敲吧(注意要有管理员的身份)命令是:
backup-spsite -identity http://po.....
分类:
其他好文 时间:
2014-05-07 10:24:21
阅读次数:
473
Given a binary tree, find the maximum path
sum.The path may start and end at any node in the tree.For example:Given the
below binary tree, 1 ...
分类:
其他好文 时间:
2014-05-07 09:36:09
阅读次数:
300
import org.junit.Test;
public class AllSort {
public void permutation(char[] buf, int start, int end) {
if (start == end) {// 当只要求对数组中一个字母进行全排列时,只要就按该数组输出即可
for (int i = 0; i <= end; i++) {
...
分类:
编程语言 时间:
2014-05-07 08:26:47
阅读次数:
364
The Ball And Cups
At the end of a busy day, The Chef and his assistants play a game together. The game is not just for fun but also used to decide who will have to clean the kitchen. The Chef...
分类:
其他好文 时间:
2014-05-07 07:41:32
阅读次数:
448
今天一个女生咨询我报名学优化。聊着聊着就让我优化一个sql,贴给大家看一下
select (case
when grouping(allwo.workshop_code) = 1 then
''
else
nvl(max(allwo.workshop_code), '未维护车间')
end) worksho...
分类:
其他好文 时间:
2014-05-07 06:45:47
阅读次数:
398