Skip to content

Instantly share code, notes, and snippets.

View gresrun's full-sized avatar

Greg Haines gresrun

  • YouTube
  • San Francisco, CA
View GitHub Profile
@gresrun
gresrun / redisBitSetTests.java
Created May 23, 2012 03:41 — forked from gmuller/redisBitSetTests.java
An attempt to understand byte and bit ordering in redis bitsets
import java.util.Arrays;
import java.util.BitSet;
import redis.clients.jedis.Jedis;
public class SieveOfEratosthenes {
/**
* @param args
*/
function isPrime(n) {
if (n<2) return false;
if (n==2) return true;
for (var i=2; i<(n/2); i++) { if (n%i==0) return false; }
return true;
}