Skip to content

Instantly share code, notes, and snippets.

@lsaville
Forked from mbburch/prework.md
Last active August 18, 2016 20:50
Show Gist options
  • Save lsaville/c5c4e80bf00030449309483e88ee033c to your computer and use it in GitHub Desktop.
Save lsaville/c5c4e80bf00030449309483e88ee033c to your computer and use it in GitHub Desktop.
An example template for your Turing pre-work Gist

Turing School Prework - Lee Saville

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:

....aaaaand here it is!

Task D- Set up your Environment:

  • Did you run into any issues? The main issue I had was the duration of time it took for xcode to download its upadate. I had previously set-up most of the environment in question apart from the seeing-is-believing.
  • How do you open Atom from your Terminal? After installing the command line tools you simply use atom followed by the directory or file you'd like to open, or alone in which case atom opens to an untitled file.
  • What is the file extension for a Ruby file? .rb
  • What is the Atom shortcut for hiding/ showing your file tree view? command + \
  • What is the Atom shortcut for quickly finding a file (fuzzy finder)? command + 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? pwd stands for "print working directory" and its helpful because it tells us where we are.
  • What does hostname tell you, and what shows up in YOUR terminal when you type hostname? Hostname tells you the name of your computer. Mine reads "Lees-MacBook-Air.local".

Task F- Learn Ruby:

Option 1 Questions:

IRB

  • How do you start and stop irb? You start IRB by typing in "irb" at the command line
  • What might you use irb for? IRB is used to try out bits of Ruby to see how it works.

Variables

  • How do you create a variable? You make a variable by giving it a name followed by an '=' and it's value.
  • What did you learn about the rules for naming variables? You can't use dashes in a name, begin the name with a number, or use all numbers.
  • How do you change the value of a variable? You can change a variable by using '=' to assign it a new value.

Datatypes

  • How can you find out the class of a variable? You can call the method "class" by following the variable with a period and "class" i.e. "five".class
  • What are two string methods? .reverse and .length
  • How can you change an integer to a string? By using the method .to_s

Strings

  • Why might you use double quotes instead of single quotes in Ruby? To be able to use string interpolation.
  • What is this used for in Ruby: #{}? This is used for string interpolation in which you can embed some ruby statement in a string.
  • How would you remove all the vowels from a string? You would use the :delete method passing ('aeiou') as its argument.

Input & Output

  • What do 'print' and 'puts' do in Ruby? 'puts' and 'print' print things to a user, the difference being print not making a newline after the printed content.
  • What does 'gets' do in Ruby? 'gets' pauses the program and waits for the user to enter some 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 numbers without decimal digits. Floats have decimal digits like 5.304.
  • 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?
    • == equivalence
    • = greater than or equal to

    • <= less than or equal to
    • != not equal to
    • && 'and' meaning that the terms on both sides must be true or the whole statement is false
    • || 'or' meaning one side or the other must be true or that whole statement is false
  • What are two Ruby methods that return booleans? :end_with? and :include? By convention methods that end with '?' return a boolean.

Conditionals

  • What is flow control? Flow control involves having the program make decisions for us. It involves using if/else type statements.
  • What will the following code return? It will return 'false' because the 'apple_count' is less than 5, resulting in '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? In a while loop you need to provide a stop condition otherwise you'll get stuck in an infinite loop... where your program just keeps repeating itself. You should have written the loop better, but you can get out by pressing ctrl - c.
  • 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 lack of definition. It 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? Symbols help Ruby use memory more efficiently by letting Ruby have many variables pointing to the same object.
  • Does naming symbols use the same rules for naming variables? Symbol naming does seem to exhibit the same rules as those for 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? You can use the method .length.
  • What is the index of pizza in this array: ["pizza", "ice cream", "cauliflower"]? The index of pizza is [0].
  • What do 'push' and 'pop' do? 'push' adds a new element to the end of the array while 'pop' removes and returns the last element of the array.

