NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
| (function( $ ) { | |
| $.fn.simulateDragDrop = function(options) { | |
| return this.each(function() { | |
| new $.simulateDragDrop(this, options); | |
| }); | |
| }; | |
| $.simulateDragDrop = function(elem, options) { | |
| this.options = options; | |
| this.simulateEvent(elem, options); | |
| }; |
| git config --global https.proxy http://127.0.0.1:1080 | |
| git config --global https.proxy https://127.0.0.1:1080 | |
| git config --global --unset http.proxy | |
| git config --global --unset https.proxy | |
| npm config delete proxy |
| git config --global http.proxy 'socks5://127.0.0.1:1080' | |
| git config --global https.proxy 'socks5://127.0.0.1:1080' |
| #import section | |
| from matplotlib import pylab | |
| import pylab as plt | |
| import numpy as np | |
| #sigmoid = lambda x: 1 / (1 + np.exp(-x)) | |
| def sigmoid(x): | |
| return (1 / (1 + np.exp(-x))) | |
| mySamples = [] |
| import tensorflow as tf | |
| from tensorflow.keras.layers import Layer | |
| class ROIPoolingLayer(Layer): | |
| """ Implements Region Of Interest Max Pooling | |
| for channel-first images and relative bounding box coordinates | |
| # Constructor parameters | |
| pooled_height, pooled_width (int) -- | |
| specify height and width of layer outputs |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
| exports.stripComments = function stripComments(toBeStrippedStr){ | |
| //LEXER | |
| function Lexer () { | |
| this.setIndex = false; | |
| this.useNew = false; | |
| for (var i = 0; i < arguments.length; ++i) { | |
| var arg = arguments [i]; | |
| if (arg === Lexer.USE_NEW) { | |
| this.useNew = true; | |
| } |
| tmux is a "terminal multiplexer", it enables a number of terminals to be accessed and controlled from a single terminal. | |
| If you use Debian/Ubuntu, you can just run apt-get install tmux, and voila. | |
| Since the title was about centos 7, then do the following step to install tmux. | |
| (1). tmux has a library dependency on libevent which, of course, isn’t installed by default. | |
| $ wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
| $ tar xzvf libevent-2.0.21-stable.tar.gz | |
| $ cd libevent-2.0.21-stable |
| The script run-and-stop-gunicorn.sh takes 1 second on both Python 2.7 and 3.4. | |
| $ cat /etc/lsb-release | |
| DISTRIB_ID=Ubuntu | |
| DISTRIB_RELEASE=14.04 | |
| DISTRIB_CODENAME=trusty | |
| DISTRIB_DESCRIPTION="Ubuntu 14.04.2 LTS" | |
| $ | |
| $ | |
| $ source 27-env/bin/activate |