Skip to content

Instantly share code, notes, and snippets.

View nkmrtty's full-sized avatar

Tatsuya Nakamura nkmrtty

View GitHub Profile
@nkmrtty
nkmrtty / docker-compose.yml
Created March 27, 2018 15:37
Easy tweets collection system = Docker + Elasticsearch + Kibana + Logstash
version: '3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-basic:6.2.2
environment:
- discovery.type=single-node
ports:
- 9200:9200
volumes:
@nkmrtty
nkmrtty / FastLightsOut.py
Created February 15, 2018 17:42
Fast Lights Out
def switch(cur_lights, pos, N, M):
new_lights = list(cur_lights)
row = pos // M
left = row * M
right = (row + 1) * M - 1
# center
new_lights[pos] ^= 1
# left
if left < pos <= right:
new_lights[pos - 1] ^= 1
@nkmrtty
nkmrtty / LightsOut.py
Last active February 9, 2018 06:46
Lights Out
def switch(cur_lights, pos, N, M):
new_lights = list(cur_lights)
row = pos // M
left = row * M
right = (row + 1) * M - 1
# center
new_lights[pos] ^= 1
# left
if left < pos <= right:
new_lights[pos - 1] ^= 1
@nkmrtty
nkmrtty / Langevin+equation.ipynb
Created September 29, 2017 05:43
Langevin Equation - 2D plot
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.