View deep-learn-gcp-setup.sh
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" |
View install-python-scratch.sh
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" |
View lagrange-solver-two-constraints.py
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 |
View lagrange-solver-one-constraint.py
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) |
View ros-install-ubuntu-cosmic.sh
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 |
View RainbowClock.m
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 |
View robot-mousemove-fix.kt
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) |
View raspberry-pi-opencv-python-setup.sh
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 |
View explore_string_hashcode.js
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
// shamelessly copied from the left-pad module :P | |
function leftPad(str, len, ch) { | |
// convert `str` to a `string` | |
str = str + ''; | |
// `len` is the `pad`'s length now | |
len = len - str.length; | |
// doesn't need to pad | |
if (len <= 0) return str; | |
// `ch` defaults to `' '` | |
if (!ch && ch !== 0) ch = ' '; |
View libvexhelper.c
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
/* vexhelper library version 0.2 */ | |
/* | |
Dictionary: | |
-variable -> a name which can contain a value (i.e 6, "hello", 3.14) | |
-constant -> a variable whose value cannot be modified | |
-function -> a block of reusable code | |
Description: |
NewerOlder