加载中…
博文
分类: JavaScript
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
分类: JavaScript
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
分类: JavaScript
there are 4 typical memory leak pattern:
Circular Reference;
Closure;
Cross-page leak;
Pseudo-leak;

8.1 Circular Reference
e.g.
var Rectangle = function(elem, w,h){
this.domElm = elem;
this.width = w; this.height = h;
elem.expendo = this;
};

new Rectangle;  //lead to memory leak;
//u have to break the circular ref somewhere
document.getElementByIdx_x('leaknode').expando = null;

8.2 Closure
e.g.
function Element(selector){
this.els = document.getElementByIdx_x(selector);
};
Element.prototype = {
constructor: Element,
on: function(type, handler){
var that = this;
this.els.attachEvent('on' + type, function(){
var ee = window.event;
handler.call(
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
分类: JavaScript
Build the seajs project2: editing the Gruntfile

1. purpose
my aim is these:
i. dynamic dependency management for js files.
ii. practical build method for seajs projects.

i've made little exploration on the example provided seajs.org or github, and read through the grunt website. i made some very small fix on Gruntfile.js and grunt-cmnd-transport plugin in order to achive these purpose:

a. i can use dynamic file mapping of grunt in order not to point the file i'd like to build one by one.

b. base on the structure website, i wanna use at least a globally Gruntfile as configuration, and each time i can select appropiate file to be built.

2. implementation
so i set Gruntfile as this:
1. 
grunt.initConfig({
    transport: {
    &nbs
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
分类: JavaScript
Build the seajs project1: preparation

1. install the nodejs/npm
see refrenece:
https://github.com/joyent/node/wiki/Installation
http://joyeur.com/2010/12/10/installing-node-and-npm/
https://gist.github.com/579814

2. installing the spm
npm install spm -g
npm install spm-build -g 

setting variable NODE_PATH, note it's the node_module path containing spm rather than nodejs. just follow the spm command's tip, by default, it's 
export NODE_PATH=/usr/local/lib/node_modules

3. upload the projects
this step can be implement by various means. now i just copy the file by mounting the windows disk to my virtual linux machine.

mount -t cifs //192.168.0.119/Downloads -o username=xxxx,password=xxxxx /mnt/windoz
then copy the project.
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
标签:

杂谈

分类: 杂记
http://book.douban.com/review/1621186/
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
标签:

转载

原文地址:享受高质量的恋爱作者:周国平

 

                         享受高质量的恋爱

              &n

阅读  ┆ 评论  ┆ 转载原文 ┆ 收藏 
分类: JavaScript

首页的这个lazyload没有上线,10月27日写完,当时首页已经在边跑case和测试,代码变动比较大,没有上线。这里我总结一下这个机制。

 

阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
(2012-11-15 10:42)
标签:

杂谈

分类: Internet和计算机

计算机科学

 
阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
标签:

杂谈

开发笔记

1. cygwin gdb version: 7.3.x

eclipse CDT Juno don't support cygwin gdb version higher than 7.3, if gdb is 7.5 you get: Error in launching GDB --version.the debug process can't be launched at all.
no other tip can be helpful in the IDE. Eclipse would then give u color see see!

http://stackoverflow.com/questions/9302670/gdb-with-eclipse-cdt


阅读  ┆ 评论  ┆ 转载 ┆ 收藏 
个人资料
阿黑
阿黑
  • 博客等级:
  • 博客积分:0
  • 博客访问:12,818
  • 关注人气:4
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
个人简介
我的另一个博客(放些整理过的东东):
http://blog.csdn.net/dustyface
  

新浪BLOG意见反馈留言板 不良信息反馈 电话:4006900000 提示音后按1键(按当地市话标准计费) 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 会员注册 | 产品答疑

新浪公司 版权所有