Programming

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

manipulating attribute? [5/5]

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

scrollTop() does?

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

getting text content of an element?

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

unbind() does?

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

basic jquery selectors?

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

firing jquery after an object has been loaded?

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

Scope

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.

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

[^0-9], \D

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

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

what does the compile() method do?

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

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

abs()

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

accept()

addClass() does?

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

Binary Arithmetic Operators

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

StringBuffer sbuf

after line 2, .... eligible

which line is not compiled

floater = ob

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

floor()

what are the three types of loops in PHP?

for, while, foreach.

CROSS JOIN

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

hasClass() does?

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

height() does?

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

what will error_reporting (E_ALL & -E_NOTICE) do?

it will show all error reporting except for notice errors.

what will error_reporting (E_ALL) do?

it will show all error reporting.

what does ksort() sort by?

keys; key-values maintained.

URL referring to databases

protocol:subprotocol:datasourcename

a programmer needs to create a logging method

public void logIt(String...msgs)

what does sqrt() do?

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

what does the method tan() do?

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

charCodeAt() method does?

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

what does exp() method do?

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

reverse() method does?

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

what does floor() method do?

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

what character must all variables begin with?

the dollar sign $.

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

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

INCORRECT..Socket

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

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

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

what can str_ireplace() be used for?

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.

what is the round() function used for?

to round numeric values.

what is the while loop designed to do?

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

booleans only non-primitve is what?

toString() boolean.toString()

toggle() does?

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

toggle(speed,callback) does?

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

triggerHandler() does?

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

True or false: PHP is considered a scripting language

true

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

true

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

true

what can urldecode() be used for?

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

when should you use single quotes?

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.

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

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

how can you set up error reporting?

with the function error_reporting();

how can you convert an array into a string?

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

what can wordwrap() do?

word wrap after a certain amount of characters.

|

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

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

C must have no-args constructor

CTE

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

NOT BETWEEN

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

BETWEEN

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

else {print ("C4\n");}

# If not, print C3

what tag ends a php script?

?>

What is mySQL?

A database server

What is a single quoted string.

A literal string that prints exactly what it shows.

triple-quoted string

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

Self Join

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

+=

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

Identifier

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

hashable

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

new-style class

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.

object

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

PHP concatenation operator

.

what is the symbol for the concatenation operator

.

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

...

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

...

AJAX with JQuery

...

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

...

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

...

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

...

Math object methods

...

Math object properties

...

RegExp modifiers

...

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

...

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.

...

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;

...

You do not put quotation marks around endl.

...

array object methods

...

css classes

...

css positioning

...

inserting content

...

jquery CSS

...

jquery animations

...

jquery content

...

jquery custom animations

...

jquery event object

...

jquery events

...

jquery helper functions

...

misc jquery functions

...

regexp object methods

...

regexp object properties

...

string object methods

...

wrapping, replacing, removing

...

what is the concatenation assignment operator?

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

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

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

fadeIn() does?

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

show(speed,callback) does?

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

Block comment synax

/* blah blah blah */

javascript comment syntax?

/* */ for multiple lines // for a single line

Single line comment syntax

//blah blah blah

making a global (multiple) case insensitive search?

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

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

0

javascript starts counting on what?

0

7 values that make boolean false

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

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

0 tham số và 2 tham số

Left or Right Outer Join

1 table is more important than the other

class Q6 ( Holder )

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

integer literal

12 This is an example of an?

JDBC supports

2-tier and 3-tier

content and visibility filters?

: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

jquery form selectors?

:enabled :disabled :checked :selected

basic jquery selectors continued? [1/2]

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

basic jquery selectors continued? [2/2]

: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.

jquery form filters?

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

jquery child filters?

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

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

;

Shorthand delimiter for PHP code segments

<? ?>

what tag begins a php script?

<?php

Delimiter for PHP code segments

<?php ?>

turn array1 into a string separated by commas and show it

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

calling an external javascript file syntax?

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

WHERE clause operators

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

list some comparison operators

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

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).

@

function

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

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

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}

mapping

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

iterable

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.

Module

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).

first-class object

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.

decorator

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.

generator function

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.

module

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

Python 3000

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

list comprehension

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.

