This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Apriori algorithm の実装です | |
# | |
# http://en.wikipedia.org/wiki/Apriori_algorithm の擬似コードと | |
# http://www.codeproject.com/Articles/70371/Apriori-Algorithm を | |
# 参考にしています | |
require 'set' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package biz.k11i.demo; | |
import java.lang.management.GarbageCollectorMXBean; | |
import java.lang.management.ManagementFactory; | |
import java.util.List; | |
import java.util.regex.Pattern; | |
public class StringSplitDemo { | |
public static void main(String[] args) { | |
if (args.length < 2) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package demo.twitter4j; | |
import twitter4j.Twitter; | |
import twitter4j.TwitterException; | |
import twitter4j.TwitterFactory; | |
import twitter4j.auth.Authorization; | |
import twitter4j.conf.ConfigurationBuilder; | |
import twitter4j.internal.http.HttpRequest; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"token_type":"bearer","access_token":"ここにトークンが設定される"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* なるべく精度を保ちつつ加算する機能を提供します。 | |
* <p> | |
* 情報落ちを回避する仕組みを備えています。 | |
* </p> | |
* | |
* @author KOMIYA Atsushi | |
*/ | |
public class AccurateAdder { | |
/** sum より大きな値を一時的に蓄積するバッファのサイズです */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Properties; | |
import java.util.concurrent.ArrayBlockingQueue; | |
import java.util.concurrent.BlockingQueue; | |
import java.util.concurrent.LinkedBlockingDeque; | |
/** | |
* ArrayBlockingQueue クラスと LinkedBlockingQueue クラスの性能を比較するデモプログラムです。 | |
* | |
* @author KOMIYA Atsushi | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
command comp.size time[sec] | |
--------------------------------------- | |
gzip -9 3,851,823 1.00 | |
zopfli -i5 3,683,337 28.04 | |
zopfli -i10 3,674,622 37.57 | |
zopfli -i15 3,673,627 46.77 | |
zopfli -i25 3,672,377 65.90 | |
zopfli -i50 3,671,837 115.22 | |
zopfli -i100 3,671,506 210.78 | |
zopfli -i250 3,670,590 496.03 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import commands | |
import sys | |
latest_node = commands.getoutput("hg head --template '{node}'") | |
file_statuses = commands.getoutput("hg status --all --rev %(latest_node)s" % { "latest_node": latest_node }) | |
file_status_list = file_statuses.split('\n') | |
latest_files = [x[2:] for x in file_status_list if len(x) >= 3 and x[0] != "A" and x[0] != " "] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'arow' | |
model = AROW::Model.new(2, 0.1) | |
File.foreach("CodeIQ_auth.txt") do |line| | |
elems = line.chomp.split(/\s/) | |
next if elems.size < 3 | |
features = { 0 => elems[0].to_f, 1 => elems[1].to_f } | |
label = (elems[2] == "1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* TFJ-726 reproducing code. | |
*/ | |
import org.junit.Assert; | |
import org.junit.Test; | |
import twitter4j.*; | |
public class GetUserListStatusesPagingCountTest { | |
@Test | |
public void pagingCountDosentWork() throws TwitterException { |