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 gzip | |
import json | |
import requests | |
try: | |
from cStringIO import StringIO | |
except: | |
from StringIO import StringIO | |
# Let's fetch the Common Crawl FAQ using the CC index | |
resp = requests.get('http://index.commoncrawl.org/CC-MAIN-2015-27-index?url=http%3A%2F%2Fcommoncrawl.org%2Ffaqs%2F&output=json') |
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 java.math.BigInteger; | |
class Factors { | |
public static void main (String [] args) | |
{ | |
// 157 bit n = pq with p ~= 78 bits | |
BigInteger n = new BigInteger("273966616513101251352941655302036077733021013991"); | |
// Set i to be p - 10e6 | |
BigInteger i = new BigInteger("496968652506233112158689"); |
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 torch | |
from cupy.cuda import function | |
from pynvrtc.compiler import Program | |
from collections import namedtuple | |
a = torch.randn(1,4,4).cuda() | |
b = torch.zeros(a.size()).cuda() | |
kernel = ''' | |
extern "C" |
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
{ | |
"Envelope" : { | |
"WARC-Header-Length" : "578", | |
"Block-Digest" : "sha1:YHKQUSBOS4CLYFEKQDVGJ457OAPD6IJO", | |
"Format" : "WARC", | |
"Actual-Content-Length" : "43428", | |
"WARC-Header-Metadata" : { | |
"WARC-Record-ID" : "<urn:uuid:ffbfb0c0-6456-42b0-af03-3867be6fc09f>", | |
"WARC-Warcinfo-ID" : "<urn:uuid:3169ca8e-39a6-42e9-a4e3-9f001f067bdf>", | |
"Content-Length" : "43428", |
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
# To run: python just_text.py > text | |
### | |
from glob import glob | |
# | |
import warc | |
# List any of the WARC files found in the data folder | |
warc_files = glob('data/*.wet.gz') | |
# Process each of the WARC files we found |
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
<meta name="description" content="How do you design a property so that it compliments its surrounding so perfectly that it's virtually invisible to the naked eye? 2014's Australian House of the Year did just that."/> | |
<link rel="canonical" href="http://www.realestate.com.au/blog/invisible-house-takes-australian-house-year-australian-house-year/" /> | |
<link rel="publisher" href="https://plus.google.com/+realestatecomau"/> | |
<meta property="og:locale" content="en_US" /> | |
<meta property="og:type" content="article" /> | |
<meta property="og:title" content="Australian house of the year is ... invisible?" /> | |
<meta property="og:description" content="How do you design a property so that it compliments its surrounding so perfectly that it's virtually invisible to the naked eye? 2014's Australian House of the Year did just that." /> | |
<meta property="og:url" content="http://www.realestate.com.au/blog/invisible-house-takes-australian-house-year-australian-house-year/" /> | |
<meta property="og:site_name" content="Th |
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
[0m [0m[1m[38;5;9mfn main() { | |
[0m [0m[1m[38;5;12mpush [0m rbp | |
[0m [0m[1m[38;5;12mmov [0m rbp, rsp | |
[0m [0m[1m[38;5;12mpush [0m r15 | |
[0m [0m[1m[38;5;12mpush [0m r14 | |
[0m [0m[1m[38;5;12mpush [0m r12 | |
[0m [0m[1m[38;5;12mpush [0m rbx | |
[0m [0m[1m[38;5;12msub [0m rsp, 3344 | |
[0m [0m[1m[38;5;9mlet mut rng = rand::thread_rng(); | |
[0m [0m[1m[38;5;12mcall [0m[1m[38;5;9m rand::rngs::thread::thread_rng |
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
# encoding=utf8 | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf8') | |
import re | |
number_match_re = re.compile(r'^([0-9]+[,.]?)+$') | |
number_split_re = re.compile(r'([,.])') |
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 requests | |
AUTH_TOKEN = 'xoxb-...' | |
channel = '#locked-out' | |
USER_ID = 'UDAS0J04S' # A user ID obtained by `list_members.py` | |
text = f'<@{USER_ID}>, Smerity locked himself out' | |
params = { | |
'token': AUTH_TOKEN, |
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 pprint | |
import requests | |
AUTH_TOKEN = 'xoxb-...' | |
params = {'token': AUTH_TOKEN} | |
r = requests.post('https://slack.com/api/users.list', params=params) | |
for member in r.json()['members']: |
NewerOlder