hash

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

Chained Outter Join

A query that has multiple outer joins

difference between a module and a script?

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.

Character Strings

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.

docstring

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.

What is a double quoted string

A string that will replace variable names with their values.

class

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

Multiple Condition Operators

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

BDFL

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

EIBTI

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

EAFP

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.

+

Addition - Adds values on either side of the operator

Alias

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

Integer Literal

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.

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

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.

reiterable

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

sequence

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.

iterator

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.

immutable

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.

define identifier

Declares an identifier (a unique object or unique class)

mysql_list_tables()

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

SYNTAX Comma

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

Equi-Join

Join conditions test for equality

mysql_field_seek()

Moves the result pointer to a specified field

$str *ne "Word"

Not equal to

SELECT DISTINCT

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

Arithmetic *$a / $b*

Quotient of $a divided by $b

return SQL query result

ResultSet

=

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

unicode

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

Set implementation... value-ordered

TreeSet

$a *=~* /pat/

True if $a contains pattern "pat"

...implement the JDBC API

Type 1

is jquery case sensitive?

YES

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

[\t \r\n\f], \s

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

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

Variable

______ 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;

Literal

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

A function inside a class is known as __

a method

A variable inside a class is known as __

an attribute

slice() method does what?

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

return statement syntax?

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

concat() method does what?

joins 2 or more arrays array.concat(array2)

concat() method does?

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

join() does what?

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

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

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

where is data sent using POST found?

predefined variable $_POST

what can strip_tags() be used for?

removes all HTML and PHP tags.

valueOf() method does what?

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

what number do indices end at?

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

define precedence

the order of operations.

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

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

ESCAPE clause

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

Is javascript case sensitive?

yes!

can a string with numbers be used as a number?

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

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

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

list some logical operators

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

PHP

"PHP: Hypertext Preprocessor"

String literal

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

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

# If $colour = red, print as C1

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

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

$var = <FILEHANDLE>;

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

Animating a scroll down of the page?

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

example of multi bind?

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

jquery traversing?

