ikkatsu : ikkatsuline+
763851
def parse_ikkatsu
      s0 = @current_pos
      s2 = parse_ikkatsu_line
      if s2 != :failed
        s1 = []
        while s2 != :failed
          s1 << s2
          s2 = parse_ikkatsu_line
        end
      else
        s1 = :failed
      end
      if s1 != :failed
        @reported_pos = s0
        s1 = -> (lines) do
          board = []
          9.times do |i|
            line = []
            9.times do |j|
              line << lines[j][8 - i]
            end
            board << line
          end
          { "preset" => "OTHER", "data" => { "board" => board } }
        end.call(s1)
      end
      s0 = s1
      s0
    end
695592
function f_tahta_teklif_idleri(_tahta_id) {
        return result.dbQ.smembers(result.kp.tahta.ssetTeklifleri(_tahta_id, true));
    }
31362
function ( root, el, selectList, idx ) {
            var currentSel = selectList[idx],//맨아래 조건
                nextIdx = idx + 1,
                nextSel = selectList[nextIdx],
                matchEl;
    
            if ( currentSel.type == 'parent' ) {
                matchEl = this.parent( el, nextSel.selector, root );
                //closest
            } else {
                matchEl = this.closest( el, nextSel.selector, root );
            }
    
            //검색결과가 있으면, 다음 조건 검색
            if ( matchEl ) {
                return (nextSel.type == 'first')? true : this.depthMatch( root, matchEl, selectList, nextIdx );
            } else {
                return false;
            }
        }
777325
function sequantial (target, listName) {

  /**
   * 各行に対して関数を呼び出します
   * @method forEach
   * @param  {Function} callback
   */
  target.forEach = function forEach (callback) {
    var list = [].slice.call(this[listName]);
    var len = list.length;
    for(var i = 0; i < len; i++) {
      callback(list[i], i, list);
    }
  };

  /**
   * すべての行に対して、真であるかを調査する
   * @method every
   * @param  {Function} callback
   * @return {Boolean}
   */
  target.every = function every (callback) {
    var list = [].slice.call(this[listName]);
    var len = list.length;
    for(var i = 0; i < len; i++) {
      if (!callback(list[i], i, list)) {
        return false;
      }
    }
    return true;
  };

  /**
   * いずれかの行に対して、真であるかを調査する
   * @method some
   * @param  {Function} callback
   * @return {Boolean}
   */
  target.some = function some (callback) {
    var list = [].slice.call(this[listName]);
    var len = list.length;
    for(var i = 0; i < len; i++) {
      if (callback(list[i], i, list)) {
        return true;
      }
    }
    return false;
  };

  /**
   * callbackを満たす行を配列で返す
   * @method filter
   * @param  {Function} callback
   * @return {Array}
   */
  target.filter = function filter (callback) {
    var list = [].slice.call(this[listName]);
    var len = list.length;
    var result = [];
    for(var i = 0; i < len; i++) {
      if (callback(list[i], i, list)) {
        result.push(list[i]);
      }
    }
    return result;
  };

  /**
   * 各行から新しい配列を作成します
   * @method map
   * @param  {Function} callback
   */
  target.map = function map (callback) {
    var list = [].slice.call(this[listName]);
    var len = list.length;
    var result = [];
    for(var i = 0; i < len; i++) {
      result.push(callback(list[i], i, list));
    }
    return result;
  };

  /**
   * 各行から値を計算します
   * @method reduce
   * @param  {Function} callback
   * @param  {Mixed}    initial
   * @return {Mixed}    result
   */
  target.reduce = function reduce (callback, initial) {
    var list = [].slice.call(this[listName]);
    var len = list.length;
    var value = initial;
    for(var i = 0; i < len; i++) {
      value = callback(value, list[i], i, list);
    }
    return value;
  };

  /**
   * 各行をインデックスの降順で値を計算します
   * @method reduceRight
   * @param  {Function} callback
   * @param  {Mixed}    initial
   * @return {Mixed}    result
   */
  target.reduceRight = function reduceRight (callback, initial) {
    var list = [].slice.call(this[listName]);
    var len = list.length;
    var value = initial;
    for(var i = len - 1; -1 < i; i--) {
      value = callback(value, list[i], i, list);
    }
    return value;
  };

}
519994
@Override
	public void complete(final LineReader reader, final ParsedLine line, final List<Candidate> candidates) {
		String buffer = line.line().substring(0, line.cursor());
		String[] parts = getLineParts(buffer);
		int len = parts.length;

		// コード補完する引数の番号を特定。
		int startArgNo = getStartArgNo(line);

		// 対象引数が-1、または開始引数にlenが満たない場合は該当なしなのでコード補完しない
		if (!accept(startArgNo, buffer, len)) {
			return;
		}

		String key = null;

		boolean isBlank = buffer.endsWith(" ");
		if (len == startArgNo && isBlank) {
			key = null;
		} else if (len == startArgNo + 1 && !isBlank) {
			key = parts[len - 1];
		} else {
			return;
		}

		final String keyword = key;

		Stream.of(SqlKeyword.values()).filter(k -> k.match(keyword))
				.forEach(k -> candidates.add(new Candidate(k.toString().toLowerCase())));
	}
