Skip to content

Instantly share code, notes, and snippets.

View KnowledgeGarden's full-sized avatar

Jack Park KnowledgeGarden

View GitHub Profile
@KnowledgeGarden
KnowledgeGarden / ChatComet
Created January 21, 2012 18:13
Chat comet response code
class ChatComet extends CometActor with CometListener {
//Register as a listener with the ChatCometServer
def registerWith = ChatCometServer
//No pre render needed
def render = <br/>
//Proccess messages
//called during update from ChatCometServer
{
"properties": {
"locator": {
"index": "not_analyzed",
"type": "string",
"store": "yes"
},
"instanceOf": {
"index": "not_analyzed",
"type": "string",
self.create = function (blog, user, callback) {
console.log('ARTICLES_CREATE '+JSON.stringify(blog));
var article = new Topic();
article.locator = uuid.newUUID();
article.instanceOf = self.types.BLOG_TYPE;
article.creatorId = user._id;
article.largeIcon = icons.PUBLICATION;
article.smallIcon = icons.PUBLICATION_SM;
//we have to take this apart, build the object from scratch
// because of tags, which are relations.
@KnowledgeGarden
KnowledgeGarden / TQPortalGist-1
Created June 28, 2014 21:56
Testing TQPortal Mongo/Topic/Dataprovider
//Really, three js files in one: the devtest, Topic, and Dataprovider
/**
* textsearchtest
*/
var MongoClient = require('mongodb').MongoClient
, dp = require('../core/dataprovider')
, topic = require('../core/topic');
var myCollection;
{
"topics": {
"mappings": {
"core": {
"properties": {
"lox": {
"index": "not_analyzed",
"type": "string",
"store": true
},
@KnowledgeGarden
KnowledgeGarden / mappingsinit
Created September 15, 2014 23:14
Section of code which initializes mappings
protected void checkIndexes(IResult result) {
List<List<String>>indexes = (List<List<String>>)environment.getProperties().get("IndexNames");
List<String>indices = new ArrayList<String>();
environment.setIndices(indices);
int len = indexes.size();
ImmutableSettings.Builder settings = null;
IndicesExistsRequestBuilder ib;
IndicesExistsResponse ir;
CreateIndexRequest cir;
CreateIndexResponse afr;
@KnowledgeGarden
KnowledgeGarden / gist:4f9552ed2774fc7836dc
Created December 22, 2014 19:44
Node Ubuntu/Windoz code
The relation struct:
var struct = module.exports = function(relationType, relationLocator, relationLabel, documentSmallIcon,
documentLocator, documentLabel, documentType, sORt) {
var result = {};
result.relationLocator = relationLocator;
result.relationType = relationType;
result.relationLabel = relationLabel;
result.documentType = documentType;
result.icon = documentSmallIcon;
result.locator = documentLocator;
Executing command: "build"
:generateTypeSystem
:compileJavaC:\projects\SolrWatson\QuestionAnswering\YodaQA-APACHE\yodaqa\build\generated-src\jcasgen\main\de\tudarmstadt\ukp\dkpro\core\api\lexmorph\type\morph\Morpheme.java:17: error: duplicate class: de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.morph.Morpheme
public class Morpheme extends Annotation {
^
C:\projects\SolrWatson\QuestionAnswering\YodaQA-APACHE\yodaqa\build\generated-src\jcasgen\main\de\tudarmstadt\ukp\dkpro\core\api\lexmorph\type\morph\Morpheme_Type.java:19: error: duplicate class: de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.morph.Morpheme_Type
public class Morpheme_Type extends Annotation_Type {
^
C:\projects\SolrWatson\QuestionAnswering\YodaQA-APACHE\yodaqa\build\generated-src\jcasgen\main\de\tudarmstadt\ukp\dkpro\core\api\lexmorph\type\morph\MorphologicalFeatures.java:17: error: duplicate class: de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.morph.MorphologicalFeatures
public class MorphologicalFeatures extends Annotation
@KnowledgeGarden
KnowledgeGarden / gist:90cecd04d0de14809253
Last active February 7, 2017 09:23
BZ2 Importer for YodaQA
import java.io.*;
import javax.swing.JFileChooser;
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
/**
* @author park
* @license Apache 2
*/
@KnowledgeGarden
KnowledgeGarden / BlazegraphTest1
Created April 12, 2015 17:09
Blazegraph test 1
The embedded driver:
public class EmbeddedDriver implements IGraphDriver {
private JSONGraphStoreEnvironment environment;
//TODO make this a config property
private final String DBPATH = "/data/bg/mygraphjournal";
private BigdataGraph _MyGraph;
public EmbeddedDriver() {}
@Override