Skip to content

Instantly share code, notes, and snippets.

View glennklockwood's full-sized avatar

Glenn K. Lockwood glennklockwood

View GitHub Profile
@glennklockwood
glennklockwood / defaultpath-solaris10.sh
Created July 23, 2015 01:56
Script for setting up PATH on Solaris 10
# Built user paths in two parts
# Most important paths get prefixed in order of (least important) -> (most)
for dir in ~/bin
do
check=`expr "$PATH" : ".*:${dir}:.*" + \
"$PATH" : "${dir}:.*" + \
"$PATH" : ".*${dir}$"`
if [ $check = 0 ]
then
@glennklockwood
glennklockwood / openmp-parallel-inner-loop.c
Created April 9, 2015 00:46
Parallelizing only the innermost loop with OpenMP
#include <stdio.h>
#include <time.h>
#include <omp.h>
int main ( void ) {
int i, j;
int me, n;
#pragma omp parallel private(i,j,me,n)
{
@glennklockwood
glennklockwood / analyzecoord-new.py
Created February 3, 2014 21:22
analyzecoord, New Version by Paul Davis
#!/usr/bin/env python2
import re
import sys
SHOW = """
Siloxane SiO4 Si3O SiO3
SiO2 SiO1 NBO FreeOH
H2O H3O SiOH SiOH2 Si2OH
@glennklockwood
glennklockwood / analyzecoord-new.pl
Created February 3, 2014 21:20
analyzecoord, New Version by gnustavo
#!/usr/bin/env perl
use utf8;
use strict;
use warnings;
my @show = qw/Siloxane SiO4 Si3O SiO3 SiO2 SiO1 NBO FreeOH H2O H3O SiOH SiOH2 Si2OH/;
my %type;
@type{@show} = (0) x @show;
@glennklockwood
glennklockwood / analyzcoord.py
Last active August 29, 2015 13:56
analyzecoord, Original Python Implementation
#!/usr/bin/env python2
import fileinput
import re
show = [ "Siloxane", "SiO4", "Si3O", "SiO3", \
"SiO2", "SiO1", "NBO", "FreeOH", \
"H2O", "H3O", "SiOH", "SiOH2", "Si2OH" ]
def printargs( counts, isave ):
@glennklockwood
glennklockwood / analyzecoord.pl
Last active August 29, 2015 13:56
analyzecoord, Original Perl Implementation
#!/usr/bin/perl
@show = qw/ Siloxane SiO4 Si3O SiO3 SiO2 SiO1 NBO FreeOH H2O H3O SiOH SiOH2 Si2OH/;
printf("\n%-8.8s ", "ird");
foreach $specie ( @show )
{
printf("%8.8s ", $specie);
}
print "\n";