$ sudo apt-get update
$ sudo apt-get upgradeapt-get update - 更新最新的套件資訊
apt-get upgrade - 更新套件
| # Original source from http://asyncio.readthedocs.io/en/latest/producer_consumer.html | |
| # Rewritten for Python >=3.4 | |
| import asyncio | |
| import random | |
| @asyncio.coroutine | |
| def produce(queue, n): | |
| for x in range(n): |
| # Open CV 3 | |
| sudo apt-get -y install libtiff5-dev | |
| sudo apt-get -y install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev | |
| sudo apt-get -y install libxine2-dev libv4l-dev | |
| sudo apt-get -y install libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev | |
| sudo apt-get -y install qt5-default libgtk2.0-dev libtbb-dev | |
| sudo apt-get -y install libatlas-base-dev |
Only do this if you understand the consequences: all node programs will be able to bind on ports < 1024
sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node
Important: your node location may vary. Use which node to find it, or use it directly in the command:
ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
| #!/usr/bin/env python | |
| # Knuth-Morris-Pratt demonstration | |
| # Kyle Gorman <[email protected]> | |
| # | |
| # A naive Python implementation of a function that returns the (first) index of | |
| # a sequence in a supersequence is the following: | |
| def subsequence(needle, haystack): | |
| """ | |
| Naive subsequence indexer; None if not found |
| #include <Python.h> // Must be first | |
| #include <vector> | |
| #include <stdexcept> | |
| #include "PyUtils.h" | |
| using namespace std; | |
| // ===== | |
| // LISTS | |
| // ===== |
| * |