Skip to content

Instantly share code, notes, and snippets.

View samuell's full-sized avatar
💻
Hacking away

Samuel Lampa samuell

💻
Hacking away
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include "svm.h"
#define Malloc(type,n) (type *)malloc((n)*sizeof(type))
void print_null(const char *s) {}
defmodule FRead do
def load_letters do
filename = "temp.txt"
if File.exists?(filename) do
stream = File.stream!(filename, [:read, :utf8], :line) # how to get this?
data = Enum.reduce stream, [], fn(line, listing) ->
[line | listing]
end
data
end
defmodule ATGCCount do
def count(sequence), do: cnt(String.to_char_list(sequence),0,0)
def cnt([65|t],at,gc), do: cnt(t,at+1,gc)
def cnt([84|t],at,gc), do: cnt(t,at+1,gc)
def cnt([71|t],at,gc), do: cnt(t,at,gc+1)
def cnt([67|t],at,gc), do: cnt(t,at,gc+1)
def cnt([62|_],at,gc), do: {at,gc}
def cnt([],at,gc), do: {at,gc}
def cnt(_,0,0), do: {0,0}
def cnt([_|t], at, gc), do: cnt(t,at,gc)
[samuel pipeline_test]$ for i in $(seq 1 8); do export GOMAXPROCS=$i; echo "Testing with $i threads..."; time cat big.fa | ./pipeline_struct > out.tmp; done;
Testing with 1 threads...
real 0m30.883s
user 0m29.527s
sys 0m1.915s
Testing with 2 threads...
real 0m20.515s
user 0m36.840s
sudo apt-get install unixodbc-dev
sudo apt-get install g++ make python-dev curl help2man unixodbc libfuse-dev libcurl4-gnutls-dev libbz2-dev zlib1g-dev libpam0g-dev libssl-dev libxml2-dev libkrb5-dev
# Download the tar.gs from https://github.com/irods/irods/releases/tag/4.0.3
# Untar the archive
# cd into folder
cd external
[xubuntu ~/install/irods]$ l
irods-database-plugin-postgres-1.3.deb
irods-icat-4.0.3-64bit.deb
[xubuntu ~/install/irods]$ sudo dpkg -i *.deb
[sudo] password for xubuntu:
Selecting previously unselected package irods-database-plugin-postgres.
(Reading database ... 179210 files and directories currently installed.)
Preparing to unpack irods-database-plugin-postgres-1.3.deb ...
Unpacking irods-database-plugin-postgres (1.3) ...
Selecting previously unselected package irods-icat.
vs() {
vim $1;
source $1;
}
alias eb='vs ~/.bashrc'
alias ea='vs ~/.bash_aliases'
alias ev='vim ~/.vimrc'
alias ei='vs ~/.irodsEnv'
alias l='ls -1'
alias ltr='ls -1tr'
inoremap jj <ESC>
noremap <silent> <c-z> :update<CR>
inoremap <silent> <c-z> <c-[>:update<CR>
vnoremap <silent> <c-z> :<c-c>:update<CR>
noremap <c-j> 4j
noremap <c-k> 4k
noremap <c-h> 4h
noremap <c-l> 4l
defmodule ATGCCount do
def count(sequence), do: cnt(String.to_char_list(sequence),0,0)
def cnt([65|t],at,gc), do: cnt(t,at+1,gc)
def cnt([84|t],at,gc), do: cnt(t,at+1,gc)
def cnt([71|t],at,gc), do: cnt(t,at,gc+1)
def cnt([67|t],at,gc), do: cnt(t,at,gc+1)
def cnt([62|_],at,gc), do: {at,gc}
def cnt([],at,gc), do: {at,gc}
def cnt(_,0,0), do: {0,0}
def cnt([_|t], at, gc), do: cnt(t,at,gc)
@samuell
samuell / zoom_xfce4_terminal.sh
Created October 3, 2014 14:51
Place this in your ```~/.bash_aliases``` file.
zi() {
if [[ ! -z $1 ]]; then
steps=$1;
SIZE=`grep 'FontName' ~/.config/Terminal/terminalrc | cut -d' ' -f 2`
NEWSIZE=$((SIZE + steps))
REGEXPR='s/FontName.*/FontName=Monospace '$NEWSIZE'/g'
sed -i "$REGEXPR" ~/.config/Terminal/terminalrc
else
echo "Usage: zi [zoom steps]";
fi;