This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IFS=$'\n' | |
a='' | |
for i in $( IFS=$'\n' lsusb | grep 045e: ); do | |
IFS=' :' read -r -a array <<< "$i" | |
a="${a} --device /dev/bus/usb/${array[1]}/${array[3]}" | |
done | |
echo $a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// g++ --std=c++11 -O3 -march=native bitreverse.cpp | |
#include <chrono> | |
#include <iostream> | |
char buf[256]; | |
int zz3(int x) | |
{ | |
return buf[x]; | |
}; | |
// 11001100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define CONCATENATE_IMPL(s1, s2) s1##s2 | |
#define CONCATENATE(s1, s2) CONCATENATE_IMPL(s1, s2) | |
#ifdef __COUNTER__ | |
#define ANONYMOUS_VARIABLE(str) \ | |
CONCATENATE(str, __COUNTER__) | |
#else | |
#define ANONYMOUS_VARIABLE(str) \ | |
CONCATENATE(str, __LINE__) | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// announcement_user_tag | |
function add_custom_timeline_express_field( $custom_fields ) { | |
$custom_fields = array( | |
array( | |
'name' => __( 'Tag', 'timeline-express' ), | |
'desc' => __( 'this is an example user defined text field.', 'timeline-express' ), | |
'id' => 'announcement_user_tag', | |
'type' => 'text_medium', | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Generalzied: [row2group,grouplabels,group2row]= igrpstats(x,group) | |
% | |
% Extraction of Mathworks code from 2016A | |
% | |
% All copyrights to Mathworks | |
function [row2group,grouplabels,group2row,groupnames]= igrpstats(x,group) | |
[rows,cols] = size(x); | |
if (nargin<1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Alternatively use: | |
# wstool set PACKAGE --git SOURCE | |
# wstool updaye | |
DISTRO=indigo-devel | |
git clone https://github.com/ros-simulation/gazebo_ros_pkgs.git -b ${DISTRO} src/gazebo_ros_pkgs | |
git clone https://github.com/ros-controls/control_toolbox.git -b ${DISTRO} src/control_toolbox | |
git clone https://github.com/ros-controls/realtime_tools.git -b ${DISTRO} src/realtime_tools | |
git clone https://github.com/ros-controls/ros_control.git -b ${DISTRO} src/ros_control |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import cv2 | |
def interp_rgb(a,b,n): | |
a = np.uint8([[a]]) | |
b = np.uint8([[b]]) | |
a1 = cv2.cvtColor(a,cv2.COLOR_BGR2HSV) | |
b1 = cv2.cvtColor(b,cv2.COLOR_BGR2HSV) | |
# 1 1 3 | |
ll = np.linspace(0,1,n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Implementation of N4562 std::experimental::any (merged into C++17) for C++11 compilers. | |
// | |
// See also: | |
// + http://en.cppreference.com/w/cpp/any | |
// + http://en.cppreference.com/w/cpp/experimental/any | |
// + http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#any | |
// + https://cplusplus.github.io/LWG/lwg-active.html#2509 | |
// | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Industria 4.0 Converter | |
from collections import OrderedDict,defaultdict | |
import csv | |
x = open("form.tsv","rb") | |
dr = csv.reader(x,delimiter="\t",quotechar="\"") | |
person = dict() | |
# load headers | |
h = [y.strip().strip("\"") for y in dr.next()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"folders": | |
[ | |
{ | |
"path": "." | |
} | |
], | |
"build_systems": | |
[ | |
{ |