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 os | |
import jpype | |
from neo4j import GraphDatabase | |
from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash | |
app = Flask(__name__) | |
app.config.from_object(__name__) | |
app.config['ADMIN'] ='Matthew' | |
app.config['DATABASE']='/tmp/graphtest' |
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
# Split a Wikipedia XML dump | |
# Evan Jones <[email protected]> | |
# April, 2008 | |
# Released under a BSD licence. | |
# http://evanjones.ca/software/wikipedia2text.html | |
import sys | |
import xml.sax | |
def writeArticle(title, text): |
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
# -*- coding: utf-8 -*- | |
""" | |
SCAN: A Structural Clustering Algorithm for Networks | |
As described in http://ualr.edu/nxyuruk/publications/kdd07.pdf | |
""" | |
from collections import deque | |
import numpy as np | |
from scipy.sparse import csr_matrix |
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
/* dbg.h | |
* Taken from Zed A Shaw's awesome debug macros. | |
* Added a bunch of crappy colors to it for my lazy eyes. */ | |
#ifndef __dbg_h__ | |
#define __dbg_h__ | |
#include <stdio.h> | |
#include <errno.h> | |
#include <string.h> | |
#define RESET "\033[0m" |
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
#include<stdio.h> | |
#define TOGETHER (8) | |
int main(void) | |
{ | |
int i = 0; | |
int entries = 50; /* total number to process */ | |
int repeat; /* number of times for while.. */ | |
int left = 0; /* remainder (process later) */ |
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
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<script type="text/javascript" src="http://d3js.org/d3.v2.min.js"></script> | |
<style> | |
svg { | |
font: 10px sans-serif; | |
shape-rendering: crispEdges; | |
} |
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
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<script type="text/javascript" src="http://d3js.org/d3.v2.min.js"></script> | |
<style> | |
svg { | |
font: 10px sans-serif; | |
shape-rendering: crispEdges; | |
} |
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
function memoizeConstantMethod(o, p) { | |
var f = o[p], mf; | |
var s = function(v) {return o[p]=v||mf}; | |
((mf = function() { | |
(s(function(){return value})).reset = mf.reset; | |
return value = f.call(this); | |
}).reset = s)(); | |
} |
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
apt-get install python g++; | |
mkdir ~/nodejs && cd $_; | |
wget -N http://nodejs.org/dist/node-latest.tar.gz; | |
tar xzvf node-latest.tar.gz && cd `ls -rd node-v*`; | |
make install; |
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
#define SWAP(x, y) do { typeof(x) temp##x##y = x; x = y; y = temp##x##y; } while (0) |
OlderNewer