Skip to content

Instantly share code, notes, and snippets.

@hoavt-54
hoavt-54 / neo4j_demo.py
Created January 12, 2018 16:20
An example of using Neo4j
"""
install python connection driver
pip install neo4j-driver
"""
from neo4j.v1 import GraphDatabase, basic_auth
def __call__(self, inputs, ctx, state, scope=None):
"""Long short-term memory cell (LSTM)."""
with vs.variable_scope(scope or "basic_lstm_cell"):
# Parameters of gates are concatenated into one multiply for efficiency.
if self._state_is_tuple:
c, h = state #[batch_size, hidden_dim]
else:
c, h = array_ops.split(value=state, num_or_size_splits=2, axis=1)
#reshape ctx first since now its shape is [batch_size, num_feats, feat_dim]
ctx_dim = 100
----- pid 7104 at 2017-07-23 01:32:44 -----
Cmd line: com.android.chrome
ABI: arm
Build type: optimized
Loaded classes: 7020 allocated classes
Intern table: 7204 strong; 1326 weak
JNI: CheckJNI is off; globals=1087 (plus 570 weak)
Libraries: /data/app/com.android.chrome-1/lib/arm/libchromium_android_linker.so /system/lib/libandroid.so /system/lib/libaudioeffect_jni.so /system/lib/libcompiler_rt.so /system/lib/libjavacrypto.so /system/lib/libjnigraphics.so /system/lib/libmedia_jni.so /system/lib/librs_jni.so /system/lib/libsoundpool.so /system/lib/libwebviewchromium_loader.so libjavacore.so (11)
Heap: 15% free, 10MB/12MB; 131898 objects
Dumping cumulative Gc timings
@hoavt-54
hoavt-54 / NonOverScrollViewPager.java
Created April 9, 2015 12:33
ViewPager - disabled overscroll
package com.iiinews.widget;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Resources;
# Formatted for readability
SELECT src, src_height, src_width, src_small, src_small_height, src_small_width
FROM photo
WHERE pid IN (SELECT pid
FROM photo_tag
WHERE subject='243117879034102' )
OR
pid IN (SELECT pid
FROM photo
WHERE aid IN (SELECT aid