Skip to content

Instantly share code, notes, and snippets.

View maxdemarzi's full-sized avatar
🏠
Working from home

Max De Marzi maxdemarzi

🏠
Working from home
View GitHub Profile
@maxdemarzi
maxdemarzi / connected-components-bfs.cpp
Created May 26, 2022 15:16 — forked from Ch-sriram/connected-components-bfs.cpp
Count Number of Connected Components [TC: O(V+E); SC: O(V+E)]
#include <queue>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
void addEdge(vector<int> *adj, int u, int v) {
adj[u].push_back(v);
adj[v].push_back(u);
}
@maxdemarzi
maxdemarzi / hello_julia.lua
Created April 7, 2022 05:49 — forked from ihnorton/hello_julia.lua
Calling Julia from LuaJIT via a shared library
ffi = require("ffi")
julia = ffi.load("/Users/inorton/git/julia/usr/lib/libjulia.dylib", true)
ffi.cdef[[
void jl_eval_string(const char*);
void jl_init(const char*);
]]
julia.jl_init("/Users/inorton/git/julia/usr/lib/")
julia.jl_eval_string(" println(\"hello, world\") ")
-- should print "hello, world"
#include <fstream>
#include <scripting/ModException.hpp>
#include <sanity.hpp>
#include "LuaSecurity.hpp"
using namespace scripting;
namespace {
void copyAll(sol::environment &env, const sol::global_table &globals,
@maxdemarzi
maxdemarzi / __usage.adoc
Last active December 8, 2021 10:49 — forked from jexp/__numbers_31.txt
Concurrent Neo4j Performance Tests via HTTP + Cypher (usage: ./_run_ab.sh 4 10000 create_plain.json)

Usage

Use latest Neo4j for best results, e.g. 2.2.2 or 2.3.0-M02 (http://neo4j.com/download) On a machine with 12 cores use concurrency 24

Create 1 node, 1 rel, 1 property per request, 1M requests

Total: 1M nodes, rels, props