Skip to content

Instantly share code, notes, and snippets.

@susiirwin
Forked from mbburch/prework.md
Last active June 23, 2016 15:57
Show Gist options
  • Save susiirwin/0c650408cc379962325d960091fdfca6 to your computer and use it in GitHub Desktop.
Save susiirwin/0c650408cc379962325d960091fdfca6 to your computer and use it in GitHub Desktop.
Susi Irwin Turing pre-work Gist

Turing School Prework - Susi Irwin

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

susiirwin commented May 18, 2016

Task A Typing - Day 1
irwin_typing_1

@susiirwin
Copy link
Author

susiirwin commented May 18, 2016

Task B - This is a screenshot showing three green dots - i passed each of the three sections for Computer Science Warmups.

computer science quizzes

@susiirwin
Copy link
Author

More Task A practice:
irwin_typing_2
irwin_typing_3

@susiirwin
Copy link
Author

Task B Challenge Levels 1 and 2:
level 1 challenge quiz comp science
level 2 challenge quiz comp science

@susiirwin
Copy link
Author

Task A continued - first thing in the morning and it shows ;)
irwin_typing_4

@susiirwin
Copy link
Author

Task A - more.
This was better!
irwin_typing_5

@susiirwin
Copy link
Author

Task E (in pieces) - I will be posting comments about this task as I accomplish them...

Did you run into any issues?

  • Just a little confusion being on a windows environment but Mark helped me out.

How do you open Atom from your Terminal?

  • in windows you can do start and type Atom, or open a Command Prompt and type Atom

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

@susiirwin
Copy link
Author

More Typing :)
irwin_typing_6

@susiirwin
Copy link
Author

typiing progress:
typing progress 5272016

@susiirwin
Copy link
Author

Task D - Environment

Did you run into any issues?
not really. there is some wierdness because my laptop is Windows and we will be using Macs during School. Atom installed just fine. Got my ic9 acount all set up.

How do you open Atom from your Terminal?
I can open up a command prompt in windows and type ATOM and hit enter and it opens.

What is the file extension for a Ruby file?
a Ruby file us a .rb extension

What is the Atom shortcut for hiding/ showing your file tree view?
on Windows it is CRTL + |

What is the Atom shortcut for quickly finding a file (fuzzy finder)?
on Windows it is ctrl +t or ctrl +p

Type the following commands into your Terminal to ensure you have Ruby, RVM, and Git installed. Take a screenshot that shows the versions of each of these, and post it as a comment in your Gist:

which ruby - on C9 the current version is:
ruby version

git --version
git version

rvm --version
rvm version

@susiirwin
Copy link
Author

susiirwin commented May 29, 2016

Task E- Start learning to use the command line.
Watched Lovisa's video. SUPER helpful.
Day One Questions:

What does pwd stand for, and how is this command helpful?
Present Working Directory
What does hostname tell you, and what shows up in YOUR terminal when you type hostname?
i used man hostname to get the linuz definition
It says: hostname - show or set the system's host name. it displays the system's DNS name. mine is qzsusi-turing-prework-3204535

Exercises from http://cli.learncodethehardway.org/

  • Introduction: Shut Up And Shell - -done
  • The Setup
    Here is a pic of my Flashcards from the Setup. I know almost all of the Windows commands so in order to prep for Turing, I made cards for the Mac OS/ LINUX commands to start learning those more solidly.

img_4220

Paths, Folders, Directories (pwd)

  • Do More (pwd 20+ times)

pwd 20x

What's Your Computer's Name? (hostname)

laptop name

  • Done more (hostname 20x)

hostname 20x

@susiirwin
Copy link
Author

susiirwin commented May 29, 2016

Task E day 2
Make a Directory. SO many folders ;)
make a directory

Change Directory:
change directory
Do More (had one goof!)
cd do more

List Directory (ls)
ls do this
Do More
dir -R
ls dir -r
Use cd to get to other directory and ls to look in it:
ls other directory

@susiirwin
Copy link
Author

susiirwin commented May 30, 2016

Days 2-7 Task F - Choose your own Ruby Adventure (Option 1)

What is Ruby?
Command Line
IRB
irb 1
Questions from template:
How do you start and stop irb?
Type IRB
Type Exit
What might you use irb for?
It is a great place for experimenting and testing out how Ruby works - but not for long code since you can't save anything to it.
Running Programs from a File
running programs from a file
Variables
Questions from Template:
How do you create a variable?
you create a variable by naming it, then typing = then assigning a value (my_variable = 20)
What did you learn about the rules for naming variables?

  • underscores are good, dashes are not
  • numbers are not good
    • no quotes around variable names
      How do you change the value of a variable?
      to change the value, you type the name of the variable you want to change, an = and a new value
      variables

Datatypes
How can you find out the class of a variable?
in irb, use the .class method
What are two string methods?
unicode_normalize and rpartition
How can you change an integer to a string?
in irb type, 5.to_s
you can then verify this by typing 5.to_s.class

datatypes

