Skip to content

Instantly share code, notes, and snippets.

@Automatic365
Forked from mbburch/prework.md
Last active March 20, 2016 20:20
Show Gist options
  • Save Automatic365/d77c58e99a327a79873d to your computer and use it in GitHub Desktop.
Save Automatic365/d77c58e99a327a79873d to your computer and use it in GitHub Desktop.
Turing pre-work Gist

Turing School Prework - Jason Hanna

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,I did not. I'm on a PC, so Cloud 9 setup was easy.
  • How do you open Atom from your Terminal?
    • n/a
  • What is the file extension for a Ruby file?
    • .rb
  • What is the Atom shortcut for hiding/ showing your file tree view?
    • n/a
  • What is the Atom shortcut for quickly finding a file (fuzzy finder)?
    • n/a

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?
    • pwd stands for print working directory. This command is helpful because it shows where the files you are using are being stored.
  • What does hostname tell you, and what shows up in YOUR terminal when you type hostname?
    • hostname tells you your computer's name. My Cloud 9 terminal shows: automatic365-turing-prework-2593267

Task F- Learn Ruby:

Option 1 Questions:

IRB (Completed Day 4)

  • How do you start and stop irb?
  • You start irb by typing irb into the command line. You stop it by typing exit into the command line.
  • What might you use irb for?
  • You might use irb to execute simply ruby statements.

Variables (Completed Day 4)

  • How do you create a variable?
  • In irb, you must name the variable, then assign a value to it using the "=" sign
  • What did you learn about the rules for naming variables?
  • Variable names must begin with a letter
  • They may contain numbers or an underscore
  • How do you change the value of a variable?
  • You change the value of a variable by assigning a new value to the same variable in irb.

Datatypes (Completed Day 5)

  • How can you find out the class of a variable?
  • By typing the variable name then .class.
  • What are two string methods?
  • :chomp, :untaint
  • How can you change an integer to a string?
  • By using the .to_s conversion method

Strings (Completed Day 5)

  • Why might you use double quotes instead of single quotes in Ruby?
  • You might use double quotes if you need to perform interpolation
  • What is this used for in Ruby: #{}?
  • That is used to interpolate, which lets you embed a Ruby statement in another string.
  • How would you remove all the vowels from a string?
  • By using the method .delete('aeiou')

Input & Output (Completed Day 5)

  • What do 'print' and 'puts' do in Ruby?
  • 'puts' prints the information to the user of the program, and returns a value of nil. 'print' is like 'puts, but it doesn't make a new line after printing.
  • What does 'gets' do in Ruby?
  • 'gets' pauses the program and waits for the user to type something and hit the enter key. It then returns the value back to the program and continues execution.
  • 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 (Completed Day 5)

  • What is the difference between integers and floats?
  • Integers are whole numbers. Floats contain decimals.
  • Complete the challenge, and post a screenshot of your program in the comments with the title, "Numbers".

Booleans (Completed Day 6)

  • What do each of the following symbols mean?
    • ==: Equal to
    • =: Greater than or equal to

    • <=: Less than or equal to
    • !=: Opposite of equal to
    • &&: And
    • ||: Or
  • What are two Ruby methods that return booleans?
  • .empty?, .include?

Conditionals (Completed Day 6)

  • What is flow control? *Flow control allows the program to make decisions using constructs like "if ... else ... end" to selectively executing code based on values that exist in the program.
  • What will the following code return?: "Not many apples..."
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 loop body that doesn't have any code to make the while condition false, so it runs forever. You can get out of one by 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 (Completed Day 6)

  • What is nil?
  • nil 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 (Completed Day 6)

  • How can symbols be beneficial in Ruby?
  • Symbols let Ruby variables point to the same object in several places instead of allocating a new copy, thus making the program more memory efficient.
  • Does naming symbols use the same rules for naming variables?
  • Yes
  • Take a screenshot of your terminal after working through Step 4, and post it in the comments with the title, "Symbols".

Arrays (Completed Day 7)

  • What method can you call to find out how many elements are in an array?
  • .length will show how many elements are in an array
  • What is the index of pizza in this array: ["pizza", "ice cream", "cauliflower"]?
  • 0
  • What do 'push' and 'pop' do?
  • 'push' will add a new element to the end of the array. 'pop' will remove (and return) the element at the end of the array

