Skip to content

Instantly share code, notes, and snippets.

View jpoetker's full-sized avatar

Jeff Poetker jpoetker

  • dotloop
  • Cincinnati, OH
View GitHub Profile
@jpoetker
jpoetker / R.java
Created February 12, 2012 20:49
Emebdly R
import java.math.BigDecimal;
public class R {
public static BigDecimal factorial(BigDecimal n) {
if (n.equals(BigDecimal.ONE)) {
return BigDecimal.ONE;
}
return n.multiply(factorial(n.subtract(BigDecimal.ONE)));
@jpoetker
jpoetker / Zipf.java
Created February 12, 2012 20:48
Embedly Zipf
public class Zipf {
public static void main(String args[]) {
long totalWords = 0;
for(int i=1; i<=900; i++) {
totalWords += 2520/i;
}
System.out.println("Total words in text: " + totalWords);