Skip to content

Instantly share code, notes, and snippets.

@kswhyte
Forked from mbburch/prework.md
Last active June 28, 2016 03:21
Show Gist options
  • Save kswhyte/51e71a6f18faf44b8067924fd4386636 to your computer and use it in GitHub Desktop.
Save kswhyte/51e71a6f18faf44b8067924fd4386636 to your computer and use it in GitHub Desktop.
An example template for your Turing pre-work Gist

Turing School Prework - Kinan Whyte

Task A- Practice Typing:

  • screenshots of scores will be posted in comments
  • see screenshots below.

Task B- Algorithmic Thinking & Logic:

  • screenshots of completed sections will be posted in comments
  • see screenshots below.

Task C- Create your Gist:

https://gist.github.com/kswhyte/51e71a6f18faf44b8067924fd4386636

Task D- Set up your Environment:

  • Did you run into any issues?
  • I ran into no issues here.
  • How do you open Atom from your Terminal?
  • by typing "atom ."
  • 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" + "T"

Task E- The Command Line:

  • screenshots of your terminal after each exercise will be posted in comments
  • see screenshots below.

Day One Questions:

  • What does pwd stand for, and how is this command helpful?
  • pwd = Print Working Directory. This command shows you which directory or folder you are currently in so that you can navigate from there
  • What does hostname tell you, and what shows up in YOUR terminal when you type hostname?
  • Hostname tells you your computer's network name or hostname. In my terminal, the following shows up: "Kinans-MacBook-Pro.local"

Task F- Learn Ruby:

Option 1 Questions:

IRB

  • How do you start and stop irb?
  • Starting irb, you type, "irb" ; Stopping irb, you type, "exit"
  • What might you use irb for?
  • You use irb for testing commands in ruby, or exploring command functions in ruby, or to test and preview working with ruby so that you can practice its functions

Variables

  • How do you create a variable?
  • by choosing a name or writing a string and setting it to "="
  • What did you learn about the rules for naming variables?
  • when you are naming variables you can include numbers and letters as long as they are within either ' ' or " ", unless you use an _ underscore. Otherwise, numbers only work.
  • How do you change the value of a variable?
  • simply type or call the variable then set it = to something new

Datatypes

  • How can you find out the class of a variable?
  • By typing the variable or object name, then a period, and finally "class" (or in total after the variable: add a ".class" to it)
  • What are two string methods?
  • to string methods (to_s) are conversion methods that convert a variable from one class to another class or datatype. to_s methods convert the class into a string
  • How can you change an integer to a string?
  • you type the integer, then add ".to_s" which is a method that changes a variable to a string.

Strings

  • Why might you use double quotes instead of single quotes in Ruby?
  • You want to use double quotes when you use string interpolation.
  • What is this used for in Ruby: #{}?
  • This is used for the string interpolation command which enters new data into data that already exists. This is useful for calling specific variables that were named or created previously in order to insert them into something new.
  • How would you remove all the vowels from a string?
  • by using the method ".delete" ; in this case you would type a string then use string.delete.('aeiou') which selects vowels and removes them from the previous string.

Input & Output

  • What do 'print' and 'puts' do in Ruby? *"print" allows you to print information to the user in a program but doesn't create a new line. "puts" is a way of doing the same thing and creates a new line. print is like puts but doesn't put a new line after printing.
  • What does 'gets' do in Ruby?
  • "gets" allows the user to type something by pausing the program. once something is typed, the enter key must be hit. then, the value or what was typed is returned to the program to continue its execution.
  • 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 and floats are decimals.

Type this in irb:

  • Complete the challenge, and post a screenshot of your program in the comments with the title, "Numbers".
  • Screen shot posted below.

Booleans

  • What do each of the following symbols mean?
    • == : equals
    • = : greater or equal than

    • <= : less or equal than
    • != : not equals
    • && : and
    • || : or
  • What are two Ruby methods that return booleans?
  • ".empty?" and ".with?"

