Skip to content

Instantly share code, notes, and snippets.

View jnorthrup's full-sized avatar

Jim Northrup jnorthrup

View GitHub Profile
@jnorthrup
jnorthrup / jena query on appengine
Created December 20, 2010 23:57
jena query on appengine
private Model createCacheGzipModel(String url, MemcacheService memcacheService, final String hash) {
final Model model = ModelFactory.createDefaultModel(ReificationStyle.Minimal);
final InputStream inputStream;
try {
inputStream = new java.net.URL(url).openStream();
model.read(inputStream, null);
@jnorthrup
jnorthrup / ModelTx
Created February 28, 2011 04:11
static delegate for jpa em
@Transactional
public void persist() {
ModelTx.persist(this);
}
@Transactional
public void flush() {
ModelTx.flush();
}
package com.talkwheel.server.rfactory.ioc;
import java.util.Properties;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import com.google.inject.AbstractModule;
import com.google.inject.Inject;
package com.talkwheel.model;
import java.util.List;
import java.util.concurrent.Callable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
[ 1.923920] PNP: PS/2 appears to have AUX port disabled, if this is incorrect please boot with i8042.nopnp
[ 1.924404] serio: i8042 KBD port at 0x60,0x64 irq 1
[ 1.924481] mice: PS/2 mouse device common for all mice
[ 1.924534] cpuidle: using governor ladder
[ 1.924536] cpuidle: using governor menu
[ 1.924620] TCP cubic registered
[ 1.924622] NET: Registered protocol family 17
[ 1.924706] registered taskstats version 1
[ 1.925002] Freeing unused kernel memory: 456k freed
[ 1.942218] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
@jnorthrup
jnorthrup / gist:1126906
Created August 5, 2011 04:10
virtuoso config.nice
#!/bin/sh
#
# Created by configure for Virtuoso Open Source Edition 6.1.3
#
# Environment
SHELL="/bin/sh"; export SHELL
/bin/sh "./configure" \
"--with-jdk4=/opt/jdk6/" \
_VPLUGIN_ char *
virtm_http_handler (void *cli, char *err, int max_len,
const char *base_uri, const char *content,
const char *params, const char **lines, int n_lines,
char **head_ret, const char **options, int n_options, char **diag_ret,
int compile_only)
{
zend_file_handle file_handle;
char *ret_str;
box_t *hret;
@jnorthrup
jnorthrup / gist:1265690
Created October 5, 2011 20:54
gae gwt pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<!--
POM generated by gwt-maven-plugin archetype
-->
<modelVersion>4.0.0</modelVersion>
<groupId>omgrentbbq</groupId>
<artifactId>omgrentbbq</artifactId>
@jnorthrup
jnorthrup / gist:2785285
Created May 25, 2012 01:37
metamodel declarative driver
public enum CouchMetaDriver implements AsioVisitor {
@DbKeys({db, docId})
createDb,
@DbKeys({db, docId}) @DbInputUnit(String.class)
createDoc,
@DbResultUnit(String.class) @DbKeys({db, docId})
getDoc,
@jnorthrup
jnorthrup / fastness.log
Created June 29, 2012 21:08
round-trip syncronous couch record insertion! (in debug mode)
testcase
DocPersist.$().db(SOMEDB).validjson("{\"name\":\"a\",\"brand\":\"c\"}").to().fire().tx();
DocPersist.$().db(SOMEDB).validjson("{\"name\":\"b\",\"brand\":\"d\"}").to().fire().tx();
String space = "hal kjfljdskjahkjsdfkajhdf halkjsdf kgasdkjfh hwroeuvbdfhjvb nv ihdfousbkvjlsdfkvbdkjfvpghblkjfgbldkgf,xjbxdl kfjbhxv,vdlkgfhbfkljdflkjh dfjgh bsjdhfg hlhgdvkjhgksdfglhs";
DocPersist.$().db(SOMEDB).validjson("{\"name\":\"" + System.nanoTime() + "\",\"brand\":\"d\",\"crap\":\"" + space + "\"}").to().fire().tx();
DocPersist.$().db(SOMEDB).validjson("{\"name\":\"" + System.nanoTime() + "\",\"brand\":\"d\",\"crap\":\"" + space + "\"}").to().fire().tx();
DocPersist.$().db(SOMEDB).validjson("{\"name\":\"" + System.nanoTime() + "\",\"brand\":\"d\",\"crap\":\"" + space + "\"}").to().fire().tx();
DocPersist.$().db(SOMEDB).validjson("{\"name\":\"" + System.nanoTime() + "\",\"brand\":\"d\",\"crap\":\"" + space + "\"}").to().fire().tx();
DocPersist.$().db(SOMEDB).validjson("{\"name\":\"" +