Skip to content

Instantly share code, notes, and snippets.

@amergin
amergin / dump_after_warming_idle.txt
Created December 31, 2012 00:31
jstack after warming the cache, at idle, CPU ~33%.
2012-12-31 02:25:57
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.10-b01 mixed mode):
"Attach Listener" daemon prio=10 tid=0x00007ff318003800 nid=0x63fe waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"712944945@qtp-2058324786-3" prio=10 tid=0x00007ff2a8003800 nid=0x63d0 in Object.wait() [0x00007ff25502e000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000005202a9ef0> (a org.mortbay.thread.QueuedThreadPool$PoolThread)
@amergin
amergin / gist:4262270
Created December 11, 2012 21:27
Cypher branching example
START a = node(137059)
MATCH a-[rel]->b
WITH a,b,rel
ORDER BY rel.pvalue DESC LIMIT 5
MATCH b-[rel2]->c
WITH a,b,c,rel,rel2
ORDER BY rel2.pvalue DESC LIMIT 5
RETURN a.label?, rel.pvalue, b.label?, b.source, rel2.pvalue, c.label?, c.source;
@amergin
amergin / gist:3960966
Created October 26, 2012 19:35
Neo4j autocomplete test
eo4j-sh (0)$ start a=node:cbm_pc_quantrev_0706_i_n_GEXP('label:TP53') return id(a);
==> +-------+
==> | id(a) |
==> +-------+
==> | 48228 |
==> +-------+
==> 1 row
==> 249 ms
==>
neo4j-sh (0)$ start a=node:cbm_pc_quantrev_0706_i_n_GEXP('label:T*') return count(a);
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<style type="text/css">
.options { font-family:"Times New Roman", Times, serif; text-size: 12px; text-color: #A8A8A8; margin: 0px auto; background-color: #E3E3E3;}
.full-height { height: 800px; margin: 0 0; padding: 0 0; width: 800px; }
</style>
<script type='text/javascript' src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type='text/javascript' src="lib/cytoscape.js"></script>
@amergin
amergin / gist:3873399
Created October 11, 2012 16:01
cypher test
START node1=node(1456) MATCH node1-[rel1]->node2
WITH node1, rel1, node2 ORDER BY rel1.distance! ASC LIMIT 10
MATCH node2-[rel2]->node3
WHERE node3 <> node1
WITH node2,node3, rel2, rel1 ORDER BY rel2.distance! ASC LIMIT 10
MATCH node3-[rel3]->node4
WHERE node4 <> node2
RETURN DISTINCT rel1, rel2, rel3
ORDER BY rel2.distance! ASC LIMIT 10;
@amergin
amergin / gremlin-test1.groovy
Created October 10, 2012 17:59
Gremlin test script for bulbs
def regulatory(clinicalNodeId, distanceThreshold, middleNodeType, mutatedType, targetType) {
if( targetType == 'GNAB' )
{
if( mutatedType == 'aberrated' )
{
/*distanceThreshold = 100000;
middleNodeType = 'GEXP';
clinicalNodeId = 137059;
mutatedType = 'aberrated';
targetType = 'GNAB'; */
# -*- coding: utf-8 -*-
# Modified lightsocket import script, based on Lightsocket
# example script by James Thornton (http://jamesthornton.com)
# mundane modification stuff
import os
import commands
import sys
import datetime
import re # regexp
# -*- coding: utf-8 -*-
# Class implementation for importing stuff to Neo4j
# based on Lightsocket examples by
#James Thornton (http://jamesthornton.com)
from java.lang import Long, Double, Integer, String
from com.tinkerpop.rexster.util import ElementHelper
from com.tinkerpop.blueprints.pgm.impls.neo4j import Neo4jGraph
from com.tinkerpop.blueprints.pgm.impls.neo4jbatch import Neo4jBatchGraph
# -*- coding: utf-8 -*-
# Modified lightsocket import script, based on Lightsocket
# example script by James Thornton (http://jamesthornton.com)
# mundane modification stuff
import os
import commands
import sys
import datetime
import re # regexp
@amergin
amergin / output.txt
Last active August 29, 2015 14:26
Math.js regression performance problem, code
_xMatrixTransp size = 2,4084
_xMatrix size = 4084
_normalTargetData size = 4084