06 2010 档案

应用中的单例模式
摘要: public class SingletonProvider<T> where T : new() { SingletonProvider() { } public static T Instance { get { return SingletonCreator.instance; } } class SingletonCreator { static SingletonCreato...阅读全文

posted @ 2010-06-26 17:27 o0myself0o 阅读(90) | 评论 (0) 编辑

面试题:给你三个bool类型变量a, b, c,判断至少有两个为true
摘要: 1.   return (a&&b) || (b&&c) || (a&&c);2.   int count = 0;  if(a) count++;  if(b) count++;  if(c) count++;  return count >= 2;3. 卡诺图  return a?(b||c):(b&&c);4.  retu...阅读全文

posted @ 2010-06-25 11:44 o0myself0o 阅读(136) | 评论 (0) 编辑

javascript面向对象编程(一)
摘要: <script type="text/javascript"> var test = { numA: 10, objB: {}, arrC: [], init: function(){ alert(this.numA); }, sayHi: function(name){ alert("hello " + name); }, sayHelloWorld: function(){ th...阅读全文

posted @ 2010-06-24 20:18 o0myself0o 阅读(82) | 评论 (8) 编辑

wtf js(一)
摘要: var Z = "constructor";Z[Z][Z]("alert('wtf js!')")();// alert wtfjs!点解?发生什么了?Z[Z]// function String(){[native code]}Z[Z][Z]// function Function(){[native code]}解释: Z[Z]-->string["constructor"]-->...阅读全文

posted @ 2010-06-24 12:27 o0myself0o 阅读(61) | 评论 (0) 编辑

导航

公告

统计