Skip to content

Instantly share code, notes, and snippets.

View torao's full-sized avatar
🤒
stacked

Torao Takami torao

🤒
stacked
View GitHub Profile
@gcardone
gcardone / ConfidenceIntervalApp.java
Last active March 31, 2024 13:13
How to calculate confidence interval for means with unknown standard deviation using the Student t distribution. Needs Apache Commons Math library.
import org.apache.commons.math3.distribution.TDistribution;
import org.apache.commons.math3.exception.MathIllegalArgumentException;
import org.apache.commons.math3.stat.descriptive.SummaryStatistics;
public class ConfidenceIntervalApp {
public static void main(String args[]) {
// data we want to evaluate: average height of 30 one year old male and female toddlers
// interestingly, at this age height is not bimodal yet
double data[] = new double[] { 63.5, 81.3, 88.9, 63.5, 76.2, 67.3, 66.0, 64.8, 74.9, 81.3, 76.2, 72.4, 76.2, 81.3, 71.1, 80.0, 73.7, 74.9, 76.2, 86.4, 73.7, 81.3, 68.6, 71.1, 83.8, 71.1, 68.6, 81.3, 73.7, 74.9 };
@owainlewis
owainlewis / java7.yml
Created July 24, 2013 10:45
Install Java 7 with Ansible on Ubuntu Linux
---
- name: ensure required packages are installed for Java 7
apt: name=$item state=latest update_cache=yes
with_items:
- python-software-properties
- name: Add Java repository to sources
action: apt_repository repo='ppa:webupd8team/java'
@qnighy
qnighy / rust-patterns.md
Last active March 20, 2024 03:33
Rustのパターンっぽいやつメモ

パターンとはその言語が抽象化できなかった敗北の歴史である。 しかしどんなに優れた言語であってもあらゆる繰り返しに勝てるわけではない。 人は必ずメタ繰り返しを欲するからだ。 そしてそれはRustも例外ではない。

ここでは、OOPでも知られているパターンよりも、Rustに特有のパターンを思いつく限りまとめてみた。名前は適当。

  • crate splitting
    • でかいcrateを分割して、見通しを良くする・再コンパイルの分量を削減する・並列コンパイルを可能にする
  • 親玉crate(全てにdependする)と殿crate(全てにdependされる)があることが多いので、だいたい束みたいな形になる。