Skip to content

Instantly share code, notes, and snippets.

View dchapman1988's full-sized avatar

David Chapman dchapman1988

View GitHub Profile
; Name: David Chapman
; Program: Lab 02
; Version: 1.0
; Date Started: 10/15/2014
; Last Update: NA
; Copyright © 2014
;
; Description: Implement a counter that increments the count when SWX is
; pressed and clears the count when SWY is pressed. The count
; is to be displayed via the four LEDs that were used in the
delay100ms
pshx
ldx #60000 ; 2 E cycles
iloop psha ; 2 E cycles
pula ; 3 E cycles
psha ; 2 E cycles
pula ; 3 E cycles
psha ; 2 E cycles
pula ; 3 E cycles
psha ; 2 E cycles
/*
* File: DownloadTimeApp.java
* Author: David Chapman, dac1988@uab.edu
* Assignment: Project 1 EE333 Fall 2013
* Vers: 1.0.1 01/12/2014 dac - initial coding
*
* Credits: (if any for sections of code)
*/
import java.util.Scanner;
require 'mathn'
# Just a class with methods for calculating trajectories of a projectile
# Read more: http://en.wikipedia.org/wiki/Trajectory_of_a_projectile
class ProjectileTrajectory
attr_accessor :grav_acceleration, :launch_angle, :launch_velocity,
:initial_height, :distance_traveled
def initialize(g=9.81, theta, v, y_not)
self.grav_acceleration = g # the gravitational acceleration (usually taken to be 9.81 m/s^2 near the Earth's surface)
suppressmacrofailures
tar Dagda Skullthumper
tar Neatherworld Wanderer
tar Frosthide
tar Mad Hogger
tar Blackblood Drake
tar Emissary Kavenik
tar Artic Peakstalker
tar Swirling Tempest
tar Frostpaw Mauler
require 'matrix'
# A polygon that's most likely to be encountured in nature.
# These are normally convex and concave polygons.
# (all sides and all angles are not congruent)
class IdealPolygon
attr_accessor :coordinates, :number_of_sides
def initialize(coordinates=[])
@coordinates = coordinates
end
$ time ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
real 0m0.018s
user 0m0.008s
sys 0m0.008s
$ time ruby -v rbenv
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
ruby: No such file or directory -- rbenv (LoadError)
> ShapeFile.all.map(&:name)
(3.0ms) SELECT f_geometry_column,coord_dimension,srid,type FROM geometry_columns WHERE f_table_name='shape_files'
ShapeFile Load (1.5ms) SELECT "shape_files".* FROM "shape_files"
=> ["S_Label_Ld.shp",
"S_Quad_Index.shp",
"S_Label_Pt.shp",
"S_Cst_Tsct_Ln.shp",
"S_Perm_Bmk.shp",
"S_BFE.shp",
"S_Fld_Haz_Ln.shp",
#!/bin/bash
# Version: 1.0.2
# Author: David Chapman
# Description: A quick script to get a Ubuntu machine up and running.
# The commands we'll be using are here
CURL="curl"
APT="apt-get"
# Checks that the system has apt
> Cnam.count
(31732.4ms) SELECT COUNT(*) FROM "cnams"
=> 64279448
> Cnam.where(["name like ?", "%Dregges%"])
Cnam Load (36500.1ms) SELECT "cnams".* FROM "cnams" WHERE (name like '%Dregges%')
EXPLAIN (0.7ms) EXPLAIN SELECT "cnams".* FROM "cnams" WHERE (name like '%Dregges%')
EXPLAIN for: SELECT "cnams".* FROM "cnams" WHERE (name like '%Dregges%')
QUERY PLAN
---------------------------------------------------------------