Skip to content

Instantly share code, notes, and snippets.

View spmallette's full-sized avatar

stephen mallette spmallette

View GitHub Profile
<ivysettings>
<settings defaultResolver="downloadGrapes"/>
<resolvers>
<chain name="downloadGrapes">
<!--
<filesystem name="cachedGrapes">
<ivy pattern="${user.home}/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml"/>
<artifact pattern="${user.home}/.groovy/grapes/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
</filesystem>
-->
Gremlin.version()
g = TinkerGraph.open().traversal()
g.addV('bolt').property(set,'xyz','1-1-1').property(set,'xy','1-1').property('val', 12).as('A').
addV('bolt').property(set,'xyz','2-1-2').property(set,'xyz','3-1-1').property(set,'xy','2-1').property(set, 'xy','3-1').property('val', 10).as('B').
addV('bolt').property(set,'xyz','3-1-2').property(set,'xy','3-1').property('val', 15).as('C').
addV('bolt').property(set,'xyz','2-1-1').property(set,'xy','2-1').property('val', 5).as('D').
addE('link').from('A').to('B').
addE('link').from('A').to('C').
addE('link').from('A').to('D').
addE('link').from('B').to('A').
[INFO] --- asciidoctor-maven-plugin:1.5.5:process-asciidoc (reference-book) @ tinkerpop ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] ignoreDelta true
[INFO] Copying 0 resource
asciidoctor: ERROR: preface.asciidoc: line 20: invalid part, must have at least one section (e.g., chapter, appendix, etc.)
asciidoctor: WARNING: intro.asciidoc: line 26: list item index: expected 2, got 1
asciidoctor: WARNING: intro.asciidoc: line 27: list item index: expected 3, got 1
asciidoctor: WARNING: the-traversal.asciidoc: line 731: callout list item index: expected 4 got 3
asciidoctor: WARNING: the-traversal.asciidoc: line 732: callout list item index: expected 5 got 4
asciidoctor: WARNING: the-traversal.asciidoc: line 733: callout list item index: expected 6 got 5
@spmallette
spmallette / copy.sh
Last active September 4, 2019 19:53
python graphbinary
cp ../../src/main/jython/gremlin_python/structure/io/graphbinaryV1.py gremlin_python/structure/io/graphbinaryV1.py
cp ../../src/main/jython/gremlin_python/driver/serializer.py gremlin_python/driver/serializer.py
g.V().bothE().limit(1).otherV().
path().
by(valueMap(true)).
by(union(valueMap(true),
project('inV','outV','inVLabel','outVLabel').
by(inV().id()).
by(outV().id()).
by(inV().label()).
by(outV().label())).unfold().
group().
  1. git clone https://github.com/spmallette/rouge
  2. cd rouge
  3. git checkout mm-adt
  4. Build the gem: $ gem build rouge.gemspec
  5. Locally install the gem: $ gem install --local rouge-3.4.1.pre.mmadt.gem
  6. In the terminal where you are running asciidoctor set the ROUGE_VERSION environment variable: $ export ROUGE_VERSION=3.4.1.pre.mmadt
  7. Use mmadt as the "format" as in [source,mmadt] within asciidoc files.
  8. Set the source-highlighter to "rouge".
  9. $ asciidoctor -a source-highlighter=rouge -a rouge-style=thankful_eyes *.adoc -D html/
public static Number min(final Number a, final Number b) {
return isNonValue(a) ? b :
isNonValue(b) ? a :
getHelper(getHighestCommonNumberClass(a, b)).min.apply(a, b);
}
public static Comparable min(final Comparable a, final Comparable b) {
if (a instanceof Number && b instanceof Number) {
return min((Number) a, (Number) b);
}
gremlin> java.util.stream.IntStream.range(0, 10000).iterator()
==>0
==>1
==>2
==>3
==>4
...
==>348
==>349
==>350
gremlin> g.addV("person").property(VertexProperty.Cardinality.single, "k", "v").
......1> property(T.id , "id").
......2> property(VertexProperty.Cardinality.list, "l", 1).
......3> property("x", "y").
......4> property(VertexProperty.Cardinality.list, "l", 2).
......5> property("m", "m", "mm", "mm").
......6> property("y", "z").profile()
org.apache.tinkerpop.gremlin.structure.T$2 cannot be cast to java.lang.String
Type ':help' or ':h' for help.
Display stack trace? [yN]n
Benchmark Mode Cnt Score Error Units
TraversalConstructionBenchmark.constructLong thrpt 20 69158.200 ± 2896.561 ops/s
TraversalConstructionBenchmark.constructMedium thrpt 20 183529.090 ± 9781.608 ops/s
TraversalConstructionBenchmark.constructMediumWithBindings thrpt 20 161881.585 ± 4653.668 ops/s
TraversalConstructionBenchmark.constructShort thrpt 20 1012200.407 ± 26662.944 ops/s
TraversalConstructionBenchmark.constructShortWithMapArgument thrpt 20 58581.459 ± 3734.211 ops/s
TraversalConstructionBenchmark.testAddVAddEWithPropsChained thrpt 20 3269.800 ± 106.465 ops/s
TraversalConstructionBenchmark.testAddVWithPropsChained thrpt 20 732.323 ± 22.541 ops/s