Skip to content

Instantly share code, notes, and snippets.

@JStans12
Forked from mbburch/prework.md
Last active August 9, 2016 22:29
Show Gist options
  • Save JStans12/1401b26b5ddecc2ca30589943e414240 to your computer and use it in GitHub Desktop.
Save JStans12/1401b26b5ddecc2ca30589943e414240 to your computer and use it in GitHub Desktop.
An example template for your Turing pre-work Gist

Turing School Prework - Joey Stansfield

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? I'm on windows until my Mac comes. No issues setting up c9, but slow / laggy overall. I've been using notepad++ to write simple ruby programs and have had no issues so far. I'll do the prework in both and compare.

  • How do you open Atom from your Terminal? ignoring atom questions because i'm using c9.

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

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

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

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. You need to know where you're working to effectivly use most commands.

  • What does hostname tell you, and what shows up in YOUR terminal when you type hostname? Your computers network name. On c9 it shows: jstans12-turing-prework-3472187 on my pc it's Joey-PC

Task F- Learn Ruby:

Option 1 Questions:

IRB

  • How do you start and stop irb? Start by typing "irb" and stop with "exit" or Ctrl+D
  • What might you use irb for? Used for testing lines of Ruby code. Not good for long programs and cannot save.

Variables

  • How do you create a variable? variable_name = value. no need to use "var" like in javascript etc..
  • What did you learn about the rules for naming variables? variables start with a lower-case letter or an underscore and after that can contain capital letters and numbers as well.
  • How do you change the value of a variable? The same way you originally defined it. It's also simple to perform simple tasks like double with "variable ++". you'll need a "!" to update the value in some cases.

Datatypes

  • How can you find out the class of a variable? call the class method on the variable: var.class
  • What are two string methods? .upcase will return the same string in uppercase and .reverse will return the same string backwards.
  • How can you change an integer to a string? call the .to_s method

Strings

  • Why might you use double quotes instead of single quotes in Ruby? double quotes allows you to use string interpolation with #{}.
  • What is this used for in Ruby: #{}? sting interpolation allows you to imbed a ruby statement within a string.
  • How would you remove all the vowels from a string? "remove vowels from this string".delete('aeiou')

Input & Output

  • What do 'print' and 'puts' do in Ruby? print will print a string to the user and puts will do the same thing and add a new line after.
  • What does 'gets' do in Ruby? get a string from the user. waits for the user to respond.
  • 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 don't have decimals. floats do.
  • 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 (when checking for equality)
    • = 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?() returns true if a strings ends with the value in parenthesis and false otherwise. .nil? returns true if the value is nil.

Conditionals

  • What is flow control? Selectivly executing code with if...else...end.
  • 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 loops is when your program is running code in a while loop with no way to meet the condition to stop. You will need to terminate the program (ctrl+c if in command line).
  • 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 data type in ruby 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

  • How can symbols be beneficial in Ruby? They can save RAM by allowing ruby to point to the same object in multiple places.
  • Does naming symbols use the same rules for naming variables? No. Symbols can be strings.
  • 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 to the end of an existing array and pop removes and returns the last element.

Hashes

  • Describe some differences between arrays and hashes. An array is just a list of items that allows you to look an item up with an index number. A hash is basically an array that associates items with a key value that you can assign.
  • What is a case when you might prefer an array? What is a case when you might prefer a hash? An array will work if your values are associated with an incrimental index number (like a table with different sweatiness values for temperatures 1-100). An array will also work if there is no relevent key and you're going to do the same thing to all the items. A hash is better if your items are associated with anything other than incrimenting numbers like latin names of zoo animals.
    • 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've taken my time with this work mostly because I've been working on another coding related project. I'm picking up the pace now to get the monthly done.
  • What are you most looking forward to learning more about? I'm most excited to learn some general "how the internet works" stuff and communication between the front and back ends.
  • What topics would you most like to see reinforced by instructors? I don't think there's much in the prework that needs reinfocing. As far as the basic stuff I hope to learn the basic Ruby conventions like writing an if statement on one line etc...
  • What is most confusing to you about what you've learned? I haven't been confused by the prework so far. In my personal project I have been hung up on what is probably a pretty simple problem for a while now because I haven't been able to get the google sheets API to work. So I'm hoping to learn a little about working with APIs.
  • What questions do you have for your student mentor or for your instructors? Which keyboard shortcuts do you use every day? Which development environment do you prefer?

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? Just set the variable equal to the function with any necessary perameters. variable = function(perameter)
  • Describe the purpose of the following in Ruby classes: initialize method, new method, instance variables. Class.new(parameters) creates a new object of a given class and passes any parameters to the initialize method which saves this data in the form of instance variables. These variables start with an @ and are only visable within the specific instance of your 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? Biggest takeaway was understanding the staging area. I have been using the desktop application for github and its difficult to visialize all the pieces without using the command line.
  • 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"?
@JStans12
Copy link
Author

Conditionals

conditionals

@JStans12
Copy link
Author

Nil

nil

@JStans12
Copy link
Author

Symbols

symbols

@JStans12
Copy link
Author

Worked through arrays in railsbridge.

@JStans12
Copy link
Author

Hashes

hashes

@JStans12
Copy link
Author

JStans12 commented Aug 1, 2016

loop that says hello to all the people in a group.

greeter

@JStans12
Copy link
Author

JStans12 commented Aug 1, 2016

I challenged myself to build rock paper scissors for the summary,

rps

rpsprogram

@JStans12
Copy link
Author

JStans12 commented Aug 3, 2016

Launch School exercise one.

ex1

@JStans12
Copy link
Author

JStans12 commented Aug 3, 2016

Launch School Basics 1, 2 and 3

basics123

@JStans12
Copy link
Author

JStans12 commented Aug 3, 2016

Launch School Loops
loops

@JStans12
Copy link
Author

JStans12 commented Aug 3, 2016

Launch School Arrays.

launcharrays

@JStans12
Copy link
Author

JStans12 commented Aug 5, 2016

Launch School Hashes 1

hashesimmediate

@JStans12
Copy link
Author

JStans12 commented Aug 5, 2016

Launch School Hashes 2

hashes2

@JStans12
Copy link
Author

JStans12 commented Aug 5, 2016

Launch School Hashes 3

hashes3

@JStans12
Copy link
Author

JStans12 commented Aug 5, 2016

Launch School Hashes 5

hashes4

@JStans12
Copy link
Author

JStans12 commented Aug 5, 2016

Launch School Hashes 6 - got this working, but not sure why I need brackets around '[word]' in line 12

hashes6

@JStans12
Copy link
Author

JStans12 commented Aug 9, 2016

Try Git

gitbadge

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