Skip to content

Instantly share code, notes, and snippets.

@DavidKnott
Forked from mbburch/prework.md
Last active October 3, 2016 04:50
Show Gist options
  • Save DavidKnott/9ce252370e3b2bf06b04c2ad312040e0 to your computer and use it in GitHub Desktop.
Save DavidKnott/9ce252370e3b2bf06b04c2ad312040e0 to your computer and use it in GitHub Desktop.
David Knott Turing pre-work Gist

Turing School Prework - David Knott

Task A- Practice Typing:

https://typing.io/lesson/ruby/rails/relation.rb/1

  • screenshots of scores will be posted in comments

Task B- Algorithmic Thinking & Logic:

  • screenshots of completed sections will be posted in comments

Task C- Create your Gist:

Task D- Set up your Environment:

  • Did you run into any issues?

  • How do you open Atom from your Terminal?

  • What is the file extension for a Ruby file? The file extension for a Ruby file is .rb.

  • What is the Atom shortcut for hiding/ showing your file tree view?

  • What is the Atom shortcut for quickly finding a file (fuzzy finder)? Ctr - E.

Task E- The Command Line:

  • screenshots of your terminal after each exercise will be posted in comments

Day One Questions:

  • What does pwd stand for, and how is this command helpful? Print Working Director, this command is helpful because it allows the user to know exexclty where they are in their terminal.
  • What does hostname tell you, and what shows up in YOUR terminal when you type hostname? The hostname tells me the name of my device that is used when said device is connected to a computer network. A devices hostname is used to identify the device in a myraid of forms of electronic communication.

Task F- Learn Ruby:

http://curriculum.railsbridge.org/ruby/variables

Option 1 Questions:

IRB

  • How do you start and stop irb? You start using irb by typing "irb" into the terminal and stop using irb by typing "exit" into the terminal.
  • What might you use irb for? You can use irb for mathematical calulations and to store information.

Variables

  • How do you create a variable? You create a variable be naming it and then defining it. (e.g. age = 21)
  • What did you learn about the rules for naming variables? I learned that a variable name can consist of: 1)All letters,2)All letters with an udnerscore,3)A letter and then numbers And will not work with: 1)A dash,2)Starting with a number,3)All numbers
  • How do you change the value of a variable? You change the value of a variable by redaclaring it using the "=" sign.

Datatypes

  • How can you find out the class of a variable? You type the name of the variable with ".class"
  • What are two string methods? Two string methods are ".replace" and ".delete"
  • How can you change an integer to a string? You can change an integer to a string by typing the variable name and then ".to_s".

Strings

  • Why might you use double quotes instead of single quotes in Ruby? You would use double quotes if you are going to be performing string interpolation.
  • What is this used for in Ruby: #{}? "#{}" is used to embed a ruby statement into another string.
  • How would you remove all the vowels from a string? I would type ".delete("aeiou")" next to the string.

Input & Output

  • What do 'print' and 'puts' do in Ruby? "puts" prints out infromation to the user. "print" also prints out information to the user but doesn´t make a new line after printing.
  • What does 'gets' do in Ruby? "gets" puses the program and waits for the user to type something and hit enter. It then returns the value back to your program and continues execution.
  • Add a screenshot in the comments of the program you created that uses 'puts' and 'gets', and give it the title, "I/O".

Numbers & Arithmetic

  • What is the difference between integers and floats? Integers are whole numbers and floats are decimals.
  • Complete the challenge, and post a screenshot of your program in the comments with the title, "Numbers".

Booleans

  • What do each of the following symbols mean?
    • == Checks for equality.
    • = Greater than or equal to.

    • <= Less than or equal to.
    • != Checks for inequality.
    • && Checks to see if both statements are true.
    • || Checks to see if atleast one statement is true.
  • What are two Ruby methods that return booleans? .end_width?("") .nil? Conditionals
  • What is flow control? Flow control is when we wnat our program to make decisions for us.
  • What will the following code return?
apple_count = 4

if apple_count > 5
  puts "Lots of apples!"
else
  puts 'Not many apples...'
end
This code will return "Not many apples..."
  • What is an infinite loop, and how can you get out of one? An infinite loop is a while loop that never ends because the body of the while loop doesn't do anything to make the while condition false. You can get out of an infinite loop by typing "ctr + c."
  • Take a screenshot of your program and terminal showing two different outputs, and post it in the comments with the title, "Conditionals".

nil

  • What is nil? nil is a special Ruby data type that means nothing.
  • Take a screenshot of your terminal after working through Step 4, and post it in the comments with the title, "nil".

Symbols

  • How can symbols be beneficial in Ruby? Symbols can be benifical in Ruby because they help us use memomry more efficiently by allowing Ruby variables to point to the same object in several places instead of allocating a new copy.
  • Does naming symbols use the same rules for naming variables? No, when naming variable you can´t use quotes but when naming strings you can.
  • Take a screenshot of your terminal after working through Step 4, and post it in the comments with the title, "Symbols".

