Skip to content

Instantly share code, notes, and snippets.

View SirVer's full-sized avatar

Holger Rapp SirVer

View GitHub Profile
@SirVer
SirVer / actor_centrality.cc
Created August 15, 2012 18:42
Actor centrality in Cplusplus
#include <set>
#include <string>
#include <map>
#include <fstream>
#include <iostream>
#include <vector>
#include <stdint.h>
using namespace std;
@SirVer
SirVer / actor_centrality.py
Created August 14, 2012 22:59
Actor centrality in Python
#!/usr/bin/env python
# encoding: utf-8
#
def mean(l):
return sum(l, 0.)/len(l)
def centrality_mean(G, v):
dists = {}
next = {v}
@SirVer
SirVer / actor_centrality.jl
Created August 14, 2012 22:59
Actor centrality in Julia
type Node
name::UTF8String
n::Set{Node}
Node(name) = new(name, Set{Node}())
end
typealias Graph Dict{UTF8String, Node}
function get(G::Graph, name)
use("aux", "formatting")
function image_line(image, count, text)
local imgs={}
for i=1,count do
imgs[#imgs + 1] = image
end
local imgstr = table.concat(imgs, ";")
if text ~= nil then
use("aux", "formatting")
return {
text =
rt(
h1("The Barbarian Lumberjack") ..
h2("General:") ..
p(_
[[The lumberjack clears the landscape from trees enabling you to build new houses.<br>
Making check in libasn1parser
make[1]: Entering directory `/tmp/asn1c_vlm/libasn1parser'
make[1]: Nothing to be done for `check'.
make[1]: Leaving directory `/tmp/asn1c_vlm/libasn1parser'
Making check in libasn1fix
make[1]: Entering directory `/tmp/asn1c_vlm/libasn1fix'
make check_fixer
make[2]: Entering directory `/tmp/asn1c_vlm/libasn1fix'
gcc -DHAVE_CONFIG_H -I. -I.. -I../libasn1parser -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT check_fixer.o -MD -MP -MF .deps/check_fixer.Tpo -c -o check_fixer.o check_fixer.c
mv -f .deps/check_fixer.Tpo .deps/check_fixer.Po