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
| var hasFlash = navigator.mimeTypes&&navigator.mimeTypes.length?Array.prototype.slice.call(navigator.mimeTypes).some(function(a){return"application/x-shockwave-flash"==a.type}):/MSIE/.test(navigator.userAgent)?eval("try{new ActiveXObject('ShockwaveFlash.ShockwaveFlash')&&!0}catch(e){!1};"):!1; |
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
| /^Author:/ { | |
| author = $2 | |
| commits[author] += 1 | |
| commits["tot"] += 1 | |
| } | |
| /^[0-9]/ { | |
| more[author] += $1 | |
| less[author] += $2 | |
| file[author] += 1 |
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
| body{ | |
| color:#444; | |
| font-family:Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', | |
| "Hiragino Sans GB", "STXihei", "微软雅黑", serif; | |
| font-size:12px; | |
| line-height:1.5em; | |
| background:#fefefe; | |
| width: 45em; | |
| margin: 10px auto; | |
| padding: 1em; |
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 os | |
| import inspect | |
| from functools import wraps | |
| _file_cache = {} | |
| def cache_file(path): | |
| def cache_is_fresh(name): |
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
| assertion_methods = [ | |
| 'assert_almost_equal(s)' | |
| 'assert_dict_contains_subset', | |
| 'assert_dict_equal', | |
| 'assert_equal(s)', | |
| 'assert_false', | |
| 'assert_greater', | |
| 'assert_greater_equal', | |
| 'assert_in', | |
| 'assert_is', |
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 func(arg1, arg2): | |
| """ | |
| Summary. | |
| Long explanation... | |
| :param arg1: Descr for arg1 | |
| :type arg1: arg1 type | |
| :param arg2: Descr for arg2 |
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
| #!/bin/bash | |
| # Git pre-commit hook | |
| ##################### | |
| # | |
| # - check for whitespace problems (trailing spaces, ...) | |
| # - check for lines with 'FIXME' | |
| # - running tests | |
| # - running code style check (pep8) on modified files | |
| # - designed for Windows, for Linux replace `> NUL` with `> /dev/null` |
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
| MOV [5] 0 | |
| JEQ 90 [5] 100 | |
| APRINT 46 | |
| MOV [8] 0 | |
| RANDOM [6] | |
| MOV [2] [6] | |
| MOV [3] 2 | |
| MOV [1] 25 | |
| JMP 125 | |
| MOV [6] [0] |
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
| try: | |
| from pip.req import parse_requirements | |
| except ImportError: | |
| def requirements(f): | |
| reqs = open(f, 'r').read().splitlines() | |
| reqs = [r for r in reqs if not r.strip().startswith('#')] | |
| return reqs | |
| else: | |
| def requirements(f): | |
| install_reqs = parse_requirements(f) |
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 fourier_series(f, frange, t, t_0): | |
| k = symbols('k', integer=True, positive=True, zero=False) | |
| a_k = 2/t_0*(integrate(f * cos(2*pi/t_0*k*t), [t, frange[0], frange[1]])) | |
| a_k = [a_k.subs(k, i) for i in range(1, 10)] | |
| b_k = 2/t_0*(integrate(f * sin(2*pi/t_0*k*t), [t, -t_0/2, t_0/2])) | |
| b_k = [b_k.subs(k, i) for i in range(1, 10)] | |
| # Amplitude |
OlderNewer