This file contains hidden or 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
| sudo apt-get install build-essential cmake libreadline-dev libssl-dev libncurses5-dev libffi-dev zlib1g-dev libpcre3-dev libpng12-dev libjpeg62-dev python-dev libpng12-dev libjpeg62-dev libmysqlclient-dev libmemcached-dev libtokyocabinet-dev libsqlite3-dev libdbi-dev libpq-dev libgmp3-dev libogg-dev libvorbis-dev libtaglib-cil-dev libtag1-dev libtheora-dev libsamplerate0-dev libloudmouth1-dev libsndfile1-dev libflac-dev libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libxmu-dev libxi-dev libxml2-dev libyajl-dev uuid-dev liblzo2-dev zlib1g-dev | |
| sudo apt-get install libevent-dev | |
| sudo apt-get install libtiff5-dev |
This file contains hidden or 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
| ( | | |
| parent* = traits clonable. | |
| balance<-0. | |
| {'Category: transfer' | |
| deposit: amount = ( balance: balance + amount ). | |
| withdraw: = ( | :amount | balance: 0 max: balance - amount ). | |
| } | |
| | ) |
This file contains hidden or 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
| ; -*- mode: lisp; mode: paredit -*- | |
| (defmacro defattrs [klass-name | |
| &optional [super-klasses []] [options []] [attrs []] | |
| &rest body] | |
| `(do | |
| (import attr) | |
| (with-decorator ~(if options `(attr.s ~@options) 'attr.s) | |
| (defclass ~klass-name ~super-klasses | |
| ~(list (interleave |
This file contains hidden or 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
| # flake8: noqa | |
| import regex | |
| import collections | |
| from typing import NamedTuple | |
| class OrderedClassMembers(type): | |
| @classmethod |
This file contains hidden or 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 entropy # pip install entropy | |
| from collections import namedtuple | |
| MIN_ENTROPY = 0.5 | |
| MIN_LENGTH = 140 | |
| S = namedtuple('S', 'text entropy') | |
| def read_entropic(prompt='', min_entropy=MIN_ENTROPY, min_length=MIN_LENGTH): | |
| s = '' |
This file contains hidden or 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 Account(balance): | |
| ret = None | |
| while True: | |
| # receive message | |
| selector, *args = yield ret | |
| # dispatch | |
| if selector == 'withdraw': |
This file contains hidden or 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
| Transcript clear; cr; show: 'Updating Zinc...'; cr. | |
| Metacello new | |
| repository: 'github://svenvc/zinc/repository'; | |
| baseline: 'ZincHTTPComponents'; | |
| load. | |
| Transcript cr; show: 'Installing Seaside...'; cr. | |
| Metacello new |
This file contains hidden or 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
| myColl := 1 to: 20. | |
| [ :job | | |
| myColl | |
| do: [ :e | | |
| job | |
| progress: e / myColl size; | |
| title: 'waiting ' , e asString. | |
| (Delay forSeconds: 0.5) wait ] ] asJob run |
This file contains hidden or 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
| | seq | | |
| seq := OrderedCollection with: 1 with: 1. | |
| 1 to: 1000 do: [ :n | | |
| seq add: (seq last * ((4 * n) + 2)) / (n + 2)]. | |
| seq |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.