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 timeit | |
from Bio import Align | |
seq1 = "ATCTAACTATTCCCTGTGCCTTATGGGGGCCTGCGCTATCTGCCTGT\ | |
CGAACCATAGGACTCGCGCCAGCGCGCAGGCTTGGATCGAGGTGAAATCTCCGGGGCCTAAGACCACGAGCGTCTGGCG\ | |
TCTTGGCTAACCCCCCTACATGCTGTTATAGACAATCAGTGGAAACCCGGTGCCAGGGGGTGGAGTGACCTTAAGTCAG\ | |
GGACGATATTAATCGGAAGGAGTATTCAACGCAATGAAGCCGCAGGGTTGGCGTGGGAATGGTGCTTCTGTCCAAGCAG\ | |
GTAAGGGCATGAGGCCGCAACCGTCCCCCAAGCGTACAGGGTGCACTTTGCAACGATTTCGGAGTCCGGAGACTCGCTG\ | |
TTTTCGAAATTTGCGCTCAAGGGCGGGTATTGAACCAGGCTTACGCCCAAGAACGTAGCAAGGTGACTCAAACAAGGTA\ | |
CATCTTGCCCGCGTTTCACACGAATCAAGTTGGAGGTTATGGAGCATAGTAACACGTGGGCGGCCAGTGGTCGGTTGCT\ |
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
#![feature(test)] | |
extern crate test; | |
use test::Bencher; | |
#[bench] | |
fn bench_vec_of_vec(b: &mut Bencher) { | |
let (m, n) = (10000, 10000); | |
let mut matrix = vec![vec![0u8; n]; m]; |
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
# setting up directories | |
mkdir pdb && cd pdb && mkdir zipped unzipped && cd zipped | |
# download all compressed PDB files (this takes a long time!) | |
wget ftp://ftp.wwpdb.org/pub/pdb/data/structures/all/pdb/* | |
# unzip all PDB files | |
cd .. && find . -name "*.gz" | xargs -I{} -n1 bash -c ' | |
src={}; dst=unzipped/${basename ${src%*.gz}} | |
[ -f $dst ] && echo "skip" || (gzcat -cv $src > $dst)' |
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
quasar create foo # with default options + npm | |
cd foo | |
quasar mode add electron | |
npm i node-id3 | |
echo "import * as NodeID3 from 'node-id3' | |
export function logId3 (buffer) { | |
console.log(NodeID3.read(buffer)) | |
}" > src/utils.js |
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
USAGE="USAGE: ${0##*/} music_id [output_file] " | |
[[ $# -lt 1 || $1 == '-h' || $1 == '--help' ]] && echo $USAGE && exit 1 | |
ID=$1 | |
OUT=${2:-_lyric.lrc} | |
curl http://music.163.com/api/song/media?id=${ID} | | |
jq -r '.lyric' | | |
sed 's/\\n/\n/g' | | |
sed 's/\\"/"/g' >${OUT} |