Skip to content

Instantly share code, notes, and snippets.

@charliecorrigan
Forked from mbburch/prework.md
Last active March 11, 2017 00:59
Show Gist options
  • Save charliecorrigan/6f02a0cf4d311eea6672435985fb3e73 to your computer and use it in GitHub Desktop.
Save charliecorrigan/6f02a0cf4d311eea6672435985fb3e73 to your computer and use it in GitHub Desktop.
Turing pre-work Gist - Charlie Corrigan

Turing School Prework - Charlie Corrigan

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? Not many. When running 'rvm requirements' in the terminal, I got an error that indicated there was 'no executable openssl' and that 'requirements installation failed with status: 12'. I googled it, tried a few things, found a solution on stackexchange. I ran 'brew install openssl --force' and that seems to have worked.
  • How do you open VS Code from your Terminal? 'code .'
  • What is the file extension for a Ruby file? .rb
  • What is the VS Code shortcut for hiding/ showing your file tree view? ⌘b
  • What is the VS Code shortcut for quickly finding a file (fuzzy finder)? Fuzzy Finder might be a specific function in Atom. ⌘p seems to function closest to this description in VS Code.

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' and it is useful because it allows the user to orient themselves in the terminal.
  • What does hostname tell you, and what shows up in YOUR terminal when you type hostname? 'hostname' displays the name of the computer and its domain. The hostname command on my computer returns 'Charlies-MacBook-Air.local'

Task F- Learn Ruby:

Option 1 Questions:

IRB

  • How do you start and stop irb? Type 'irb' in command line to start. Type 'exit' or control-C or control-D to stop.
  • What might you use irb for? irb is useful for testing small snippets or experimenting with features.

Variables

  • How do you create a variable? Variables are assigned by declaring the variable name, followed by '=', followed by whatever value the variable is to hold.
  • What did you learn about the rules for naming variables? Variables cannot begin with numbers, cannot contain only numbers, cannot contain dashes, and cannot be in quotation marks.
  • How do you change the value of a variable? Type the name of the variable, followed by '=', followed by the new value.

Datatypes

  • How can you find out the class of a variable? Type '.class' after the variable name.
  • What are two string methods? Upcase and downcase.
  • How can you change an integer to a string? integer.to_s

Strings

  • Why might you use double quotes instead of single quotes in Ruby? Single quotes do not support interpolation.
  • What is this used for in Ruby: #{}? Interpolation
  • How would you remove all the vowels from a string? "String".delete(aeiou)

Input & Output

  • What do 'print' and 'puts' do in Ruby? 'print' displays text and returns 'nil.' 'puts' does the same thing but starts on a new line.
  • What does 'gets' do in Ruby? 'gets' prompts the user for a string 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. Floats contain a 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?
    • == 'is equal to'
    • = 'is greater than or equal to'

    • <= 'is less than or equal to'
    • != 'is the opposite of equal to'/'is not equal to'
    • && 'and'
    • || 'or'
  • What are two Ruby methods that return booleans? '.include?()' and '.end_with?()'

Conditionals

  • What is flow control? Flow control is when a program makes decisions and executes code based on certain conditions.
  • 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 a loop that continually executes forever without ending/breaking.
  • 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 a value that hasn't been assigned.
  • 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? Symbols can be a more efficient use of memory.
  • Does naming symbols use the same rules for naming variables? Seems to.
  • 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 on to the end of an array. .pop removes and returns the last element of an array.

Hashes

  • Describe some differences between arrays and hashes. Elements in arrays are accessed through their index. Elements in hashes are accessed through their keys. Elements in hashes contain keys and values. Elements in arrays contain only values.
  • What is a case when you might prefer an array? What is a case when you might prefer a hash? Since arrays contain lists of things and hashes contain lists of things and their properties, I imagine hashes are more useful when one wants to associate properties with a list of items, for instance, one might use a hash to list customer information (first name, last name, phone number, etc). Array might be useful to store something where knowing the index of an item is useful, maybe a list of names that one might want to sort?
    • 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. DONE
  • What challenges did you try for "Summary: Basics"? Post a screenshot of one of your programs. I completed all challenges.
  • Functions: How do you call a function and store the result in a variable? variable_name = function_name(argument)
  • Describe the purpose of the following in Ruby classes: initialize method, new method, instance variables. Initialize method is a special method which accepts and saves initial data needed to create an instance of an object. New method creates a new instance of an object. Instance variables start with '@' and are only visable inside a specific instance of an 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.

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

Task A: Typing, Objective C Cheddar.

turingpreworktypingioobjectiveccheddar002

turingpreworktypingioobjectiveccheddar003

turingpreworktypingioobjectiveccheddar004

@charliecorrigan
Copy link
Author

Priority1 "How to Write a Program"

