Skip to content

Instantly share code, notes, and snippets.

@ckaminer
Forked from mbburch/prework.md
Last active March 21, 2016 04:36
Show Gist options
  • Save ckaminer/09aee86681a0783cd0e8 to your computer and use it in GitHub Desktop.
Save ckaminer/09aee86681a0783cd0e8 to your computer and use it in GitHub Desktop.
Charles Kaminer Turing pre-work Gist

Turing School Prework - Charles Kaminer

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?
    • Nope, the downloads and video tutorial covered any and all my questions.
  • 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?
    • 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

Day One Questions:

  • What does pwd stand for, and how is this command helpful?

    pwd stands for print working directory and is helpful in determining which file you are currenty working in.

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

    hostname tells you the name of your computer. In my terminal I see "Charless-Macbook-Pro.local".

Task F- Learn Ruby:

Option 1 Questions:

IRB

  • How do you start and stop irb?
    • you start using irb by entering irb into the command line and stop by typing exit
  • What might you use irb for?
    • irb might be used to experiment with short, unfamiliar language features. It should not be used to write long programs.

Variables

  • How do you create a variable?
    • a variable is created with a single = after the name of the variable.
  • What did you learn about the rules for naming variables?
    • variable names cannot lead with a number and cannot use dashes
  • How do you change the value of a variable?
    • you can change the value of a variable by re-defining it, the same way you created it in the first place. If the name is the same, it will overwrite what was originally there.

Datatypes

  • How can you find out the class of a variable?
    • to find out the class of a variable type the variable followed by .class
  • What are two string methods?
    • Two string methods are :delete and :center
  • How can you change an integer to a string?
    • to change an integer to a string, type the number followed by .to_s

Strings

  • Why might you use double quotes instead of single quotes in Ruby?
    • double quotes enables you to use string interpolation
  • What is this used for in Ruby: #{}?
    • #{} is used for string interpolation. You can embed a ruby statement in a string when it is entered in the curly brackets.
  • How would you remove all the vowels from a string?
    • "string".delete('aeiou')

Input & Output

  • What do 'print' and 'puts' do in Ruby?
    • 'print' and 'puts' are both ways of returning information to the user. Puts has the return value Nil and creates a new line. Print does not create a new line.
  • What does 'gets' do in Ruby?
  • 'gets' pauses your program to wait for the user to enter a requested value followed by the enter key.
  • 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 do not have any decimals and floats do have decimals.
  • 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
    • =

      • greater than or equal to
    • <=
      • less than or equal to
    • !=
      • not equal to
    • &&
      • and
    • ||
      • or
  • What are two Ruby methods that return booleans?
    • .end_with?('') and .include?()

Conditionals

  • What is flow control?
    • Flow control is the concept of having your program make decisions for you. You can selectively run parts of your code based on inputs.
  • 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 happens when your loop body does not doesn't do anything to make the while condition false. The loops runs for ever. You can get out of a loop 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 datatype that means "nothing". A variable either hasn't been assigned anything or a function did not return 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 can be beneficial in Ruby because they do not use any extra memory when they are called on. This can save time in larger programs
  • Does naming symbols use the same rules for naming variables?
    • Yes
  • 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.length
  • What is the index of pizza in this array: ["pizza", "ice cream", "cauliflower"]?
    • 0
  • What do 'push' and 'pop' do?
    • 'push' allows you to add an element into an exisiting array. Pop removes and returns the last element from the array.

Hashes

  • Describe some differences between arrays and hashes.
    • Order matters when using an array. Elements can be called on by their index. In hashes information is stored using a key and a value, order does not matter. You can use a key to call a value and vice versa.
  • What is a case when you might prefer an array? What is a case when you might prefer a hash?
    • An array might be prefered when entering the results of a race. You could use the index capabilities to call on whoever came in first, second, third, etc. A hash could be useful when entering everyone at Turing's name and birthday. The order would not matter but we could look up someone's birthday using their name.
    • 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 was able to get through the week long prework as that is the time I had between ending my job and starting school. I was able to take my time and wrap everything up at a comfortable pace.
  • What are you most looking forward to learning more about?
    • I'm most looking forward to learning more about conditionals and hashes. I feel they are both very popwerful tools that could do a lot when used together. I also couldn't help but to notice how many different methods there are and am looking forward to exploring those.
  • What topics would you most like to see reinforced by instructors?
    • I think hashes seem to be the most complex and could require the most time to become good at. One thing I don't think was touched upon during the prework was trouble shooting which I think is something that would be helpful to go over.
  • What is most confusing to you about what you've learned?
    • I'm still having a little bit of a hard time wrapping my brain around how everything works together in terms of applications, methods, etc.
  • What questions do you have for your student mentor or for your instructors?
    • I don't have any at the moment but am sure I will have many once class gets going. I think the prework was a great introduction into Ruby and was not too intimidating for someone like myself who had no prior experience.

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

Task E, rmdir - Screenshot

task e rmdir

@ckaminer
Copy link
Author

Task E, pushd popd - Screenshot

task e pushd popd

@ckaminer
Copy link
Author

Task F, Option 2 - Completed "Try Ruby"

try ruby complete

@ckaminer
Copy link
Author

Task A, typing lesson 5 - Screenshot

typing lesson 5 screenshot

@ckaminer
Copy link
Author

Task A, typing lesson 6 - screenshot

typing lesson 6 screenshot

@ckaminer
Copy link
Author

Task A, typing lesson 7 - screenshot

typing lesson 7 screenshot

@ckaminer
Copy link
Author

Task A, typing lesson 8 - screenshot

typing lesson 8 screenshot

@ckaminer
Copy link
Author

Task A, typing lesson 9 - screenshot

typing lesson 9 screenshot

@ckaminer
Copy link
Author

Task A, typing lesson 10 - screenshot

typing lesson 10 screenshot

@ckaminer
Copy link
Author

Task A, typing lesson 11 - screenshot

typing lesson 11 screenshot

@ckaminer
Copy link
Author

Task A, typing lesson 12 - screenshot

typing lesson 12 screenshot

@ckaminer
Copy link
Author

Task A, typing lesson 13 - screenshot

typing lesson 13 screenshot

@ckaminer
Copy link
Author

Task E, touch - screenshot

task e touch

@ckaminer
Copy link
Author

Task E, cp - Screenshot

task e cp

@ckaminer
Copy link
Author

Task E, mv - Screenshot

task e mv

@ckaminer
Copy link
Author

Task E, less - Screenshot

task e less

@ckaminer
Copy link
Author

Task E, cat - Screenshot

task e cat

@ckaminer
Copy link
Author

Task E, rm - Screenshot

task e rm

@ckaminer
Copy link
Author

Task F, I/O
input_output

@ckaminer
Copy link
Author

Task F, Numbers

numbers

@ckaminer
Copy link
Author

Task F, conditionals

conditionals

conditionals results

@ckaminer
Copy link
Author

Task F, nil

nil

@ckaminer
Copy link
Author

Task F, symbols

symbols

@ckaminer
Copy link
Author

Task F, Hashes

hashes

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