Inputs, outputs, and debugging Flashcards

1
Q

DOM

A

Document object model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Document.Object.Model represents (3)

A

Document Object Model

Document - web page - index.html
Object - pieces or individual tags/elements - H1 tag, etc.
Model - agreed upon set of terms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

batch program

A
  • a program that is designed to start from finish to end as soon as possible, and potentially produce and output
  • example: anti-virus scanner
  • most programs nowadays are not designed to start and finish as soon as possible. they allow you to interact with them through a graphical user interface.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

persistence

A

saving the state of the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what kind of persistence (saving ability) exists in javascript?

A

None! At least not at the basic level!

It doesn’t exist due to security concerns. But other programming languages such as java or objective C which runs natively on your OS will allow you to save files onto your hard drive.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

example of a few different javascript events

A

1) unload
2) onclick
3) onmouseover
4) noblur
5) onfocus

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what takes longer, writing code or debugging code?

A

debugging

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

errors in code (2)

A

1) syntax error

2) logic error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

error in code

syntax error

A
  • something is wrong with the ACTUAL format of the code

- forgot a semi colon, wrong number of braces, brackets, etc…

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

syntax error

  • compiled vs. interpreted language
A
  • in compiled languages, syntax errors are normally found while writing the code
  • with interpreted code, you sometimes just have to run code before you know if there’s a syntax terror
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

error in code

*logic error

A
  • correct in syntax but there’s a flaw in the logic
  • problem with arithmetic
  • infinite loop
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

best way to fix an error in code:

A

reproduce the same error

find out when the error occurs and how it occurred

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

trace

A
  • finding out where the code when wrong by leaving messages in your code or functions.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

trace messaging is sometimes called…

A

logging to the console

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In object oriented programming, these “objects”….

A

communicate with one another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Class

A

The blueprint, the description, and the definition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

If you wrote “classes” for a restaurant-review website, some classes would be (9)

A
  • restaurant
  • review
  • user
  • textbox
  • button
  • window
  • date
  • timezone
  • Videoplayer

Of course, there’s more.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

An attribute (english word) is akin to a . . . (computing word)

A

property

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

A behaviour (english word) is akin to . . . (computing word)

A

a method, a function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

a property or a method?

*name

A

property

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

a property or a method?

*sleep

A

method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

a property or a method?

*speak

A

method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

a property or a method?

*gender

24
Q

a property or a method?

*run

25
a property or a method? *age
method
26
a property or a method? *gender
property
27
a property or a method? *jump
method
28
a property or a method? *height
property
29
a property or a method? *weight
property
30
A class is a/an __________ as the object is the thing
idea
31
A class is an idea and the object, is the _________
thing
32
encapsulation
the idea the classes and objects are self contained entities, and that we box them up together to produce our end product
33
var isValid = true; is of type
boolean
34
primitives
primitives store a value
35
object or primitive? *var myArray = [1, 2, 3, 4, 5];
object
36
object or primitive? *var myNumber = 123;
primitive
37
object or primitive? *var isValid = true;
primitive
38
object or primitive? *var myRe = /hello/;
object
39
object or primitive? *date
object
40
create today's date in javascript
var today = new Date( );
41
create halloween date
var halloweenDate = new Date(2016, 1, 1)
42
classes in javascript (4)
1) array 2) RegExp (regular expression) 3) Date 4) Math
43
javascript classes are .... compared to other languages
limited
44
of the main languages, which one is the "purest" object oriented language?
ruby
45
basic pseudo code for memory management in object oriented programming (4)
1) allocate memory (choose memory you want to use) 2) create object 3) use object 4) free memory
46
memory leak
- when you don't "free memory" after use | - causes programs to become slow
47
dangling pointer
- when you "free memory", but have a variable pointed at a specific piece of memory - you then try to use that variable but the variable doesn't exist because you "freed memory". - causes programs to crash
48
reference counting
- used be Objective-C and C++ for memory management | - allows us to keep a counter of what memory is being used
49
garbage collection
- the system itself keeps track of how the much memory the application is using - it is called garbage collection because the "freeing of memory" happens all at once, not slowly. You actually don't have control of WHEN garbage is collected.
50
in Scripting language, memory management is...
automatic
51
problem with automatic memory management
- can be slow
52
bubble sort
- considered a slow method to sort numbers
53
in terms of programming (sorting for example), you have to decide between (3)
1) ease of use 2) speed 3) elegance (easy to understand)
54
multi-tasking
running many programs at once
55
multi-threading
doing multiple things in one program
56
multithreading challenges
1) competition for RAM or other resources 2) Restriction on updating UI 3) language support 4) Web Work -- future feature for Javascript through an update in HTML5