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
ARG base_image=centos:7 | |
FROM $base_image | |
ARG jdk_version=8 | |
ARG jdk_arch=x64 | |
ARG jdk_platform=linux | |
ARG sbt_version=1.9.8 | |
# setup java | |
ADD ./install_jdk.sh . |
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
class Array | |
def scan(init, &op) | |
res = Array.new(self.length) | |
m = init | |
self.each_with_index do |x, i| | |
acc = op.call(m, x) | |
res[i] = acc | |
end | |
res | |
end |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Affinity Propagation clustering</title> | |
<script src="./jquery-2.1.3.min.js"></script> | |
<script> | |
function getRandomInt(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} |
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
// https://paiza.jp/poh/enkoi-second/e144f4da | |
open System | |
let readLines (reader : IO.TextReader) = | |
seq { | |
let eof = ref false | |
while not !eof do | |
match reader.ReadLine() with | |
| null -> eof := true | |
| str -> yield str |
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
let slice n arr = | |
let len = int (ceil ((float (Array.length arr)) / (float n))) | |
Array.init len (fun i -> arr.[(i * n)..(i * n + (n - 1))]) | |
// test code | |
[<EntryPoint>] | |
let main args = | |
let arr = [|1; 2; 3; 10; 20; 30; 100; 200; 300|] | |
let result = slice 3 arr | |
printfn "%A" result |
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
#pyonpyon-container { | |
position: relative; | |
width: 100px; | |
height: 120px; | |
} | |
#kokoro { | |
position: absolute; | |
left: 0; | |
top: 0; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>あぁ^〜心がぴょんぴょんするんじゃぁ^〜</title> | |
<script src="gochiusa.js"></script> | |
</head> | |
<body> | |
<canvas id="gochiusa" width="640" height="480"> | |
あぁ^〜心ぴょんぴょんするには最新のブラウザが必要なんじゃぁ^〜 |
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
# Provides the implementation of Affinity Propagation | |
class AffinityPropagation | |
DEFAULT_DAMPFACT = 0.9 | |
DEFAULT_CONVERGENCE_ITERATION = 10 | |
DEFAULT_MAX_ITERATION = 2000 | |
attr_reader :preference, :min_similarity, :max_similarity, :med_similarity | |
def initialize( | |
dampfact = DEFAULT_DAMPFACT, |
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
def read_problem(io) | |
problem = '' | |
loop { | |
ch = io.getc | |
break if !ch || ch == '?' | |
problem << ch | |
} | |
io.getc | |
problem | |
end |
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 3 4 5 6 7 8 | |
|-| |-| | | |-| | |
| | | | | |-| | | |
| | | | | | |-| | |
|-| | |-| | | | | |
| | |-| |-| |-| | |
|-| | |-| | | | | |
| |-| | |-| |-| | |
|-| |-| | | | | | |
| | | | |-| | | |
NewerOlder