- screenshots of scores will be posted in comments
- screenshots of completed sections will be posted in comments
- Did you run into any issues? Not many. When running 'rvm requirements' in the terminal, I got an error that indicated there was 'no executable openssl' and that 'requirements installation failed with status: 12'. I googled it, tried a few things, found a solution on stackexchange. I ran 'brew install openssl --force' and that seems to have worked.
- How do you open VS Code from your Terminal? 'code .'
- What is the file extension for a Ruby file? .rb
- What is the VS Code shortcut for hiding/ showing your file tree view? ⌘b
- What is the VS Code shortcut for quickly finding a file (fuzzy finder)? Fuzzy Finder might be a specific function in Atom. ⌘p seems to function closest to this description in VS Code.
- 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 it is useful because it allows the user to orient themselves in the terminal.
- What does hostname tell you, and what shows up in YOUR terminal when you type hostname? 'hostname' displays the name of the computer and its domain. The hostname command on my computer returns 'Charlies-MacBook-Air.local'
IRB
- How do you start and stop irb? Type 'irb' in command line to start. Type 'exit' or control-C or control-D to stop.
- What might you use irb for? irb is useful for testing small snippets or experimenting with features.
Variables
- How do you create a variable? Variables are assigned by declaring the variable name, followed by '=', followed by whatever value the variable is to hold.
- What did you learn about the rules for naming variables? Variables cannot begin with numbers, cannot contain only numbers, cannot contain dashes, and cannot be in quotation marks.
- How do you change the value of a variable? Type the name of the variable, followed by '=', followed by the new value.
Datatypes
- How can you find out the class of a variable? Type '.class' after the variable name.
- What are two string methods? Upcase and downcase.
- How can you change an integer to a string? integer.to_s
Strings
- Why might you use double quotes instead of single quotes in Ruby? Single quotes do not support interpolation.
- What is this used for in Ruby: #{}? Interpolation
- How would you remove all the vowels from a string? "String".delete(aeiou)
Input & Output
- What do 'print' and 'puts' do in Ruby? 'print' displays text and returns 'nil.' 'puts' does the same thing but starts on a new line.
- What does 'gets' do in Ruby? 'gets' prompts the user for a string input.
- 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 whole numbers. Floats contain a 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?
- == 'is equal to'
-
= 'is greater than or equal to'
- <= 'is less than or equal to'
- != 'is the opposite of equal to'/'is not equal to'
- && 'and'
- || 'or'
- What are two Ruby methods that return booleans? '.include?()' and '.end_with?()'
Conditionals
- What is flow control? Flow control is when a program makes decisions and executes code based on certain conditions.
- 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 loop that continually executes forever without ending/breaking.
- 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 value that hasn't been assigned.
- 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 a more efficient use of memory.
- Does naming symbols use the same rules for naming variables? Seems to.
- 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 adds an element on to the end of an array. .pop removes and returns the last element of an array.
Hashes
- Describe some differences between arrays and hashes. Elements in arrays are accessed through their index. Elements in hashes are accessed through their keys. Elements in hashes contain keys and values. Elements in arrays contain only values.
- What is a case when you might prefer an array? What is a case when you might prefer a hash? Since arrays contain lists of things and hashes contain lists of things and their properties, I imagine hashes are more useful when one wants to associate properties with a list of items, for instance, one might use a hash to list customer information (first name, last name, phone number, etc). Array might be useful to store something where knowing the index of an item is useful, maybe a list of names that one might want to sort?
-
- Take a screenshot of your terminal after working through Step 2, and post it in the comments with the title, "Hashes".
- 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?
(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.)
- Loops: Take a screenshot of your "Challenge" program, and post it as a comment in your Gist. DONE
- What challenges did you try for "Summary: Basics"? Post a screenshot of one of your programs. I completed all challenges.
- Functions: How do you call a function and store the result in a variable? variable_name = function_name(argument)
- Describe the purpose of the following in Ruby classes: initialize method, new method, instance variables. Initialize method is a special method which accepts and saves initial data needed to create an instance of an object. New method creates a new instance of an object. Instance variables start with '@' and are only visable inside a specific instance of an object.
- 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.
- screenshots will be posted in comments
- What are your three biggest takeaways from working through this book?
- 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?
- 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?
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"?
Task F - "Hashes"