143427
function(cell1,cell2){
		if(!cell1.room || !cell2.room || cell1.room===cell2.room){ return;}
		var merged, keep;
		var tcell1 = cell1.room.top;
		var tcell2 = cell2.room.top;
		if(tcell1.bx>tcell2.bx || (tcell1.bx===tcell2.bx && tcell1.by>tcell2.by)){ merged = tcell1; keep = tcell2;}
		else                                                                     { merged = tcell2; keep = tcell1;}

		// 消える部屋のほうの数字を消す
		if(merged.isNum()){
			// 数字が消える部屋にしかない場合 -> 残るほうに移動させる
			if(keep.noNum()){
				keep.setQnum(merged.qnum);
				keep.draw();
			}
			merged.setQnum(-1);
			merged.draw();
		}
	}
1074773
function (e) {
                    var evt = {
                        _event: e,			//실제 이벤트 객체
                        type: originToCrossType( e.type ),
                        target: e.target,
                        currentTarget: e.currentTarget,
                        relatedTarget: e.relatedTarget,
                        eventPhase: e.eventPhase,
                        //마우스 좌표
                        layerX: e.layerX, layerY: e.layerX,//파폭
                        clientX: e.clientX, clientY: e.clientY,
                        pageX: e.pageX, pageY: e.pageY,
                        offsetX: e.offsetX, offsetY: e.offsetY,
                        screenX: e.screenX, screenY: e.screenY,
                        shiftKey: e.shiftKey, charCode: e.charCode,
                        altKey: e.altKey,
                        ctrlKey: e.ctrlKey,
                        //이벤트 관리 함수
                        stopPropagation: function () { if (this._event) this._event.stopPropagation(); },
                        preventDefault: function () { if (this._event) this._event.preventDefault(); },
                        //mousewheel
                        delta: 0,
                        data: e.customData || data
                    };
    
                    /*
                     mousewheel delta
                     trace( 'detail:' + e.detail );//FF, Oprera
                     trace( 'wheelDelta:' + e.wheelDelta );//IE, Chrome, Safari, Opera
                     */
                    if ( e.wheelDelta ) {
                        evt.delta = e.wheelDelta / 120;
                    } else if ( e.detail ) {
                        evt.delta = -e.detail / 3;
                    }
    
                    handler.call( el, evt );
                }
