{{ message }}

Instantly share code, notes, and snippets.

🎯
Focusing

# Maksim Koltsov tirinox

🎯
Focusing
Last active Nov 3, 2018
View perspective_terminal.py
 # Prints pseudo 3D image in ASCII import shutil c, r = shutil.get_terminal_size() print(''.join(('*' if (j-c/2) % (i+1) == 1 else '-' if 4*r/(i+1)%2==0 else ' ') for i in range(r) for j in range(c)), end='')
Created Nov 4, 2018
View example_defaultdict.py
 text = """ We develop a methodology for automatically analyzing text to aid in discriminating firms that encounter catastrophic financial events. The dictionaries we create from Management Discussion and Analysis Sections (MD&A) of 10-Ks discriminate fraudulent from non-fraudulent firms 75% of the time and bankrupt from nonbankrupt firms 80% of the time. Our results compare favorably with quantitative prediction methods. We further test for complementarities by merging quantitative data with text data. We achieve our best prediction results for both bankruptcy (83.87%) and fraud (81.97%) with the combined data, showing that that the text of the MD&A complements the quantitative financial information. """
Last active Nov 24, 2018
View xo_naive_ai.py
 import random from flask import Flask, request class Game: X = 'X' O = 'O' N = ' ' def __init__(self, size=3, to_win=3):
Created Nov 24, 2018
 import random from flask import Flask, request class Game: X = 'X' O = 'O' N = ' ' def __init__(self, size=3, to_win=3):
Created Dec 5, 2018
View christmas_tree.py
 import random class ASCIICanvas: def __init__(self, w=50, h=100): assert 0 < w < 1000 and 0 < h < 1000 self.w = w self.h = h self.buffer = [] self.clear()
Created Jan 28, 2019
 # this is Radix sort prove of O(n) time complexity import random import matplotlib.pyplot as plt import time def radix_sort(a_list, radix=10): max_length_achieved = False tmp, placement = -1, 1
Created Mar 9, 2019
View sort_operator.py
 import operator class Item: def __init__(self, name, price, qty): self.name = name self.price = price self.qty = qty def total_cost(self):
Created Mar 28, 2019