Midterm Practice Flashcards

(40 cards)

1
Q

How do we select the id attribute in css?

A

“#id”

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

How do we select the class attribute in css?

A

.class

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

What does “p” select in css?

A

Selects all the paragraphs

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

What does “p” select in css?

A

Selects all the paragraphs

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

What does “div p” select is css?

A

Selects all paragraphs inside div elements

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

What does “div, p” select in css?

A

Selects all the div and p tags

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

What does “div+p” select in css?

A

Selects all the sibling p tags that immediately follow a div tag
“<div></div>”
“<p></p> <– this one–>”
“<p></p> <– this does not follow a div –>”

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

What does :hover do in css?

A

Applies a style to an element when the mouse is over it

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

Code test:
<?php
$pass = “test”;
$hash1 = password_hash($pass, PASSWORD_BCRYPT);
$hash2 = password_hash($pass, PASSWORD_BCRYPT);
if($hash1 == $hash2){
echo “matches”;
}
else{
echo “doesn’t match”;
}

?>

A

doesn’t match (random salt is assigned during hash to prevent two or more users from having the same password key)

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

What does == do?

A

Value equality matches but not type

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

What does === do?

A

Value AND type equality

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

What does $x++ do?

A

Increments x by 1

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

What does $x– do?

A

Decrements x by 1

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

What does && do?

A

Logical AND (both conditions must be true)

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

“What does || do?”

A

Logical OR (either condition must be true)

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

What does ! typically do in !$x?

A

Negates it (flips the boolean or truthy value)

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

What does % do in $x % $y?

A

Remainder/Modulus/Modulo

17
Q

What does . do in php?

A

Concats data/variables

18
Q

What does + do in php?

A

Addition Arithmetic

19
Q

In SQL how do you do a partial match on a column?

A

LIKE and the % wildcard

20
Q

So LIKE “hi%” partial matches what?

A

Any data in the column starting with hi

21
Q

So LIKE “%hi%” partial matches what?

A

Any data in the column that contains hi

22
Q

So LIKE “%hi” partial matches what?

A

Any data in the column ending in hi

23
Q

In SQL how do you select unique data?

A

SELECT DISTINCT

24
In JS what does console.log() do?
Prints to the developer console
25
In JS what does confirm() do?
Built in dialog providing a positive and negative action
26
In JS what does prompt() do?
Built in dialog asking for user input
27
while:
keeps running as long as the condition is true
28
do while:
runs at least once and continues as long as true
29
foreach:
loops over each item in a collection
30
for:
loops a specific number of times
31
Find Elements
Hello
Null; runs before page is ready
32
Form Submit
[ "job":"Painter", "age":51, "name": "Joe" ]
33
Logic Check 1
x is 1
34
Logic Check 2
x is 1500
35
Logic Check 3 2){ $x--; } } echo "x is $x"; ?>
x is 2
36
Logic Check 4
x is 0
37
Defined Variables "; } //does x need to be defined? ?>
no, it's a warning for now. PHP will do it's best to assume the initial value. Since it's addition it can assume you want it to be an int so it uses the default value of 0 then applies the arithmetic.
38
Random onload sample
Hello
Bye
What?
Who?
Where?
39
Update an immediate sibling This will change