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
# Requirements: | |
# pip install statsmodel pandas numpy scipy | |
from statsmodels.stats import proportion as prop | |
def demo(num_clicks, num_impressions): | |
alpha = 0.05 | |
methods = [ |
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 org.apache.commons.math3.stat.interval; | |
import org.apache.commons.math3.distribution.FDistribution; | |
import org.apache.commons.math3.exception.NotPositiveException; | |
import org.apache.commons.math3.exception.NotStrictlyPositiveException; | |
import org.apache.commons.math3.exception.NumberIsTooLargeException; | |
import org.apache.commons.math3.exception.OutOfRangeException; | |
/** | |
* numberOfSuccesses が 0 もしくは numberOfTrials と等しい場合でも、 |
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 verticalcode; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class VerticalCode { | |
private static final int BLOCK_BYTES = 1; | |
private static final int BLOCK_SIZE = BLOCK_BYTES * 8; |
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.io; | |
import java.io.BufferedReader; | |
import java.io.Closeable; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.Stack; | |
/** |
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 hoge; | |
import java.util.Calendar; | |
import java.util.Date; | |
import java.util.Iterator; | |
import java.util.NoSuchElementException; | |
public class Fuga { | |
public static Iterable<Date> iterableDays(Date from, Date to) { | |
final Date localFrom = from; |
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 hoge; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.NoSuchElementException; | |
import java.util.Stack; | |
public interface Retrievable<T extends Retrievable> extends Iterable<T> { | |
List<T> children(); | |
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
#--- | |
# child.sh | |
echo "export MESSAGE=hello" | |
#--- | |
# parent.sh | |
`sh child.sh` |
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 -*- | |
require 'MeCab' | |
class MeCabTagger | |
class MeCabNode | |
def initialize(node, charset) | |
@node = node | |
@feature = node.feature.force_encoding(charset).split(',') | |
@charset = charset |
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 helpers; | |
import java.util.Collections; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.NoSuchElementException; | |
import play.db.jpa.GenericModel.JPAQuery; | |
/** |
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
public static List<String> tokenize(String str) { | |
if (str == null || str.isEmpty()) { | |
return Collections.emptyList(); | |
} | |
ArrayList<String> tokens = new ArrayList<String>(); | |
int i = 0; | |
char[] chars = str.toCharArray(); | |
while (i < chars.length) { |