Skip to content

Instantly share code, notes, and snippets.

View chck's full-sized avatar
🏠
Working from home

chck chck

🏠
Working from home
View GitHub Profile
@Getaji
Getaji / How-to-Lombok.md
Last active September 1, 2020 01:13
書きかけのLombok解説

#概要

 黒魔術ライブラリことLombokについての解説です。公式ドキュメントからの和訳と多分な意訳によって構成されています。

 すでにこちらの”JavaでAndroid開発をするなら絶対に導入したいLombok - 超戦士が秘めたる13のパワー[劇場版]”で解説がありますが、当記事では各パラメータやオプションの解説も行っていきます。そういった部分も把握して使いこなしたい、と言った場合に参考にしていただければと思います。

 Experimental features(実験的な機能)はバージョンアップによって削除される可能性が高いため解説は行いません。Lombokのアップデートによってメインパッケージへと移動した場合は追記を行う予定です。

 かなり長くなるので見出しをご活用ください。

@yasaichi
yasaichi / x_means.py
Last active May 1, 2025 11:26
Implementation of X-means clustering in Python
"""
以下の論文で提案された改良x-means法の実装
クラスター数を自動決定するk-meansアルゴリズムの拡張について
http://www.rd.dnc.ac.jp/~tunenori/doc/xmeans_euc.pdf
"""
import numpy as np
from scipy import stats
from sklearn.cluster import KMeans
@dyndna
dyndna / docker_config_dns_fix.md
Created May 20, 2015 21:12
Docker build "Could not resolve 'archive.ubuntu.com'" apt-get fails to install anything

Docker build "Could not resolve 'archive.ubuntu.com'" apt-get fails to install anything

In Ubuntu Precise 12.04 LTS, after executing docker build command, e.g., docker build -t myimages/pcawg3_1 -f ./icgc_rnaseq_align/, build engine may halt at step 1: apt-get with errors similar to Could not resolve 'archive.ubuntu.com'. This is occurring most likely because of inability of docker ubuntu image to resolve apt-get urls with default Google DNS.

To resolve this issue: [Ref. http://stackoverflow.com/a/24991137]

  1. Uncomment following line in /etc/default/docker, and preferably replace Google DNS with those from your own ISP:

DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"

  1. Restart docker by sudo service docker restart or service restart command for other platforms.
  2. Reissue docker build, and add no-cache=true flag to force docker image fetch new DNS, e.g., docker build --no-cache=true -t myimages/pcawg3_2 -f ./icgc_rnaseq_align/
@PurpleBooth
PurpleBooth / README-Template.md
Last active August 4, 2025 04:32
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@karpathy
karpathy / min-char-rnn.py
Last active July 27, 2025 12:08
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
import numpy as np
from sklearn.cluster import KMeans
class Cluster:
def __init__(self, ids: [str], features: [[float]], centroid: []):
self.ids = np.array(ids)
self.features = np.array(features)
self.centroid = centroid
@tkuchiki
tkuchiki / example.md
Last active May 2, 2020 23:50
s3 にアップロードする (golang)
$ ./put-s3 --help
sage: put-s3 --file=FILE --bucket=BUCKET --region=REGION [<flags>]

Flags:
      --help                 Show context-sensitive help (also try --help-long and --help-man).
  -f, --file=FILE            upload file
  -b, --bucket=BUCKET        bucket
  -r, --region=REGION        region
 --path=PATH path
@civitaspo
civitaspo / s3_to_file.yml.liquid
Created February 4, 2016 01:38
embulkでデータ欠損が発生した際の全ログとconfig
in:
type: s3
access_key_id: "{{ env.AWS_ACCESS_KEY_ID }}"
secret_access_key: "{{ env.AWS_SECRET_ACCESS_KEY }}"
bucket: "{{ env.S3_BUCKET }}"
path_prefix: "{{ env.INPUT_PREFIX }}"
decoders:
- type: gzip
parser:
type: csv
@jaredhowland
jaredhowland / clear-font-cache.md
Last active July 8, 2025 23:32
Clear Mac OS X Font Caches
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward