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
*.aux | |
*.fdb_latexmk | |
*.log | |
*.fls |
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
# A priority queue-based, wheel-using incremental Sieve of Eratosthenes. | |
# See `The Genuine Sieve of Eratosthenes' by Melissa E. O'Neill | |
# (http://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf) | |
# for the Haskell incremental sieve which inspired this implementation | |
# (along with detailed analyses of performance of several Haskell | |
# sieves). | |
# | |
# Usage: | |
# Sieve() -> simple SoE | |
# Sieve(Wheel(4)) -> SoE + a wheel based on 4 initial primes |
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 re | |
import os | |
import ast | |
import glob | |
import collections | |
class ImportVisitor(ast.NodeVisitor): | |
def __init__(self): | |
self.imports = [] | |
self.modules = collections.defaultdict(list) |
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
Usage: pip wheel [OPTIONS] PACKAGE_NAMES... | |
Creates wheel archives from your requirements and place into ./wheels | |
(requires distribute>0.6.28 and wheel) | |
-w --wheel-dir <DIR> //alternative dir to place wheels into | |
--force-rebuild //rewrite existing wheels | |
--unpack-only <DIR> //unpack to dir, for manual building with "setup.py bdist_wheel" | |
-r, --requirement <FILENAME> | |
-f, --find-links <URL> |
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
''' | |
Problem solution | |
---------------- | |
The area of a circular ring is: | |
pi * (R^2 - r^2) | |
where R is the radius of the bigger circle and r | |
the radius of the other one. |
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
#!/bin/bash | |
# Configuration | |
root=/dev/sda3 | |
boot=/dev/sda1 | |
home=/dev/sda4 | |
lang=en_US-UTF-8 | |
keyboard=it | |
zone=Europe | |
subzone=Rome |
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 asyncio | |
@asyncio.coroutine | |
def waiting(r): | |
print("hello from waiting -", r) | |
yield from asyncio.sleep(2) | |
print("bye from waiting -", r) | |
return r | |
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
def render(digits): | |
'''This function converts its input, a string of decimal digits, into a | |
barcode, using the interleaved 2 of 5 format. The input string must not | |
contain an odd number of digits. The output is an SVG string. | |
Wikipedia [ITF Format]: http://en.wikipedia.org/wiki/Interleaved_2_of_5 | |
''' | |
top = '<svg height="58" width="{0}" style="background:white">' |
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 java.lang.Boolean; | |
import java.lang.Integer; | |
public class AtkinSieveArray { | |
static private int count(boolean[] buffer) { | |
int counter = 0; | |
for(int i = 2; i < buffer.length; ++i) { | |
if(buffer[i]) { | |
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
import abc | |
import re | |
import argparse | |
class ArgBaseError(Exception): pass | |
def _inject_vals(name, bases, dict): | |
expected_args = {} |
OlderNewer