I hereby claim:
- I am ivgiuliani on github.
- I am kratorius (https://keybase.io/kratorius) on keybase.
- I have a public key whose fingerprint is 979F 957D A898 C9C1 36C5 2C1D 0766 1FBC FBC9 72D6
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env python | |
import sys | |
def embed(content_iter, title=None): | |
if title: | |
sys.stdout.write("<%s>\n" % title) | |
for line in content_iter: | |
sys.stdout.write(line) | |
if title: | |
sys.stdout.write("</%s>\n" % title) |
Check that your CPU supports hardware virtualization:
egrep –c ‘(vmx|svm)’ /proc/cpuinfo
Check if your processor supports kvm:
sudo apt-get install cpu-checher
tuborg:~ $ kvm-ok
INFO: /dev/kvm exists
import colorsys | |
def color_interpolation(colorpoints, steps, use_hsv=True): | |
"""Generates a color sequence interpolating through color points. | |
Iterates from/to each given color point in the number of steps specified. | |
For example, if `colorpoints` is [A, B, C] and `steps` is [3, 10], this | |
function will generate a list of 13 color points in the RGB spectrum, with | |
the first 3 points representing colors going from color A to color B | |
(so basically color A, some intermediate gradient, and color B) and the |
import sys | |
""" | |
This is my take at solving this interview question: | |
You are working on a crossword, and become fixated with one of the words. | |
You have some of its letters figured out so far, but not all of them. E.g.: | |
"A.GO...H." | |
That, and a dictionary, are your inputs. | |
Your output must be the set of words that are plausible solutions. |
#!/usr/bin/env python | |
""" | |
Given a list of stopwords and a simple text file, this script | |
extracts bigrams. Example: | |
./bigrams.py nietzsche-zarathustra.txt | |
great: ['noontide'] | |
petty: ['people'] | |
love: ['thee'] | |
voluntary: ['beggar'] |