This file contains hidden or 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
import json | |
import urllib2 | |
import sys | |
def internet_on(): | |
try: | |
response=urllib2.urlopen('http://173.194.204.105',timeout=1) | |
return True | |
except urllib2.URLError as err: pass | |
return False |
This file contains hidden or 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 class NiceColors | |
{ | |
public static int colorPos = 0; | |
//use golden ratio to create pleasant colors | |
//http://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/ | |
public static Color betterNiceColor() | |
{ | |
double goldenRatioConj = (1.0 + Math.sqrt(5.0)) / 2.0; | |
float hue = new Random().nextFloat(); | |
This file contains hidden or 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
import java.math.BigInteger; //http://docs.oracle.com/javase/6/docs/api/java/math/BigInteger.html | |
public class Prob17 | |
{ | |
public static BigInteger oneHundred = new BigInteger("100"); | |
public static BigInteger oneThousand = new BigInteger("1000"); | |
public static BigInteger tenThousand = new BigInteger("10000"); | |
public static BigInteger oneMillion = new BigInteger("1000000"); | |
public static void main(String[] args) |
NewerOlder