This file contains 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 numpy as np | |
from theano.sandbox.rng_mrg import MRG_RandomStreams | |
rng = MRG_RandomStreams(seed=1234) | |
mult = rng.multinomial(pvals=[[.3,.3,.3]]) | |
# Backup random state | |
rst = rng.rstate.copy() | |
rst_upd = [s[0].get_value() for s in rng.state_updates] |
This file contains 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
""" | |
## RESULTS ## | |
# Windows 8.1 + NTFS + SSD: | |
read_write 6.81500005722 | |
append 6.42299985886 | |
# LinuxMint 15 + ext4 witout journaling + HD | |
read_write 0.222398996353 | |
append 0.00950384140015 | |
""" |
This file contains 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 os | |
import requests | |
from bs4 import BeautifulSoup | |
class GSheet(object): | |
base_sheet_url = 'https://spreadsheets.google.com/feeds/worksheets/{0}/private/full' | |
list_worksheet_url = 'https://spreadsheets.google.com/feeds/list/{0}/{{}}/private/full' | |
cell_worksheet_url = 'https://spreadsheets.google.com/feeds/cells/{0}/{{}}/private/full' | |
HTTPheaders = {'content-type': 'application/atom+xml'} |
This file contains 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 __future__ import print_function | |
import re | |
import ijson.backends.yajl2 as ijson | |
with open("movies_rule_agent/actors.txt", "r") as f_actors: | |
actors = [re.sub(r'\n', '', entry).lower() for entry in f_actors.readlines()] | |
with open("movies_rule_agent/actor_qids.txt", "w") as f_actor_qids: | |
with open('wikidata_json_dump/latest-all.json', "r") as f_wiki: | |
for obj in ijson.items(f_wiki, 'item'): |
This file contains 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
#!/usr/bin/env python3 | |
# Dependencies python3 and dnspython | |
import os | |
import re | |
import sys | |
import csv | |
import time | |
import string | |
import random | |
import smtplib |
This file contains 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 | |
source scl_source enable devtoolset-3 |