- https://jamesthornton.com#EXIWlRrkjKE
- https://twitter.com/Rangers/status/1641554510605611011
- https://twitter.com/astros/status/1641996751618940936
- https://www.youtube.com/watch?v=S7c3lzpDkvQ#7SlILk2WMTI
- https://gist.github.com/espeed/dd3026536ec3d38afea1072941670f52#3ch6eXkQWU8-C5TDc46E1G4-trIjpVH8h88-UcW056B9jeQ-LvG_M_fAkXU
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From ce55883e1009c70108bd7503e89c896bb8838fe1 Mon Sep 17 00:00:00 2001 | |
From: James Thornton <james@jamesthornton.com> | |
Date: Fri, 10 Jun 2011 21:44:19 -0500 | |
Subject: [PATCH] Setting self.body to None breaks oauth2/init.py line 493. | |
Changed the body default from None to empty string. | |
--- | |
flaskext/oauth.py | 6 +++--- | |
1 files changed, 3 insertions(+), 3 deletions(-) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Talk to Redis while you walk Gremlin | |
// by James Thornton, http://jamesthornton.com | |
import redis.clients.jedis.*; | |
Jedis jedis = new Jedis("localhost"); | |
g = TinkerGraphFactory.createTinkerGraph(); | |
talk2redis = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Neo4j Jython Example | |
# by James Thornton, http://jamesthornton.com | |
from org.neo4j.kernel import EmbeddedGraphDatabase | |
from org.neo4j.kernel import Config | |
from org.neo4j.graphdb import DynamicRelationshipType | |
class Database(object): | |
def __init__(self,path,config=None): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have a recursive Python function that builds a tree, and I'm trying to translate it into Groovy. | |
Here's the Python version... | |
def get_tree(vertices): | |
results = [] | |
if type(vertices) != list: | |
vertices = [vertices] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Rebuild a graph's vertices index from Gremlin | |
gremlin> g = TinkerGraphFactory.createTinkerGraph() | |
gremlin> index = g.getIndex('vertices',Vertex) | |
gremlin> AutomaticIndexHelper.reIndexElements(g, index, g.getVertices()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle | |
from redis import Redis | |
from bulbs.graph import Graph | |
# https://github.com/espeed/bulbs | |
# https://github.com/andymccurdy/redis-py | |
g = Graph() | |
redis = Redis() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@prefix lib: <http://www.swi-prolog.org/rdf/library/> . | |
@prefix owl: <http://www.w3.org/2002/07/owl#> . | |
@prefix dcterms: <http://purl.org/dc/terms/> . | |
@prefix wn30: <http://purl.org/vocabularies/princeton/wn30/> . | |
@prefix wnschema: <http://purl.org/vocabularies/princeton/wordnet/schema#> . | |
@prefix basic: <basic/> . | |
@prefix full: <full/> . | |
@prefix standoff: <standoff/> . | |
@prefix wn20map: <wn20mappings/> . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Wordnet 3.0 Jython Loader Example | |
from org.openrdf.rio import RDFHandler | |
from org.openrdf.rio import RDFHandlerException | |
from org.openrdf.rio import RDFParseException | |
from org.openrdf.rio import ParseErrorListener | |
from org.openrdf.rio.turtle import TurtleParser | |
from org.openrdf.sail import Sail | |
from org.openrdf.sail import SailConnection | |
from org.openrdf.sail import SailException |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ jython load2.py | |
. | |
. | |
. | |
. | |
. | |
Current number of operations counted 53 | |
Number of commits that have occured 5 | |
Closing commit manager... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Jython Wordnet 3.0 Loader Example 2 | |
# by James Thornton, http://jamesthornton.com | |
from org.openrdf.rio import RDFHandler | |
from org.openrdf.rio import RDFHandlerException | |
from org.openrdf.rio import RDFParseException | |
from org.openrdf.rio import ParseErrorListener | |
from org.openrdf.rio.turtle import TurtleParser | |
from org.openrdf.sail import Sail | |
from org.openrdf.sail import SailConnection |
OlderNewer