Skip to content

Instantly share code, notes, and snippets.

@dphilla
Forked from mbburch/prework.md
Last active April 27, 2017 21:16
Show Gist options
  • Save dphilla/fd38e739be8ee5e95c9b812b326fa08b to your computer and use it in GitHub Desktop.
Save dphilla/fd38e739be8ee5e95c9b812b326fa08b to your computer and use it in GitHub Desktop.
Daniel Phillips Pre-Work

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?

No issues during set up, though going through the Launch School Tutorial I ran into some trouble installing ruby gems axlxs and nokogiri. I tried to make sure I had rbenv installed correctly, but that didn't seem to help. A quick google search dissuaded me from installing using the sudo.

  • 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+k, cmd+b

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

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

print working drive; good for reaffirming where you are

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

hostname basically tells you the computer's name. My is Daniels-Macbook-Pro-2.local.

Task F- Learn Ruby:

Option 1 Questions:

IRB

  • How do you start and stop irb?

to start: irb to stop: exit

  • What might you use irb for?

seeing how and small pieces of ruby code do--i.e what certain things return, whether things mutate or not, etc.

Variables

  • How do you create a variable?

<variable_name> = 1

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

Mostly through the Railsbridge book, but I've had some experience when working with python in the past.

  • How do you change the value of a variable?

x = 1 x = 2 #x now refers to 2.

Datatypes

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

var.class

  • What are two string methods?

.upcase .downcase

  • How can you change an integer to a string?

i.to_s

Strings

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

Double quotes allow for string interpolation, while single quotes do not.

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

string interpolation

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

.delete "aeiou"

Input & Output

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

prints and puts both print print a given string, but puts adds a new line at the end, while print does not.

  • What does 'gets' do in Ruby?

gets meaning "get string" allows for user input

  • 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, while floats can contain numbers after the decimal point

  • 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?
    • == equals
    • = greater than or equal to

    • <= less than or equal to
    • != not equal to
    • && And
    • || Or
  • What are two Ruby methods that return booleans?

.has_key? .include?

Conditionals

  • What is flow control?

Flow control is directing which code gets executed, how often, depending upon certain conditions

  • What will the following code return?
apple_count = 4

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

'Not many apples' nil

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

an infinite loop runs a certain piece of code infinitely because no stopping condition is defined and met. ^C ends this.

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

a non-zero "empty" element

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

they can't be reassigned a value, so they can be used as/like objects.

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

symbols have more flexibility when being named.

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

.length

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

0

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

push adds an element to the end of the array

pop removes (and returns) an element at end of arry

Hashes

  • Describe some differences between arrays and hashes.

hashes are associative in that the store an element and reference to it where an array is just a list of elements

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

an array may be useful for just a list of items; a hash may be more useful for building a dictionary.

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

Yes, I took my time and feel as though I had enough time to reflect on or revisit section I was unfamiliar with.

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

recursion, building larger and more complex files, ans working with different file types.

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

Probably which methods mutate the caller and which don't, and how those actually work in the computer's memory.

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

I'd like to have more time to focuse on blocks, and iterators.

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

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