Skip to content

Instantly share code, notes, and snippets.

View jameslittle230's full-sized avatar

James Little jameslittle230

View GitHub Profile
@jameslittle230
jameslittle230 / dlt.cpp
Last active April 7, 2018 10:21
HW8 Submission: Computing Homography Matrices
#include <vector>
#include <iostream>
#include "svd.h"
using namespace std;
struct Point {
double x, y;
};
@jameslittle230
jameslittle230 / R2Image.cpp
Last active April 10, 2018 14:21
HW9 Submission: RANSAC and DLT
void R2Image::
blendOtherImageTranslated(R2Image * otherImage)
{
R2Image *output = new R2Image(*otherImage);
std::vector<Feature> features = this->Harris(3); // passed by value
std::vector<Feature>::iterator it;
int searchSpaceXDim = this->Width() / 10; // half the search space dimension
int searchSpaceYDim = this->Height() / 10;
int windowDimension = 12; // half the window dimension
@jameslittle230
jameslittle230 / R2Image.cpp
Last active April 17, 2018 10:00
HW10 Submission: Blended Transformed Images
std::vector<Feature> R2Image::
Harris(double sigma)
{
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());
// Set T3 to product of T1 and T2
for(int x=0; x<Width(); x++) {

I have three tables that store data like this:

chats

chat_id sqn_num name
1 5 My Cool Chat
2 3 Another Awesome Chat
3 9 A Third Rockin' Chat
@jameslittle230
jameslittle230 / bg_fs.essl
Last active May 5, 2018 14:17
Fragment Shader with Noise Issues
Shader.source[document.currentScript.src.split('js/shaders/')[1]] = `
precision highp float;
varying vec3 rayDir;
uniform vec3 eyePos;
uniform samplerCube envmapTexture;
uniform mat4 quadrics[32];
uniform vec4 brdfs[16];
@jameslittle230
jameslittle230 / hell.js
Created May 8, 2018 12:12
Callback Hell
app.get('/loadUserData', function(req, res) {
var keys, chats, messages;
var u_id = req.query.user_id;
db.all(`SELECT * FROM keys WHERE user_id = ` + u_id + ` OR expired_at IS NULL`, function(err, data) {
if(err || !data) return res.status(404).send(err || "No data found for ID");
keys = data;
db.all(`SELECT * FROM messages WHERE recipient_id = ` + u_id, function(err, data) {
if(err || !data) return res.status(404).send(err || "No data found for ID");
@jameslittle230
jameslittle230 / query.sql
Created November 2, 2018 04:11
Almost-done query
select
article.id,
date,
title,
excerpt,
body
from
article LEFT JOIN (
select id, article_id, body, max(timestamp) from articlebody
group by article_id
jlittle at moosehead in ~/honors/5-tf-nbl-clean-setup
$ qrsh -l gpuk20=1 run.sh
Warning: Permanently added '[moose55]:46863,[139.140.230.205]:46863' (ECDSA) to the list of known hosts.
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /mnt/local/jboss/jboss-5.1.0.GA
#!/usr/bin/env bash
PATH=${PATH}:/usr/local/bin/
for f in "$@"
do
myoutput=""
basename=$(basename "$f")
dirname=$(dirname "$f")
shrink="${dirname}/p_${basename}"
fn temp_write_config(_args: &[String]) {
let config = Config {
input: InputConfig {
base_directory: ".".to_string(),
stemming: StemmingConfig{
enabled: true,
language: Algorithm::French
},