Arrays

  • What method can you call to find out how many elements are in an array? .length
  • What is the index of pizza in this array: ["pizza", "ice cream", "cauliflower"]? The index of pizza is 0.
  • What do 'push' and 'pop' do? Push adds a new element to the end of an array. Pop removes and returns the element at the end of an array.

Hashes

  • Describe some differences between arrays and hashes. Arrays contain an ordered list of items while hashes contain an ordered list of keys and their respective values.
  • What is a case when you might prefer an array? What is a case when you might prefer a hash? Arrays are best at storing an ordered list of items when you want to be able to access said items through their position in the array. Hashes are otimal when you want to access the items in a list based on a name, or key.
    • Take a screenshot of your terminal after working through Step 2, and post it in the comments with the title, "Hashes".

Task G- Prework Reflection:

  • Were you able to get through the work? Did you rush to finish, or take your time? I was able the get through the prework and didn't need to rush.
  • What are you most looking forward to learning more about? I'm most looking forward to learning about how to combine what I've learned so far in order to make more complex programs.
  • What topics would you most like to see reinforced by instructors? I'd like to learn more about the correct methods for writing and labeling programs so that other programmers can easily understand and modify my work.
  • What is most confusing to you about what you've learned? I'd like to learn more about hashes and there real world uses.
  • What questions do you have for your student mentor or for your instructors?

Pre-work Tasks- One Month Schedule

(Note: You will most likely only get to the following sections if you have more than a week for your pre-work. If you are doing the one week pre-work schedule, you may delete this section of the Gist.)

Railsbridge Curriculum, cont.

  • Loops: Take a screenshot of your "Challenge" program, and post it as a comment in your Gist.
  • What challenges did you try for "Summary: Basics"? Post a screenshot of one of your programs.
  • Functions: How do you call a function and store the result in a variable?
  • Describe the purpose of the following in Ruby classes: initialize method, new method, instance variables.
  • How to Write a Program: Screenhero with your student mentor and share your program. Write a bit about what you found most challenging, and most enjoyable, in creating your program.

Launch School Ruby Book

  • screenshots will be posted in comments
  • What are your three biggest takeaways from working through this book?

CodeSchool

  • screenshots will be posted in comments
  • What are your two biggest takeaways from working through this tutorial?
  • What is one question you have about Git & GitHub?

Workflow Video

  • Describe your thinking on effective workflow. What shortcuts do you think you'll find most useful? What would you like to learn or practice that will most help you improve your speed and workflow?

Michael Hartl's Command Line Book

As you complete each section, respond to the related questions below (mostly taken directly from the tutorial exercises):

  • 1.3: By reading the "man" page for echo, determine the command needed to print out “hello” without the trailing newline. How did you do it?
  • 1.4: What do Ctrl-A, Ctrl-E, and Ctrl-U do?
  • 1.5: What are the shortcuts for clearing your screen, and exiting your terminal?
  • 2.1: What is the "cat" command used for? What is the "diff" command used for?
  • 2.2: What command would you use to list all txt files? What command would you use to show all hidden files?
  • 3.1: How can you download a file from the internet, using the command line?
  • 3.3: Describe two commands you can use in conjunction with "less".
  • 3.4: What are two things you can do with "grep"?
@DavidKnott
Copy link
Author

David Knott Prework Logic Problem Prework Day 1
Uploading David Knott Turing Logic Problem Prework Day 1.png…

@DavidKnott
Copy link
Author

David Knott Prework Day 1 Ruby RVM and Git Check
turing ruby rvm and git check

@DavidKnott
Copy link
Author

I/O
input and output

@DavidKnott
Copy link
Author

Numbers
addition

@DavidKnott
Copy link
Author

Codecademy Learn the Command Line Course Completed
david knott code academy pre-work code academy learn the command line

@DavidKnott
Copy link
Author

David Knott Prework Typing Day 2
ho

@DavidKnott
Copy link
Author

David Knott Prework Typing Day 3
hi

@DavidKnott
Copy link
Author

Conditionals
next

@DavidKnott
Copy link
Author

nil
wow

@DavidKnott
Copy link
Author

Symbols
symbols

@DavidKnott
Copy link
Author

Hashes
hash

@DavidKnott
Copy link
Author

David Knott Prework Typing Day 4
typing

@DavidKnott
Copy link
Author

David Knott Algorithmic Thinking & Logic Day 1
pp

@DavidKnott
Copy link
Author

David Knott Prework Typing Day 5
asd

@DavidKnott
Copy link
Author

David Knott Prework Typing Day 6
new

@DavidKnott
Copy link
Author

David Knott Prework Typing Day 7
asdasd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment