Skip to content

Instantly share code, notes, and snippets.

View kozo2's full-sized avatar

Kozo Nishida kozo2

View GitHub Profile
@kozo2
kozo2 / mm.py
Created November 21, 2011 09:35
mm.py
class MassActionFluxProcess:
def __init__(self, k_value, volume, reactants):
self.volume = volume
self.k_value = k_value
self.reactants = reactants
self.N_A = 6.0221367e+23
def __call__(self, variable_array, time):
velocity = self.k_value * self.volume * self.N_A
for r in self.reactants:
@kozo2
kozo2 / .pdbrc
Created November 22, 2011 06:12
tab completion in pdb
import rlcompleter
import pdb
pdb.Pdb.complete = rlcompleter.Completer(locals()).complete
@kozo2
kozo2 / uniprottime.py
Created December 12, 2011 20:31
PyPy time test using Uniprot data
from Bio import SeqIO
uniprot = SeqIO.index("uniprot_sprot.dat", "swiss")
handle = open("selected.dat", "w")
for acc in ["P33487", "P19801", "P13689", "Q8JZQ5", "Q9TRC7"]:
handle.write(uniprot.get_raw(acc))
handle.close()
@kozo2
kozo2 / xmonad.hs
Created August 5, 2012 05:56
evilvte NSP doesn't float...
import XMonad
import XMonad.Prompt
import XMonad.Prompt.Window
import XMonad.Util.EZConfig
import XMonad.Util.NamedScratchpad
import XMonad.Hooks.FadeInactive
import Anekos.Config.Layout (myLayoutHook)
import Anekos.Config.Layout (myLayoutPrompt)
scratchpads = [ NS "emacs" "emacs" (className =? "Emacs") nonFloating
import urllib2
from bs4 import BeautifulSoup
import re
MAP_HTML_URL = "http://www.genome.jp/kegg/pathway/map/map01100.html"
HSA_HTML_URL = "http://www.genome.jp/kegg-bin/show_pathway?org_name=hsa&mapno=01100&mapscale=1.0&show_description=show"
HSA_KGML_URL = "http://www.genome.jp/kegg-bin/download?entry=hsa01100&format=kgml"
rid_pat = re.compile("R[0-9]{5}")
hoge = urllib2.urlopen(MAP_HTML_URL)
@kozo2
kozo2 / zoterator.js
Created August 15, 2012 16:43
vimperator plugin for Zotero
/* NEW BSD LICENSE {{{
Copyright (c) 2009-2012, kozo2.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
@kozo2
kozo2 / kof2012-letsknowaboutemacsandvim.md
Created November 6, 2012 05:00
k-of 2012 presentation

helm.el, unite.vimでもっとemacs, vimを知ろう

2012/11/10 KOF2012
kozo2

何故emacs, vimを知ろうと提案するのか?

  • eclipseなどがある今でもやはり知っておいた方がよい
    • IDEを使えない開発環境
  • 特にemacsはprogramming以外にも有用
  • server設定など雑務
@kozo2
kozo2 / pybngl.py
Created November 9, 2012 09:56
print modeljson function
# epdp model print functions
#for k,v in m.species.iteritems():
# print "s" + k + " = " + "model.Species('" + v.str_simple() + "', 1.5e-12, 5e-9)"
# print "m.add_species_type(s" + k + ")"
#counter = 0
#for result in reaction_results:
# for reaction in result.reactions:
# counter = counter + 1
@kozo2
kozo2 / tcvime.md
Last active October 12, 2015 19:28
Vim勉強会#11 tcvime.vimでVimでもT-code

tcvime.vimでVimでもT-code

T-codeとは

  • Googleしてください。
  • こわくない tcvime.vimとかtc3があれば
  • まずはひらがなだけT-codeできるようになろう
  • ひらがながT-codeできるようになったらtcvime.vimを使おう
  • tcvime.vimのひらがなを漢字に変換する機能を用いて、よく変換すると感じた漢字からゆっくりと覚えていくとよい。
  • ujihisaさんのように 根性でいっきに漢字まで覚えようとしないこと
[kozo2@kozo2s-Mac-mini]~/projects/ecell3% make
make all-recursive
Making all in libltdl
make all-am
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I/usr/local/opt/boost149/include -g -O2 -c -o ltdl.lo ltdl.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I/usr/local/opt/boost149/include -g -O2 -c ltdl.c -fno-common -DPIC -o .libs/ltdl.o
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I/usr/local/opt/boost149/include -g -O2 -c ltdl.c -o ltdl.o >/dev/null 2>&1
/bin/sh ./libtool --tag=CC --mode=link gcc -g -O2 -L/usr/local/opt/boost149/lib -o libltdlc.la ltdl.lo -ldl
libtool: link: ar cru .libs/libltdlc.a .libs/ltdl.o
libtool: link: ranlib .libs/libltdlc.a