This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sequence_fixed_len_numeric_column(key, | |
shape=(1, ), | |
default_value=0., | |
dtype=dtypes.float32, | |
normalizer_fn=None): | |
shape = fc._check_shape(shape=shape, key=key) | |
if not (dtype.is_integer or dtype.is_floating): | |
raise ValueError('dtype must be convertible to float. ' 'dtype: {}, key: {}'.format(dtype, key)) | |
if normalizer_fn is not None and not callable(normalizer_fn): | |
raise TypeError('normalizer_fn must be a callable. Given: {}'.format(normalizer_fn)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import tensorflow as tf | |
def _stack_past(x, steps): | |
"""Stack the past data for each step. | |
Ex. x = [0, ..., 60]. steps = [10, 20] | |
Result [x, x[:-10], x[:-20]] normalized to the same shape | |
""" | |
# Sort the steps in ascending order [10, 20] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Script to illustrate usage of tf.estimator.Estimator in TF v1.3""" | |
import tensorflow as tf | |
from tensorflow.examples.tutorials.mnist import input_data as mnist_data | |
from tensorflow.contrib import slim | |
from tensorflow.contrib.learn import ModeKeys | |
from tensorflow.contrib.learn import learn_runner | |
# Show debugging output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
#i tried it and working like charm just have to note make the file .sh chmod +x and you may need sudo to run with permission but be carefull with sudo | |
#be sure the $JAVA_HOME is configure correctly or make it static as commentedline 7 below | |
OLDDIR="$PWD" | |
if [ -z "$CACERTS_FILE" ]; then | |
# you should have java home configure to point for example /usr/lib/jvm/default-java/jre/lib/security/cacerts | |
CACERTS_FILE=$JAVA_HOME/jre/lib/security/cacerts | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
#i tried it and working like charm just have to note make the file .sh chmod +x and you may need sudo to run with permission but be carefull with sudo | |
#be sure the $JAVA_HOME is configure correctly or make it static as commentedline 7 below | |
OLDDIR="$PWD" | |
if [ -z "$CACERTS_FILE" ]; then | |
# you should have java home configure to point for example /usr/lib/jvm/default-java/jre/lib/security/cacerts | |
CACERTS_FILE=$JAVA_HOME/jre/lib/security/cacerts | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// non-blocking --- event loop | |
const resolveAsync = () => | |
new Promise((resolve) => { | |
setTimeout(() => { | |
resolve('something'); | |
}, 100); | |
}); | |
const rejectAsync = () => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {component} from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { renderToString } from 'react-dom/server'; | |
let ReactLayout = {}; | |
ReactLayout._domLoaded = false; | |
ReactLayout._rootProps = {}; | |
ReactLayout._readyCallbacks = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
machine github.com | |
login technoweenie | |
password SECRET | |
machine api.github.com | |
login technoweenie | |
password SECRET |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tools.debouncedAutorun = function (f, timeout) { | |
var debounced = _.debounce(function (c) { | |
// Store current computation | |
var prev = Tracker.currentComputation; | |
// Set the new computation | |
Tracker.currentComputation = c;//thisComputation; | |
Tracker.active = !!Tracker.currentComputation; | |
// Call function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Server | |
Meteor.methods({ | |
/** | |
* Login as a userId. Must be an admin. | |
*/ | |
impersonate: function (options) { | |
var self = this; | |
if (Settings.isProduction) { | |
var currentUser = Meteor.users.findOne(self.userId); |