Skip to content

Instantly share code, notes, and snippets.

@Thatgirlcancode16
Forked from mbburch/prework.md
Last active March 23, 2016 17:53
Show Gist options
  • Save Thatgirlcancode16/28702dd984bf8d5c8ff1 to your computer and use it in GitHub Desktop.
Save Thatgirlcancode16/28702dd984bf8d5c8ff1 to your computer and use it in GitHub Desktop.
An example template for your Turing pre-work Gist

Turing School Prework- Denali Lord

Task A- Practice Typing: Completed. 27 wpm.

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

More Typing Practice from 3/3/16: Erlang Riak:

screen shot 2016-03-03 at 7 50 52 am

@Thatgirlcancode16
Copy link
Author

3/3/16 Pre-Work: Launch School Work: Variables:

One: Write a program called name.rb that asks the user to type in their name and then prints out a greeting message with their name included.

screen shot 2016-03-03 at 8 40 58 am

Two: Write a program called age.rb that asks a user how old they are and then tells them how old they will be in 10, 20, 30 and 40 years. Below is the output for someone 20 years old.

screen shot 2016-03-03 at 8 49 48 am

Three: Add another section onto name.rb that prints the name of the user 10 times. You must do this without explicitly writing the puts method 10 times in a row. Hint: you can use the times method to do something repeatedly.

screen shot 2016-03-03 at 8 52 43 am

Four: Modify name.rb again so that it first asks the user for their first name, saves it into a variable, and then does the same for the last name. Then outputs their full name all at once.

screen shot 2016-03-03 at 8 56 43 am

Five: What does x print to the screen in each case? Do they both give errors? Are the errors different? Why?

X prints both 3 and nil. No, they don't both give errors.

screen shot 2016-03-03 at 9 00 24 am

Six: What does the following error message tell you?

NameError: undefined local variable or method shoes' for main:Object from (irb):3 from /usr/local/rvm/rubies/ruby-2.0.0-rc2/bin/irb:16:in

'

The error message tells you that you are outside the scope of the variable 'shoes and thus did not define the local method or variable named 'shoes.'

@Thatgirlcancode16
Copy link
Author

3/4/16: Typing Practice: C Redis
screen shot 2016-03-05 at 9 24 00 pm

@Thatgirlcancode16
Copy link
Author

3/5/16 Typing Practice: Python

screen shot 2016-03-05 at 9 18 31 pm

@adamcaron
Copy link

Hi Denali,

Good working using the terminal to create and move files around. Also, nice job working with loops! (from day 8). 

Fantastic work on your “voting age” program! Nice use of gets and great job creating a method. After reviewing your day6 work, it seems you’re understanding gets quite well, now. Excellent progress. I’m glad you’re working with hashes, too. Those are one of the most foundational data-types and you’ll be using hashes more and more in the future.

I’m glad you have yourself a little command line quiz. You’re understanding of deleting folders and files is exactly correct. Also, adding the -la flag to the ls command (in other words, ls -la) is a great was to see additional information about the contents of a directory. ls -la is also the way to view hidden files and “dotfiles” that you wouldn’t otherwise be able to view (specifically, they’re not visible from within a ‘finder’ window).

Nice work with classes. You’ll become more and more familiar with classes as the program progresses and this is a wonderful introduction. 

Nice job creating a function to simulate a die roll. Fantastic work adding arguments and default arguments to your roll method. It’s clear by your notes that have a solid foundational understanding of the program so thanks for sharing your notes.

“Six: What does the following error message tell you?”

NameError: undefined local variable or method shoes’ for main:Object from (irb):3 from /usr/local/rvm/rubies/ruby-2.0.0-rc2/bin/irb:16:in

“The error message tells you that you are outside the scope of the variable ‘shoes and thus did not define the local method or variable named ‘shoes.’” — — Great!

Good job keeping up with your typing.io work.

All of this hard work will pay off tremendously, Denali. This really is fantastic work and I can tell your understanding is growing.

@Thatgirlcancode16
Copy link
Author

Thanks Adam! I need to catch up with Priority Two! Be in touch soon!

@Thatgirlcancode16
Copy link
Author

Thanks Adam! I need to catch up on my priority two tasks! Just sent you a message on Slack about when to have a meeting.

@Thatgirlcancode16
Copy link
Author

3/6/16: Typing Practice:
screen shot 2016-03-06 at 7 44 44 pm

screen shot 2016-03-06 at 7 40 28 pm

@Thatgirlcancode16
Copy link
Author