Notes on what I found most challenging and most enjoyable: What I found most enjoyable was seeing all of the concepts come together in a single program and starting to think about organization within a program. What I found most challenging was internalizing and retaining these concepts without being able to struggle through creating my own program. Because the original assignment provided every single line of the program pre-written, I tried to create another program that used some of the same concepts that wasn't pre-written. I made a "Rock, Paper, Scissors" game. In creating my own game, my biggest challenge is seeing ways in which it's clunky or repetitive, but not knowing how to fix it yet. My student mentor and I are going to go over the assignment on Screenhero later this week.

turingpreworkrubycc018

turingpreworkrubycc019

@charliecorrigan
Copy link
Author

Priority 2, Launch School Ruby. Section 1, Preparations

turingpreworkrubycc020

@charliecorrigan
Copy link
Author

Ruby practice: Rock paper scissors game repository for refactor

https://github.com/charliecorrigan/rock_paper_scissors_game

@charliecorrigan
Copy link
Author

Priority 2, Launch School Ruby. Section 2, The Basics

turingpreworkrubycc022

turingpreworkrubycc023

turingpreworkrubycc024

turingpreworkrubycc025

@charliecorrigan
Copy link
Author

Priority 2, Launch School Ruby. Section 3, Variables
turingpreworkrubycc026

turingpreworkrubycc027

turingpreworkrubycc028

turingpreworkrubycc029

@charliecorrigan
Copy link
Author

Priority 2, Launch School Ruby. Section 4, Methods

turingpreworkrubycc030

turingpreworkrubycc031

turingpreworkrubycc032

@charliecorrigan
Copy link
Author

Priority 2, Launch School Ruby. Section 5, Flow Control

turingpreworkrubycc033

turingpreworkrubycc034

turingpreworkrubycc035

@charliecorrigan
Copy link
Author

Priority 2, Launch School Ruby. Section 6, Loops and iterators

turingpreworkrubycc036

turingpreworkrubycc037

turingpreworkrubycc038

@charliecorrigan
Copy link
Author

Priority 2, Launch School Ruby. Section 7, Arrays

turingpreworkrubycc039

turingpreworkrubycc040

turingpreworkrubycc041

@charliecorrigan
Copy link
Author

Priority 2, Launch School Ruby. Section 8, Hashes

turingpreworkrubycc042

turingpreworkrubycc043

turingpreworkrubycc044

turingpreworkrubycc045

turingpreworkrubycc046

turingpreworkrubycc047

@charliecorrigan
Copy link
Author

Priority 2, Launch School Ruby. Section 9, Files

turingpreworkrubycc048

turingpreworkrubycc049

turingpreworkrubycc050

@charliecorrigan
Copy link
Author

Priority 2, Launch School Ruby. Section 9, Files, Part 2 (parsing JSON and XML)

turingpreworkrubycc051

@charliecorrigan
Copy link
Author

Priority 2, Launch School Ruby. Section 10, More Stuff

turingpreworkrubycc052

turingpreworkrubycc053

@charliecorrigan
Copy link
Author

Priority 3, Git Tutorial

turingpreworkgitcc001

@charliecorrigan
Copy link
Author

Priority 2, Launch School Ruby. Section 11, Exercises

turingpreworkrubycc054
turingpreworkrubycc055
turingpreworkrubycc056
turingpreworkrubycc057
turingpreworkrubycc058
turingpreworkrubycc059
turingpreworkrubycc060
turingpreworkrubycc061
turingpreworkrubycc062
turingpreworkrubycc063
turingpreworkrubycc064
turingpreworkrubycc065
turingpreworkrubycc066
turingpreworkrubycc067
turingpreworkrubycc068
turingpreworkrubycc069

@charliecorrigan
Copy link
Author

Priority 4: Thoughts on Effective Workflow

Gist

@charliecorrigan
Copy link
Author

Were you able to get through the work? Did you rush to finish, or take your time?

I started a month and a half out, so I was able to take my time and still get through the first week work, and most of the Next Steps section. I didn't rush through most of the assignments, but found myself rushing somewhat in the week leading up to Mod 1, trying to get as much accomplished as possible by the first day of class.

What are you most looking forward to learning more about?

Right now, there's a bit of magical ambiguity between the Ruby "programs" I've made during the pre-work and the Ruby-based apps and websites I've seen "in the wild." I'm really curious how code gets packaged into something that users can access and how Ruby, HTML, CSS, and Javascript can all work together in a project.

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

I don't have much of an opinion about this (yet). I don't feel like I know enough to know what's most important or most interesting. I am hoping that we'll be able to cover a good amount of computer science theory mixed in with programming/coding instruction and I'm personally interested in security.

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

Recursive functions! This was my third encounter with learning about recursive functions. I've graduated from overwhelming confusion when merely reading through a recursive function to now having a perplexed appreciation of their complexity and a deep discomfort with writing my own recursive functions. It's solid progress, but I'm looking forward to gaining more comfort in creating these functions and recognizing when they're appropriate.

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

I don't have any questions right now.

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