Strings
Why might you use double quotes instead of single quotes in Ruby?
you would use double quotes instead of single quotes when you use string interpolation.
What is this used for in Ruby: #{}?
string interpolation: it contains any valid ruby statement - it embeds a Ruby statement into another string
How would you remove all the vowels from a string?
the method is .delete('aeiou')

strings

Input & Output
What do 'print' and 'puts' do in Ruby?
puts "is a way of printing information to the user of your program"

  • basically this means we are showing our user some text on the screen
    prints does basically the same thing except that it does not add a new line after printing the text
    What does 'gets' do in Ruby?
    gets pauses the program and lets the user give an answer or provide input to your program and then hit the enter key. gets then takes that input and returns the value back to the program and moves on.

Add a screenshot in the comments of the program you created that uses 'puts' and 'gets', and give it the title, "I/O".
"I/O"
challenge
challenge_run

Numbers & Arithmetic
What is the difference between integers and floats?
integers are whole numbers and floats are decimals
Complete the challenge, and post a screenshot of your program in the comments with the title, "Numbers".
"Numbers"
calculator
calculator_run

Booleans
What do each of the following symbols mean?
== - equal to

= - greater than or equal to
<= - less than or equal to
!= - not equal to
&& - and
|| - or
What are two Ruby methods that return booleans?
methods that end with a question mark:
.end_with? and .include?
booleans

Conditionals

What is flow control?
it is when the program makes decisions for us - if/else/end, if/elsif/else/end
What will the following code return?
Not many apples...
What is an infinite loop, and how can you get out of one?
an infinite loop is a loop that has no stopping point - there is no logic in the code that completes the cycle so it repeats itself indefinitely.
You get out of it by typing CTRL+C on your keyboard
Take a screenshot of your program and terminal showing two different outputs, and post it in the comments with the title, "Conditionals".
"Conditionals"
conditionals_test2
conditionals_run2

nil

What is nil?
nil means "nothing" and is the same as null or None in other languages. it shows that value has not been assigned to a variable yet or that a vlue was not returned by a function.

Take a screenshot of your terminal after working through Step 4, and post it in the comments with the title, "nil".
"nil"
nil

Symbols

How can symbols be beneficial in Ruby?
they help Ruby use memory more efficiently by lettting Ruby varibales point to the same object in several places instead of making a new copy each time.
Does naming symbols use the same rules for naming variables?
No. Symbols always start with a colon (:) - that is not the case with variables. Symbols can have spaces if they are enclosed in "" or ''.

Take a screenshot of your terminal after working through Step 4, and post it in the comments with the title, "Symbols".
"Symbols"
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 an array
pop removes (and returns) the element at the end of the array

arrays

Hashes

Describe some differences between arrays and hashes.
arrays will store items in a list in a particular order and we can retrieve those items by the position in the order. Hashes allow us to retriev an item based on a key. hases use curly brackets, arrays use square brackets. Hashes use a "hashrocket" =>.

What is a case when you might prefer an array? What is a case when you might prefer a hash?
You might prefer hashes if you are creating a catalog of inventory, contact list, etc.... where you can have a thing and its associated properties (like a bike with its model, color, year, wheel size, etc...). An array might be a better option if you are just listing items with no extra information. You use an array to show tje values of a hash in an array as well.

  • Take a screenshot of your terminal after working through Step 2, and post it in the comments with the title, "Hashes".

"Hashes"
hashes

@susiirwin
Copy link
Author

More Typing
irwin_typing_5312016

Note - i have found that typing is easier on a laptop keyboard over the external keyboard. Could just be a weird thing, Who knows.

@susiirwin
Copy link
Author

Typing Practice
irwin_typing_632016

@susiirwin
Copy link
Author

Typing (11)
irwin_typing_11

@susiirwin
Copy link
Author

Typing (12)
Observation - i do better when the screen is directly in front of me rather than it off to the side.
irwin_typing_12

Typing (13)
irwin_typing_13

@susiirwin
Copy link
Author

Typing completed (round 1)
typing completed

@susiirwin
Copy link
Author

Day 3 Task E
Remove Directory
remove directory

Moving Around
moving around

@susiirwin
Copy link
Author

Day 4 Task E

Making Empty Files
making empty files

Copy a File
copy a file

Moving a File
moving a file

@susiirwin
Copy link
Author

Day 5 Task E
View A File (less, MORE)
less and more
NOTE: the hardest part of less and MORE was figuring out how to copy the file form the desktop to Temp. I googled the cp command and found how to get it to a folder on the same level as desktop. Hoping I did it correctly since the outcome seems to be the same.

Stream A File (cat)
stream a file

Removing A File (rm)
remove a file

@susiirwin
Copy link
Author

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 everything - however, i spread it out over a few weeks versus the one week schedule due to still being full time at work. I absolutely took my time, read everything, even did a few exercises multiple times if I didn't feel that I understood it on the first (or second) pass. Some exercises were easier than others but overall, all of this has been, and continues to be, incredible helpful.

