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 <iostream> | |
#include <vector> | |
int main(int, char* []) { | |
std::vector<int> a(10000000, 10); | |
std::vector<int> b; | |
b.reserve(10000000); | |
b.insert(b.end(), a.begin(), a.end()); | |
} |
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 | |
BUILD_TYPE="release" | |
PROGRAM_LABEL="" | |
for arg in $@ | |
do | |
if [[ $arg = debug ]] | |
then | |
BUILD_TYPE="debug" | |
elif [[ $arg = profil* ]] |
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 re | |
import dendropy as dpy | |
BEAST_NODE_INFO_PATTERN = re.compile(r'(.+?)=({.+?,.+?}|.+?)(,|$)') | |
BEAST_SUMMARY_TREE_NODE_FIELDS = [ | |
'height', | |
'height_median', |
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 dendropy | |
from dendropy import treesplit | |
from dendropy.interop import paup | |
trees = dendropy.TreeList.get_from_path('smallwt.nex', 'nexus') | |
taxa = trees.taxon_set | |
tax_labels, bipartitions, bipartition_counts, bipartition_freqs = paup.bipartitions("weightedtrees.taxa.nex", "weightedtrees.nex", use_tree_weights=True) | |
split_dists_paup = paup.build_split_distribution(bipartition_counts, |
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 | |
if [[ -z $1 ]] | |
then | |
if [[ -z $VIMRUNTIME ]] | |
then | |
VIMRUNTIME=$HOME/.vim | |
fi | |
else | |
VIMRUNTIME="$1" |
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 | |
############################################################################### | |
## | |
## Copyright 2011 Jeet Sukumaran. | |
## | |
## This program is free software; you can redistribute it and/or modify | |
## it under the terms of the GNU General Public License as published by | |
## the Free Software Foundation; either version 3 of the License, or | |
## (at your option) any later version. |
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 | |
from dendropy.interop import ncbi | |
entrez = ncbi.Entrez(generate_labels=True, | |
label_num_desc_components=2, | |
label_separator='_', | |
exclude_gbnum_from_label=True, | |
sort_taxa_by_label=True) |
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 os | |
import sys | |
import dendropy | |
src_filepath = sys.argv[1] | |
full_data = dendropy.DnaCharacterMatrix.get_from_path(src_filepath, 'nexus') | |
items = full_data.character_subsets.items() | |
basename = os.path.splitext(os.path.basename(src_filepath))[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
#! /bin/bash | |
if [[ -z $1 ]] | |
then | |
echo "require version number (e.g. "2.2.4") as argument" | |
exit | |
fi | |
VERSION="$1" | |
NOW=$(date +"%Y%b%d") | |
SRC="satesrc-v$VERSION-$NOW" |
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 | |
compose_name() { | |
if [[ $(which git 2> /dev/null) ]] | |
then | |
STATUS=$(git status 2>/dev/null) | |
if [[ -z $STATUS ]] | |
then | |
return | |
fi |