Skip to content

Instantly share code, notes, and snippets.

@jesse-spevack
Forked from mbburch/prework.md
Last active June 26, 2016 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesse-spevack/6b7960ccb6bd8d0f01b290d5dabbb504 to your computer and use it in GitHub Desktop.
Save jesse-spevack/6b7960ccb6bd8d0f01b290d5dabbb504 to your computer and use it in GitHub Desktop.
An example template for your Turing pre-work Gist

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?
  • How do you open Atom from your Terminal?
  • What is the file extension for a Ruby file?
  • 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?
  • What does hostname tell you, and what shows up in YOUR terminal when you type hostname?

Task F- Learn Ruby:

Option 1 Questions:

IRB

  • How do you start and stop irb?
  • What might you use irb for?

Variables

  • How do you create a variable?
  • What did you learn about the rules for naming variables?
  • How do you change the value of a variable?

Datatypes

  • How can you find out the class of a variable?
  • What are two string methods?
  • How can you change an integer to a string?

Strings

  • Why might you use double quotes instead of single quotes in Ruby?
  • What is this used for in Ruby: #{}?
  • How would you remove all the vowels from a string?

Input & Output

  • What do 'print' and 'puts' do in Ruby?
  • What does 'gets' do in Ruby?
  • 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?
  • 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?
    • ==
    • =

    • <=
    • !=
    • &&
    • ||
  • What are two Ruby methods that return booleans?

Conditionals

  • What is flow control?
  • What will the following code return?
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?
  • 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?
  • 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?
  • Does naming symbols use the same rules for naming variables?
  • 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?
  • What is the index of pizza in this array: ["pizza", "ice cream", "cauliflower"]?
  • What do 'push' and 'pop' do?

Hashes

  • Describe some differences between arrays and hashes.
  • What is a case when you might prefer an array? What is a case when you might prefer a hash?
    • 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.
  • 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"?
@jesse-spevack
Copy link
Author

Task E- The Command Line:
Finding Help (apropos, HELP)
screen shot 2016-06-10 at 11 15 46 am

@jesse-spevack
Copy link
Author

Task E- The Command Line:
What's In Your Environment (env, echo, Env:)
screen shot 2016-06-10 at 11 23 58 am

@jesse-spevack
Copy link
Author

Task E- The Command Line:
Changing Environment Variables (export, Env:)

screen shot 2016-06-10 at 11 27 56 am

@jesse-spevack
Copy link
Author

Task F- Learn Ruby:

nil

What is nil?
Nil means 'nothing'. It is used to show that a variable hasn't been assigned to anything yet, or that a function didn't return a value.

Take a screenshot of your terminal after working through Step 4, and post it in the comments with the title, "nil".
screen shot 2016-06-10 at 2 02 54 pm

@jesse-spevack
Copy link
Author

Task F- Learn Ruby:

Symbols

How can symbols be beneficial in Ruby?
Symbols help Ruby use memory more efficiently. Symbols let Ruby variables point to the same object in several places instead of allocating a new copy. This is like a rental car company letting several drivers use the same car instead of each buying their own.

Does naming symbols use the same rules for naming variables?
Symbols do not use the same rules for naming as variables. Symbols can have spaces if surrounded by quotes.

Take a screenshot of your terminal after working through Step 4, and post it in the comments with the title, "Symbols".
screen shot 2016-06-10 at 2 17 12 pm

@jesse-spevack
Copy link
Author

Task F- Learn Ruby:

Arrays

What method can you call to find out how many elements are in an array?
We can find the number of elements in an array by using the .length method.

What is the index of pizza in this array: ["pizza", "ice cream", "cauliflower"]?
The index of pizza in the above array is 0. Array's are zero-indexed, they start with zero.

What do 'push' and 'pop' do?
Push adds an item too the end of an array. Pop removes (and returns) the element at the end of an array.

@jesse-spevack
Copy link
Author

jesse-spevack commented Jun 10, 2016

Hashes

