Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
use List::MoreUtils qw(uniq);
use Data::Dumper::Names;
my @tab = (["12","25","2","18","9","25","18","30","30","12","30","30","18","12"],["154","12","56","8","22","88","74","12","56","32","88","88","56","12","12","56"]);
print "=============Before=============\n";
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
use List::MoreUtils qw(uniq);
#use Data::Dumper::Names;
use Benchmark qw(:all) ;
sub test1 {
my @tab = (["12","25","2","18","9","25","18","30","30","12","30","30","18","12"],["154","12","56","8","22","88","74","12","56","32","88","88","56","12","12","56"]);
#!/usrbin/env python
def getMaxRowLength( matrix ):
maxLen = 0
for i in matrix:
if len(i) > maxLen:
maxLen = len(i)
return maxLen
def computeDiag( matrix, i , j ):
// ==UserScript==
// @name CDSIM
// @description CENTER DRIVEN's Combat Simulator and Combat Stats Fork
// @author XDAAST.XDaast.daltondaast.KingCrimson | Thanks to Topper42, Eferz98, KRS_L, PythEch, MrHIDEn, Panavia2, Deyhak, CodeEcho, Matthias Fuchs, Enceladus, TheLuminary, Da Xue, Quor, WildKatana, Peluski17, Eistee
// @version 5.2
// @namespace http*://*.alliances.commandandconquer.com/*/index.aspx*
// @include http*://*.alliances.commandandconquer.com/*/index.aspx*
// @icon https://www.openmerchantaccount.com/img/cdCNCTALOGObigger.png
// @updateURL https://userscripts.org/scripts/source/173566.meta.js
// @downloadURL https://userscripts.org/scripts/source/173566.user.js
$ 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; }
$ 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
@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;
##############################################################################
### 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";
/**
* 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;