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
# | |
# TODO test for password expirying | |
# | |
@javascript | |
Feature: Recover password | |
In order to not having to contact my manager when I forgot my password | |
As an employee | |
I want to be able to reset the password myself |
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
! This program determines the number of positive values in an array | |
! | |
! Register usage: %r1 - Index of array | |
! %r2 - Current value | |
! %r3 - Positive numbers counter | |
.begin | |
.org 2048 | |
a_start .equ 3000 |
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
package tictactoe.transformation; | |
import tictactoe.*; | |
public class Rotation implements Transformation { | |
private final int times; | |
public Rotation(int times, boolean clockwise) { | |
// Rotating more than four times is superfluous | |
times = times % 4; |
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 'formula' | |
class Node < Formula | |
homepage 'http://nodejs.org/' | |
url 'http://nodejs.org/dist/v0.8.0/node-v0.8.0.tar.gz' | |
sha1 '5171fb46fbfee5ac7129c4b17207a3f35a1f57e8' | |
head 'https://github.com/joyent/node.git' | |
devel do |
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 MagnetURI | |
@compile: (hash, title) -> | |
'magnet:?' + [ | |
"xt=urn:btih:#{hash}" | |
"dn=#{encodeURIComponent(title)}", | |
"tr=#{encodeURIComponent('udp://tracker.openbittorrent.com:80/announce')}", | |
"tr=#{encodeURIComponent('udp://tracker.1337x.org:80/announce')}", | |
"tr=#{encodeURIComponent('http://tracker.publicbt.com/announce')}" | |
].join '&' |
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
[alias] | |
todo="grep --heading --break --ignore-case --color='always' -e ' TODO: *'" | |
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
defmodule Parser do | |
import Enum, only: [ | |
take_while: 2, | |
drop_while: 2, | |
split_with: 2, | |
filter: 2 | |
] | |
defp parse(:digit, [48|xs]) do { 0, xs } end | |
defp parse(:digit, [49|xs]) do { 1, xs } 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
boolean isPartOfCycle(int[][] matrix, Edge e) { | |
// Verwijder edge vw | |
matrix[v][w] = matrix[w][v] = 0; | |
Node v = e.node1; | |
Node w = e.node2; | |
// Bepaal of er een pad is van v naar w | |
List<Node> reachableNodes = getReachableNodes(matrix, v); |
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); | |
} |
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)))))))) |
OlderNewer