Skip to content

Instantly share code, notes, and snippets.

@elswit
elswit / gist:4dfc27c485d9a58fb324cf3c154ce59b
Last active January 24, 2024 10:05
Using MPI on Rlogin
  1. Use your credentials to ssh into rlogin.cs.vt.edu

ssh user@rlogin.cs.vt.edu

  1. Load openmpi module to get acces to mpi compilers

module add mpi/openmpi-x86_64

  1. Create/edit your MPI program. You can use vim to edit your files in the terminal. Here we will use vim mpiTest.c and type in a simple hello world example:
@elswit
elswit / gist:927db7dd71b0b6a001147c43d54a1260
Created August 6, 2018 20:25
Convert solve solutions to global vars in mathematica
rl = {a -> 2 , b -> 3 }
ReplaceAll[rl, Rule -> Set]
Put[{a, b}, "~/alaky.txt"]
MapThread[SetDelayed, {Keys[rl] , Values[rl]}]
find . -type f -exec mogrify -thumbnail 400x {} \;
mogrify -quality '80' -format png **/*.pdf
# Grep GIs from synthetic sample
grep -o "GI=[0-9]*," ShortReadsForAssembelly_Large.fna | grep -o "[0-9]*" | sort | uniq | wc -l
# lookup TaxID from Gi
gawk '$1==158 {print $1" " $2;exit;}' gi_taxid_nucl.dmp
gawk '$2 == 155978' gi_taxid_nucl.dmp
sed -i -e "s/gi|/ /g" desire-100bp-454-100kReads.txt
@elswit
elswit / Euler.java
Created December 16, 2013 06:53
Interaction between ArrayList, Char Array and String
ArrayList<Character> array =new ArrayList();
ArrayList currentWindow=new ArrayList();
for (int i=0;i<str.length();i++){
if (str.charAt(i)!='\n')
array.add(str.charAt(i));
}
int maxProduct=1;
int whereIsMax=0;
for (int i=0;i<5;i++)