Skip to content

Instantly share code, notes, and snippets.

View ikwattro's full-sized avatar

Christophe Willemsen ikwattro

View GitHub Profile
/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java -ea -Dclasspath=/Users/ikwattro/dev/graphaware/modules/graph-aided-search/neo4jextlib -Xmx2048m -XX:MaxPermSize=512m -Didea.launcher.port=7542 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 15 CE.app/Contents/bin" -Didea.junit.sm_runner -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA 15 CE.app/Contents/lib/idea_rt.jar:/Applications/IntelliJ IDEA 15 CE.app/Contents/plugins/junit/lib/junit-rt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/lib/javafx-doclet.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_79.
@ikwattro
ikwattro / cypher.txt
Created March 24, 2016 17:13
Tonimoto distance in Cypher
MATCH (input:User) WHERE id(input) = 2
MATCH (input)-[r:LIKES]->(totalMovie)
WITH input, count(totalMovie) as totalUserMovieCount
MATCH (input)-[:LIKES]->(movie)<-[r2:LIKES]-(other)
WITH input, other, totalUserMovieCount, count(movie) as commonMovieCount
MATCH (other)-[:LIKES]->(otherMovie)
WITH input, other, totalUserMovieCount, commonMovieCount, count(otherMovie) as otherMovieCount
RETURN other, commonMovieCount*1.0/(totalUserMovieCount + otherMovieCount - commonMovieCount) as tonimotoDinstance
Name property_name property_value
A weight 64
A height 180
B hair color blond
@ikwattro
ikwattro / statement.json
Created March 8, 2016 19:51
unwind batching
{
"statements": [
{
"statement": "UNWIND {nodes} as x MERGE (o:Object {um: x.umid}) SET o.value = x.value, o.updated = timestamp()",
"parameters": {
"nodes": [
{
"umid": 1,
"value": "bla bla"
},
@ikwattro
ikwattro / Doctrine.php
Created March 3, 2016 16:28 — forked from jakzal/Doctrine.php
Use Doctrine and Symfony Kernel in phpunit tests
<?php
namespace Zalas\Test;
use Doctrine\Common\Persistence\ManagerRegistry;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\Tools\SchemaTool;
trait Doctrine
{
@ikwattro
ikwattro / gist:184dac98db909f5702d9
Created February 21, 2016 02:19 — forked from entaroadun/gist:1653794
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

Whitelist the host for interactive tutorials in neo4j-server.properties file

# Whitelist of hosts for the Neo4j Browser to be allowed to fetch content from.
# Set to '*' to allow all hosts.
dbms.browser.remote_content_hostname_whitelist=http://guides.neo4j.com,https://guides.neo4j.com,http://localhost,https://localhost

Start neo4j server

name city country
aa london UK
bd Berlin Germany
cr helsinki Finland
fe Washington US
200 rows
627 ms
Compiler CYPHER 2.3
Planner COST
Runtime INTERPRETED
+------------------------+----------------+--------+---------+-------------------------------------+------------------------------+
200 rows
494 ms
Compiler CYPHER 2.3
Planner COST
Runtime INTERPRETED
+----------------------+----------------+-------+---------+--------------------------------------+----------------------------------------------------------------------------------------------------------+