Skip to content

Instantly share code, notes, and snippets.

@edilenedacruz
Forked from mbburch/prework.md
Last active September 27, 2016 16:08
Show Gist options
  • Save edilenedacruz/874845f78d5bf3f90fb847c34e5271c4 to your computer and use it in GitHub Desktop.
Save edilenedacruz/874845f78d5bf3f90fb847c34e5271c4 to your computer and use it in GitHub Desktop.

Turing School Prework - Edilene

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:

https://gist.github.com/edilenedacruz/874845f78d5bf3f90fb847c34e5271c4

Task D- Set up your Environment:

  • Did you run into any issues?
  • No, I didn't run into any issues.
  • How do you open VS Code from your Terminal?
  • Just type 'code' in Terminal.
  • What is the file extension for a Ruby file?
  • It is .rb
  • What is the VS Code shortcut for hiding/ showing your file tree view?
  • Command + B
  • What is the VS Code shortcut for quickly finding a file (fuzzy finder)?
  • Command + P

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?
  • It stands for "print working directory" and this will indicate the folder you are currently working ensuring you are working in the right place.
  • What does hostname tell you, and what shows up in YOUR terminal when you type hostname?
  • The hostname tells you the main directory in the computer. My hostname is '/Users/edilene'

Task F- Learn Ruby:

Option 1 Questions:

IRB

  • How do you start and stop irb?
  • Start irb by typing 'irb' in Terminal and stop irb by typing 'exit'.
  • What might you use irb for?
  • To experiment how a language works. Variables
  • How do you create a variable?
  • By using an equal sign (=)
  • What did you learn about the rules for naming variables?
  • That not all combination of letters and numbers are acceptable for variables names.
  • How do you change the value of a variable?
  • By assigning it a new value.

Datatypes

  • How can you find out the class of a variable?
  • By adding ".class" to a variable
  • What are two string methods?
  • Upcase and reverse
  • How can you change an integer to a string?
  • By adding ".to_s" after the integer.

Strings

  • Why might you use double quotes instead of single quotes in Ruby?
  • The double quotes if you need a string interpolation.
  • What is this used for in Ruby: #{}?
  • It is used to perform a string interpolation.
  • How would you remove all the vowels from a string?
  • By adding .delete(aeiou)to the end of a string

Input & Output

  • What do 'print' and 'puts' do in Ruby?
  • 'Print' will print the text without adding a new line after printing; 'puts' will print the information and will add a new line after it.
  • What does 'gets' do in Ruby?
  • 'gets' (get string) will pause the program and wait for user input, then it will return the value back to the program.
  • 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
    • = greater than or equal to

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

Conditionals

  • What is flow control?
  • Is the ability of asking the program to perform task as requested.
  • What will the following code return?
apple_count = 4

if apple_count > 5
  puts "Lots of apples!"
else
  puts 'Not many apples...'
end
  • It will return "Not many apples..."
  • What is an infinite loop, and how can you get out of one?
  • It is a sequence of instructions that will never end because there's no false condition. To get out type 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 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?
  • It saves memory and helps 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, it doesn't.
  • 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"]? It is [0]
  • What do 'push' and 'pop' do?
  • 'Push' inserts an item to the array and 'pop' removes the last of the array and presents it._ Hashes
  • Describe some differences between arrays and hashes.
  • Arrays stores an ordered list and hashes stores a list by their value.
  • What is a case when you might prefer an array? What is a case when you might prefer a hash?
  • I would use an array when the order is important to the result and I would use a hash when the order is not important but the value is important.
    • 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 not able to complete the conditions calculator but I didn't rush. I took my time to make sure that I understood what was being asked.
  • What are you most looking forward to learning more about?
  • I'm looking forward to see what all I can do with Ruby and also to see how all that I will learn will be put together.
  • What topics would you most like to see reinforced by instructors?
  • ###blank
  • What is most confusing to you about what you've learned?
  • 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"?
@edilenedacruz
Copy link
Author

edilenedacruz commented Sep 19, 2016

Priority 2 - Launch School's Ruby book

Getting started - exercises

screen shot 2016-09-19 at 4 26 40 pm

2.

screen shot 2016-09-19 at 4 29 40 pm

### The Basics - exercises

screen shot 2016-09-19 at 4 58 51 pm

2.

screen shot 2016-09-19 at 5 05 40 pm

3.

screen shot 2016-09-19 at 5 51 52 pm

4.

screen shot 2016-09-19 at 5 52 43 pm

5.

screen shot 2016-09-19 at 5 53 21 pm

6.

screen shot 2016-09-19 at 5 54 14 pm

7. The message tells me that we used a closing parentheses ')' instead of a closing curly braces '}'.

@edilenedacruz
Copy link
Author

edilenedacruz commented Sep 20, 2016

Variables - exercises

