--------------------------------------------------------------------------- ope.undo()  操作opeを一手前に戻す ope.redo()  操作opeを一手進める ope.exec()  操作opeを反映する。ope.undo(),ope.redo()から内部的に呼ばれる ---------------------------------------------------------------------------
437630
function(){
		// とりあえず盤面全部の対応だけ
		var d0 = this.area, d = {x1:d0.x1,y1:d0.y1,x2:d0.x2,y2:d0.y2};
		var key_undo = this.board.exec.boardtype[this.old][0];
		if(key_undo & this.TURN){ var tmp=d.x1;d.x1=d.y1;d.y1=tmp;}
		this.exec(key_undo,d);
	}
409797
function overwrite(thisObj, thatObj, fields) {

            if (!thatObj) {
                return thisObj;
            }

            // 这里`fields`未指定则仅overwrite自身可枚举的字段，指定`fields`则不做限制
            fields = fields || Object.keys(thatObj);
            fields.forEach(function (field) {
                // 拷贝对象
                if (
                    thisObj[field] && typeof thisObj[field] === 'object'
                    && thatObj[field] && typeof thatObj[field] === 'object'
                ) {
                    overwrite(thisObj[field], thatObj[field]);
                }
                else {
                    thisObj[field] = thatObj[field];
                }
            });

            return thisObj;
        }
634198
function resetBizCache (date) {
  // 全キャッシュ削除
  if (!date) {
    this.bizCache = {};
    return true;
  }

  var cache = this.bizCache;

  // 年度キャッシュを全削除
  if (date === 'year') {
    Object.keys(cache).forEach(x=>{if(x.indexOf('-')===-1){delete cache[x];}});
    return true;
  }

  date = this.toDate(date);
  if (!date) {
    return false;
  }

  // 個別の日が含まれるキャッシュを削除
  var year = date.getFullYear();
  var month = date.getMonth() + 1;
  // 月キャッシュの削除
  delete cache[year + '-' + month];
  // 年度キャッシュの削除
  if (month < this.startMonth) {
    delete cache[year - 1];
  } else {
    delete cache[year];
  }

  return true;
}
283842
function replaceUrlHandler(p, options, buildInfo, destMaps, filepath) {
        var tmp = p;
        //去除?之后面路径
        if(p.indexOf('?') > -1) tmp = p.substr(0, p.indexOf('?'));
        
        var ext = path.extname(tmp);
        var dest = destMaps[ext] || options.destPath;
        var fpath = path.normalize(path.join(dest, tmp));
        var info = buildInfo[fpath];
        if(!info) {
            fpath = path.join(options.destPath, tmp);
            info = buildInfo[fpath];
        }

        //如果上面的都不可以，则有可能是相对路径，
        if(!buildInfo[fpath] && filepath) {
            fpath = path.normalize(path.join(path.dirname(filepath), tmp));
            info = buildInfo[fpath];
        }

        if(info && info.path) {
            tmp =  path.dirname(tmp) + '/' + path.basename(info.path);
            //如果后续还有?部门，也截取到tmp中
            if(p.indexOf('?') > -1) {
                tmp += p.substr(p.indexOf('?'));
            }
        }

        //如果有md5码，且路径中需要替换md5,则替换。
        if(info && info.md5 && tmp.indexOf('{md5}') > -1) {
            tmp = tmp.replace('{md5}', info.md5);
        }

        //只有找到相关信息才采用更改后的
        if(info) p = tmp;

        p = replaceUrlMap(p, options.urlMaps);
        return p;
    }
680410
function(data){
			//console.log(data);
			//丢弃data的第一行
			var res = '', i = 1, len = data.length;
			for(; i < len; i++){
				res += data[i].replace(/^[\t ]+/, '');
			}
			return res;
		}
