`
文章列表
int to string by specified base   convert a int to string, by specified base, support 2 - 16,   code: #include <stdio.h> /* * @author kuchaguangjie * @date 2012-04-03 22:10 * @mail kuchaguangjie@gmail.com */ /** * convert int to string of specified base, * @param n ...
  link archor   http://www.xxx.com/me.html#mood, this is a link with a archor,  #mood, is the archor part, could be the id/name of a element on the page,(html5 support id, html4 support id & name, so use id,)   when click: when click on such a url,  if the current base url is the same a ...

define subclass - js

    博客分类:
  • js
  define subclass - js   ------ define subclass   definition of subclass: assume there are function A and B, if A.prototype.prototype = B.prototype, then A is subclass of B, to complete the subclass, there are more things to do than extends prototype, see following steps,   steps to creat ...
modify file name util - python   a util script to modify file/folder name recusively, written in python, on ubuntu system,   code:   #!/usr/bin/env python # -*- coding: utf-8 -*- # @author: eric # @date: 03/04/2012 00:09 am # @mail: kuchaguangjie@163.com # this is a python util to modi ...

js closure

    博客分类:
  • js
js closure   scope: in js, inner function has access to params/local variable of the outer function,   closure: variable use the scope where they are defined, even apparently the scope is finished, inner function: a inner function will always has access to the scope which defined it - ...

js array methods

    博客分类:
  • js
  js array method   array has some build-in method, to manipulate array,   ------ join   join array elements and return a string, elements are separated by a separator, the default separator is ',' , also you can specify one,   e.g.   var arr = [1,2,3,4]; console.log(arr.join()); co ...

colleges

    colleges   ------ stanford master apply   requirements: * TOFEL 600+ * GRE 1250 * education GPA 3.3 *  * work experience * money $22000 +  *    major: * CS *    ------ MIT   requirements: * TOEFL 600+ 250 for computer-based * GRE no need *  * study backgro ...

js logic operator

    博客分类:
  • js
logical expression of js   && ,||, !   operand: the 3 operator all accept any values as operand,   return value: && and || return one of the 2 operand as return value, ! always return true or false as return value,   ------ truthy & falsy value   falsy val ...
  火车票 网上订票 经验   (以下经验是 2012年春节前, 在深圳的经验, 其他时间/地点 不保证适用,具体参见订票网站的信息和Google)   网站: http://www.12306.cn/mormhweb/   操作系统: 仅支持 windows xp, windows7,   浏览器: IE6,7,8, (IE9 我不确定是否支持)   安装 银根书: http://www.12306.cn/mormhweb/ggxxfw/wbyyzj/201106/srca12306.zip   注册: 需要提供 手机号 / 身份证号 / 姓名 / ...
variable   some global variable are avaliable in subroutings, in different stage there are different variable avaliable,   ref: https://www.varnish-cache.org/docs/3.0/reference/vcl.html#subroutines   ------ set variable value   keyword 'set', is used to set value of variable, format: s ...
  subroutine & action - varnish   subroutine, code section, called in the flow, manipulate http header and other things, action, indicate the next step, used inside subroutine, in format "return (action);" ,   see: https://www.varnish-cache.org/docs/3.0/reference/vcl.html#subrouti ...
  servlet - thread safe   ------ servlet's thread mode   by default, each servlet has only one instance, each request will have it's own thread to access the single servlet instance,   the thread safe is related to JVM memory mode,   fields & thread safe: * static fields for static ...

random select

  random select   problem: select m number from 0 - (n-1) randomly,   ------ solution 1   for each number in 0 - (n-1), in increasing order, generate a random number x, using "(x%remain) < to_select" to decide will the number be choose, until m number is choosen,   time: o ...
sparse data structure   sparse data structure - means most element are empty(or have a very same value),  so we can try to use some better data structure to reduce memory use,   ------ matrix   we can use 'header array' & 'link list' to represent matrix,   how to: define a data str ...
max sub_sequence  - c     /* problem: there is a sequence of number,could be positive or negative, find out the sub sequence which has max sum, solution: loop the sequence, use maxendinghere to record sum of elements,when sum < 0, set to 0 and go on summation from next element, ...
Global site tag (gtag.js) - Google Analytics