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 argparse | |
| from PIL import Image, ImageDraw, ImageFilter, ImageEnhance | |
| class AsciiArt: | |
| char_map = " `'\".,:;i!~-+]{|1\\rxucoz6?UCL0O*#W&B@$$" | |
| def __init__(self, filename, resolution=None): | |
| # loading image |
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 urllib3.exceptions import InsecureRequestWarning | |
| requests.packages.urllib3.disable_warnings(InsecureRequestWarning) | |
| words = [] | |
| with open('p.txt', 'r') as f: | |
| for line in f: | |
| words = [word for word in line.split()] |
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 <stdio.h> | |
| #include <string.h> | |
| #include <ctype.h> | |
| #define BUFFERSIZE 256 | |
| #define PP_TOKEN 290 | |
| #define MM_TOKEN 291 | |
| #define OR_TOKEN 292 |
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 <iostream> | |
| #include <vector> | |
| #include <algorithm> | |
| using namespace std; | |
| typedef pair<int, int> pii; | |
| const int epochs = 300000, MAXN = 5100, MAXM = 50; | |
| bool mark[MAXN][MAXM]; |
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 time | |
| from itertools import permutations | |
| from math import sqrt | |
| def exhaustive(n, points): | |
| min_distance = float("inf") | |
| solution = [] | |
| for perm in permutations(range(1, n)): | |
| perm = list(perm) |
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 numpy | |
| from scipy import misc | |
| from matplotlib import pylab as mat_plot | |
| import matplotlib.cm as mat_cm | |
| from sklearn.multiclass import OneVsRestClassifier | |
| from sklearn.linear_model import LogisticRegression | |
| # b. Loading Matrices | |
| train_labels, X = [], [] |