python3 setup.py build
Output: build/lib.macosx-10.11-x86_64-3.5/hello.cpython-35m-darwin.so
| // concurrent-queue.h | |
| #ifndef CONCURRENT_QUEUE_H_ | |
| #define CONCURRENT_QUEUE_H_ | |
| #include <queue> | |
| #include <thread> | |
| #include <mutex> | |
| #include <condition_variable> | |
| template <typename T> |
| #include <Python.h> // Must be first | |
| #include <vector> | |
| #include <stdexcept> | |
| #include "PyUtils.h" | |
| using namespace std; | |
| // ===== | |
| // LISTS | |
| // ===== |
| #include <Python.h> // Must be first | |
| #include <vector> | |
| #include <stdexcept> | |
| #include "PyUtils.h" | |
| using namespace std; | |
| // ===== | |
| // LISTS | |
| // ===== |
| /** | |
| * OpenCV video streaming over TCP/IP | |
| * Client: Receives video from server and display it | |
| * by Steve Tuenkam | |
| */ | |
| #include "opencv2/opencv.hpp" | |
| #include <sys/socket.h> | |
| #include <arpa/inet.h> | |
| #include <unistd.h> |
| #include <iostream> | |
| #include <vector> | |
| using namespace std; | |
| // an illustration for my Julia-related question on julia-users | |
| struct datfun { | |
| // some data | |
| vector<double> x; | |
| vector<double> y; |
| import tensorflow as tf | |
| x = tf.Variable(2, name='x', dtype=tf.float32) | |
| log_x = tf.log(x) | |
| log_x_squared = tf.square(log_x) | |
| optimizer = tf.train.GradientDescentOptimizer(0.5) | |
| train = optimizer.minimize(log_x_squared) | |
| init = tf.initialize_all_variables() |
| # A simple generator wrapper, not sure if it's good for anything at all. | |
| # With basic python threading | |
| from threading import Thread | |
| try: | |
| from queue import Queue | |
| except ImportError: | |
| from Queue import Queue | |