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
// http://apple.stackexchange.com/questions/6707/how-to-stop-os-x-from-writing-spotlight-and-trash-files-to-memory-cards-and-usb | |
mdutil -i off /Volumes/yourUSBstick | |
cd /Volumes/yourUSBstick | |
rm -rf .{,_.}{fseventsd,Spotlight-V*,Trashes} | |
mkdir .fseventsd | |
touch .fseventsd/no_log .metadata_never_index .Trashes | |
cd - |
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 non_linear_parameters_95_percent_confidence_interval(fvec, jac): | |
"""Returns the 95% confidence interval on parameters from | |
non-linear fit results.""" | |
# residual sum of squares | |
rss = np.sum(fvec**2) | |
# number of data points and parameters | |
n, p = jac.shape | |
# the statistical degrees of freedom | |
nmp = n - p | |
# mean residual error |
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 pandas as pd | |
from sklearn.preprocessing import MultiLabelBinarizer | |
# Feature-list data frame | |
df = pd.DataFrame(columns = ["features"], index=['Item 1', 'Item 2']) | |
df['features'] = [["A", "B"], ["C", "D"]] | |
# Use scikits-learn to create feature matrix and feature names | |
mlb = MultiLabelBinarizer() | |
feature_column_name = 'features' |
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
from tables import * | |
# Isolated the copying logic | |
def append_column(table, group, name, column): | |
"""Returns a copy of `table` with an empty `column` appended named `name`.""" | |
description = table.description._v_colObjects.copy() | |
description[name] = column | |
copy = Table(group, table.name+"_copy", description) | |
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 numpy as np | |
def magnitude(vector): | |
return np.sqrt(np.dot(np.array(vector),np.array(vector))) | |
def norm(vector): | |
return np.array(vector)/magnitude(np.array(vector)) | |
def lineRayIntersectionPoint(rayOrigin, rayDirection, point1, point2): | |
""" |
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
extension Array { | |
mutating func removeObject<U: Equatable>(object: U) { | |
var index: Int? | |
for (idx, objectToCompare) in enumerate(self) { | |
if let to = objectToCompare as? U { | |
if object == to { | |
index = idx | |
} | |
} | |
} |
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
daniel@DJF2:~/dev/git/odes*development$ rm -rf build/ | |
daniel@DJF2:~/dev/git/odes*development$ python setup.py install | |
============================================= | |
parent package is scikits | |
top path is /Users/daniel/dev/git/odes | |
============================================= | |
lapack_opt_info: | |
FOUND: | |
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate'] | |
define_macros = [('NO_ATLAS_INFO', 3)] |
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
from fipy import * | |
import numpy as np | |
""" | |
This script illustrates a failure with the finite volume method for an elliptical problem on a non-uniform mesh. | |
For more information see the question and answer here, | |
http://scicomp.stackexchange.com/questions/8577/peculiar-error-when-solving-the-poisson-equation-on-a-non-uniform-mesh-1d-only | |
""" | |
def fipy_step_charge(): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.