--------------------------------------------------------------------- qrKanji ---------------------------------------------------------------------
341920
function(data) {

    var _mode = QRMode.MODE_KANJI;
    var _data = data;

    var stringToBytes = qrcode.stringToBytesFuncs['SJIS'];
    if (!stringToBytes) {
      throw 'sjis not supported.';
    }
    !function(c, code) {
      // self test for sjis support.
      var test = stringToBytes(c);
      if (test.length != 2 || ( (test[0] << 8) | test[1]) != code) {
        throw 'sjis not supported.';
      }
    }('\u53cb', 0x9746);

    var _bytes = stringToBytes(data);

    var _this = {};

    _this.getMode = function() {
      return _mode;
    };

    _this.getLength = function(buffer) {
      return ~~(_bytes.length / 2);
    };

    _this.write = function(buffer) {

      var data = _bytes;

      var i = 0;

      while (i + 1 < data.length) {

        var c = ( (0xff & data[i]) << 8) | (0xff & data[i + 1]);

        if (0x8140 <= c && c <= 0x9FFC) {
          c -= 0x8140;
        } else if (0xE040 <= c && c <= 0xEBBF) {
          c -= 0xC140;
        } else {
          throw 'illegal char at ' + (i + 1) + '/' + c;
        }

        c = ( (c >>> 8) & 0xff) * 0xC0 + (c & 0xff);

        buffer.put(c, 13);

        i += 2;
      }

      if (i < data.length) {
        throw 'illegal char at ' + (i + 1);
      }
    };

    return _this;
  }
97485
function()
        {
            // 如果导入了 pinyin_dict_firstletter.js
            if(pinyin_dict_firstletter)
            {
                dict.firstletter = pinyin_dict_firstletter;
            }
            // 如果导入了 pinyin_dict_notone.js
            if(window.pinyin_dict_notone)
            {
                dict.notone = {};
                dict.py2hz = pinyin_dict_notone; // 拼音转汉字
                for(var i in pinyin_dict_notone)
                {
                    var temp = pinyin_dict_notone[i];
                    for(var j=0, len=temp.length; j<len; j++)
                    {
                        if(!dict.notone[temp[j]]) dict.notone[temp[j]] = i; // 不考虑多音字
                    }
                }
            }
            // 如果导入了 pinyin_dict_withtone.js
            if(window.pinyin_dict_withtone)
            {
                dict.withtone = {}; // 汉字与拼音映射，多音字用空格分开，类似这种结构：{'大': 'da tai'}
                var temp = pinyin_dict_withtone.split(',');
                for(var i=0, len = temp.length; i<len; i++)
                {
                    // 这段代码耗时28毫秒左右，对性能影响不大，所以一次性处理完毕
                    dict.withtone[String.fromCharCode(i + 19968)] = temp[i]; // 这里先不进行split(' ')，因为一次性循环2万次split比较消耗性能
                }

                // 拼音 -> 汉字
                if(window.pinyin_dict_notone)
                {
                    // 对于拼音转汉字，我们优先使用pinyin_dict_notone字典文件
                    // 因为这个字典文件不包含生僻字，且已按照汉字使用频率排序
                    dict.py2hz = pinyin_dict_notone; // 拼音转汉字
                }
                else
                {
                    // 将字典文件解析成拼音->汉字的结构
                    // 与先分割后逐个去掉声调相比，先一次性全部去掉声调然后再分割速度至少快了3倍，前者大约需要120毫秒，后者大约只需要30毫秒（Chrome下）
                    var notone = pinyinUtil.removeTone(pinyin_dict_withtone).split(',');
                    var py2hz = {}, py, hz;
                    for(var i=0, len = notone.length; i<len; i++)
                    {
                        hz = String.fromCharCode(i + 19968); // 汉字
                        py = notone[i].split(' '); // 去掉了声调的拼音数组
                        for(var j=0; j<py.length; j++)
                        {
                            py2hz[py[j]] = (py2hz[py[j]] || '') + hz;
                        }
                    }
                    dict.py2hz = py2hz;
                }
            }
        }
1297424
private void setGeneratedKeyColumns(final SqlContext context, final MappingColumn[] idColumns,
			final TableMetadata metadata) {
		// 実行結果から生成されたIDを取得できるようにPreparedStatementにIDカラムを渡す
		if (idColumns != null && idColumns.length > 0) {
			List<String> keyColumnNames = new ArrayList<>();
			for (MappingColumn idColumn : idColumns) {
				for (TableMetadata.Column column : metadata.getColumns()) {
					if (idColumn.getCamelName().equals(column.getCamelColumnName())) {
						keyColumnNames.add(column.getColumnName());
						break;
					}
				}
			}
			context.setGeneratedKeyColumns(keyColumnNames.toArray(new String[keyColumnNames.size()]));
		}
	}
1024348
function f_tahta_kurum_idleri(_tahta_id) {
        return result.dbQ.smembers(result.kp.tahta.ssetOzelKurumlari(_tahta_id, true));
    }
415941
function(){
		/* ヘッダの処理 */
		if(this.type===FILE_PZPR){
			return [(this.filever===0?"pzprv3":("pzprv3." + this.filever)), this.pid, ""].join("\n");
		}
		else if(this.type===FILE_PBOX_XML){
			this.body.querySelector('puzzle').setAttribute('type', pzpr.variety(this.pid).kanpenid);
		}
		return "";
	}
1134406
function(newope){
		if(!this.puzzle.ready || (!this.forceRecord && this.disrec>0)){ return;}

		/* Undoした場所で以降の操作がある時に操作追加された場合、以降の操作は消去する */
		if(this.enableRedo){ this.removeDescendant();}

		/* 前の履歴を更新するかどうか判定 */
		var puzzle = this.puzzle;
		if( this.disCombine || !this.lastope ||
			!newope.isModify || !newope.isModify(this.lastope) )
		{
			/* 履歴を追加する */
			if(!this.chainflag){
				this.history.push(new this.klass.OperationList());
				this.position++;
				this.chainflag = true;
			}
			this.history[this.history.length-1].push(newope);
			this.lastope = newope;
		}
		else{
			/* 前の履歴を更新したときは何もしない */
		}
		
		if(newope.property!=='qsub' && newope.property!=='qcmp' && newope.property!=='snum'){
			puzzle.checker.resetCache();
		}
		this.changeflag = true;
		this.checkexec();
	}
1172062
function f_kalem_indeksliler_by_page(_tahta_id, _ihale_id, _arama) {
        l.info("f_db_kalem_indeksliler_by_page");
        var baslangic = 0,
            bitis = 10,
            sonucAnahtari = "temp_kalem_sayfali",
            defer = result.dbQ.Q.defer();

        if (_arama.Sayfalama) {
            baslangic = _arama.Sayfalama.Sayfa * _arama.Sayfalama.SatirSayisi;
            bitis = _arama.Sayfalama.SatirSayisi;
        }

        var sonuc = schema.f_create_default_object(schema.SCHEMA.LAZY_LOADING_RESPONSE);
        sonuc.ToplamKayitSayisi = 0;
        sonuc.Data = [];

        f_kalem_indeksli_idler_ihaleye_bagli(_tahta_id, _ihale_id)
            .then(function (_kalem_idler) {
                console.log("_kalem_idler>" + _kalem_idler);
                console.log(" _kalem_idler.length>" + _kalem_idler.length);

                if (_kalem_idler && _kalem_idler.length > 0) {

                    sonuc.ToplamKayitSayisi = _kalem_idler.length;


                    //sayfalı çekebilmek için önce zset e eklemeliyiz(? diye bir sey zset oluşturmak için yazıyoruz)
                    _kalem_idler.mapX(null, function (_id) {
                        db.redis.dbQ.zadd(sonucAnahtari, new Date().getTime(), _id);
                    }).allX()
                        .then(function () {

                            console.log("baslangic>" + baslangic);
                            console.log("bitis>" + bitis);

                            result.dbQ.Q.all([
                                result.dbQ.zrangebyscore(sonucAnahtari, "-inf", "+inf", "LIMIT", baslangic, bitis),
                                result.dbQ.expire(sonucAnahtari, 20)
                            ]).then(function (_ress) {

                                if (_ress[0] && _ress[0].length > 0) {
                                    f_kalem_id(_ress[0], _tahta_id)
                                        .then(function (_data) {
                                            sonuc.Data = _data;
                                            defer.resolve(sonuc);
                                        });
                                } else {
                                    defer.resolve(sonuc);
                                }
                            });
                        });

                } else {
                    defer.resolve(sonuc);
                }
            });
        return defer.promise;
    }
764810
function(isques, rdata){
		var bd = this.board;
		for(var id=0;id<bd.border.length;id++){
			var border = bd.border[id], cell1 = border.sidecell[0], cell2 = border.sidecell[1];
			var isdiff = (!cell1.isnull && !cell2.isnull && rdata[cell1.id]!==rdata[cell2.id]);
			border[(isques?'ques':'qans')] = (isdiff?1:0);
		}
	}
1014923
static function result($s, $quanpin = true, $daxie = false, $trim = false)
      {
            $pyCount = 0;
            if(is_array($quanpin) && $quanpin[1]) {
                  $pyCount = $quanpin[1];
                  unset($quanpin[1]);
                  $quanpin = $quanpin[0];
            }
            $s = preg_replace("/\s/is", "_", $s);
            $s = preg_replace("/(|\~|\`|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\-|\+|\=|\{|\}|\[|\]|\||\\|\:|\;|\"|\'|\<|\,|\>|\.|\?|\/)/is", "", $s);
            $i = 0;
            $py = '';
            $_trim = $trim ? ' ' : '';
            // 加入这一句，自动识别UTF-8
            if (strlen("拼音") > 4)
            $s = iconv('UTF-8', 'GBK', $s);
            if ($quanpin) {
                  // 全拼
                  for ($i = 0; $i < strlen($s); $i++) {
                      if (ord($s[$i]) > 128) {
                          $char = self::asi2py(ord($s[$i]) + ord($s[$i + 1]) * 256);
                          $py.=$char.$_trim;
                          $i++;
                      } else {
                          $py.=$s[$i].$_trim;
                      }
                  }
            } else {
                  // 首字母
                  for ($i = 0; $i < strlen($s); $i++) {
                        if (ord($s[$i]) > 128) {
                              $char = self::asi2py(ord($s[$i]) + ord($s[$i + 1]) * 256);
                              $py	.=$char[0].$_trim;
                              $i++;
                        } else {
                              $py	.=$s[$i].$_trim;
                        }
                  }
            }
            $py = $trim ? trim($py, ' ') : $py;
            if($pyCount){
                  $py = substr($py, 0, $pyCount);
            }
            return ($daxie == true ? $py : strtolower($py));// 判断是否输出小写字符
      }
741431
public function createBroccoliInitOptions(){
		$broccoliInitializeOptions = array();
		$px2ce = $this;

		$page_path = $this->page_path;
		$px2conf = $this->px2conf;
		$pageInfo = $this->pageInfo;
		$contRoot = $this->contRoot;
		$documentRoot = $this->documentRoot;
		$realpathDataDir = $this->realpathDataDir;
		$pathResourceDir = $this->pathResourceDir;
		$pathsModuleTemplate = array();
		$bindTemplate = function(){};

		$customFields = array();
		$page_content = $this->page_path;
		if( strlen(@$pageInfo->content) ){
			$page_content = $pageInfo->content;
		}

		// フィールドを拡張

		// px2ce が拡張するフィールド
		$customFields['table'] = 'broccoliHtmlEditor\\broccoliFieldTable\\main';

		// 呼び出し元アプリが拡張するフィールド
		foreach( $this->options['customFields'] as $idx=>$customField ){
			$customFields[$idx] = $this->options['customFields'][$idx];
		}

		// プロジェクトが拡張するフィールド
		$confCustomFields = @$px2conf->plugins->px2dt->guieditor->custom_fields;
		if(is_object($confCustomFields)){
			foreach( $confCustomFields as $fieldName=>$field ){
				if( @$confCustomFields->{$fieldName}->backend->class ){
					$customFields[$fieldName] = $confCustomFields->{$fieldName}->backend->class;
				}
			}
		}

		// var_dump($customFields);

		// モジュールテンプレートを収集
		// (指定モジュールをロード)
		if( $this->target_mode == 'theme_layout' ){
			// テーマ編集ではスキップ
		}else{
			$tmp_paths_module_template = @$px2conf->plugins->px2dt->paths_module_template;
			if( is_array($tmp_paths_module_template) || is_object($tmp_paths_module_template) ){
				foreach( $tmp_paths_module_template as $idx=>$path_module_template ){
					$pathsModuleTemplate[$idx] = $this->fs()->get_realpath( $path_module_template.'/', dirname($this->entryScript) );
				}
			}
		}

		// モジュールテンプレートを収集
		// (モジュールフォルダからロード)
		$pathModuleDir = @$px2conf->plugins->px2dt->path_module_templates_dir;
		if( $this->target_mode == 'theme_layout' ){
			// テーマ編集では `broccoli_module_packages` をロードする。
			$pathModuleDir = $this->documentRoot.$this->theme_id.'/broccoli_module_packages/';
		}
		if( !is_string($pathModuleDir) ){
			// モジュールフォルダの指定がない場合
		}else{
			$pathModuleDir = $this->fs()->get_realpath( $pathModuleDir.'/', dirname($this->entryScript) );
			if( !is_dir($pathModuleDir) ){
				// 指定されたモジュールフォルダが存在しない場合
			}else{
				// info.json を読み込み
				$infoJson = array();
				if( is_file($pathModuleDir.'/info.json') ){
					$srcInfoJson = file_get_contents($pathModuleDir.'/info.json');
					$infoJson = json_decode($srcInfoJson);
				}
				if( is_array(@$infoJson->sort) ){
					// 並び順の指定がある場合
					foreach( $infoJson->sort as $idx=>$row ){
						if( @$pathsModuleTemplate[$infoJson->sort[$idx]] ){
							// 既に登録済みのパッケージIDは上書きしない
							// (= paths_module_template の設定を優先)
							continue;
						}
						if( is_dir($pathModuleDir.$infoJson->sort[$idx]) ){
							$pathsModuleTemplate[$infoJson->sort[$idx]] = $pathModuleDir.$infoJson->sort[$idx];
						}
					}
				}

				// モジュールディレクトリ中のパッケージをスキャンして一覧に追加
				$fileList = $this->fs()->ls($pathModuleDir);
				sort($fileList); // sort
				foreach( $fileList as $idx=>$row){
					if( @$pathsModuleTemplate[$fileList[$idx]] ){
						// 既に登録済みのパッケージIDは上書きしない
						// (= paths_module_template の設定を優先)
						continue;
					}
					if( is_dir($pathModuleDir.$fileList[$idx]) ){
						$pathsModuleTemplate[$fileList[$idx]] = $pathModuleDir.$fileList[$idx];
					}
				}
			}
		}

		if( $this->target_mode == 'theme_layout' ){
			$bindTemplate = function($htmls){
				$fin = '';
				foreach( $htmls as $bowlId=>$html ){
					if( $bowlId == 'main' ){
						$fin .= $htmls['main'];
					}else{
						$fin .= "\n";
						$fin .= "\n";
						$fin .= '<'.'?php ob_start(); ?'.'>'."\n";
						$fin .= (strlen($htmls[$bowlId]) ? $htmls[$bowlId]."\n" : '');
						$fin .= '<'.'?php $px->bowl()->send( ob_get_clean(), '.json_encode($bowlId).' ); ?'.'>'."\n";
						$fin .= "\n";
					}
				}
				$template = '<'.'%- body %'.'>';
				$pathThemeLayout = $this->documentRoot.$this->theme_id.'/broccoli_module_packages/_layout.html';
				if(is_file($pathThemeLayout)){
					$template = file_get_contents( $pathThemeLayout );
				}else{
					$template = file_get_contents( __DIR__.'/tpls/broccoli_theme_layout.html' );
				}
				// PHP では ejs は使えないので、単純置換することにした。
				// $fin = $ejs.render($template, {'body': $fin}, {'delimiter': '%'});
				$fin = str_replace('<'.'%- body %'.'>', $fin, $template);

				$baseDir = $this->documentRoot.$this->theme_id.'/theme_files/';
				$this->fs()->mkdir_r( $baseDir );
				$CssJs = $this->getModuleCssJsSrc($this->theme_id);

				$this->fs()->save_file($baseDir.'modules.css', $CssJs['css']);
				$this->fs()->save_file($baseDir.'modules.js', $CssJs['js']);
				return $fin;
			};
		}else{
			$bindTemplate = function($htmls){
				$fin = '';
				foreach( $htmls as $bowlId=>$html ){
					if( $bowlId == 'main' ){
						$fin .= $htmls['main'];
					}else{
						$fin .= "\n";
						$fin .= "\n";
						$fin .= '<'.'?php ob_start(); ?'.'>'."\n";
						$fin .= (strlen($htmls[$bowlId]) ? $htmls[$bowlId]."\n" : '');
						$fin .= '<'.'?php $px->bowl()->send( ob_get_clean(), '.json_encode($bowlId).' ); ?'.'>'."\n";
						$fin .= "\n";
					}
				}
				return $fin;
			};
		}

		$broccoliInitializeOptions = array(
			'appMode' => $this->get_app_mode() ,
			'paths_module_template' => $pathsModuleTemplate ,
			'documentRoot' => $documentRoot,// realpath
			'pathHtml' => $this->fs()->get_realpath($this->contRoot.'/'.$page_content),
			'pathResourceDir' => $this->pathResourceDir,
			'realpathDataDir' =>  $this->realpathDataDir,
			'contents_bowl_name_by' => @$px2conf->plugins->px2dt->contents_bowl_name_by,
			'customFields' => $customFields ,
			'bindTemplate' => $bindTemplate,
			'log' => function($msg){
				// エラー発生時にコールされます。
				// px2ce.log(msg);
			}
		);

		return $broccoliInitializeOptions;
	}
