class BubbleSorter { static public void Sort(IList sortArray, Func comparison) { bool swapped = true; do ...
分类:
其他好文 时间:
2014-07-10 12:34:06
阅读次数:
159
1 public IQueryable LoadPageuserInfos(int pageSize, int pageIndex, out int total, 2 Func wherelambda, Func orderbyLambda, bool isasc) 3 ...
分类:
其他好文 时间:
2014-07-07 14:13:08
阅读次数:
188
由于项目要在旧的服务器上面运行,而旧的服务器底层用了Prototype,所以需要解决jQuery和Prototype冲突的问题。一.$符号冲突问题这个还是很好解决的。jQuery.noConflict()而如果不想将原来所有$符号换成jQuery,可以用即时函数包住原来的jQuery代码:(func...
分类:
Web程序 时间:
2014-07-03 11:38:05
阅读次数:
204
Swift 中的方法是与特定类型(类和结构体)相关的函 数。实例方法 隶属于某个特定类型(类或结构体)实例函数。 class Counter{var count = 0funcincrement() {count++}funcincrementBy(amount: Int) {count += amount}func reset() {count = 0}}let counter = Counte...
分类:
其他好文 时间:
2014-06-30 20:22:51
阅读次数:
301
Functions and Closures 函数和封闭性(闭包)Functions 函数的使用Swift中的函数定义和OC中有明显的差别了,使用func定义函数,在括号里定义參数和类型,用 -> 定义返回值类型func greet(name: String, day: String) -> Str...
分类:
其他好文 时间:
2014-06-29 19:26:28
阅读次数:
209
# define DEF(func, kind, rettype, args...) rettype tern_ ## func (unsigned insid, ##args);
上面的rettype是宏参数,在实际使用DEF宏时,在rettype位置要有一个参数,然后在宏内容里rettype位置就会被替换为你提供的参数;##用于连接前后两个参数,把它们变成一个字符串。
DEF(...
分类:
其他好文 时间:
2014-06-28 07:15:10
阅读次数:
1352
1、通过Object对象实例化,然后在外部添加属性/方法(原始模式)var obj = new Object();obj.v = '';obj.func = function(){ //... }2、通过构造函数实例化,然后在外部通过prototype添加属性,或者在构造函数里面直接定义属...
分类:
编程语言 时间:
2014-06-27 14:40:02
阅读次数:
198
以string为例package mainimport "fmt"func main() { var a interface{} var b string a = "asdasdasdasd" b = a.(string) fmt.Println(a, b)}
分类:
其他好文 时间:
2014-06-26 17:29:36
阅读次数:
202
以前我们为了能够调用一个方法,必须比照这个方法定义一个相应的delegate.
原先我们定义delegate
//
委托声明 --
定义一个签名:
delegate doubleMathAction(double num);
class DelegateTest
{
//
符合委托声明的常规方法
static double Double(double i...
分类:
其他好文 时间:
2014-06-26 13:49:06
阅读次数:
164
写这篇原创文章是因为看到了极客中的一篇文章《有趣各种编程语言实现2+2=5》,其中C语言是这样实现的:
int main() {
char __func_version__[] = “5″; // For source control
char b[]=”2″, a=2;
printf(“%d + %s = %s\n”, a, b, a+b);
return 0;
}
有些童鞋可能会说...
分类:
编程语言 时间:
2014-06-26 11:03:19
阅读次数:
282