3/6/16: Launch School: Methods Exercises:

One: Write a program that prints a greeting message. This program should contain a method called greeting that takes a name as its parameter and returns a string.

screen shot 2016-03-06 at 9 33 38 pm

Two: What do the following expressions evaluate to?
X = 2 evaluates to 2
puts X = 2 evaluates to nil
p name = "Joe" evaluates to "Joe"
four = "four" evaluates to "four"
print something = "nothing" evaluates to nil
screen shot 2016-03-06 at 9 40 46 pm

Three: Write a program that includes a method called multiply that takes two arguments and returns the product of the two numbers.

screen shot 2016-03-06 at 9 45 03 pm

Four: What will the following code print to the screen?

The code will print doesn't print anything

Five: 1. Removed Return 2. I got it to work - printed "Yippee!!!!" The solution said that I should get nil. ?

screen shot 2016-03-06 at 9 52 43 pm

Six: What does the following error message tell you?
screen shot 2016-03-06 at 9 54 27 pm

So, I had to look this answer up b/c I had no idea. The answer is that you are calling the calculate_product method that passes two arguments. However, only one argument is provided.

@Thatgirlcancode16
Copy link
Author

3/6/16: Launch School: Language Comparisons and Conditionals

One: Write down whether the following expressions return true or false. Then type the expressions into irb to see the results.

screen shot 2016-03-06 at 10 49 37 pm

I think 1. will evaluate false b/c when I calculate 32 * 4 = 128 it is not less than 129.
screen shot 2016-03-06 at 10 50 11 pm

I think 2. will evaluate as as false b/c ! is an opposite operator. So the !true operator is actually false and the != is the equality operator, so false does equal false. The answer is true.
screen shot 2016-03-06 at 10 50 11 pm

I think 3 will evaluate as false b/c true and 4 are strings and an integer, they are not compatible for comparison.
screen shot 2016-03-06 at 10 52 25 pm

I think 4 will evaluate as true b/c 847 does not equal '847' as one is an integer and the other is a string. So, the false == to false is true!
screen shot 2016-03-06 at 10 53 16 pm