$("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

after() does?

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

manipulating attribute? [4/5]

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

manipulating attribute? [3/5]

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

manipulating attribute? [1/5]

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

manipulating attribute? [2/5]

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

before() does?

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

bind() does?

$("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.

clone(bool) does?

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

css(name) does?

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

css(properties) does?

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

css(property,value) does?

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

insertAfter() does?

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

insertBefore() does?

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

remove() does?

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

context parameter for finding retroactive elements.

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

getting x and y position of mouse.

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

killing default events such as browser scroll when using the mousewheel

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

using the jquery mousewheel plugin?

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

parsing json data?

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

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

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

what type of variable is $_SERVER

$_SERVER is a predefined variable.

what is a superglobal

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

how do you append elements to an array?

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

what is the syntax for connecting to a database?

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

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

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

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

$myFlavor = "vanilla";

what shorthand can you use to increment? decrement?

$var++ and $var-- respectively.

how do you refer to an item in an array?

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

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

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

logical operators?

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

syntax for line breaks in an alert box?

'/n' + " here"

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

'data structure'

how to make a case sensitive (single) search?

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

tuple

(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.

what are some basic arithmetic operators?

+ addition - subtraction * multiplication / division

what operators can you use to operate and assign?

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

Array Data

- 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]\n");

Relational Operators

- Check if the ouput is true/ not true

PERL syntax (how words are put tgt)

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

Advantage of PERL

- Easy to run - Efficient in processing biological seq data

Create Perl Program

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

Why PERL?

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

Disadvantage of PERL

- Generally slower than a compiled program

Initiate Perl

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

PERL

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

*Scalar Data*

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

*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\n"); print ("The second element of the array is $num[1]\n");

- 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

DCL Commands

Data Control Language GRANT, REVOKE, DENY

DDL Commands

Data Definition Language CREATE, ALTER, DROP

DML Commands

Data Manipulation Language SELECT, INSERT, UPDATE, DELETE

define def

Def introduces a function definition.

Query does what?

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

mysql_change_user()

Deprecated. Changes the user of the current MySQL connection

mysql_create_db()

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

mysql_drop_db()

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

mysql_escape_string()

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

mysql_list_fields()

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

mysql_tablename()

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

mysql_db_query()

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

Arithmetic *$a - $b*

Difference of $a and $b

/=

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

/ (what do you import?)

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)

Theta-JOIN

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

obtain a Connection to a Database

DriverManager

what are the seven main error reporting constants?

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

What does the symbol $ mean in regular expressions

End of a string anchor

$str *eq* "Word"

Equal to

describe the error type 'Error'

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

mysql_real_escape_string()

Escapes a string for use in SQL statements

Hierarchy of Employees

Ex. of a recursive relationship

mysql_query()

Executes a query on a MySQL database

mysql_unbuffered_query()

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

loosely-typed

Explicit data types are not required

**

Exponent - Performs exponential (power) calculation on operators

**=

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

read back data from file

FileInputStream, RandomAccessFile

OUTTER JOIN

Finds Missing - will contain NULL

mysql_free_result()

Free result memory

Full Outer Join

Full Outer Join - both tables are important

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

Global

in regular expressions what does //g mean

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

$var > 10

Greater than 10

$var >= 10

Greater than or equal to

What does the symbol () mean in regular expressions

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

Typical mySQL datatype for an 'id'

INT

ISNULL

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

what symbol is the {} in regards regular expressions

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

in regular expressions what does the s/// do

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.

___ a set of java API

JDBC

TOP

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

$var < 10

Less than

var <= 10

Less than or equal to

TestException

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

mysql_list_processes()

Lists MySQL processes

mysql_list_dbs()

Lists available databases on a MySQL server

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

Local

LBYL

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.

JOIN Execution

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

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

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

my

Makes a local variable.

Rules for CTE's

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

MVC

Model -View -Controller

%

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

%=

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

mysql_data_seek()

Moves the record pointer

*

Multiplication - Multiplies values on either side of the operator

*=

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

Rules for Subqueries

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

mutable

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

\n

Newline

describe the error type 'Notice'

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

what are the four main error types?

Notice, Warning, Parse error, and Error.

Standard and Prestandard C++

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

What does the symbol + mean in regular expressions

One or more of the previous token

mysql_connect()

Opens a non-persistent MySQL connection

mysql_pconnect()

Opens a persistent MySQL connection

NOT LIKE

Opposite of LIKE - used in the WHERE Statement

ORDER BY

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:

To create a user in PHPmyAdmin, to to this place

PHPmyAdmin Home Page>Privileges

PI is what?

PI approx (3.14159)

describe the error type 'Parse error'

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

ON Condition

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.

LIKE

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

mysql_ping()

Pings a server connection or reconnects if there is no connection

Arithmetic $a * $b

Product of $a times $b

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

Program prints: outside: firstVar = 11

object oriented

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

interactive

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.

JOIN

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

Arithmetic *$a % $b*

Remainder of $a divided by $b

$a *=~s/*hate/love/

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

bool Data Type

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

WHERE clause

Restricts & is evaluated after the JOIN has been executed

mysql_get_client_info()

Returns MySQL client info

mysql_get_host_info()

Returns MySQL host info

mysql_get_proto_info()

Returns MySQL protocol info

mysql_get_server_info()

Returns MySQL server info

mysql_db_name()

Returns a database name from a call to mysql_list_dbs()

mysql_fetch_row()

Returns a row from a recordset as a numeric array

mysql_fetch_assoc()

Returns a row from a recordset as an associative array

mysql_fetch_array()

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

mysql_fetch_object()

Returns a row from a recordset as an object

mysql_fetch_field()

Returns column info from a recordset as an object

The defined function

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

mysql_info()

Returns information about the last query

mysql_insert_id()

Returns the AUTO_INCREMENT ID generated from the previous INSERT operation

mysql_stat()

Returns the current system status of the MySQL server

mysql_error()

Returns the error description of the last MySQL operation

mysql_errno()

Returns the error number of the last MySQL operation

mysql_field_flags()

Returns the flags associated with a field in a recordset

mysql_fetch_lengths()

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

mysql_field_len()

Returns the maximum length of a field in a recordset

mysql_client_encoding()

Returns the name of the character set for the current connection

mysql_num_fields()

Returns the number of fields in a recordset

mysql_field_type()

Returns the type of a field in a recordset

Order of the SELECT Statement Clauses

SELECT FROM JOIN WHERE GROUP BY HAVING ORDER BY

Subquery

SELECT statement embedded inside another statement

mysql_select_db()

Sets the active MySQL database

C++ string class

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;

What does the symbol ^ mean in regular expressions

Start of a string anchor

@_

Stores all arguments passed to a subroutine.

@ARGV

Stores all command line arguments

$0

Stores command that ran the current script.

$!

Stores error messages returned from OS.

$_

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

$^O

Stores the name of the OS.

-

Subtraction - Subtracts right hand operand from left hand operand

Arithmetic *$a + $b*

Sum of $a and $b

\t

Tab

$#array

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

Suppose interface Inty defines 5 methods

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

c out

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

generator

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

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

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.

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

The name of the field is underscored

whitespace

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.

Programming style

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

c out

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

char

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:

c out << object

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

code fragmanet, sbuf references.. sbuf.append

True

$a *!~* /pat/

True if $a does not contain pattern "pat"

Logical *CONDITION1 || CONDITION2*

True if CONDITION1 is true or CONDITION2 is true

URL

Uniform Resource Locator

NULL

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

Arithmetic Operators

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

Comments

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

Condition of a WHERE clause

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

DISTINCT, ORDER BY, TOP Sequence

WHERE, DISTINCT, ORDER BY, TOP

describe the error type 'Warning'

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

INCORRECT.. serialization

When an Object Output Stream

What does the symbol \b mean in regular expressions

Word boundary anchor

Valuable platform integrating PHP and mySQL

XAMPP

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

Yes

\n escape sequence

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.

endl

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

what does the symbol * mean in regular expressions

Zero or more of the previous token

What does the symbol ? mean in regular expressions

Zero or one of the previous token

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

[0-9], \d

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

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

jquery attribute filters?

[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

determing browser type with jquery

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

bracket examples

[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

special text insertions?

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

Named Constants

____________ (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

Variable name

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

Integer Literals

______________ 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

Character literals

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

Variables

___________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

SELECT in FROM clause?

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

property

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.

INCORRECT..RMI server

a client acceeses remote object... only server name

what is a control structure?

a conditional or loop.

what is a cookie?

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

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

a global variable

Every function must have

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

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

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

JDBC 2-tierprocessing model

a user's command are delivered to the database

public class Outer

abce

push() method does what?

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

unshift() method does what?

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

alert box syntax?

alert("message");

correct statement about RMI

all

correct statement about remote class

all

correct statement about remote interface

all

what are the seven main SQL functions?

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;

IDLE

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.

what is an indexed array?

an array whose keys are numbers.

what is an associative array?

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

what is a regular expression?

an object that describes a pattern of characters

what is an array?

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

how many arguments can isset() take?

any amount.

append() does?

append(content) appends every matched element to the content

appendTo() does?

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

regexp metacharacters

are characters with a special meaning

Another name for parameter

argument

Assignment *$var = 5*

assign 5 to $var

What are back-quotes

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

LOG10E

base-10 logarithm of E approx (0.434)

LOG2E is what?

base-2 logarithm of E approx (1.442)

true or false is called a

boolean

how can you create an array with an HTML form?

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.

how do you declare a constant?

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.

how can you discern if a constant is already declared?

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

myFlavor is an example of

camel case

identifiers

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).

regexp quantifiers

can be used in conjunction with metacharacters

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

ceil()

*chop()* chop ($var)

chops off the last character of $var

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

class loading takes no additional time

click() does?

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

clone() does?

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

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

compilation takes slightly more time

types of strings object properties

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.

Variables are _____ for storing information

containers

toLowerCase() method does what?

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

toUpperCase() method does what?

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

what can htmlentities() be used for?

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

toString() method does what?

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

fromCharCode() method does what?

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

function to show number of items in an array

count

what does fopen() do?

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

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

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

Assignment *$var -= 2*

decrease $var by 2 and assign to $var

Assignment *$var--*

decrement $var by 1 and assign to $var

INNER JOIN

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

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

defining

what does abs() method do?

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

.offset() does?

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

how do you get selected text and clear it?

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

naïve object

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

Command to print information on a web page

echo

The ability to group similar functions and variables together is __

encapsulation

e is what?

eulers numbers approx (2.718)

jquery event object properties?

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)

Last statement *last;*

exits the most inner loop

substring() does what?

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

fadeOut() does?

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

fadeTo() does?

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

A java monitor must either extend Thread....

false

True or false: Spaces are acceptable in PHP variables

false

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

false

a signed data type

false

a thread wants to make a second thread ineligible

false

Columns in Excel are analogous to _____ in mySQL

fields

Query Optomizer

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

suppose a method called finallyTest()

finally block will always exe

\B meta character does what?

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

regexp brackets

find a range of characters

\d meta character does what?

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

\W meta character does what?

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

\0 meta character does what?

finds a nul character

. meta char does what?

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

\s meta character does what?

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

\w meta character does what?

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

Floating-Point data types

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

how can you iterate over the values of an array?

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

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

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

function syntax and purpose?

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

parseFloat() does what?

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

parseInt() does what?

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

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

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() }) });

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

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

hide() does?

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

hide(speed, callback) does?

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

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

host, userName, password, databaseName

hover() does?

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

what counters htmlentities()?

html_entity_decode()

outer:for...

i=1; j=0;

class Xyz

iAmPublic iAmPrivate iAmVolatile

id

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.

what two conditionals does PHP have?

if and switch.

else if conditional syntax?

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

the break and continue statement?

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

what control structure does break exit?

if/elseif/else and switch statements.

Button you push in mySQL to bring in external data

import

what functions can you use to include files?

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

Assignment *$var += 3*

increase $var by 3 and assign to $var

Assignment *$var++*

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

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

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

Purpose of the WHERE clause

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

what is the function getrandmax() for?

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

what can htmlspecialchars() be used for?

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

what will error_reporting (0) do?

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

what will error_reporting (E_ALL | E_STRICT) do?

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.

class SuperDuper

line 3: private; line 8: protected;

Racoon,SwampThing,Washer

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

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

localhost

what control structure does continue exit?

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

PHP is a ______ typed language

loosely

INCORRECT..ServerSocket class

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

closing the loop on a recursive function?

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) }

In regular expressions what does the symbol . mean

match any single character

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

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

what does the n{x,} quantifier do?

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

what does the n{x} quantifier do?

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

what does the n+ quantifier do?

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

what does the n* quantifier do?

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

what does the n? quantifier do?

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

what does the ?=n quantifier do?

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

what deos the ?!n quantifier do?

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

what does the ^n quantifier do?

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

what does the n$ quantifier do?

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

show highest number in an array

max

show lowest number in an array

min

prevent user input to other windows

modal dialog

statment chaining allows?

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

how do you close a connection between a database?

mysql_close($dbc);

PHP command name to tie in to a database

mysqli_connect

LN10 is what?

natural logarithm of 10 approx (2.302)

LN2 is what?

natural logarithm of 2 approx (0.693)

finding browsers and app.name?

navigator.appName - name navigator.appVersion - version #

determining if cookies are enabled?

navigator.cookieEnabled - true or false

2 types of date and time objects

naïve and aware

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

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.

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

no decimals, it will round to the nearest integer.

will print $_GET work? why or why not?

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

will print $_POST work? why or why not?

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

will print $_SERVER work? why or why not?

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

is there a standard that applies to the navigator object?

no, therefore determining browsers becomes quite an ordeal.

can variable names begin with numbers?

no.

can variable names contain symbols?

no.

does rsort() maintain key-values?

no.

does sort() maintain key-values?

no.

is data shown in the URL if POST is used?

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

what can be used to print data in an array?

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

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

number_format()

object based programming what does this mean?

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.

HTML DOM mouse events?

onclick ondblclick mousedown mousemove mouseover mouseout mouseup

one() does?

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

PHP is _____ source software

open

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

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.

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

parameter

the Math object allows you to?

perform mathematical equations and tasks.

what does the i modifier do?

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

what does the g modifier do?

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

Extension for PHP files

php

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.

pointing

what types of arguments are used for error_reporting()?

predefined constants that are not in quotations.

where is data sent using GET found?

predefined variable $_GET

what type of variable is $_GET?

predefined variable.

what type of variable is $_POST?

predefined variable.

prepend() does?

prepend(content) prepends the content to every matched element

prependTo() does?

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

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

primary key ... auto increment

show all items in $array1

print_r($array1);

*print()* print ($var)

prints the value of $var to screen

properties of methods defined?

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]

How do you execute a module as a script?

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.

what are the possible modes for fopen()?

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).

what can you do to reset an array?

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

regexp means what?

regular expression

removeClass() does?

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

shift() method does what?

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

pop() does what?

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

replaceWith() / replaceAll() do?

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

what does the random() method do?

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

what does acos() method do?

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

what does atan2() method do?

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

what does atan() method do?

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

charAt() method does?

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

what does cos() method do?

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

what does the log() method do?

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

what does the max() method do?

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

what does min() method do?

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

indexOf() method does?

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

lastIndexOf() method does what?

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

valueOf() method does what?

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

what does sin() do?

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

what does the source property do?

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

what does pow() method do?

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

what does krsort() sort by?

reversed keys; key-values maintained.

what does arsort() sort by?

reversed values; key-values not maintained.

what does rsort() sortby?

reversed values; key-values not maintained.

what does round() method do?

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

what does ceil() method do?

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

put an array in order of maximum value to minimum value

rsort

substr() does what?

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

search() method does what?

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

match() method does?

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

replace() method does what?

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

slice() method does what?

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

.select() does what?

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

PHP is a _________ language

server-side

integer data types

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

show() does?

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

COALESCE function

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

slideDown() does?

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

slideToggle() does?

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

slideUp() does?

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

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

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

put an array in order of minimum value to maximum value

sort

sort() for numbers?

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 }

sort() method does what?

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

what does the global property do?

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

what does the ignoreCase property do?

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

what does the lastIndex property do?

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

split() method does what?

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

SQRT1_2 is what?

square root of 1/2 approx (0.707)

SQRT2 is what?

square root of 2 approx (1.414)

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

str_replace()

the last index in a string is?

string.length-1

how to access an array?

string[array index]

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

strings 55

Built-in function for finding the length of a string

strlen

what does SQL stand for?

structured query language.

switch statement syntax?

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

what does the exec() method do?

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

what does the test() method do?

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

what should the action attribute's value contain?

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

condtion must be true....throw AssertionError

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

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

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

what function can be used to get time data?

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

what can you use to merge arrays?

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

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

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

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

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

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

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

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

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

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

the number or numeric variable to be formatted.

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

the number or numeric variable to be rounded.

what is the concatenation operator?

the period; .

how can you reorganise the array randomly?

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

Define 'statements'. Give examples of simple and compound

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

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

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

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

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

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

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).

what do natsort() and natcasesort() do?

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

define concatenate

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

how can the list() function be used?

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;

what can empty() be used for?

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

what can is_numeric() be used for?

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

what can isset() be used for?

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

the purpose of the boolean object?

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

what is the nl2br() function used for?

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

what can strtok() be used for?

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.

what can crypt() be used for?

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.

what can substr() be used for?

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.

what can str_word_count() be used for?

to find the amount of words in a string.

what can strlen() be used for?

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

what is the for loop designed to do?

to perform specific statements for a determined number of iterations

what can trim() be used for?

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

toggle(switch) does?

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

toggleClass() does?

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

trigger() does?

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

True or false: PHP variables are case-sensitive

true

code fragmanet, sbuf references.. sbuf.insert

true

the boolean has a default value of?

true

TIES

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

.... native client library....

type 2

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

type 3

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

type 4

valid identifiers

tất

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

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

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

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

what can you do to delete a variable?

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

\D meta character does what?

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

\b meta character does what?

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

\n meta chracter does what?

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

\S meta character does what?

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

what are regexp modifiers?

used to perform case-insensitive and global searches

onsubmit should be used for what and where?

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

what does asort() sort by?

values; key-values maintained.

what does sort() sort by?

values; key-values not maintained.

how is regexp defined?

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

for... in statement syntax?

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;

creating a literal array?

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

creating an uncondensed array?

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

creating a condensed array?

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

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

variables, lists, dictionaries, etc.

INCORRECT..deserialization

we use readObject()... to deserialize

what is an 'index' or 'key'?

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'

when should you use double quotes?

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

what can urlencode() be used for?

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

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

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

width() does?

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

Cat, Washer,SwampThing

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

how do you create an array?

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

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

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.

how can you convert a string into an array?

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

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

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

wrap() does?

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.

wrapAll() does?

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

wrapInner() does?

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.

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

x+=y or x/=y

prompt box syntax?

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

numerical comparison operators?

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]

int[]x

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

Extension for an 2010 Excel file

xlsx

can variables include other variables?

yes

can javascript detect a browser type?

yes and version.

can jquery variables be simplified?

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

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

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

can arrays contain arrays?

yes, they commonly do contain arrays.

are variable names case-sensitive?

yes.

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

yes.

can parentheses be used in conditional statements to set precedence?

yes.

can variable names begin with underscores?

yes.

does arsort() maintain key-values?

yes.

does asort() maintain key-values?

yes.

does krsort() maintani key-values?

yes.

does ksort() maintain key-values?

yes.

is data shown in the URL if GET is used?

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

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

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

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

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

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

you cannot

conditional variable syntax?

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

what number do indices begin at?

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

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

zeros will be added to the end.

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

Array Size = 5 scalar() determines size of array

a thread's run() method

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

SomeException

B fail A suceed

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

B must have no-args constructor

Multi-line Comments

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 */

Single line Comments

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;

&

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

<<

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

~

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

>>

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

^

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

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

CSV

not

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.

Floating-Point literals

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)

