Skip to content

Instantly share code, notes, and snippets.

import std.string;
import std.stdio;
import std.range;
import std.lowercase;
mixin template delegates( alias instance, methods... ){
static if( methods.length > 0 ){
static if( hasmembers(instance, methods[0]) ){
alias ReturnType!(methods[0]) type; // function/method type returned for first method
import std.traits;
import std.stdio;
import std.string;
import std.range;
import std.ascii; // lowercase
static string getFunctionParameterString(T, S)( T ptt, S pstc ) @safe pure nothrow{
enum result = "";
static if( ptt.length > 0 && pstc.length > 0 && ptt.length == pstc.length){
result = ptt[0].stringof ~" "~ pstc.stringof ~" ";
import std.string;
import std.stdio;
import std.range;
mixin template arrayDelegator( alias instance, methods... ){
static if( methods.length > 0 ){
static if( methods[0] == "opIndexAssign" ){
mixin("
void opIndexAssign( " ~ ElementEncodingType!(typeof(instance)).stringof ~ " value, size_t index ){
array[index] = value;
/**
* The module csv is a set of function to parse many format using a delimitter as csv file
* Supported format:
* - .mat matrix file
* - .bed UCSC file
* For parse a .csv file use std.csv
*/
module bed;
import std.conv;
/**
* The module csv is a set of function to parse many format using a delimitter as csv file
* Supported format:
* - .mat matrix file
* - .bed UCSC file
* For parse a .csv file use std.csv
*/
module bed;
import std.conv;
##############################################################################
### file 1 of 2: test_bed.d
##############################################################################
import bed;
import std.stdio;
import std.string;
void main(){
string filePath = "ColorByStrandDemo.txt";
##############################################################################
### file 1 of 2: test_bed.d
##############################################################################
import bed;
import std.stdio;
import std.string;
void main(){
string filePath = "ColorByStrandDemo.txt";
@bioinfornatics
bioinfornatics / gist:1941241
Created February 29, 2012 14:36
bed reader
/**
* The module csv is a set of function to parse many format using a delimitter as csv file
* Supported format:
* - .mat matrix file
* - .bed UCSC file
* For parse a .csv file use std.csv
*/
module dscience.parser.csv;
import std.conv : to;
$ ldc2 -shared test.d -soname test.so -g
$ gcc test.c -L. -ltest -otest -g
$ LD_LIBRARY_PATH=`pwd`gdb ./test
./test: error while loading shared libraries: test.so: cannot open shared object file: No such file or directory
$ LD_LIBRARY_PATH=`pwd` gdb ./test
(gdb) b 5
$ ldc2 -relocation-model=pic -shared -soname test.so sharedLib.d
$ cat sharedLib.d
import std.string;
import std.stdio;
void func1(){}
int func2(){ return 1; }