(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| # Add NVIDIA package repository | |
| sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | |
| wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb | |
| sudo apt install ./cuda-repo-ubuntu1804_10.0.130-1_amd64.deb | |
| wget http://developer.download.nvidia.com/compute/machine-learning/repos/https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb | |
| sudo apt install ./nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb | |
| sudo apt update | |
| # Install CUDA and tools. Include optional NCCL 2.x | |
| sudo apt install cuda10.0 cuda-cublas-10-0 cuda-cufft-10-0 cuda-curand-10-0 \ |
| import numpy as np | |
| import tensorflow as tf | |
| import tensorflow.contrib.layers as tflayers | |
| x = tflayers.real_valued_column(np.linspace(0, 100, 101)) | |
| buckets = np.linspace(0, 100, 5).tolist() | |
| x2 = tflayers.bucketized_column(x, buckets) | |
| print(x2) |
| var toObservable = request => Rx.Observable.create(observer => { | |
| var req = request.end((err, res) => { | |
| if(err) { | |
| observer.onError(err) | |
| } else { | |
| observer.onNext(res) | |
| observer.onComplete() | |
| } | |
| }) | |
| return Rx.Disposable.create(() => { |
| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| import sys | |
| salesTotal = 0 | |
| oldKey = None | |
| for line in sys.stdin: | |
| data = line.strip().split("\t") | |
| if len(data) != 2: | |
| # Something has gone wrong. Skip this line. | |
| continue |