As configured in my dotfiles.
start new:
tmux
start new with session name:
As configured in my dotfiles.
start new:
tmux
start new with session name:
Here's a few things I tried to write output to a python subprocess pipe.
from subprocess import Popen, PIPE
p = Popen('less', stdin=PIPE)
for x in xrange(100):
p.communicate('Line number %d.\n' % x)
#!/bin/sh | |
parse_yaml() { | |
local prefix=$2 | |
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') | |
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ | |
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | | |
awk -F$fs '{ | |
indent = length($1)/2; | |
vname[indent] = $2; | |
for (i in vname) {if (i > indent) {delete vname[i]}} |
import cv2 | |
import numpy as np | |
def in_front_of_both_cameras(first_points, second_points, rot, trans): | |
# check if the point correspondences are in front of both images | |
rot_inv = rot | |
for first, second in zip(first_points, second_points): | |
first_z = np.dot(rot[0, :] - second[0]*rot[2, :], trans) / np.dot(rot[0, :] - second[0]*rot[2, :], second) | |
first_3d_point = np.array([first[0] * first_z, second[0] * first_z, first_z]) |
sudo apt-get update | |
sudo apt-get install python-pip python-dev ipython | |
sudo apt-get install bluetooth libbluetooth-dev | |
sudo pip install pybluez |
import tensorflow as tf | |
from tensorflow.python.framework import ops | |
import numpy as np | |
# Define custom py_func which takes also a grad op as argument: | |
def py_func(func, inp, Tout, stateful=True, name=None, grad=None): | |
# Need to generate a unique name to avoid duplicates: | |
rnd_name = 'PyFuncGrad' + str(np.random.randint(0, 1E+8)) | |
from __future__ import print_function | |
''' | |
Basic Multi GPU computation example using TensorFlow library. | |
Author: Aymeric Damien | |
Project: https://github.com/aymericdamien/TensorFlow-Examples/ | |
''' | |
''' | |
This tutorial requires your machine to have 1 GPU | |
"/cpu:0": The CPU of your machine. |
from __future__ import print_function | |
import requests | |
import json | |
import cv2 | |
addr = 'http://localhost:5000' | |
test_url = addr + '/api/test' | |
# prepare headers for http request | |
content_type = 'image/jpeg' |
# -*- coding: utf-8 -*- | |
""" | |
| **@created on:** 11/05/17, | |
| **@author:** Prathyush SP, | |
| **@version:** v0.0.1 | |
| | |
| **Description:** | |
| DL Module Tests | |
| **Sphinx Documentation Status:** Complete | |
| |