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) |
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
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 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
package optimization.vrp; | |
import java.awt.Color; | |
import java.io.IOException; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Random; | |
import org.w3c.dom.Document; |
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
package graph; | |
import java.util.*; | |
import com.google.common.collect.*; | |
/** | |
* @author Alexey Grigorev | |
*/ | |
public class Graph { |
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.io.*; | |
import javax.sound.sampled.*; | |
import org.apache.commons.lang3.Validate; | |
import com.google.common.base.Throwables; | |
/** | |
* @author Alexey Grigorev | |
*/ | |
public class AudioFileReader implements Closeable { |
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
$wgHooks['MediaWikiPerformAction'][] = 'wfActionMultipleArticles'; | |
function wfActionMultipleArticles($output, $article, $title, $user, $request, $wiki) { | |
$action = $request->getText('action', 'view'); | |
if ($action != 'multi') { | |
return true; | |
} | |
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
DATE,VALUE | |
2004-08-04,. | |
2004-08-05,-17.93 | |
2004-08-06,-16.73 | |
2004-08-09,1.25 | |
2004-08-10,13.82 | |
2004-08-11,-3.25 | |
2004-08-12,-12.56 | |
2004-08-13,1.57 | |
2004-08-16,14.54 |
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
install.packages('hflights', 'entropy') | |
library(hflights) | |
library(entropy) | |
sample.size = 10000 | |
reps = 5000 | |
mean(hflights$ArrDelay, na.rm=T) |
OlderNewer