Run with Python:
pip-2.7 install cffi PYTHON=python2.7 sh go.sh
Run with PyPy:
pip-pypy install cffi PYTHON=pypy sh go.sh
| git clone https://oauth2:KNgus-zGhsiKkw@gitlab.my.net/mygroup/myproject.git |
| class Solution: | |
| def lengthOfLongestSubstring(self, s): | |
| """ | |
| :type s: str | |
| :rtype: int | |
| testcase: "jbpnbwwd", "abcabcbb", "bbbbbb" | |
| """ | |
| cout, ret, temp = 0, '', [] | |
| for c in s: | |
| if c not in temp: |
| """ | |
| Author: Awni Hannun | |
| This is an example CTC decoder written in Python. The code is | |
| intended to be a simple example and is not designed to be | |
| especially efficient. | |
| The algorithm is a prefix beam search for a model trained | |
| with the CTC loss function. |
| # Example for my blog post at: | |
| # http://danijar.com/introduction-to-recurrent-networks-in-tensorflow/ | |
| import functools | |
| import sets | |
| import tensorflow as tf | |
| def lazy_property(function): | |
| attribute = '_' + function.__name__ |
| """ | |
| Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
| BSD License | |
| """ | |
| import numpy as np | |
| # data I/O | |
| data = open('input.txt', 'r').read() # should be simple plain text file | |
| chars = list(set(data)) | |
| data_size, vocab_size = len(data), len(chars) |
Run with Python:
pip-2.7 install cffi PYTHON=python2.7 sh go.sh
Run with PyPy:
pip-pypy install cffi PYTHON=pypy sh go.sh
| """ | |
| Convert a CFFI cdata structure to Python dict. | |
| Based on http://stackoverflow.com/q/20444546/1309774 with conversion of | |
| char[] to Python str. | |
| Usage example: | |
| >>> from cffi import FFI | |
| >>> ffi = FFI() |
| """ | |
| Character RNN in python | |
| Code adaptation from Andrej Karpathy's Vanilla RNN blog post. | |
| Prepared by Adrian Sarno (mr.sarno2@gmail.com) | |
| """ | |
| import numpy as np | |
| from IPython.display import Latex | |
| from random import uniform | |
| // require() some stuff from npm (like you were using browserify) | |
| // and then hit Run Code to run it on the right | |
| var $ = require('jquery'); | |
| var $main = $('#main'); | |
| $main.html('hello <s>world</s>'); | |
| $main.focus(); | |
| var nodes = $main.contents(); |
| // require() some stuff from npm (like you were using browserify) | |
| // and then hit Run Code to run it on the right | |
| var editor = document.getElementById('main'); | |
| editor.focus(); | |
| console.dir(editor); | |
| var startNode = editor.childNodes[0]; | |
| console.dir(startNode); | |
| var endNode = editor.childNodes[1].firstChild; | |
| var range = document.createRange(); |