159816
function f_kalem_gizlenen_toplami(_tahta_id) {

        return result.dbQ.exists(result.kp.temp.ssetTahtaKalemTumu(_tahta_id))
            .then(function (_iExist) {
                return (_iExist
                    ? 1//temp var
                    : f_tahta_kalem_idler_aktif(_tahta_id));//temp oluşturmak için kalem idlerini çek )
            })
            .then(function () {
                return result.dbQ.Q.all([
                    f_kalem_gizlenen_idler(_tahta_id),
                    result.dbQ.scard(result.kp.temp.ssetTahtaKalemTumu(_tahta_id))

                ]).then(function (_ress) {

                    var sonuc = schema.f_create_default_object(schema.SCHEMA.GRAFIK_DONUT);
                    var gecerli = parseInt(_ress[0].length || 0),
                        toplam = parseInt(_ress[1] || 0);
                    sonuc.Toplam = toplam;
                    sonuc.Gecerli = gecerli;
                    sonuc.Gecersiz = toplam - gecerli;
                    return sonuc;
                });
            })


    }
1047553
function f_tahtanin_takipteki_kalem_idleri(_ihale_id, _tahta_id) {

        return result.dbQ.smembers(result.kp.tahta.ssetTakiptekiKalemleri(_tahta_id))
            .then(function (_takipteki_kalem_idler) {
                //takip edilen kalem yoksa boş dizi dön
                if (!_takipteki_kalem_idler || _takipteki_kalem_idler.length == 0) {
                    return [];
                }
                return f_aktif_kalem_idler(_ihale_id, _tahta_id)
                    .then(function (_aktif_kalem_idler) {
                        return _.intersection(_aktif_kalem_idler, _takipteki_kalem_idler);
                    });
            });
    }
1036453
function f_tahta_ihale_gizlenen_toplami(_tahta_id) {
        var db_ihale = require("./db_ihale");
        return result.dbQ.exists(result.kp.temp.ssetTahtaIhaleTumu(_tahta_id))
            .then(function (_iExist) {
                return (_iExist
                    ? 1//temp kayıtlı
                    : db_ihale.f_db_tahta_ihale_idler_aktif(_tahta_id))//temp oluşturmak için ihale idlerini çek
            })
            .then(function () {
                return result.dbQ.Q.all([
                    f_tahta_ihale_gizlenen_idler(_tahta_id),
                    result.dbQ.scard(result.kp.temp.ssetTahtaIhaleTumu(_tahta_id))

                ]).then(function (_ress) {
                    /** @type {GrafikDonut} */
                    var sonuc = schema.f_create_default_object(schema.SCHEMA.GRAFIK_DONUT);
                    var gecerli = parseInt(_ress[0].length || 0),
                        toplam = parseInt(_ress[1] || 0);

                    sonuc.Toplam = toplam;
                    sonuc.Gecerli = gecerli;
                    sonuc.Gecersiz = toplam - gecerli;
                    return sonuc;
                });
            });

    }