Conditionals

  • What is flow control?
  • a concept that explains how we want programs to make decisions for us. It is found in most OO languages
  • What will the following code return?
apple_count = 4
"not many apples..."

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?
  • when creating a loop you use a "while" object/loop. It needs a false statement to stop the loop, and if it doesn't get one, it can go on forever. This is an infinite loop.
  • Take a screenshot of your program and terminal showing two different outputs, and post it in the comments with the title, "Conditionals".
  • See post in comments below.

nil

  • What is nil?
  • for setting a variable to empty. It 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".
  • See comments below.

Symbols

  • How can symbols be beneficial in Ruby?
  • Symbols allow variables point to the same object in several places instead of allocating a new copy. Everytime a value is assigned to an object, Ruby stores this information, setting aside a piece of memory to hold the value; This helps Ruby use memory more efficiently.
  • Does naming symbols use the same rules for naming variables?
  • no, symbols start with a ":", i.e. :symbol
  • Also, symbols are constants, like letters and numbers, so they can't be assigned a value.
  • Take a screenshot of your terminal after working through Step 4, and post it in the comments with the title, "Symbols".
  • See comments.

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 a new element into an array.
  • "pop" removes (and returns) the element at the end of an array

Hashes

  • Describe some differences between arrays and hashes.
  • "arrays" help store an ordered list of items (or elements) by their position. "hashes" help us store an ordered list of items, and also allow us to sign a "key" to those items so that they can be looked up by name (key or value).
  • A hash stores pairs of items, associating "keys" with "values"; often they store properties of some object
  • What is a case when you might prefer an array? What is a case when you might prefer a hash?
  • a case in which you would prefer an array is when you want to look them up by positions (or numbers).
  • a case in which you would prefer a hash is when you want to look them up by name (or key or value). Hashes are a fundamental way to group large amounts of data.
    • Take a screenshot of your terminal after working through Step 2, and post it in the comments with the title, "Hashes".
  • See comments.

Task G- Prework Reflection:

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

Not quite. I worked through almost the entire month's work at a fairly regular pace. I spent a good amount of time in the last few days working longer hours to get as much as I could done. It was a mix of taking my time over the month by hitting lessons nearly daily and then pushing more time into the lessons as I sat down for longer periods as work obligations kept me from daily routine.

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

I am most looking forward to learning about actual programming, to pick up and memorize technical components to coding as well as being able to debug my own code. I'll be also looking forward to getting good at solving real world problems and working on assignments that are more about applying it all to real situations.

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

tricks and tips on apps like git, github, the command line, atom, and ruby. I would like to see more about how instructors approach a given problem or prompt.

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

potentially, this is just writing code from scratch. It's difficult for me to see how I can come up with lines of code that include functions, objects, methods, etc. from scatch. I'm curious about how people are working through problems--whether they are consistently referring to guidebooks and documents for command lists or what.

  • What questions do you have for your student mentor or for your instructors? I don't have any other questions really at this time. I'm ready to continue the journey!

HOWEVER, I wrote down these 2 questions that I couldn't seem to nail:

how do you remove the trailing newline in terminal? - Learning the Command line another example questions: What is the command to list only the files starting with the letter “b”? Hint: Use a wildcard.

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.

  • see comments

  • What challenges did you try for "Summary: Basics"? Post a screenshot of one of your programs. See comments

  • I tried the following programs: all of them, however found the most success in the following:

  • playback_msg, voter_age, add_userinput

  • 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, then send in the values the function needs to do its job. To store the result in a variable, you set the result "=" to something--a name that will indicate it's value that you can remember (preferrably)

  • Describe the purpose of the following in Ruby classes: initialize method, new method, instance variables. See below:

