Skip to content

Instantly share code, notes, and snippets.

@JF-Lalonde
Forked from mbburch/prework.md
Last active May 1, 2017 04:11
Show Gist options
  • Save JF-Lalonde/5d8952f45df06395a31f8c7c37612990 to your computer and use it in GitHub Desktop.
Save JF-Lalonde/5d8952f45df06395a31f8c7c37612990 to your computer and use it in GitHub Desktop.
JF Lalonde's Prework

Turing School Prework - JF Lalonde

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?

 An issue I ran into was that I was working on the Week-long Prework page instead of doing the Week-long prework under the "prework-month" page. I was halfway into day two (and had been doing typing.io and brilliant excercises for about a week) when I received Mike's email talking about tasks (A, B, C, etc.). These were not specified in the Week-long Prework page, and I did not realize my gist had to follow a particular format, nor that I had to be taking screenshots of my progress. I have started following the tasks enumerated on the prework-month page, but that means going back and re-doing many exercises in order to grab screenshots of them. Another issue I ran into was when trying to open Atom from the command line. I was following the "Dev Environment Setup" page and as I made my way down I opened the "Terminal and Editor" page and started following that. When it asked to open the .bash_profile from the terminal I was unable to get Atom to boot up. I did a quick Google search that showed my I needed to setup Install Shell Commands, and the problem was fixed! Of course as soon as I went back to the "Dev Environment Setup" page and read the next step on the list it instructed me to do just that!

  • How do you open Atom from your Terminal?

    In order to open Atom, type Atom . in the command line.

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

    The shortcut is cmd-\

  • What is the Atom shortcut for quickly finding a file (fuzzy finder)?

    The shortcut is cmd-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?

    pwd stands for "Print Working Directory". It helps to navigate through the terminal by letting you know what directory you are currently in.

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

    hostname tells you the name of your computer. Mine shows up with JFs-MBP.local

  • What does ls do? What about cd and mkdir? (This question was in the week-long prework but I noticed it wasn't included here. In any case, I had already answered it so I figured I'd include it.)

    ls displays the current directory's files and directories. Cd allows you to change to a different directory, and mkdir allows you to create a new directory.

Day Two Questions:

  • What is the ruby command used to output something to the terminal?

    There are two commands to output in ruby. One is puts and the other is print

  • How is a ruby file run from the command line?

    To run a ruby file from the command, type ruby filename.rb

  • If a # is at the beginning of a ruby line in Atom, what does that indicate?

    It indicates a comment, and will not be interpreted when compiling.

  • What will "turing".length return

    It will return 6

Day Three Questions:

  • What is a pomodoro break?

    It is a type of productivity technique where a work is broken down into shorter intervals with the use of a timer. You rest in between timed sessions, in order to give your brain a break and result in more productive working intervals.

Day Four Questions:

  • What ruby command would we use to get: The “T” from “Turing”. .chars.first or [0] The length of “Turing”. .length Make the whole string capital letters. .upcase Delete the “n” from “Turing”. .delete('n') Assign “Turing” to a variable. variable = "Turing"

  • What does gets do? gets requires an input from the user

  • What is the difference between the input without the .chomp and the input with the .chomp? The input with the .chomp will remove separator characters at the end of a string

  • What does fav_num.to_i do? It converts the value (as best as it can) into an integer

  • What does animals.length return? 4

  • What does animals[0] return? dog

  • What does animals.empty? return? false

  • What are two different ruby commands that add to the animals ? .push("") or <<("")

  • What ruby command is used to remove the last element from the array? .pop

Day Seven Questions:

  • What do you feel most confident about? I feel comfortable with input/output
  • What do you feel least confident about? I feel unconfident about loops
  • What do you feel was most successful in your game? Getting level one done where it was ending the game when the proper number was reached.
  • What was the most challenging part about creating the game? Working with different kinds of loops.
  • When you reached a challenging part of the game, how did you move forward? I tried to think it through and do trial/error for a little bit, then I looked online for examples of ways to use loops.

Task F- Learn Ruby:

Option 1 Questions:

IRB

  • How do you start and stop irb?

    Open the terminal and type irb into the command line to start irb. To stop, type exit

  • What might you use irb for?

    You can use irb to experiment with ruby functions and see how certain commands work.

Variables

  • How do you create a variable?

    You create a variable by naming it, and making it equal to some value.

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

    A variable can contain a number within its name or at the end, but not at the beginning. The name of a variable also can't contain a dash within it.

  • How do you change the value of a variable?

    To change the value, just write the name of the variable and set it equal to a new value.

Datatypes

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

You can find out the class of a variable by calling the method class

  • What are two string methods?

"downcase!" and "index"

  • How can you change an integer to a string?

To change an integer to a string use the conversion method to_s

Strings

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

Double quotes allow you to use string interpolation, whereas single quotes do not.

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

The curly braces are used to contain any valid Ruby statement.

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

After the string, type .delete('aeiou')

Input & Output

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

