This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elsif word.include?("qu") #word contains 'qu'. | |
if word[0..1].include?("qu") #word begins with 'qu'. | |
result << word[2..-1] + word[0..1] + "ay" | |
else #'qu' is somewhere else in the word. | |
position = word.index("qu") | |
result << word[0..position] + "qu" + word[(position + 2)..-1] + "ay" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def translate(word) | |
word_list = word.split(/ /) | |
letters = ('a'..'z').to_a | |
vowels = ['a', 'e', 'i', 'o', 'u'] | |
consonants = letters - vowels | |
result = "" | |
word_list.each do |word| | |
if vowels.include?(word[0]) #translate word beginning with vowels. | |
result << word + "ay" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def translate(word) | |
word_list = word.split(/ /) | |
letters = ('a'..'z').to_a | |
vowels = ['a', 'e', 'i', 'o', 'u'] | |
consonants = letters - vowels | |
result = "" | |
word_list.each do |word| | |
if word.include?("qu") #word contains 'qu'. | |
if word[0..1].include?("qu") #word begins with 'qu'. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def measure(repeat = 1) | |
start_calc = 0 | |
end_calc = 0 | |
total_time = 0 | |
repeat.times do | |
start_calc = Time.now | |
yield | |
end_calc = Time.now | |
total_time = total_time + (end_calc - start_calc) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GEM | |
remote: https://rubygems.org/ | |
specs: | |
actionmailer (3.2.11) | |
actionpack (= 3.2.11) | |
mail (~> 2.4.4) | |
actionpack (3.2.11) | |
activemodel (= 3.2.11) | |
activesupport (= 3.2.11) | |
builder (~> 3.0.0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe "Cats" do | |
it "Has a homepage" do | |
visit "cats/home" | |
page.should have_content("About cats") | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Checking file system on D: | |
The type of the file system is NTFS. | |
Volume label is FreeAgent Disk. | |
Unable to query LCN from VCN 0x5 for attribute of type 0x80. | |
The non resident attribute of type 0x80 is inconsistent. The valid data | |
length is 0x27c1c000, file size 0x27c1c000, and allocated length 0x4000. | |
The non resident attribute of type 0x80 is inconsistent. The valid data | |
length is 0x27c1c000, file size 0x4000, and allocated length 0x4000. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form name="aspnetForm" method="post" action="signIn.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="aspnetForm"> | |
<div> | |
<input type="hidden" name="hdnServer" id="hdnServer" value=".101" /> | |
<input type="hidden" name="hdnSID" id="hdnSID" value="D8FE96CEB8E545B897D00212D0FF810B" /> | |
<input type="hidden" name="hdnLangCode" id="hdnLangCode" value="en-US" /> | |
<input type="hidden" name="hdnPOS" id="hdnPOS" value="US" /> | |
<input type="hidden" name="hdnClient" id="hdnClient" value="108.185.16.157" /> | |
<input type="hidden" name="hdnInactive" id="hdnInactive" value="false" /> | |
<input type="hidden" name="hdnAccountNumber" id="hdnAccountNumber" value="" /> | |
<input type="hidden" name="hdnAccountNumberE" id="hdnAccountNumberE" value="" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# missing_number_spec.rb | |
# Suppose you have an array of 99 numbers. The array contains the digits 1 to 100 with one digit missing. | |
# Write four different algorithms to compute the missing number. | |
# Two of these should optimize for low storage and two of these should optimize for fast processing. | |
require 'rspec' | |
def missing_number params | |
sum_total = 5050 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chad@zen:~/repos/cybercoders$ cat /home/chad/.rvm/gems/ruby-2.0.0-p247/bin/rspec | |
#!/usr/bin/env ruby_executable_hooks | |
# | |
# This file was generated by RubyGems. | |
# | |
# The application 'rspec-core' is installed as part of a gem, and | |
# this file is here to facilitate running it. | |
# | |
require 'rubygems' |