Skip to content

Instantly share code, notes, and snippets.

View thomasantony's full-sized avatar

Thomas Antony thomasantony

View GitHub Profile
@thomasantony
thomasantony / hw09.py
Created October 28, 2012 06:40
AAE 532 - Hohmann Transfer gone bad
# AAE 532 - HW09 - Q02
# Author : Thomas Antony ( tantony (at) purdue (dot) edu )
# Code re-purposed from from Udacity.com CS222 - HW02-Q02
# Original code author : Miriam "Swords" Kalk ?? ( I think )
# The simulation starts with the spacecraft in an earth-centered
# circular orbit at 175 km altitude, just after finishing a burn which sends it on a
# Hohmann trajectory to the moon.
#
# The purpose of the simulation was to examine what happens to the orbit if a capture
# burn was not performed after reaching the moon
@thomasantony
thomasantony / gist:6471125
Last active September 9, 2021 14:15
An implementation of an improved & simplified Brent's Method. Calculates root of a function f(x) in the interval [a,b]. Zhang, Z. (2011). An Improvement to the Brent’s Method. International Journal of Experimental Algorithms (IJEA), (2), 21–26. Retrieved from http://www.cscjournals.org/csc/manuscript/Journals/IJEA/volume2/Issue1/IJEA-7.pdf
template <class T>
inline void __swap(T *a, T *b)
{
T temp = *a;
*a = *b;
*b = temp;
}
/*
An implementation of an improved & simplified Brent's Method.
@thomasantony
thomasantony / .bash_profile
Last active August 29, 2015 14:08
Bash Profile for Carter Server
module load cuda
module load matlab/R2014a
module load mathematica
unset SSH_ASKPASS
screen -p 0 -X stuff "export DISPLAY=$DISPLAY$(printf \\r)"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/apps/rhel6/Wolfram/Mathematica/9.0/SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions
export PATH=$PATH:/apps/rhel6/Wolfram/Mathematica/9.0/Executables
#!/bin/bash
# Place in ~/Library/TexShop/Engines/LatBibNomTex/engine
pdflatex "$1"
for file in *.aux ; do
bibtex $file
bfname=$(dirname "$1")/"`basename "$1" .tex`"
makeindex "$bfname".nlo -s nomencl.ist -o "$bfname".nls
done
pdflatex "$1"
# pdflatex "$1"
#!/bin/bash
# Place in ~/Library/TexShop/Engines
# LatNomLat.engine
bfname=$(dirname "$1")/"`basename "$1" .tex`"
makeindex "$bfname".nlo -s nomencl.ist -o "$bfname".nls
done
pdflatex "$1"
# pdflatex "$1"
@thomasantony
thomasantony / ezproxify
Created December 11, 2014 20:33
Ezproxify bookmarklet
javascript:void(window.location.host += '.ezproxy.lib.purdue.edu')
@thomasantony
thomasantony / index.js
Created September 2, 2016 02:25
requirebin sketch
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
require('virtual-dom')
var h = require('virtual-dom/h');
var diff = require('virtual-dom/diff');
var patch = require('virtual-dom/patch');
var createElement = require('virtual-dom/create-element');
@thomasantony
thomasantony / greyscale.py
Created April 12, 2017 21:22
A Python script for batch converting images to greyscale
"""Batch convert images to greyscale [by Thomas Antony].
Install dependencies:
pip install pillow docopt
Note: If you do not provide an output path, the generated files will be saved
in a folder named "Converted"
Usage:
greyscale.py <in_path> [<out_path>]
@thomasantony
thomasantony / client.py
Created June 10, 2017 03:30 — forked from marvin/client.py
simple python client/server socket binary stream
import socket
HOST = 'localhost'
PORT = 9876
ADDR = (HOST,PORT)
BUFSIZE = 4096
videofile = "videos/royalty-free_footage_wien_18_640x360.mp4"
bytes = open(videofile).read()
@thomasantony
thomasantony / qcl.rb
Last active April 4, 2019 20:44
Installs qcl tool using Homebrew for communicating with QNX OS devices
# Download file and run `brew install qcl.rb`
class Qcl < Formula
desc "A command line tool to transfer files into Qconn-enabled remote device"
homepage "https://github.com/TheHipbot/weather"
url "https://github.com/thomasantony/qcl/archive/master.zip"
sha256 "db762174cd29e827007d97333853e64a8e39210ac4fad23f3083d9912a5ba3ce"
version "1.0.0"
depends_on "perl"