'Print' and 'puts' both will print information to the user of the program. However, 'print' does not create a new line after printing.

  • What does 'gets' do in Ruby?

'Gets' pauses the program and awaits input from the user.

  • 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 do not contain decimals, whereas floats do.

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

    • == "equals"
    • = "greater than or equal to"

    • <= "less than or equal to"
    • != "does not equal"
    • && "and"
    • || "or"
  • What are two Ruby methods that return booleans?

    .include? and .empty?

Conditionals

  • What is flow control?

    Flow control is using certain statements in a particular order to allow the program to make decisions.

  • What will the following code return?

    The code will return the statement: '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 can happen if you create a loop in a program with no conditions to exit out of it. You can get out of it by ending your program using 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 represents "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 allow less memory to be allocated, which can result in a program running faster.

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

    Yes, naming symbols follows the same rules as for 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?

    You use .length to find out how many elements are in an array.

  • What is the index of pizza in this array: ["pizza", "ice cream", "cauliflower"]?

    The index is "0"

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

    'Push' adds an element to the end of an array. 'Pop' removes the last element form an array.

Hashes

  • Describe some differences between arrays and hashes.

    In arrays, elements are ordered in certain positions and are accessed based on their index. In hashes, elements are arranged in with associating keys and values, and are accessed based on their keys.

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

    An array could be preferable for a simple list of items. A hash would be preferable if you want to assign values to different properties, like if you are trying to group large amounts of related data.

    • 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 did manage to get through the work. I was accepted eight days ago but didn't receive any instructions about the prework until three days ago (4/24). I managed to find the backend prework course a few days before that and got started on everything I could, so nothing was overwhelming. I wanted to give a good push through the Railsbridge tutorial so that I'd have time to go back and reference it if I ran into any questions.

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

    I'm looking forward to learning about algorithms in general and how to manipulate data efficiently. Aside from that I'll go with the flow and see what topics pique my interest as time goes on.

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

    I'm sure this will come with practice but I want to learn the proper vocabulary and jargon for everything.

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

    Exercises in Brilliant.org's section on algorithms had an introduction to Big O notation. The functions and use of binary logarithms were the most confusing thing to go through.

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

    I am not sure who my student mentor is, so I guess that is my question to my instructors.

@JF-Lalonde
Copy link
Author

Typing.io Day 1

typing day 1

@JF-Lalonde
Copy link
Author

JF-Lalonde commented Apr 26, 2017

Dinner Date exercises from Brilliant.org
screen shot 2017-04-26 at 10 32 31 am
screen shot 2017-04-26 at 10 34 41 am
screen shot 2017-04-26 at 10 34 56 am
screen shot 2017-04-26 at 10 35 15 am
screen shot 2017-04-26 at 10 35 28 am

@JF-Lalonde
Copy link
Author

Terminal Screenshot Day 1
terminalday1

@JF-Lalonde
Copy link
Author

JF-Lalonde commented Apr 26, 2017

Terminal Screenshot Day 2: mkdir, cd, ls
screen shot 2017-04-26 at 11 14 17 am
screen shot 2017-04-26 at 11 20 23 am
screen shot 2017-04-26 at 11 23 33 am
screen shot 2017-04-26 at 11 29 30 am

@JF-Lalonde
Copy link
Author

Typing.io Day 2
day2

@JF-Lalonde
Copy link
Author

Algorithm exercises from Brilliant.org
screen shot 2017-04-26 at 12 04 14 pm
screen shot 2017-04-26 at 12 04 24 pm
screen shot 2017-04-26 at 12 04 33 pm
screen shot 2017-04-26 at 12 04 44 pm
screen shot 2017-04-26 at 12 04 52 pm

@JF-Lalonde
Copy link
Author

JF-Lalonde commented Apr 26, 2017

"I/O"
woodchuck

@JF-Lalonde
Copy link
Author

Typing.io Day 3
day3

@JF-Lalonde
Copy link
Author

Typing.io Day 4
day4

@JF-Lalonde
Copy link
Author

Typing.io Day 5
day4

@JF-Lalonde
Copy link
Author

"Numbers"
firstcalc

@JF-Lalonde
Copy link
Author

JF-Lalonde commented Apr 27, 2017

"Conditionals"
math_ops

@JF-Lalonde
Copy link
Author

"nil"
nil

@JF-Lalonde
Copy link
Author

"Symbols"
symbols

@JF-Lalonde
Copy link
Author

Typing.io Day 6
screen shot 2017-04-27 at 11 06 31 pm

@JF-Lalonde
Copy link
Author

Labyrinth problems from Brilliant.org
screen shot 2017-04-28 at 11 51 45 am
screen shot 2017-04-28 at 11 51 57 am
screen shot 2017-04-28 at 11 52 07 am
screen shot 2017-04-28 at 11 52 16 am
screen shot 2017-04-28 at 11 52 24 am

@JF-Lalonde
Copy link
Author

Typing.io Day 7
screen shot 2017-04-30 at 5 29 08 pm

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