This file contains hidden or 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 <stdlib.h> | |
| #include <stdio.h> | |
| void railfence_encipher(int key, const char *plaintext, char *ciphertext); | |
| void railfence_decipher(int key, const char *ciphertext, char *plaintext); | |
| int main(int argc, char *argv[]){ | |
| /* the string to encipher / decipher */ | |
| char *plaintext = "defendtheeastwallofthecastle"; | |
| /* allocate some space for results of enciphering/deciphering */ |
This file contains hidden or 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
| ''' | |
| implements porta cipher | |
| Author: James Lyons | |
| Created: 2012-06-27 | |
| ''' | |
| from .base import Cipher | |
| #################################################################################### | |
| class Porta(Cipher): | |
| def __init__(self,key='CODE'): |
This file contains hidden or 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
| function arburg(x,p) | |
| N = length(x) | |
| P = zeros(1,p+1) | |
| f = zeros(p+1,N) | |
| b = zeros(p+1,N) | |
| a = zeros(p,p) | |
| # Initialisation | |
| f[1,:] = x |
This file contains hidden or 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 itertools import product | |
| key = "EPSDUCVWYM ZLKXNBTFGORIJHAQ" | |
| IND2L = dict(zip(list(product((1,2,3),repeat=3)),key)) | |
| L2IND = dict(zip(key,list(product((1,2,3),repeat=3)))) | |
| ptext = 'DEFEND THE EAST WALL OF THE CASTLE' | |
| ctext = "" | |
| for c in ptext: |
This file contains hidden or 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
| SNR=40; % the SNR of white noise to apply to each file | |
| path = '/home/james/databases/speech_db/timit_xxl_white/db/timit_full'; | |
| [status,result]=system(['find ',path,' -name "*.wav" | grep -v snr > ',path,'/timit_list.txt']); | |
| listfilename = [path,'/timit_list.txt']; | |
| filelist = fopen(listfilename); | |
| wavname = fgetl(filelist); | |
| count = 1; | |
| while ischar(wavname), |
This file contains hidden or 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
| [sig fs] = read_NIST_file(filename); % read the input file, assume filename is supplied | |
| NFFT = 1024; | |
| WINLEN = 0.025; %frame length in ms | |
| WINSTEP = 0.01; | |
| frames = frame_sig(sig, WINLEN*fs, WINSTEP*fs, @hamming); | |
| cspec = fft(frames,NFFT,2); % complex spectrum | |
| pspec = abs(cspec).^2; % power spectrum of noisy signal | |
| phase = angle(cspec); | |
| % do spectral subtraction, produce modified_pspec |
This file contains hidden or 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 sys | |
| if len(sys.argv) <= 1: | |
| print 'usage: python pdb2fasta.py file.pdb > file.fasta' | |
| exit() | |
| input_file = open(sys.argv[1]) | |
| letters = {'ALA':'A','ARG':'R','ASN':'N','ASP':'D','CYS':'C','GLU':'E','GLN':'Q','GLY':'G','HIS':'H', | |
| 'ILE':'I','LEU':'L','LYS':'K','MET':'M','PHE':'F','PRO':'P','SER':'S','THR':'T','TRP':'W', |
This file contains hidden or 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
| XUKEXWSLZJUAXUNKIGWFSOZRAWURORKXAOSLHROBXBTKCMUWDVPTFBLMKEFVWMUXTVTWUIDDJVZKBRMCWOIWYDXMLUFPVSHAGSVWUFWORCWUIDUJCNVTTBERTUNOJUZHVTWKORSVRZSVVFSQXOCMUWPYTRLGBMCYPOJCLRIYTVFCCMUWUFPOXCNMCIWMSKPXEDLYIQKDJWIWCJUMVRCJUMVRKXWURKPSEEIWZVXULEIOETOOFWKBIUXPXUGOWLFPWUSCH | |
| XRFMTOUWLUKVLBCWCEKXWUEMUJIEAMFRUFUOXOUPTWPMEWSXVUPOVTSLTSNYXROLHVHOTCCOZRTAJRNJFJOWGULMUWUBUSZGCMKAXIVHBIVBXBDWVMWRIUTDUTCMKUNKJFWYSXXKCVWKPKWPIMZOOOPUXGUKRRJXRUWWBCSCEKGFDRWVLDPOSVMURRLSWOPCIZIYELZTWDSYIEFRFOUVTQIPABIJVVKWWWLWCFFDZUUMYNSCJVSRKDVQCWXCOEXTXMIUH | |
| HCSUWPFLWOGUXPXUIBKWFOOTEOIELUXVZWIEESPKRUWXKRVMUJCRVMUJCWIWJDKQIYLDEXPKSMWICMNCXOPFUWUMCCFVTYIRLCJOPYCMBGLRTYPWUMCOXQSFVVSZRVSROKWTVHZUJONUTREBTTVNCJUDIUWCROWFUWVSGAHSVPFULMXDYWIOWCMRBKZVJDDIUWTVTXUMWVFEKMLBFTPVDWUMCKTBXBORHLSOAXKRORUWARZOSFWGIKNUXAUJZLSWXEKUX | |
| HUIMXTXEOCXWCQVDKRSVJCSNYMUUZDFFCWLWWWKVVJIBAPIQTVUOFRFEIYSDWTZLEYIZICPOWSLRRUMVSOPDLVWRDFGKECSCBWWURXJRRKUGXUPOOOZMIPWKPKWVCKXXSYWFJKNUKMCTUDTUIRWMVWDBXBVIBHVIXAKMCGZSUBUWUMLUGWOJFJNRJATRZOCCTOHVHLORXYNSTLSTVOPUVXSWEMPWTPUOXOUFURFMAEIJUM |
This file contains hidden or 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
| % load the dataset, this is built in to matlab | |
| load fisheriris | |
| % the data is ordered, we want to randomly select 100 points for train, 50 | |
| % for test. This part just generates a random list of array indices. | |
| indices = randperm(150); | |
| train_indices = indices(1:100); | |
| test_indices = indices(101:end); | |
| % meas contains the features, we use our random indices to select a subset |
This file contains hidden or 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
| name: "iris" | |
| layer { | |
| name: "data" | |
| type: "HDF5Data" | |
| top: "data" | |
| top: "label" | |
| include: { | |
| phase: TRAIN | |
| } | |
| hdf5_data_param { |