Skip to content

Instantly share code, notes, and snippets.

View kozo2's full-sized avatar

Kozo Nishida kozo2

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kozo2
kozo2 / appveyor.yml
Created February 2, 2016 22:59
appveyor.yml for redpen
environment:
matrix:
- JAVA_HOME: C:\Program Files\Java\jdk1.8.0
install:
- ps: choco install maven
- cmd: SET PATH=C:\tools\apache-maven-3.3.3\bin;%JAVA_HOME%\bin;%PATH%
- mvn --version
build_script:
- mvn package
artifacts:
@kozo2
kozo2 / .travis.yml
Last active February 8, 2016 13:40
uim travis
language: c
sudo: false
addons:
apt:
packages:
- gcc
- make
- gettext
- intltool
install:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kozo2
kozo2 / narray-devel-quickstart.md
Last active February 27, 2016 18:51
NArray-devel quickstart tutorial

An example

[1] pry(main)> require "narray"
=> true
[2] pry(main)> a = NArray[0..14].reshape(3, 5)
=> NArray::Int32#shape=[3,5]
[[0, 1, 2, 3, 4],
 [5, 6, 7, 8, 9],
 [10, 11, 12, 13, 14]]
@kozo2
kozo2 / kaizu2010.py
Created February 28, 2016 06:01
Cytoscape v3.3 Animation/Automation Challenge with Kaizu 2010
from bs4 import BeautifulSoup
soup = BeautifulSoup(open("./msb201073-sup-0003.xml", encoding='utf-8').read(), 'xml')
ann = soup.annotation
import re
sas = ann.find_all(re.compile("speciesAlias$"))
for sa in sas:
print(sa.get("id"), sa.bounds.get("h"), sa.bounds.get("w"), tag.bounds.get("x"), tag.bounds.get("y"))
@kozo2
kozo2 / jupyter.md
Last active March 4, 2016 11:48
jupyter notes
python2 -m ipykernel install
jupyterhub -f jupyterhub_config.py
@kozo2
kozo2 / wikidata.py
Last active March 14, 2016 05:36
wikidata
import pywikibot
site = pywikibot.Site("wikidata", "wikidata")
repo = site.data_repository()
item = pywikibot.ItemPage(repo, u"Q415011")
print item.get()
stringclaim = pywikibot.Claim(repo, u'P2064')
stringclaim.setTarget(u"C00000674")
item.addClaim(stringclaim)
import pandas as pd
a=pd.read_table("foo.out", sep=" ", header=None)
>>> for i in ["%.2d" % i for i in range(1,25)]:
... print [i, a[3].str.contains(i+"/Feb").value_counts()[True]]
['01', 511]
['02', 1552]
['03', 283]
['04', 93]
['05', 207]
@kozo2
kozo2 / numo-quickstart.ipynb
Created March 11, 2016 12:36
numo quickstart notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.