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 as bs | |
from StringIO import StringIO | |
import gzip | |
import urllib2 | |
import os | |
s = bs(gzip.GzipFile(fileobj=StringIO(urllib2.urlopen("http://kickass.to/search/game%20of%20thrones/?from=opensearch").read())).read()) | |
magnet = s.find_all('table')[1].find_all('tr')[1].find_all('a')[3]['href'] | |
os.system('start "" "%s"' % magnet) |
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 as bs | |
from StringIO import StringIO | |
import gzip | |
import urllib2 | |
import os | |
s = bs(gzip.GzipFile(fileobj=StringIO(urllib2.urlopen("http://kickass.to/search/game%20of%20thrones/?from=opensearch").read())).read()) | |
magnet = s.find_all('table')[1].find_all('tr')[1].find_all('a')[3]['href'] | |
print magnet |
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
✔ C++ templates @done (13-06-16 13:03) | |
✔ C++ typecasting @done (13-06-16 15:53) | |
✔ C function pointers @done (13-06-16 23:27) | |
✔ int * x and int (*x) or whatever that was @done (13-06-16 23:44) | |
☐ practice writing the "big three" | |
☐ implement class tuple | |
☐ ADA | |
☐ basic DS | |
☐ one height balanced tree | |
☐ |
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
#include <cstdio> | |
#include <cmath> | |
#include <cstring> | |
#include <ctime> | |
#include <iostream> | |
#include <algorithm> | |
#include <set> | |
#include <map> | |
#include <vector> | |
#include <sstream> |
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 math import sqrt | |
from itertools import count | |
from collections import defaultdict | |
# Sieve of Eratosthenes | |
# Modified from the Code by David Eppstein, UC Irvine, 28 Feb 2002 | |
# http://code.activestate.com/recipes/117119/ | |
def prime_candidates(begin=5, end=None): | |
"""Returns all prime candidates between begin and end(>=begin and <end). If end is None, it behaves like end = infinity. A prime candidate is either 2, 3 or a number of the form 6k-1 or 6k+1. |
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 collections | |
users = [] | |
def train(filename="trainingdata.txt"): | |
global users | |
tweeters = {} | |
first = True | |
f = open(filename) |
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 re | |
from collections import * | |
from itertools import * | |
class Prob: | |
users = [] | |
def __init__(self, probs=None): | |
if probs is None: |
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
Show hidden characters
{ | |
"auto_upgrade_last_run": null, | |
"installed_packages": | |
[ | |
"Alignment", | |
"All Autocomplete", | |
"Calculate", | |
"Case Conversion", | |
"Clipboard Manager", | |
"Codechef", |
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
@echo off | |
:: BatchGotAdmin | |
:------------------------------------- | |
REM --> Check for permissions | |
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" | |
REM --> If error flag set, we do not have admin. | |
if '%errorlevel%' NEQ '0' ( | |
echo Requesting administrative privileges... |
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
01-14 19:31:16.699: E/HostsActivity(6922): Usage: mount [-r] [-w] [-o options] [-t type] device directory |