Skip to content

Instantly share code, notes, and snippets.

View qrprat77's full-sized avatar

G Brandon Hoyt qrprat77

View GitHub Profile
Feature: Katie takes a quiz
A quiz has a certain number of questions, and is of a certain type, like
times, add, divide, etc. The default number of questions is 10, and the
default type is "times". When Katie takes a quiz, each problem is
presented one at a time. As Katie answers, she is given immediate
feedback if the answer is correct or not. Incorrect answers are marked
in a file for further analysis and practice. At the end of the quiz,
Katie receives a score and "prize". The prize is a token that Katie can
collect.
@qrprat77
qrprat77 / entry.rb
Created September 10, 2014 04:52
I don't think my class is right
module Read_r
class Entry
attr_accessor :name, :recorder, :favbook, :fiction, :minreadmon, :minreadtues, :minreadweds, :minreadthurs, :minreadoth
def initialize(options = {})
self.name = options[:name]
self.recorder = options[:recorder]
self.favbook = options[:favbook]
options.keys.each do |minread| # from this block on I think is messy
# I want to check if an option is one of the minread* accesssors above
# It seems to me that I'm doing this whole method wrong, duplicating a lot
@qrprat77
qrprat77 / gist:48581a24f37cc7764d3b
Last active August 29, 2015 14:06
making a list of gems, installing that list of gems.
#!/usr/local/bin/ruby
def make_gem_list
File.open("gemlist.txt", "w") do |file|
file.write `gem list`.gsub(/\s[(].*[)]/, "")
end
end
@qrprat77
qrprat77 / upruby.rb
Created November 9, 2010 08:06
My Rubyscript for updating Ruby.
#!/usr/local/bin/ruby
#gettin' lazy wid dem ruby scripts.
Dir.chdir("/your/source/ruby/dir/")
["rm ./configure","svn up","autoconf","./configure --enable-shared",
"make", "make install", "make clean", "gem update"].each do |one|
puts `sudo #{one}`
puts one == "make install" ? `ruby -v` : "Next!"
@qrprat77
qrprat77 / gist:1183066
Created August 31, 2011 08:18
test and code, code works, test fails.
#Here's the spec:
module Antlers
describe Menu do
context "display a Menu from a text file" do
before (:each) do
@messenger = mock("messenger").as_null_object
@menu = Menu.new("Main Menu")
end #before
@qrprat77
qrprat77 / gist:1232287
Created September 21, 2011 15:05
#gistperlproblem
For each of the strings (a)--(e), say which of the patterns (i)--(xii) it matches. Where there is a match, what would be the values of $MATCH, $1, $2, etc.?
the quick brown fox jumped over the lazy dog
The Sea! The Sea!
(.+)\s*\1
9780471975632
C:\DOS\PATH\NAME
/[a-z]/
/(\W+)/
@qrprat77
qrprat77 / DecoupledStubAntenna
Created February 28, 2012 21:18
This discribes a 10/20/40m band antenna made from ladder line.
CM --- NEC2 Input File created by xnec2c-1.2 ---
CM Decoupled Stub antenna, by KG4GVL
CM For 10m, 20m, 40m
CM Adapted from "More Wire Antenna Classics, Vol 2"
CM "Multiband Antennas Using Decoupling Stubs"
CM William J Lattin, W4JRW QST Dec. 1960
CE --- End Comments ---
GW 1 60 -2.43840E+00 0.00000E+00 1.00584E+01 2.43840E+00 0.00000E+00 1.00584E+01 1.50000E-02
GW 2 30 2.43840E+00 0.00000E+00 1.00584E+01 4.54660E+00 0.00000E+00 1.00584E+01 1.50000E-03
GW 3 1 4.54660E+00 0.00000E+00 1.00584E+01 4.54660E+00 0.00000E+00 1.00330E+01 1.50000E-03
CM --- NEC2 Input File created by xnec2c 3.0 ---
CM File by KG4GVL
CM Skeleton Sleeve, 30m/15m based on 40/20m design in
CM Small Antennas for Small Spaces, Appendix A
CM I have no idea if this is the correct way to model this antenna!
CE --- End Comments ---
GW 1 30 -6.05765E+00 0.00000E+00 7.33330E+00 6.05765E+00 0.00000E+00 7.33330E+00 1.50000E-02
GW 2 1 6.05765E+00 0.00000E+00 7.33330E+00 6.05765E+00 0.00000E+00 7.35870E+00 1.50000E-03
GW 3 15 6.05765E+00 0.00000E+00 7.35870E+00 3.38527E+00 0.00000E+00 7.35870E+00 1.50000E-03
GW 4 15 3.13533E+00 0.00000E+00 7.35870E+00 -3.13533E+00 0.00000E+00 7.35870E+00 1.50000E-03
@qrprat77
qrprat77 / SkeleSleeve30m_15m_3.nec
Last active November 8, 2015 07:19
Skeleton Sleeve antenna model for XNEC2C
CM --- NEC2 Input File created by xnec2c 3.0 ---
CM File by KG4GVL
CM Skeleton Sleeve, 30m/15m based on 40/20m design in
CM Small Antennas for Small Spaces, Appendix A
CM I'm pretty sure this is the correct way to model this antenna!
CM Modified 08 Nov 2015
CE --- End Comments ---
GW 1 29 -6.15925E+00 0.00000E+00 7.33330E+00 6.15925E+00 0.00000E+00 7.33330E+00 1.50000E-02
GW 2 1 6.15925E+00 0.00000E+00 7.33330E+00 6.15925E+00 0.00000E+00 7.35870E+00 1.50000E-03
GW 3 15 6.15925E+00 0.00000E+00 7.35870E+00 3.23287E+00 0.00000E+00 7.35870E+00 1.50000E-03