Skip to content

Instantly share code, notes, and snippets.

@robbiejaeger
Forked from mbburch/prework.md
Last active March 18, 2016 21:34
Show Gist options
  • Save robbiejaeger/3e3a5b78ad657a3261af to your computer and use it in GitHub Desktop.
Save robbiejaeger/3e3a5b78ad657a3261af to your computer and use it in GitHub Desktop.
Robbie Jaeger's Turing pre-work Gist

Turing School Prework - Robbie Jaeger

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:

  • Completed

Task D- Set up your Environment:

  • Did you run into any issues?

    • No issues
  • How do you open Atom from your Terminal?

    • atom .
  • What is the file extension for a Ruby file?

    • .rb
  • What is the Atom shortcut for hiding/ showing your file tree view?

    • cmd-\
  • What is the Atom shortcut for quickly finding a file (fuzzy finder)?

    • cmd-t or 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?

    • It stands for "print working directory". It is helpful because it tells you where you are in your file structure.
  • What does hostname tell you, and what shows up in YOUR terminal when you type hostname?

    • hostname tells you the computer's network name. My hostname is "Roberts-MacBook-Pro.local".

Task F- Learn Ruby:

Option 1 Questions:

IRB

  • How do you start and stop irb?

    • Start irb from the command line using "irb". Stop irb by typing "exit" in the command line.
  • What might you use irb for?

    • irb is good for testing small peices of code or testing a language's functionality.

Variables

  • How do you create a variable?

    • Use the equals sign "=" to assign a value. The variable to assign goes on the left side of the equals sign.
  • What did you learn about the rules for naming variables?

    • You cannot use variable names that contain only numbers, true/false, dashes, or numbers at the start.
  • How do you change the value of a variable?

    • You reassign the variable with the new value. variable = 5 becomes variable = 10.

Datatypes

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

    • Use the method .class with the variable. For instance 5.class
  • What are two string methods?

    • .insert
    • .match
  • How can you change an integer to a string?

    • Use the method .to_s. For instance 5.to_s

Strings

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

    • Using double quotes lets you use string interpolation with variables.
  • What is this used for in Ruby: #{}?

    • You can use #{} inside a string for string interpolation. The variable or expression inside {} will be used inside of the rest of the string.
  • How would you remove all the vowels from a string?

    • You can use the delete method with the vowels as the input argument. 'Remove vowels'.delete('aeiou')

Input & Output

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

    • 'print' and 'puts' output a string to the command line, but 'puts' adds a new line at the end.
  • What does 'gets' do in Ruby?

    • 'gets' pauses the execution of the scripts and waits for an input from the user (through the command line).
  • Add a screenshot in the comments of the program you created that uses 'puts' and 'gets', and give it the title, "I/O".

    • (Added)

Numbers & Arithmetic

  • What is the difference between integers and floats?

    • Integers are whole numbers, and floats are floating point numbers with decimals.
  • Complete the challenge, and post a screenshot of your program in the comments with the title, "Numbers".

    • (Added)

