Skip to content

Instantly share code, notes, and snippets.

View aahammer's full-sized avatar

Andreas Adlichhammer aahammer

View GitHub Profile
@aahammer
aahammer / README.md
Created February 19, 2014 19:46
Number of Smite matches per queue timeslot

Distribution of player activity between different game modes of the online game Smite. The data was extracted from the public online data source (Smite Stats)[http://account.hirezstudios.com/smitegame/stats.aspx] and represents one hour of gameplay during the week. The absolute numbers are not representative for the games total number of players, but the relative numbers are quite interesting for people interested in the state of matchmaking.

The bar chart shows the total number of games started in each queue timeslot per queue type.

@aahammer
aahammer / README.me
Created February 19, 2014 19:42
Total number of Smite matches over one hour
Distribution of player activity between different game modes of the online game [Smite](http://www2.hirezstudios.com/smite). The data was extracted from the public online data source (Smite Stats)[http://account.hirezstudios.com/smitegame/stats.aspx] and represents one hour of gameplay during the week. The absolute numbers are not representative for the games total number of players, but the relative numbers are quite interesting for people interested in the state of matchmaking.
The bar chart shows the total number of games started over one hour per queue type.
@aahammer
aahammer / adjacency_sample.js
Last active December 19, 2015 21:39
Sample adjacency matrix for d3js
var AdjacenyMatrix = function(process, svg) {
var adjacenyMatrix = {}, process = process, svg = svg, view = svg.append("svg:g");
//inital layout and base size settings
var textLength = 30;
var slotSize = (svg.height - textLength) / (process.activity().length + 0.5);
var cellSize = slotSize*0.8;
// add adjanceny index information
@aahammer
aahammer / analyze.js
Last active December 19, 2015 21:39
Sample functionality for a process data model
analyze = function() {
analyze = {};
// determin start nodes
var start = function(process) {
var start = [];
process.activity().forEach( function(a) {
if (a.source.length == 0) start.push(a); });
return start;
@aahammer
aahammer / standardProcess.js
Last active December 19, 2015 21:29
Sample process viewer for d3js
var Standard = function(process, svg) {
standard = {}, process = process, svg =svg, view = svg.selectAll().append("svg:g") ;
var initializeData = function() {
// enrich activities with max/min layout coordinates
// and fixate start and end nodes
process.activity().forEach(function(a) {
if (a.isStartNode || a.isEndNode) {
@aahammer
aahammer / processgenerator.js
Last active December 19, 2015 21:29
Small process data generator for simple processes
jproc.processGenerator = function() {
// define the number logical levels and the maximum number
// of different activities on each level
var level =5; var maxActivtiesPerLevel = 5;
var max = {index:maxActivtiesPerLevel-1, level:level-1};
// the matrix will later store the raw process
var matrix = [];
@aahammer
aahammer / analyze_events.sh
Last active December 19, 2015 21:18
Sample snippets for a Node.js Map/Reduce Task
#!bin/bash
# PIGLET_HOME is the path of the TCP Server from Step 2
hadoop jar $HADOOP_PATH/contrib/streaming/hadoop-streaming-1.1.2.jar \
-file $PIGLET_HOME/map_event.js -mapper $PIGLET_HOME/map_event.js \
-file $PIGLET_HOME/reduce_event.js -reducer $PIGLET_HOME/reduce_event.js \
-input /process/event/* -output /process/trace
@aahammer
aahammer / MapReduceTCPServer.js
Created July 17, 2013 09:08
A tcp server for running map/reduce on EC2
var net = require('net');
var spawn = require('child_process').spawn;
var fs = require('fs');
var HOST = process.env.IP;
var PORT = 17000;
//execute a two step map / reduce task
function exec_mapreduce(regexp, callback){
@aahammer
aahammer / RegexEditor.css
Last active December 19, 2015 21:18
A simple regular expression editor
/* red error highlight */
input[type="text"].invalid-entry:focus {
border-color:rgba(232, 149, 60, 0.8);
background #FDD
}
/* green valid highlight */
input[type="text"].valid-entry:focus {
border-color:rgba(60, 232, 149, 0.8);
background #DFD

Hello World