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
1 | 1 | 0 | |
---|---|---|---|
1 | 2 | 0 | |
1 | 3 | 0 | |
2 | 1 | 0 | |
2 | 2 | 0 | |
2 | 3 | 0 | |
4 | 1 | 1 | |
4 | 2 | 1 | |
4 | 3 | 1 | |
5 | 1 | 1 |
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> | |
#include <fcntl.h> | |
#include <string.h> | |
#include <sys/mman.h> | |
#include <sys/stat.h> | |
/** | |
* Median calculation | |
* This program takes an input file with one number per line and calculates mean and median. |
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
typedef struct datum { | |
int number; | |
} datum; | |
typedef datum * table; | |
TYPEMAP: <<END | |
table T_PTRREF | |
END |
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
package Imports; | |
strict->import(); | |
warnings->import(qw(FATAL)); | |
5.010_000->import(); | |
utf8->import(); | |
1; |
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
sub codon_sequence { | |
my ($self, $n) = @_; | |
my ( $r, @s ); | |
for my $i ( 0 .. 2 ) { | |
$r = $n % 4; | |
$n = $n >> 2; | |
unshift( @s, $nucleotides[$r] ); | |
} | |
return join( '', @s ); | |
} |
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
#/usr/bin/perl | |
use strict; | |
use warnings; | |
#The names of the input files are provided on the command line | |
if (@ARGV == 2) { | |
# Read input files | |
my $ids_file = $ARGV[0]; |
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 "list.h" | |
list* list_init() { | |
list* ls = (list*)malloc(sizeof(list)); | |
ls->head = (list_node*)malloc(sizeof(list_node)); | |
ls->cursor = ls->head; | |
ls->head->data = NULL; | |
ls->dealloc = NULL; | |
ls->copy = NULL; | |
return ls; |
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
//A little function to allocate a length-1 sds from a char | |
//This is a little nasty, since we would need a lot of tiny mallocs if we do this often | |
sds sdsnewchar(char c) { | |
//Do some dirty allocations to save the char | |
char *ch = (char*)malloc(2*sizeof(char)); //culprit of small size allocation - could pre-allocate if we do this often | |
ch[0] = c; | |
ch[1] = '\0'; //zero-termination | |
sds str = sdsnew(ch); //new sds item, copied | |
free(ch); //sdsnew copies the content, so we can free | |
return str; |
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
# Maintainer: Lucas Hermann Negri <[email protected]> | |
# Contributor: shacristo | |
pkgname=armadillo | |
pkgver=4.300.8 | |
pkgrel=1 | |
pkgdesc="C++ linear algebra library" | |
arch=('i686' 'x86_64') | |
url="http://arma.sourceforge.net/" | |
license=('MPL 2.0') |
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
[map(float,a.split(" ")) for a in data.split("\n")] |