Skip to content

Instantly share code, notes, and snippets.

@alfosco
Forked from mbburch/prework.md
Last active September 20, 2016 17:27
Show Gist options
  • Save alfosco/bb55a1193a19e855bcbe692ab7d63b5b to your computer and use it in GitHub Desktop.
Save alfosco/bb55a1193a19e855bcbe692ab7d63b5b to your computer and use it in GitHub Desktop.
An example template for your Turing pre-work Gist

Turing School Prework- Alex Fosco

Task A- Practice Typing:

  • 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? -I installed Visual Studio Code instead of Atom which was suggested in the set-up post. So the questions below referring to 'Atom' will actually be VS Code on my system.
  • How do you open Atom from your Terminal? -Type code in the terminal.
  • What is the file extension for a Ruby file? -.rb
  • What is the Atom shortcut for hiding/ showing your file tree view? -command B
  • What is the Atom shortcut for quickly finding a file (fuzzy finder) -command F

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 directory; it displays your present directory and the pathway to get there
  • What does hostname tell you, and what shows up in YOUR terminal when you type hostname? -it displays the system's hostname; when I type hostname it shows: alex-foscos-macbook-pro.local

Task F- Learn Ruby:

Option 1 Questions:

IRB

  • How do you start and stop irb? -To start type 'irb' in the terminal. To stop type 'exit' in the terminal.
  • What might you use irb for? -It is useful for experimenting and to find out how certain langauge features work.

Variables

  • How do you create a variable? -Utilize a single equals sign (=). To the left of it assign a name and to the right of it assign a value.
  • What did you learn about the rules for naming variables? -You cannot use constants when naming variables becuase they never change.
  • How do you change the value of a variable? -Type the name of the variable and re-assign a value utilizing the equals sign.

Datatypes

  • How can you find out the class of a variable? -type the variable, then a period, then 'class' or a different method name you want to know
  • What are two string methods? -upcase, downcase!
  • How can you change an integer to a string? -type the integer, then a period followed by 'to_s'; ex. 5.to_s would output "5"

Strings

  • Why might you use double quotes instead of single quotes in Ruby? -double quotes allow you to execute string interpolation
  • What is this used for in Ruby: #{}? -it's used for string interpolation; it lets you embed a Ruby statement in another string
  • How would you remove all the vowels from a string? -type your string between quotes, followed by the '.delete' method, then type ('aeiou')

Input & Output

  • What do 'print' and 'puts' do in Ruby? -'print' prints information to the user of the program, and 'puts' does the same thing and adds a new line after printing
  • What does 'gets' do in Ruby? -it pauses the program to get input from the user, then it returns the user's input back into the 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?
    • == -equal to
    • = -greater than or equal to

    • <= -less than or equal to
    • != -not equal to
    • && -and
    • || -or
  • What are two Ruby methods that return booleans? -.end_with? and .empty?

Conditionals

  • What is flow control? -allowing the program to make selections for the user
  • What will the following code return? -Not many apples
apple_count = 4

if apple_count > 5
  puts "Lots of apples!"
else
  puts 'Not many apples...'
end
  • What is an infinite loop, and how can you get out of one? -if your loop body doesn't do anything to make the while condition 'false', the loop will run forever; you can terminate the program by typing ctrl+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? -it means nothing; it is used to show that a variable hasn't been assigned anything yet or that a function didn't return a value
  • 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? -they let Ruby variables point to the same object in several places instead of allocating a new copy, thus using memory more efficiently
  • Does naming symbols use the same rules for naming variables? -they differ in that symbols cannot be assigned a value
  • 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? -use the '.length' method
  • What is the index of pizza in this array: ["pizza", "ice cream", "cauliflower"]? -0
  • What do 'push' and 'pop' do? -push adds a new element to the end of the array; pop removes and returns the element at the end of the array

Hashes

  • Describe some differences between arrays and hashes. -with hashes you can access elements by their key as opposed to accessing them by their index with arrays
  • What is a case when you might prefer an array? What is a case when you might prefer a hash? -I'd prefer an array when I want to store an ordered list of items, I'd prefer a hash when I want to access items in a list based on their 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 did not have to rush to complete the pre-work.
  • What are you most looking forward to learning more about? -I am looking forward to finding out what programs I can build with Ruby.
  • What topics would you most like to see reinforced by instructors? -How you fit all these topics we covered together to build useful programs.
  • What is most confusing to you about what you've learned? -I didn't find anything covering the command line or Ruby confusing yet, but I struggled with the challenge quiz algorithms on brilliant.org.
  • What questions do you have for your student mentor or for your instructors? -Nothing specific right now. I am going to continue through the additional pre-work assignments and will communicate any questions I have.

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? -To call a function, first say the name of the function, then send in the values the function needs to do its job. To store the result in a variable set the result = to a desired variable.
  • Describe the purpose of the following in Ruby classes: initialize method, new method, instance variables. -initialize method saves the initial data your object is created with and performs any other required set-up -new method creates an instance of your object; arguments passed in to new are sent to your initialize method -instance variables store data on your object with an '@' sign; instance variables behave like normal variables, but are only visible from inside a specific instance of your object
  • 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"?
@alfosco
Copy link
Author

alfosco commented Sep 20, 2016

Hash of people at my table
my_table_hash

@alfosco
Copy link
Author

alfosco commented Sep 20, 2016

Months Array
months_array

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