- screenshots of scores will be posted in comments
- screenshots of completed sections will be posted in comments
- Did you run into any issues? No, I ran into no issues the directions were fairly clear and easy to follow.
- How do you open Atom from your Terminal? After installing atom into my termainal I simply have to type in atom and the termainl will open it for me.
- 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
- 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/present working directory. It is helpful because when entered it will show you which directory (file) you are currently in.
- What does hostname tell you, and what shows up in YOUR terminal when you type hostname? A Hostname tells you the name of your computer. My hostname is "Janets-iMac.local" (I'm using my mother's computer currently)
IRB
- How do you start and stop irb? In the termianl type irb into the command line to start up ruby and to stop irb type quit into the command line.
- What might you use irb for? To run ruby based code.
Variables
- How do you create a variable? By declaring the variable, for example my_variable = 7.
- What did you learn about the rules for naming variables? variables can contain just about any combination of characters.
- How do you change the value of a variable? By redeclaring the variable in the command line, for example my my_varaible is currently 7 by typing my_variable = 9 in the command line it changes the value of the varaible to 9.
Datatypes
- How can you find out the class of a variable? by adding ".class" to the end, for example my_variable.class would return fixnum.
- What are two string methods? a string entered between either single quotes or double quotes.
- How can you change an integer to a string? by adding ".to_s" to the end, for exampe my_varaible.to_s would return "9"
Strings
- Why might you use double quotes instead of single quotes in Ruby? double quotes allow you to do string interpolation.
- What is this used for in Ruby: #{}? it does interpolation
- How would you remove all the vowels from a string? enter .delete('aeiou') at the end of the string
Input & Output
- What do 'print' and 'puts' do in Ruby? puts is a way of printing information and prints is like puts but it doesnt make a new line after printing.
- What does 'gets' do in Ruby? It pauses your program and waits for the user to type something and hit 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? An integer doesnt have a decimal point while a float does.
- 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?
- == we use this to check to see if things are equal
-
= greater then or ewual to
- <= less than or equal to
- != gives the opposite
- && AND means everything must be true
- || OR means atleast one must be true
- What are two Ruby methods that return booleans? && and || Conditionals
- What is flow control? Flow control is a concept used when we want the program to make decisions for us.
- What will the following code return? I got => nil
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? When a loop body doesn't do anything to make the while condition flase, the loop runs forever. To get out of it type 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 means "nothing" and is used to show that a varaible hasn't been assigned anything yet, or that a function didn't 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? They help Ruby use memory more effeciently.
- Does naming symbols use the same rules for naming variables? no, because symbols are constants so they can't be given values in the way the variables can
- 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 a new element to the end of the array and pop removes (and returns) the element at the end of the array.
Hashes
- Describe some differences between arrays and hashes. Hashes are much more detailed, they are used to store properties of the object where arrays are more so just a list of objects.
- What is a case when you might prefer an array? What is a case when you might prefer a hash? you would prefer arrays when you just need to list out objects/variables and you would prefer hashes when you are wanting to add a little more value or information to those objects/variables.
-
- 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? Overall I felt like I was able to move through all of this at a fairly steady pace. For a portion of it I remembered the topics from the Try Turing weekend and I feel like that definitely helped me when I got into the newer topics.
- What are you most looking forward to learning more about? I'm really excited to see how all of these different commands and concepts can come together in my code to create different types of programs and what different combinations of the commands can create!
- What topics would you most like to see reinforced by instructors? I would like to see a little more reenforcement with booleans and conditionals.
- What is most confusing to you about what you've learned? For me my main confusion just seems to be coming from keeping all the different commands and their functions seperate but with continued memorization that should start to alleviate itself.
- 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.
- 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.
- 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"?
![screen shot 2016-08-13 at 5 28 14 pm](https://cloud.githubusercontent.com/assets/18131669/17647170/eea8fb7a-61a3-11e6-8571-abd41e73ec82.png)
rmdir part 1![screen shot 2016-08-13 at 5 51 13 pm](https://cloud.githubusercontent.com/assets/18131669/17647172/fd94c222-61a3-11e6-84a6-a895d07e3ae5.png)
rmdir part 2![screen shot 2016-08-13 at 6 01 16 pm](https://cloud.githubusercontent.com/assets/18131669/17647175/0f740d40-61a4-11e6-8a3e-99449ec10956.png)
pushd popdI believe that is everything from the "learn code the hard way" (I need to get more organized with my screenshots ASAP, I have a feeling that I'm going to be taking a lot of them over the next few months)