Skip to content

Instantly share code, notes, and snippets.

@Dpalazzari
Forked from mbburch/prework.md
Last active October 2, 2016 04:49
Show Gist options
  • Save Dpalazzari/a52b50ecd8efc397ae251890e23e067c to your computer and use it in GitHub Desktop.
Save Dpalazzari/a52b50ecd8efc397ae251890e23e067c to your computer and use it in GitHub Desktop.
Drew's Turing pre-work Gist
# 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? Mostly just typing things incorrectly and not noticing quickly enough.
* How do you open Atom from your Terminal? Type in atom .
* What is the file extension for a Ruby file? I believe it is .rb. In the terminal you can type in 'irb' to start ruby coding
* What is the Atom shortcut for hiding/ showing your file tree view? it says that I can hide/show with command /
* What is the Atom shortcut for quickly finding a file (fuzzy finder)? Command T
### 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? present working directory. It outputs the name of the directory/folder you are currently in
* What does hostname tell you, and what shows up in YOUR terminal when you type hostname? when I type it into my terminal, it says Drews-MacBook-Pro.Local
I assume this is indicating that I am working directly on my macbook, and not from a remote terminal.
*note* if unsure what anything is in terminal type man and then the terminal term. ex: man pwd*
*After "I like pizza" step use esc, and then :wq to exit
*cat for long files, less for when you are more familiar
*After using Vim Pizza.txt, use i to insert words/descriptions
### Task F- Learn Ruby:
#### Option 1 Questions:
**IRB**
* How do you start and stop irb? type in 'ird' to start and 'exit' to quit irb.
* What might you use irb for? irb is used to "experiment and find out how certain language features work." YOu will not actually use it to type code
because you cannot save your work.
**Variables**
* How do you create a variable? ex: my_variable = [variable]
* What did you learn about the rules for naming variables? Each different variable will need a specific command file name.
* How do you change the value of a variable? if my_variable = 5, and oyu need to change it, just type my_variable = 10 to
change the value of the variable.
**Datatypes**
* How can you find out the class of a variable? type ".class" after it. Ex: "letters and words".class
* What are two string methods? I think that is when you type in "Drew" + "Palazzari" into the terminal.
* How can you change an integer to a string? you add .to_s to the end of the integer
**Strings**
* Why might you use double quotes instead of single quotes in Ruby? If you need to use a string interpolation.
* What is this used for in Ruby: #{}? it's a string iterpolation: lets you imbed a ruby rule or statement in another string.
* How would you remove all the vowels from a string? type .delete('aeiou') at the end of your string. Ex: 'A Strong man'.remove('aeiou')
**Input & Output**
* What do 'print' and 'puts' do in Ruby? Whenn you run the code, the print command simply prints whatever the programmer wants to say/ask
* What does 'gets' do in Ruby? gets is a way that ruby gathers inputs from users and can apply it to other rules in the code. You GET answers.
* 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 full numbers. Floats have decimal places.
* 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
+ != the opposite of
+ && and as in also
+ || or operator
* What are two Ruby methods that return booleans? anything that ends with a question or if/else statements
**Conditionals**
* What is flow control? When programs make decisions for us.
* What will the following code return? I provided pictures of this part in the comments of my gist, titled "apple game"
```
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? a loop that runs, you guessed it, forever! TO terminate the program you use 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? nil means nothing. Nil means a variable has no value or meaning.
* 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 are fixed objects that wont be accidentally changed by a method or variable when coding in ruby.
* Does naming symbols use the same rules for naming variables? In terms of quotes, yes. When making symbols, you need a colon (:) though.
* 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? you type .length at the end of the array. Ex: Fruits.length
* What is the index of pizza in this array: ["pizza", "ice cream", "cauliflower"]? Index of pizza is 0
* What do 'push' and 'pop' do? Push adds an object to the end of an array. Pop removes the object from the end of an array.
**Hashes**
* Describe some differences between arrays and hashes. Arrays are used for an ordered list of items. Hashes group large amounts of related data
associating keys with values. Keys are usually the name of a property, values are the value of the property given. EX: Key: make/color Value: Corolla/Silver
* What is a case when you might prefer an array? What is a case when you might prefer a hash? Arrays are fine for simple lists of objects. If you dont need to access
values of the objects in the array, it's perfect. But if you need more details, or to access items in the list based on a name, you would use a Hash.
Hashes are for the details of objects in an array.
Array: Fruits = ['apple', 'orange', 'kiwi', 'plum']
Hash: Apple = {"taste" => "sugary", "color" => "red"}
* * 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? Some of the parts I flew through, others I found challenging. Overall, it was fun!
* What are you most looking forward to learning more about? Making more complex/complicated code that does multiple things, like a well oiled complex machine.
* What topics would you most like to see reinforced by instructors? when and where to put spaces in your code.
* What is most confusing to you about what you've learned? I get confused as to what to name my variables, where to put spaces in my code, and which methods to use, sometimes.
* What questions do you have for your student mentor or for your instructors? I have mostly touched base on how to organize your work week, when to arrive, how the hw will work, etc.
I think the vast majority of my question will have to do with my code.
## 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. I did the hard ones, and it was fun! Just didnt make the hash or the array.
* Functions: How do you call a function and store the result in a variable? TO call a funciton you type def {function name}. If the function is: def backwards('Hello'), you can make it a variable by typing mirror = backwards 'Hello'
* Describe the purpose of the following in Ruby classes: initialize method, new method, instance variables. Inititalize Method saves the initial data your object is created with. Arguments passed in to new are sent into oyur initialize Method.
Instance variable are variables that start with @. THey are only visible 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"?
@Dpalazzari
Copy link
Author

9/27/2016

screen shot 2016-09-27 at 11 19 48 am

screen shot 2016-09-27 at 11 29 21 am

@Dpalazzari
Copy link
Author

Dpalazzari commented Sep 28, 2016

9/28/2016

screen shot 2016-09-28 at 11 31 26 am

screen shot 2016-09-28 at 11 34 59 am

Launch School's Ruby Book Exercises
screen shot 2016-09-28 at 12 12 07 pm

The Basic's Exercises
screen shot 2016-09-28 at 12 38 53 pm
screen shot 2016-09-28 at 12 38 24 pm
screen shot 2016-09-28 at 12 38 33 pm
screen shot 2016-09-28 at 12 38 38 pm
screen shot 2016-09-28 at 12 38 44 pm

Variables Exercises

screen shot 2016-09-28 at 1 37 59 pm

screen shot 2016-09-28 at 1 42 20 pm

screen shot 2016-09-28 at 1 42 26 pm

screen shot 2016-09-28 at 1 48 27 pm

screen shot 2016-09-28 at 1 48 35 pm

screen shot 2016-09-28 at 1 50 18 pm

screen shot 2016-09-28 at 1 50 25 pm

@Dpalazzari
Copy link
Author

Dpalazzari commented Sep 29, 2016

9/29/2016

screen shot 2016-09-29 at 2 17 23 pm

screen shot 2016-09-23 at 4 09 21 pm

Method Exercises
screen shot 2016-09-29 at 3 07 45 pm
screen shot 2016-09-29 at 3 07 59 pm
screen shot 2016-09-29 at 3 08 06 pm
screen shot 2016-09-29 at 3 08 14 pm

Flow Control Exercises

screen shot 2016-09-29 at 3 30 18 pm

screen shot 2016-09-29 at 3 23 16 pm

screen shot 2016-09-29 at 3 29 59 pm

screen shot 2016-09-29 at 3 30 09 pm

LOOPS
screen shot 2016-09-29 at 4 11 38 pm
screen shot 2016-09-29 at 4 11 48 pm
screen shot 2016-09-29 at 4 21 42 pm
screen shot 2016-09-29 at 4 11 10 pm
screen shot 2016-09-29 at 4 10 56 pm
screen shot 2016-09-29 at 3 52 37 pm
screen shot 2016-09-29 at 4 21 49 pm

@Dpalazzari
Copy link
Author

10/1/2016

screen shot 2016-10-01 at 10 15 08 pm

Arrays Challenges
screen shot 2016-10-01 at 10 40 25 pm
screen shot 2016-10-01 at 10 48 11 pm
screen shot 2016-10-01 at 10 48 17 pm

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