Skip to content

Instantly share code, notes, and snippets.

@BethKnight1234
Forked from mbburch/prework.md
Last active November 28, 2016 19:02
Show Gist options
  • Save BethKnight1234/5ad52700ecf08bc772a2f773180cffd9 to your computer and use it in GitHub Desktop.
Save BethKnight1234/5ad52700ecf08bc772a2f773180cffd9 to your computer and use it in GitHub Desktop.
An example template for your Turing pre-work Gist

Turing School Prework-- Beth Knight

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:

Done and done.

Task D- Set up your Environment:

  • Did you run into any issues?

Nopers.

  • How do you open Atom from your Terminal?

atom .

  • What is the file extension for a Ruby file?

.rb

  • What is the Atom shortcut for hiding/ showing your file tree view?

⌃-0

  • What is the Atom shortcut for quickly finding a file (fuzzy finder)?

⌘-t

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 means print working directory. It's useful for showing where the current file you are in is located.

  • What does hostname tell you, and what shows up in YOUR terminal when you type hostname?

Hostname shows what device you're currently using. Mine shows Beths-MacBook-Pro-2.local.

Task F- Learn Ruby:

Option 1 Questions:

IRB

  • How do you start and stop irb?

To start irb you type irb.

To stop irb cmd-t, or close the terminal (but thats not recommended).

  • What might you use irb for?

Irb is used to test out ruby code, in real time.

Variables

  • How do you create a variable?

Global variables begin with the $ sign. Then you state the variable and assign it a value. As in $Pay = 10.00. for other types of variables, its @ instance variable @@ class variable

  • What did you learn about the rules for naming variables?

Use snake_case for symbols, methods and variables.

Use CamelCase for classes and modules.

  • How do you change the value of a variable?

You can assign it a new value. It's not a constant, so it can change.

Datatypes

  • How can you find out the class of a variable?

    string.class

    irb(main):001:0> var = "string" => "string" irb(main):002:0> var.class

  • What are two string methods?

    Turn it into a string "Hello from " + self.to_s #=> "Hello from main"

    To capitalize a string "hello".capitalize #=> "Hello"

  • How can you change an integer to a string?

    9.to_s "9"

Strings

  • Why might you use double quotes instead of single quotes in Ruby?

    Double quotes will allow you to use string interpolation or special symbols inside.

  • What is this used for in Ruby: #{}?

    That would be string interpolation, and it allows you to insert a value into a string.

    name = "Ned Stark" puts "Hello there, #{name}" #=> "Hello there, Ned Stark"

  • How would you remove all the vowels from a string?

    string= "This Is my sAmple tExt to removE vowels" string.delete 'aeiouAEIOU'

    Is that cheating?

Input & Output

  • What do 'print' and 'puts' do in Ruby?

    Prints info to the command line. It's the simpliest form of printing and does not add lines between statements.

print 1,2,3

123 => nil

Puts also prints info to the command line. It adds a new line between the output.

> puts 1,2,3
1
2
3
=> nil
  • What does 'gets' do in Ruby?

    When you add gets you are saying you want the user to input text so you can do something with it in your 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?

    An integer is a whole number, float takes it to the most accurate decimal point.

  • 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?

    • == Checks if the value of two operands are equal or not, if yes then condition becomes true.
    • = Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true.

    • <= Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true.
    • != Checks if the value of two operands are equal or not, if values are not equal then condition becomes true.
    • && And. Called Logical AND operator. If both the operands are non zero, then the condition becomes true.
    • || or. Called Logical OR Operator. If any of the two operands are non zero, then the condition becomes true.
  • What are two Ruby methods that return booleans?

Conditionals

  • What is flow control?

It's how ruby chooses a path through a program.

  • What will the following code return?
apple_count = 4

if apple_count > 5
  puts "Lots of apples!"
else
  puts 'Not many apples...'
end

'Not many apples...'

  • What is an infinite loop, and how can you get out of one?

    A loop is a sequence that keeps going until a certain condition is reached. An infinite loop does not have this exit, so it keeps going.

    While 1==1 # As the condition 1 is equal to 1 is true, it always runs. puts "foo"
    puts "bar"
    sleep 300 end

  • 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 absense 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 help Ruby use memory more efficiently.

Symbols. Tiny, efficiently reusable code words with a colon: :splendid

  • Does naming symbols use the same rules for naming variables? "symbols can have spaces if in quotes but it's a lot to type" :'single quotes work too'

  • 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?

    array.count

  • What is the index of pizza in this array: ["pizza", "ice cream", "cauliflower"]?

    2 ([0, 1, 2])

  • What do 'push' and 'pop' do?

Push add's elements to the end of an array

a = [ "a", "b", "c" ] a.push("d", "e", "f") #=> ["a", "b", "c", "d", "e", "f"]

Pop removes the last element(s) of an array.

a = [ "a", "b", "c", "d" ]
a.pop     #=> "d"
a.pop(2)  #=> ["b", "c"]
a         #=> ["a"]

Hashes

  • Describe some differences between arrays and hashes.

    Array is a list of objects that are ordered and use an integer index.

Hash is a collection of key-value pairs. It is not integer indexed, but rather it sorts by the keys.

  • 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?

Little bit every day.

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

Algorithms.

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

Testing!!

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

screen shot 2016-11-16 at 11 29 08 am

@BethKnight1234
Copy link
Author

Challenge numbers/arithmetic

screen shot 2016-11-16 at 11 44 36 am

@BethKnight1234
Copy link
Author

Conditionals

screen shot 2016-11-23 at 10 29 33 am

@BethKnight1234
Copy link
Author

Symbols

screen shot 2016-11-23 at 10 46 42 am

@BethKnight1234
Copy link
Author

Hashes

screen shot 2016-11-23 at 10 56 58 am

@BethKnight1234
Copy link
Author

EMPATHY

What role does empathy play in your life and how has it helped you?

Empathy allows me to understand other people while I maintain healthy boundaries. The most recent example of this was in the recent election. I was liberal living in a red state and it was difficult to have discussions that didn’t turn into screaming matches. But by having empathy and listening to other people’s viewpoints, we were able to see each other’s point of view. This didn’t mean we convinced one another to change our positions, but it turned a fight into a productive discussion.

How does empathy help you build better software?

Having empathy allows you to understand what people want and need, rather than your own needs. This allows you to design software with the user in mind. It also means you need to reach out to the people you’re building it for instead of making assumptions. As much as customer interviews suck, they’re a vital first step.

Why is empathy important for working on a team?

It allows me to work with other people in teams. By understanding your teammates point of view, it helps to find common ground so you don’t rip each other to shreds. See question ones concerning elections. It also allows me to step up and speak my own voice, knowing that failure is not something to be afraid of.

Describe a situation in which your ability to empathize with a colleague or teammate was helpful.

I was in a RailsBridge class as a TA and one of the students was having trouble understanding how her terminal works. I’ve been using a terminal for about 2 years, so my first inclination was to say, it’s “easy”. But I took a step back, remembered what it was like, and tried to teach her understanding her viewpoint. I brought out the visual file system and showed her how the two correlated.

When do you find it most difficult to be empathetic in professional settings? How can you improve your skills when faced with these scenarios?

When I receive feedback from my boss that you perceive as negative. My first reaction is to tear him down or feel terrible about myself. But if I have an idea of how he’s investing in me as an employee and has my best interest at heart, it reframes it and makes it easier for me to take it in and grow from it.

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