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
package main | |
/** | |
* simple go concurrency pattern | |
* generator + fanIn | |
*/ | |
import ( | |
"fmt" | |
"math/rand" |
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 | |
wd="./src" | |
t="./template" | |
o="./output" | |
fname=$1 | |
ofile=$o/$fname | |
echo "$ofile" |
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/perl | |
my $topicdb = 'topic.txt'; | |
open(my $db, '<', $topicdb) or die $!; | |
my $count = 0; | |
my %topic; | |
while(<$db>){ | |
if($_ =~ "^--"){ |
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
FROM python:2.7-slim | |
WORKDIR /Users/smanurung/Documents/lab/docker/iris-base/ | |
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils | |
RUN yes | apt-get install bzip2 | |
RUN apt-get install -y curl git supervisor | |
# # install miniconda for python dependency management | |
RUN curl "https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh" >> /tmp/miniconda.sh |
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 numpy as np | |
def smith_waterman(a: str, b: str, alignment_score: float = 1, gap_cost: float = 1) -> float: | |
""" | |
Compute the Smith-Waterman alignment score for two strings. | |
See https://en.wikipedia.org/wiki/Smith%E2%80%93Waterman_algorithm#Algorithm | |
This implementation has a fixed gap cost (i.e. extending a gap is considered | |
free). In the terminology of the Wikipedia description, W_k = {c, c, c, ...}. | |
This implementation also has a fixed alignment score, awarded if the relevant |
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
#!/Users/smanurung/miniconda3/bin/python | |
class Person: | |
name = "foo" | |
def sayName(self): | |
return self.name | |
def setName(self, n): | |
self.name = n |