in relation expressions what does //i mean

Case insensitive match

==

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

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

Close the file associated with FILEHANDLE

mysql_close()

Closes a non-persistent MySQL connection

CSV

Comma-Separated Values

Programming style

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

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

Comparable interface and ít compareTo method

public static iterator

Complication fails

EXPRESSIONS

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

NOT IN

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

IN

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

Interface ___ help manage the connection

Connection

mysql_thread_id()

Returns the current thread ID

Test extends Base ( gọi hàm )

1 tham số và 2 tham số

mysql_field_name()

Returns the name of a field in a recordset

mysql_field_table()

Returns the name of the table the specified field is in

mysql_affected_rows()

Returns the number of affected rows in the previous MySQL operation

mysql_num_rows()

Returns the number of rows in a recordset

mysql_result()

Returns the value of a field in a recordset

empty() does?

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

submit a query to a database

Statement object

getting HTML content?

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

Logical *! CONDITION*

True if CONDITION is not true

Logical *CONDITION1 && CONDITION2*

True if both CONDITION1 and CONDITION2 are true

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

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

hash table

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

things to know about jquery events!

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.

\s

All white spaces

#include

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.

SQL keyword

WHERE

Dog, Animal

compile and run

confirm box syntax?

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

what function can you use to create a random number?

