Skip to content

Instantly share code, notes, and snippets.

@meyerhoferc
Forked from mbburch/prework.md
Last active November 26, 2016 20:27
Show Gist options
  • Save meyerhoferc/31001d9dfb74d546374102a018981b5b to your computer and use it in GitHub Desktop.
Save meyerhoferc/31001d9dfb74d546374102a018981b5b to your computer and use it in GitHub Desktop.
Courtney Meyerhofer 1611 prework

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?

I have not located instructions for how to have multiple folders open simultaneously in the VS Code environment.

* How do you open VS Code from your Terminal?

I can open VS Code from the terminal by typing 'code'. I added that to the $Path.

* What is the file extension for a Ruby file?

.rb

* What is the VS Code shortcut for hiding/ showing your file tree view?

I use cmd + B.

* What is the VS Code shortcut for quickly finding a file (fuzzy finder)?

I use cmd + 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?

The command 'pwd' represents "print working directory" or "present working directory." This command, combined with 'ls', allows you to know your location within the file structure of your computer.

* What does hostname tell you, and what shows up in YOUR terminal when you type hostname?

It prints the name of your local system. My terminal printed 'local'.

Task F- Learn Ruby:

Option 1 Questions:

IRB

* How do you start and stop irb?

In order to start irb, I type 'irb' in the terminal prompt. To stop irb, I can type 'exit', 'quit', or 'CTRL + d'.

* What might you use irb for?

I can use irb for calcuations or to experiment with very short scripts.

Variables

* How do you create a variable?

I can create a variable by declaring a variable name equal to some information, such as: a = 13, b = "string", c4 = "explosive".

* What did you learn about the rules for naming variables?

I found that numbers can appear in any position of a variable name except for the first character. Underscores may be used in variable names while hypens may not. Additionally, I didn't not find a way for a variable to be only a number for its name.

* How do you change the value of a variable?

I can change the value by re-declaring it in irb.

Datatypes

* How can you find out the class of a variable?

I can determine the class of a variable by executing variable.class or "variable".class

* What are two string methods?

reverse and upcase! (apparently different from upcase, sans exclamation)

* How can you change an integer to a string?

I can convert an integer to a string by calling the .to_s method on the variable. For example, if I have the variable sand = 555, I can convert this from an integer to a string by executing sand.to_s, the output of which is "555".

Strings

* Why might you use double quotes instead of single quotes in Ruby?

If I have a string using the #{} interpolater, I would use double quotes for it to work.

* What is this used for in Ruby: #{}?

The #{} is a string interpolater and substitutes any valid statement into the string. I could place another string, a variable name, a math expression, etc. and all would be substituded in to the string.

* How would you remove all the vowels from a string?

I would remove all vowels from a test string by execuding: test_string.delete('aeiou')

Input & Output

* What do 'print' and 'puts' do in Ruby?

'puts' returns nil and outputs the variable/string after 'puts' while in irb. 'print' does the same thing as 'puts' but without a newline after.

* What does 'gets' do in Ruby?

'gets' takes information from the user. This information can be set equal to a variable name, can be converted to a different datatype, and can have methods called on it.

* 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 without a decimal point while floats are decimal 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?

  • == is equal
  • = greater than or equal

  • <= less than or equal
  • != not equal
  • && and
  • || or

* What are two Ruby methods that return booleans?

.empty? .nil? .end_with('')?

Conditionals

* What is flow control?

Flow control is built in paths for data in the program to take. There are options within if-elsif-else statements that execute when certain conditions are met.

* What will the following code return?

This should print "Not many apples..." to the terminal.

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?

An infinite loop is a loop set to continue iterating until a prescribed condition is set for it to stop. As long as that condition is not met, the loop will continue infinitely. You can get out of an infinite loop by meeting the condition for it to terminate or 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?

nil is its own class and also represents "nothing." We can use it set aside memory for a variable even if we don't have the data we need for it quite yet.

* 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?

The use of symbols is beneficial in Ruby for effecient memory usage because it allows the program to reference the same object without making copies.

* Does naming symbols use the same rules for naming variables?

I believe so. I couldn't find an example where they did not apply.

* 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?

In order to determine the number of elements in an array example, I could execute example.length.

* What is the index of pizza in this array: ["pizza", "ice cream", "cauliflower"]?

Pizza is in the 0th slot.

* What do 'push' and 'pop' do?

Push adds an element to an existing array while pop removes and returns the element with the highest index.

Hashes

* Describe some differences between arrays and hashes.

Arrays are ways to group values together while hashes assign a key that correspond to a value. One could create an array of hashes. Hashes remind me of a dictionary in that they have a key/word that is assigned to a value/definition or usage.

* What is a case when you might prefer an array? What is a case when you might prefer a hash?

I would prefer an array for listing or grouping similar items while I would prefer a hash for completing profiles or forms. Let's say I had a room full of people that I wanted to collect data on. I would prefer an array to list all of the cities people are from, and I would prefer a hash to create a profile of information for each person. The profile could store their height, eye color, city of origin, occupation, and other keys.

* 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.

commented below

* What challenges did you try for "Summary: Basics"? Post a screenshot of one of your programs.

commented below

* Functions: How do you call a function and store the result in a variable?

In order to call a function, I can take function(args). To store the result as a variable I can declare a variable as var = function(args).

* Describe the purpose of the following in Ruby classes: initialize method, new method, instance variables.