1127562
function kansuji (num) {

  if (num === 0) {
    return '〇';
  } else if (num < 0 || 9999 < num) {
    return '';
  }

  var kurai = ('0000' + num).slice(-4).split('');
  var s = kurai[0] * 1;
  var h = kurai[1] * 1;
  var j = kurai[2] * 1;
  var i = kurai[3] * 1;

  return (s === 0 ? '' : s === 1 ? '千' : JNUM[s] + '千') +
         (h === 0 ? '' : h === 1 ? '百' : JNUM[h] + '百') +
         (j === 0 ? '' : j === 1 ? '十' : JNUM[j] + '十') +
         (i === 0 ? '' : JNUM[i]);
}
1172532
public QrCodeEncoder addKanji(String message) {
		byte[] bytes;
		try {
			bytes = message.getBytes("Shift_JIS");
		} catch (UnsupportedEncodingException ex) {
			throw new IllegalArgumentException(ex);
		}

		MessageSegment segment = new MessageSegment();
		segment.message = message;
		segment.data = bytes;
		segment.length = message.length();
		segment.mode = QrCode.Mode.KANJI;

		segment.encodedSizeBits += 4;
		segment.encodedSizeBits += 13*segment.length;

		segments.add(segment);

		return this;
	}
1256786
function() {
        var hierarchyList = this._getColumnHierarchyList();
        var maxRowCount = this._getHierarchyMaxRowCount(hierarchyList);
        var headerHeight = this.dimensionModel.get('headerHeight');
        var rowMarkupList = new Array(maxRowCount);
        var columnNames = new Array(maxRowCount);
        var colSpanList = [];
        var rowHeight = util.getRowHeight(maxRowCount, headerHeight) - 1;
        var rowSpan = 1;
        var height;
        var headerMarkupList;

        _.each(hierarchyList, function(hierarchy, i) {
            var length = hierarchyList[i].length;
            var curHeight = 0;

            _.each(hierarchy, function(columnModel, j) {
                var columnName = columnModel.name;
                var classNames = [
                    classNameConst.CELL,
                    classNameConst.CELL_HEAD
                ];

                if (columnModel.validation && columnModel.validation.required) {
                    classNames.push(classNameConst.CELL_REQRUIRED);
                }

                rowSpan = (length - 1 === j && (maxRowCount - length + 1) > 1) ? (maxRowCount - length + 1) : 1;
                height = rowHeight * rowSpan;

                if (j === length - 1) {
                    height = (headerHeight - curHeight) - 2;
                } else {
                    curHeight += height + 1;
                }
                if (columnNames[j] === columnName) {
                    rowMarkupList[j].pop();
                    colSpanList[j] += 1;
                } else {
                    colSpanList[j] = 1;
                }
                columnNames[j] = columnName;
                rowMarkupList[j] = rowMarkupList[j] || [];
                rowMarkupList[j].push(this.templateHeader({
                    attrColumnName: ATTR_COLUMN_NAME,
                    columnName: columnName,
                    className: classNames.join(' '),
                    height: height,
                    colspan: colSpanList[j],
                    rowspan: rowSpan,
                    title: columnModel.title,
                    btnSort: columnModel.sortable ? this.markupBtnSort : ''
                }));
            }, this);
        }, this);
        headerMarkupList = _.map(rowMarkupList, function(rowMarkup) {
            return '<tr>' + rowMarkup.join('') + '</tr>';
        });

        return headerMarkupList.join('');
    }
289025
function task () {
  run = true;
  var item = messages.shift();
  if (!item) {
    run = false;

  // 書き込み
  } else if ('message' in item) {
    if (output_) {
      write(item);
    } else {
      task();
    }

  // パスの変更
  } else if (item.path) {
    p_ = path.resolve(p_, item.path);
    task();

  // 出力のコントロール
  } else if ('output' in item) {
    output_ = item.output;
    task();

  } else {
    task();
  }
}