Skip to content

Instantly share code, notes, and snippets.

running build_ext
creating build/temp.macosx-10.12-x86_64-3.5
checking if libyaml is compilable
/usr/bin/clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/local/include -I/opt/local/Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m -c build/temp.macosx-10.12-x86_64-3.5/check_libyaml.c -o build/temp.macosx-10.12-x86_64-3.5/check_libyaml.o
checking if libyaml is linkable
/usr/bin/clang build/temp.macosx-10.12-x86_64-3.5/check_libyaml.o -lyaml -o build/temp.macosx-10.12-x86_64-3.5/check_libyaml
ld: library not found for -lyaml
clang: error: linker command failed with exit code 1 (use -v to see invocation)
libyaml is not found or a linker error: forcing --without-libyaml
@anddam
anddam / inline.py
Last active November 1, 2016 09:47
# The idea is from http://i.imgur.com/iVLQKSW.jpg
def sequence(n):
value, past = 0, set()
for c in range(n):
t = value - c
value = t if (t > 0 and t not in past) else (value + c)
past.add(value)
from random import random
from math import sqrt
"""Generate coordinates for set of two random points in the [0, 1] square plane"""
def four_randoms():
return (random() for __ in range(4))
# Use yield to create an iterator
def coordinates(limit=10):
def josephus_problem_iterate(soldiers):
"Iterative solution to Josephus' problem"
while len(soldiers) > 1:
start = 2 if len(soldiers) % 2 else 0
soldiers = soldiers[start::2]
return soldiers
def garble_text(text):
'''Somehow garble text, swaps
a <=> z, b <=> y, c <=> x, etc
'''
replace_string = 'abcdefghijklm nopqrstuvwxyz'
replace_dict = {key: value for key, value in zip(replace_string, reversed(replace_string))}
result = ''
for char in text:
(vai) me@bibook ~> pip --verbose install vai
Collecting vai
1 location(s) to search for versions of vai:
* https://pypi.python.org/simple/vai/
Getting page https://pypi.python.org/simple/vai/
Looking up "https://pypi.python.org/simple/vai/" in the cache
Current age based on date: 238
Freshness lifetime from max-age: 600
Freshness lifetime from request max-age: 600
me@bibook ~> diskutil eraseVolume fat32 NO\ NAME disk2s1
Started erase on disk2s1 NO NAME
Unmounting disk
Erasing
Error: -69877: Couldn't open device
me@bibook ~> man diskutil
me@bibook ~> sudo diskutil eraseVolume fat32 NO\ NAME disk2s1
Started erase on disk2s1 NO NAME
Unmounting disk
Erasing
~> locale -a
af_ZA
af_ZA.ISO8859-1
af_ZA.ISO8859-15
af_ZA.UTF-8
am_ET
am_ET.UTF-8
be_BY
be_BY.CP1131
be_BY.CP1251
class Anomaly1(models.Model):
"Kind of anomaly that only brings its name"
name = models.CharField(max_length=10)
class Anomaly2(models.Model):
"Kind of anomaly that only brings a numeric value and no name"
intensity = models.FloatField()
@anddam
anddam / shell.out
Last active October 15, 2016 17:20
root@remora:/# sgdisk --print /dev/sda
Disk /dev/sda: 625142448 sectors, 298.1 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 1432CDE6-FAD3-403E-AAA7-7FECBA39D723
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 625142414
Partitions will be aligned on 2048-sector boundaries
Total free space is 199277 sectors (97.3 MiB)
Number Start (sector) End (sector) Size Code Name