Section 1

Preview this deck

global interpreter lock or GIL

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

1

Favorites

0

Last updated

6 years ago

Date created

Mar 14, 2020

Cards (744)

Section 1

(50 cards)

global interpreter lock or GIL

Front

the lock used by Python threads to assure that only one thread can be run at a time. This simplifies Python by assuring that no two processes can access the same memory at the same time. Locking the entire interpreter makes it easier for the interpreter to be multi-threaded, at the expense of some parallelism on multi-processor machines. Efforts have been made in the past to create a "free-threaded" interpreter (one which locks shared data at a much finer granularity), but performance suffered in the common single-processor case.

Back

class

Front

A template for creating user-defined objects. Class definitions normally contain method definitions that operate on instances of the class.

Back

generator function

Front

A function that returns a generator iterator. Its definition looks like a normal function definition except that it uses the keyword yield. Generator functions often contain one or more for or while loops that yield elements. The function execution is stopped at the yield keyword (returning the result) and its resumed there when the next element is requested (e.g., by the builtin function next()). For details see PEP 0255 and PEP 0342.

Back

datetime.date

Front

idealized naïve date. Attributes: year, month, day

Back

function

Front

A block of code that is invoked by a "calling" program, best used to provide an autonomous service or calculation.

Back

iterable

Front

A container object capable of returning its members one at a time. Examples of iterables include all sequence types (list, str, tuple, etc.) and some non-sequence types like dict and file and objects of any classes you define with an __iter__ or __getitem__ method.

Back

coercion

Front

The implicit conversion of an instance of one type to another during an operation which involves two arguments of the same type. For example, int(3.15) converts the floating point number to the integer, 3, but in 3 + 4.5, each argument is of a different type (one int, one float), and both must be converted to the same type before they can be added or it will raise a TypeError. Coercion between two operands can be implicitly invoked with the coerce builtin function; thus, 3 + 4.5 is equivalent to operator.add(*coerce(3, 4.5)) and results in operator.add(3.0, 4.5) which is of course 7.5. Without coercion, all arguments of even compatible types would have to be normalized to the same value by the programmer, e.g., float(3) + 4.5 rather than just 3 + 4.5.

Back

mutable

Front

Mutable objects can change their value but keep their id(). See also immutable.

Back

iterator

Front

An object representing a stream of data. Repeated calls to the iterator's next() method return successive items in the stream. When no more data is available a StopIteration exception is raised instead.

Back

LBYL

Front

Look before you leap. This coding style explicitly tests for pre-conditions before making calls or lookups. This style contrasts with the EAFP approach and is characterized the presence of many if statements.

Back

decorator

Front

A function that modifies another function or method. Its return value is typically a callable object, possibly the original function, but most often another function that modifies the original function's behavior in some fashion.

Back

dictionary. what is it? what goes in it? How are items added or subtracted from it?

Front

A built-in Python data type composed of arbitrary keys and values; it's an unordered set of key: value pairs, with the requirement that the keys are unique (within one dictionary). Unlike sequences, which are indexed by a range of numbers, dictionaries are indexed by keys, which can be any immutable type; strings and numbers can always be keys. Create a dictionary using dict([(item1:4), (item2:'sarah')]). delete items (del), add items, or lookup items: >>> tel = {'jack': 4098, 'sape': 4139} >>> tel['guido'] = 4127 >>> del tel['sape'] >>> tel['irv'] = 4127 >>> tel {'guido': 4127, 'irv': 4127, 'jack': 4098}

Back

EAFP

Front

Acronym for the saying it's "Easier to Ask for Forgiveness than Permission". This common Python coding style assumes the existance of valid keys or attributes and catches exceptions if the assumption proves false. This clean and fast style is characterized by the presence of many try and except statments. The technique contrasts with the LBYL style that is common in many other languages such as C.

Back

hash table

Front

An object that maps more-or-less arbitrary keys to values. Dictionaries are the most visible and widely used objects that exhibit this behavior.

Back

list

Front

A built-in Python datatype, which is a mutable sorted sequence of values. Note that only sequence itself is mutable; it can contain immutable values like strings and numbers. Any Python first-class object can be placed in a tuple as a value.

Back

tzinfo

Front

an optional time zone information attribute. Tzinfo can be set as a sbclass of the abstract tzinfo class.

Back

EIBTI

Front

Acronym for "Explicit Is Better Than Implicit", one of Python's design principles, included in the Zen of Python.

Back

old-style class

Front

Any class that does not inherit (directly or indirectly) from object.

Back

complex number. what module should be imported to operate on complex numbers?

Front

An extension of the familiar real number system in which all numbers are expressed as a sum of a real part and an imagary part. Imaginary numbers are real multiples of the imaginary unit, often written i in mathematics or j in engineering. Python has builtin support for complex numbers, which are written with this latter notation; the imaginary part is written with a j suffix, e.g., 3+1j. To get access to complex equivalents of the math module, use cmath. Use of complex numbers is a fairy advanced mathematical feature; if you're not aware of a need for complex numbers, it's almost certain you can safely ignore them.

Back

object

Front

Any data with state (attributes or value) and defined behavior (methods).

Back

2 types of date and time objects

Front

naïve and aware

Back

datetime module

Front

datetime module supplies classes for manipulating dates and times

Back

descriptor

Front

Any object that defines the methods __get__(), __set__(), or __delete__(). When a class attribute is a descriptor, its special binding behavior is triggered upon attribute lookup. Normally, writing a.b looks up the object b in the class dictionary for a, but if b is a descriptor, the defined method gets called. Understanding descriptors is a key to a deep understanding of Python because they are the basis for many features including functions, methods, properties, class methods, static methods, and reference to super classes.

Back

nested scope

Front

The ability to refer to a variable in an enclosing definition. For instance, a function defined inside another function can refer to variables in the outer function. Note that nested scopes work only for reference and not for assignment which will always write to the innermost scope. In contrast, local variables both read and write in the innermost scope. Likewise, global variables read and write to the global namespace.

Back

integer division

Front

Mathematical division discarding any remainder, for example 3 / 2 returns 1, in contrast to the 1.5 returned by float division. Also called "floor division". When dividing two integers the outcome will always be another integer (having the floor function applied to it). However, if one of the operands is another numeric type (such as a float), the result will be coerced (see coercion) to a common type. For example, an integer divided by a float will result in a float value, possibly with a decimal fraction. Integer division can be forced by using the '//' operator instead of the '/' operator.

Back

first-class object

Front

