Skip to content

Instantly share code, notes, and snippets.

@cews7
Forked from mbburch/prework.md
Last active August 14, 2016 20:29
Show Gist options
  • Save cews7/1d05ef14d825a641a29f6c04b930bfda to your computer and use it in GitHub Desktop.
Save cews7/1d05ef14d825a641a29f6c04b930bfda to your computer and use it in GitHub Desktop.
:D

Turing School Prework- Eric Wahlgren-Sauro

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?

At one point my terminal froze. I restarted it and everything worked from there.

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

The command stands for Print Working Directory. This command lets you know where you are in the terminal.

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

The hostname is my computer's network name. This is mine: Erics-MacBook-Air.local

Task F- Learn Ruby:

Sections: (June 29 - IRB); (June 30 - Variables, Datatypes); (July 5 - Strings, Input & Output); (July 8 - Numbers & Arithmetic, Booleans); (July 11 - Conditionals, nil); (August 3 - Symbols); (August 4 - Arrays, Hashes)

Option 1 Questions:

IRB

  • How do you start and stop irb?

To start irb, type irb into the terminal. To stop it, type exit.

  • What might you use irb for?

You may want to use irb for trying out something in Ruby that you aren't used to doing. You'd never write full programs using irb -- that's what the text editor is for.

Variables

  • How do you create a variable?

To create a variable, use the command line and type out the variable's name -- (bear in mind the rules). Use an equals sign to assign a value to a variable (the value being on the righthand side).

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

The command line will reject syntax styles that resembles the following: 'first-name'; '101dalmations'; '101'

Counter to that, it will accept syntax styles that resembles the following: 'starwars2'; 'y2k'; 'last-name'; 'folders'; 'first_name'

The syntax for this langauge is a dream!

  • How do you change the value of a variable?

unless it's a const, it can be changed as needed. You change it by adjusting the value of the variable.

Datatypes

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

.class

  • What are some string methods?

.capitalize; .split; .size; .empty? -- methods can be daisy-chained.

  • How can you change an integer to a string?

.to_s

Strings

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

String interpolation is valid using double quotes -- letting us embed a ruby evaluation in another string. Single quotes works for assigning a variable to a string, as does double quotes. Double and single quotes can be used to concatenate strings.

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

This is used to do ruby evaluations inside a string. An evaluation could be adding numbers together or evaluating a variable that has an assigned string.

Example: curtemp = '72' "The current temperature outside is #{curtemp}"

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

'this is a sentence'.delete('aeiou')

Input & Output

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

Both commands will display results of code to the screen. Puts will add a new line to the end of the result, while print will not.

  • What does 'gets' do in Ruby?

In Ruby, 'gets' takes in user 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?

An integer is a whole number, while a float is has a decimal. A float takes additional memory compared to an integer.

  • 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?
    • == check to see if things are equal to each other
    • = greater than or equal to

    • <= less than or equal to
    • != not equal to
    • && both conditions must be met
    • || either condition must be met
  • What are two Ruby methods that return booleans?

.nil?; .empty?

Conditionals

  • What is flow control?

Flow control is the notion that the program makes decisions for us, based on the conditionals we've used.

  • What will the following code return?

The code below will 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 occurs when a while has no terminate condition. control-C is used to get out of infinite loops.

  • 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 to set a variable to nothing. It can also be used in methods so as to make the method return nothing.

  • 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 are beneficial for being efficient with memory. Every time a created symbol is used, the slice of memory that was initially put aside for said symbol is used.

  • Does naming symbols use the same rules for naming variables?

No, a symbol is a special object that doesn't use standard object conventions. When making a symbol it is created using just a ":" proceeding the name of the symbol. If you try to assign a value to the symbol it won't work.

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

index 0

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

'push' adds an element to the end of an array, while 'pop' removes the last element in an array.

Hashes

  • Describe some differences between arrays and hashes

We access elements in an array using an index number. With hashes, we use keys to access specific elements. Hashes have properties that have values assigned to them. It seems like hashes are really useful.

  • What is a case when you might prefer an array? What is a case when you might prefer a hash?

One might prefer an array if all one is trying to do is store a simple list of items. However, if the list has any complexity, using a hash may be optimal. For example, if we want to store types of soap an array would do just fine. If we want to store types of soap and have them paired based on each manufacturer then using hashes would be to our advantage.

  • 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 took a my time to complete the prework. I did on average about an hour of work at a time when I would sit at the computer. I spread the work out over several weeks.

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

I don't know enough yet to accurately assess my interests in the subject. I have room for improvement with the command line. I am coming into Turing knowing about basic constructs from having taken an intro to programming class in C++.

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

I'd find it helpful to continue drills on learning commands in the command line, along with getting more exposure to using the text editor. With that said, I assume with more practice it will all start to feel better.

  • What is most confusing to you about what you've learned?

None of what I've been exposed to thus far is confusing, it just takes time to learn -- there is a lot to learn.

  • What questions do you have for your student mentor or for your instructors?

Will we recieve devoted time for learning about how to use our text editor? I don't feel that comfortable with Atom yet.

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.

I completed all except for the last -- store each month in an array.

  • Functions: How do you call a function and store the result in a variable?

Declare the name of the function to call, along with all needed values. To store the result in a variable we make the content on the left-hand side of the equals sign the name of our variable, with the content on the right-hand side of the equals sign the function we want to assign our newly created variable to.

  • Describe the purpose of the following in Ruby classes: initialize method, new method, instance variables.

