Skip to content

Instantly share code, notes, and snippets.

@Laszlo-JFLMTCO
Forked from mbburch/prework.md
Last active September 19, 2016 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Laszlo-JFLMTCO/fcda996e7c72e00aafe6dd0b3583b779 to your computer and use it in GitHub Desktop.
Save Laszlo-JFLMTCO/fcda996e7c72e00aafe6dd0b3583b779 to your computer and use it in GitHub Desktop.
Laszlo's Turing prework gist

Turing School Prework - Laszlo Balogh

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

Task A- Practice Typing update:
screenhunter_94 aug 27 14 14
screenhunter_93 aug 27 14 13

@Laszlo-JFLMTCO
Copy link
Author

Task A- Practice Typing update:
screenhunter_96 aug 27 14 20
screenhunter_95 aug 27 14 20

@Laszlo-JFLMTCO
Copy link
Author

Task A- Practice Typing update:
screenhunter_98 aug 27 14 25
screenhunter_97 aug 27 14 25

@Laszlo-JFLMTCO
Copy link
Author

Task A- Practice Typing update:
screenhunter_100 aug 27 14 29
screenhunter_99 aug 27 14 28

@Laszlo-JFLMTCO
Copy link
Author

**Task A- Practice Typing update:
screenhunter_102 aug 27 14 32
screenhunter_101 aug 27 14 32

@Laszlo-JFLMTCO
Copy link
Author

Task B- Algorithmic Thinking & Logic update:
screenhunter_103 aug 27 14 43

@Laszlo-JFLMTCO
Copy link
Author

Task B- Algorithmic Thinking & Logic update:
screenhunter_112 aug 28 08 16

@Laszlo-JFLMTCO
Copy link
Author

Task B- Algorithmic Thinking & Logic update:
screenhunter_113 aug 28 08 26

@Laszlo-JFLMTCO
Copy link
Author

Task B- Algorithmic Thinking & Logic update:
screenhunter_114 aug 28 08 35

@Laszlo-JFLMTCO
Copy link
Author

Laszlo-JFLMTCO commented Aug 28, 2016

Task D- Set up your Environment:

  • Did you run into any issues?
    • No. Followed the instructions for Windows environment. Setting up Cloud 9 free account did require a credit card.
  • How do you open Atom from your Terminal?
    • Based on the terminal intro video it would be "atom.", but I use a Windows machine with Atom editor installed as a desktop application. I couldn't find a way to launch Atom editor from the Cloud9 terminal. Cloud9 is using its own Ace editor. Screenshot from Cloud9 when trying to launch Atom editor based on the termminal intro video:
      screenhunter_115 aug 28 08 49
  • What is the file extension for a Ruby file?
    • The file extension is .rb
  • What is the Atom shortcut for hiding/ showing your file tree view?
    • On a Windows machine pressing "CTRL + " will toggle File Tree View On/Off
  • What is the Atom shortcut for quickly finding a file (fuzzy finder)?
    • On a Windows machine pressing "CTRL + P" will toggle File Search textbox On/Off

@Laszlo-JFLMTCO
Copy link
Author

Day Two: Task E- Read AND do these command line exercises in your terminal

  • Make A Directory (mkdir)
  • Change Directory (cd)
  • List Directory (ls)
    screenhunter_126 sep 01 22 49
    screenhunter_127 sep 01 22 49

@Laszlo-JFLMTCO
Copy link
Author

Day Two: Task F- Choose your Ruby adventure! Option 1:
First baby step... :-)
screenhunter_129 sep 02 00 06

@Laszlo-JFLMTCO
Copy link
Author

Day Three: Task E- Read AND do these command line exercises in your terminal

  • Remove Directory (rmdir)
    screenhunter_130 sep 07 19 44

@Laszlo-JFLMTCO
Copy link
Author

Laszlo-JFLMTCO commented Sep 8, 2016

Task F- Learn Ruby

IRB

  • How do you start and stop irb?
    • screenhunter_131 sep 07 20 16
  • What might you use irb for?
    • To test out Ruby features

Variables

  • How do you create a variable?
    • screenhunter_132 sep 07 20 20
  • What did you learn about the rules for naming variables?
    • That there are some rules when comes to naming variables, such as:
      • Cannot start with a number
      • Cannot have only numbers
      • Cannot include a '-'
  • How do you change the value of a variable?
    • Assigning with a single equal sign => '='
      • screenhunter_133 sep 07 20 25

@Laszlo-JFLMTCO
Copy link
Author

Laszlo-JFLMTCO commented Sep 8, 2016

Task F- Learn Ruby

Datatypes

  • How can you find out the class of a variable?
    • adding '.class' after the variable name
    • screenhunter_133 sep 07 20 25
  • What are two string methods?
    • '.length' => to determine how many characters a string has
    • '.upcase' => converts the string content to upper case letters
    • screenhunter_135 sep 07 20 44
  • How can you change an integer to a string?
    • Adding the '.to_s' method after the variable name
    • screenhunter_136 sep 07 20 48

@Laszlo-JFLMTCO
Copy link
Author

Laszlo-JFLMTCO commented Sep 19, 2016

Task F- Learn Ruby

Strings

  • Why might you use double quotes instead of single quotes in Ruby?
    • Double quotes would allow to apply interpolation => see next question.
    • screenhunter_141 sep 18 20 24
  • What is this used for in Ruby: #{}?
    • Syntax for interpolation: allows to embed a Ruby statement within a string. See screenshot attached for previous question.
  • How would you remove all the vowels from a string?
    • Using the '.delete' method with parameters of all the vowels both lower and upper case
    • screenhunter_143 sep 18 20 35

@Laszlo-JFLMTCO
Copy link
Author

