This file contains hidden or 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
1 sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' | |
2 sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116 | |
3 sudo apt-get update | |
4 sudo apt-get install ros-melodic-desktop-full | |
5 sudo rosdep init | |
6 rosdep update | |
7 echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc | |
8 source ~/.bashrc | |
9 sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential | |
10 printenv | grep ROS |
This file contains hidden or 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
# Installing gphoto2 on cygwin (NOTE: This is with cygwin/X installed and working already so a lot of the graphical stuff had been worked out) | |
git clone https://github.com/gphoto/gphoto2.git | |
cd gphoto2/ | |
autoreconf -is # Not installed. Need these cygwin packages: autoconf automake gettext | |
apt-cyg install autoconf | |
apt-cyg install automake | |
apt-cyg install gettext | |
autoreconf -is # Still not working. Need gettext-tools which is gettext-devel in cygwin | |
#autoreconf-2.69: failed to run autopoint: No such file or directory | |
#autoreconf-2.69: autopoint is needed because this package uses Gettext |
This file contains hidden or 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
# Get the current clipboard contents. Can be used in three different ways: | |
# 1) clip=$( get_clip ) # puts clippboard contents directly to the STDOUT | |
# 2) get_clip file=clipFile # puts clippboard contents in the file provided | |
# 3) get_clip rtrnVar=myClip # puts clippboard contents in the variable myClip | |
# This is a way of getting clipboard contents from a bash script | |
get_clip () { | |
local file rtrn rtrnVar && local $*; # declare possible named variables | |
local rtrnFile errCode; # declare private variables | |
[[ ! $file ]] && file=$( mktemp ) || rtrnFile=true | |
gvim $file -T dumb --noplugin -n -es -c 'set nomore' +'normal "*P' +'wq'; |
This file contains hidden or 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
# CSV file can be pretty generic but the one I am using looks something like this: | |
# date,host,test_name,sim_dir,matlab_dir_id,note,sensitivity,mod_clk,num_tones,tone_freq_0,tone_amp_0,ATT,SNR,SINAD,THD,THDN,SFDR,SFDRnh,exp_ATT,exp_SNR,exp_THD,exp_THDN,exp_SFDR,exp_SFDRnh | |
# 2018-06-27 19:10:49,afrma306,rnd_tone_test,/some/path/to/regress_Jun27_182851/simulate/rand_tone_test_1_-482062569_1, 1,PDM,-19.000000,508077.000000,1,1499.000000,75.255000,-37.523000,46.682000,46.799000,0.023000,0.457000,-89.607000,-89.607000,37.523000,21.088528,0.525000,9.263240,-50.564104,-50.564104 | |
# 2018-06-27 19:15:17,afrma809,rnd_tone_test,/some/path/to/regress_Jun27_182851/simulate/rand_tone_test_1_469551002_1, 1,PDM,-41.000000,1568337.000000,1,9885.000000,83.357000,-51.585000,70.499000,70.499000,0.000000,0.030000,-133.390000,-133.390000,51.585000,27.177713,0.803399,105.000000,0.000000,-73.728294 | |
CSV=/path/to/data.csv | |
X=tone_amp_0 | |
Y=ATT | |
Z=sensetivity |
This file contains hidden or 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
// Example: | |
// gcc -E -CC systemverilog_macro_expansion.cpp -D PREPROC_ONLY=1 | |
// gcc -E -CC systemverilog_macro_expansion.cpp -D PREPROC_ONLY=0 | |
// gcc systemverilog_macro_expansion.cpp -D PREPROC_ONLY=0 -fno-exceptions && a.out | |
// | |
// | |
#define STD_5BIN_RANGE_CALC_MIDP(dflt, shift) ( (dflt) + ( (dflt) >> (shift) ) ) | |
#define STD_5BIN_RANGE_CALC_MIDN(dflt, shift) ( (dflt) - ( (dflt) >> (shift) ) ) | |
#define N_UNSIGNED_BITS_TO_FSP(bits) ( (1<<bits)-1 ) |
This file contains hidden or 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
#!/usr/bin/env python3 | |
# Very simple interactive grid. Could be the basis for simple games. | |
# taken from https://stackoverflow.com/a/30045893/120681 Arthur Vaïsse | |
from tkinter import * | |
class Cell(): | |
FILLED_COLOR_BG = "blue" | |
EMPTY_COLOR_BG = "black" | |
FILLED_COLOR_BORDER = "blue" |
This file contains hidden or 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
# This would normally just go in your .bashrc file | |
# My workaround for not having xsel or xclip | |
# Get the current clipboard contents. Can be used in three different ways: | |
# 1) clip=$( get_clip ) # puts clippboard contents directly to the STDOUT | |
# 2) get_clip file=clipFile # puts clippboard contents in the file provided | |
# 3) get_clip rtrnVar=myClip # puts clippboard contents in the variable myClip | |
# This is a way of getting clipboard contents from a bash script | |
get_clip () { | |
local file rtrn rtrnVar && local $*; # declare possible named variables |
This file contains hidden or 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
# Do you like python named parameters (kvargs) ? | |
# Well, you can have it in bash too!! (but unfortunatly this will not allow you to mix positional and named parameters) | |
function myfunc() { local $*; echo "# foo=$foo, bar=$bar"; } | |
myfunc bar=world foo=hello | |
# foo=hello, bar=world | |
######### | |
# And with default arguments: |