Hashes

  • Describe some differences between arrays and hashes. An array contains elements that are associated by their index number while hashes are key/value pairs, where the key can be any object. A hash is like a dictionary where you can look up things by name instead of ordered number.
  • What is a case when you might prefer an array? What is a case when you might prefer a hash? An array might work well for an ordered list while hashes work better for properties and looking things up by their key regardless of order.
    • 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 got through the week worth of work in a week. I was eventually able to finish almost all the suggested work with the exception of the entirety of free logic work on brilliant.org. I didn't feel rushed but there was certainly a good deal of work that had to be done and I invested regular times to work through all of it.
  • What are you most looking forward to learning more about? I'm looking forward to the application of the simple bits of a language into a usable construct. I've had a little experience with the fundamentals of the language now but it's not always readily apparent what the applications are. You're really able to do some cool things with ruby, I'd also like to get deeper into classes and unique ruby features.
  • What topics would you most like to see reinforced by instructors? The creation of clean code seems paramount, it being one thing to throw something functional together and another to have it easy to read, avoiding repitition, and factoring the code as in the last section of the Railsbridge. Object oriented programming principles are an easy target, the tricky parts of variable scope, and how to create classes/how the variables are passed etc.
  • What is most confusing to you about what you've learned? From this experience and a few others I have had it seems like there is a point at which one needs to jump beyond the simple fundamentals of a language and into some real complexity. At this jumping off point it seems hard to keep track of everything that is going on. I had to come back to the dice rolling program and slowly go through line by line explaining to myself what was happenning and why. I'll likely need to do it again. (This is perhaps due to the nature of the problem, it being a "here, type this long thing in your editor, then I'll explain it" type of situtation as opposed to a natural progression of having a need and working to create bit by bit.) I also felt generally confused about the brilliant.org part. There didn't seem to be any good screenshot opportunities that made it visible which section was completed. In the challenge quizes it seemed to veer directly towards math knowledge which could be considered logic but are of a different style and seem to require specific math conventions. Some of the more complex class objects and variable scope can get tricky.
  • What questions do you have for your student mentor or for your instructors? I've been asking questions to my mentor for some time now and I'm all up to date with questions as of now. This will surely change as we encounter new materials and get into the thick of the module.

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? You can set your variable name equal to the function with its parameters. i.e var1 = function(param)
  • Describe the purpose of the following in Ruby classes: initialize method, new method, instance variables. Initialize is a method used to save the initial stuff you'll need. New method is used to create an instance of the class (A particular individual instance. Like human is the class I am the instance), the parameters you pass in the new method get fed to the initialize method. Instance variables are variables specific to that particular object and are invisible from without.
  • 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. As stated above, I found the jump in complexity from railsbridge "how to write a program" step 3 to step 4-7 a little difficult. It may partially be the result of my trying to work through the material after a longish day of work, but it took a while to be able to keep all the individual working parts in my understanding. Going through it and making comment notes about each section and what it does seemed to help.

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

Hartl Command Line 1.3
You can use the option '-n' with echo to prevent it from appending a newline to the output.
screen shot 2016-07-29 at 8 15 03 am

@lsaville
Copy link
Author

Hartl Command Line 1.4
ctrl + a takes us to the beginning of the line.
ctrl + e takes us to the end of the line.
crtl + u erases the line so we can start fresh.

@lsaville
Copy link
Author

Hartl Command Line 1.5
You can type ctrl + L to clear the whole frame of the window, or use cmd + L to erase line by line. As for 'exit'ing, the recommended shortcut is ctrl + d. Another option for this is cmd + w or cmd + q, which exits terminal automatically when it closes. I'm unsure if there is a reason you'd use exit terminal but not close the window.

@lsaville
Copy link
Author

Hartl Command Line 2.1
"cat" is short for concatenation but is commonly used as a quick way to see the contents of a file. "diff" is used to see the differences between two files.

@lsaville
Copy link
Author

lsaville commented Jul 29, 2016

Hartl Command Line 2.2
To list all test files you would use "ls *.txt". To show all hidden files you would use "ls -a".

@lsaville
Copy link
Author

Hartl Command Line 3.1
We can download a file from the internet by using the "curl" command with various flags. In the tutorial we fetch the file 'sonnets.txt' by using "curl -OL" the -O means we write the output to a local file of the same name, and the -L means that if the location has moved curl will try the request again at the new location.