639060
function(){
		var loopcount = 0;

		while(1){
			var Rdeg = ((Math.random() * 384)|0)-64; if(Rdeg<0){Rdeg=0;} if(Rdeg>255){Rdeg=255;}
			var Gdeg = ((Math.random() * 384)|0)-64; if(Gdeg<0){Gdeg=0;} if(Gdeg>255){Gdeg=255;}
			var Bdeg = ((Math.random() * 384)|0)-64; if(Bdeg<0){Bdeg=0;} if(Bdeg>255){Bdeg=255;}

			// HLSの各組成値を求める
			var Cmax = Math.max(Rdeg,Math.max(Gdeg,Bdeg));
			var Cmin = Math.min(Rdeg,Math.min(Gdeg,Bdeg));

			var Hdeg = 0;
			var Ldeg = (Cmax+Cmin)*0.5 / 255;
			var Sdeg = (Cmax===Cmin?0:(Cmax-Cmin)/((Ldeg<=0.5)?(Cmax+Cmin):(2*255-Cmax-Cmin)) );

			if(Cmax===Cmin){ Hdeg = 0;}
			else if(Rdeg>=Gdeg && Rdeg>=Bdeg){ Hdeg = (    60*(Gdeg-Bdeg)/(Cmax-Cmin)+360)%360;}
			else if(Gdeg>=Rdeg && Gdeg>=Bdeg){ Hdeg = (120+60*(Bdeg-Rdeg)/(Cmax-Cmin)+360)%360;}
			else if(Bdeg>=Gdeg && Bdeg>=Rdeg){ Hdeg = (240+60*(Rdeg-Gdeg)/(Cmax-Cmin)+360)%360;}

			// YCbCrのYを求める
			var Ydeg = (0.29891*Rdeg + 0.58661*Gdeg + 0.11448*Bdeg) / 255;

			if( (this.minYdeg<Ydeg && Ydeg<this.maxYdeg) && (Math.abs(this.lastYdeg-Ydeg)>0.15) && (Sdeg<0.02 || 0.40<Sdeg) &&
				 (((360+this.lastHdeg-Hdeg)%360>=45)&&((360+this.lastHdeg-Hdeg)%360<=315)) ){
				this.lastHdeg = Hdeg;
				this.lastYdeg = Ydeg;
				//alert("rgb("+Rdeg+", "+Gdeg+", "+Bdeg+")\nHLS("+(Hdeg|0)+", "+(""+((Ldeg*1000)|0)*0.001).slice(0,5)+", "+(""+((Sdeg*1000|0))*0.001).slice(0,5)+")\nY("+(""+((Ydeg*1000)|0)*0.001).slice(0,5)+")");
				return "rgb("+Rdeg+","+Gdeg+","+Bdeg+")";
			}

			loopcount++;
			if(loopcount>100){ return "rgb("+Rdeg+","+Gdeg+","+Bdeg+")";}
		}
	}
943733
function reporter(context) {
    let { Syntax, RuleError, report, fixer, getSource } = context;
    return {
        [Syntax.Str](node) {
            if (!isUserWrittenNode(node, context)) {
                return;
            }
            const text = getSource(node);
            // 全角同士の間は半角スペースを入れない
            const matchReg = rx`${japaneseRegExp}( )${japaneseRegExp}`;
            const katakakana = /[ァ-ヶ]( )[ァ-ヶ]/;
            matchAll(text, matchReg).forEach(match => {
                const { input, captureGroups } = match;
                // ただしカタカナ複合語の場合を除きます。
                if (katakakana.test(input)) {
                    return;
                }
                captureGroups.forEach(captureGroup => {
                    const index = captureGroup.index;
                    report(
                        node,
                        new RuleError("原則として、全角文字どうしの間にスペースを入れません。", {
                            index: index,
                            fix: fixer.replaceTextRange([index, index + 1], "")
                        })
                    );
                });
            });
        }
    };
}
265409
function(x, y, isSmooth) {
                //顶点
                this.vertex = new ShapePoint(x, y);
                //控制点
                this.forward = new ShapePoint(x, y);
                this.backward = new ShapePoint(x, y);
                //是否平滑
                this.setSmooth(isSmooth === undefined || isSmooth);
                this.setSymReflaction(true);
            }
851174
def create(max=false)
#      puts "create"
#      repo.commits('master', max).each{|a|
#        p "** commit **"
#        a.diffs.each{|d|
#          p "- diff -"
#          p d
#        }
#      }

      #experimental
      # commitsが最新順に並んでいる前提で書かれている
      # a_pathがあってb_blobがないものは削除されているので除外できる
      summaries = repo.commits('master', max).select{|c|
        c.diffs.first != nil
      }.uniq{|c|
        c.diffs.first.a_path
      }.select{|c|
        c.diffs.first.b_blob
      }.map{|c|
        create_markdown_body(c).summary
      }
      @summary_file.write(summaries)
      summaries
    end
696812
function setKokuminNoKyujitu(year, holidays) {
  if (year < 1988) {
    return;
  }
  var kokumin = [];
  var last = null;
  Object.keys(holidays).forEach(md => {
    var date = new Date(year, md.slice(0, -2) * 1 - 1, md.slice(-2) * 1);
    if (last){
      last.setTime(last.getTime() + A_DAY);
      if (last.getTime() + A_DAY === date.getTime()) {
        kokumin.push((last.getMonth() + 1) * 100 + last.getDate());
      }
    }
    last = date;
  });
  // 他の祝日や振替休日が優先される
  kokumin.forEach(x => holidays[x] = holidays[x] || '国民の休日');
}
798157
function(iscount, type, code){ // type = 0:違う 1:numより小さい 2:numより大きい
		for(var c=0;c<this.board.cell.length;c++){
			var cell = this.board.cell[c];
			if(!cell.isValidNum()){ continue;}
			var num = cell.getNum(), count=cell.countDir4Cell(iscount);
			if((type===0 && num===count) || (type===1 && num<=count) || (type===2 && num>=count)){ continue;}
			
			this.failcode.add(code);
			if(this.checkOnly){ break;}
			cell.seterr(1);
		}
	}
