Skip to content

Instantly share code, notes, and snippets.

@EmilHernvall
EmilHernvall / wordcount.java
Created May 3, 2011 17:15
Find the most popular words in a file - Java version
import java.io.*;
import java.util.*;
public class wordcount
{
public static class Word implements Comparable<Word>
{
String word;
int count;
@think49
think49 / Array.prototype.shuffle.txt
Created January 28, 2011 14:24
array-shuffle.js : "Fisher–Yates shuffle"
----------------------
Fisher–Yates shuffle
----------------------
* Fisher and Yates' original method
1. Write down the numbers from 1 to N.
2. Pick a random number k between one and the number of unstruck numbers remaining (inclusive).
3. Counting from the low end, strike out the kth number not yet struck out, and write it down elsewhere.
4. Repeat from step 2 until all the numbers have been struck out.