A Pen by Rachel Warbelow on CodePen.
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 is_fibonacci?(i) | |
| tester1 = Math.sqrt((5*(i*i)) + 4) | |
| tester2 = Math.sqrt((5*(i*i)) - 4) | |
| if (tester1 - tester1.to_i) == 0 or (tester2 - tester2.to_i) == 0 | |
| return true | |
| else | |
| return false | |
| 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
| ### PART 1 (write tests) | |
| class Car | |
| @@WHEELS = 4 | |
| def initialize(args) | |
| @color = args[:color] | |
| @wheels = @@WHEELS | |
| end | |
| def drive | |
| @status = :driving |
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
| <!doctype html> | |
| <html> | |
| <head> | |
| <link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css"> | |
| <link rel="stylesheet" href="main.css"> | |
| <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800"> | |
| <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900"> | |
| <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css"> | |
| </head> |
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 find_submissions(course) | |
| @course_category_submissions = Hash.new([]) | |
| self.submissions.each do |submission| | |
| cat = "#{submission.assignment.assignment_category.name}" | |
| weight = submission.assignment.assignment_category.weight | |
| @course_category_submissions[[cat, weight]] = [] | |
| end | |
| self.submissions.each do |submission| | |
| cat = "#{submission.assignment.assignment_category.name}" | |
| weight = submission.assignment.assignment_category.weight |
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
| Started PUT "/admin/student_profiles/155" for 127.0.0.1 at 2013-09-22 19:35:39 -0700 | |
| Processing by Admin::StudentProfilesController#update as HTML | |
| Parameters: {"utf8"=>"✓", "authenticity_token"=>"Ms4TZwzD3X2729++CmQSRompltCRrTDQS96/NYn0HAw=", "student"=>{"birthday"=>"1985-05-05", "gender"=>"male", "grade_level"=>"7", "ccsd_id"=>"3333488", "email"=>"[email protected]"}, "identity"=>{"username"=>"gracealtenwerth", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Update", "id"=>"155"} | |
| Identity Load (0.3ms) SELECT "identities".* FROM "identities" WHERE "identities"."id" = 402 LIMIT 1 | |
| Admin Load (0.3ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = 1 LIMIT 1 | |
| Student Load (0.2ms) SELECT "students".* FROM "students" WHERE "students"."id" = $1 LIMIT 1 [["id", "155"]] | |
| Identity Load (0.4ms) SELECT "identities".* FROM "identities" WHERE "identities"."student_id" = 155 LIMIT 1 | |
| (0.1ms) BEGIN | |
| Identity Exists (0.3ms) SELECT 1 AS one FROM "identities" WHERE ("ide |
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
| --color |
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
| ENCODE = { "a" => "j", "b" => "3", "c" => "l", "d" => "m", "e" => ".", | |
| "f" => "o", "g" => "p", "h" => "4", "i" => "r", "j" => "&", "k" => "t", | |
| "l" => "u", "m" => "v", "n" => "#", "o" => "x", "p" => "y", "q" => "9", | |
| "r" => "a", "s" => "$", "t" => "c", "u" => "[", "v" => "e", "w" => "f", | |
| "x" => "g", "y" => "8", "z" => "i", " " => " " } | |
| DECODE = { "j" => "a", "3" => "b", "l" => "c", "m" => "d", "." => "e", | |
| "o" => "f", "p" => "g", "4" => "h", "r" => "i", "&" => "j", "t" => "k", | |
| "u" => "l", "v" => "m", "#" => "n", "x" => "o", "y" => "p", "9" => "q", | |
| "r" => "a", "s" => "$", "t" => "c", "u" => "[", "v" => "e", "w" => "f", |
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 10 columns, instead of 7 in line 9.
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
| ,RegDate,first_Name,last_Name,Email_Address,HomePhone,Street,City,State,Zipcode | |
| 1,11/12/08 10:47,Allison,Nguyen,[email protected],6154385000,3155 19th St NW,Washington,DC,20010 | |
| 2,11/12/08 13:23,SArah,Hankins,[email protected],414-520-5000,2022 15th Street NW,Washington,DC,20009 | |
| 3,11/12/08 13:30,Sarah,Xx,[email protected],(941)979-2000,4175 3rd Street North,Saint Petersburg,FL,33703 | |
| 4,11/25/08 19:21,David,Thomas,[email protected],650-799-0000,9 garrison ave,Jersey City,NJ,7306 | |
| 5,2/2/09 11:29,Chris,Sackett,[email protected],613 565-4000,173 Daly Ave,Ottawa,ON, | |
| 6,11/12/08 15:00,Aya,Fuller,[email protected],778.232.7000,2-1325 Barclay Street,Vancouver,BC,90210 | |
| 7,11/12/08 16:05,Mary Kate,Curry,[email protected],(202) 328 1000,1509 Jackson Street,Baltimore,MD,21230 | |
| 8,11/12/08 17:18,Audrey,Hasegan,[email protected],530-919-3000,1570 Old Ranch Rd.,Placerville,CA,95667 | |
| 9,11/13/08 1:32,Shiyu,Armideo,[email protected],8084974000,644 Ike |
A Pen by Rachel Warbelow on CodePen.
OlderNewer