View node_exit_handler.js
* Efficient Exit Handler
* @author Loreto Parisi (loretoparisi at gmail dot com)
* @2018 Loreto Parisi
var addExitHandler = function (params, exitCallback) {
var self = this;
var options={
ignoreUncaughtException: false
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
View lda.js
* Latent Dirichlet Allocation
* Based on javascript implementation
* @author Loreto Parisi (loretoparisi at gmail dot com)
"use strict";
* Based on javascript
View json_traverse.php
$json = array(
"12472" => array(
"ABC" => "foo data1",
"BAC" => "foo data2",
"DAE" => "foo data3"),
"12484" => array(
"LCD" => "foo data1")
inp = Input(shape=(maxlen,), name="text_input") # featureized text comes in here
x = Embedding(embedding_matrix.shape[0], embed_size, weights=[embedding_matrix], trainable=True)(inp)
x = Dense(some_num_here, activation="relu")(x)
extra_data = Input(shape=(1,), name="extra_data") # your continous features comes in here
combined = concatenate([x, extra_data])
# maybe some ReLu + Dropout here
View unicode.js
// @see
// @see
var UnicodeCategories = {
ZWNJ : /\u200C/,
ZWJ : /\u200D/,
TAB : /\u0009/,
VT : /\u000B/,
FF : /\u000C/,
SP : /\u0020/,
NBSP : /\u00A0/,
View jsmin.c
/* jsmin.c
Copyright (c) 2002 Douglas Crockford (
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
git init
git add .
git commit -m "First commit"
git remote add origin $GIT_REMOTE_ORIGIN
git remote -v
git pull --allow-unrelated-histories origin master
git push -u origin master
awk -F"," 'BEGIN { OFS="" ; ORS="" } ; { for (i=1; i<9; i++ ) print $i ","; print substr($NF,0,20) "\n"}' file.csv
def smart_procrustes_align_gensim(base_embed, other_embed, words=None):
"""Procrustes align two gensim word2vec models (to allow for comparison between same word across models).
Code ported from HistWords <> by William Hamilton <>.
(With help from William. Thank you!)
First, intersect the vocabularies (see `intersection_align_gensim` documentation).
Then do the alignment on the other_embed model.
Replace the other_embed model's syn0 and syn0norm numpy matrices with the aligned version.
Return other_embed.