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
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"This is a test notebook!\n" | |
] | |
}, | |
{ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/usr/bin/python | |
""" | |
Author: Jeremy M. Stober | |
Program: GP.PY | |
Date: Thursday, July 17 2008 | |
Description: Example of Gaussian Process Regression. | |
""" | |
from numpy import * | |
import pylab |
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 chunk(n, nchunks): | |
"""Return a list of slices that divide an array into approximately nparts.""" | |
d = n / nchunks | |
r = n - nchunks * d | |
indices = range(0,(d+1)*r,d+1) + range((d+1)*r, n+d, d) | |
indices[-1] = None | |
a,b = tee(indices) | |
next(b,None) | |
return izip(a,b) |
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 re | |
import unicodedata | |
def slugify(value): | |
""" | |
Converts to lowercase, removes non-word characters (alphanumerics and | |
underscores) and converts spaces to hyphens. Also strips leading and | |
trailing whitespace. | |
""" |
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
#!/usr/bin/env python | |
''' | |
@author jstober | |
''' | |
def test_static(static=[0]): | |
static[0] += 1 | |
return static[0] | |
print test_static() # 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
import sublime, sublime_plugin | |
class UnSplitPaneCommand(sublime_plugin.WindowCommand): | |
def run(self): | |
if self.window.num_groups() == 2: | |
for view in self.window.views_in_group(1): | |
#TODO check modified? | |
self.window.focus_view(view) | |
self.window.run_command('close_file') |
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 sublime_plugin,sublime | |
class SplitPaneCommand(sublime_plugin.WindowCommand): | |
def run(self): | |
if self.window.num_groups() == 1: | |
self.window.run_command('set_layout', | |
{ | |
"cols": [0.0, 0.5, 1.0], | |
"rows": [0.0, 1.0], | |
"cells": [[0, 0, 1, 1], [1, 0, 2, 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
import sublime, sublime_plugin | |
class FilePathCommand(sublime_plugin.TextCommand): | |
""" Show the full file path in the status bar. """ | |
def run(self, args): | |
sublime.status_message(self.view.file_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
""" | |
Things I hate about Python. | |
""" | |
import distutils | |
try: | |
print distutils.sysconfig.get_python_lib() | |
except: | |
print "Failed call!" |
NewerOlder