Skip to content

Instantly share code, notes, and snippets.

@Ryanspink1
Created November 27, 2016 20:12
Show Gist options
  • Save Ryanspink1/4b7f04a33858dcb4fd7111e70e6ebc0f to your computer and use it in GitHub Desktop.
Save Ryanspink1/4b7f04a33858dcb4fd7111e70e6ebc0f to your computer and use it in GitHub Desktop.
# Turing School Prework
### 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?
No problems on this end.
* How do you open VS from your Terminal?
After installing the 'code' command in path, VS is now opened by entering 'code' in Terminal
* What is the file extension for a Ruby file?
* A: 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)?
### 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?
* A: pwd stands for "print working directory". It is useful as it outputs the name of your current directory.
* What does hostname tell you, and what shows up in YOUR terminal when you type hostname?
* A: Hostname shows your computers network name. My hostname is "Ryans-MacBook-Pro.local"
### Task F- Learn Ruby:
#### Option 1 Questions:
**IRB**
* How do you start and stop irb?
* A: irb is started by typing "irb" into the command line. It's stopped by typing "exit" into the command line.
* What might you use irb for?
* A: irb is used for running Ruby code within the terminal.
**Variables**
* How do you create a variable?
* A: variables are created by assigning a value to a name.
* What did you learn about the rules for naming variables?
* A: variables cannot have the value of letters, number variables cannot have a value other than their own, spaces in variable names must use an underscore not a dash, cannot have letters and numbers as the variable value, cannot have an integer start the name of a variable, can have an integer in the variable name though,
* How do you change the value of a variable?
* A: The value of the variable can be changed by reassignign a new value to the name ie. " abalone = 6" can be changed with " abalone = 7"
**Datatypes**
* How can you find out the class of a variable?
* A: Type in the variable with ".class" proceeding it.
* What are two string methods?
* A: partition and unpack are two string methods
* How can you change an integer to a string?
* A: integer.to_s
**Strings**
* Why might you use double quotes instead of single quotes in Ruby?
* A: To eliminate confusion when using lots of quotations?
* What is this used for in Ruby: #{}?
* A: This is used for interpolation
* How would you remove all the vowels from a string?
* A: All the vowels in a string can be removed by: "a string".delete('aeiou')
**Input & Output**
* What do 'print' and 'puts' do in Ruby?
* A: 'Puts' prints information to the user of the program. 'Print' does the same thing, but doesn't start a new line after.
* What does 'gets' do in Ruby?
* A: 'gets' retrieves the value that was entered by the user
* 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?
* A: integers are whole numbers, floats can contain decimels/fractions of numbers
* 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?
+ == equals
+ >= more than or equal to
+ <= less than or equal to
+ != opposite of
+ && and
+ || or
* What are two Ruby methods that return booleans?
* A: Two Ruby methods that return booleans are ".include?" and ".nil?"
**Conditionals**
* What is flow control?
* A: Flow control is using the program to make decisions for you using "if" "else" and "end" to construct a statement.
* What will the following code return?
```
apple_count = 4
if apple_count > 5
puts "Lots of apples!"
else
puts 'Not many apples...'
end
```
* A: The code returns "Not many apples..."
* What is an infinite loop, and how can you get out of one?
* A: An infinite loop is when the loop body doesn't do anything to make the loop condition false...running on forever. One can get out of this situation by typing "control+c" to terminate the program.
* 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?
* A: "Nil is a special ruby type data 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?
* A: Symbols can be beneficial in Ruby by using memory more efficiently.
* Does naming symbols use the same rules for naming variables?
* A: Symbols don't use the same rules. Instead of creating a new object ID, it allows the user to give the same symbol the same object ID, thus saving memory.
* 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?
* A: The method to find out how many elements are in an array is '"array".length'
* What is the index of pizza in this array: ["pizza", "ice cream", "cauliflower"]?
* A: The index of pizza in this array is "0"
* What do 'push' and 'pop' do?
* A: Push adds an element at the end of an array, pop removes the element at the end of an array.
**Hashes**
* Describe some differences between arrays and hashes.
* A: Arrays store ordered lists of items, hashes store properties of objects. In such, Arrays store things based on keys, and hashes store will store as a pair of a key and a value.
* What is a case when you might prefer an array? What is a case when you might prefer a hash?
* A: One might prefery an array when you want to store an ordered list of items. A Hash might be preferable when one wants to store keys with values.
* * 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?
* What are you most looking forward to learning more about?
* What topics would you most like to see reinforced by instructors?
* 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"?
@Ryanspink1
Copy link
Author

Task F: Simple Calculator output
simplecalculator output

Simple Calc Prog:
numbers

@Ryanspink1
Copy link
Author

Task F: Nil
nil

@Ryanspink1
Copy link
Author

Task F: IRB
irb running programs from a file

@Ryanspink1
Copy link
Author

Task F: I/O Program
i o

I/O Output
input output

@Ryanspink1
Copy link
Author

Task F: Hashes
hashes

@Ryanspink1
Copy link
Author

Task F: Data Types
data types

@Ryanspink1
Copy link
Author

Task F: Conditionals Program

conditionals1

Conditionals Output:

conditionals2

@Ryanspink1
Copy link
Author

Task F: Booleans

booleans

@Ryanspink1
Copy link
Author

Task F: Arrays

arrays

@Ryanspink1
Copy link
Author

Priority 1: Loop Challenge 1
loop challenge 1

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