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 | |
""" | |
Scrambler is a small commandline script made to randomize file names. It stores | |
a log of all the file renaming events which it later uses to unscramble the | |
names. This script may not guard against intentional dishonesty, but it does | |
protect one from unconscious bias. | |
All of the matching options may be used simultaneously, but only files which | |
satisfy each restriction will be scrambled (the intersection of each match set). |
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 | |
# Converts all flac files in a folder into mp3s, plus the id3 tag | |
# Requires flac, metaflac, lame, id3v2 | |
for a in * | |
do | |
# Check the file is a flac file | |
if [[ "$a" =~ flac$ ]] | |
then |
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 os | |
import os.path | |
def main(): | |
outdir = 'FASTAs' | |
if not os.path.isdir(outdir): | |
os.mkdir(outdir) | |
for s in os.listdir(os.getcwd()): | |
r, e = os.path.splitext(s) | |
if e.lower() == '.seq': |
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 os | |
import os.path | |
def main(): | |
outdir = 'FASTA' | |
if not os.path.isdir(outdir): | |
os.mkdir(outdir) | |
with open(os.path.join(outdir, 'bundled_seqs.fa'), 'w') as output: | |
for s in os.listdir(os.getcwd()): | |
r, e = os.path.splitext(s) |
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
#Probability Distributions implemented interactively. | |
#An exercise in python mathematics and statistical methods | |
#I am developing this to further my understanding of bio-informatics by using | |
#a base-up approach. | |
import math | |
import random | |
class Binomial: | |
'''The binomial distribution has two possible outcomes. which may be |
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
#Problem 15 from Project Euler | |
# | |
#Here are solutions by Paul Barton | |
# | |
#The problem outlines a 2 dimensional space of 21 nodes by 21 nodes, or 20 boxes | |
#by 20 boxes. It asks how many distinct paths may be taken without backtracking. | |
# | |
#It appears that backtracking is counter-intuitively defined as moving away from | |
#the end point, or in a negative fashion, rather than visiting the same node | |
#twice. This is makes it way the hell simpler... |
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
#Problem 18 from Project Euler | |
#Solution by Paul Barton | |
# | |
#The problem presents us with a triangle, which I represent as a list of lists | |
#in the code the below. Though this problem *may* be brute forced, I would like | |
#to do this problem elegantly the first time through, as it is merely a scaled | |
#down version of one which is not brute-forceable later on (#67). | |
#Thus we need a method that scales well. | |
# | |
#I observe that the algorithm has only limited need for memory. Each point has |
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
#Problem 19 from Project Euler | |
#Solution by Paul Barton | |
# | |
#You are given the following information, but you may prefer to do some research | |
#for yourself. | |
# | |
# * 1 Jan 1900 was a Monday. | |
# * Thirty days has September, | |
# April, June and November. | |
# All the rest have thirty-one, |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
//I'd like to credit Eric Rowell at http://www.html5canvastutorials.com/ for eir instruction | |
window.requestAnimFrame = (function(callback){ | |
return window.requestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.mozRequestAnimationFrame || | |
window.oRequestAnimationFrame || |
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
/*Problem 25 from Project Euler | |
Solution by Paul Barton | |
Here is the text of the problem: | |
The Fibonacci sequence is defined by the recurrence relation: | |
Fn = Fn1 + Fn2, where F1 = 1 and F2 = 1. | |
Hence the first 12 terms will be: | |
F1 = 1 |
OlderNewer