Hashes (Completed Day 7)

  • Describe some differences between arrays and hashes.
  • Arrays store an ordered list of items. Elements in an array can be accessed by their position.
  • Hashes store pairs of items, associating keys with values. With a hash, elements are accessed by their key.
  • What is a case when you might prefer an array? What is a case when you might prefer a hash?
  • Arrays might be the preferred method if you are making a grocery list. Hashes would be better for making a list of makes and models of your favorite cars.
    • 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 able to get through all of the work on the first 7 days and most of priority 1. I took my time with these exercises.
  • What are you most looking forward to learning more about?
  • I am most looking forward to learning about the thought process that goes into coding. Systematic, ordered thinking in terms of writing out a process is something that does not come easily to me.
  • What topics would you most like to see reinforced by instructors?
  • Conditional programming
  • What is most confusing to you about what you've learned?
  • The proper syntax for each argument. There are so many tools, and I haven't quite grasped how/when to use each one.
  • What questions do you have for your student mentor or for your instructors?
  • Everything. The language makes sense to me conceptually, but I am still confused by a lot of it in application.

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 tried the challenges of write a program that verifies whether someone can vote based on their supplied age, and making an array of the months of the year
  • Functions: How do you call a function and store the result in a variable?
  • To call a function, you type the name of the function, then the values of the function.
  • To store the result in a variable, you name the variable, and then give it the value of the called function
  • Describe the purpose of the following in Ruby classes: initialize method, new method, instance variables.
  • initialize stores initial data an object is created with and performs any other required set-up.
  • new method takes arguments and passes them to the initialize method
  • instance variables internally stores data on your object, and is only viewable inside a specific instance.
  • 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"?
@Automatic365
Copy link
Author

Task D

cloud 9 ruby

@Automatic365
Copy link
Author

Task E: Flashcards - I used an app so I can have the cards with me at all times

flash cards

@Automatic365
Copy link
Author

Task E: pwd and hostname exercises

pwd terminal
hostname terminal

@Automatic365
Copy link
Author

Task A - Day 2

typing day 2

@Automatic365
Copy link
Author

Task B - Day 2

quiz day 2

@Automatic365
Copy link
Author

Task E: mkdir exercise

mkdir exercise

@Automatic365
Copy link
Author

Task E - cd exercise

cd exercise

@Automatic365
Copy link
Author

Task E - ls exercise

ls exercise

@Automatic365
Copy link
Author

Task F - Option 2. For some reason, I never saw the badge for part 2

tryruby 1
tryruby 3
tryruby 4

@Automatic365
Copy link
Author

Task A: Day 3
typing day 3

@Automatic365
Copy link
Author

Task B: Day 3

algorithm accomplished

@Automatic365
Copy link
Author

Task E: rmdir, pushd, popd exercises
rmdir exercise
pushd popd exercise

@Automatic365
Copy link
Author

Task F: Try Ruby Lessons 5-6 (no badge for 6)
tryruby 5

@Automatic365
Copy link
Author

Task A: Day 4
typing day 4

@Automatic365
Copy link
Author

Task B: Day 4
challenge 1

@Automatic365
Copy link
Author

Task E: Day 4

touch exercise
copy file exercise
move exercise

@Automatic365
Copy link
Author

Task A: Day 5
typing day 5

@Automatic365
Copy link
Author

Task B: Day 5
challenge day 5

@Automatic365
Copy link
Author

Task E: Day 5 [View A File (less, MORE), Stream A File (cat), Removing A File (rm)]
less exercise
cat exercise
rm exercise

@Automatic365
Copy link
Author

Task F: Day 5 - I/O
input and output exercise

@Automatic365
Copy link
Author

Task F: Day 5 - Numbers
numbers and arithmetic

@Automatic365
Copy link
Author

Task A: Day 6

typing day 6

@Automatic365
Copy link
Author

Task B: Day 6
challenge day 6

@Automatic365
Copy link
Author

Task F: Day 6 (Conditionals, nil, Symbols)
conditionals exercise
nil exercise
symbols exercise

@Automatic365
Copy link
Author

Task A: Day 7
typing - day 7

@Automatic365
Copy link
Author

Task B: Day 7
challenge day 7

@Automatic365
Copy link
Author

Task F: Hashes
hashes exercise

@erinnachen
Copy link

Looking good!!!

@Automatic365
Copy link
Author

Priority 1 - Railsbridge Cont'd: Loops Challenge

loops challenge 1

@Automatic365
Copy link
Author

Priority 1 - Railsbridge Cont'd: Voter age verification program

conditionals challenge

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