Describe some differences between arrays and hashes.
Arrays are an ordered list of items. We can access elements in an array by their position (eg myArr[0] returns the first element in myArr). Hashes store key value pairs. Rather than access items by positions, with a hash we can access items by name.

What is a case when you might prefer an array? What is a case when you might prefer a hash?
We might prefer an array when order is important. For example, if I have a list of my top 10 favorite albums, I might want to put that into an array and the order of the array shows which albums I like the best. I might prefer a hash if I want to store more detailed information about an item. For example, instead of just storing the album name in an array, I could store a hash about the album that includes keys like genre, release date, band, etc.

  • Take a screenshot of your terminal after working through Step 2, and post it in the comments with the title, "Hashes".
    screen shot 2016-06-10 at 2 52 58 pm

@jesse-spevack
Copy link
Author

Railsbridge Curriculum, cont.

Loops: Take a screenshot of your "Challenge" program, and post it as a comment in your Gist.
screen shot 2016-06-10 at 6 13 16 pm

@jesse-spevack
Copy link
Author

What challenges did you try for "Summary: Basics"? Post a screenshot of one of your programs.
Write a program that verifies whether someone can vote based on their supplied age.
screen shot 2016-06-10 at 6 20 03 pm

Write a program that plays back the message a user supplied.
screen shot 2016-06-10 at 6 25 27 pm

Write a program that adds up five user-supplied numbers.
screen shot 2016-06-10 at 6 29 00 pm

Make a hash for the people at your table, where the key is their name and the value is their favorite color.
screen shot 2016-06-10 at 6 32 59 pm

Make an array of the months in the year.
months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']

@jesse-spevack
Copy link
Author

Railsbridge Curriculum, cont.
Functions: How do you call a function and store the result in a variable?
To call a function, first say the name of the function, and then send in the values the function needs to do its job. We can store the result in a variable by setting the variable equal to the function call.
screen shot 2016-06-11 at 5 02 24 pm

@jesse-spevack
Copy link
Author

Railsbridge Curriculum, cont.
Describe the purpose of the following in Ruby classes: initialize method, new method, instance variables.
The initialize method saves the initial data the object is created with and performs any other required set-up. The new method creates an instance of the object by passing arguments to the initialize method. Instance variables start with @ sign, behave like normal variables, but are only visible from inside a specific instance of the object in question.
screen shot 2016-06-11 at 5 12 03 pm

@jesse-spevack
Copy link
Author

jesse-spevack commented Jun 11, 2016

Railsbridge Curriculum, cont.
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.
screen shot 2016-06-12 at 11 15 51 am

Challenging
At first just getting used to reading through the code and understanding what each line was doing was challenging.

Enjoyable
I enjoyed the progression of cleaning up the code.

@jesse-spevack
Copy link
Author

Launch School Ruby Book
Section: Preparations
screen shot 2016-06-12 at 11 19 30 am

@jesse-spevack
Copy link
Author

Launch School Ruby Book
Section: The Basics

Exercise 1:
screen shot 2016-06-12 at 11 32 58 am

Exercise 2:
screen shot 2016-06-12 at 11 36 54 am

Exercise 3:
screen shot 2016-06-12 at 2 57 18 pm

Exercise 4:
screen shot 2016-06-12 at 3 00 40 pm

Exercise 5:
screen shot 2016-06-12 at 6 06 34 pm

Exercise 6
screen shot 2016-06-12 at 6 12 28 pm

Exercise 7
The code has a ")" where it should have a "}".

@jesse-spevack
Copy link
Author

Variables

Exercise 1
screen shot 2016-06-12 at 6 26 52 pm

Exercise 2
screen shot 2016-06-12 at 6 30 33 pm

Exercise 3
screen shot 2016-06-12 at 6 32 44 pm

Exercise 4
screen shot 2016-06-12 at 6 44 45 pm

Exercise 5
The first code prints a 3 to the screen. The second throws an error because the variable x is not defined outside of the do/end block.

Exercise 6
This error message means that the variable shoes is not defined.