Booleans

  • What do each of the following symbols mean?
    • == (equal to, not an assignment)
    • = (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?
    • include?

Conditionals

  • What is flow control?
    • Flow control is a way to let the program make decisions for us. It enables us to selectively execute code based on conditions.
  • What will the following code return?
    • This code will output "Not many apples..." because apple_count is less than 5.
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 happens when there is no condition to make the while loop false. You can exit an infinite loop by entering command+c.
  • Take a screenshot of your program and terminal showing two different outputs, and post it in the comments with the title, "Conditionals".

    • (Added)

nil

  • What is nil?

    • A special data type that means nothing. It can be used to show a variable hasn't been assigned anything yet or that a function returns nothing.
  • Take a screenshot of your terminal after working through Step 4, and post it in the comments with the title, "nil".

    • (Added)

Symbols

  • How can symbols be beneficial in Ruby?
    • Symbols can help with memory allocation. They are useful for tems that do not change throughout the program, similar to enumerations in other programming languages.
  • Does naming symbols use the same rules for naming variables?
    • Yes, symbols use the same rules.
  • Take a screenshot of your terminal after working through Step 4, and post it in the comments with the title, "Symbols".
    • (Added)

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"]?
    • 0th
  • What do 'push' and 'pop' do?
    • push adds a new element to the end of an array with the value defined as the input argument
    • pop removes the last element of an array and returns the value

Hashes

  • Describe some differences between arrays and hashes.
    • In arrays, you access elements using their index number. With hashes, you access elements using their key.
  • What is a case when you might prefer an array? What is a case when you might prefer a hash?
    • You might prefer an array if you have a dataset of ordered values. You might prefer a hash if you have items with properties like color, style, height, or any values associated with a name.
  • Take a screenshot of your terminal after working through Step 2, and post it in the comments with the title, "Hashes".
    • (Added)

Task G- Prework Reflection:

  • Were you able to get through the work? Did you rush to finish, or take your time?
    • I took my time through it. I had a few hours a day to spend on the prework. So I finished in about 2.5 days. I did not feel rushed or overwhelmed.
  • What are you most looking forward to learning more about?
    • I really want to learn how all the pieces connect and talk to each other in web development. So far, the concepts we have learned so far have been siloed.
  • What topics would you most like to see reinforced by instructors?
    • From the prework, it would be interesting to learn more about how to utilize hashes.
  • What is most confusing to you about what you've learned?
    • The most confusing part for me was the command line exercise on pushd/popd. The example in the exercise wasn't clear as to what was actually going on. I looked up a video about pushd/popd and that cleared it up.
  • What questions do you have for your student mentor or for your instructors?
    • No big questions at this point - just eager to keep learning since I know there is a lot to learn.

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.
    • (Added) "Loops"
  • What challenges did you try for "Summary: Basics"? Post a screenshot of one of your programs.
    • I did all of the chalenges. Screenshot below "Summary: Basics".
  • Functions: How do you call a function and store the result in a variable?
    • You call a function using it's name. If a function is called "begin", then you can call it and store the output to a variable using: a = begin(input)
  • Describe the purpose of the following in Ruby classes: initialize method, new method, instance variables.
    • intitialize method: stores data that is passed in when you create a new istance of the object
    • new method: creates a new instance of the object
    • instance variables: these are variables that are accessible only locally within a specific instance of the 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.
    • One confusing part for me was the array summation section of the code following total = 0. There seems to be an easier way to sum an array, so I'm not sure why the code is the way it is. The best part of this exercise was breaking down the code into functions.

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"?
@robbiejaeger
Copy link
Author

Day 1 Typing Lesson:

screen shot 2016-03-14 at 2 41 04 pm

@robbiejaeger
Copy link
Author

Day 1 Command Line Work:
pwd
screen shot 2016-03-14 at 3 34 28 pm
hostname
screen shot 2016-03-14 at 3 37 25 pm

@robbiejaeger
Copy link
Author

Day 1 Brilliant Problems:

screen shot 2016-03-14 at 2 29 56 pm

screen shot 2016-03-14 at 2 33 22 pm

screen shot 2016-03-14 at 2 33 38 pm

@robbiejaeger
Copy link
Author

Day 2 Task E:
mkdir
screen shot 2016-03-14 at 4 48 01 pm
cd
screen shot 2016-03-14 at 4 57 32 pm
ls
screen shot 2016-03-14 at 5 02 07 pm

@robbiejaeger
Copy link
Author

Day 1: Finished sections from RailsBridge Ruby through "irb".

@robbiejaeger
Copy link
Author

Ruby lessons: I/O
screen shot 2016-03-15 at 12 15 36 pm

@robbiejaeger
Copy link
Author

Ruby lessons: Numbers
screen shot 2016-03-15 at 12 27 01 pm

@robbiejaeger
Copy link
Author

Ruby lessons: Conditionals
screen shot 2016-03-15 at 3 25 50 pm

@robbiejaeger
Copy link
Author

Ruby lessons: nil
screen shot 2016-03-15 at 3 39 12 pm

@robbiejaeger
Copy link
Author

Day 2: Finished sections from RailsBridge Ruby "Running Programs From A File" through "nil".

@robbiejaeger
Copy link
Author

Day 2: typing lesson
screen shot 2016-03-15 at 4 24 31 pm

@robbiejaeger
Copy link
Author

Task E:
rmdir
screen shot 2016-03-15 at 4 00 42 pm
pushd, popd
screen shot 2016-03-15 at 5 04 34 pm

@robbiejaeger
Copy link
Author

Task E:
touch
screen shot 2016-03-15 at 8 14 20 pm
cp
screen shot 2016-03-15 at 8 27 29 pm
mv
screen shot 2016-03-15 at 8 31 09 pm

@robbiejaeger
Copy link
Author

Ruby lessons: Symbols
screen shot 2016-03-16 at 8 57 14 am

@robbiejaeger
Copy link
Author

Ruby lessons: Hashes
screen shot 2016-03-16 at 9 18 08 am

@robbiejaeger
Copy link
Author

Task E:
less
screen shot 2016-03-16 at 9 32 47 am
cat
screen shot 2016-03-16 at 9 37 45 am
rm
screen shot 2016-03-16 at 9 41 39 am

@robbiejaeger
Copy link
Author

Day 3: Typing lesson
screen shot 2016-03-16 at 9 53 28 am

@robbiejaeger
Copy link
Author

Ruby lessons: Loops
screen shot 2016-03-16 at 11 54 28 am

@robbiejaeger
Copy link
Author

Ruby lessons: Summary: Basics
screen shot 2016-03-16 at 12 17 56 pm

@robbiejaeger
Copy link
Author

LaunchSchool: The Basics
screen shot 2016-03-17 at 2 59 22 pm

@robbiejaeger
Copy link
Author

LaunchSchool: Variables
screen shot 2016-03-17 at 3 57 20 pm

@robbiejaeger
Copy link
Author

Day 4: typing lesson
screen shot 2016-03-17 at 5 12 58 pm

@robbiejaeger
Copy link
Author

LaunchSchool: Methods
screen shot 2016-03-17 at 5 46 04 pm

@robbiejaeger
Copy link
Author

LaunchSchool: Flow Control
screen shot 2016-03-18 at 10 32 28 am

@robbiejaeger
Copy link
Author

LaunchSchool: Loops and Iterators
screen shot 2016-03-18 at 2 42 10 pm

@robbiejaeger
Copy link
Author

LaunchSchool: Arrays
screen shot 2016-03-18 at 3 34 12 pm

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