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
class FizzBuzz: | |
def __init__(self): | |
self.current_number = 0 | |
def detect_multiple(self): | |
if (self.current_number % 3 == 0) and (self.current_number % 5 == 0): | |
return "FizzBuzz" | |
elif self.current_number % 3 == 0: |
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 sys | |
import math | |
import random | |
import collections | |
def democracy(number_of_candidates): | |
votes = [] | |
cntr = collections.Counter() |
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
.file "test_g++_flags_speedup.cpp" | |
.text | |
.section .rodata.str1.8,"aMS",@progbits,1 | |
.align 8 | |
.LC0: | |
.string "The billionth fibonacci number is: " | |
.section .text.startup,"ax",@progbits | |
.p2align 4,,15 | |
.globl main | |
.type main, @function |
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
.file "test_g++_flags_speedup.cpp" | |
.text | |
.section .rodata | |
.type _ZStL19piecewise_construct, @object | |
.size _ZStL19piecewise_construct, 1 | |
_ZStL19piecewise_construct: | |
.zero 1 | |
.local _ZStL8__ioinit | |
.comm _ZStL8__ioinit,1,1 | |
.align 8 |
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
#include <iostream> | |
using namespace std; | |
int main(){ | |
unsigned long long int last_number = 0; | |
unsigned long long int current_number = 1; | |
unsigned long long int currnum_buff = 0; |
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 time | |
import json | |
from typing import Union | |
from datetime import datetime | |
from argparse import ArgumentParser, Namespace | |
import tweepy |
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 urllib | |
import json | |
import twitter | |
import sqlite3 | |
import os | |
from HTMLParser import HTMLParser | |
import nltk | |
class Worker(object): |
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
# Given a square matrix of size N x N, calculate the absolute difference between the sums of its diagonals. | |
m_raw = input().strip() | |
m_order = int(m_raw.split("\n")[0]) | |
for _ in range(m_order): | |
m_raw += "\n"+input().strip() | |
m_trix = [list(map(int, x.strip().split())) for x in m_raw.split("\n")][1:] | |
print(abs(sum([(m_trix[x][x] - m_trix[x][-(x+1)]) for x in range(m_order)]))) |
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
# Keeps heroku free dyno from sleeping | |
# Runs from cron every 29 minutes | |
import requests | |
import gevent | |
from gevent import monkey | |
monkey.patch_all() | |
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
# Combat Computer Vision Syndrome using the 20-20-20 rule | |
# Every 20 minutes, spend 20 seconds looking at something 20 feet away, minimum. | |
# https://www.vsp.com/computer-vision-syndrome.html | |
# @timkofu, 2016 | |
import subprocess | |
import time | |
import sys |