- What is the
check_italgorthim checking?
It is checking if each opening and closing bracket, paranethesis, or curly brace in a pair are present, by setting the opening character as a key and the closing character as a value in the open_close method. It returns true or false based on whether both in the pair are present and nested properly.
- What other applications could this algorithm have?
This algorithm might be what is underlying the errors that Ruby returns (and the linter detects in atom) when we forget to use close all of our hashes and arrays and nested stuff properly.
- What kinds of problems are Stacks good at?
Carrying out actions in the proper order. Otherwise it would be mayhem!
-
Classes are containers for what? Behaviors. Instructions for an object to be able to understand.
-
Classes have a pointer to what? Superclasses
-
Instances are containers for what? Instance variables.
-
Instances have a pointer to what? Class
-
We say classes are also instances... what does this mean? A class is an instances of the Object class.
-
Method parameters are what kind of variable? local variables
-
All code executes in what? call stack
-
What are the bindings? "A ruby class that captures the context in which code is executed"
-
Bindings are containers for what? variables, methods, self, and other contextual information
-
Bindings execute in what? call stack
-
Bindings have a pointer to what? Whatever their context is? Could be a method, and instance, a class...
-
What does this give them access to? Whatever is within their scope
-
Where are methods stored? Classes
-
If I call a method on an instance, where does it look for the method? In the class
-
What if it doesn't find the method there? In the superclass
-
What if it STILL doesn't find the method there? In the superclass of that class
-
What does it do once it finds the method? executes
-
I call
"hello world".upcase; what isselfinside of theupcasemethod? the string "hello world" -
What is the colloquial term for an instance? a specific instance
-
In the code below, which describes what is actually happening?
a = "some string". b = a
a and b are local variables pointing to the same string a is a local variable, b is an alias, pointing to a different string a and b are local variables, each pointing to their own instance of "some string" a is pointing to "some string", and b is pointing to a
- What is
abc?
a string a symbol an instance variable a local variable
-
What is
@abc? a local variable a constant an instance variable a global variable -
What is
Abc? a local variable a constant an instance variable a global variable -
What is
$abc? a local variable a constant an instance variable a global variable