@jesse-spevack
Copy link
Author

Methods

Exercise 1
screen shot 2016-06-13 at 8 04 14 am

Exercise 2
screen shot 2016-06-13 at 8 07 23 am

Exercise 3
screen shot 2016-06-13 at 8 10 49 am

Exercise 4
This code will not print anything because the puts statement comes after the method has already returned a value and that value is not printed subsequently in the code.

Exercise 5
screen shot 2016-06-13 at 8 16 33 am

Exercise 6
The error message shows that when the method "calculate_product" is called, it is passed 1 argument when it is expecting 2 arguments.

@jesse-spevack
Copy link
Author

Flow Control

Exercise 1
screen shot 2016-06-13 at 8 56 51 am

Exercise 2
screen shot 2016-06-13 at 8 59 17 am

Exercise 3
screen shot 2016-06-13 at 9 04 20 am

Exercise 4
screen shot 2016-06-13 at 1 43 14 pm

Exercise 5
screen shot 2016-06-13 at 1 52 43 pm

Exercise 6
The error is the result of a missing "end" statement. The if/else needs an end statement. Add "end" to line 7 and the program will run.

@jesse-spevack
Copy link
Author

Loops & Iterators

Exercise 1
The each method returns [1, 2, 3, 4, 5] the original array it acted upon.

Exercise 2
screen shot 2016-06-13 at 5 38 52 pm

Exercise 3
screen shot 2016-06-13 at 5 44 58 pm

Exercise 4
screen shot 2016-06-13 at 5 50 35 pm

@jesse-spevack
Copy link
Author

Arrays

Exercise 1
screen shot 2016-06-13 at 6 12 35 pm

Exercise 2
screen shot 2016-06-13 at 6 27 56 pm

Exercise 3
screen shot 2016-06-13 at 6 30 53 pm

Exercise 4
screen shot 2016-06-13 at 6 33 09 pm

Exercise 5
screen shot 2016-06-13 at 6 34 35 pm

Exercise 6
To replace the fourth element, 'margaret' with 'jody' the code should be names[3] = 'jody'

Exercise 7
screen shot 2016-06-13 at 6 52 45 pm

@jesse-spevack
Copy link
Author

Hashes

Exercise 1
screen shot 2016-06-13 at 9 46 22 pm

Exercise 2
screen shot 2016-06-13 at 9 59 03 pm

Exercise 3
screen shot 2016-06-13 at 10 04 36 pm

Exercise 4
I would access the name of the person in the given has with person[:name]

Exercise 5
screen shot 2016-06-13 at 10 08 46 pm

Exercise 6
screen shot 2016-06-13 at 10 40 43 pm

Exercise 7
In my_hash, the symbol x is used as the key. In my_hash2 the string value, "hi there" stored in the variable x is used as the key.

Exercise 8
Arrays do not have a keys method. (B)

@jesse-spevack
Copy link
Author

More Stuff

Exercise 1
screen shot 2016-06-14 at 2 44 15 pm

@jesse-spevack
Copy link
Author

Improve your workflow with Regis’ video on using Atom & Spectacle

What shortcuts do you think you'll find most useful?
The shortcuts that I think I will find most useful are:

  1. being able to quickly toggle my windows into different configurations to best utilize screen real estate. This is definitely a pain point for me pre- spectacle.
  2. the short cut for moving blocs of code in atom - ctrl+cmd up arrow / down arrow.
    What would you like to learn or practice that will most help you improve your speed and workflow?
    I think I need to get clearer on some of the tasks I'll be doing routinely to better understand which shortcuts will be most helpful.

@jesse-spevack
Copy link
Author

Learn how to use Git & GitHub for version control
screen shot 2016-06-14 at 4 44 16 pm

@jesse-spevack
Copy link
Author

Jumpstart Lab Tutorials - encryptor:

https://github.com/PlanetEfficacy/turing-prework-encryptor

@jesse-spevack
Copy link
Author

jesse-spevack commented Jun 18, 2016