The new method allows us to make a new object for a given class. The initialize method is a method that happens whenever a new version of the class it's associated with gets made. Instance variables save the data for objects.

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

When I break it down line by line it's not hard understand, but just looking at it as a whole promotes confusion. I'm not totally clear on what "roll_array << roll_value" does. I found it enjoyable organizing the code, although I couldn't have done that on my own at this point. I also took pleasure in inching my way to fully understanding what each line is doing.

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?

"echo -n hello"

  • 1.4: What do Ctrl-A, Ctrl-E, and Ctrl-U do?

Ctrl-A: move cursor to beginning of line; Ctrl-E: move cursor to end of line; Ctrl-U: clear line

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

cews7 commented Jul 5, 2016

Task A - July 5

screen shot 2016-07-05 at 3 18 19 pm

@cews7
Copy link
Author

cews7 commented Jul 5, 2016

Task A - July 5
screen shot 2016-07-05 at 3 23 59 pm

@cews7
Copy link
Author

cews7 commented Jul 5, 2016

Task A - July 5
screen shot 2016-07-05 at 3 29 59 pm

@cews7
Copy link
Author

cews7 commented Jul 8, 2016

Task E (popd, pushd) - July 8

screen shot 2016-07-08 at 11 17 00 am

screen shot 2016-07-08 at 11 17 13 am

@cews7
Copy link
Author

cews7 commented Jul 9, 2016

Task F - (I/O) July 8

screen shot 2016-07-08 at 6 02 12 pm

@cews7
Copy link
Author

cews7 commented Jul 9, 2016

Task F - July 8 (Numbers)
screen shot 2016-07-08 at 6 49 20 pm

@cews7
Copy link
Author

cews7 commented Jul 9, 2016

Task A - July 8
screen shot 2016-07-08 at 7 28 31 pm

screen shot 2016-07-08 at 7 34 06 pm

@cews7
Copy link
Author

cews7 commented Jul 11, 2016

Task A - July 11
screen shot 2016-07-11 at 9 37 58 am

@cews7
Copy link
Author

cews7 commented Jul 11, 2016

Task B - July 11
screen shot 2016-07-11 at 9 49 43 am

@cews7
Copy link
Author

cews7 commented Jul 11, 2016

Task F - July 11 (Conditionals)
screen shot 2016-07-11 at 10 06 56 am

@cews7
Copy link
Author

cews7 commented Jul 11, 2016

Task A - July 11
screen shot 2016-07-11 at 10 57 15 am

@cews7
Copy link
Author

cews7 commented Jul 12, 2016

Task F - July 11 (nil)
screen shot 2016-07-11 at 9 12 26 pm

screen shot 2016-07-11 at 9 17 16 pm

@cews7
Copy link
Author

cews7 commented Jul 12, 2016

Task A - July 11
screen shot 2016-07-11 at 9 35 59 pm

@cews7
Copy link
Author

cews7 commented Jul 16, 2016

Task A - July 15
screen shot 2016-07-15 at 6 04 44 pm

@cews7
Copy link
Author

cews7 commented Jul 21, 2016

Task E - July 21 (mv)
screen shot 2016-07-21 at 1 42 24 pm
screen shot 2016-07-21 at 1 42 58 pm
screen shot 2016-07-21 at 1 43 16 pm

@cews7
Copy link
Author

cews7 commented Jul 21, 2016

Task E - July 21 (touch)
screen shot 2016-07-21 at 11 45 19 am

@cews7
Copy link
Author

cews7 commented Jul 21, 2016

Task E - July 21 (cp)
screen shot 2016-07-21 at 11 54 38 am

@cews7
Copy link
Author

cews7 commented Aug 3, 2016

Task F - August 3 (symbols)
screen shot 2016-08-03 at 11 24 20 am
screen shot 2016-08-03 at 11 24 38 am
screen shot 2016-08-03 at 11 24 52 am
screen shot 2016-08-03 at 11 26 18 am

@cews7
Copy link
Author

cews7 commented Aug 4, 2016

Task F - August 4 (Arrays)
screen shot 2016-08-04 at 1 42 15 pm

@cews7
Copy link
Author

cews7 commented Aug 4, 2016

Task F - August 4 (Hashes)
screen shot 2016-08-04 at 2 54 01 pm

@cews7
Copy link
Author

cews7 commented Aug 5, 2016

Task E - August 5 (less)
screen shot 2016-08-05 at 2 06 07 pm

screen shot 2016-08-05 at 2 06 20 pm

@cews7
Copy link
Author

cews7 commented Aug 5, 2016

Task E - August 5 (cat)
screen shot 2016-08-05 at 2 16 36 pm

@cews7
Copy link
Author

cews7 commented Aug 5, 2016

Task E - August 5 (rm)
screen shot 2016-08-05 at 2 24 08 pm

@cews7
Copy link
Author

cews7 commented Aug 6, 2016

Task F - August 6 (loops)
screen shot 2016-08-06 at 11 36 13 am

@cews7
Copy link
Author

cews7 commented Aug 11, 2016

August 11 - priority 1 (challenge program)
screen shot 2016-08-11 at 11 21 12 am

@cews7
Copy link
Author

cews7 commented Aug 12, 2016

August 12 - priority 2 (mkdir, rmdir)
screen shot 2016-08-12 at 12 39 02 pm

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