I think 5 will be true b/c I first have to evaluate the comparison operators. So I first have to evaluate the == operators (which there weren't any). After doing this, I evaluate the equality operators and then the logical or operators. The answer is true
screen shot 2016-03-06 at 10 56 06 pm

Two: Write a method that takes a string as argument. The method should return the all-caps version of the string, only if the string is longer than 10 characters. Example: change "hello world" to "HELLO WORLD". (Hint: Ruby's String class has a few methods that would be helpful. Check the Ruby Docs!)
screen shot 2016-03-06 at 11 09 54 pm

Three: Write a program that takes a number from the user between 0 and 100 and reports back whether the number is between 0 and 50, 51 and 100, or above 100.

@Thatgirlcancode16
Copy link
Author

3/7/16: Typing Practice: Clojure

screen shot 2016-03-07 at 8 43 45 am

@Thatgirlcancode16
Copy link
Author

3/7/16: Continued exercises from 3/6/16: Launch School: Language Comparisons and Conditionals:

Three: Write a program that take a number from the user between 0 and 100 and reports back whether the number is between 0 and 50, 51 and 100, or above 100.

screen shot 2016-03-07 at 9 08 25 am

Four: What will each block of code below print to screen? Write answer in a text editor and then run each block of code to see if correct:

1st: FALSE
screen shot 2016-03-07 at 9 15 42 am

2nd: "Did you get it right?"
screen shot 2016-03-07 at 9 17 46 am

3rd: Not sure about this one. Here is the output when run in terminal:
screen shot 2016-03-07 at 9 17 46 am

Five: Rework exercise three using a case statement. Wrap each method in a case statement and run.
Got a no method error:
screen shot 2016-03-07 at 9 44 25 am

Six: The message error appears because you need another end for the equal_to_four method.

@Thatgirlcancode16
Copy link
Author

3/7/16: Launch School Exercises: Loops and Iterators:

One: What does the each method in the following program return after it is finished executing?
screen shot 2016-03-07 at 2 37 53 pm

Two: Write a while loop that takes input from the user, performs an action, and only stops when the user types "STOP". Each loop can get info from the user.

screen shot 2016-03-07 at 3 20 05 pm

Three: Use the each_with_index method to iterate through an array of your creation that prints each index and value of the array.

screen shot 2016-03-07 at 3 28 07 pm

Four: Write a method that counts down to zero using recursion.

screen shot 2016-03-07 at 3 36 25 pm

@Thatgirlcancode16
Copy link
Author

3/8/16: Array Exercises:
One: Below we have given you an array and a number. Write a program that checks to see if the number appears in the array.

screen shot 2016-03-08 at 3 58 50 pm

Two: What will the following programs return? What is value of arr after each?

screen shot 2016-03-08 at 4 01 01 pm

Three: How do you print the word "example" from the following array?
I had to cheat, but it does make since. Type arr. last(for last array) and then type. first (for first name in last array group).

screen shot 2016-03-08 at 4 04 17 pm

Four: What does each method return in the following example?

screen shot 2016-03-08 at 4 07 04 pm

Five: What is the value of a, b, and c in the following program?
Use indices.

screen shot 2016-03-08 at 4 08 55 pm

Six: You run the following code...
The problem is that the element of 'Margaret' has been set to another string instead of an index to find the indie or place of this element. I think what the program was trying to do was to get the place or index of Margaret. Margaret would be the third element as we start counting elements from zero, not one.

Seven: Write a program that iterates over an array and builds a new array that is the result of incrementing each value in the original array by a value of 2. You should have two arrays at the end of this program, The original array and the new array you've created. Print both arrays to the screen using the p method instead of puts.

screen shot 2016-03-11 at 8 13 13 pm

@Thatgirlcancode16
Copy link
Author

3/8/16 Typing Practice: Php Symphony

screen shot 2016-03-08 at 2 10 25 pm

@Thatgirlcancode16
Copy link
Author

3/9/16: Typing Practice: Less Bootstrap:

screen shot 2016-03-09 at 9 17 07 am

@Thatgirlcancode16
Copy link
Author

3/9/16: Typing Practice: Perl Moose:

screen shot 2016-03-09 at 9 23 05 am

@Thatgirlcancode16
Copy link
Author

3/11/16: Typing Practice: Ruby on Rails

screen shot 2016-03-11 at 8 49 52 pm

@Thatgirlcancode16
Copy link
Author

3/11/16: Hashes Exercises:

One: Given a hash of family members, with keys as the title and an array of names as the values, use Ruby's built-in select method to gather only immediate family members' names into a new array.

screen shot 2016-03-11 at 10 19 52 pm

Two:Look at Ruby's merge method. Notice that it has two versions. What is the difference between merge and merge!? Write a program that uses both and illustrate the differences.

Merge simply merges two or more hashes together and does not modify the original data. Merge! modifies the hashes and becomes destructive.

Three: Using some of Ruby's built-in Hash methods, write a program that loops through a hash and prints all of the keys. Then write a program that does the same thing except printing the values. Finally, write a program that prints both.

Four: Given the following expression, how would you access the name of the person?
person = {name: 'Bob', occupation: 'web developer', hobbies: 'painting'}

To access the name, you could set up the hash: person[:name]

Five: What method could you use to find out if a Hash contains a specific value in it? Write a program to demonstrate this use.

Six: Given the array...

words = ['demo', 'none', 'tied', 'evil', 'dome', 'mode', 'live',
'fowl', 'veil', 'wolf', 'diet', 'vile', 'edit', 'tide',
'flow', 'neon']

Write a program that prints out groups of words that are anagrams. Anagrams are words that have the same exact letters in them but in a different order. Your output should look something like this:

["demo", "dome", "mode"]
["neon", "none"]

Seven: Given the following code...

x = "hi there"
my_hash = {x: "some value"}
my_hash2 = {x => "some value"}
What's the difference between the two hashes that were created?**

The difference is that the second hash does not have a symbol like the first hash.

Eight: If you see this error, what do you suspect is the most likely problem?

NoMethodError: undefined method `keys' for Array

A. We're missing keys in an array variable.

B. There is no method called keys for Array objects.

C. keys is an Array object, but it hasn't been defined yet.

D. There's an array of strings, and we're trying to get the string keys out of the array, but it doesn't exist.

The answer is letter B because there is this means that we are missing a method named keys.

@Thatgirlcancode16
Copy link
Author

3/14/16: Typing Practice: J Query

screen shot 2016-03-14 at 5 17 19 pm

@Thatgirlcancode16
Copy link
Author

3/14/16: Launch School: Files Exercises:

One:
screen shot 2016-03-15 at 7 32 57 pm

Two:
screen shot 2016-03-15 at 7 35 10 pm

screen shot 2016-03-15 at 7 36 33 pm

Another exercise that has me working with CSV and JSON/ XML. When I tried completing the exercise, I received this error message so I stopped.

screen shot 2016-03-15 at 7 49 31 pm

I tried again and talked with my husband, who told me that I needed to install the brew wget. I installed the wget package from brew and everything ran fine. The files were so large that I only took one screen shot of me requiring the files.

screen shot 2016-03-15 at 11 03 07 pm

@Thatgirlcancode16
Copy link
Author

3/15/16: Typing Practice: Ruby on Rails

screen shot 2016-03-15 at 7 53 08 pm

@adamcaron
Copy link

Nice work on the Haskell typing practice! I haven't done that one yet (but probably should!)

3/6/16: Launch School: Methods Exercises:

Looks like you're feeling comfortable with methods and passing arguments (the 'greeting', 'multiply' and 'scream' methods).

You're correct about the wrong number of arguments error. In Ruby, if a method expects a certain number of arguments and when the method is called without those args (and if there aren't default argument values) it spits out that error.

3/6/16: Launch School: Language Comparisons and Conditionals

false != !true You're right that != is a comparison operator. != asks, "Is it true that the first thing does NOT equal the second thing?" In this case, the first thing is false and the second thing is !true which is false therefor both the first thing and the second thing are false, which means our question ("Is it true that the first thing does NOT equal the second thing?") is false because the two ARE equal.

Note that with true == 4 true is not a 'string' type: it's a 'boolean' type.

Nice work on all these booleans comparisons! They can get tricky (but it's sort of fun, too!)


Fantastic work with the iterators (each and each_with_index), while loops, and recursion.


3/8/16: Array Exercises: Tricky stuff going on here but looks like you're understanding it nicely!

"Three: How do you print the word "example" from the following array?"
... Nice job! Note that in addition to arr.last.first one can also call the array elements specifically with arr[1][0].

"Seven: Write a program that iterates over an array and builds a new array that is the result of incrementing each value in the original array by a value of 2. You should have two arrays at the end of this program, The original array and the new array you've created. Print both arrays to the screen using the p method instead of puts."
... Great! In the future, you'll learn to use .map instead, which allows you to do

arr = [1,2,3,4,5]
new_arr = arr.map do |n|
  n + 2
end

p new_arr
 => [3,4,5,6,7]

We can talk more about this another time.


Nice work with hashes.

You're doing spectacular. Let me know if you'd like to pair on anything or if you have any questions at all. Good work, Denali!

@Thatgirlcancode16
Copy link
Author

3/18/16: Typing Practice: JavaScript:

screen shot 2016-03-18 at 8 15 29 am

@Thatgirlcancode16
Copy link
Author

3/18/16: Task G: Task G (final task)- Pre-work Reflection:

Were you able to get through the work? Did you rush to finish, or take your time?
I was able to get through Week 1 and then moved on to Priority 2 (Launch School) work. I did have to rush at times. I wish that we could have received notification of the required pre-work earlier to allow more time for completion and understanding. Since changing my start date for Turing to March, I booked a trip back to Atlanta to spend time with family that I haven't seen since last May. I did not have much time to work no the assignments during my trip and thus had to really push through the material before my trip.

What are you most looking forward to learning more about?
I am looking forward to everything- meeting everyone, reviewing concepts discussed in the pre-work and learning other languages.
What topics would you most like to see reinforced by instructors?
Here is a short list of things that I believe I need to continue to work on or that I did not have time to adequate prepare for:
Methods
Conditionals
Arrays (especially conditionals in arrays)
Hashes
File types
Did not have a lot of time to review Git. Need to discuss this.
What is most confusing to you about what you've learned?
Files is confusing. Hashes from the Launch School was confusing for me. Conditionals in arrays is also confusing for me.
What questions do you have for your student mentor or for your instructors?
I need to review my comments from my posts to look at very specific questions. In general, I would like review on material from conditionals, arrays, hashes, and files.

Thank you!

@adamcaron
Copy link

Hi Denali.

Great feedback! I appreciate it.

Firstly, congratulate yourself. You've truly set yourself up for success over the next 7 months. It may not seem so but the work you've submitted shows understanding and growth, and I believe it will pay huge dividends as your education unfolds. I am excited for you.

School has started so you will of course be busy. If you'd like, we can pair for fun on conditionals, arrays, hashes, and files. We can also pair on Git, which is really fun although you will have classes dedicated to teaching you and your classmates how to use git and over the coming months it will become second nature for you. Again, if you'd like to pair for half an hour (or more) one week, send a message on slack and, again, smile and give yourself a huge pat on the back. You rocked this pre-work!

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