Task F- Learn Ruby

Input & Output

  • What do 'print' and 'puts' do in Ruby?
    • Both are printing output from a Ruby program, but 'puts' adds a linebreak at the end while 'pring' does not.
    • screenhunter_144 sep 18 21 29
  • What does 'gets' do in Ruby?
    • Collects user input in a Ruby program. Pauses running the Ruby program and waits for user input closed by ENTER key. See "I/O" example...
  • Add a screenshot in the comments of the program you created that uses 'puts' and 'gets', and give it the title, "I/O".
    • See next comment titled "I/O" with screenshot

@Laszlo-JFLMTCO
Copy link
Author

Laszlo-JFLMTCO commented Sep 19, 2016

I/O

screenhunter_147 sep 18 21 47
screenhunter_145 sep 18 21 34

@Laszlo-JFLMTCO
Copy link
Author

Laszlo-JFLMTCO commented Sep 19, 2016

Task F- Learn Ruby

Numbers & Arithmetic

  • What is the difference between integers and floats?
    • Integers are whole numbers, while floats are decimal.
    • screenhunter_146 sep 18 21 46
  • Complete the challenge, and post a screenshot of your program in the comments with the title, "Numbers".
    • See next comment titled "Numbers"

@Laszlo-JFLMTCO
Copy link
Author

Numbers

screenhunter_148 sep 18 21 48
screenhunter_149 sep 18 21 51

@Laszlo-JFLMTCO
Copy link
Author

Task F- Learn Ruby

Booleans

  • What do each of the following symbols mean?
    • == evaluation that returns TRUE if the two values are the same
    • = evaluation that returns TRUE if the first value is greater than or equal to the second value

    • <= evaluation that returns TRUE if the first value is smaller than or equal to the second value
    • != evaluation that returns TRUE if the two values are not the same
    • && evaluation that returns TRUE if all values are TRUE
    • || evaluation that returns TRUE if at least one of the values is TRUE
  • What are two Ruby methods that return booleans?
    • In general methods end with '?'. Two examples: '.zero?' and 'include?'
    • screenhunter_150 sep 18 22 05

@Laszlo-JFLMTCO
Copy link
Author

Task F- Learn Ruby

Conditionals

  • What is flow control?

    • When adding evaluation points into our code which will allows us to execute only specific sections of our code based on the result of the evaluation.
  • What will the following code return?

    apple_count = 4
    
    if apple_count > 5
    puts "Lots of apples!"
    else
    puts 'Not many apples...'
    end
    
    • It will return "Not many apples..." in the program output
  • What is an infinite loop, and how can you get out of one?

    • Infinite loop is when the exit criteria of a while loop will never be TRUE, therefore the piece of code inside the loop is going to executed continuously without any end.
  • Take a screenshot of your program and terminal showing two different outputs, and post it in the comments with the title, "Conditionals".

    • See next comment titled "Conditionals"

@Laszlo-JFLMTCO
Copy link
Author

Laszlo-JFLMTCO commented Sep 19, 2016

Conditionals

screenhunter_151 sep 18 22 32
screenhunter_153 sep 18 22 57
screenhunter_154 sep 18 22 58

@Laszlo-JFLMTCO
Copy link
Author

Task F- Learn Ruby

nil

  • What is nil?
    • It is a special Ruby keyword, defining the value of any variable as "nothing".
  • Take a screenshot of your terminal after working through Step 4, and post it in the comments with the title, "nil".
    • See next comment with title "nil"

@Laszlo-JFLMTCO
Copy link
Author

Laszlo-JFLMTCO commented Sep 19, 2016

nil

screenhunter_155 sep 18 23 12

@Laszlo-JFLMTCO
Copy link
Author

Task F- Learn Ruby

Symbols

  • How can symbols be beneficial in Ruby?
    • With complex implementations, it helps to minimize memory allocation for the same constants.
  • Does naming symbols use the same rules for naming variables?
    • Yes it does. See below screenshot for examples...
    • screenhunter_158 sep 18 23 28
  • Take a screenshot of your terminal after working through Step 4, and post it in the comments with the title, "Symbols".
    • See screenshots under next comment titled "Symbols"

@Laszlo-JFLMTCO
Copy link
Author

Symbols

screenhunter_157 sep 18 23 27
screenhunter_158 sep 18 23 28
screenhunter_159 sep 18 23 29

@Laszlo-JFLMTCO
Copy link
Author

Laszlo-JFLMTCO commented Sep 19, 2016

Task F- Learn Ruby

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"]?
    • Array indexing starts with 0 (zero), therefore pizza will have index 0.
  • What do 'push' and 'pop' do?
    • Method '.push' adds a new element to the end of the array
    • Method '.pop' removes the last element of the array and returns that value at the same time
    • screenhunter_160 sep 18 23 55

@Laszlo-JFLMTCO
Copy link
Author

Task F- Learn Ruby

Hashes

  • Describe some differences between arrays and hashes.
    • Elements of an array are referenced by their index, while in hashes by their key
    • Content of an array is a sorted list of elements, each assigned an index number. The content of a hash is a list of pairs of key and value
  • What is a case when you might prefer an array? What is a case when you might prefer a hash?
    • Array is preferred, when an ordered list of elements is sufficient, for instance a list of products, items, properties, etc.
    • Hashes are preferred, when a multi dimensional array would be necessary to store multiple values for each element within an array, for instance a database of products, where each product has their unique properties
  • Take a screenshot of your terminal after working through Step 2, and post it in the comments with the title, "Hashes".
    • See next comment with title "Hashes"

@Laszlo-JFLMTCO
Copy link
Author

Hashes

screenhunter_161 sep 19 00 02
screenhunter_162 sep 19 00 11

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