The use of __main__.py to create executables
myprojectfolder/
|_ __main__.py
|_ __init__.py
Being __main__.py:
print("Hello")
The use of __main__.py to create executables
myprojectfolder/
|_ __main__.py
|_ __init__.py
Being __main__.py:
print("Hello")
$/
artifacts/
build/
docs/
lib/
packages/
samples/
src/
tests/
| # -*- coding: utf-8 -*- | |
| """ | |
| Builds epub book out of Paul Graham's essays: http://paulgraham.com/articles.html | |
| Author: Ola Sitarska <[email protected]> | |
| Copyright: Licensed under the GPL-3 (http://www.gnu.org/licenses/gpl-3.0.html) | |
| This script requires python-epub-library: http://code.google.com/p/python-epub-builder/ | |
| """ |
| BUILD_DIR := gen | |
| # pandoc is a handy tool for converting between numerous text formats: | |
| # http://johnmacfarlane.net/pandoc/installing.html | |
| PANDOC := pandoc | |
| # pandoc options | |
| # Liberation fonts: http://en.wikipedia.org/wiki/Liberation_fonts | |
| PANDOC_PDF_OPTS := --toc --chapters --base-header-level=1 --number-sections --template=virsto_doc.tex --variable mainfont="Liberation Serif" --variable sansfont="Liberation Sans" --variable monofont="Liberation Mono" --variable fontsize=12pt --variable documentclass=book | |
| PANDOC_EBOOK_OPTS := --toc --epub-stylesheet=epub.css --epub-cover-image=cover.jpg --base-header-level=1 |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This article is now published on my website: Prefer Subshells for Context.
| #!/bin/sh | |
| # | |
| # Shell script that configures gnome-terminal to use solarized theme | |
| # colors. Written for Ubuntu 11.10, untested on anything else. | |
| # | |
| # Solarized theme: http://ethanschoonover.com/solarized | |
| # | |
| # Adapted from these sources: | |
| # https://gist.github.com/1280177 | |
| # http://xorcode.com/guides/solarized-vim-eclipse-ubuntu/ |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.25.0"></script> | |
| <script type="text/javascript" src="http://mbostock.github.com/d3/d3.time.js?1.25.0"></script> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
| </head> | |
| <body> | |
| <div id="chart"></div> |