Skip to content

Instantly share code, notes, and snippets.

@amergin
amergin / messages.log
Created December 31, 2012 00:35
messages.log, relevant parts
2012-12-31 00:23:14.528+0000 INFO [o.n.k.i.DiagnosticsManager]: --- INITIALIZED diagnostics START ---
2012-12-31 00:23:14.529+0000 INFO [o.n.k.i.DiagnosticsManager]: Neo4j Kernel properties:
2012-12-31 00:23:14.532+0000 INFO [o.n.k.i.DiagnosticsManager]: neostore.propertystore.db.mapped_memory=3000M
2012-12-31 00:23:14.533+0000 INFO [o.n.k.i.DiagnosticsManager]: cache_type=gcr
2012-12-31 00:23:14.533+0000 INFO [o.n.k.i.DiagnosticsManager]: read_only=true
2012-12-31 00:23:14.533+0000 INFO [o.n.k.i.DiagnosticsManager]: use_memory_mapped_buffers=true
2012-12-31 00:23:14.533+0000 INFO [o.n.k.i.DiagnosticsManager]: neostore.nodestore.db.mapped_memory=50M
2012-12-31 00:23:14.533+0000 INFO [o.n.k.i.DiagnosticsManager]: ha.pull_interval=10
2012-12-31 00:23:14.533+0000 INFO [o.n.k.i.DiagnosticsManager]: neostore.relationshipstore.db.mapped_memory=1200M
2012-12-31 00:23:14.533+0000 INFO [o.n.k.i.DiagnosticsManager]: neostore.propertystore.db.strings.mapped_memory=1000M
@amergin
amergin / vmstat_idle_3min.txt
Created January 1, 2013 18:22
timeout 3m vmstat 3 > ~/vmstat_loading_3min.txt
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 175424 6648152 656812 17511332 0 0 38 20 0 0 1 1 98 0 0
1 0 175424 6648136 656812 17511336 0 0 0 4 3436 21147 1 2 97 0 0
0 0 175424 6648136 656816 17511336 0 0 0 11 3361 21589 1 2 97 0 0
0 0 175424 6648136 656816 17511336 0 0 0 5 3418 21793 1 2 97 0 0
0 0 175424 6648136 656816 17511336 0 0 0 4 3687 21588 1 2 97 0 0
0 0 175424 6648136 656816 17511344 0 0 3 16 3599 21750 1 2 97 0 0
0 0 175424 6647988 656820 17511348 0 0 0 21 3850 22033 1 2 97 0 0
0 0 175424 6647988 656820 17511348 0 0 0 3 3926 21425 1 2 96 0 0
@amergin
amergin / vmstat_loading.txt
Created January 1, 2013 18:23
vmstat while warming the graph.
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 175424 7509264 656956 17513120 0 0 38 20 0 0 1 1 98 0 0
1 0 175424 7487780 656968 17517780 0 0 1651 0 5169 22462 5 4 88 4 0
1 0 175424 7450576 656976 17518080 0 0 5 156 7185 24458 21 3 76 0 0
1 0 175424 7453236 656976 17518080 0 0 0 168 5435 22729 12 4 83 0 0
1 0 175424 7428040 656984 17518080 0 0 0 4 5201 20206 13 3 84 0 0
9 0 175424 7370016 656984 17518080 0 0 0 12 7874 21739 25 4 71 0 0
3 0 175424 7312612 656988 17518084 0 0 1 11 7502 22395 22 4 73 0 1
2 0 175424 7277488 656988 17518084 0 0 0 47 7545 23143 26 5 69 0 1
@amergin
amergin / angular-packery.js
Created August 6, 2014 00:24
Angular-masonry fork for Packery.js
/*!
* angular-packery
* Forked from angular-masonry (Pascal Hartig, weluse GmbH, http://weluse.de/)
*/
(function () {
'use strict';
angular.module('wu.packery', []).controller('PackeryCtrl', [
'$scope',
'$element',
'$timeout',
@amergin
amergin / dc.problem.seriesChart.js
Created December 30, 2014 16:50
Problem with DC.js series chart grouping and sorting
var createSVG = function($scope, config) {
var getLabel = function(variable, circle) {
return variable + " (" + circle.name() + ")";
};
var getLabels = function() {
var ret = [];
_.each(config.groups, function(group, name) {
_.each( $scope.filterOnSet(group, name).all(), function(obj) {
var circle = obj.key.circle;
this.getReducedSTD = function(dimensionGroup, variable) {
// see https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Decremental_algorithm
var reduceAdd = function (p, v) {
var obj = p;
var value = +v.variables[variable];
if( _.isNaN(value) ) {
//pass
} else {
obj.n = obj.n + 1;
var oldM2 = obj.M2;
this.getReducedSTD2 = function(dimensionGroup, variable) {
// see https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
var reduceAdd = function (p, v) {
var value = +v.variables[variable];
if( _.isNaN(value) ) {
//pass
}
else {
if( p.n === 0 ) {
p.k = value;
var t = beta / _sqrt;
console.log("degrees", degrees);
console.log("beta", beta, "sqrt", _sqrt);
console.log("t=", t, "tprob=", statDist.tprob(degrees, t));
var pvalue = 2 * (1 - statDist.tprob(degrees, t));
console.log("pvalue=", pvalue);
Tulosteet ylläolevasta:
degrees 82 (program):64
beta 1.0097334538696747 sqrt 0.015688694906613447 (program):65
@amergin
amergin / stretch_colors.js
Last active August 29, 2015 14:24
Stretch available color range to be used based on the values
// Specs:
// - As a default, the colour range should be scaled so, that at least 70% (..ish) of the colour range is available for the data shown.
// Example: we have a map with lowest positive correlation at r=0.85 and highest at r=0.99 while the negative correlations span from r=-0.2 to r=-0.35. The desired colour range would then be as follows:
// 100% red at r=0.99,
// 30% red at r=0.85,
// white at r=0,
// 30% blue at r=-0.2 and
// 100% blue at r=-0.35.
function CustomScale() {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.