Skip to content

Instantly share code, notes, and snippets.

View jameslittle230's full-sized avatar

James Little jameslittle230

View GitHub Profile
@jameslittle230
jameslittle230 / md_colors.scss
Last active November 29, 2017 19:48
Material Design Colors
$red-50: #fde0dc;
$red-100: #f9bdbb;
$red-200: #f69988;
$red-300: #f36c60;
$red-400: #e84e40;
$red-500: #e51c23;
$red-600: #dd191d;
$red-700: #d01716;
$red-800: #c41411;
$red-900: #b0120a;
@jameslittle230
jameslittle230 / style_emacs.st
Last active November 29, 2017 19:48
Preferred Enscript C Color Scheme - /usr/local/share/enscript/hl/style_emacs.st
state style_emacs
{
BEGIN {
call(default_faces);
if (color)
{
/* Set colors. */
face_bold[fg_color] = language_color("black");
if application "Spotify" is running and application "iTunes" is not running then
tell application "Spotify"
if player state is stopped then
set display to ""
else
set track_artist to artist of current track
set track_name to name of current track
set track_duration to duration of current track
set seconds_played to player position
set state to ""
set output to "paused"
if application "Spotify" is running then
tell application "Spotify" to set spotifyState to (player state as text)
if spotifyState is "playing" then
set output to "playing"
end if
end if
if application "iTunes" is running then
@jameslittle230
jameslittle230 / puzzle.json
Created January 24, 2018 01:38
A data representation of a crossword puzzle
{
"version": 1,
"size": [15, 15],
"values": ["I", "C", "A", "R", "U", "S", " ", "F", "R", "E", "E", " ", "F", "A", "N",
"T", "H", "R", "U", "S", "T", " ", "R", "A", "D", "S", " ", "A", "D", "O",
"S", "I", "M", "M", "E", "R", " ", "O", "D", "C", "T", "O", "J", "O", "E",
"O", "L", "Y", " ", "S", "A", "N", "D", "A", "N", "D", "M", "E", "R", "O",
"P", "I", "M", "A", " ", "I", "N", "O", "R", " ", " ", "S", "T", "E", "M",
"E", "D", "U", "C", "A", "T", "E", " ", "G", "I", "G", " ", "A", "D", "A",
"N", "O", "L", "T", "E", " ", " ", "R", "U", "N", "I", "N", " ", " ", " ",
@jameslittle230
jameslittle230 / R2Image.cpp
Last active February 20, 2018 09:23
HW2 Submission -- Code Changes
void R2Image::
SobelX(void)
{
R2Image *output = new R2Image(width, height);
double sobel_x[3][3] = {
{-1, 0, 1},
{-2, 0, 2},
{-1, 0, 1}
};
@jameslittle230
jameslittle230 / R2Image.cpp
Last active February 25, 2018 13:58
HW3 Submission -- Gaussian Blur
void R2Image::
Blur(double sigma)
{
R2Image *temp = new R2Image(width, height);
// Generate 1D kernel
int k_rad = 3 * sigma;
int k_len = 6 * sigma + 1;
double *k = (double *) malloc(k_len * sizeof(double));
double sum = 0.0;
@jameslittle230
jameslittle230 / R2Image.cpp
Last active March 4, 2018 19:44
HW5 Submission: Feature Detection
void R2Image::
Harris(double sigma)
{
std::cout << "Computing harris filter" << std::endl;
const R2Image self = *this;
R2Image *t1 = new R2Image(self); t1->SobelX(); t1->Square();
R2Image *t2 = new R2Image(self); t2->SobelY(); t2->Square();
R2Image *t3 = new R2Image(Width(), Height());
R2Image *t4 = new R2Image(Width(), Height());
@jameslittle230
jameslittle230 / R2Image.cpp
Created March 12, 2018 12:43
HW6 Submission: Feature Tracking
void R2Image::
blendOtherImageTranslated(R2Image * otherImage)
{
R2Image *output = new R2Image(*otherImage);
std::vector<Feature> features = *(this->Harris(3));
int searchSpaceXDim = this->Width() / 10; // half the search space dimension
int searchSpaceYDim = this->Height() / 10;
int windowDimension = 12; // half the window dimension
std::vector<Feature>::iterator it;
@jameslittle230
jameslittle230 / R2Image.cpp
Last active April 8, 2018 16:16
HW7 Submission: Feature Matching with RANSAC
std::vector<Feature> R2Image::
Harris(double sigma)
{
std::cout << "Computing harris filter" << std::endl;
const R2Image self = *this;
R2Image *t1 = new R2Image(self); t1->SobelX(); t1->Square();
R2Image *t2 = new R2Image(self); t2->SobelY(); t2->Square();
R2Image *t3 = new R2Image(Width(), Height());
R2Image *t4 = new R2Image(Width(), Height());