A first class object in a programming language is a language object that can be created dynamically, stored in a variable, passed as a parameter to a function and returned as a result by a function (from http://www.cs.unm.edu/~crowley/phdExams/1997xfall/pl.html). In Python, practically all objects are first-class, including functions, types, and classes.

Back

immutable

Front

An object with fixed value. Immutable objects include numbers, strings and tuples. Such an object cannot be altered. A new object has to be created if a different value has to be stored. They play an important role in places where a constant hash value is needed such as the keys of a dictionary.

Back

id

Front

id is a built-in function which returns a number identifying the object, referred to as the object's id. It will be unique during the lifetime of the object, but is very often reused after the object is deleted.

Back

interpreted

Front

Python is an interpreted language (like Perl), as opposed to a compiled one (like C). This means that the source files can be run directly without first creating an executable which is then run. Interpreted languages typicaly have a shorter development/debug cycle than compiled ones, though their programs generally also run more slowly.

Back

dynamic typing

Front

A style of typing of variables where the type of objects to which variables are assigned can be changed merely by reassigning the variables. Python is dynamically typed. Thus, unlike as in a statically typed language such as C, a variable can first be assigned a string, then an integer, and later a list, just by making the appropriate assignment statements. This frees the programmer from managing many details, but does come at a performance cost.

Back

property

Front

a built-in data type, used to implement managed (computed) attributes. You assign the property object created by the call property( optional-args ) to a class attribute of a new-style class. When the attribute is accessed through an instance of the class, it dispatches functions that implement the managed-attribute operations, such as get-the-value and set-the-value.

Back

define Attribute. how are attributes accessed?

Front

Values associated with an individual object. Attributes are accessed using the 'dot syntax': a.x means fetch the x attribute from the 'a' object.

Back

IDLE

Front

an Integrated Development Environment for Python. IDLE is a basic editor and intepreter environment that ships with the standard distribution of Python. Good for beginners and those on a budget, it also serves as clear example code for those wanting to implement a moderately sophisticated, multi-platform GUI application.

Back

new-style class

Front

Any class that inherits from object. This includes all built-in types like list and dict. Only new style classes can use Python's newer, versatile features like __slots__, descriptors, properties, __getattribute__, class methods, and static methods.

Back

interactive

Front

Python has an __ interpreter which means that you can try out things and directly see its result, just launch python with no arguments. A very powerful way to test out new ideas, inspect libraries (remember x.__doc__ and help(x)) and improve programming skills.

Back

pie syntax

Front

A syntax using '@' for decorators that was committed to an alpha version of Python 2.4. So called because the '@' vaguely resembles a pie and the commital came on the heels of the Pie-thon at an open source conference in 2004.

Back

hash

Front

A number used to correspond to objects, usually used for 'hashing' keys for storage in a hash table. Hashing in Python is done with the builtin hash function

Back

byte code. what is it? where is it cached?

Front

The interpreter's representation of a Python program. The byte code is cached in .pyc and .pyo files so that executing the same file is faster the second time (the step of compilation from source to byte code can be saved). This "intermediate language" is said to run on a "virtual machine" that calls the subroutines corresponding to each byte code.

Back

naïve object

Front

does not contain enough information to unambiguously locate itself relative to other date/time objets.

Back

list comprehension

Front

A neat syntactical way to process elements in a sequence and return a list with the results. result = ["0x%02x" % x for x in range(256) if x % 2 == 0] generates a list of strings containing hex numbers (0x..) that are even and in the range from 0 to 255. The if part is optional' all elements are processed when it is omitted.

Back

generator

Front

The common name for a generator iterator. The type of iterator returned by a generator function or a generator expression.

Back

greedy regular expressions

Front

Regular expressions which match the longest string possible. The , + and ? operators are all greedy. Their counterparts ?, +? and ?? are all non-greedy (match the shortest string possible).

Back

mapping

Front

A container object (such as dict) that supports arbitrary key lookups using __getitem__.

Back

BDFL

Front

Acronym for "Benevolent Dictator For Life" - a.k.a. Guido van Rossum, Python's primary creator, figurehead and decision-maker.

Back

object oriented

Front

Programming typified by a data-centered (as opposed to a function-centered) approach to program design.

Back

hashable

Front

An object is hashable if it is immutable (ints, floats, tuples, strings, etc) or user-defined classes that define a __hash__ method.

Back

duck typing

Front

From the "If it walks, talks, and looks like a duck, then its a duck" principle. Python uses duck typing in that if an object of some user-defined type exhibits all of the expected interfaces of some type (say the string type), then the object can be treated as if it really were of that type.

Back

namespace

Front

The place where a variable is stored in a Python program's memory. Namespaces are implemented as a dictionary. There are the local, global and builtins namespaces and the nested namespaces in objects (in methods). Namespaces support modularity by preventing naming conflicts. For instance, __builtins__.open() and os.open() are distinguished by their namespaces. Namespaces also aid readability and maintainabilty by making it clear which modules implement a function. For instance, writing random.seed() and itertools.izip() will make it clear that those functions are implemented by the random and itertools modules respectively.

Back

docstring

Front

A string that appears as the lexically first expression in a module, class definition or function/method definition is assigned as the __doc__ attribute of the object where it is available to documentation tools or the help() builtin function.

Back

metaclass

Front

The class of a class. Class definitions create a class name, a class dictionary, and a list of base classes. The metaclass is responsible for taking those three arguments and creating the class. Most object oriented programming languages provide a default implementation. What makes Python special is that it is possible to create custom metaclasses. Most users never need this tool, but when the need arises, metaclasses can provide powerful, elegant solutions. They have been used for logging attribute access, adding thread-safety, tracking object creation, implementing singletons, and many other tasks.

Back

Section 2

(50 cards)

^

Front

Binary XOR Operator copies the bit if it is set in one operand but not both.

Back

<>

Front

Checks if the value of two operands are equal or not, if values are not equal then condition becomes true.

Back

module

Front

A module is a python file that (generally) has only definitions of variables, functions, and classes.

Back

not in

Front

Evaluates to true if it does not finds a variable in the specified sequence and false otherwise.

Back

<=

Front

Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true.

Back

in

Front

Evaluates to true if it finds a variable in the specified sequence and false otherwise.

Back

Zen of Python

Front

listing of Python design principles and philosophies that are helpful in understanding and using the language effectively. The listing can be found by typing "import this" at the interactive promp

Back

>=

Front

Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true.

Back

not

Front

Called Logical NOT Operator. Use to reverses the logical state of its operand. If a condition is true then Logical NOT operator will make false.

Back

sequence

Front

An iterable that also supports random access using __getitem__ and len. Some builtin sequence types are list, str, tuple, and unicode. Note that dict also supports these two operations but is considered a mapping rather than a sequence because the lookups use arbitrary keys rather than consecutive numbers and it should be considered unsorted.

Back

is

Front

Evaluates to true if the variables on either side of the operator point to the same object and false otherwise.

Back

static typing

Front

A style of typing of variables common to many programming languages (such as C) where a variable, having been assigned an object of a given type, cannot be assigned objects of different types subsequently.

Back

**=

Front

Exponent AND assignment operator, Performs exponential (power) calculation on operators and assign value to the left operand

Back

&

Front

Binary AND Operator copies a bit to the result if it exists in both operands.

Back

type

Front

A "sort" or "category" of data that can be represented by a programming language. Types differ in their properties (such as mutability and immutability), the methods and functions applicable to them, and in their representations. Python includes, among others, the string, integer, long, floating point, list, tuple, and dictionary types.

Back

+

Front

Addition - Adds values on either side of the operator

Back

!=

Front

Checks if the value of two operands are equal or not, if values are not equal then condition becomes true.

Back

>>

Front

Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand.

Back

//=

Front

Floor Dividion and assigns a value, Performs floor division on operators and assign value to the left operand

Back

=

Front

Simple assignment operator, Assigns values from right side operands to left side operand

Back

whitespace

Front

The unconventional use of space characters (' ') to control the flow of a program. Instead of a loosely-enforced ideal, this is an integral part of Python syntax. It's a tradeoff between readability and flexibility in favor of the former.

Back

*

Front

Multiplication - Multiplies values on either side of the operator

Back

When we first describe a class, we are __ it (like with functions)

Front

defining

Back

|

Front

Binary OR Operator copies a bit if it exists in eather operand.

Back

~

Front

Binary Ones Complement Operator is unary and has the efect of 'flipping' bits.

Back

is not

Front

Evaluates to false if the variables on either side of the operator point to the same object and true otherwise.

Back

<

Front

Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true.

Back

==

Front

Checks if the value of two operands are equal or not, if yes then condition becomes true.

Back

triple-quoted string

Front

A string that is bounded by three instances of either the double quote mark (") or the single quote mark (').

Back

/=

Front

Divide AND assignment operator, It divides left operand with the right operand and assign the result to left operand

Back

or

Front

Called Logical OR Operator. If any of the two operands are non zero then then condition becomes true.

Back

**

Front

Exponent - Performs exponential (power) calculation on operators

Back

unicode

Front

The unicode type is the companion to the string type. They are used to store text with characters represented as Unicode code points.

Back

reiterable

Front

An iterable object which can be iterated over multiple times. Reiterables must not return themselves when used as an argument to iter()

Back

*=

Front

Multiply AND assignment operator, It multiplies right operand with the left operand and assign the result to left operand

Back

regular expression

Front

A formula for matching strings that follow some pattern. Regular expressions are made up of normal characters and metacharacters. In the simplest case, a regular expression looks like a standard search string. For example, the regular expression "testing" contains no metacharacters. It will match "testing" and "123testing" but it will not match "Testing". Metacharacters match some expressions like '.' metacharacter match any single character in a search string.

Back

-=

Front

Subtract AND assignment operator, It subtracts right operand from the left operand and assign the result to left operand

Back

tuple

Front

(pronounced TUH-pul or TOO-pul) A built-in Python datatype, which is an immutable ordered sequence of values. Note that only the sequence itself is immutable. If it contains a mutable value such as a dictionary, that value's content may be changed (e.g. adding new key/value pair). Any Python first-class object can be placed in a tuple as a value.

Back

/ (what do you import?)

Front

Division - Divides left hand operand by right hand operand. from __future__ import division (if division is not imported then / only does int division; it drops the remainder of the quotient)

Back

<<

Front

Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand.

Back

>

Front

Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true.

Back

-

Front

Subtraction - Subtracts right hand operand from left hand operand

Back

+=

Front

Add AND assignment operator, It adds right operand to the left operand and assign the result to left operand

Back

//

Front

Floor Division - The division of operands where the result is the quotient in which the digits after the decimal point are removed.

Back

and

Front

Called Logical AND operator. If both the operands are true then then condition becomes true.

Back

__slots__

Front

A declaration inside a new-style class that saves memory by pre-declaring space for instance attributes and eliminating instance dictionaries. Though popular, the technique is somewhat tricky to get right and is best reserved for rare cases where there are large numbers of instances in a memory critical application.

Back

%

Front

Modulus - Divides left hand operand by right hand operand and returns remainder

Back

%=

Front

Modulus AND assignment operator, It takes modulus using two operands and assign the result to left operand

Back

Python 3000

Front

A mythical Python release, allowed to be backward incompatible, with telepathic interface.

Back

string

Front

One of the basic types in Python that store text. In Python 2.X strings store text as a 'string of bytes', and so the string type can also be used to store binary data. Also see Unicode.

Back

Section 3

(50 cards)

A class is known as a __ - it holds data, and the methods to process that data.

Front

'data structure'

Back

A java monitor must either extend Thread....

Front

false

Back

Racoon,SwampThing,Washer

Front

line 7 will not compile ( phải ép kiểu )

Back

a signed data type

Front

false

Back

Module

Front

A file containing definitions and statements. if you want to import definitions from one script to another, you can define them in a module. Importing definitions (import file.py) will provide access to the definitions within file.py. Then in anotherfile.py you can use a definition defined in file.py (import file.py... b=file.divide).

Back

obtain a Connection to a Database

Front

DriverManager

Back

class Xyz

Front

iAmPublic iAmPrivate iAmVolatile

Back

public static iterator

Front

Complication fails

Back

outer:for...

Front

i=1; j=0;

Back

A function inside a class is known as __

Front

a method

Back

Test extends Base ( gọi hàm tạo )

Front

0 tham số và 2 tham số

Back

difference between a module and a script?

Front

A script is generally an executable piece of code, run by itself. A module is generally a library, imported by other pieces of code. There is no internal distinction; both are executable and importable. It's just that module code typically doesn't do anything.

Back

.... native client library....

Front

type 2

Back

Dog, Animal

Front

compile and run

Back

class Q6 ( Holder )

Front

101 ( tăng 1 so vs held gốc )

Back

SomeException

Front

B fail A suceed

Back

a thread wants to make a second thread ineligible

Front

false

Back

A variable inside a class is known as __

Front

an attribute

Back

read back data from file

Front

FileInputStream, RandomAccessFile

Back

...implement the JDBC API

Front

Type 1

Back

a programmer needs to create a logging method

Front

public void logIt(String...msgs)

Back

x = a++ + b++

Front

x tổng cũ, a,b tăng 1

Back

class SuperDuper

Front

line 3: private; line 8: protected;

Back

... pure java... implement the network protocol

Front

type 4

Back

int[]x

Front

x[24] = 0; x.length = 25;

Back

which line is not compiled

Front

floater = ob

Back

public class Outer

Front

abce

Back

define identifier

Front

Declares an identifier (a unique object or unique class)

Back

__ method is used to wait for a client...

Front

accept()

Back

A class is an object, just like (name 3 other types of objects)

Front

variables, lists, dictionaries, etc.

Back

condtion must be true....throw AssertionError

Front

the application must be run... the args must have one or more...

Back

StringBuffer sbuf

Front

after line 2, .... eligible

Back

TestException

Front

Line 46 ... enclosing method throws... Line 46... try block

Back

prevent user input to other windows

Front

modal dialog

Back

.... objects in a List to be sorted,..

Front

Comparable interface and ít compareTo method

Back

define def

Front

Def introduces a function definition.

Back

when a new instance of a class is created, we can call that class by its parent class name or its instance name. The instance name is ___ to the parent name.

Front

pointing

Back

Test extends Base ( gọi hàm )

Front

1 tham số và 2 tham số

Back

Cat, Washer,SwampThing

Front

will compile... exception line 7...cannot be converted

Back

submit a query to a database

Front

Statement object

Back

valid identifiers

Front

tất

Back

How do you execute a module as a script?

Front

python fibo.py <args> executes the python module as a script, just as if you imported it, but with __name__ set to __main__. This is often used to either provide a convenient user interface to a module or for testing purposes.

Back

Set implementation... value-ordered

Front

TreeSet

Back

___ a set of java API

Front

JDBC

Back

The word 'class' can be used in what 2 ways?

Front

1)when describing the code where the class is defined (like how a function is defined), and 2) it can also refer to an instance of that class

Back

Define 'statements'. Give examples of simple and compound

Front

the smallest standalone element. Simple statements include: assignment, call (e.g. clearscreen() ), return. Compound statements include for/while loops, if statements, etc.

Back

The ability to group similar functions and variables together is __

Front

encapsulation

Back

a thread's run() method

Front

At line 2, ..stop running. It will resume running SOME TIME...

Back

monitor called mon ... 10 threads... waiting pool

Front

you cannot

Back

...pure java...communicate with middleware server....

Front

type 3

Back

Section 4

(50 cards)

Character Strings

Front

A series of characters in consecutive memory locations: "Hello" Stored with the null terminator, \0, at the end: Comprised of the characters between the " " quotation marks.

Back

Integer Literals

Front

______________ are stored in memory as ints by default To store an integer constant in a long memory location, put 'L' at the end of the number: 1234L Constants that begin with '0' (zero) are base 8: 075 Constants that begin with '0x' are base 16: 0x75A

Back

INCORRECT..deserialization

Front

we use readObject()... to deserialize

Back

Integer variables can hold whole numbers such as 12, 7, and -99.

Front

...

Back

correct statement about remote class

Front

all

Back

Suppose interface Inty defines 5 methods

Front

The class will not compile if it's declared abstract The class may not be instantiated

Back

String literal

Front

"hello, there" This is an example of an?

Back

INCORRECT..RMI server

Front

a client acceeses remote object... only server name

Back


escape sequence

Front

You can also use the __ escape sequence to start a new line of output. This will produce two lines of output: Similar to endl manipulator.

Back

You do not put quotation marks around endl.

Front

...

Back

A ext Objectl B ext A; C ext B, java.io.Externalizable

Front

C must have no-args constructor

Back

c out

Front

The command that displays output on the computer screen . You use the stream insertion operator (<<) to send output to ____:

Back

C++ string class

Front

Special data type supports working with strings #include <string> Can define string variables in programs: string firstName, lastName; Can receive values with assignment operator: firstName = "George"; lastName = "Washington"; Can be displayed via cout cout << firstName << " " << lastName;

Back

Variable name

Front

____________ (s) should represent the purpose of the variable. Example: itemsOrdered The purpose of this variable is to hold the number of items ordered.

Back

A ext Objectl B ext A; C ext B, java.io.Serializable

Front

B must have no-args constructor

Back

write code... execute onlu.. curren thread owns multiple locks

Front

Yes

Back

integer data types

Front

short unsigned short int unsigned int long unsigned long Are examples of _________________?

Back

return SQL query result

Front

ResultSet

Back

The last character in endl is a lowercase L, not the number 1

Front

...

Back

INCORRECT.. serialization

Front

When an Object Output Stream

Back

Character literals

Front

_________________ must be enclosed in single quote marks. Example: 'A'

Back

correct statement about remote interface

Front

all

Back

Identifier

Front

An _________is a programmer-defined name for some part of a program: variables, functions, etc.

Back

Floating-Point data types

Front

float , double, long double are examples of? They can hold real numbers such as: 12.45 -3.8 Stored in a form similar to scientific notation All floating-point numbers are signed

Back

URL referring to databases

Front

protocol:subprotocol:datasourcename

Back

Literal

Front

_______is a value that is written into a program's code.

Back

Identifier Rules: The first character of an identifier must be an alphabetic character or and underscore ( _ ). After the first character you may use alphabetic characters, numbers, or underscore characters. Upper- and lowercase characters are distinct

Front

...

Back

char

Front

This data type is: Used to hold characters or very small integer values Usually 1 byte of memory Numeric value of character from the character set is stored in memory:

Back

code fragmanet, sbuf references.. sbuf.insert

Front

true

Back

#include

Front

Inserts the contents of another file into the program This is a preprocessor directive, not part of C++ language. #include lines not seen by compiler. Do not place a semicolon at end of #include line.

Back

c out

Front

This command (<<) displays output on the computer screen.

Back

INCORRECT..Socket

Front

the java.net.Socket... contain code... know how.. communicate server .. UDP

Back

endl

Front

You can use the ____ manipulator to start a new line of output. This will produce two lines of output:

Back

Variables

Front

___________of the same type can be defined - On separate lines: int length; int width; unsigned int area; - On the same line: int length, width; unsigned int area; Variables of different types must be in different definitions

Back

source file contains a large number of import statements ( compilation )

Front

compilation takes slightly more time

Back

integer literal

Front

12 This is an example of an?

Back

source file contains a large number of import statements ( class loading )

Front

class loading takes no additional time

Back

Integer Literal

Front

An ______________ is an integer value that is typed into a program's code. For example: itemsOrdered = 15; In this code, 15 is an integer literal.

Back

SQL keyword

Front

WHERE

Back

correct statement about RMI

Front

all

Back

JDBC supports

Front

2-tier and 3-tier

Back

suppose a method called finallyTest()

Front

finally block will always exe

Back

identifiers

Front

can be all word character can contain underscore in beginning or afterwards cannot contain symbols ($) or period(.) but can have underscore (_) cannot begin with digits (3, 4, 5).

Back

code fragmanet, sbuf references.. sbuf.append

Front

True

Back

MVC

Front

Model -View -Controller

Back

JDBC 2-tierprocessing model

Front

a user's command are delivered to the database

Back

Variable

Front

______ is a storage location in memory. Has a name and a type of data it can hold. Must be defined before it can be used. int item;

Back

c out << object

Front

This stream insertion operator is used to send output to cout. Can be used to send more than one item to c out.

Back

Interface ___ help manage the connection

Front

Connection

Back

INCORRECT..ServerSocket class

Front

make new object avaiable... call its accept()

Back

Section 5

(50 cards)

Programming style

Front

The visual organization of the source code Includes the use of spaces, tabs, and blank lines Does not affect the syntax of the program Affects the readability of the source code

Back

PHP is a _________ language

Front

server-side

Back

True or false: PHP is considered a scripting language

Front

true

Back

Floating-Point literals

Front

Can be represented in Fixed point (decimal) notation: 31.4159 0.0000625 E notation: 3.14159E1 6.25e-5 Are double by default Can be forced to be float (3.14159f) or long double (0.0000625L)

Back

Variable Assignments and Initialization: An assignment statement uses the = operator to store a value in a variable. item = 12; This statement assigns the value 12 to the item variable.

Front

...

Back

Assignment The variable receiving the value must appear on the left side of the = operator. This will NOT work: // ERROR! 12 = item;

Front

...

Back

loosely-typed

Front

Explicit data types are not required

Back

What is mySQL?

Front

A database server

Back

Comments

Front

Used to document parts of the program Intended for persons reading the source code of the program: Indicate the purpose of the program Describe the use of variables Explain complex sections of code Are ignored by the compiler

Back

Scope

Front

The _____ of a variable: the part of the program in which the variable can be accessed A variable cannot be used before it is defined.

Back

Arithmetic Operators

Front

Used for performing numeric calculations C++ has unary, binary, and ternary operators: unary (1 operand) -5 binary (2 operands) 13 - 7 ternary (3 operands) exp1 ? exp2 : exp3

Back

______ scope refers to any variable that is defined outside of any function

Front

Global

Back

Write a correct PHP statement that creates a variable called 'myFlavor' with the value of 'vanilla'

Front

$myFlavor = "vanilla";

Back

Single line Comments

Front

Begin with // through to the end of line: int length = 12; // length in inches int width = 15; // width in inches int area; // calculated area // calculate rectangle area area = length * width;

Back

PHP is a ______ typed language

Front

loosely

Back

A closer look at /Operator / (division) operator performs integer division if both operands are integers cout << 13 / 5; // displays 2 cout << 91 / 7; // displays 13 If either operand is floating point, the result is floating point cout << 13 / 5.0; // displays 2.6 cout << 91.0 / 7; // displays 13.0

Front

...

Back

Variables are _____ for storing information

Front

containers

Back

Given: echo strpos("ABCD", "A"); What is the resulting output?

Front

0

Back

Binary Arithmetic Operators

Front

addition, subtraction, division, multiplication, and modulus are examples of?

Back

Every function must have

Front

a parameter list delimited by parentheses, even if that list is empty

Back

PHP

Front

"PHP: Hypertext Preprocessor"

Back

Standard and Prestandard C++

Front

Older-style C++ programs: Use .h at end of header files: #include <iostream.h> Use #define preprocessor directive instead of const definitions Do not use using namespace convention May not compile with a standard C++ compiler

Back

Programming style

Front

Common elements to improve readability: Braces { } aligned vertically Indentation of statements within a set of braces Blank lines between declaration and other statements Long statements wrapped over multiple lines with aligned operators

Back

Multi-line Comments

Front

Begin with /, end with / Can span multiple lines: /* this is a multi-line comment */ Can begin and end on the same line: int area; / calculated area /

Back

Another name for parameter

Front

argument

Back

True or false: PHP strings may be delimited by either double or single quotes

Front

true

Back

PHP is _____ source software

Front

open

Back

Built-in function for finding the length of a string

Front

strlen

Back

Variable Initialization To initialize a variable means to assign it a value when it is defined: int length = 12; Can initialize some or all variables: int length = 12, width = 5, area;

Front

...

Back

Delimiter for PHP code segments

Front

<?php ?>

Back

bool Data Type

Front

Represents values that are true or false bool variables are stored as small integers false is represented by 0, true by 1:

Back

True or false: PHP variables are case-sensitive

Front

true

Back

Single line comment syntax

Front

//blah blah blah

Back

A closer look at /Operator % (modulus) operator computes the remainder resulting from integer division cout << 13 % 5; // displays 3 % requires integers for both operands cout << 13 % 5.0; // error

Front

...

Back

A _______ is a local variable whose value is passed to the function by the calling code

Front

parameter

Back

An 'id' should be designated as a ______ ____ with ___________ enabled

Front

primary key ... auto increment

Back

Command to print information on a web page

Front

echo

Back

Extension for PHP files

Front

php

Back

myFlavor is an example of

Front

camel case

Back

The _____ of a variable is the portion of the script in which the variable can be referenced

Front

scope

Back

Shorthand delimiter for PHP code segments

Front

<? ?>

Back

PHP concatenation operator

Front

.

Back

Named Constants

Front

____________ (constant variable): variable whose content cannot be changed during program execution Used for representing constant values with descriptive names: const double TAX_RATE = 0.0675; const int NUM_STATES = 50; Often named in uppercase letters

Back

A variable declared within a PHP function becomes ____ and can only be accessed within that function.

Front

Local

Back

True or false: Spaces are acceptable in PHP variables

Front

false

Back

Block comment synax

Front

/* blah blah blah */

Back

Type this word in the address bar of any browser to get to phpMyAdmin

Front

localhost

Back

Valuable platform integrating PHP and mySQL

Front

XAMPP

Back

Typical mySQL datatype for an 'id'

Front

INT

Back

When a table's structure is being viewed, this shows that a field is a primary key

Front

The name of the field is underscored

Back

Section 6

(50 cards)

function to show number of items in an array

Front

count

Back

To create a user in PHPmyAdmin, to to this place

Front

PHPmyAdmin Home Page>Privileges

Back

Button you push in mySQL to bring in external data

Front

import

Back

is data shown in the URL if GET is used?

Front

yes; use for search engines, catalogued pages, pages that would be bookmarked.

Back

besides GET and POST, what other predefined variable can you use to access data?

Front

$_REQUEST, but $_POST and $_GET are more precise, and therefore preferable.

Back

where is data sent using POST found?

Front

predefined variable $_POST

Back

why should you use comments before you shorthand variables for POST and GET?

Front

so you know which values are being passed from the form. // feedback.html passes title, name, email, response, comments $title = $_POST['title'] ...

Back

what should the action attribute's value contain?

Front

the URL to the php script that will handle the information in the form.

Back

can variable names begin with numbers?

Front

no.

Back

how can you set up error reporting?

Front

with the function error_reporting();

Back

show highest number in an array

Front

max

Back

PHP command name to tie in to a database

Front

mysqli_connect

Back

can variable names begin with underscores?

Front

yes.

Back

CSV

Front

Comma-Separated Values

Back

what type of variable is $_GET?

Front

predefined variable.

Back

when should you use single quotes?

Front

when there are no variables in the string; if you use single quotes, PHP will not search for variables to replace, which can enhance speed.

Back

URL

Front

Uniform Resource Locator

Back

Columns in Excel are analogous to _____ in mySQL

Front

fields

Back

can variable names contain symbols?

Front

no.

Back

will print $_SERVER work? why or why not?

Front

no, because you cannot use the print function on arrays.

Back

what types of arguments are used for error_reporting()?

Front

predefined constants that are not in quotations.

Back

when should you use double quotes?

Front

when a variable contains any amount of variables; in general.

Back

The default delimiter in mySQL that must be changed to bring in Excel CSV information

Front

;

Back

put an array in order of maximum value to minimum value

Front

rsort

Back

how do you know what to use to get a value from POST or GET?

Front

they are the values of the name attributes of the input tags in the form. $_POST['name'] or $_GET['name'] refers to the value of <input name="name" /> (depending on the method of the form).

Back

can a string with numbers be used as a number?

Front

yes. $string = "2"; can be used as $string = 2; can be used.

Back

true or false is called a

Front

boolean

Back

show lowest number in an array

Front

min

Back

what will happen if $_POST['name'] is used in double quotes?

Front

a parse error will occur, to avoid this, create shorthand variables like: $name1 = $_POST['name1']; $name2 = $_POST['name2'];

Back

what should be used to have multiple quotations in one string?

Front

the escape character '\': $string = "I said \"Hello\" to the man.";

Back

what type of variable is $_POST?

Front

predefined variable.

Back

are variable names case-sensitive?

Front

yes.

Back

will print $_GET work? why or why not?

Front

no, because you cannot use the print function on arrays.

Back

what can you use to display errors in a particular script?

Front

ini_set ('display_errors', 1); should be placed at top of script.

Back

is data shown in the URL if POST is used?

Front

no; use for passwords, pages that would not be bookmarked, pages that require security.

Back

To take an Excel file to a mySQL database, you must first convert it to a _____ file

Front

CSV

Back

what character must all variables begin with?

Front

the dollar sign $.

Back

can arrays contain arrays?

Front

yes, they commonly do contain arrays.

Back

put an array in order of minimum value to maximum value

Front

sort

Back

what type of variable is $_SERVER

Front

$_SERVER is a predefined variable.

Back

The 4 parameters, in the proper order, needed to connect to a PHP database

Front

host, userName, password, databaseName

Back

Make sure you do this to your Excel information before you convert to CSV file

Front

Make sure there are no commas in the entire sheet; if they are there, use global find/replace to make them something else you can change back to commas later using PHP

Back

Extension for an 2010 Excel file

Front

xlsx

Back

what can be used to print data in an array?

Front

not print; print_r (human readable) can be used.

Back

what is an 'index' or 'key'?

Front

what is referred to for a value within an array. $_POST['name'] may be equal to 'Jane Doe' $cards[4] may be equal to 'BMW'

Back

turn array1 into a string separated by commas and show it

Front

<?php echo $string1 = implode(" , ", $array1); ?>

Back

will print $_POST work? why or why not?

Front

no, because you cannot use the print function on arrays.

Back

This is a character you can place before a PHP/mySQL command that will suppress warnings on a user's screen if there are connection problems to a database. It should NOT be used in development (you want to see your warnings!) but it should be used for live sites (so as not to scare your users).

Front

@

Back

show all items in $array1

Front

print_r($array1);

Back

where is data sent using GET found?

Front

predefined variable $_GET

Back

Section 7

(50 cards)

describe the error type 'Error'

Front

Error is fatal, it is a general fatal error: memory allocation problem.

Back

what are some basic arithmetic operators?

Front

+ addition - subtraction * multiplication / division

Back

what function can be used to round up to the highest integer?

