Skip to content

Instantly share code, notes, and snippets.

View alexeygrigorev's full-sized avatar
:octocat:
Githubbing

Alexey Grigorev alexeygrigorev

:octocat:
Githubbing
View GitHub Profile
@alexeygrigorev
alexeygrigorev / sp.txt
Created August 5, 2014 18:12
S&P from 2004-08-04 to 2014-07-01
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
@alexeygrigorev
alexeygrigorev / kldiv.R
Created January 13, 2015 13:54
KL divergence for bootstrap sample distribution
install.packages('hflights', 'entropy')
library(hflights)
library(entropy)
sample.size = 10000
reps = 5000
mean(hflights$ArrDelay, na.rm=T)
@alexeygrigorev
alexeygrigorev / brushes.js
Last active August 29, 2015 14:16
syntaxhighlighter for itshared.org
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
@alexeygrigorev
alexeygrigorev / logo_dima.pdf
Last active September 26, 2015 17:33
IT4BI Master Thesis title at DIMA TU Berlin
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexeygrigorev
alexeygrigorev / gist:5334784
Last active December 15, 2015 22:39
8 Queens, Scheme (SICP)
(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)
@alexeygrigorev
alexeygrigorev / CassandraService.java
Last active December 16, 2015 01:19
Cassandra TTL test
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.*;
@alexeygrigorev
alexeygrigorev / Heap.java
Created July 31, 2013 09:29
Implementation of a heap
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>>();
@alexeygrigorev
alexeygrigorev / Drawer.java
Last active December 20, 2015 23:09
Vehicle Routing Java visualizor
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;
@alexeygrigorev
alexeygrigorev / Graph.java
Created December 22, 2013 18:47
Generating event logs from a graph for process mining
package graph;
import java.util.*;
import com.google.common.collect.*;
/**
* @author Alexey Grigorev
*/
public class Graph {
@alexeygrigorev
alexeygrigorev / multi.php
Created December 25, 2013 15:12
MultiplePages mediawiki extension
$wgHooks['MediaWikiPerformAction'][] = 'wfActionMultipleArticles';
function wfActionMultipleArticles($output, $article, $title, $user, $request, $wiki) {
$action = $request->getText('action', 'view');
if ($action != 'multi') {
return true;
}