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 java.util.*; | |
/** | |
* Implementation is based on http://algorithms.soc.srcf.net/notes/dijkstra_with_heaps.pdf | |
* | |
* @author Grigorev Alexey | |
*/ | |
public class Heap<E, K> { | |
private final List<HeapNode<E, K>> heap = new ArrayList<HeapNode<E, K>>(); |
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
grammar RuleDSL; | |
rules: (basic_rule)+ EOF; | |
basic_rule: 'rule' SPACE rule_name SPACE '{' EOL conditions '}' EOL; | |
name: ID; | |
list_index: '[' IND ']'; | |
name_expr: name list_index*; | |
rule_name: name_expr ('.' name_expr)*; |
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 me.prettyprint.cassandra.serializers.ObjectSerializer; | |
import me.prettyprint.cassandra.service.ThriftCfDef; | |
import me.prettyprint.hector.api.*; | |
import me.prettyprint.hector.api.beans.HColumn; | |
import me.prettyprint.hector.api.ddl.*; | |
import me.prettyprint.hector.api.factory.HFactory; | |
import me.prettyprint.hector.api.mutation.Mutator; | |
import me.prettyprint.hector.api.query.QueryResult; | |
import org.slf4j.*; |
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
(define (accumulate op initial sequence) | |
(if (null? sequence) | |
initial | |
(op (car sequence) | |
(accumulate op initial (cdr sequence))) | |
) | |
) | |
(define (enumerate-interval begin end) | |
(if (> begin end) |
NewerOlder