Skip to content

Instantly share code, notes, and snippets.

View yustoris's full-sized avatar
🏺
Digital Humanity

Kenji Yamauchi yustoris

🏺
Digital Humanity
View GitHub Profile
@yustoris
yustoris / load_all_modules_under_directory.py
Created April 26, 2018 01:21
Sample to load all modules under directory
# In __init__.py
import pkgutil
__all__ = []
for loader, module_name, is_pkg in pkgutil.walk_packages(__path__):
__all__.append(module_name)
module = loader.find_module(module_name).load_module(module_name)
@yustoris
yustoris / oucc_advent_2016_yustoris.md
Last active December 16, 2016 15:11
OUCC Advent Calendar (yustoris担当)

いんとろ

OUCC Advent Calendar2016用のそれです。遅刻すみません。

前回はs_sefさんの、ガルパン劇場版の1年を振り返るでした。
次回はdoooooooooooom1さんが「今年について振り返ります」とのことです。

今回アドベントカレンダー担当ということで、以下の候補を考えてました。

  1. BioPythonとETEで系統樹 in Python
  2. COLING 2016のおもしろげな論文を雑に紹介
@yustoris
yustoris / basic_operations_mock.rb
Created March 25, 2016 00:10
GSoC 2016 Ruby TensorFlow Wrapper
require 'tensor_flow'
# Define placeholders
a = TensorFlow::Placeholder.new(:int32)
b = TensorFlow::Placeholder.new(:int32)
# Define Add operation
addition = TensorFlow::Operations.new(:add, placeholder: [a, b])
# Execute operations and output result
@yustoris
yustoris / constant_operation_mock.rb
Last active March 25, 2016 00:05
GSoC 2016 Ruby TensorFlow Wrapper
require 'tensor_flow'
str = TensorFlow::Constant.new(type: :string, value: 'hello world')
session = TensorFlow::Session.new
session.run(str)
@yustoris
yustoris / log
Created February 24, 2016 12:59
Python SWIG log for python
bazel-out/host/bin/tensorflow/swig -c++ -python -module pywrap_tensorflow
-ltensorflow/python/client/events_writer.i
-ltensorflow/python/client/tf_session.i
-ltensorflow/python/framework/python_op_gen.i
-ltensorflow/python/lib/core/py_func.i
-ltensorflow/python/lib/core/status.i
-ltensorflow/python/lib/core/status_helper.i
-ltensorflow/python/lib/core/strings.i
-ltensorflow/python/lib/io/py_record_reader.i
-ltensorflow/python/lib/io/py_record_writer.i
sealed trait Stream[+A]{
def toList: List[A] = this match {
case Cons(h, t) => h() :: t().toList
case _ => List()
}
}
case object Empty extends Stream[Nothing]
case class Cons[+A](h: () => A, t: () => Stream[A]) extends Stream[A]
@yustoris
yustoris / init.el
Last active August 29, 2015 14:11
Emacs入門用(Camphor)
;; Cmd as Meta key
(setq ns-command-modifier (quote meta))
(setq ns-alternate-modifier (quote super))
;; バックアップファイルの置き場所を指定する
(setq make-backup-files t)
(setq backup-directory-alist
(cons (cons "\\.*$" (expand-file-name "~/.emacs.d/bak"))
backup-directory-alist))
@yustoris
yustoris / OUCC-AdventCalendar.md
Last active August 29, 2015 14:11
自己流古典ギリシア語学習環境 with Yosemite

この記事はOUCCアドベントカレンダー2014 19日目です。昨日は @domitry君によるゆるふわ工作のための3つのTipsでした。

自己流古典ギリシア語学習環境 with Yosemite

はじめまして、ユス(@yus_no_s)と申します。 大学院で自然言語処理をやってたりするOBです。

なんかクリスマスが近いらしいです。 クリスマスと言えばキリスト教、キリスト教といえば聖書、聖書といえばコイネー、コイネーといえば古典ギリシア語(アッティカ方言)の正統進化形、ということで今回は趣味で触れている古典ギリシア語についてです。

古典ギリシア語の情報は、(当たり前ですが)日本だと初学者に対するものがWeb上だとあんまりまとまっていません。

@yustoris
yustoris / gist:10768336
Created April 15, 2014 20:15
GSoC-2014WT198
# -*- coding: utf-8 -*-
import oauth2 as oauth #
import logging
import sys
from rdflib import ConjunctiveGraph as Graph
from rdflib import Namespace
from rdflib import URIRef
import urllib
import urllib2
import json