The purpose of the initialize method is to define the characteristics of the class object. It performs the setup of the object. The .new method specifies an instance of that object. I could be very wrong, but I think of the code block under class describing a template for an object and then the .new method creates a specific object with the template. The instance variables create a specific instance of that object. For example, I could have a class Square and define the instance variable to be the side length of the square. We could then define the methods area and perimeter to tell us the area and perimeter of the square, both of which are dependent upon the instance variable, the side length.

* 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?

  1. There are so many ways to complete a task successfully yet some solutions are more elegant than others. I found that especially with iterators and loops, there were almost too may options for me to construct a solution. Oftentimes, I couldn't see which solution would be the simplest until looking at the provided solution from the book writer. I think the only way for me to improve is to work through a high volume of exercises involving loops/iterators/do-end blocks.

  2. The right method at the right time makes things a lot easier. When working with hashes and arrays, I found that knowing about available methods and perusing the Ruby documentation was really helpful. I found the number of methods intimidating, but I'm hoping that with some pointed exercises I'll get more exposure and increase my comfort level.

  3. Notation is really important. I thankfully didn't have many times where I was missing a ( , [, or {, but I am struggling to memorize the notation for different blocks of code. I think I need more practice until its ingrained into my mind.

CodeSchool

* screenshots will be posted in comments

* What are your two biggest takeaways from working through this tutorial?

  1. git status is really helpful for me to understand where in the process of staging/committing I am.
  2. I don't feel confident at all with git. I'm going to try to do the rest of the CodeSchool git course to see more context.

* What is one question you have about Git & GitHub?

If I'm working on a project with multiple people and we all merge our branches to the master, how do I resolve conflicts within our code?

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"?

@meyerhoferc
Copy link
Author

Launch School Ruby Book (Priority 2)
Methods Exercises (1-2, 3-5)
methods1-2
mehods3-5

@meyerhoferc
Copy link
Author

Task A Typing Progress 11.01.2016
11 01 2016

@meyerhoferc
Copy link
Author

Task A Typing Progress 11.02.2016
screen shot 2016-11-02 at 1 58 11 pm

@meyerhoferc
Copy link
Author

Task A 11.06.2016
11 06 2016

@meyerhoferc
Copy link
Author

Launch School Ruby Book (Priority 2)
Conditionals & Flow Control Exercises
exercises 1-4
conditionals_ex1-4
exercises 5-6
conditionals_ex5-6

@meyerhoferc
Copy link
Author

Launch School Ruby Book (Priority 2)
Loops & Iterators
loops_iterators

@meyerhoferc
Copy link
Author

Launch School Ruby Book (Priority 2)
Array Exercises
array_exercises

@meyerhoferc
Copy link
Author

Launch School Ruby Book (Priority 2)
Hashes Exercises
hashes_1-2
hashes_3-5
hashes_6

@meyerhoferc
Copy link
Author

I've finished the Launch School Ruby Book and all exercises have been posted in comments.
My three biggest takeaways from working through this book are:

  1. There are so many ways to complete a task successfully yet some solutions are more elegant than others. I found that especially with iterators and loops, there were almost too may options for me to construct a solution. Oftentimes, I couldn't see which solution would be the simplest until looking at the provided solution from the book writer. I think the only way for me to improve is to work through a high volume of exercises involving loops/iterators/do-end blocks.

  2. The right method at the right time makes things a lot easier. When working with hashes and arrays, I found that knowing about available methods and perusing the Ruby documentation was really helpful. I found the number of methods intimidating, but I'm hoping that with some pointed exercises I'll get more exposure and increase my comfort level.

  3. Notation is really important. I thankfully didn't have many times where I was missing a ( , [, or {, but I am struggling to memorize the notation for different blocks of code. I think I need more practice until its ingrained into my mind.

@meyerhoferc
Copy link
Author

Code School Try Git/GitHub (Priority 3)
try git badge

My two biggest takeaways from this course:

  1. git status is really helpful for me to understand where in the process of staging/committing I am.
  2. I don't feel confident at all with git. I'm going to try to do the rest of the CodeSchool git course to see more context.

@meyerhoferc
Copy link
Author

I decided to work through Code School's "Git Real" course as a follow up to the tryGit.
Level 1 completed:
git_real_lvl1

Level 2 completed:
git_real_lvl2

@meyerhoferc
Copy link
Author

Code School's Git Real Course
Level 4
git_real_lvl4

Level 5
git_real_lvl5

@meyerhoferc
Copy link
Author

Code School's Git Real Course Level 6
git_real_lvl6

@meyerhoferc
Copy link
Author

Code School Git Real (1) complete
git_real_complete

@meyerhoferc
Copy link
Author

Task G- Prework Reflection:

  • Were you able to get through the work? Did you rush to finish, or take your time?
    I was able to get through the suggested work and also complete the Git Real course and Learn Ruby the Hard Way. I didn't rush to finish and did my best to focus on concepts.

  • What are you most looking forward to learning more about?
    I'm most looking forward to learning about objects, classes, and instance variables. These are new concepts to me, and while I have a rough idea of what they are, I am looking forward to exercises that bring refinement and further understanding.

  • What topics would you most like to see reinforced by instructors?
    I'd like to learn more about git/version control and objects/classes/instances variables. I am about to watch the TDD video and would like to see this reinforced a lot as well.

  • What is most confusing to you about what you've learned?
    The most confusing thing for me has been knowing when to use what tool, especially with loops. I can understand that there are many ways to reach a desired outcome but I'm not sure which will be the most efficient/useful.

  • What questions do you have for your student mentor or for your instructors?
    I would like some help/guidance on how to set up exercisms so I can do more practice. I was following the website's instructions and hit a few roadblocks, so I'm hoping we talk a bit about setting up and navigating our work environment.

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