362792
function f_teklifleri(tahta_id, ihale_id) {
        var defer = result.dbQ.Q.defer();

        //ihaleye bağlı teklifleri bul
        result.rc.multi()
            .sinterstore("temp_ihale_teklif", result.kp.ihale.ssetTeklifleri(ihale_id), result.kp.tahta.ssetTeklifleri(tahta_id, true))
            .smembers("temp_ihale_teklif")
            .expire("temp_ihale_teklif", 10)
            .exec(function (err, replies) {
                l.info("MULTI REPLY" + JSON.stringify(replies));

                if (replies[1] && replies[1].length > 0) {
                    defer.resolve(replies[1]);

                } else {
                    defer.resolve(null);
                }
            });

        return defer.promise;
    }
1204187
public static void main(String[] args) 
    throws NoSuchAlgorithmException, IOException, InvalidKeyException, XmlPullParserException {
    try {
      /* play.min.io for test and development. */
      MinioClient minioClient = new MinioClient("https://play.min.io:9000", "Q3AM3UQ867SPQQA43P2F",
                                                "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");

      /* Amazon S3: */
      // MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID",
      // 
      
      // Create some content for the object.
      StringBuilder builder = new StringBuilder();
      for (int i = 0; i < 10; i++) {
        builder.append("Sphinx of black quartz, judge my vow: Used by Adobe InDesign to display font samples. ");
        builder.append("(29 letters)\n");
        builder.append("Jackdaws love my big sphinx of quartz: Similarly, used by Windows XP for some fonts. ");
        builder.append("(31 letters)\n");
        builder.append("Pack my box with five dozen liquor jugs: According to Wikipedia, this one is used on ");
        builder.append("NASAs Space Shuttle. (32 letters)\n");
        builder.append("The quick onyx goblin jumps over the lazy dwarf: Flavor text from an Unhinged Magic Card. ");
        builder.append("(39 letters)\n");
        builder.append("How razorback-jumping frogs can level six piqued gymnasts!: Not going to win any brevity ");
        builder.append("awards at 49 letters long, but old-time Mac users may recognize it.\n");
        builder.append("Cozy lummox gives smart squid who asks for job pen: A 41-letter tester sentence for Mac ");
        builder.append("computers after System 7.\n");
        builder.append("A few others we like: Amazingly few discotheques provide jukeboxes; Now fax quiz Jack! my ");
        builder.append("brave ghost pled; Watch Jeopardy!, Alex Trebeks fun TV quiz game.\n");
        builder.append("---\n");
      }

      // Create a InputStream for object upload.
      ByteArrayInputStream bais = new ByteArrayInputStream(builder.toString().getBytes("UTF-8"));

      Map<String,String> myContext = new HashMap<>();
      myContext.put("key1","value1");
      // To test SSE-KMS
      ServerSideEncryption sse = ServerSideEncryption.withManagedKeys("Key-Id", myContext);

      minioClient.putObject("my-bucketname", "my-objectname", bais, bais.available(), sse);
            
      bais.close();

      System.out.println("my-objectname is encrypted and uploaded successfully.");
        
    } catch (MinioException e) {
      System.out.println("Error occurred: " + e);
    }
  }
1335643
function ( target, propSet ) {
        var get_prop = {},
            cName = $B.string.camelCase( propSet.name ),
            value, valueSet;

        get_prop.name = propSet.name;

        if ( cName == 'scrollTop' ) {
            value = $B( target ).scrollTop();
        } else if ( cName == 'scrollLeft' ) {
            value = $B( target ).scrollLeft();
        } else {
            value = $B( target ).css( get_prop.name );
        }

        if ( value == 'transparent' || value == 'auto' || value == undefined ) {
            throw new Error( '[ixBand] TweenCSS의 대상의 Style "' + get_prop.name + '"가 설정되어 있지않아 Tween 실행불가!' );
        }

        if ( typeof value === 'number' ) value = String(value);

        valueSet = $B.style.parseValue( value );
        get_prop.value = valueSet.value;
        get_prop.unit = valueSet.unit;

        return get_prop;
    }
68349
function toEmoji(node) {
  var value = toString(node)
  var info = (shortcodes[value] || emoticons[value] || {}).emoji

  if (info) {
    node.value = info
  }
}