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 sys | |
import os | |
import subprocess | |
import argparse | |
import platform | |
def link(source, dest): | |
if not os.path.exists(source): | |
print("--- directory to be linked: {} does not exist".format(source)) |
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
"""Detect whether a Windows exe or dll is a 32 or 64bit executable. | |
Port of the perl script given by Paul Dixon on a Stack Overflow answer [1]_ | |
.. [1] http://stackoverflow.com/a/495305/40056 | |
""" | |
import sys | |
import os | |
from struct import unpack |
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
function condalist -d 'List conda environments.' | |
for dir in (ls $HOME/anaconda/envs) | |
echo $dir | |
end | |
end | |
function condactivate -d 'Activate a conda environment' -a cenv | |
if test -z $cenv | |
echo 'Usage: condactivate <env name>' | |
return 1 |
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
https://www.quora.com/Object-Oriented-Programming/Was-object-oriented-programming-a-failure/answer/Michael-O-Church | |
No, not a failure. It's the worst kind of success. | |
Alexander Stepanov's complaint is blistering and accurate. If you read Types and Programming Languages, you get a sense for just how much complexity objects add to your world. OOP, as commonly envisioned, doesn't play well with static or dynamic typing. | |
Is OOP a failure? Well, what is it? I've heard OOP given about 12 definitions, all credible in some core way, but many conflicting. Like "Scrum", it's too all over the place to justify a closed-form, final opinion. It's either highly beneficial or loathsome depending on which interpretation one uses. There's good OOP and bad OOP. This should be no surprise: in the anti-intellectual world of mainstream business software, it's mostly bad OOP. (For "Scrum", there's the same sad story.) | |
Separation of implementation and interface is a clear win. That's not limited to OO languages, of course. Ha |
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 numpy as np | |
a = np.arange(0., 1.0, .1) | |
b = np.arange(0., 1.0, .1) | |
# modify 3 values to have differences | |
b[5:8] *= 1.1 | |
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
C/C++ COMPILER OPTIONS | |
-OPTIMIZATION- | |
/O1 minimize space /O2 maximize speed | |
/Ob<n> inline expansion (default n=0) /Od disable optimizations (default) | |
/Og enable global optimization /Oi[-] enable intrinsic functions | |
/Os favor code space /Ot favor code speed | |
/Ox maximum optimizations /Oy[-] enable frame pointer omission |
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 test file:///Users/sevas/PycharmProjects/gulbis/doc/build/html/test_attributes.html file:///Users/sevas/PycharmProjects/gulbis/doc/build/html/test_attributes.html file:///Users/sevas/PycharmProjects/gulbis/doc/build/html/test_attributes.html | |
[nosetests] | |
verbosity=3 | |
with-doctest=1 | |
doctest-tests=1 |
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 copytree(src, dst, symlinks=False, ignore=None): | |
if not os.path.exists(dst): | |
os.makedirs(dst) | |
for item in os.listdir(src): | |
s = os.path.join(src, item) | |
d = os.path.join(dst, item) | |
if os.path.isdir(s): | |
copytree(s, d, symlinks, ignore) | |
else: | |
if not os.path.exists(d) or os.stat(src).st_mtime - os.stat(dst).st_mtime > 1: |
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
Show hidden characters
{ | |
"color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme", | |
"font_face": "Source Code Pro", | |
"font_size": 11.0, | |
"highlight_modified_tabs": true, | |
"theme": "Soda Dark.sublime-theme", | |
"trim_trailing_white_space_on_save": true, | |
"word_separators": "./\\()\"'-:,.;<>~!@#%^&*|+=[]{}`~?", | |
"tab_size": 4, | |
"scroll_past_end": true, |
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
"""Color output plugin for the nose testing framework. | |
Use ``nosetests --with-color`` (no "u"!) to turn it on. | |
http://en.wikipedia.org/wiki/Rudolph_the_Red-Nosed_Reindeer | |
"Rudolph the Red-Nosed Reindeer" is a popular Christmas story about Santa | |
Claus' ninth and lead reindeer who possesses an unusually red colored nose that | |
gives off its own light that is powerful enough to illuminate the team's path | |
through inclement weather. |
NewerOlder