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
| # версия скалы в консоле sbt по-умолчанию | |
| ~/.sbt/0.13/global.sbt: scalaVersion := "2.11.8" |
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
| # 300 раз генерим эмпирические среднии выборок размера 100 из N(0, 9) | |
| x = replicate(300, mean(rnorm(100, 0, 9))) |
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
| (function() { | |
| var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m; | |
| var FN_ARG_SPLIT = /,/; | |
| var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/; | |
| var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; | |
| function annotate(fn) { | |
| var $inject, | |
| fnText, |
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
| """ | |
| Dispatch based on string matching | |
| """ |
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 contextlib | |
| import time | |
| import sys | |
| @contextlib.contextmanager | |
| def timer(): | |
| stat = lambda: None | |
| start = time.time() | |
| yield stat |
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
| # -*- coding: utf-8 -*- | |
| """Simple echo server for educational purposes. | |
| Based directly on python interface to Linux epoll mechanism. | |
| Uses greenlets. | |
| """ | |
| import socket | |
| import select | |
| import errno | |
| from greenlet import greenlet |
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
| # -*- coding: utf-8 -*- | |
| """Simple tcp server for educational purposes. | |
| Based directly on python interface to Linux epoll mechanism. | |
| Uses vanilla plain callback style. | |
| """ | |
| import socket | |
| import select | |
| import errno | |
| from functools import partial |