Skip to content

Instantly share code, notes, and snippets.

View link_lists.py
@inytar
inytar / egyption_fractions.py
Created Jan 17, 2017
Hank & Pieter egyption fractions
View egyption_fractions.py
def decompose(n):
# your code
num, _, den = n.partition('/')
if not den:
den = 1
if '.' in num:
pred, _, postd = num.partition('.')
num = int(pred) * 10**(len(postd))
num += int(postd)
den *= 10**(len(postd))
@inytar
inytar / Hamming numbers
Created Jan 10, 2017
Hamming numbers solution by Ben & Pieter for 2017-01-10
View Hamming numbers
data = []
def hamming(n):
return data[n - 1]
def calc_hamming(i, j, k):
return 2**i * 3**j * 5**k
for i in range(50):
for j in range(50):
View Graphs 2016_12_16.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View database.py
#! python3
# coding: utf-8
import argparse
import collections
from http.server import BaseHTTPRequestHandler
from http.server import HTTPServer
import json
from urllib import parse
@inytar
inytar / image_mangler.py
Created Aug 1, 2016
Script that mangles images by switching color comparable spots in the image.
View image_mangler.py
#! python3
# coding: utf-8
"""Script to mangle images.
This script mangles images by switching color comparable spots in the image.
This script uses the pillow python package.
"""
from __future__ import print_function