Ruby Lessons on CodeAcademy
screen shot 2016-06-18 at 9 05 25 am

@jesse-spevack
Copy link
Author

Jumpstart Lab Tutorials - encryptor:

https://github.com/PlanetEfficacy/turing-prework-encryptor
screen shot 2016-06-23 at 9 07 29 am

@jesse-spevack
Copy link
Author

Jumpstart Lab Tutorials - encryptor:

https://github.com/PlanetEfficacy/turing-prework-encryptor
screen shot 2016-06-23 at 9 54 21 pm

@jesse-spevack
Copy link
Author

Jumpstart Lab Tutorials - encryptor:

https://github.com/PlanetEfficacy/turing-prework-encryptor
screen shot 2016-06-24 at 4 53 08 pm

@jesse-spevack
Copy link
Author

jesse-spevack commented Jun 25, 2016

Become a command line master by working through Michael Hartl's command line book.

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?
screen shot 2016-06-25 at 2 23 01 pm
screen shot 2016-06-25 at 2 23 29 pm

1.4: What do Ctrl-A, Ctrl-E, and Ctrl-U do?
Ctrl-A will move the cursor to the start of a line. Ctrl-E will move the cursor to the end of the line. Ctrl-E clears to the beginning of the line and lets us start over.

1.5: What are the shortcuts for clearing your screen, and exiting your terminal?
The 'clear' command, Ctrl+L and Cmd+k will all clear the screen. The 'exit' command, Ctrl+L and Cmd+Q will exit terminal.

2.1: What is the "cat" command used for? What is the "diff" command used for?
"cat" is short for "concatenate", and can combine the contents of multiple files. It is also a 'quick-and-dirty' way to view the contents of a particular file. "diff" prints the difference of two files.

2.2: What command would you use to list all txt files? What command would you use to show all hidden files?
To list all txt files, use the command "ls *.txt". To show all hidden files use the command "ls -a".

3.1: How can you download a file from the internet, using the command line?
The curl command can be used to download a file from the internet.

3.3: Describe two commands you can use in conjunction with "less".
One command you can use with "less" is "/" keyword to search the file for the keyword. We can also use the G command to move to the end of the file and the 1G to move back to the beginning.

3.4: What are two things you can do with "grep"?
One thing you can do with grep is search a .txt file for a sub string, (e.g. grep -i rose sonnets.txt). A second thing you can do with grep is an inverted search, which finds lines of a .txt file that do not contain a particular sub string, (e.g grep -v rose sonnets.txt).

@jesse-spevack
Copy link
Author

jesse-spevack commented Jun 25, 2016

Task G (final task)- Pre-work Reflection:

To sum up your pre-work, answer the following questions in your Gist:

Were you able to get through the work? Did you rush to finish, or take your time?
I got through ALL of the work, except the final two paid, in-depth options for learning Ruby. I didn't rush, I spread the work out over about three weeks from the time I finished my job as an assistant principal to the day before module 1 begins.

What are you most looking forward to learning more about?
I'm looking forward to learning more about Ruby, computational thinking, and how to build web apps using Ruby. I'm still not clear how to make things appear in my browser using Ruby.

What topics would you most like to see reinforced by instructors?
At first, I'm excited to see how more experienced folks approach the work flow of development. I think I got much better with short cuts and of course command line after completing the pre-work. I want to reinforce this and fill in gaps in my understanding at the start. I also am excited to more fully wrap my head around object oriented programming with Ruby and debugging best practices. I made my way through pry and pry byedebug, but I'm sure there are better ways to approach unexpected errors in one's code. With OOP, I'm excited to get clear on how to break problems down and organize them.

What is most confusing to you about what you've learned?
The most confusing parts of Ruby for me are symbols, working with files as inputs / outputs, blocs, and procs. I'm also not clear on dealing with branches in git. I've been able to create a repository and update it, but I haven't had to fork or reconcile differences between branches.

What questions do you have for your student mentor or for your instructors?
What's next?!

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