385800
function UndoManager(callback, panels) {

        var undoObj = this;
        var undoStack = []; // A stack of undo states
        var stackPtr = 0; // The index of the current state
        var mode = "none";
        var lastState; // The last state
        var timer; // The setTimeout handle for cancelling the timer
        var inputStateObj;

        // Set the mode for later logic steps.
        var setMode = function (newMode, noSave) {
            if (mode != newMode) {
                mode = newMode;
                if (!noSave) {
                    saveState();
                }
            }

            if (!uaSniffed.isIE || mode != "moving") {
                timer = setTimeout(refreshState, 1);
            }
            else {
                inputStateObj = null;
            }
        };

        var refreshState = function (isInitialState) {
            inputStateObj = new TextareaState(panels, isInitialState);
            timer = undefined;
        };

        this.setCommandMode = function () {
            mode = "command";
            saveState();
            timer = setTimeout(refreshState, 0);
        };

        this.canUndo = function () {
            return stackPtr > 1;
        };

        this.canRedo = function () {
            if (undoStack[stackPtr + 1]) {
                return true;
            }
            return false;
        };

        // Removes the last state and restores it.
        this.undo = function () {

            if (undoObj.canUndo()) {
                if (lastState) {
                    // What about setting state -1 to null or checking for undefined?
                    lastState.restore();
                    lastState = null;
                }
                else {
                    undoStack[stackPtr] = new TextareaState(panels);
                    undoStack[--stackPtr].restore();

                    if (callback) {
                        callback();
                    }
                }
            }

            mode = "none";
            panels.input.focus();
            refreshState();
        };

        // Redo an action.
        this.redo = function () {

            if (undoObj.canRedo()) {

                undoStack[++stackPtr].restore();

                if (callback) {
                    callback();
                }
            }

            mode = "none";
            panels.input.focus();
            refreshState();
        };

        // Push the input area state to the stack.
        var saveState = function () {
            var currState = inputStateObj || new TextareaState(panels);

            if (!currState) {
                return false;
            }
            if (mode == "moving") {
                if (!lastState) {
                    lastState = currState;
                }
                return;
            }
            if (lastState) {
                if (undoStack[stackPtr - 1].text != lastState.text) {
                    undoStack[stackPtr++] = lastState;
                }
                lastState = null;
            }
            undoStack[stackPtr++] = currState;
            undoStack[stackPtr + 1] = null;
            if (callback) {
                callback();
            }
        };

        var handleCtrlYZ = function (event) {

            var handled = false;

            if (event.ctrlKey || event.metaKey) {

                // IE and Opera do not support charCode.
                var keyCode = event.charCode || event.keyCode;
                var keyCodeChar = String.fromCharCode(keyCode);

                switch (keyCodeChar) {

                    case "y":
                        undoObj.redo();
                        handled = true;
                        break;

                    case "z":
                        if (!event.shiftKey) {
                            undoObj.undo();
                        }
                        else {
                            undoObj.redo();
                        }
                        handled = true;
                        break;
                }
            }

            if (handled) {
                if (event.preventDefault) {
                    event.preventDefault();
                }
                if (window.event) {
                    window.event.returnValue = false;
                }
                return;
            }
        };

        // Set the mode depending on what is going on in the input area.
        var handleModeChange = function (event) {

            if (!event.ctrlKey && !event.metaKey) {

                var keyCode = event.keyCode;

                if ((keyCode >= 33 && keyCode <= 40) || (keyCode >= 63232 && keyCode <= 63235)) {
                    // 33 - 40: page up/dn and arrow keys
                    // 63232 - 63235: page up/dn and arrow keys on safari
                    setMode("moving");
                }
                else if (keyCode == 8 || keyCode == 46 || keyCode == 127) {
                    // 8: backspace
                    // 46: delete
                    // 127: delete
                    setMode("deleting");
                }
                else if (keyCode == 13) {
                    // 13: Enter
                    setMode("newlines");
                }
                else if (keyCode == 27) {
                    // 27: escape
                    setMode("escape");
                }
                else if ((keyCode < 16 || keyCode > 20) && keyCode != 91) {
                    // 16-20 are shift, etc. 
                    // 91: left window key
                    // I think this might be a little messed up since there are
                    // a lot of nonprinting keys above 20.
                    setMode("typing");
                }
            }
        };

        var setEventHandlers = function () {
            util.addEvent(panels.input, "keypress", function (event) {
                // keyCode 89: y
                // keyCode 90: z
                if ((event.ctrlKey || event.metaKey) && (event.keyCode == 89 || event.keyCode == 90)) {
                    event.preventDefault();
                }
            });

            var handlePaste = function () {
                if (uaSniffed.isIE || (inputStateObj && inputStateObj.text != panels.input.value)) {
                    if (timer == undefined) {
                        mode = "paste";
                        saveState();
                        refreshState();
                    }
                }
            };

            util.addEvent(panels.input, "keydown", handleCtrlYZ);
            util.addEvent(panels.input, "keydown", handleModeChange);
            util.addEvent(panels.input, "mousedown", function () {
                setMode("moving");
            });

            panels.input.onpaste = handlePaste;
            panels.input.ondrop = handlePaste;
        };

        var init = function () {
            setEventHandlers();
            refreshState(true);
            saveState();
        };

        init();
    }
