This file contains hidden or 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
<?php | |
require_once 'FizzBuzz.php'; | |
class FizzBuzzTest extends PHPUnit_Framework_TestCase | |
{ | |
/** | |
* makeFizzBuzz | |
* @dataProvider provideMakeFizzBuzz | |
*/ |
This file contains hidden or 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
object Caluculator extends App { | |
val walet:List[Money] = Money(100) :: Money(200) :: Money(300) :: Nil | |
val sum:Money = (Money(0) /: walet) (_ + _) | |
println(sum.toString) | |
} |
This file contains hidden or 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
'use strict'; | |
var LinkedList = {}; | |
LinkedList.prototype = { | |
head: function() { | |
return this._head; | |
}, | |
tail: function() { | |
return this._tail; |
This file contains hidden or 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
var _ = require('lodash'); | |
function iPush(arr, val) { | |
var arr2 = _.clone(arr); | |
arr2.push(val); | |
return arr2; | |
} | |
var arr = []; |
This file contains hidden or 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 akka.actor._ | |
import akka.routing.RoundRobinPool | |
import akka.actor.SupervisorStrategy._ | |
import scala.concurrent.duration._ | |
import scala.util.Random | |
case object Run | |
case object Task | |
class ResumeException extends RuntimeException |
This file contains hidden or 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 MeCab | |
t = MeCab.Tagger('-Ochasen') | |
n = t.parseToNode('MeCabを使って何かやってみる。') | |
while n: | |
print("surface:\t{0}".format(n.surface)) | |
print("feature:\t{0}".format(n.feature)) | |
print("cost:\t{0}".format(n.feature)) | |
n = n.next |
This file contains hidden or 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
function seq2candlestick(range, nDiv, noHeader) { | |
const vals = range.filter(function(val) { return val != "" }).map(function(val) { return Number(val) }) | |
const res = _splitseq(vals, Number(nDiv)).map(function(ns) { | |
const min = Math.min.apply(null, ns) | |
const q1 = _q1(ns) | |
const q3 = _q3(ns) | |
const max = Math.max.apply(null, ns) | |
return [min, q1, q3, max] | |
}) | |
if (noHeader) { |
This file contains hidden or 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
root = true | |
[*] | |
end_of_line = lf | |
insert_final_newline = true | |
charset = utf-8 | |
indent_style = space | |
indent_size = 2 |
This file contains hidden or 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 IM from 'immutable' | |
import _ from 'lodash' | |
export const DISC = { | |
WHITE_SIDE : Symbol('WHITE_SIDE'), | |
BLACK_SIDE : Symbol('BLACK_SIDE') | |
} | |
export const SQUARE_STATUSES = { | |
WHITE: Symbol('WHITE'), |
This file contains hidden or 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
require 'set' | |
COL_NUM = 8 | |
def queen() | |
place([], 1, COL_NUM).select{ |l| l.length == 8 } | |
end | |
def place(accum, col, col_num) | |
available_squares = find_available_squares(accum, col_num) |
OlderNewer