2014年12月19日

node API buffer

摘要: https://cnodejs.org/topic/5189ff4f63e9f8a54207f60c1、拼接字符串时,String比buffer要快,buffer需要toString()。当保存非utf-8字符串,2进制等等其他格式的时候,需要使用buffer。var string3, buffer... 阅读全文
posted @ 2014-12-19 11:44 j.w 阅读(239) 评论(0) 推荐(0)

node API assert

摘要: 1、assert.throws(block, [error], [message]):assert.throws( function(){ throw new Error('wrong'); }, Error);//通过assert.throws( functi... 阅读全文
posted @ 2014-12-19 09:39 j.w 阅读(306) 评论(0) 推荐(0)
2014年12月13日

mongodb 问题

摘要: 启动mongodb时,提示Unclean shutdown detected mongodb,解决方法很简单 mongod --repair --dbpath D:\MongoDB\blog 不用加引号(路径) try to open unclosed connection:mongoose.con 阅读全文
posted @ 2014-12-13 16:02 j.w 阅读(253) 评论(0) 推荐(0)

node 命令行

摘要: 问题起源于,想用node执行命令行的命令。结论如下:两种情况1、node本身的命令(node app.js):使用child_process模块的四个方法2、命令行的命令(包括1,还有java):使用shelljs模块来调用,这样的话,就可以调用exe文件了。https://github.com/a... 阅读全文
posted @ 2014-12-13 15:40 j.w 阅读(435) 评论(0) 推荐(0)
2014年12月9日

onclick传参

摘要: var tema="打开";为了这条语句,费了多少精力。目的:给div html()一个元素,点击这个元素,会showKnowledgeMap(1,"名称")。在网上找的onclick传字符串,外变是“”,里面就是‘’外边是‘’,里边就是“”。其实不用的,都是"都可以。 阅读全文
posted @ 2014-12-09 18:56 j.w 阅读(524) 评论(0) 推荐(0)
2014年12月5日

express4.X 笔记

摘要: express是node的web框架,更新频繁,3.X到4.X有了很大的改变。网上的例子,各种版本的都有,为了以后方便,现在重新认真看一遍4.X的API,统一以后的使用方法。在J2EE上落后了,在express上一定要好学精进。 body-parser(): form中的name=movie[tit 阅读全文
posted @ 2014-12-05 22:48 j.w 阅读(187) 评论(0) 推荐(0)
2014年12月2日

node.js+express+mongodb

摘要: 主要是想用node.js链接mongodb,用的是mongoose。用ejs引擎,扩展到.html比较容易 小例子结构简单,框架清晰。 入口:mongodb.js,数据模型:model.js,(这两个在同一级目录) 路由:index.js 三个页面index.html,add.html,modify 阅读全文
posted @ 2014-12-02 22:02 j.w 阅读(498) 评论(0) 推荐(0)
2014年11月26日

eclipse 安装

摘要: 做一个项目,需要搭建环境。使用sql server 2005,tomcat,eclipse。过程真复杂,碰到些小问题,不过都解决了,还算顺利。win7下sql server 2005安装:http://ideapad.zol.com.cn/54/160_532192.html,这个教程确实很好。最后... 阅读全文
posted @ 2014-11-26 16:17 j.w 阅读(187) 评论(0) 推荐(0)
2014年11月25日

jsPlumb学习笔记

摘要: 这就是一个给元素画连接线的工具。 这是一个简单的小例子。是官网中一个demo的简化版,在学习了网上的教程之后,给官网的例子加了自己的注释。 给元素加连接点,给连接点加连接线,给连接线加各种装饰。需要的样式,canvas和SVG中都有,需要的动作,就是拖动。 阅读全文
posted @ 2014-11-25 17:46 j.w 阅读(5283) 评论(0) 推荐(0)
2014年11月20日

chrome 概述

摘要: Chrome, Firebug, Filddle 调试:http://www.zhihu.com/question/35667558/answer/63936233 Chrome开发者工具系列: http://www.cnblogs.com/constantince/category/712675. 阅读全文
posted @ 2014-11-20 09:21 j.w 阅读(157) 评论(0) 推荐(0)