604112
function(){
		var opemgr = this.puzzle.opemgr;
		var bd = this.board;
		var len = this.readLine().match(/TrialData\((\d+)\)/)[1]|0;
		for(var i=len-1;i>=0;i--){
			var opes = [];
			var bd1 = bd.freezecopy();
			bd.allclear(false);
			this.decodeData();
			bd.compareData(bd1, function(group,c,a){
				var obj = bd[group][c];
				var old = obj[a];
				var num = bd1[group][c][a];
				opes.push(new this.puzzle.klass.ObjectOperation(obj, a, old, num));
			});
			opemgr.history.unshift(opes);
			opemgr.history.unshift([new this.puzzle.klass.TrialEnterOperation(i, i+1)]);
			opemgr.trialpos.unshift(i*2);
			this.readLine();	// 次の"TrialData"文字列は読み捨て
		}
		opemgr.position = opemgr.history.length;
		opemgr.resumeTrial();
	}
1099222
function replace(value) {

  // 漢数字、漢字、全角文字を半角数字に変換
  value = suji(value);

  // 和暦時西暦に変換
  value = value.replace(REG_ERA, (x, g, n, af) => {
    var era = ERA_MAP[g];
    return '' + (era.y + (n === '元' ?  1 : +n) - 1) + af;
  });

  // 午前午後を24時間表記に変換
  value = value.replace(REG_AMPM, (x, ampm, n) => {
    var pm = ampm === '午後' || ampm.toLowerCase() === 'pm';
    return pm ? +n + 12 : n;
  });

  return value;
}
955973
def docomo_openiarea_url_for(options = {})
      url = options
      if options.is_a?(Hash)
        options = options.symbolize_keys
        options[:only_path] = false
        posinfo = options.delete(:posinfo) || '1' # 基地局情報を元に測位した緯度経度情報を要求
        url = url_for(options)
      else
        posinfo = '1'
      end
      "http://w1m.docomo.ne.jp/cp/iarea?ecode=OPENAREACODE&msn=OPENAREAKEY&posinfo=#{posinfo}&nl=#{CGI.escape(url)}"
    end
204404
function openExecute(puzzle, data, variety, callback){
	if(typeof variety!=='string' && !callback){
		callback = variety;
		variety = void 0;
	}

	puzzle.ready = false;

	var classes = puzzle.klass;
	var Board = ((!!classes && !!classes.Board) ? classes.Board : null);
	var pzl = pzpr.parser(data, (variety || puzzle.pid));

	pzpr.classmgr.setPuzzleClass(puzzle, pzl.pid, function(){
		/* パズルの種類が変わっていればオブジェクトを設定しなおす */
		if(Board!==puzzle.klass.Board){ initObjects(puzzle);}
		else{ puzzle.painter.suspendAll();}
		
		try{
			puzzle.metadata.reset();
			if     (pzl.isurl) { new puzzle.klass.Encode().decodeURL(pzl);}
			else if(pzl.isfile){ new puzzle.klass.FileIO().filedecode(pzl);}
			
			puzzle.ready = true;
			puzzle.emit('ready');
			puzzle.emit('mode');
			
			if(!!puzzle.canvas){ postCanvasReady(puzzle);}
			
			puzzle.resetTime();
			
			if(!!callback){ callback(puzzle);}
		}
		catch(e){
			puzzle.emit('fail-open');
			throw e;
		}
	});
}
489549
function (element, type, handler) {
            var own = this;
            //非DOM元素不处理 handler 非function 不处理
            if (!(1 == element.nodeType || element.nodeType == 9 || element === window) || !vQ.isFunction(handler)) {
                return;
            }

            //批量事件绑定
            if (vQ.isArray(type)) {
                return own._handleMultipleEvents(own.remove, element, type, handler);
            }
            //处理绑定了了context的事件
            var _handler = own._contextHandler[handler.$$guid];// || handler;

            //调用原生方法解除已绑定事件
            if (element.removeEventListener) {
                element.removeEventListener(type, _handler || handler, false);
            } else {
                //IE等 自行托管事件

                // delete the event handler from the hash table
                var events = element.events;
                if (events) {
                    delete events[handler.$$guid];//删除该方法
                    //判断事件集合是否为空
                    var hasProp = false;
                    for (var prop in events) {
                        hasProp = true;
                    }
                    if (!hasProp) {
                        delete element.events;
                    }
                }
            }
            if (_handler && !delete own._contextHandler[handler.$$guid]) {
                own._contextHandler[handler.$$guid] = null;
            }
        }
