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
require 'pry' | |
class Category | |
def initialize(attributes) | |
@id, @name = *attributes.values_at(:id, :name) | |
end | |
def valid? | |
errors.empty? | |
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
=== Run information === | |
Scheme:weka.classifiers.functions.MultilayerPerceptron -L 0.3 -M 0.2 -N 500 -V 0 -S 0 -E 20 -H a | |
Relation: scrabble-game-states | |
Instances: 7273 | |
Attributes: 8 | |
number_of_plays | |
first_player_current_score | |
second_player_current_score | |
current_score_difference |
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
=== Run information === | |
Scheme:weka.classifiers.lazy.IBk -K 350 -W 0 -F -A "weka.core.neighboursearch.LinearNNSearch -A \"weka.core.ManhattanDistance -R first-last\"" | |
Relation: scrabble-game-states | |
Instances: 7273 | |
Attributes: 8 | |
number_of_plays | |
first_player_current_score | |
second_player_current_score | |
current_score_difference |
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
=== Run information === | |
Scheme:weka.classifiers.functions.LeastMedSq -S 4 -G 0 | |
Relation: scrabble-game-states | |
Instances: 7273 | |
Attributes: 6 | |
number_of_moves | |
first_player_current_score | |
second_player_current_score | |
first_player_average_score |
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
arr1 = [1, 2, 3, 4] | |
arr2 = [1, 2, 3, 4] | |
*a, b, c = *arr1 | |
puts [a, b, c].inspect # => [[1, 2], 3, 4] | |
puts arr1.inspect # => [1, 2] | |
d, *e, f = *arr2 |
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
xsjztliyjvphmamicnwlriemsotjpsgcdtensyyllyydjwlxicnidtjonjqjvpsxnfidfvnntsjvdgedjhzsxsjppyxpwwzkevjchtvonxtxednqaqiqtvxtjatpjfpamemjxthwfgwenxfymzsxsjztliyjvphmamicmedgipsvpnrgjrejhxfrjymxjwemixjxsthhfwzwmrnrlqpjiidhvtgiogcrnsgfrmfxtxxlgiwfwznrsnwqnjejiykmqycemvpjfztowfgtkvliiwxmrlmzaeygeenweffpqedtlzbigjvemidhlprihfwwfxpwqtxeeyvtgyejhetfwfmdjhpamrjrpwitsxsjrtsiejiyylnjrezvjfronwytahnhpqcvsshsedylpamrjrpwinntsjvemmdhmamicnwhjpwprzbrmjglzwpbltqitymdjeddxzzrojvdyeyieyimxuppriyymetjejrlutpfvdysmjktsrpwwetfpzrmwilpemqiemmdjecsionxemiojwnwmaymzspphltkjcjmyiinmmqkvlgppkvpsgskscylpzrmwilpemqinntsjvntrdjufjreqcxfrjuizuppmegjxcnioystrtwjqpsxzgjfxglymzsscjrnwcaymzswnmixjwemeefvpjwdjrenewqcgnkpsicjgtulpwwzspjyssfzpylprfctopsxsjwewiylxsgisnroylpamrjrpwinntsjvwnopfpwuswdewullgiengnntsjvdnwtywlgmwnxjysdycxniqwibziyhclsewdwtxjcjufjrndeyfpjxmdnwemiawenymnjsqiinwcaymylexjwdfkpgcntyyymylxsjjcjufjrndsqhmamicyiiyppyxpwwlshpvylymylmeysemiwjxejvqwibziyhczkrzwqlqxpcxqtvtswefrnjmqusnhycwiorsdymyfgtulpwxpcxhmsdjtwfmyyiiymdnrpskwnwstr |
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
$.each @items, (index, item) => | |
listItem.click => alert(item) |
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
(ns hypergraph.core | |
"A clojure library for dealing with undirected (hyper)graphs." | |
(:gen-class) | |
(:use (clojure set))) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
(defrecord Graph [vertices edges]) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
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 max-marbles (memoize (fn [board x y i j] | |
(let [tile-marbles (nth (nth board x) y)] | |
(cond | |
(and (= x i) (= y j)) tile-marbles | |
(= x i) (+ tile-marbles (max-marbles board x (inc y) i j)) | |
(= y j) (+ tile-marbles (max-marbles board (inc x) y i j)) | |
:else (+ tile-marbles (max | |
(max-marbles board x (inc y) i j) | |
(max-marbles board (inc x) y i j)))))))) |
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
boolean canRemoveEdge(HashMap<Node, List<Node>> adjacencyList, node1, node2) { | |
// Verwijder edge vw | |
adjacencyList.get(node1).remove(node2); | |
adjacencyList.get(node2).remove(node1); | |
List<Node> reachableNodes = getReachableNodes(adjacencyList, [], node1); | |
return reachableNodes.contains(node2); | |
} |
NewerOlder