摘要: 根据《Node.js开发指南》Node有以下几种调试方式:一、命令行调试二、远程调试三、基于远程调试的IDE调试(Eclipse)四、node-inspector我选取了第四种node-inspector为我的Node调试工具。1】安装node-inspector:$ npm install -g node-inspector (全局安装,因为命令行要用到);2】在终端中调试你的js,例如debug.js$ node --debug-brk=5858 debug.js3】终端中启动node-inspector$ node-inspector4】浏览器中打开(注:仅支持webkit内核浏览器)h 阅读全文
posted @ 2013-11-12 13:25 dearRose 阅读(285) 评论(0) 推荐(0)
摘要: 4.4 参数当函数被调用时,会得到一个参数列表,即arguments数组(并不是真的数组,只有length属性,不含方法)。// Make a function that adds a lot of stuff.// Note that defining the variable sum inside of// the function does not interfere with the sum// defined outside of the function. The function// only sees the inner one.var sum = function ( ) . 阅读全文
posted @ 2013-01-16 20:20 dearRose 阅读(141) 评论(0) 推荐(0)
摘要: 最近在一个java调用oracle存储过程的程序中,经行压力测试老报java.sql.SQLException: Conntion is closed,间歇中冶也有java.sql.SQLException: Conntion is closed。如果对java调用oracle存储过程不太清楚的可以查看http://tiantiankaixin.iteye.com/blog/770250,这里讲的比较清楚了。 就这个错误我查看了网上的各种资料发现了有着两种可能:(1) 1 private static String sql = null; 2 String rtn = nul... 阅读全文
posted @ 2012-10-18 14:58 dearRose 阅读(12474) 评论(0) 推荐(0)
摘要: 1、想要使用反射,首先需要获得待处理类或对象所对应的Class对象。2、获取某个或某个对象所对应的Class对象的常用的3种方式: 1)使用Class类的静态方法forName:Class.forName("java.lang.String"); 2) 使用.Class语法: String.class; 3)使用对象的 getClass()方法: String s ="aa";Class<?> clazz = s.getClass();3、若想通过类的不带参数的构造方法来生成对象,我们有两种方式: 1)先获得class对象,然后通过该clas 阅读全文
posted @ 2012-09-26 15:35 dearRose 阅读(137) 评论(0) 推荐(0)
摘要: Chapter 4. Functions4.1函数对象 对象有连到原型的隐藏连接,函数对象连接到Function.prototype。 函数在创建时带有prototype属性,它的值是一个有constructor属性且constructor的值就是函数值本身的对象。1 var func = function() {};//GC查看func的属性4.2函数字面量var add = function (a, b) { return a + b;};4.3调用 javascript有四种调用函数的方式。调用函数时会传入两个参数this和arguments。4.3.1方法调用模式 当函数... 阅读全文
posted @ 2012-07-25 22:48 dearRose 阅读(143) 评论(0) 推荐(0)
摘要: 3.5原型 一种继承方式3.6反射3.7枚举 遍历对象的属性时可以用 for in 和 for。 使用for in时 使用hasOwnProperty方法排除原型上的属性,使用typeof排除函数。注意属性出现顺序随即。var name;for (name in another_stooge) { if (typeof another_stooge[name] !== 'function') { document.writeln(name + ': ' + another_stooge[name]); }} 使用for遍历字面量可以避免一些问题。3.8删除 .. 阅读全文
posted @ 2012-07-24 22:16 dearRose 阅读(173) 评论(0) 推荐(0)
摘要: Chapter 3. Objects javascript的简单类型:数字,字符串,布尔值,null和undefined。数字,字符串,布尔值拥有方法。 如果当一个声明的变量未初始化,该变量默认值是undefined;当函数没有明确返回值得时候,返回的也是undefined。3.1对象字面量 就是直接对对象赋值,类似:var empty_object = {};var stooge = { "first-name": "Jerome", "last-name": "Howard"}; 对象可以嵌套。var flig 阅读全文
posted @ 2012-07-21 14:12 dearRose 阅读(181) 评论(0) 推荐(0)
摘要: 由于实习项目需要,我开始了学习javascript的慢慢之途。本博客就记录下我学习javascript的脚印吧~ Douglas Crockford的《JavaScript: The Good Parts》是一本讲述javascript经典书籍,我当然得好好拜读下~Chapter 1. Good Parts 比较笼统地讲了javascript的缺点和优点。 就是这个函数注意下,后文中定义新方法都是用这个方法。1 Function.prototype.method = function (name, func) {2 this.prototype[name] = func;3 ... 阅读全文
posted @ 2012-07-21 12:54 dearRose 阅读(232) 评论(2) 推荐(0)