To transform the currently opened Graphviz source file (in DOT Language) into a PNG:
{
"cmd": [ "/usr/local/bin/dot", "-Tpng", "-o", "$file_base_name.png", "$file"],
"selector": "source.dot"
}
MATCH (a) -[r]- (s) | |
// use two `WITH` clauses to build a sorted list | |
WITH r, a // a for group by | |
ORDER BY id(r) | |
WITH type(r) AS t, collect(r) AS coll, a | |
// identify duplications | |
WITH t, reduce(s = [], x IN coll| | |
CASE any(y IN coll WHERE id(x) > id(y) | |
AND y.KEY1 = x.KEY1 | |
AND y.KEY2 = x.KEY2) |
To transform the currently opened Graphviz source file (in DOT Language) into a PNG:
{
"cmd": [ "/usr/local/bin/dot", "-Tpng", "-o", "$file_base_name.png", "$file"],
"selector": "source.dot"
}
# Compile `mxnet` | |
git clone --recursive https://github.com/dmlc/mxnet | |
cd mxnet | |
cp make/osx.mk ./config.mk | |
echo "USE_BLAS = openblas" >> ./config.mk | |
echo "ADD_CFLAGS += -I/usr/local/opt/openblas/include" >> ./config.mk | |
echo "ADD_LDFLAGS += -L/usr/local/opt/openblas/lib" >> ./config.mk | |
echo "ADD_LDFLAGS += -L/usr/local/lib/graphviz/" >> ./config.mk | |
make -j$(sysctl -n hw.ncpu) |
-- From CSV to Parquet in favor to Cloudera Impala | |
CREATE EXTERNAL TABLE IF NOT EXISTS [from_table] ( | |
schema DATA_TYPE, | |
... | |
) | |
COMMENT 'A sample of vehicle infomation' | |
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde' | |
WITH SERDEPROPERTIES ( | |
"separatorChar" = ",", | |
"quoteChar" = "\"" |
[List of Adjacent States in US](https://writeonly.wordpress.com/2009/03/20/adjacency-list-of-states-of-the-united-states-us/) | |
/* | |
glench provides a JSON file, and the URL is https://gist.github.com/3906059 | |
Here is a R code to convert the nested list to a paired data frame in R | |
*/ | |
library(dplyr) |
# library(pROC) | |
#---------------------------------- | |
# Compute the ROC | |
#---------------------------------- | |
pROC::roc($pred_p, $actual) | |
pROC::roc( | |
actual ~ pred, | |
data.frame( |
foo = function(...) { | |
list(...) | |
} |
data(iris) | |
# Apply a function to rows | |
row_sum = function(...) { | |
each_row = list(...) | |
# call by position | |
each_row[[1]] + # Sepal.Length | |
each_row[[2]] + # Sepal.Width | |
each_row[[3]] + # Petal.Length |
import threading | |
def thread_worker(*args, **kwargs): | |
pass | |
t1 = threading.Thread(target = thread_worker, args = (elms), kwargs = {key: value}) | |
t1.start() | |
t1.join() | |
# arguments pass to the target function, and |