Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Max De Marzi maxdemarzi

🏠
Working from home
View GitHub Profile
View sharding.cc
// g++-7 sharding.cc -Wall -std=c++17 -g -pthread -O2 -ltbb
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <string>
#include <mutex>
#include <shared_mutex>
#include <optional>
#include <random>
@graphadvantage
graphadvantage / part1-neo4j-marketing-attribution.md
Last active Dec 19, 2019
Neo4j GraphGist: Real-Time Marketing Attribution & Recommendations - Part 1 Marketing Attribution Modeling
View part1-neo4j-marketing-attribution.md

##Neo4j GraphGist - Marketing Recommendations Using Last Touch Attribution Modeling and k-NN Binary Cosine Similarity

Neo4j Use Case: Real-Time Marketing Recommendations

#Part 1. Neo4j Marketing Attribution Models

Introduction

Graphs are well suited for marketing analytics - a natural fit since marketing is principally about relationships. In this GraphGist, we'll take a look at how to use Neo4j to make real-time marketing recommendations.

@jexp
jexp / __numbers_31.txt
Last active Dec 14, 2016
Concurrent Neo4j Performance Tests via HTTP + Cypher (usage: ./_run_ab.sh 4 10000 create_plain.json)
View __numbers_31.txt
Unusable on spinning disk, these results are from an SSD.
1M x create node+rel in 38s, 26k r/s
1M x create 2 nodes, 2 relationships, 2 properties in 47s, 21k r/s -> 80k records / s
1M x create 2 nodes with labels, 2 rels, 0 properties in 140s, 7k r/s
100k x create 100 rel + node -> 10M in 20s, 5k r/s
1M lookups by id in 22s, 43k r/s
1M lookup by id compiled runtime in 21s, 47k r/s
@Geal
Geal / future.c
Last active Mar 13, 2021
small future and promise library in C with pthreads
View future.c
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <stdbool.h>
#include <time.h>
#include <stdarg.h>
#include <string.h>
#include "future.h"
@iambigd
iambigd / gist:10952096
Created Apr 17, 2014
Generating an API Signature - Kayako Developer Resources - Kayako Wiki
View gist:10952096
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.security.GeneralSecurityException;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import org.bouncycastle.util.encoders.Base64Encoder;
View how-to-install-dpdk-on-ubuntu.sh
# If you're looking into the C10M problem (10 million concurrent connections)
# you might want to play with DPDK (Originally proprietry Intel, now open source)
#
# C10M: http://c10m.robertgraham.com/
# DPDK: http://dpdk.org/
#
# This is a quick summary how to install dpdk on ubuntu
# running inside virtualbox on a mac
# On my Mac:
@psuman
psuman / gist:3118359
Created Jul 15, 2012
Neo4j Bootstrapper which registers TransactionEventHandler
View gist:3118359
package org.sample
import java.util.Map;
import org.apache.commons.configuration.Configuration;
import org.neo4j.kernel.EmbeddedGraphDatabase;
import org.neo4j.kernel.GraphDatabaseAPI;
import org.neo4j.server.Bootstrapper;
import org.neo4j.server.NeoServerBootstrapper;
import org.neo4j.server.database.GraphDatabaseFactory;