Skip to content

Instantly share code, notes, and snippets.

@rgbatty
Forked from mbburch/prework.md
Last active March 20, 2016 21:22
Show Gist options
  • Save rgbatty/20257d17febc3e442bc7 to your computer and use it in GitHub Desktop.
Save rgbatty/20257d17febc3e442bc7 to your computer and use it in GitHub Desktop.
Turing Pre-work Gist

Turing School Prework - Ryan Batty

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:

This file

Task D- Set up your Environment:

  • Did you run into any issues?

Not really. Most of it was fairly straight-forward.

  • How do you open Atom from your Terminal?

"atom" with the "." character signifying your home path

  • 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+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?

Present Working Directory. It provides an easy method to check what directory you are currently at in Terminal.

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

63-234-136-9.dia.static.qwest.net - Hostname shows the name of your computer, though this value I believe is your name on the network your connected to, considering the actual name is within the terminal prompt (Riizus-MacBook-Air).

Task F- Learn Ruby:

Option 1 Questions:

IRB

  • How do you start and stop irb?

You start irb wirth the command, 'irb' and stop it with the command, 'exit'

  • What might you use irb for?

irb is useful for testing language features, or small chunks of code. I could imagine using it to test if conditionals to make sure they evaluate properly.

Variables

  • How do you create a variable?

You type in a name for a variable 'ie. foo' and then assign it a value 'ie. foo = 1'

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

Variables are picky about what they can be named as. Specifically none starting with numbers.

  • How do you change the value of a variable?

You assign it a new value through a method.

Datatypes

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

Run the '.class' method (5.class will return FixNum)

  • What are two string methods?

.try_convert and .new

  • How can you change an integer to a string?

By using the .to_s method.

Strings

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

The only thing I could tell is that interpolation does not work nicely with strings saved using single quotes.

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

'#{}' is Ruby's interpolation operator. It allows you to run a code statement and concatenate the result into the given string.

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

someString.delete('aeiou')

Input & Output

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

    'print' prints text on the current line, puts prints text to a new line.

  • What does 'gets' do in Ruby?

    'gets' gets user input and saves it into a given variable.

  • 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, while floats are decimal values (ie. 2.5)

  • Complete the challenge, and post a screenshot of your program in the comments with the title, "Numbers".

    Added, though its with the changes from the Conditionals section. Will label as "Numbers and Conditionals."

Booleans

  • What do each of the following symbols mean?

    • ==

    Equal to

    • =

    Greater than

    • <=

    Less than

    • !=

    Not equal to

    • &&

    And

    • ||

    Or

  • What are two Ruby methods that return booleans?

    .end_with? and .empty?

Conditionals

  • What is flow control?

    Flow control is the act of using conditionals such as loops and if statements to control the flow of data through a program.

  • What will the following code return?

apple_count = 4

if apple_count > 5
  puts "Lots of apples!"
else
  puts 'Not many apples...'
end

It will return 'Not many apples...'

  • What is an infinite loop, and how can you get out of one?

    an infinite loop is a loop that does not terminate, due to a conditional having no fail value. You can exit an infinite loop by killing the program.

  • Take a screenshot of your program and terminal showing two different outputs, and post it in the comments with the title, "Conditionals".

    Added, though I was unable to complete the second challenge. Due to prior knowledge, the easiest method I could see was with arrays and for loops, but this was not covered in the curriculum. Honestly this section of RailsBridge seems very unfinished. At the top it mentions things like 'elsif' and 'unless', but neither of those topics are covered. Again, prior knowledge on my part makes this fairly trivial, but without understanding 'elsif', the only way one could complete the first challenge woud be with repeated if statements.

nil

  • What is nil?

    nil is a value that represents 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 allow a programmer to create one copy of an object and when necessary, reuse it. This prevents unneeded memory from being loaded and results in a faster program.

  • 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".

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

    Pizza's index value is 0.

  • What do 'push' and 'pop' do?

    push adds a new value to the end of an array, and pop removes and returns the last value of an array.

Hashes

  • Describe some differences between arrays and hashes.

    Unlike arrays, hashes store elements as a key-value pair.

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

    An array is better for a collection of similar datapoints, such as a list of colors. A hash is better when you want to be able to refer to something by a key to get its value, or vice versa. The versatility of a hash is its real benefit.

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

    Yes, I did. I took my time, which was both good and bad. I would of liked a little bit more time to do the extra prework, but I'm glad I didn't feel like I had to rush to complete either, and it let me make my week off before starting classes a little bit more of a relaxation period.

  • What are you most looking forward to learning more about?

    General CS principles and software design. One of the biggest things I felt I was missing was not being able to read or understand code, but being unable to develop and implement an idea from start to finish. I'm hoping Turing will help me bridge that gap.

  • What topics would you most like to see reinforced by instructors?

    I think Symbols will be one of the more complex topics that should receive additional attention. I know I felt frustrated learning pointers in C++ when only one class period was given to discuss them, and Symbols fill a similar niche.

  • What is most confusing to you about what you've learned?

Speaking strictly of the base pre-work curriculum, I really felt that RailsBridge was a lackluster resource. While it was definitely a hands-on tutorial, which is always good, many things felt incomplete. While I was completing it, I kind of felt like it would promise to teach one thing, and not another, especially in the case of the Conditionals section.

  • What questions do you have for your student mentor or for your instructors?

    At this time, nothing in particular. I'm just ready to get started :)

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

rgbatty commented Mar 20, 2016

Day 5
Typing
screen shot 2016-03-20 at 8 44 37 am
Logic
screen shot 2016-03-20 at 8 55 59 am
CLI
screen shot 2016-03-20 at 8 50 09 am
screen shot 2016-03-20 at 8 52 22 am
screen shot 2016-03-20 at 8 55 00 am
Nil
screen shot 2016-03-20 at 2 48 32 pm
Symbols
screen shot 2016-03-20 at 2 52 33 pm
Hashes
screen shot 2016-03-20 at 3 02 04 pm

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