Skip to content

Instantly share code, notes, and snippets.

@hzno
hzno / pycompress.py
Created November 25, 2010 01:01
(pycompress.py) A file is compressed by "tar.bz2", "tar.gz" or "zip".
#!/usr/bin/env python
# Author: Iyori Komiyama
# Contact: hazimarino@gmail.co.jp
# site: http://hazimarino.blogspot.com/
"""\
A file is compressed by "tar.bz2", "tar.gz" or "zip".
"""
import os
import tarfile
import zipfile
@uasi
uasi / git-svn.markdown
Last active May 27, 2024 04:48
git-svn の使い方メモ

git-svn の使い方メモ

git-svn の使い方をメモする。他によいプラクティスがあれば指摘していただけるとありがたい。

用語

SVN のブランチと git のブランチが混在しているため、ここではブランチという語を以下のように区別する。

  • ブランチ、 SVN ブランチ:$SVN_REPO/branches 以下にあるディレクトリ
  • ローカルブランチ:git のローカルブランチ
  • リモートブランチ:git のリモートブランチ
@j5ik2o
j5ik2o / gist:2996293
Created June 26, 2012 15:03
リトライハンドラー
case class RetryException(throwables: List[Throwable]) extends Exception(throwables.toString())
object RetryUtil {
import scala.util.control.Exception.allCatch
def retry[T](retryLimit: Int)(f: => T): T =
retry(retryLimit, 0, classOf[Throwable])(f)
@aeg
aeg / EnclosedTest.groovy
Created February 17, 2013 13:17
SpockとJUnitが混在したテストクラス。
import org.junit.Test
import org.junit.experimental.runners.Enclosed
import org.junit.runner.RunWith;
import spock.lang.Specification
@RunWith(Enclosed.class)
class SpockJUnitMixTest {
static class Spockテストグループ1 extends Specification{
def "Spockテスト1-1"() {
when:
@aphlysia
aphlysia / stfuawsc_itg_advent2014_4_conda.md
Last active June 16, 2023 01:05
conda で python の環境つくり

これは stfuawsc_itg Advent Calendar 2014 4日目の記事です。

プログラミングをしていると、いろいろなバージョンの環境を行ったり来たりしたくなることがあります。たとえば言語処理は python 2 へ nltk を入れてやりたい。シミュレーションは python 3 へ numpy 入れてやりたいとか。
そういうふうに言語やモジュールのバージョンをいろいろ組合せた環境を気軽に切り替えられると便利です。
実際そういうことを可能にするツールはたくさんあります。virtualenv, pyenv など。
ここで紹介する conda というツールもその1つです。
virtualenv などでは、モジュールを入れるときは通常の python の流儀でインストールするのですが、インストールがうまくいかないというのはよくあることです。conda ではあらかじめビルドされたものを入れるので、楽です。もちろん conda に用意されていないモジュールもありますが、そういうのは pip 等通常の方法で入れて共存できます。

ではさっそく conda で python の環境を作る方法です。

@kobayassiy
kobayassiy / nmf.ipynb
Last active July 7, 2023 08:33
NMFサンプル
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.