initialize method: saves the initial data your object is created with and performs any other required set-up. * new method: to create an instance of your object with a new variable. Arguments passed into a new variable are sent to your initialize method. * instance variables: store data on you object by using the "@" sign. They are like normal vaiables, but are only visible from inside a 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. SEE COMMENTS
  • What are your three biggest takeaways from working through this book? That to write programs and troubleshoot through problems on my own is very useful, that being able to verify a solution through the course allows me to see that solutions vary, that there is always more than 1 way to accomplish a task, but usually there is a more effective and time-effective method.

I have also been introduced to the great depth of how expressive Ruby is and how there are a ton of options to do multiple things. There really is an infinite number of functions that are possible in programming.

CodeSchool

  • screenshots will be posted in comments. SEE COMMENTS
  • What are your two biggest takeaways from working through this tutorial? First of all, that Git and Github are different yet connected and that it is important to connect them and to work seemlessly between them. I learned that Git is the tool to manage source code and the HISTORY of it. It is impressive to be able to store this data...While Github is more of the hosting service for projects that are using Git.

Secondly, I can see how valuable it is to use open source philosophy of creating, contributing, collaborating, etc. on work that makes developing software and using it better. I can see the power of cross pollinating and cross collaborating with all kinds of minds across the globe as well. It is very powerful.

  • What is one question you have about Git & GitHub? How to use SSL and SSH and how to set up keys.

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?

Effective workflow is definitely using the most efficient commands and ways of using tools. This can be done by learning shortcut keys that allow you to command and navigate the OS more seemlessly, faster, and more effectively. This saves time, which ultimately saves money, and creates a much more smooth and effective workflow.

I found the Command-D shortkey really useful becasue of the way you can change a variable or class that is present in many places in Atom all at once. I also found that splitting panes is very helpful if you are working on multiple projectst and need to see the content of all of them. I like how you can navigate easily from one tab to the other and close out of them easily with shorcut functions. Command-T is nice to be able to quickly look up a file. I also was happy to see the 33-66 split of the terminal at the bottom and atom at the top. I was using left and right splits before. This is not possible as easily with Spectacle, so knowing about that app is huge too.

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?

by appending/adding '\c' to the end of the string. I'm having a tough time understanding this one...however, I used echo "string...\c" which seems to work.

  • 1.4: What do Ctrl-A, Ctrl-E, and Ctrl-U do?

Ctrl-A: brings/moves cursor to beginning of line Ctrl-E: brings/moves cursor to end of line Ctrl-U: deletes full line, with fresh start

  • 1.5: What are the shortcuts for clearing your screen, and exiting your terminal?

typing "clear" and enter OR "control-L" Exiting: type command-W, ctrl-D or type "exit"

  • 2.1: What is the "cat" command used for? What is the "diff" command used for?

cat = to concatenate/link or print the text inside a file to the terminal for viewing diff = to view the difference of 2 different files

  • 2.2: What command would you use to list all txt files? What command would you use to show all hidden files?

type "ls" in the proper directory to view documents that exist in that directory type "ls -a" to view all files, even if hidden.

  • 3.1: How can you download a file from the internet, using the command line?

type curl -OL #{URL name} then you can ls -rtl to see it.

  • 3.3: Describe two commands you can use in conjunction with "less".

when you are looking at a file with less, you can scroll up and down with ^F and ^B or use the space bar to scroll. You can also use ^G to go to the end of the file or 1-shift-G to go the beginning

  • 3.4: What are two things you can do with "grep"?
  • inspect files: you can take a word or phrase and search through a file and get information about where those words are by having grep print back to the screen those lines; since it is case sensitive you can use option -i to perform case sensitive matching. you can also use the "|" and "wc" to count how many times it shows up.
@kswhyte
Copy link
Author

kswhyte commented Jun 12, 2016

Task E Complete:

Remove files:
kw-task e remove files

Stream files:
kw-task e stream files

View files
kw-task e view files

@kswhyte
Copy link
Author

kswhyte commented Jun 12, 2016