What are you most looking forward to learning more about?
I am really, really looking forward to creating workable applications using Ruby. The examples are fun to work through, but I cannot wait to really get my hands dirty and write a program that does something. I am excited to see what Ruby can do.

What topics would you most like to see reinforced by instructors?
I definitely want to dig further into gems - I have a feeling those are going to be incredible useful. I also want to talk more about similarities between Ruby and other OOP languages, as well as differences.

What is most confusing to you about what you've learned?
So far just learning how to navigate the Terminal has been one of the more challenging parts. I am new to Mac/Apple as I have been a Windows user since i was PC person since I was 6 years old. I can get around pretty well in PowerShell and MS-DOS but I am still a bit new to Terminal.

What questions do you have for your student mentor or for your instructors?
My student mentor has been fantastic. Mark is always willing to answer my questions, listen to my worries and fears about the program, and encourage me. At this moment, I am not sure that I have any pressing questions for Mark or my Instructors. I am super anxious (in a very positive way) to get started, learn life with a Macbook instead of my Lenovo, and just give my all.

@susiirwin
Copy link
Author

susiirwin commented Jun 13, 2016

Railsbridge Curriculum, cont.

*Loops: *
Take a screenshot of your "Challenge" program, and post it as a comment in your Gist.
Challenge Screenshot:
loopschallengecode
loopschallengerun

What challenges did you try for "Summary: Basics"? Post a screenshot of one of your programs.
"Write a program that verifies whether someone can vote based on their supplied age."
voitingchallengecode
votingchallengerun

Functions:
How do you call a function and store the result in a variable?
You call a function by typing def then the name of the function and then a list of what you want to send in.

Describe the purpose of the following in Ruby classes:
initialize method - saves the initial data your object is created with and performs any other required set-up - basically, it gets things started for you with the initial data
new method - this creates an instance of the object. any arguments passed in to the new method are then sent to the initialize method
instance variables - stores data in the object and start with an @. in the example from the course, this was @radius. They are like regular variables except an instance variable only works within the instance of the object in which it was created.
.
How to Write a Program:
Screenhero with your student mentor and share your program. (will see if Mark has time soon)
Write a bit about what you found most challenging, and most enjoyable, in creating your program.
This one was a lot of fun and the prompts and explanations were super helpful. I like the patterns and how easy they are to follow once you see them. I don't understand the >> in the code and need to look that up to see what it means. the most challenging part was looking at the code and making it more efficient. Being super new to Ruby means my eyes are still not looking at all angles of the code for inefficiencies. The coolest part though is seeing it all come together and for most of it to make sense to me!

@susiirwin
Copy link
Author

susiirwin commented Jun 18, 2016

Launch School - As you complete the exercises for each section, take a screenshot of your terminal or text editor that shows your work, and post it as a comment to your Gist, listing the exercise topic as the comment heading.

Basics:
1.
basics 1
2.
basics 2
3.
basics 3
4.
basics 4
5.
basics 5
6.
basics 6
7. The message tells me that that ) was used instead of a } and therefore the code will not run; or it could be that there is an opening bracket but not a closing one.

@susiirwin
Copy link
Author

Variables
1.
screen shot 2016-06-20 at 8 50 36 pm
screen shot 2016-06-20 at 8 49 45 pm

screen shot 2016-06-20 at 8 56 25 pm

screen shot 2016-06-20 at 8 56 33 pm

screen shot 2016-06-20 at 9 00 15 pm

screen shot 2016-06-20 at 9 00 06 pm

screen shot 2016-06-20 at 9 05 07 pm

screen shot 2016-06-20 at 9 05 16 pm

1. In the first program, x will equal 3. The second example won't work because the variable is out of scope. 2. Tells us that "shoes" has not been defined or it is not in scope

@susiirwin
Copy link
Author

Launch: Methods
1.
screen shot 2016-06-21 at 3 46 17 pm
screen shot 2016-06-21 at 3 46 55 pm
1.
screen shot 2016-06-21 at 8 23 23 pm

screen shot 2016-06-21 at 8 32 53 pm

screen shot 2016-06-21 at 8 33 00 pm

1. It won't print anything because "Ruby methods ALWAYS return the evaluated result of the last line of the expression unless an explicit return comes before it" (copied from the Launch guide). 2.

screen shot 2016-06-21 at 8 45 10 pm

screen shot 2016-06-21 at 8 44 57 pm

3. This error is saying that the program was expecting a certain number of arguments given to it but it didn't receive the right amount.

@susiirwin
Copy link
Author

susiirwin commented Jun 22, 2016

Launch: Flow Control
1)

  1. false
  2. false
  3. fase
  4. true
  5. true

screen shot 2016-06-22 at 3 02 51 pm

screen shot 2016-06-22 at 3 02 59 pm

screen shot 2016-06-22 at 3 37 11 pm

screen shot 2016-06-22 at 3 37 01 pm

  1. FALSE
  2. Did you get it right?
  3. Alright Now!
  1. I am not really understanding Cases that well :( I typed out the solution so that i could practice typing and the syntax, but I am sort of confused on how Cases work.

  2. This error comes up because we are missing an end.

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