Skip to content

Instantly share code, notes, and snippets.

View takuti's full-sized avatar
🏃‍♂️
𓈒 𓂂𓏸𓋪‪

Takuya Kitazawa takuti

🏃‍♂️
𓈒 𓂂𓏸𓋪‪
View GitHub Profile
# coding: utf-8
import base64
import Image
import sys
""" This is a simple steganography script
Base64-encoded message will be hidden in a image file
"""
# coding: utf-8
""" Usage
$ ./IBM_Model1.py ${english_filename} ${japanese_filename}
NOTE: prefix for filenames 'kftt-alignments/data/' will be automatically added
"""
# Reference: http://www.statmt.org/book/slides/04-word-based-models.pdf
@takuti
takuti / collaborative_filtering.py
Last active January 20, 2016 09:54
Collaborative Filtering for row items in a given N-by-M matrix
import numpy as np
class CF:
"""Collaborative filtering for row items in a given N-by-M matrix
"""
def __init__(self, mat):
self.mat = mat
self.N, self.M = mat.shape
import java.util.*;
class WriteTree {
public static void write(int n) {
int bottom_n = (int) Math.pow(2, n);
int digits = String.valueOf(bottom_n).length();
int w = bottom_n * digits - 1;
int p = 0;
String v = "1";
import random
class MontyHall:
def __init__(self):
pass
def is_won(self, action='stay'):
doors = [1, 2, 3]
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 4. in line 1.
# Custom segmentation for long entries
日本経済新聞,日本 経済 新聞,ニホン ケイザイ シンブン,カスタム名詞
関西国際空港,関西 国際 空港,カンサイ コクサイ クウコウ,テスト名詞
# Custom reading for sumo wrestler
朝青龍,朝青龍,アサショウリュウ,カスタム人名
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@takuti
takuti / Dockerfile
Created January 21, 2018 23:12
Mock dockerfile for takuti.me
FROM node:alpine
ENV HUGO_VERSION=0.30.2
ADD https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz /tmp
ADD . /src
WORKDIR /src
RUN \
# install hugo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.