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

A

property

24
Q

a property or a method?

*run

A

method

25
Q

a property or a method?

*age

A

method

26
Q

a property or a method?

*gender

A

property

27
Q

a property or a method?

*jump

A

method

28
Q

a property or a method?

*height

A

property

29
Q

a property or a method?

*weight

A

property

30
Q

A class is a/an __________ as the object is the thing

A

idea

31
Q

A class is an idea and the object, is the _________

A

thing

32
Q

encapsulation

A

the idea the classes and objects are self contained entities, and that we box them up together to produce our end product

33
Q

var isValid = true;

is of type

A

boolean

34
Q

primitives

A

primitives store a value

35
Q

object or primitive?

*var myArray = [1, 2, 3, 4, 5];

A

object

36
Q

object or primitive?

*var myNumber = 123;

A

primitive

37
Q

object or primitive?

*var isValid = true;

A

primitive

38
Q

object or primitive?

*var myRe = /hello/;

A

object

39
Q

object or primitive?

*date

A

object

40
Q

create today’s date in javascript

A

var today = new Date( );

41
Q

create halloween date

A

var halloweenDate = new Date(2016, 1, 1)

42
Q

classes in javascript (4)

A

1) array
2) RegExp (regular expression)
3) Date
4) Math

43
Q

javascript classes are …. compared to other languages

A

limited

44
Q

of the main languages, which one is the “purest” object oriented language?

A

ruby

45
Q

basic pseudo code for memory management in object oriented programming (4)

A

1) allocate memory (choose memory you want to use)
2) create object
3) use object
4) free memory

46
Q

memory leak

A
  • when you don’t “free memory” after use

- causes programs to become slow

47
Q

dangling pointer

A
  • 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
Q

reference counting

A
  • used be Objective-C and C++ for memory management

- allows us to keep a counter of what memory is being used

49
Q

garbage collection

A
  • 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
Q

in Scripting language, memory management is…

A

automatic

51
Q

problem with automatic memory management

A
  • can be slow
52
Q

bubble sort

A
  • considered a slow method to sort numbers
53
Q

in terms of programming (sorting for example), you have to decide between (3)

A

1) ease of use
2) speed
3) elegance (easy to understand)

54
Q

multi-tasking

A

running many programs at once

55
Q

multi-threading

A

doing multiple things in one program

56
Q

multithreading challenges

A

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