Orange and Blue
Night and Day
Read more/less
Sliding and hiding
class DrawShape | |
def line(user_num=9) | |
"*" * user_num | |
end | |
def number_line(input) | |
input.times do |number| | |
print number unless number == 0 | |
end | |
end |
require 'open-uri' | |
require 'csv' | |
require 'Mechanize' | |
require 'awesome_print' | |
# letter_array = ['0-9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', | |
# 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', | |
# 'u', 'v', 'w', 'x', 'y', 'z'] | |
letter_array = ['b'] | |
letter_array.each do |letter| |
namespace :apprenticeships do | |
desc "scrapes DOL site for apprenticeship data by state" | |
task :scrape => :environment do | |
require 'mechanize' | |
require 'open-uri' | |
require 'csv' | |
apprenticeships_in_state_array = [] | |
# states = ["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY","WI","WY"] |
# nokogiri requires open-uri to work properly | |
require 'nokogiri' | |
require 'open-uri' | |
# Putting it all together | |
# =============================================== | |
# initialize a url and feed into Nokogiri | |
url = "http://www.rottentomatoes.com/m/lincoln_2011/" | |
doc = Nokogiri::HTML(open(url)) |
# Try to figure out which dataset is real and which dataset is fake | |
# Hint: http://en.wikipedia.org/wiki/Benford's_law | |
data1 = ["2", "3", "8", "1", "3", "1", "8", "599", "1", "5", "7", "7", "8", "7", "6", "1", "1", "1", "5", "596", "7", "1", "7", "1", "1", "1", "7", "2", "1", "4", "542", "7", "1", "1", "3", "3", "2", "1", "7", "2", "2", "510", "1", "1", "1", "2", "2", "1", "3", "2", "557", "7", "2", "7", "2", "1", "7", "7", "5", "7", "2", "595", "2", "1", "4", "3", "2", "1", "2", "8", "1", "563", "2", "1", "3", "2", "2", "2", "7", "1", "569", "7", "1", "1", "1", "2", "3", "7", "538", "3", "2", "2", "3", "2", "3", "3", "1", "1", "8", "40239", "502", "5", "9", "1", "1", "7", "1", "8", "7", "568", "1", "2", "1", "1", "7", "1", "2", "7", "1", "2", "501", "1", "8", "7", "2", "1", "2", "1", "1", "1", "2", "509", "9", "2", "1", "1", "2", "2", "7", "1", "2", "541", "2", "2", "1", "8", "1", "2", "2", "2", "3", "525", "2", "7", "1", "1", "3", "2", "2", "1", "1", "479", "3", "2", "1", "8", "2", "3", "2", "2", "5", "2", |
# Gene Sequencing | |
# Given an input array and a test array, create a method that takes in | |
# two arrays as inputs, named 'input' and 'test,' respectively. | |
# 'input' is an array of any number of letters | |
# 'test' is an array of 4 letters | |
# The method returns 'match!' if the 'test' array is found inside the | |
# 'input' array and returns 'no match =(' if the 'test' array is not found | |
# Bonus: Try to make the script work even if your test sequence is reversed |
Orange and Blue
Night and Day
Read more/less
Sliding and hiding
In your web browser, navigate to the project page that you want to clone down and copy the clone URL on the middle-right side of the project page. It should look something like https://github.com/tsl-su-15/ruby_logic.git
Then in terminal, navigate to the parent folder that you want to download the project into and and use the following command, replacing [project_url] with your project's URL:
git clone [project_url]