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
# Source: http://wiki.ros.org/melodic/Installation/Source | |
function install_ros_first_time() { | |
# Install bootstrap dependencies | |
sudo apt-get install python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential -y | |
# Initialize rosdep | |
sudo rosdep init | |
rosdep update |
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
VERSION=$1 | |
sudo apt install gcc make zlib1g-dev | |
sudo apt install libssl-dev # needed for SSL support | |
sudo apt install libsqlite3-dev # needed for SQLite support | |
sudo apt-get install libbz2-dev # needed for BZ2 compression support | |
wget "https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tar.xz" | |
tar xJf "Python-$VERSION.tar.xz" | |
cd "Python-$VERSION" |
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
# Usage: install-python <VERSION> | |
# Example: install-python 3.6.9 | |
function install_python() { | |
VERSION=$1 | |
sudo apt install gcc make zlib1g-dev | |
sudo apt install libssl-dev # needed for SSL support | |
sudo apt install libsqlite3-dev # needed for SQLite support | |
sudo apt-get install libbz2-dev # needed for BZ2 compression support | |
wget "https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tar.xz" |
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
from sympy import * | |
x, y, z, l1, l2 = symbols('x y z l1 l2') | |
f = x + y + 3*z | |
g = x - y + z | |
k1 = 2 | |
h = x + 2*z**2 | |
k2 = 59 |
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
from sympy import * | |
from sympy.abc import x, y, z, l | |
f = x**2 + y**2 + z**2 | |
g = x**4 + y**4 + z**4 | |
k = 9 | |
grad = lambda fn: Matrix([fn.diff(x), fn.diff(y), fn.diff(z)]).transpose() | |
# grad(f) = lambda * grad(g) |
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
% Final Project: Rainbow Analog Clock | |
% Author: Tejas Shah | |
% Class: ENGIN-136 - Intro to MATLAB | |
% Clear any vars and current figure and show it on top of screen | |
clear, clf, shg | |
% Setup drawing board for clock | |
axis([-1.1 1.1 -1.1 1.1]); | |
axis square |
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
/* Robot.betterMouseMove is a function that's meant to fix Robot.mouseMove when dealing with Windows's | |
display scaling in order to make text easier to see. The 'scaleFactor' is the actual scaling factor | |
as a float > 1.0f. | |
This is the error vector field that represents the error caused by Robot.mouseMove in which to move | |
in the x and y direction towards its destination. It's not that useful in hindsight, but kind of cool | |
that one can model the error as a mathematical function. | |
"Error" Vector Field: F(x, y) = f(x, y) * i + g(x, y) * j | |
f(x, y) = (-x + t_x) / (width - t_x) |
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
# Get latest packages | |
sudo apt-get update && sudo apt-get dist-upgrade -y | |
sudo apt-get update && sudo apt-get upgrade -y | |
# Install needed packages to perform common I/O image/video operations and/or math calculations | |
sudo apt-get update | |
sudo apt-get install libhdf5-dev libhdf5-serial-dev libharfbuzz-dev liblapack-dev libcblas-dev libwebp-dev \ | |
libilmbase-dev libopenexr-dev libgstreamer1.0-dev libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev \ | |
libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libatlas-base-dev \ | |
gfortran libgstreamer1.0-dev libgtk-3-0 -y |
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
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install build-essential cmake pkg-config | |
sudo apt-get install libjpeg8-dev libtiff5-dev libjasper-dev libpng12-dev | |
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev | |
sudo apt-get install libxvidcore-dev libx264-dev | |
sudo apt-get install libgtk-3-dev | |
sudo apt-get install libatlas-base-dev gfortran | |
sudo apt-get install python |
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
int readInt(); | |
char readChar(); | |
float readFloat(); | |
string readWord(); | |
string readLine(); | |
void swapInt(int &a, int &b); | |
void swapChar(char &a, char &b); | |
void swapFloat(float &a, float &b); | |
void swapString(string &a, string &b); |