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
1、技术解决方案--------->(widget/event/ajax)->function->data------>XMLHttpRequest----->Server1、业务流程------------》通过技术的解决方案来实现。不管是什么业务流程,技术都是可以实现的。
分类:
其他好文 时间:
2014-05-08 21:48:39
阅读次数:
284
Load var data = []; var viewModel = { vendors:
ko.observableArray(data)};ko.applyBindings(viewModel);$(function () { // on this
click event, ...
分类:
其他好文 时间:
2014-05-08 21:03:59
阅读次数:
282
类别.h@interface
NSString(XXXXXX)-(NSInteger)getLen;@end.m@implementation
NSString(XXXXXX) -(NSInteger)getLen{ return
0;}@end//////////////////////////....
分类:
移动开发 时间:
2014-05-08 20:20:28
阅读次数:
365
登陆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
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
通常实现INotifyPropertyChanged接口很简单,为你的类只实现一个PropertyChanged
的Event就可以了。例如实现一个简单的ViewModel1类: public class ViewModel1 :
INotifyPropertyChanged { ...
分类:
其他好文 时间:
2014-05-06 14:12:55
阅读次数:
443