Skip to content

Instantly share code, notes, and snippets.

View kozo2's full-sized avatar

Kozo Nishida kozo2

View GitHub Profile
@kozo2
kozo2 / rc.lua
Created July 13, 2013 04:47 — forked from myuhe/rc.lua
--- Spawns cmd if no client can be found matching properties
-- If such a client can be found, pop to first tag where it is visible, and give it focus
-- @param cmd the command to execute
-- @param properties a table of properties to match against clients. Possible entries: any properties of the client object
function run_or_raise(cmd, properties)
local clients = client.get()
local focused = awful.client.next(0)
local findex = 0
local matched_clients = {}
local n = 0
@kozo2
kozo2 / load_kegg.py
Last active January 1, 2016 17:29 — forked from keiono/load_kegg.py
from java.io import File
KEGG_DIR = "/Users/kozo2/kegg/"
CARBOHYDRATE = "Carbohydrate"
pathwayids_for = { CARBOHYDRATE : ["00010", "00020", "00030", "00040", "00051", "00052", "00053", "00500", "00520", "00562", "00620", "00630", "00640", "00650", "00660"] }
ORGANISM = "eco"
loadNetworkTF = cyAppAdapter.get_LoadNetworkFileTaskFactory()
@kozo2
kozo2 / xml.scala
Last active January 4, 2016 18:29
import net.liftweb.json.Xml // converts XML to JSON
import com.mongodb.casbah.Imports._ // To put stuff in Mongo
import com.mongodb.casbah.MongoDB // To connect to Mongo
import com.mongodb.util.JSON // To parse JSON into a MongoDBObject
import net.liftweb.json._ // To output Lift JSON as actual JSON
import scala.xml.XML // To load XML
// load the XML
val xml = XML.load("http://www.w3schools.com/xml/note.xml")
// fire up mongo connection

Windows 7 (64bit)上でE-Cell4のPython拡張をビルドする

準備

E-Cell4はwin32ブランチをチェックアウトして用いる. 必要なら各自Gitをインストールして使う: https://github.com/ecell/ecell4

以下がビルドに利用したもの:

@kozo2
kozo2 / spfw.R
Last active August 29, 2015 14:18 — forked from kohske/spfw.R
library(gtable)
d=data.frame(g=c(1,1,1,2,2,3),x=c(1,2,3,1,2,3),y=1:6);
p = ggplot(d,aes(x,y))+geom_bar(stat="identity")+facet_wrap(~g)
gt= ggplot_gtable(ggplot_build(g))
graphics.off()
for (p in c(4, 7, 10)) {
pdf(paste0("plot-", p, ".pdf"))
grid.draw(gt[,c(1:3, p, 12)])
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kozo2
kozo2 / rust-cross-sparc64-linux-gcc-5.4.0.log
Created July 12, 2017 09:57 — forked from tatsuya6502/rust-cross-sparc64-linux-different-ld-versions.log
Rust cross compile - Linux x86_64 -> Linux Sparc64 (gcc 5.4.0)
$ docker run -it ubuntu:xenial
Unable to find image 'ubuntu:xenial' locally
xenial: Pulling from library/ubuntu
...
Digest: sha256:a0ee7647e24c8494f1cf6b94f1a3cd127f423268293c25d924fbe18fd82db5a4
Status: Downloaded newer image for ubuntu:xenial
root@3479ac349e68:/# cd
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kozo2
kozo2 / noglobal.py
Created May 30, 2018 15:57 — forked from ax3l/noglobal.py
Useful Noglobal in Python
# License:
# I hereby state this snippet is below "threshold of originality" where applicable (public domain).
#
# Otherwise, since initially posted on Stackoverflow, use as:
# CC-BY-SA 3.0 skyking, Glenn Maynard, Axel Huebl
# http://stackoverflow.com/a/31047259/2719194
# http://stackoverflow.com/a/4858123/2719194
import types