@lsaville
Copy link
Author

Hartl Command Line 3.3
Commands you can use in 'less' are G and 1G which move you to the end of the file and beginning of the file respectively. You can use ctrl + f/b to move forward page by page and back page by page respectively. / followed by a search term allows you to search, n and N allowing you to move to the next instance of found search or the previous respectively.

@lsaville
Copy link
Author

Hartl Command Line 3.4
Two things you can do with the "grep" command are search for a string in a file or search through the results of ps aux to find particular processes that are clogging the system to kill them.

@lsaville
Copy link
Author

lsaville commented Aug 3, 2016

Codecademy
screen shot 2016-08-02 at 6 59 47 pm

@lsaville
Copy link
Author

lsaville commented Aug 3, 2016

Codecademy
screen shot 2016-07-31 at 5 42 24 pm

@lsaville
Copy link
Author

lsaville commented Aug 5, 2016

Codecademy
screen shot 2016-08-05 at 4 40 51 pm

@lsaville
Copy link
Author

lsaville commented Aug 5, 2016

Codecademy
screen shot 2016-08-02 at 7 14 43 pm

@lsaville
Copy link
Author

lsaville commented Aug 5, 2016

Codecademy
screen shot 2016-08-05 at 5 00 25 pm

@lsaville
Copy link
Author

lsaville commented Aug 6, 2016

Codecademy
screen shot 2016-08-05 at 9 48 51 pm

@lsaville
Copy link
Author

lsaville commented Aug 6, 2016

Codecademy
screen shot 2016-08-06 at 12 40 08 pm

@lsaville
Copy link
Author

lsaville commented Aug 6, 2016

Codecademy
screen shot 2016-08-06 at 2 26 37 pm

@lsaville
Copy link
Author

lsaville commented Aug 7, 2016

Codecademy
screen shot 2016-08-07 at 4 01 50 pm

@lsaville
Copy link
Author

lsaville commented Aug 8, 2016

Codecademy
screen shot 2016-08-08 at 12 04 17 pm

@lsaville
Copy link
Author

lsaville commented Aug 8, 2016

Codecademy
screen shot 2016-08-08 at 1 10 25 pm

@lsaville
Copy link
Author

lsaville commented Aug 9, 2016

Codecademy
screen shot 2016-08-09 at 10 36 29 am

@lsaville
Copy link
Author

lsaville commented Aug 9, 2016

Codecademy
screen shot 2016-08-09 at 11 34 52 am

@lsaville
Copy link
Author

lsaville commented Aug 9, 2016

Codecademy
screen shot 2016-08-09 at 11 55 48 am

@lsaville
Copy link
Author

lsaville commented Aug 9, 2016

Codecademy
screen shot 2016-08-09 at 12 33 25 pm

@lsaville
Copy link
Author

lsaville commented Aug 9, 2016

Codecademy
screen shot 2016-08-09 at 3 37 34 pm

@lsaville
Copy link
Author

Brilliant.org
screen shot 2016-08-09 at 3 51 01 pm
screen shot 2016-08-09 at 4 01 05 pm
screen shot 2016-08-09 at 4 06 15 pm
screen shot 2016-08-09 at 4 13 28 pm

@lsaville
Copy link
Author

Brilliant.org
screen shot 2016-08-09 at 4 30 45 pm
screen shot 2016-08-09 at 4 34 53 pm
screen shot 2016-08-09 at 4 38 47 pm
screen shot 2016-08-09 at 4 44 42 pm
screen shot 2016-08-09 at 5 17 39 pm

@lsaville
Copy link
Author

Brilliant.org
screen shot 2016-08-09 at 6 35 09 pm
screen shot 2016-08-10 at 9 13 58 am
screen shot 2016-08-10 at 9 22 33 am
screen shot 2016-08-10 at 9 31 46 am

@lsaville
Copy link
Author

typing
screen shot 2016-08-10 at 7 15 48 pm

@lsaville
Copy link
Author

typing
screen shot 2016-07-31 at 10 58 40 am

@lsaville
Copy link
Author

typing
screen shot 2016-08-10 at 7 02 39 pm

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