This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# | |
# マインスイーパー | |
# コマンドライン引数にヨコ、タテ、地雷の数を渡してあげると動きます | |
# 入力を求められるので掘りたいマスの座標をスペースで区切って渡してあげてください | |
# | |
import sys | |
import random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ 1 2 0 -1] | |
[ 3 7 -1 3] | |
[ 2 2 1 2] | |
[ 1 2 0 -1] | |
[ 0 1 -1 6] | |
[ 2 2 1 2] | |
[ 1 2 0 -1] | |
[ 0 1 -1 6] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
import time | |
import numpy as np | |
from sklearn.datasets import load_digits, make_classification | |
from sklearn.svm import SVC | |
from matplotlib import pyplot | |
from scw import SCW1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.pyc | |
*.diff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import numpy as np | |
from matplotlib import pyplot | |
from numpy.random import multivariate_normal | |
class StateViewer(object): | |
def __init__(self, dt, n_iterations): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# svmlight / liblinear format file loader | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2015 Ishita Takeshi | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Base.show | |
using Formatting | |
typealias AA AbstractArray | |
function xvec!(x, row) | |
m = length(row) | |
row[1] = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from copy import copy | |
def dangling_suffixes(code1, code2): | |
def suffixes(code, word): | |
N = len(word) | |
s = set() | |
for c in code: | |
if c == word: | |
continue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The MIT License (MIT) | |
Copyright (c) 2016 Ishita Takeshi | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DataStructures | |
function int_to_binarray(number, array_length) | |
""" | |
Convert the given number into a fixed length binary array | |
""" | |
binstring = bin(number) | |
# padding for alignment of the lengths of vectors |
OlderNewer