Front

ceil()

Back

define concatenate

Front

to append; add a string to the end of another string.

Back

describe the error type 'Notice'

Front

Notice is not fatal, but may or may not be indicative of a problem: referring to a variable with no value.

Back

what can htmlspecialchars() be used for?

Front

it converts certain HTML tags into their entity versions. <span> -> &lt;span&gt;

Back

what can urldecode() be used for?

Front

when applied, the value is decoded from its encoded nature; firstname+last name -> firstname lastname.

Back

what tag ends a php script?

Front

?>

Back

how does round() handle 0.5, 0.05, etc. rounds?

Front

half the time it rounds up, half the time it rounds down.

Back

what will error_reporting (E_ALL) do?

Front

it will show all error reporting.

Back

describe the error type 'Parse error'

Front

Parse error is fatal, caused by a semantic mistake: omission of a semicolon, imbalance of quotations, parentheses, or braces.

Back

what can the number_format() function be used for? (two answers)

Front

the function will format with commas and the second argument can determine how many decimals to round to.

Back

what is the second optional argument of the number_format() function?

Front

the number of decimal places to round to. number_format(125939.4958670, 3) will yield 125,939.496

Back

is round($num) the same as round ($num)

Front

yes, spaces are optional and not required after a function.

Back

what is the optional second argument of the round() function?

Front

the number of decimal places to round to. round(12.4958670, 3) will yield 12.496

Back

what can strtok() be used for?

Front

to create a substring (referred to as a token) from a larger string; $first = strtok($_POST['name'], ' ') finds first name because first and last name is separated by a space.

Back

what number do indices end at?

Front

the length minus one, and they always begin at zero.

Back

what will happen if there are no numbers to round? round (12, 2)

Front

zeros will be added to the end.

Back

what function can be used to find the absolute value of a number or numeric variable?

Front

abs()

Back

what are the seven main error reporting constants?

Front

E_NOTICE, E_WARNING, E_PARSE, E_ERROR, E_ALL, E_STRICT, E_DEPRECATED

Back

what will error_reporting (E_ALL | E_STRICT) do?

Front

it will show all errors that fall under E_ALL or E_STRICT, the pipe | is used for 'or' so that errors that fall under either will be shown; E_ALL & E_STRICT would be incorrect for this purpose because the error would have to fall under both E_ALL and E_STRICT.

Back

what can wordwrap() do?

Front

word wrap after a certain amount of characters.

Back

what tag begins a php script?

Front

<?php

Back

define precedence

Front

the order of operations.

Back

what counters htmlentities()?

Front

html_entity_decode()

Back

what will error_reporting (0) do?

Front

it will not show error reporting, it will be turned off.

Back

what is the default number of decimals that round() will round to?

Front

no decimals, it will round to the nearest integer.

Back

what is the first argument of the number_format() function?

Front

the number or numeric variable to be formatted.

Back

what operators can you use to operate and assign?

Front

+=, -=, *=, /= $num += 5 will yield $num + 5 $num /= 5 will yield $num / 5

Back

what can htmlentities() be used for?

Front

converts all HTML tags into their entity versions. <span> -> &lt;span&gt;

Back

what are the four main error types?

Front

Notice, Warning, Parse error, and Error.

Back

what is the concatenation operator?

Front

the period; .

Back

what can urlencode() be used for?

Front

when applied, the value can be passed safely through the URL (GET).

Back

what is the function getrandmax() for?

Front

it contains the highest value that rand() can have randomly

Back

what function can you use to create a random number?

Front

rand() function.

Back

what is the round() function used for?

Front

to round numeric values.

Back

what will strip_tags(nl2br($string)) do?

Front

nl2br will replace any new lines in $string with <br /> tags, and then strip_tags will remove any HTML or PHP tags, including the just inserted <br /> tags; use nl2br(strip_tags($string)) instead.

Back

what shorthand can you use to increment? decrement?

Front

$var++ and $var-- respectively.

Back

what is the first argument of the round() function?

Front

the number or numeric variable to be rounded.

Back

what number do indices begin at?

Front

zero, and they continue to the length of the string minus one.

Back

what function can be used to round down to the lowest integer?

Front

floor()

Back

what is the concatenation assignment operator?

Front

.= $greeting = 'hello, '; $greeting =. 'world!'; $greeting yields 'hello, world!'

Back

what are the first and second optional arguments of rand()?

Front

the lower limit and the upper limit for $num = rand(0, 10) $num must be between 0 and 10.

Back

what can strip_tags() be used for?

Front

removes all HTML and PHP tags.

Back

what will error_reporting (E_ALL & -E_NOTICE) do?

Front

it will show all error reporting except for notice errors.

Back

what can crypt() be used for?

Front

to encrypt values; it is a one-way encryption method, but you can compare $data to crypt($string), if, say, $string is a password as user has entered and $data is the password on file.

Back

what function can you use to format a number with commas?

Front

number_format()

Back

what is the nl2br() function used for?

Front

to convert new lines in a variable from a form to <br /> tags so that the data can be formatted correctly.

Back

describe the error type 'Warning'

Front

Warning is not fatal, but is probably problematic: misusing a function.

Back

how can you put a dollar sign before a variable like $10 where 10 is the variable's value?

Front

you can escape the first dollar sign; \$$cost; or you can use curly braces; ${$total}

Back

Section 8

(50 cards)

what can empty() be used for?

Front

to check if a given variable has an "empty" value - no value, 0, or FALSE.

Back

what are the three types of loops in PHP?

Front

for, while, foreach.

Back

what can strlen() be used for?

Front

to find the length of a string; strlen('Hello, world!') would yield 13

Back

does sort() maintain key-values?

Front

no.

Back

does asort() maintain key-values?

Front

yes.

Back

what can you use to merge arrays?

Front

the function array_merge(); $new_array = array_merge($array1, $array2); or you can use the + or += operators appropriately: $soups = $soups + $soups2; $soups += $soups2;

Back

how can you assign keys to the values in an array?

Front

with the array() function; $groceries = array(1 => 'apples', 2 => 'bananas', 3 => 'oranges'); $groceries = array( 1 => 'apples', 2 => 'bananas', 3 => 'oranges' ); the key does not have to be a number.

Back

how do you refer to an element in a multidimensional array?

Front

listing the indices in order of general to more precise; $meats = ('turkey', 'ham', 'chicken'); $vegetables = ('broccoli', 'lettuce', 'tomato'); $foods = array($meats, $vegetables); print $foods[1][1]; // lettuce print $foots[0][0]; // broccoli

Back

how can you iterate over the values of an array?

Front

for ($i = 0; $i < count($array); $i++) {statement(s);}

Back

what is the for loop designed to do?

Front

to perform specific statements for a determined number of iterations

Back

if you are worried about quotation marks while using arrays, what should you use?

Front

curly braces; print "<p>Monday's soup is {$soups['Monday'[}.</p>";

Back

what if you want to use trim() for the beginning of a string?

Front

you can use ltrim() (as in left-trim), because the left is the beginning of the string.

Back

how do you refer to an item in an array?

Front

$varname[key]; keys can be numbers or strings.

Back

what happens if you omit the third argument of substr()?

Front

the substring will contain the rest of the string starting at the index value provided by the second argument.

Back

can negative numbers be used with substr() to count backward?

Front

yes.

Back

what can isset() be used for?

Front

to check if a variable has any value (including 0, FALSE, or an empty string). $var1 = 0; $var 2 = 'something'; isset(var1); // TRUE isset(var2); // TRUE isset(var); // FALSE

Back

how do you append elements to an array?

Front

$array[] = item; will assign item to the next available index; associative arrays get messy.

Back

how do you create an array?

Front

with the array() function; $groceries = array('apples', 'bananas', 'oranges'); first element is assigned key 0 by default.

Back

how many arguments can isset() take?

Front

any amount.

Back

what can you do to reset an array?

Front

reassign the array() function to the array; $array = array();

Back

how can you iterate over the keys and values of an array?

Front

with the foreach loop; foreach ($array as $key => $value) {statement(s);} foreach ($array as $k => $v) {statement(s);}

Back

how can you sort the values while maintaining the correlation between each value and its key?

Front

the asort() function; arsort() can be used for reversed order; asort($array);

Back

what is a control structure?

Front

a conditional or loop.

Back

how can you reorganise the array randomly?

Front

the shuffle() function; shuffle($array);

Back

what can substr() be used for?

Front

to find a substring in a larger string using indices; $sub = substr($string, 2, 10) assigns $sub ten characters of $string starting at the second character of $string.

Back

does rsort() maintain key-values?

Front

no.

Back

what can str_word_count() be used for?

Front

to find the amount of words in a string.

Back

list some comparison operators

Front

== equality != inequality < less than > greater than <= less than or equal to >= greater than or equal to

Back

what if you want to use trim() for the end of a string?

Front

you can use rtrim() (as in right-trim), because the right is the end of the string.

Back

what is an indexed array?

Front

an array whose keys are numbers.

Back

what can str_ireplace() be used for?

Front

to replace a substring with another string; $me = 'first i. last'; $me = str_ireplace('i.', 'initial', $me); print $me; // 'first initial last' it is not case-sensitive.

Back

what is the while loop designed to do?

Front

to run until a condition is FALSE; for (initial expression; condition; closing expression) {statement(s);}

Back

what operator can you use to find the remainder of $x divided by $y?

Front

$z = $x % $y; $z will yield the remainder of $x / $y

Back

what control structure does continue exit?

Front

loops; any statements after the continue are not executed, but the condition of the loop is checked again afterward.

Back

can parentheses be used in conditional statements to set precedence?

Front

yes.

Back

what can you use to case-sensitively replace substrings with other strings?

Front

str_replace()

Back

what can you do to delete a variable?

Front

use the unset() function; unset($var); unset($array[7]);

Back

what can you do to determine the amount of elements in an array?

Front

use the count() function; $howmany = count($array);

Back

what control structure does break exit?

Front

if/elseif/else and switch statements.

Back

does ksort() maintain key-values?

Front

yes.

Back

how can you sort by the keys while maintaining the correlation between the key and its value?

Front

the ksort() function; krsort() can be used for reversed order; ksort($array);

Back

how can you iterate over the values of an array, but not the keys?

Front

with the foreach loop; foreach ($array as $value) {statement(s);}

Back

what can is_numeric() be used for?

Front

to check if a variable has a valid numerical value; strings with numerical values pass.

Back

what can trim() be used for?

Front

to remove any white space - spaces, newlines, tabs - from the beginning and end of a string, not the middle.

Back

what two conditionals does PHP have?

Front

if and switch.

Back

what can you do to delete an element of an array?

Front

use the unset() function; unset($array[7]);

Back

list some logical operators

Front

! negation AND and && and OR or || or XOR or not

Back

how can you sort values of an array without regard to the keys?

Front

the sort() function; rsort() can be used for reversed order; sort($array);

Back

what is a superglobal

Front

$_SERVER, $_POST, $_GET, $_COOKIE, $_SESSION, $_ENV; special arrays.

Back

what is an associative array?

Front

an array whose keys are strings; also known as a hash.

Back

Section 9

(50 cards)

how can you convert an array into a string?

Front

with the implode() function; join() also works; $string = implode(glue, $array);

Back

mysql_free_result()

Front

Free result memory

Back

mysql_close()

Front

Closes a non-persistent MySQL connection

Back

mysql_data_seek()

Front

Moves the record pointer

Back

mysql_error()

Front

Returns the error description of the last MySQL operation

Back

mysql_drop_db()

Front

Deprecated. Deletes a MySQL database. Use mysql_query() instead

Back

what are the possible modes for fopen()?

Front

r reading only; begin reading at the start of the file; r+ reading or writing; begin at the start of the file; w writing only; create the file if it does not exist, and overwrite any existing contents; w+ reading or writing; create the file if it does not exist, and overwrite any existing contents (when writing); a writing only; create the file if it does not exist, and append the new data to the end of the file; a+ reading or writing; create the file if it does not exist, and append the new data to the end of the file (when writing); x writing only; create the file if it does not exist, but do nothing (and issue a warning) if the file does exist. x+ reading or writing; create the file if it does not exist, do nothing (and issue a warning) if the file already exists (when writing); b can be paired with any of the above modes, which forces the file to open in binary mode (safer).

Back

how do you declare a constant?

Front

by using the define() function; define ('CONSTANT', value); constants are usually capitalised, but do not have to be; you DO NOT use dollar signs - they are constants not variables.

Back

mysql_fetch_row()

Front

Returns a row from a recordset as a numeric array

Back

how can the list() function be used?

Front

to assign array element values to individual variables; $date = array('Thursday', 23, 'October'); list($weekday, $day, $month) = $date; now a $weekday, $day, $month variable exist, with respective values; must be indexed, beginning with 0; arguments cannot be omitted but can be ignored; list($weekday, ,) = $date;

Back

what does rsort() sortby?

Front

reversed values; key-values not maintained.

Back

mysql_fetch_assoc()

Front

Returns a row from a recordset as an associative array

Back

mysql_fetch_lengths()

Front

Returns the length of the contents of each field in a result row

Back

mysql_client_encoding()

Front

Returns the name of the character set for the current connection

Back

how can you discern if a constant is already declared?

Front

by using the defined() function; defined('CONSTANT'); usually used with conditional statements.

Back

mysql_field_len()

Front

Returns the maximum length of a field in a recordset

Back

what does asort() sort by?

Front

values; key-values maintained.

Back

what is the syntax for connecting to a database?

Front

$dbc = mysql_connect(hostname, username, password);

Back

mysql_db_name()

Front

Returns a database name from a call to mysql_list_dbs()

Back

what does ksort() sort by?

Front

keys; key-values maintained.

Back

mysql_field_table()

Front

Returns the name of the table the specified field is in

Back

mysql_field_type()

Front

Returns the type of a field in a recordset

Back

does krsort() maintani key-values?

Front

yes.

Back

mysql_fetch_field()

Front

Returns column info from a recordset as an object

Back

mysql_fetch_object()

Front

Returns a row from a recordset as an object

Back

what does SQL stand for?

Front

structured query language.

Back

mysql_errno()

Front

Returns the error number of the last MySQL operation

Back

what functions can you use to include files?

Front

include() and require(); include() will give errors, require() will terminate execution().

Back

what function can you use to find how many substrings are in a string?

Front

the substr_count(); substr_count($_POST['email'], '@') // counts @ signs in $_POST['email']

Back

how can you convert a string into an array?

Front

with the explode() function; $array = explode(separator, $string);

Back

does arsort() maintain key-values?

Front

yes.

Back

mysql_affected_rows()

Front

Returns the number of affected rows in the previous MySQL operation

Back

what do natsort() and natcasesort() do?

Front

they sort using natural order while maintaining key-value; name2 is placed before name12; sort() would place name12 before name2.

Back

how do you close a connection between a database?

Front

mysql_close($dbc);

Back

what are the seven main SQL functions?

Front

alter - modifies existing table; create - creates database or table; delete - deletes records from a table; drop - deletes a database or table; insert - adds records to a table; select - retrieves records from a table; update - updates records in a table;

Back

mysql_field_name()

Front

Returns the name of a field in a recordset

Back

what does arsort() sort by?

Front

reversed values; key-values not maintained.

Back

mysql_change_user()

Front

Deprecated. Changes the user of the current MySQL connection

Back

mysql_create_db()

Front

Deprecated. Creates a new MySQL database. Use mysql_query() instead

Back

mysql_field_seek()

Front

Moves the result pointer to a specified field

Back

what does sort() sort by?

Front

values; key-values not maintained.

Back

mysql_fetch_array()

Front

Returns a row from a recordset as an associative array and/or a numeric array

Back

mysql_connect()

Front

Opens a non-persistent MySQL connection

Back

mysql_escape_string()

Front

Deprecated. Escapes a string for use in a mysql_query. Use mysql_real_escape_string() instead

Back

mysql_db_query()

Front

Deprecated. Sends a MySQL query. Use mysql_select_db() and mysql_query() instead

Back

mysql_field_flags()

Front

Returns the flags associated with a field in a recordset

Back

what does fopen() do?

Front

creates a pointer to a file with the declared mode (read, write, etc.).

Back

what does krsort() sort by?

Front

reversed keys; key-values maintained.

Back

how can you create an array with an HTML form?

Front

by making the name attribute equal to the name of the array, and the value equal to the value of an element of the array; this makes $_POST or $_GET multidimensional.

Back

what function can be used to get time data?

Front

the date() function; date('formatting').

Back

Section 10

(50 cards)

Multiple Condition Operators

Front

AND & OR connect conditions AND causes rows that satisfy all (priority executed 1st) OR causes rows that satisfy at least one Parenthesis can be used to change the priority

Back

SYNTAX Comma

Front

If you forget to add a comma a column may be aliased accidently

Back

Rules for Subqueries

Front

Must: -Be enclosed in parenthesis -a derived table (SELECT) statement being used instead of a table name. -derived tables must be aliased

Back

mysql_unbuffered_query()

Front

Executes a query on a MySQL database (without fetching / buffering the result)

Back

Condition of a WHERE clause

Front

WHERE CurrentSalary >= $4000 Results all records where the salary is greater than or equal to $4000

Back

mysql_get_client_info()

Front

Returns MySQL client info

Back

ORDER BY

Front

Orders your data in the manner you select via ColumnName or TableName.ColumnName Without ORDER BY any random number of rows may be returned Not allowed in a view definition except in:

Back

Order of the SELECT Statement Clauses

Front

SELECT FROM JOIN WHERE GROUP BY HAVING ORDER BY

Back

BETWEEN

Front

Conditional WHERE operator BETWEEN <value> AND <value> within a value range

Back

NOT LIKE

Front

Opposite of LIKE - used in the WHERE Statement

Back

DCL Commands

Front

Data Control Language GRANT, REVOKE, DENY

Back

SELECT DISTINCT

Front

Purpose is to remove duplicates Opposite of SELECT DISTINCT is ALL or *

Back

NOT IN

Front

Conditional WHERE operator (<value>,...<value>) Different from all values

Back

mysql_ping()

Front

Pings a server connection or reconnects if there is no connection

Back

mysql_tablename()

Front

Deprecated. Returns the table name of field. Use mysql_query() instead

Back

mysql_list_dbs()

Front

Lists available databases on a MySQL server

Back

IN

Front

Conditional WHERE operator (<value>,...<value>) Equal to any value

Back

DDL Commands

Front

Data Definition Language CREATE, ALTER, DROP

Back

mysql_list_tables()

Front

Deprecated. Lists tables in a MySQL database. Use mysql_query() instead

Back

mysql_get_server_info()

Front

Returns MySQL server info

Back

mysql_get_proto_info()

Front

Returns MySQL protocol info

Back

mysql_select_db()

Front

Sets the active MySQL database

Back

Query Optomizer

Front

figures out the most efficient way to get info "How"

Back

mysql_list_processes()

Front

Lists MySQL processes

Back

mysql_insert_id()

Front

Returns the AUTO_INCREMENT ID generated from the previous INSERT operation

Back

Subquery

Front

SELECT statement embedded inside another statement

Back

mysql_get_host_info()

Front

Returns MySQL host info

Back

mysql_info()

Front

Returns information about the last query

Back

Rules for CTE's

Front

May be nested May reference another previously declared May reference itself recursively

Back

Alias

Front

Alias's can be given to a column or an expression with the AS (ANSI)

Back

Purpose of the WHERE clause

Front

is a RESTRICTION - it filters out the rows that don't satisfy the condition

Back

TOP

Front

Keyword that specifies the # of rows or the percentaget to return. Data may seem ordered but it is ordered by the entry into the dbse not any other logical order so you must order your data. Meaningless in an unordered set

Back

Query does what?

Front

Defines a result set that is structured like a table and can be accessed like a real table

Back

mysql_thread_id()

Front

Returns the current thread ID

Back

mysql_result()

Front

Returns the value of a field in a recordset

Back

mysql_stat()

Front

Returns the current system status of the MySQL server

Back

ESCAPE clause

Front

used in the LIKE condition defines a character as an escape character

Back

SELECT in FROM clause?

Front

a SELECT statement can be used instead of a table name. This is called a derived table or inline view

Back

mysql_pconnect()

Front

Opens a persistent MySQL connection

Back

NOT BETWEEN

Front

Conditional WHERE operator (<value>AND<value>) Outside a value range

Back

CTE

Front

Common Table Expression Subquery that is declaired and named prior to use

Back

mysql_num_fields()

Front

Returns the number of fields in a recordset

Back

WHERE clause operators

Front

= equal to <> not equal to > greater than >= greater than or equal to < less than <= less than or equal to

Back

mysql_real_escape_string()

Front

Escapes a string for use in SQL statements

Back

mysql_list_fields()

Front

Deprecated. Lists MySQL table fields. Use mysql_query() instead

Back

DML Commands

Front

Data Manipulation Language SELECT, INSERT, UPDATE, DELETE

Back

LIKE

Front

Part of the WHERE clause is used for testing and uses special characters % any character (including zero) (ANSI) _ any character, exactly 1 occurence (ANSI) [ ] a range of characters [^ ] Does not match the range or distince characters

Back

mysql_num_rows()

Front

Returns the number of rows in a recordset

Back

mysql_query()

Front

Executes a query on a MySQL database

Back

EXPRESSIONS

Front

Concatenation of strings, an arithmetic expression, adding a number of days to a date

Back

Section 11

(50 cards)

JOIN Execution

Front

Loop Join - row by row Merge Join - Merge two sorted result sets Hash Join - build hash keys based on join columns

Back

for... in statement syntax?

Front

var person={fname:"john",lname:"doe",age:"25"}; var x; for (x in person) { document.write(person[x]+" "); } ------- loops through all variables attached to person;

Back

switch statement syntax?

Front

switch(variable) { case 1; code break; case "example"; code break default; code }

Back

OUTTER JOIN

Front

Finds Missing - will contain NULL

Back

DISTINCT, ORDER BY, TOP Sequence

Front

WHERE, DISTINCT, ORDER BY, TOP

Back

javascript syntax for a (limited loop based on specifications) syntax?

Front

for(variable=startvalue;variable<=endvalue;variable=variable+increment) { code to be run until loop is complete. }

Back

Left or Right Outer Join

Front

1 table is more important than the other

Back

Equi-Join

Front

Join conditions test for equality

Back

HTML DOM mouse events?

Front

onclick ondblclick mousedown mousemove mouseover mouseout mouseup

Back

properties of methods defined?

Front

properties - are values associated with an object i.e. length methods - are actions (functions) that can be performed on objects ie toUpperCase [an uppercase method]

Back

ON Condition

Front

Part of JOIN specifies how the rows in the tables relate to each other the column names have prefixes to specify the table in which each column is located.

Back

logical operators?

Front

&& [and] || [or] ! [not]

Back

function syntax and purpose?

Front

function functionName(var1,var2,..,var99) { some code } functions allows scripts to be executed when called.

Back

JOIN

Front

Query that retrieves columns from multiple tables Most common join conditions are primary and foreign keys Without a join condition the product is a Cartesian Product

Back

return statement syntax?

Front

function product(a,b) { return a*b; } alert(product(4,3)) <-- will alert 12 return function gives a value back based on function variables.

Back

alert box syntax?

Front

alert("message");

Back

calling an external javascript file syntax?

Front

<script type="text/javascript" src="javascript.js"> </script>

Back

types of strings object properties

Front

constructor- returns the function that created the objects prototype. length- returns the length of characters of a string. prototype-allows you to add properties and methods to an object.

Back

javascript comment syntax?

Front

/ / for multiple lines // for a single line

Back

NULL

Front

Unknown or Missing Not the same as blank Not the same as zero when NULL is added to an expression the result is NULL 5000 * NULL = NULL

Back

prompt box syntax?

Front

x="prompt("text here","default value"); if(x!="null" && x!="") { alert("hello "+x+" how are you today?") }

Back

confirm box syntax?

Front

r=confirm("press a button") if(r==true) { alert('you pressed ok!'); } else { alert('you pressed cancel'); }

Back

special text insertions?

Front

\' single quote \" double quote
new line \r carriage return \t tab \b backspace \f form feed

Back

ISNULL

Front

ISNULL returns argument1 if it is not NULL ISNULL returns argument2 if argument1 is NULL SQL specific

Back

Is javascript case sensitive?

Front

yes!

Back

conditional variable syntax?

Front

z=(x==y)?5:6 z = 5 if x=y; z = 6 if x!=y;

Back

object based programming what does this mean?

Front

objects have properties & methods for example { var txt="Hello World!"; document.write(txt.length) } gives the property of length of txt and writes it to the doc which is 12.

Back

Theta-JOIN

Front

Does not test for equality; nested tables; all types of conditions are possible: >, <, <>, between

Back

Chained Outter Join

Front

A query that has multiple outer joins

Back

numbers + strings =? 5+"5" = ?

Front

strings 55

Back

CROSS JOIN

Front

has no JOIN condition (ON clause) Each rows in one table is paired to every row in the other table Syntax: CROSS JOIN AKA Cartesian Product

Back

the break and continue statement?

Front

if(i==3) { break; } breaks loop if(i==3) { continue; } breaks loop and restarts at next value;

Back

how to make a case sensitive (single) search?

Front

("w3schools") - case sensitive (/w3schools/) - case insensitive /content/;

Back

onsubmit should be used for what and where?

Front

validating form fields ex. <form action="blah.asp" methond="post" onsubmit="return checkForm()">

Back

javascript starts counting on what?

Front

0

Back

COALESCE function

Front

similar to ISNULL COALESCE is (ANSI) Returns the 1st non-NULL argument Returns NULL if all argruments are NULL

Back

x=x+y is the same as what? or x=x/y?

Front

x+=y or x/=y

Back

else if conditional syntax?

Front

if(condition) { code } else if(condition) { code }

Back

syntax for line breaks in an alert box?

Front

'/n' + " here"

Back

can variables include other variables?

Front

yes

Back

TIES

Front

two or more rows return the exact data - that's a TIE WITH TIES does not work w/out ORDER BY If both DISTINCT & TOP are used DISTINCT takes prefernce over TOP

Back

Full Outer Join

Front

Full Outer Join - both tables are important

Back

Self Join

Front

A table is joined to itself Table aliases must be used to distinguish

Back

Hierarchy of Employees

Front

Ex. of a recursive relationship

Back

if a variable is not a function and does not have var then it is?

Front

a global variable

Back

INNER JOIN

Front

default, exact match Syntax: INNER JOIN Orders JOIN Customers = Orders INNER JOIN Customers

Back

The while loop (a loop executed when a specific condition is met) syntax?

Front

while(variable<=endvalue) { code to be executed }

Back

numerical comparison operators?

Front

x==y [x is equal to y] x===y [x is exactly equal to y] != [not equal to] > [greater than] < [less than] >= [greater than or equal to] <= [less than or equal to]

Back

WHERE clause

Front

Restricts & is evaluated after the JOIN has been executed

Back

making a global (multiple) case insensitive search?

Front

/content goes here/g; var x = /money/g

Back

Section 12

(50 cards)

creating an uncondensed array?

Front

var x = new Array(); //regular array x[0] = "black"; x[1] = "white"; x[2] = "green"; x[3] = "yellow"; x[4] = "blue"; x[5] = "red";

Back

split() method does what?

Front

splits a string into an array of substring and returns the new array e.x. string.split(separator,limit) x="hello world" document.write(x.split(" ",1))---> hello

Back

substring() does what?

Front

extracts characters from a string between two specified #'s and returns it as a new string. [start at 0] e.x. string.substring(from,to) x="hello world" document.write(x.substring(0,4))--->hello

Back

how to access an array?

Front

string[array index]

Back

array object methods

Front

...

Back

search() method does what?

Front

searches for a match between a regular expression and the string and returns the position e.x. string.search(regexp) x="hello world" document.write(x.search("wo"))--->7

Back

indexOf() method does?

Front

returns the position of the first found occurrence of a specified value in a string e.x. string.indexOf(searchstring,start) x="hello world" document.write(x.indexOf("world",0))-->7

Back

slice() method does what?

Front

selects a part of an array and returns an array [starts from 0, original not changed] array.slice(begin,length) x=["1","2","3"] document.write(x.slice(0,2))-->1,2

Back

LN10 is what?

Front

natural logarithm of 10 approx (2.302)

Back

slice() method does what?

Front

extracts a part of a string and returns the extracted part in a new string(-1 if null) e.x. string.slice(begin,end) x="hello" document.write(x.slice(0,3))---> hell

Back

what is an array?

Front

an object used to store multiple values in a single variable.

Back

PI is what?

Front

PI approx (3.14159)

Back

valueOf() method does what?

Front

returns the primitive value of an array array.valueOf()

Back

e is what?

Front

eulers numbers approx (2.718)

Back

valueOf() method does what?

Front

returns the primitive value of a string. e.x. string.valueOf() x= "Hi!" document.write(x.valueOf())----> Hi!

Back

charAt() method does?

Front

returns the character at the specified index e.x. string.charAt(index) x="hello world" document.write(x.charAt(0))-->h

Back

LN2 is what?

Front

natural logarithm of 2 approx (0.693)

Back

string object methods

Front

...

Back

unshift() method does what?

Front

adds new elements to the beginning of an array and returns new length array.unshift(ele1,ele2,...,ele99) x=["1","2","3"] document.write(x.unshift("4"))-->4

Back

substr() does what?

Front

same as substring except uses length as opposed to a stop number e.x. string.substr(start,length) x="hello world" document.write(x.substr(0,4))--->hello

Back

Math object methods

Front

...

Back

SQRT1_2 is what?

Front

square root of 1/2 approx (0.707)

Back

SQRT2 is what?

Front

square root of 2 approx (1.414)

Back

pop() does what?

Front

removes the last element of an array and returns it [alters original] array.pop() fruits=["apple","nana","grape","orange"] document.write(fruits.pop())-->orange document.write(fruits())-->apple,nana,grape

Back

creating a condensed array?

Front

var x = new array ("white","black","red","green","blue") //condensed array

Back

charCodeAt() method does?

Front

returns the unicode of the character at a specific index in a string. e.x. string.charCodeAt(index) x="hello world" document.write(x.charCodeAt(0))--->72

Back

the last index in a string is?

Front

string.length-1

Back

match() method does?

Front

searches for a match between the regexp and a string and returns the matchs e.x. string.match(regexp) x="hello world" document.write(x.match("hello"))-->hello

Back

toLowerCase() method does what?

Front

converts a string to lowercase letters e.x. string.toLowerCase() x="BLAH" document.write(x.toLowerCase())---->blah

Back

toString() method does what?

Front

converts an array to a string, returns the result x=["1","2","3"] document.write(x.toString())-->1,2,3

Back

Math object properties

Front

...

Back

concat() method does?

Front

joins 2 or more strings then returns a copy. e.x. string.concat(string2) x="hello world " y="goodbye world" document.write(x.concat(y))--> hello world goodbye world

Back

reverse() method does?

Front

reverse the order of elements in an array (first is last, last is first) array.reverse() x=["1","2","3"] x.reverse() document.write(x)-->3,2,1

Back

toUpperCase() method does what?

Front

converts a string to uppercase letters e.x. string.toUpperCase() x="blah" document.write(x.toUpperCase())---->BLAH

Back

parseFloat() does what?

Front

gets a decimal number from a string [not part of the math object] parseFloat(string) document.write(parseFloat("45.1nn"))-->45.1 document.write(parseFloat("45nn"))-->45

Back

what does abs() method do?

Front

determines the absolute value of x Math.abs(x) document.write(Math.abs(-7))-->7

Back

the Math object allows you to?

Front

perform mathematical equations and tasks.

Back

sort() method does what?

Front

sorts the elements of an array (alphabetical default) [changes original] array.sort(sort function) x=["a","b","c"] y=["a","c","b"] document.write(y.sort())-->a,b,c

Back

parseInt() does what?

Front

gets a number from a string [not part of the math object] parseInt(string) document.write(parseInt("45.1nn"))-->451 document.write(parseInt("45nn"))-->45

Back

LOG10E

Front

base-10 logarithm of E approx (0.434)

Back

sort() for numbers?

Front

sorting by numbers is different, using a sort function is necessary. function sortNumber(a,b) { return b-a;// for descending return a-b;// for ascending }

Back

creating a literal array?

Front

var x = ["black","white","red","blue","green"]

Back

concat() method does what?

Front

joins 2 or more arrays array.concat(array2)

Back

lastIndexOf() method does what?

Front

returns the position of the last occurence of a specified value in a string. e.x. string.lastIndexOf(regexp,start) x="hello world" document.write(x.lastIndexOf("wo",0))--->7

Back

push() method does what?

Front

adds new elements to an array [alters original] array.push(ele1,ele2,..,ele99) x=["1","2","3"] x.push("4") document.write(x)-->1,2,3,4

Back

fromCharCode() method does what?

Front

converts unicode values into characters [does not use strings] document.write(string.fromCharCode(72))--> H

Back

shift() method does what?

Front

removes the first elements in an array and returns it [alters original] array.shift() x=["1","2","3"] document.write(x.shift())--->1 document.write(x)--->2,3

Back

LOG2E is what?

Front

base-2 logarithm of E approx (1.442)

Back

replace() method does what?

Front

searches for a regexp or substring and replaces it with a new string. e.x. string.replace(regexp/substr,newstring) x="hello world" document.write(x.replace("hello","goodbye"))-->goodye world

Back

join() does what?

Front

joins all elements of an array into a string array.join(seperator) x=["1","2","3"] document.write(x.join(" and ")) --> 1 and 2 and 3

Back

Section 13

(50 cards)

\S meta character does what?

Front

used to find a non-whitespace character x="hello world" y=/\S/g document.write(x.match(y))-->h,e,l,l,o,w,o,r,l,d

Back

regexp means what?

Front

regular expression

Back

\w meta character does what?

Front

finds a word character (a-z,A-Z,0-9) x="hello world!%" y=/\w/g document.write(x.match(y))--> h,e,l,l,o, ,w,o,r,l,d

Back

what does the n$ quantifier do?

Front

matches any string with n at the end x="hello world" y=/ld$/g document.write(x.match(y))--> ld

Back

. meta char does what?

Front

finds a single character (can be used in combination) except newline or other line terminators x="hello world" y=/h.l/g document.write(x.match(y))--> hel

Back

what does ceil() method do?

Front

rounds a number upwards to the nearest interger and returns the result Math.ceil(number) document.write(Math.ceil(2.3))--> 3

Back

what does the n{x,} quantifier do?

Front

matches any string that contains a sequence of atleast X n's [x must be a number] x="100, 1000 or 10000" y=/\d{3,}/g document.write(x.match(y))--> 100,1000,10000

Back

what does exp() method do?

Front

returns the value of a user-defined power to eulers number Math.exp(number) document.write(Math.exp(1))-->2.7183

Back


meta chracter does what?

Front

used to find a newline character (only useful in alert text) x="hello
world" y=/
/g document.write(x.search(y))--> 5

Back

what is a regular expression?

Front

an object that describes a pattern of characters

Back

\B meta character does what?

Front

find a match that is not at the beginning of a word (or returns null) x="hello world" y=/\Borld/g document.write(x.match(y))--> orld

Back

regexp quantifiers

Front

can be used in conjunction with metacharacters

Back

7 values that make boolean false

Front

0 -0 null " " false undefined NaN <-- not a number

Back

what does the n{x,y} quantifier do?

Front

matches any string that contains a sequence of X to Y n's [x and y must be #'s] x="100, 1000 or 10000" y=/\d{4,5}/g document.write(x.match(y))--> 1000,10000

Back

RegExp modifiers

Front

...

Back

\b meta character does what?

Front

used to find a match at the beginning or end of a word (if none null) x="hello world" y=/\bworld/g document.write(x.match(y))--> world

Back

what does the n* quantifier do?

Front

matches any string that contains zero or more occurrences of n x="hello world" y=/lo*/g document.write(x.match(y))--> lo,l

Back

what does the n{x} quantifier do?

Front

matches any string that contains a sequences of x n's x="100, 1000 or 10000" y=/\d{4}/g document.write(x.match(y))--> 1000,1000

Back

what does pow() method do?

Front

returns the value of x to the power of y Math.pow(x,y) document.write(Math.pow(4,2))-->16

Back

\0 meta character does what?

Front

finds a nul character

Back

what does acos() method do?

Front

returns the arccosine of a number in radians Math.acos(x) document.write(Math.acos(0.64))-->0.87629

Back

how is regexp defined?

Front

var patt = new RegExp(pattern,modifiers) or var patt = /pattern/modifiers

Back

regexp brackets

Front

find a range of characters

Back

what does sin() do?

Front

returns the sine of a number (-1 to 1) Math.sin(number) document.write(Math.sin(3))-->0.1411

Back

what are regexp modifiers?

Front

used to perform case-insensitive and global searches

Back

booleans only non-primitve is what?

Front

toString() boolean.toString()

Back

what does the log() method do?

Front

returns the natural logarithm (base E) of a number Math.log(number) document.write(Math.log(2))-->0.6931

Back

what does the ^n quantifier do?

Front

matches any string with n at the beginning x="hello world" y=/^he/g document.write(x.match(y))--> he

Back

what does round() method do?

Front

rounds a number to the nearest interget Math.round(x) document.write(Math.round(5.5))-->6 document.write(Math.round(5.49))-->5

Back

regexp metacharacters

Front

are characters with a special meaning

Back

\s meta character does what?

Front

finds a whitespace chracters x="hello world " y=/\s/g document.write(x.match(y))--> , ,

Back

what does the max() method do?

Front

returns the number with the highest value Math.max(x,y,z) document.write(Math.max(10,5,-1))-->10

Back

what does the method tan() do?

Front

returns the tangent of a number Math.tan(number) document.write(Math.tan(90))-->-1.995

Back

the boolean has a default value of?

Front

true

Back

\D meta character does what?

Front

used for find a non-digit character x="hello world9" y=/\D/g document.write(x.match(y))--> h,e,l,l,o, ,w,o,r,l,d

Back

what does the g modifier do?

Front

performs a global match (instead of stopping at first found) /regexp/g x="hello world" y=/o/g document.write(x.match(y))--> o,o

Back

what does atan() method do?

Front

returns the arctangent of a number in radians Math.atan(x) document.write(Math.atan(2))-->1.1071

Back

the purpose of the boolean object?

Front

to convert a non-boolean value to a boolean value (true or false) value.

Back

what does the random() method do?

Front

returns a random number between 0 and 1 [use .floor() and * to get a higher number] Math.random() document.write(Math.random())-->0.57

Back

what does floor() method do?

Front

rounds a number to down to the nearest interger Math.floor(number) document.write(Math.floor(5.3))-->5

Back

\d meta character does what?

Front

finds a digit from 0-9 x="hell1o world" y=/\d/g document.write(x.match(y))--> 1

Back

what does sqrt() do?

Front

returns the square root of a number Math.sqrt(number) document.write(Math.sqrt(9))-->3

Back

what does cos() method do?

Front

returns the cosine of a number Math.cos(number) document.write(Math.cos(3))-->-0.9899

Back

what does atan2() method do?

Front

returns the arctangent between positive x-axis and the point Math.atan2(x,y) document.write(Math.atan2(8,4))-->1.1071

Back

what does the i modifier do?

Front

performs a case insensitive search /regexp/i x="hello world" y=/world/i document.write(x.match(y))--> world

Back

what does the n+ quantifier do?

Front

matches any string that contains at one n x="hello world" y=/w+/g document.write(x.match(y))--> hello,world

Back

bracket examples

Front

[new RegExp("[abc]") or /[abc]/] [abc] - find any character between bracks [^abc] - find any char not in bracks [0-9] - find any digit 0-9 [A-Z] - find any char from uppercase A to uppercase Z [a-z] - find any char from lowercase a to lowercase z [A-z] - find any char from uppercase A to lowercase Z (red|blue|green) - find any of the alternations specified

Back

\W meta character does what?

Front

finds a non-word character x="hello world!%" y=/\W/g document.write(x.match(y))--> !,%

Back

what does min() method do?

Front

returns the number with the lowest value Math.min(x,y,z) document.write(Math.min(10,5,-1))-->-1

Back

what does the n? quantifier do?

Front

matches any string that contains zero or one occurences of n x="hello world" y=/lo?/g document.write(x.match(y))--> lo,l

Back

Section 14

(50 cards)

what does the ?=n quantifier do?

Front

matches any string that is followed by a specific string of n x="hello world" y=/hello(?=world)/g document.write(x.match(y))--> hello

Back

determining if cookies are enabled?

Front

navigator.cookieEnabled - true or false

Back

is there a standard that applies to the navigator object?

Front

no, therefore determining browsers becomes quite an ordeal.

Back

after() does?

Front

$("selector").after(content) inserts content after each of the matched elements

Back

what does the test() method do?

Front

tests for a match in a string, returns true or false (true if found, false if not) y=/regexp/ y.test(string)

Back

manipulating attribute? [1/5]

Front

$("selector").attr(name) - retrieves values on named attribute

Back

regexp object properties

Front

...

Back

manipulating attribute? [2/5]

Front

$("selector").attr(properties) --------------------------------------- sets a series of attributes on all matched elements ---------------------------------------- $("img").attr({src:"/images/hat.gif",title:"jquery",alt:"jquery logo"})

Back

jquery form filters?

Front

:input :text :password :radio :checkbox :submit :reset :image :button :file - filters all upload elements

Back

jquery child filters?

Front

:nth-child(index) :nth-child(odd) :nth-child(odd) :nth-child(equation) - variable selection [2n] :first-child :last-child :only-child

Back

basic jquery selectors continued? [2/2]

Front

:header - gets all header eles :animated - any animated eles :not(selector) - all eles but the selected -------------------------------------------------- p:not(p.a) <- gets all p but p with a class of a.

Back

what does the lastIndex property do?

Front

specified the index at which to start the next match [specified character position after last match] x="string string string" y=/regexp/gi while(y.text(x)==true) { document.write("i found the index at: " + y.lastIndex) } firstmatch index number, second match index number

Back

appendTo() does?

Front

appendTo(selector) appends all of the matched elements to another set of specified elements

Back

getting text content of an element?

Front

$("selector").text() - returns text content of first matched $("selector").text(newcontent) - changes text of all matched eles

Back

manipulating attribute? [3/5]

Front

$("selector").attr(key,value) sets a value for a single attribute on all matched elements

Back

regexp object methods

Front

...

Back

what does the global property do?

Front

specified if the "g" modifier is set /regexp/g

Back

prepend() does?

Front

prepend(content) prepends the content to every matched element

Back

insertAfter() does?

Front

$("selector").insertAfter(selector) inserts all of the [last] matched elements after all the specified [first] set of elements

Back

jquery content

Front

...

Back

wrapAll() does?

Front

wrapAll(html) [expanding] wraps all matched element with the specified html content. wrapAll(element) wraps all of matched element with a single specified element.

Back

statment chaining allows?

Front

multiple function to be executed on a single selector at once $("selector").method().method()

Back

what is a cookie?

Front

a cookie is a variable that is stored on a users computer.

Back

jquery form selectors?

Front

:enabled :disabled :checked :selected

Back

basic jquery selectors?

Front

$("tagName") #id .class *all elements

Back

what does the compile() method do?

Front

[edits source] the compile method is used to compile and recompile a regexp y=/regexp/ y.compile(regexp,modifier)

Back

append() does?

Front

append(content) appends every matched element to the content

Back

wrapInner() does?

Front

wrapInner(html) [ul->li wrap] wraps the inner contents of the specified set with the html. wrapInner(element) wraps the inner contents of the specified set with the specified element.

Back

manipulating attribute? [4/5]

Front

$("selector").attr(key,fn) sets a single property to a computed value [where fn=function]

Back

wrapping, replacing, removing

Front

...

Back

prependTo() does?

Front

prependTo(selector) prepends all the matched elements to all the specified elements

Back

getting HTML content?

Front

$("selector").html() - returns html+text [first element] $("selector").html(newcontent) - sets the new HTML

Back

what deos the ?!n quantifier do?

Front

matches any string that is not follwed by specific string n x="hello world" y=/hello(?!world)/g document.write(x.match(y))-->

Back

is jquery case sensitive?

Front

YES

Back

content and visibility filters?

Front

:contains(text) - only includes selection with specified text :empty - only empty elements :has(selector) - only includes elements that contain selected elements :visible - only if visible :hidden - only if hidden

Back

jquery attribute filters?

Front

[attribute] - all eles with the atrribute [attribute=value] [attribute!=value] - attribute is not value [attribute^=value] - starts with specified value [attribute$=value] - ends with specified value [attribute*=value] - value anywhere in attribute

Back

wrap() does?

Front

wrap(html) [closes itself <div />] wraps each matched element with the specified html content. wrap(element) wraps each of matched element with a specified element.

Back

before() does?

Front

$("selector").before(content) inserts content before each of the matched elements

Back

finding browsers and app.name?

Front

navigator.appName - name navigator.appVersion - version #

Back

insertBefore() does?

Front

$("selector").insertBefore(selector) inserts all of the [last] matched elements before all the specified [first] set of elements

Back

what does the exec() method do?

Front

tests for a match in a string (returns matched text if found null if not) y=/regexp/ y.exec(string)

Back

jquery traversing?

Front

$("p").size() - returns length $("p").get(index) - returns the indexed element's content $("p").find(exp) - searches for elements that match exp $("p").each(fn) - execute a function within ever match elemenet

Back

what does the ignoreCase property do?

Front

specified if the "i" modifier is set /regexp/i

Back

empty() does?

Front

$("selector").empty() removes all child nodes from the set of matched elements.

Back

basic jquery selectors continued? [1/2]

Front

:first :last :even :odd :eq(n) - filters all but (n) :gt(n) - greater than (n) :lt(n) - less than (n)

Back

replaceWith() / replaceAll() do?

Front

replaceWith(content) replaces alll the matched elements with the specified html. replaceAll(selector) replaces all the matched elements with the newly specified one.

Back

can javascript detect a browser type?

Front

yes and version.

Back

what does the source property do?

Front

returns the source of the regexp x=/regexp/gi document.write(x.source)-->regexp

Back

manipulating attribute? [5/5]

Front

$("selector").removeAttr(name) removes the named attribute from all matched elements.

Back

inserting content

Front

...

Back

Section 15

(50 cards)

jquery custom animations

Front

...

Back

one() does?

Front

one(event, data(fn), handler) same as .bind() but is only executed once for each matched element.

Back

width() does?

Front

width(value) either returns the value of width from the first matched element, or sets all of the matched elements width.

Back

unbind() does?

Front

$("selector").unbind(event,handler) removes the bind() elements properties.

Back

jquery helper functions

Front

...

Back

jquery event object

Front

...

Back

things to know about jquery events!

Front

1.event -> variavles are declared within functions $("div").click(function(evt){ $(this).html("pageX"+evt.pageX) }) 2. events are 'triggers' jquery gives 'smoothe' code for these.

Back

bind() does?

Front

$("selector").bind(event,data,handler) $("p").bind('click',function(){alert("you clicked the p");}) defines the function you want to be triggered when the specified event happens to the matched elements.

Back

remove() does?

Front

$("selector").remove() removes all the amtched elements from the DOM[html]

Back

slideUp() does?

Front

slideUp(speed,callback) hides all matched content through graceful animation of height adjustment plus optional callback.

Back

hasClass() does?

Front

hasClass(class) returns true if the specified class is present [on atleast one matched element], false otherwise.

Back

Animating a scroll down of the page?

Front

$("html, body").animate({ scrollTop: "300px" });

Back

fadeOut() does?

Front

fadeOut(speed,callback) fades out all matched elements in graceful animation and optionally fires a callback.

Back

jquery animations

Front

...

Back

toggle(switch) does?

Front

toggle(switch) toggles displaying each of the matched elements based on switch true=show all false=hide all

Back

getting x and y position of mouse.

Front

$(document).bind('mousemove',function(e){ e.pageX / x poisiton of mouse / e.pageY / y position of mouse / })

Back

misc jquery functions

Front

...

Back

hide(speed, callback) does?

Front

hide(speed[ms],callback[function]) gracefully hides all the matched elements if they are shown.

Back

removeClass() does?

Front

removeClass(class) removes all the specified class(es) from the set of matched elements.

Back

clone() does?

Front

clone() clones the matched elements and selects the clones.

Back

trigger() does?

Front

trigger(event,data) triggers an event on every matched element, will also cause browser default action (e.g browser clicked as well)

Back

hide() does?

Front

hide() hides all the matched elements if they are shown.

Back

clone(bool) does?

Front

$("selector").clone(bool) clones all the matcghed elements and their event handlers and selects the clones.

Back

css(name) does?

Front

$("selector").css(name) returns the value for the named css property for the first matched element.

Back

jquery events

Front

...

Back

how do you get selected text and clear it?

Front

document.getSelected().removeAllRanges() [not jquery]

Back

context parameter for finding retroactive elements.

Front

$("selector","context") $("img", this) would find the currently active element and select its images.

Back

animate(params,duration,easing,callback) does?

Front

.animate(params,duration,easing,callback) params - {'property':'value'} duration - number in ms easing - linear or swing callbak function to call after completion

Back

addClass() does?

Front

addClass(class) adds the specified class to each of the set of matched elements.

Back

click() does?

Front

click(function) is a shortcut for the element listener or .bind() method.

Back

css positioning

Front

...

Back

fadeIn() does?

Front

.fadeIn(speed,callback) fades in all matched elements by adjusting their opacity and firing an optional callback.

Back

toggle(speed,callback) does?

Front

toggle(speed[ms],callback[function]) toggles between show() and hide() with graceful animation.

Back

css(properties) does?

Front

$("selector").css(properties) sets the css properties of every matched element $("p").css({'background-color':red,'height':'20px';})

Back

jquery CSS

Front

...

Back

toggle() does?

Front

toggle() toggles between .hide() and .show()

Back

slideDown() does?

Front

slideDown(speed,callback) reveals all matched elements by adjusting their height plus an optional callback.

Back

fadeTo() does?

Front

fadeTo(speed,opacity,callback) fades the opacity of all matched elements to a specific opacity and fires an optional callback.

Back

css(property,value) does?

Front

$("selector").css(property,value) sets a single property to a single value on all matched elements.

Back

slideToggle() does?

Front

slideToggle(speed,callback) toggles the visibility of all matched elements by adjusting their height through graceful animation.

Back

hover() does?

Front

hover(function over, function out) a shortcut for the bind('mouseover) and bind('mouseout')

Back

css classes

Front

...

Back

show(speed,callback) does?

Front

.show(speed[ms],callback[function]) shows all the matched elements if they are hidden using graceful animation. speed="slow","fast","normal"

Back

example of multi bind?

Front

$("li").bind('mouseover',hah) function hah() { $(this).css('border','3px solid red'); }

Back

show() does?

Front

show() [display:block;] displays each of the matched elements if they are hidden.

Back

height() does?

Front

height(value) either returns the value of height from the first matched element, or sets all of the matched elements height.

Back

jquery event object properties?

Front

event.property .type - type of event(eg.click) .target - element the called the event .data - data passed to bind() .pageX,pageY - position of mose to doc .result - value returned by hand .timestamp - time when occurred (ms)

Back

triggerHandler() does?

Front

triggerHandler(event, data) triggers all the bound event handlers on a single element without causing browser default action.

Back

toggleClass() does?

Front

toggleClass(class) adds the specified class if absent, removes if present. toggleClass(class,switch) if switch is true adds class, if not [false] removes.

Back

scrollTop() does?

Front

$("selector").scrollTop() gets the value [overflow / with scroll bar] elements. $(window).scrollTop() retuurns the value of pixels hidden from view on top.

Back

Section 16

(50 cards)

can jquery variables be simplified?

Front

yes! this helps particularly with semantic html ex var a = $("element .class .inner-class element-in-class"); a.height() or $('.most-specific-item',a)

Back

$var > 10

Front

Greater than 10

Back

$a !~ /pat/

Front

True if $a does not contain pattern "pat"

Back

Logical ! CONDITION

Front

True if CONDITION is not true

Back

If ($colour eq "red") {print ("C1
");}

Front

# If $colour = red, print as C1

Back

Arithmetic $a * $b

Front

Product of $a times $b

Back

.select() does what?

Front

selects the text of the selected elements and prepares it for copying (note: does not copy.)

Back

$.get("file.xml(or whatever)",callback(d)) does what?

Front

gets the xml file, and specifies d as the container of all regarding information. --------------------------- ex$.get('file.xml',function(d){ $(d).find('xmltag').each(function() { runs a script for each 'xmltag' found traverse like DOM $(this).attr('title') $(this,'nestedTag').html() }) });

Back

Logical CONDITION1 || CONDITION2

Front

True if CONDITION1 is true or CONDITION2 is true

Back

AJAX with JQuery

Front

...

Back

Assignment $var--

Front

decrement $var by 1 and assign to $var

Back

$var >= 10

Front

Greater than or equal to

Back

$str *ne "Word"

Front

Not equal to

Back


Front

Newline

Back

Assignment $var = 5

Front

assign 5 to $var

Back

\s

Front

All white spaces

Back

Advantage of PERL

Front

- Easy to run - Efficient in processing biological seq data

Back

using the jquery mousewheel plugin?

Front

$(element).bind('mousewheel',function(evt,delta){}) delta = -1 if going down; delta = 1 if going up.

Back

Scalar Data

Front

- Scalar variable begins with ($) - Any combination of letters, numbers, underscores Eg $name = "Bob"; #assignment of variable- name Eg $number = 123; assignment of variable- number

Back

$a =~s/hate/love/

Front

Replace occurences of 'hate' with 'love' in $a

Back

PERL

Front

- Practical Extraction and Report Language - allows easy manipulation of files - process text information

Back

Logical CONDITION1 && CONDITION2

Front

True if both CONDITION1 and CONDITION2 are true

Back

killing default events such as browser scroll when using the mousewheel

Front

$(element).bind('mousewheel',function(e){ e.stopPropagation(); e.preventDefault(); e.cancelBubble = false; })

Back

Assignment $var += 3

Front

increase $var by 3 and assign to $var

Back

closing the loop on a recursive function?

Front

make sure to stop the animated function (this is what casues the added delays.), for example use .stop(true,true) $("li:eq("+slideIndex+")",slideList).addClass('active').css('left','0%').delay(slideDelay).show(name) function name() { $("li",slideList).stop(true,true) }

Back

PERL syntax (how words are put tgt)

Front

- Comments begin with (#). Eg # I'm a comment - Statements must end with (;) Eg print ("I am learning Perl.
");

Back

Arithmetic $a / $b

Front

Quotient of $a divided by $b

Back

Assignment $var++

Front

increment $var by 1 and assign to $var (equal to $var+1 then run program again)

Back

\t

Front

Tab

Back

$var < 10

Front

Less than

Back

else {print ("C4
");}

Front

# If not, print C3

Back

Relational Operators

Front

- Check if the ouput is true/ not true

Back

Initiate Perl

Front

- Input e.g. "perl myprogram.pl" under DOS or Unix

Back

Disadvantage of PERL

Front

- Generally slower than a compiled program

Back

Assignment $var -= 2

Front

decrease $var by 2 and assign to $var

Back

$str eq "Word"

Front

Equal to

Back

Arithmetic $a + $b

Front

Sum of $a and $b

Back

var <= 10

Front

Less than or equal to

Back

.offset() does?

Front

determines the pixels between the document and the element, -------------- thisElement = $("#id").offset(); thisElement.top <--- gives the pixels from top.

Back

While loop $first var = 1; while ($firstVar <=10) {firstVar++}; print ("outside:firstVar = $firstVar
");

Front

Program prints: outside: firstVar = 11

Back

Arithmetic $a - $b

Front

Difference of $a and $b

Back

Why PERL?

Front

- Free - Easier to learn than C - Does not require a special compiler (Interpretive, not compiled)

Back

elsif ($colour eq "green") {print ("C2
");}

Front

# If not, $colour = green, print as C2

Back

determing browser type with jquery

Front

[deprecated 1.9] -use plugin $.browser.webkit [true if browser is webkit] has 4 values webkit mozilla msie opera

Back

parsing json data?

Front

$.get(url,function(name){ $.parseJSON(name) name.jsonproperty <-[can use as js object now.] })

Back

firing jquery after an object has been loaded?

Front

$(element or window).load(function(){})

Back

Create Perl Program

Front

- File name with suffix.pl - Text editor such as Windows Notepad/ UltraEdit

Back

Arithmetic $a % $b

Front

Remainder of $a divided by $b

Back

Array Data

Front

- Arrays of scalar denoted with (@) - index always start at 0 Eg @array = (1,2,3); Eg @students = ("Bob", "John", "Mary"); (if we want Mary) print ("$students[2]
");

Back

$a =~ /pat/

Front

True if $a contains pattern "pat"

Back

Section 17

(44 cards)

what is the symbol for any word character when using regular expressions

Front

[A-Za-z0-9_], \w

Back

What does the symbol + mean in regular expressions

Front

One or more of the previous token

Back

$var = <FILEHANDLE>;

Front

# read one line from the file Eg $line=<INFILE>;

Back

split() split(/pattern/, $variable) Eg. #!/usr/local/bin/perl; $str = "1+3+6+4+5"; @num = split(/\+/, $str); $count = scalar(@num); print ("The array has $count elements
"); print ("The second element of the array is $num[1]
");

Front

- return an array constructed by using the pattern as a delimiter to distinguish elements in $variable prints: The array has 5 elements The second element of the array is 3

Back

what is the symbol for any digit character when using regular expressions

Front

[0-9], \d

Back

In regular expressions what does the symbol . mean

Front

match any single character

Back

$!

Front

Stores error messages returned from OS.

Back

Last statement last;

Front

exits the most inner loop

Back

my

Front

Makes a local variable.

Back

@_

Front

Stores all arguments passed to a subroutine.

Back

chomp($name=<STDIN>)

Front

reads data into a variable and strips the ending character if it is a newline character.

Back

what is the symbol for any white space character when using regular expressions

Front

[\t \r
\f], \s

Back

What does a string with the following evaluate to '00'

Front

true

Back

$^O

Front

Stores the name of the OS.

Back

@ARGV

Front

Stores all command line arguments

Back

scalar() @array = (0,1,2,3,4); $number = scalar (@array); print ("Array Size = $number
");

Front

Array Size = 5 scalar() determines size of array

Back

in regular expressions what does the s/// do

Front

It is the substitution operator, the string to be matched goes between the first set of slashes and the value to replace it with goes in the second string.

Back

$_

Front

Stores the last thing read by Perl. It is the default variable for many functions.

Back

What is a double quoted string

Front

A string that will replace variable names with their values.

Back

cut($name=<STDIN>)

Front

reads data into a variable and strips the ending character no matter what it is.

Back

what symbol is the {} in regards regular expressions

Front

It is quantifier and specifies how elements we are looking for of a said character.

Back

what is the symbol for any non-whitespace character when using regular expressions

Front

[^\t \r
\f],\S

Back

in regular expressions what does //g mean

Front

Global; match as many times as possible within the string.

Back

$0

Front

Stores command that ran the current script.

Back

File Handling open() open(FILEHANDLE, "test.txt") open(FILEHANDLE, ">test.txt")

Front

open(FILEHANDLE, "test.txt") - opens a file and link it to FILEHANDLE for reading open(FILEHANDLE, ">test.txt") - opens a file and link it to FILEHANDLE for writing to the file.

Back

what does the symbol * mean in regular expressions

Front

Zero or more of the previous token

Back

For loop $sum = 0; for ($i=0; $i<=100; $i++) { $sum = $sum + $i; } print ("Sum = $sum
");

Front

$i=0; = CONDITION1 = set initial value of loop $i<=100; = CONDITION2 = decide is loop continue/stop $i++ = CONDITION3 = update loop variable

Back

What does the symbol () mean in regular expressions

Front

Group, which is used to make a group of tokens that can be quantified as a unit

Back

print() print ($var)

Front

prints the value of $var to screen

Back

what is the symbol for any non-word character when using regular expressions

Front

[^A-Za-z0-9_], \W

Back

What does the symbol \b mean in regular expressions

Front

Word boundary anchor

Back

in relation expressions what does //i mean

Front

Case insensitive match

Back

what is the symbol for the concatenation operator

Front

.

Back

close() close (FILEHANDLE) Eg close (INFILE);

Front

Close the file associated with FILEHANDLE

Back

What does the symbol ^ mean in regular expressions

Front

Start of a string anchor

Back

The defined function

Front

Returns false if the variable name has not been defined, and true if the variable name has been defined.

Back

What does a string with the following evaluate to '0' or ''

Front

false

Back

What does the symbol $ mean in regular expressions

Front

End of a string anchor

Back

What is a single quoted string.

Front

A literal string that prints exactly what it shows.

Back

what is the symbol for any non digit character when using regular expressions

Front

[^0-9], \D

Back

What does the symbol ? mean in regular expressions

Front

Zero or one of the previous token

Back

chop() chop ($var)

Front

chops off the last character of $var

Back

What are back-quotes

Front

back quotes allow us to capture the return of a command by placing the command inside the series of back-quotes.

Back

$#array

Front

Tells you the index of the last element of an array.

Back