1146428
function removeFormpart(TPL,ctx)
{
    let files = ctx.files;
    for(let f in files) {
        fs.unlink(files[f].path, (err)=> {
            err && TPL.params[f] && console.error('删除文件失败', files[f])
        });//异步清除临时目录中的上传文件
    }
}
1195883
function initText(elem, parsed, extra){
  var param = extra.param;
  var throttle, lazy = param.lazy

  if('throttle' in param){
    // <input throttle r-model>
    if(param.throttle === true){
      throttle = 400;
    }else{
      throttle = parseInt(param.throttle, 10)
    }
  }

  var self = this;
  var wc = this.$watch(parsed, function(newValue){
    if(elem.value !== newValue) elem.value = newValue == null? "": "" + newValue;
  }, STABLE);

  // @TODO to fixed event
  var isCompositing = false;
  var handler = function (ev){

    if(isCompositing) return;

    isCompositing = false;

    var that = this;
    if(ev.type==='cut' || ev.type==='paste'){
      _.nextTick(function(){
        var value = that.value
        parsed.set(self, value);
        wc.last = value;
        self.$update();
      })
    }else{
        var value = that.value
        parsed.set(self, value);
        wc.last = value;
        self.$update();
    }
  };

  function onCompositionStart(){
    isCompositing = true;
  }

  function onCompositionEnd(ev){
    isCompositing = false;
    handler.call(this,ev)
  }

  if(throttle && !lazy){
    var preHandle = handler, tid;
    handler = _.throttle(handler, throttle);
  }

  if(hasInput === undefined){
    hasInput = dom.msie !== 9 && "oninput" in document.createElement('input')
  }

  if(lazy){
    dom.on(elem, 'change', handler)
  }else{

    if(typeof CompositionEvent === 'function' ){ //lazy的情况不需要compositionend
      elem.addEventListener("compositionstart", onCompositionStart );
      elem.addEventListener("compositionend", onCompositionEnd );
    }

    if( hasInput){
      elem.addEventListener("input", handler );
    }else{
      dom.on(elem, "paste keyup cut change", handler)
    }
  }
  if(parsed.get(self) === undefined && elem.value){
     parsed.set(self, elem.value);
  }
  return function (){
    if(lazy) return dom.off(elem, "change", handler);
    if( hasInput ){
      elem.removeEventListener("input", handler );
    }else{
      dom.off(elem, "paste keyup cut change", handler)
    }
  }
}
566511
function onError(err) {
		// 请求（或响应）发生错误的时候，如果内部任何一层都未能捕获，则在最外层捕获
		Coralian.logger.err("HTTP req error : ");
		Coralian.logger.err(err.code);
		Coralian.logger.err(err.stack);

		// 如果发生 write after end ，则只将错误信息记录到 log 中去
		if (String.contains(err.message, 'write after end')) return;

		req.url = formatString(ERROR_ROUTE_FORMAT, (err.code || HttpStatusCode.INTERNAL_SERVER_ERROR));
		req.parse = url.parse(req.url, true);
		request(req, res);
	}
451539
function touchHandler (event) {
  let opt = this._opt
  opt.preventDefault && event.preventDefault()
  opt.stopPropagation && event.stopPropagation()

  // 如果 touchstart 没有被触发(可能被子元素的 touchstart 回调触发了 stopPropagation)，
  // 那么后续的手势将取消计算
  if (event.type !== 'touchstart' && !dataProcessor.startTime) {
    return
  }

  let data = dataProcessor.process(event, opt.preventX, opt.preventY)
  this._recognize(data)
  this.trigger(event.type, event, data)
}
38736
public function rewind()
	{
		//1行目はヘッダ行なので読み飛ばす
		$this->position = 1;
		
		if(!$this->lines){
			
			//CSVを読み込み
			$giscsv = new Dm_Geocoder_GISCSV($this->prefectureCode);
			$buf = $giscsv->read();
			
			//1行ごとに分解
			$ret = array();
			$lines = explode("\r\n", $buf);
			array_pop($lines);
			foreach ($lines as $line) {
				$ret[] = $line;
			}
			
			$this->lines = $ret;
		}
	}
421610
void accept(PassedRoute passRoute) {
		//各行の通過情報を集計
		for (LineRange range : lineRanges) {
			if (passRoute.isHit(range)) {
				hitLines[range.getLineIndex()]++;
			}
		}
		//各行のブランチ情報を集計
		passRoute.getRangeBranchStatus().forEach((range, state) -> {
			RangeBranch branch = branches.computeIfAbsent(range, RangeBranch::new);
			branch.add(state);
		});

		//各通過情報を集計
		passRanges.addAll(passRoute.getHitRanges());

		updated = true;

	}