screen shot 2016-09-19 at 8 38 37 pm

2.

screen shot 2016-09-19 at 8 39 25 pm

3.

screen shot 2016-09-19 at 10 16 36 pm

4.

screen shot 2016-09-19 at 10 22 25 pm

5. The x only prints in the first snippet. In the second snippet, it gave me an error message because x hasn't been defined outside the block. 6. The error message indicates that the variable was not defined yet or was defined outside of the scope in which is being called.

@edilenedacruz
Copy link
Author

edilenedacruz commented Sep 20, 2016

Methods - exercises

screen shot 2016-09-20 at 10 05 45 am

screen shot 2016-09-20 at 10 04 18 am

screen shot 2016-09-20 at 10 10 33 am

It won't print anything
screen shot 2016-09-20 at 10 14 42 am

screen shot 2016-09-20 at 10 16 46 am

1. The message is telling me that the method "calculate_product" needs 2 arguments but only one was provided.

@edilenedacruz
Copy link
Author

edilenedacruz commented Sep 20, 2016

Flow control - exercises

false
false
false
true
true
screen shot 2016-09-20 at 11 33 48 am
1.
screen shot 2016-09-20 at 11 41 29 am

screen shot 2016-09-20 at 12 18 10 pm

1.

screen shot 2016-09-20 at 12 38 28 pm

screen shot 2016-09-20 at 1 34 18 pm

The error message occurs because we are missing an "end" statement for the if/else statement
screen shot 2016-09-20 at 12 45 30 pm

@edilenedacruz
Copy link
Author

edilenedacruz commented Sep 22, 2016

Loops & Iterators

1.
screen shot 2016-09-21 at 1 05 30 pm

2.
screen shot 2016-09-21 at 1 23 59 pm

3.
screen shot 2016-09-21 at 1 32 06 pm

4.
screen shot 2016-09-21 at 1 44 08 pm

@edilenedacruz
Copy link
Author

edilenedacruz commented Sep 22, 2016

Arrays

screen shot 2016-09-21 at 8 38 14 pm

screen shot 2016-09-22 at 8 24 42 am

screen shot 2016-09-22 at 8 32 18 am

screen shot 2016-09-22 at 8 40 44 am

screen shot 2016-09-22 at 8 44 22 am

screen shot 2016-09-22 at 8 50 15 am

screen shot 2016-09-22 at 9 05 43 am

@edilenedacruz
Copy link
Author

edilenedacruz commented Sep 23, 2016

Hashes

screen shot 2016-09-22 at 12 49 50 pm

screen shot 2016-09-22 at 1 18 56 pm

screen shot 2016-09-22 at 1 38 18 pm

screen shot 2016-09-22 at 1 54 04 pm

screen shot 2016-09-22 at 2 02 07 pm

screen shot 2016-09-22 at 7 31 38 pm

screen shot 2016-09-22 at 7 42 17 pm

1. **B**

@edilenedacruz
Copy link
Author

edilenedacruz commented Sep 26, 2016

Files - didn't work - come back later

@edilenedacruz
Copy link
Author

edilenedacruz commented Sep 26, 2016

More stuff

1.
morestuff1

2.
morestuff2

3.
Exception handling is writing your code/program in a way that will be instructed to continue if an error occurs.

4.
morestuff4

5.
It was missing the ampersand sign.
morestuff5

@edilenedacruz
Copy link
Author

edilenedacruz commented Sep 27, 2016

Exercises

1.
screen shot 2016-09-26 at 6 09 11 pm

2.
screen shot 2016-09-26 at 6 09 28 pm

3.
screen shot 2016-09-26 at 6 09 50 pm

4.
screen shot 2016-09-26 at 6 10 10 pm

5.
screen shot 2016-09-26 at 6 10 33 pm

6.
screen shot 2016-09-26 at 6 13 03 pm

7.
The main difference is that hashes has values and keys.

8.
screen shot 2016-09-26 at 6 18 24 pm

9.
screen shot 2016-09-26 at 6 24 31 pm

10.
Yes, hashes can be arrays and vice versa.

array = [{continent: "America"}, {continent: "Asia"}]
hash = {continents: ["America", "Asia"]}

11.
Unsure at this point.
*

12.
screen shot 2016-09-26 at 9 16 31 pm

13.
screen shot 2016-09-26 at 9 24 39 pm

14.
screen shot 2016-09-27 at 8 33 06 am

15.
screen shot 2016-09-27 at 8 46 28 am

16.
screen shot 2016-09-27 at 9 01 04 am

17.
screen shot 2016-09-27 at 9 03 56 am

@edilenedacruz
Copy link
Author

edilenedacruz commented Sep 27, 2016

Priority 3: Learn how to use Git & GitHub

git

screen shot 2016-09-27 at 10 03 13 am

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