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
#!/bin/sh | |
PARENT="origin/dev" | |
clang_format=$(which clang-format || (echo "could not find clang-format!"; return 1)) | |
diff_files=$(git diff --name-only $PARENT) | |
diff_cc_files=$(find $diff_files -name "*.cc" -or -name "*.c" -or -name "*.h") | |
if [[ -z "$diff_cc_files" ]]; then | |
return 0; |
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
#include <tiledb/tiledb> | |
#include <iostream> | |
#include <limits> | |
#include <iomanip> | |
std::string array_path("/tmp/test_cc"); | |
std::string array_path2("/tmp/test_cc_2"); | |
std::string attr_name("a"); |
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
julia> function pointer_field(p::Ptr{T}, sym) where T | |
idx = findfirst(s -> s==sym, fieldnames(T)) | |
ptype = fieldtypes(T)[idx] | |
unsafe_load(Ptr{ptype}(Ptr{UInt8}(p) + fieldoffset(T, idx))) | |
end | |
pointer_field (generic function with 1 method) | |
julia> | |
julia> struct X |
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 gzip, shutil | |
# inverted from the python gzip docs | |
def gunzip(f): | |
with gzip.open(f, 'rb') as gzip_in, open(f[0:f.find('.gz')], 'wb') as f_out: | |
shutil.copyfileobj(gzip_in, f_out) |
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
#!/bin/sh | |
# pull the listing | |
wget http://mirror.centos.org/centos/6/sclo/x86_64/rh/devtoolset-3/ | |
# yank the hrefs | |
egrep -o 'href=\"(.*\.rpm)"' index.html | cut -d \" -f2 > rpm.list | |
# download them | |
for f in `cat rpm.list`; |
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
#!/usr/bin/python | |
# usage: | |
# > cmake --trace > foo | |
# > cmake_prof.py foo | |
# Return a sorted list of (hitcount, line) for lines in a given file | |
# dramatically faster than running `sort | uniq` on large files. |
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 vtk, os | |
from glob import glob | |
def exp_tubes(fname): | |
rdr = vtk.vtkPolyDataReader() | |
rdr.SetFileName(fname) | |
pd = rdr.GetOutputPort() | |
tf = vtk.vtkTubeFilter() | |
tf.SetInputConnection(pd) | |
tf.SetNumberOfSides(6) |
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
const FS = Base.Filesystem | |
const regex = r"^((?!//))(#include\s+)(<|\")(\S+)(>|\")\s+" | |
function get_includes(dir, prefix, exclude="") | |
includes = Dict{String,String}() | |
for path in readlines(`bash -c "find $dir -name $prefix*.h -not -path $exclude"`) | |
(bp,h) = FS.splitdir(path) | |
bp = replace(bp, dir*"/", "") | |
if haskey(includes, h) |
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
begin | |
# assuming pwd is a julia git clone | |
vers = ["v0.2.0", "v0.3.0", "v0.4.0", "v0.5.0", "release-0.6"] | |
auths = Dict{String, Vector{String}}() | |
for v in vers | |
auths[v] = unique(map(chomp, readlines(`git log --format=%aN $v`))) | |
end | |
for i in 2:length(vers) | |
v1,v2 = vers[i-1],vers[i] | |
diff = setdiff(auths[v2], auths[v1]) |
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://app.assembla.com/spaces/slicerrt/subversion/source/HEAD/trunk/SlicerRt/data/eclipse-8.1.20-phantom-prostate/Original/RP.1.2.246.352.71.5.2088656855.377401.20110920153647.dcm?_format=raw |