Skip to content

Instantly share code, notes, and snippets.

<property name="ffi.gem" value="ffi-0.6.0-java.gem"/>
<property name="ffi-java.gem" value="ffi-0.6.0-java.gem"/>
<property name="nice-ffi.gem" value="nice-ffi-0.3.gem"/>
<property name="chipmunk-ffi.gem" value="chipmunk-ffi-1.0.0.gem"/>
<arg value="${build.lib.dir}/${ffi.gem}"/>
<arg value="${build.lib.dir}/${ffi-java.gem}"/>
<arg value="${build.lib.dir}/${nice-ffi.gem}"/>
<arg value="${build.lib.dir}/${chipmunk-ffi.gem}"/>
require 'bio'
reg= Bio::Registry.new
genbank = reg.get_database('genbank')
entry = genbank.get_by_id('AA2CG')
print entry
ff = Bio::FlatFile.new(Bio::GenBank, File.open("/home/etsvigun/devenv/biotech/seq/gbhtg86.seq", 'r'))
%%% File : ahocorasik.erl
%%% Author : Fyodor Ustinov <ufm@ufm.su>
%%% Descrip.: Multiple search based on Aho-Corasick string matching algorithm
%%%
%%% License : GPL
%%%
%%% Usage:
%%% ahocorasik:match(["pat1", "pat2"], "pat1 pat2 pat1")
%%% or
%%% Tree = ahocorasick:tree(["pat1", "pat2"])
@utgarda
utgarda / ring_benchmark.erl
Created December 8, 2010 16:51
Tutorial problem from "Programming Erlang" by Joe Armstrong , 8.11 Write a ring benchmark. Create N processes in a ring. Send a msage round the ring M times so that a total of N * M messages sent. Time how long this takes for different values of N and M.
-module(ring_benchmark).
-export([new/2]).
new(N, M) ->
spawn(fun() -> spawn_ring(N, M) end).
spawn_ring(N, M) ->
io:format("First process: ~p~n", [self()]),
NextPid = spawn_rest(self(), N),
major, minor = `bison --version`.scan(/bison \(GNU Bison\) (\d+)\.(\d+)/)[0].map(&:to_i)
$?.exitstatus == 0 && ([major, minor] <=> [2,4]) >=0
@utgarda
utgarda / jquery_animation_1.coffee
Created January 2, 2012 20:55
CoffeeScript + jQuery animation example http://coffeequery.blogspot.com
#Using $j instead of just $ to be more specific
$j = jQuery
#Storing page elements to local variables
clickme = $j '#ani1_clickme'
restore = $j '#ani1_restore'
bar1 = $j '#ani1_bar1'
bar2 = $j '#ani1_bar2'
#Cool shortcut, instead of $j(document).ready(function(){
<div id="palette" style="width: 510px; height: 80px;">
</div>
<script type="text/coffeescript">
colors = ['#CCDDBB', '#99CC66', '#88AA66', '#AADDCC', '#66AAAA', '#559999', '#FFFFDD', '#FF9922', '#DD8822', '#AACCDD', '#5599CC', '#4477AA']
next_square_html = (color) ->
"""
<div style="background: #{color};
border: 1px solid grey;
height: 30px;
@utgarda
utgarda / jquery_animation_1.2.html
Created January 12, 2012 16:40
jQuery + CoffeeScript tutorial: animation stacking http://coffeequery.blogspot.com/
<!DOCTYPE html>
<html>
<head>
<title>jQuery + CoffeeScript tutorial: animation stacking</title>
<style>
div.tree-frog {font-size: 12pt; border: 1px solid white; height: 38px; width: 38px; position: absolute}
</style>
<script src="coffee-script.js"></script>
<script src="jquery-1.7.1.js"></script>
</head>
@utgarda
utgarda / ani.stack.1.coffee
Created January 13, 2012 15:56
CoffeeScript + jQuery tutorials: Stacking animations http://coffeequery.blogspot.com
$j = jQuery
$j('#ani2_btn1').click ->
$j('#ani2_worm_bar')
.animate(width:78).animate(left:'+=40',width:38)
@utgarda
utgarda / README.md
Created January 16, 2012 05:10
CoffeeScript + jQuery tutorials

CoffeeQuery

CoffeeScript + jQuery tutorials

  • Various jQuery tutorials ported to CS
  • CoffeeScript basics
  • Cool colours, not the least of features :)