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/bash | |
#Show help and exit | |
if [ $# -eq 0 ] || [ $1 == "-h" ] || [ $1 == "--help" ]; | |
then | |
echo "Usage: vl [OPTION] [FILE]..." | |
echo "Open vim for FILEs with automatic layouts." | |
echo "OPTION:" | |
echo -e " -t, --tabbed \t open 2 FILEs per tab, splitting each tab vertically" | |
echo -e " -H, --htabbed \t open 2 FILEs per tab, splitting each tab horizontally" |
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
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') | |
" let Vundle manage Vundle, required |
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 open_custombox() | |
{ | |
var modal_settings = $(this).data("modal"); | |
if (typeof(modal_settings) === 'string') | |
{ | |
Custombox.open({ | |
target: modal_settings | |
}); | |
} | |
else if(typeof(modal_settings) === 'object') |
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
'''========================================================================= | |
Program: Visualization Toolkit | |
Module: vtk1DGaussianTransferFunction.cxx (Python version) | |
Converted to Python by Mohammad A.Raji ([email protected]) | |
Copyright (c) Ken Martin, Schroeder, Lorensen | |
All rights reserved. | |
See Copyright.txt or http:#www.kitware.com/Copyright.htm for details. |
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 seto(x, width, height): | |
c = GaussianControlPointList() | |
p = GaussianControlPoint() | |
p.x = x | |
p.width = width | |
p.height = height | |
c.AddControlPoints(p) | |
v = GetPlotOptions() | |
v.SetOpacityControlPoints(c) | |
SetPlotOptions(v) |
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 seto(x, width, height): | |
c = GaussianControlPointList() | |
p = GaussianControlPoint() | |
p.x = x | |
p.width = width | |
p.height = height | |
c.AddControlPoints(p) | |
v = GetPlotOptions() | |
v.SetOpacityControlPoints(c) | |
SetPlotOptions(v) |
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
#for isabel | |
import itertools | |
def set_annotation_attributes(): | |
# Logging for SetAnnotationObjectOptions is not implemented yet. | |
AnnotationAtts = AnnotationAttributes() | |
AnnotationAtts.axes2D.visible = 0 | |
AnnotationAtts.axes2D.autoSetTicks = 1 | |
AnnotationAtts.axes2D.autoSetScaling = 1 | |
AnnotationAtts.axes2D.lineWidth = 0 | |
AnnotationAtts.axes2D.tickLocation = AnnotationAtts.axes2D.Outside # Inside, Outside, Both |
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
# In case you need byte arrays | |
import numpy as np | |
a = np.uint64(7640891576956014592) #64 bits | |
b = a.tostring() # '\x00\xd0\xbc\xf3g\xe6\tj' in bytes | |
b = bytearray(b) # bytearray(b'\x00\xd0\xbc\xf3g\xe6\tj') Byte array object | |
# Padding | |
a = [1, 1, 1, 1, 1] | |
a + [0] * (16 - len(a)) # [1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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
#!/usr/bin/python | |
import numpy as np | |
import sys | |
sys.path.append('/home/mohammad/Downloads/visit2_10_0.linux-x86_64/2.10.0/linux-x86_64/lib/site-packages') | |
import vtk | |
from vtk.util.vtkConstants import * |
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/env python | |
import numpy as np | |
def getDegree(ref_id, grid_list): | |
results = np.zeros(grid_list[0].shape) | |
for i, grid in enumerate(grid_list): | |
results += (grid_list[ref_id] == grid) | |
return results / float(len(grid_list)) * 100 |
OlderNewer