rand() function.

chomp($name=<STDIN>)

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

cut($name=<STDIN>)

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

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

scope

x = a++ + b++

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

static typing

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.

dynamic typing

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.

pie syntax

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.

old-style class

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

descriptor

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.

//=

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

//

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

duck typing

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.

string

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.

interpreted

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.

greedy regular expressions

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).

-=

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

nested scope

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.

metaclass

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.

coercion

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.

namespace

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.

define Attribute. how are attributes accessed?

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

tzinfo

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

datetime module

datetime module supplies classes for manipulating dates and times

datetime.date

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

Zen of Python

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

type

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.

list

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.

__slots__

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.

regular expression

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.

and

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

or

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

>=

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

>

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

<=

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

<

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

!=

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

<>

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

is not

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

not in

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

in

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

is

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

integer division

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.

global interpreter lock or GIL

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.


संबंधित स्टडी सेट्स

ATI Fundies practice test A help

View Set

Unit 13: Promote Digital Citizenship and Positive Online Behavior

View Set

Les Technologie et les Réseaux sociaux definitions

View Set

Steps in Marketing Research Process

View Set

10 practice questions insurance regulations

View Set

Complementary and Supplementary Angles

View Set

H Theology: Ch. 1-2 and Genesis Ch. 1-3

View Set