Task E Complete:

Arrays
kw-task e arrays

Hashes
kw-task e hashes

Symbols
kw-task e symbols

@kswhyte
Copy link
Author

kswhyte commented Jun 14, 2016

Priority 1 (P1)

Loops Challenge:

kw- p1_loops_greet everyone

@kswhyte
Copy link
Author

kswhyte commented Jun 14, 2016

P1

Summary: Tools Challenges:

Program: add_userinput

kw-p1_add user numbers

Program: voter_age

kw-p1_voter age

Program: playback_msg

kw-p1_playback message

@kswhyte
Copy link
Author

kswhyte commented Jun 14, 2016

P1

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, then send in the values the function needs to do its job.
To store the result in a variable, you set the result "=" to something--a name that will indicate it's value that you can remember (preferrably)

@kswhyte
Copy link
Author

kswhyte commented Jun 14, 2016

P1

Describe the purpose of the following in Ruby classes:

initialize method:
saves the initial data your object is created with and performs any other required set-up.

new method:
to create an instance of your object with a new variable. Arguments passed into a new variable are sent to your initialize method.

instance variables:
store data on you object by using the "@" sign. They are like normal vaiables, but are only visible from inside a specific instance of your object.

@kswhyte
Copy link
Author

kswhyte commented Jun 14, 2016

P1

How to write a program...
In creating this program...

what I found most challenging:
was understanding how the whole of the program works and how breaking down initial objects into further components made it more efficient. I had a hard time fully following the changes and understanding the meaning of each change in terms of it being connected.

most enjoyable:
was refining the code and seeing it become more organized and seemingly efficient by separating objects into smaller parts. It is fun to see the code run in generally the same way

@kswhyte
Copy link
Author

kswhyte commented Jun 17, 2016

P2 Preparations Exercise Complete:

p2 preparations exercise

@kswhyte
Copy link
Author

kswhyte commented Jun 17, 2016

P2 The Basics Exercise:

p2 the basics exercise

@kswhyte
Copy link
Author

kswhyte commented Jun 20, 2016

P2 Variables Exercise:

p2 variables exercise

@kswhyte
Copy link
Author

kswhyte commented Jun 21, 2016

P2 Methods Exercise

p2 methods exercise a

@kswhyte
Copy link
Author

kswhyte commented Jun 22, 2016

P2 Flow Conditionals Exercise

p2 flow control exercise 2

p2 flow control exercise 3

p2 flow control exercise 4

p2 flow control exercise 1

@kswhyte
Copy link
Author

kswhyte commented Jun 23, 2016

P4 Completed with Badge

p3 github tutorial badge

p3 github tutorial

@kswhyte
Copy link
Author

kswhyte commented Jun 23, 2016

P2 Loops & Iterators Exercises

p2 loops iterators exercise 12

p2 loops iterators exercise 1

@kswhyte
Copy link
Author

kswhyte commented Jun 25, 2016

P2 Arrays Exercises
p2 arrays exercise 1

p2 arrays exercise 5

p2 arrays exercise 4

p2 arrays exercise 3

p2 arrays exercise 2

@kswhyte
Copy link
Author

kswhyte commented Jun 25, 2016

Typing.io Complete in Javascript:

kw-typing io_javascript1

kw-typing io_javascript2

kw-typing io_javascript3

kw-typing io_javascript4

kw-typing io_javascript5

kw-typing io_javascript6

kw-typing io_javascript7

kw-typing io_javascript8

kw-typing io_javascript9

kw-typing io_javascript10

kw-typing io_javascript11

kw-typing io_javascript12

kw-typing io_javascript13

kw-typing io_javascript14

kw-typing io_javascript15

kw-typing io_javascript complete

@kswhyte
Copy link
Author

kswhyte commented Jun 27, 2016

P2 Hashes Exercises

p2 hash exercise 3

p2 hash exercise 2

p2 hash exercise 1

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