Skip to content

Instantly share code, notes, and snippets.

View qmaruf's full-sized avatar
🤖
Training robot

Quazi Marufur Rahman qmaruf

🤖
Training robot
View GitHub Profile
@qmaruf
qmaruf / gist:10957924
Created April 17, 2014 06:32
c++, pass by ref
// pass by ref example
#include <iostream>
using namespace std;
/*
store memory address using pointer type variable.
int* x : x is a variable to store memory address
of another variable.
*x : use this syntax to access value from memory address.
@qmaruf
qmaruf / gist:1e75e03957b9297c71b9
Last active August 29, 2015 14:00
neo4j, create sample db
#create db
create(a{n:"a"}),(b{n:"b"}),(c{n:"c"}),(d{n:"d"}),(e{n:"e"}),
a-[:parent_of]->b,
a-[:parent_of]->c,
b-[:parent_of]->d,
d-[:parent_of]->e,
e-[:parent_of]->c,
d-[:parent_of]->c;
#do query
@qmaruf
qmaruf / neo4j
Last active August 29, 2015 14:01
START n=node(*)
WHERE has (n.name)
and n.name="Google"
RETURN n
@qmaruf
qmaruf / neo4j
Created May 16, 2014 16:03
neo4j
#count node
START n=node(*)
RETURN count(n)
#count relationship
START r=relationship(*)
RETURN count(r)
#get all nodes
START n=node(*)
RETURN n;
#delete all nodes
MATCH (n)
OPTIONAL MATCH (n)-[r]-()
DELETE n,r
#create db
create(a{n:"a"}),(b{n:"b"}),(c{n:"c"}),(d{n:"d"}),(e{n:"e"}),
a-[:parent_of]->b,
a-[:parent_of]->c,
b-[:parent_of]->d,
d-[:parent_of]->e,
e-[:parent_of]->c,
d-[:parent_of]->c;
#do query
#nodes.csv
Node Rels Property
0 4 TEST
1 0 TEST
2 1 TEST
3 1 TEST
#rels.csv
Start Ende Type Property
0 3 FIVE Property
maruf@leopard:~/Desktop/bi/batch-import$ java -server -Xmx4G -jar target/batch-import-jar-with-dependencies.jar target/db nodes.csv rels.csv
Usage: Importer data/dir nodes.csv relationships.csv [node_index node-index-name fulltext|exact nodes_index.csv rel_index rel-index-name fulltext|exact rels_index.csv ....]
Using: Importer target/db nodes.csv rels.csv
Using Existing Configuration File
Importing 4 Nodes took 0 seconds
Importing 4 Relationships took 0 seconds
pip install --user package-name
@qmaruf
qmaruf / matlab
Created August 14, 2014 05:52
matlab: Display image in separate window
im1 = imread(file1);
im2 = imread(file2);
imshow(im1);
figure, imshow(im2);