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 datetime | |
################################################################### | |
# | |
# Showing the way bits, difficulty, target, and hash work together. | |
# | |
################################################################### | |
print "Calculating target from bits, verifying the block's hash is valid, and verify the calculated difficulty." |
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
#!/bin/bash | |
port=$1 | |
if [ -z "$port" ] #if port isn't assigned | |
then | |
echo Need to specify port number | |
exit 1 | |
fi |
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 requests | |
from bs4 import BeautifulSoup | |
import os, json | |
base_url = "http://api.genius.com" | |
headers = {'Authorization': 'Bearer GENIUS_API_BEARER_STRING'} | |
artist_names = ["Fleet Foxes"] | |
def artist_id_from_song_api_path(song_api_path, artist_name): |
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 sys | |
import json | |
from collections import defaultdict | |
def parse_list_based_json(data): | |
out = {} | |
for index, value in enumerate(data[0]): | |
out[value] =[row[index] for row in data[1:]] | |
return out |
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
from bs4 import BeautifulSoup | |
import unicodedata | |
import matplotlib.mlab as mlab | |
import matplotlib.pyplot as plt | |
from scipy.stats import norm | |
class Prize: | |
def __init__(self, name, age, year, prize_type, description): | |
self.name = unicodedata.normalize('NFKD', name).encode('ascii','ignore') #umlaut issues | |
self.age = age |
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 csv | |
import numpy as np | |
points_label = "Points" | |
lineup_label = "Lineup" | |
players = set() | |
num_lineups = 0 | |
with open('outcome.csv', 'rb') as csvfile: | |
rows = csv.reader(csvfile) |
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 nltk | |
import string | |
import requests | |
import operator | |
import re | |
import logging | |
from collections import defaultdict | |
pattern = '[A-Z][^A-Z]*' |
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 nltk | |
import string | |
import pprint | |
import requests | |
import operator | |
import re | |
import logging | |
from collections import defaultdict | |
FREEBASE_API_KEY = '' |
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 nltk | |
import requests | |
FREEBASE_API_KEY = '' | |
class FindNames(object): | |
def __init__(self, text, freebase_api_key): | |
self.text = text | |
self.key = freebase_api_key |
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
(ns gb-or-syria.core | |
(:use [boilerpipe-clj.core] | |
[opennlp.nlp] | |
[opennlp.treebank] | |
[clojure.pprint :only [pprint]] | |
[opennlp.tools.filters] | |
[clojure.set] | |
[clojure.string :only [split-lines]] | |
[stemmer.snowball]) | |
(:gen-class)) |
NewerOlder