Skip to content

Instantly share code, notes, and snippets.

@wlffann
Forked from mbburch/prework.md
Last active September 17, 2016 03:17
Show Gist options
  • Save wlffann/93258dc419930c2d6105337cf2b91b9f to your computer and use it in GitHub Desktop.
Save wlffann/93258dc419930c2d6105337cf2b91b9f to your computer and use it in GitHub Desktop.
My pre-work Gist -- Annie Wolff

Turing School Prework - Annie

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? My updates went smoothly!
  • How do you open VS Code from your Terminal? code
  • What is the file extension for a Ruby file? .rb
  • What is the Atom shortcut for hiding/ showing your file tree view? Shift+Cmd+E
  • What is the Atom shortcut for quickly finding a file (fuzzy finder)? Cmd+F

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? It stands for "print working directory" and shows you where you are in the file structure. Helpful for determining your location and how to navagate to the file you need.
  • What does hostname tell you, and what shows up in YOUR terminal when you type hostname? hostnames identify your computer or server. hostname: anniewolff$

Task F- Learn Ruby:

Option 1 Questions:

IRB

  • How do you start and stop irb? type "irb" into the terminal to open and "exit" to close
  • What might you use irb for? irb is good for running simple programs and testing ruby code

Variables

  • How do you create a variable? some_variable = "Some value"
  • What did you learn about the rules for naming variables? Variables can be named by combinations of letters and numbers, as long as the number does not begin the name. Additionally, variables cannot have only numbers in their name.
  • How do you change the value of a variable? To reassign the value of a variable, simply type the name of the variable and pass it a different value. some_variable = 5 some_variable = 10

Datatypes

  • How can you find out the class of a variable? Some_value.class
  • What are two string methods? .upcase, .reverse
  • How can you change an integer to a string? 5.to_s

Strings

  • Why might you use double quotes instead of single quotes in Ruby? Using double quotes on a string allows for interpolation.
  • What is this used for in Ruby: #{}? String interpolation name = 'Annie' "Hello #{Annie}"
  • How would you remove all the vowels from a string? 'Any sentence'.downcase.delete('aeiou')

Input & Output

  • What do 'print' and 'puts' do in Ruby? They return a string that has been input. puts starts a new line while print does not
  • What does 'gets' do in Ruby? "Get String". It asks the user to input a string which is returned to the program.
  • 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 round numbers, while floats have decimal points.
  • 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?
    • == equal to
    • = greater than or equal to

    • <= less than or equal to
    • != not equal to
    • && and
    • || or
  • What are two Ruby methods that return booleans? .include?, .empty?

Conditionals

  • What is flow control? A way for a program to selectively execute code based on values that it has been passed.
  • 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 loop is a conditional that never returns false that can crash your program. To get out, press cmd+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 the absence of a value.
  • 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 use less memory so allow ruby to run a program more quickly
  • Does naming symbols use the same rules for naming variables? Yes, but they begin with :
  • 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 will add a value to the end of an array, .pop will remove the last value.

Hashes

  • Describe some differences between arrays and hashes. Arrays are a collection of indexed values, while the values in hashes are accessed by keys.

  • What is a case when you might prefer an array? What is a case when you might prefer a hash? Hashes are good for storing the attributes of an object, while arrays are good at ordered lists

    • 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 made it through the work without too much trouble, and never felt like i needed to rush to get it all done. I did let myself fall a little behind, but catching up wasn't too hard.
  • What are you most looking forward to learning more about?
  • I'm looking forward to building more complex programs with ruby!
  • What topics would you most like to see reinforced by instructors?
  • Building functions and multiple uses for classes. I'm interested in taking real-world situations and building progams to solve them!
  • What is most confusing to you about what you've learned?
  • Loops trip me up, but I think more practice will help.
  • What questions do you have for your student mentor or for your instructors?
  • What was the most helpful preparation that you took when beginning to learn programming?

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?
  • Functions are called by beginning with 'def' and closing with 'end'. To store the result as a variable define a variable and then pass it the value of a function.
  • Describe the purpose of the following in Ruby classes: initialize method, new method, instance variables.
  • initialize tells ruby the values it should store when a new instance of a class is created wby using the new method. instance variable begin with the @ sign and are variables that are only accessable from inside a instance of the class.
  • 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"?
@wlffann
Copy link
Author

wlffann commented Sep 2, 2016

image

@wlffann
Copy link
Author

wlffann commented Sep 2, 2016

image

@wlffann
Copy link
Author

wlffann commented Sep 2, 2016

I forgot to post as I did these quizzes, so here's an update!
image

@wlffann
Copy link
Author

wlffann commented Sep 6, 2016

Actually happy with this score!
image

@susiirwin
Copy link

These are great!!!! i STILL do the typing exercises ;)

@wlffann
Copy link
Author

wlffann commented Sep 7, 2016

Yeah! I feel my success on the typing exercises is a good gauge of how focused my day is going to be haha.
i o copy

@susiirwin
Copy link

hahaha i know what you mean about the typing exercises. lol. when i was in 5th grade i cheated in my computer typing class (honestly the ONLY thing i have ever cheated on in my life) and i still regret it to this day!

@wlffann
Copy link
Author

wlffann commented Sep 8, 2016

Numbers
numbers_challenge

@wlffann
Copy link
Author

wlffann commented Sep 8, 2016

Conditional
conditional_challenge

@wlffann
Copy link
Author

wlffann commented Sep 8, 2016

I was just about to comment on how I've studied most of this before and felt like I was breezing through it when I got to the conditionals. I spent a little longer that I should have needed to messing around with this simple program. At least I'm relearning it! >_<

@wlffann
Copy link
Author

wlffann commented Sep 8, 2016

Nil
nil

@wlffann
Copy link
Author

wlffann commented Sep 8, 2016

image

@susiirwin
Copy link

Have you done Ruby before? Or another language? It looks like you are going nice and strong with these!!

@wlffann
Copy link
Author

wlffann commented Sep 11, 2016

I have actually! I took a Girl, Develop It course on Ruby so it all feels pretty familiar. We got through most of these basic concepts, but I haven't experimented much with the language beyond that.

@wlffann
Copy link
Author

wlffann commented Sep 11, 2016

Symbols
symbols

@wlffann
Copy link
Author

wlffann commented Sep 12, 2016

Hashes
hashes

@wlffann
Copy link
Author

wlffann commented Sep 13, 2016

Loops
loops

@wlffann
Copy link
Author

wlffann commented Sep 13, 2016

Basics Review Challenge!
basics_challenge

@wlffann
Copy link
Author

wlffann commented Sep 13, 2016

Lol
methods_or_functions

@susiirwin
Copy link

wnat to know something funny??? i had the SAME reaction to that piece of the reading! LOL. I can't remember if I posted it my prework gist or just sent it to my prework guide LOL. i thought it was hysterical!!!!

@susiirwin
Copy link

How are you liking Visual Code? We have been using Atom and they are switching to VC with your cohort. I have it downloaded and installed, but I haven't used it yet. Since i have been all Microsoft for basically my whole life (haha) i have been avoiding it ;) Your pre-work looks great!!!! You are just chugging along!!

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