Skip to content

Instantly share code, notes, and snippets.

View spmallette's full-sized avatar

stephen mallette spmallette

View GitHub Profile
gremlin> g = new Neo4jGraph('/tmp/neo4jtesting/')
==>neo4jgraph[EmbeddedGraphDatabase [C:\tmp\neo4jtesting]]
gremlin> g.createKeyIndex("test", Vertex.class)
==>null
gremlin> v = ['a','b','c','d','e','f','g']
==>a
==>b
==>c
==>d
==>e
select dr.provider_id, dr.provider_name_last name_last, provider_name_first as name_first,
geo.geo_name as census_region, dr.primary_addr_line_1, dr.primary_addr_city, dr.primary_addr_realm as [state],
dr.primary_addr_zip as zip, provider_email,
cana.ani_index, stat_iv.stat_rank as iv, stat_msl.stat_rank as msl,
cana.rivermsl, cana.[rank], cana.imputeadv, cana.imputeprom,
stat_msl.stat_custom_3 as rm_national, stat_msl.stat_custom_4 as rm_expert,
dros.role_ct, ims.SPEC ims_specialty, ims.OVERALL_RATING as ims_rank,
drdec.provider_decile_rank as dec_oad,
case stat_iv.stat_custom_8 when 0 then '6. Non-Writer'
when 1 then '5. Laggards'
<store>
<name>group</name>
<persistence>bdb</persistence>
<routing>client</routing>
<replication-factor>3</replication-factor>
<required-reads>2</required-reads>
<required-writes>2</required-writes>
<key-serializer>
<type>json</type>
<schema-info>"string"</schema-info>
@spmallette
spmallette / gist:3067060
Created July 7, 2012 16:21
google maps api
<script type="text/javascript">
function initialize() {
var myLatLng = new google.maps.LatLng(24.886436490787712, -70.2685546875);
var myOptions = {
zoom: 5,
center: myLatLng,
mapTypeId: google.maps.MapTypeId.TERRAIN
};
var bermudaTriangle;
var map = new google.maps.Map(document.getElementById("map_canvas"),
package com.tinkerpop.blueprints.util.wrappers.batch.cache;
import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.Vertex;
import java.util.HashMap;
import java.util.Map;
/**
* (c) Matthias Broecheler ([email protected])
INSERT INTO org_family_key_account
VALUES (14096,32),
(2211,32),
(14082,32),
(3017,50),
(3127,50),
(3389,50),
(3555,50),
(5858,50),
(8634,50),
@spmallette
spmallette / gist:3193858
Created July 28, 2012 16:08
Timing Batch Scripts
REM source: http://www.thesysadminhimself.com/2011/03/calculating-time-difference-in-batch.html
FOR /F "skip=1 tokens=1-6" %%A IN ('WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Second /Format:table ^| findstr /r "."') DO (
set Milisecond=%time:~9,2%
set Day=%%A
set Hour=%%B
set Minute=%%C
set Second=%%D
)
set /a Start=%Day%*8640000+%Hour%*360000+%Minute%*6000+%Second%*100+%Milisecond%
curl http://localhost:8182/graphs/neo4jsample/keyindices/
{"version":"2.1.0-SNAPSHOT","keys":{"edge":[],"vertex":[]},"queryTime":4.111137}
curl -X POST http://localhost:8182/graphs/neo4jsample/keyindices/vertex/name
{"version":"2.1.0-SNAPSHOT","queryTime":44.829999}
curl http://localhost:8182/graphs/neo4jsample/keyindices/
{"version":"2.1.0-SNAPSHOT","keys":{"edge":[],"vertex":["name"]},"queryTime":0.017321}
curl -X POST http://localhost:8182/graphs/neo4jsample/vertices?name=marko
{"message":"It is not possible to mutate a ReadOnlyGraph","error":"It is not possible to mutate a ReadOnlyGraph"}
@spmallette
spmallette / stacktrace.txt
Created August 16, 2012 19:28
minerva - titan stack trace
2012-08-16 18:49:21,809 WARN DbPedia - Could not complete parse of [external_links_en.nt.bz2]. Continuing with next file if there is one (stack trace follows)
com.thinkaurelius.titan.core.GraphStorageException: Exception in storage backend.
at com.thinkaurelius.titan.diskstorage.cassandra.CassandraThriftOrderedKeyColumnValueStore.mutateMany(CassandraThriftOrderedKeyColumnValueStore.java:407)
at com.thinkaurelius.titan.diskstorage.writeaggregation.BufferStoreMutator.flushInternal(BufferStoreMutator.java:86)
at com.thinkaurelius.titan.diskstorage.writeaggregation.BufferStoreMutator.mutate(BufferStoreMutator.java:68)
at com.thinkaurelius.titan.diskstorage.writeaggregation.BufferStoreMutator.mutateEdges(BufferStoreMutator.java:35)
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.persist(StandardTitanGraph.java:693)
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.save(StandardTitanGraph.java:642)
at com.thinkaurelius.titan.graph
@spmallette
spmallette / gist:3550585
Created August 31, 2012 09:08
OrientDB Classes
gremlin> graph = new OrientGraph("local:/tmp/orientgraph1")
==>orientgraph[local:/tmp/orientgraph1]
gremlin> graph.getRawGraph().setUseCustomTypes(true);
==>null
gremlin> graph.getRawGraph().createVertexType("Product");
==>Product
gremlin> graph.getRawGraph().createVertexType("Customer");
==>Customer
gremlin> graph.getRawGraph().createEdgeType("Sell");
==>Sell