Skip to content

Instantly share code, notes, and snippets.

@s4553711
s4553711 / tool.pl
Created June 17, 2013 09:03
A simple example of ExcelHelper module
# Include of ExcelHelper Module
use Tool::DB::ExcelHelper;
# definition of mapping between xls title and column
my $xls_schema = {
'Date' => 'date',
'Catalog No' => 'catno',
'Type' => 'type',
'old data' => 'old_val',
'new data' => 'new_val',
@s4553711
s4553711 / gist:6059718
Created July 23, 2013 03:48
A sample code for parsing KEGG Pathway from KGML
#!/usr/bin/perl
use local::lib;
use utf8;
use Bio::Database::KEGG::Path;
use Data::Dumper;
# input file (KGML file)
my $file = shift;
# parse the pathway info
@s4553711
s4553711 / gist:6412800
Created September 2, 2013 13:20
My vimrc
set tabstop=4
set shiftwidth=4
set nu
set hls
call pathogen#runtime_append_all_bundles()
syntax on
filetype plugin indent on
import java.io.*;
import java.security.MessageDigest;
public class FastaMD5
{
public static void main(String args[]) throws Exception
{
int len=0;
byte[] buffer = new byte[1];
MessageDigest complete = null;
@s4553711
s4553711 / gist:7802355
Created December 5, 2013 09:10
Add center text on the charts if there is no data in highcharts
var ele = $('#canvas').highcharts();
var textWidth = ele.chartWidth;
$('#canvas').highcharts().renderer.text("No Data Available.",(textWidth/2)-65,115).css({
color: '#4572A7',
fontSize: '16px',
textAlign: 'center',
}).attr({zIndex: 9999999}).add();
@s4553711
s4553711 / gist:9488399
Created March 11, 2014 15:41
Some example for subprocess.Popen exception example
#!/usr/bin/python
import subprocess
import os
import sys
#res = subprocess.Popen(['ls','-al','/ahome'],stdout=subprocess.PIPE,stderr=subprocess.PIPE);
#output,error = res.communicate()
#if res.returncode:
# #raise Exception(error)
#include <iostream>
using namespace std;
int main() {
long long int n;
long long int m;
long long int a;
cin >> n;
cin >> m;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
// The source of this code is http://kasonblog.blogspot.tw/2012/04/10810-ultra-quicksort-uva-online-judge.html
// and its realted information http://program-lover.blogspot.tw/2008/10/mergesort.html
// or http://programming-study-notes.blogspot.tw/2013/12/uva-10810-ultra-quicksort.html
// or http://www.tuicool.com/articles/ANb6Fv
@s4553711
s4553711 / gist:063c444aeaa27064216b
Created June 20, 2014 10:04
Some example about phantomjs
var page = require('webpage').create();
var system = require('system');
var map_result = {
"Reference Sequence" : "mouse_mm10(UCSC)",
"Known SNP/Indel" : "dbSNP138",
"leftReadsInput" : "36730566",
"leftReadsMapped" : "35130795 (95.6% of input)",
"leftReadsOfThese" : "9607 ( 0.0%) have multiple alignments (11204 have >1)",
"rightReadsInput" : "36730566",