首先,其實還滿開心有機會可以做個小小辯論的啦。我的回應如下
這把好幾個主題混在一起了,需要一個一個看。
不好寫。東西好不好寫的意思,代表它和 programmer 的內在思考模式符合程度。Async program 不符合人類習慣思維,所以才會被說一開始的學習 overhead 很高,寫起來容易卡。尤其如果同步與異步 paradigms 並立(例如 Python),就更容易在切換的時候出問題。
class ResponseError(Exception): | |
def __init__(self, message, code=None, params=None): | |
super().__init__(message) | |
self.message = str(message) | |
self.code = code | |
self.params = params |
Building Tensorflow from source on Ubuntu 16.04LTS for maximum performance:
TensorFlow is now distributed under an Apache v2 open source license on GitHub.
On Ubuntu 16.04LTS+:
Step 1. Install NVIDIA CUDA:
To use TensorFlow with NVIDIA GPUs, the first step is to install the CUDA Toolkit as shown:
TL;DR
Install Postgres 9.6, and then:
sudo pg_dropcluster 9.6 main --stop
sudo pg_upgradecluster 9.5 main
sudo pg_dropcluster 9.5 main
#!/usr/bin/env python | |
''' | |
This script will attempt to open your webbrowser, | |
perform OAuth 2.0 authentication and print your access token. | |
To install dependencies from PyPI: | |
$ pip install oauth2client | |
Then run this script: |
How to generate graphic model Django with PyGraphViz?
sudo apt-get install -y graphviz libgraphviz-dev pkg-config
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install pygraphviz
pip uninstall pyparsing
pip install -Iv https://pypi.python.org/packages/source/p/pyparsing/pyparsing-1.5.7.tar.gz#md5=9be0fcdcc595199c646ab317c1d9a709
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
# From http://vanderwijk.info/blog/adding-css-classes-formfields-in-django-templates/#comment-1193609278 | |
from django import template | |
register = template.Library() | |
@register.filter(name='add_attributes') | |
def add_attributes(field, css): | |
attrs = {} | |
definition = css.split(',') |
/* ______________________________________ | |
________| |_______ | |
\ | SmartAdmin WebApp | / | |
\ | Copyright © 2014 MyOrange | / | |
/ |______________________________________| \ | |
/__________) (_________\ | |
* The above copyright notice and this permission notice shall be | |
* included in all copies or substantial portions of the Software. | |
* ======================================================================= |
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |