Sai Gopal Wordpress Blog

saigopal wordpress blog

Saigopal's website

Saigopal's website

My Daughter Website

Weebly

Palwow

Freelance Jobs

Thursday, October 28, 2010

F5 key board key disable code using javascript

// F5 key board key disable code using javascript
// refresh button in browser also disabling using this following javascript code
//-------------------------------------------------------------------------------------------------
function disablekeyboardnavigation(e)
{
var input_key = "";


if(window.event) {
input_key = event.keyCode; //IE
} else {
input_key = e.which; //firefox
}
if (input_key == 0 ) //F5
{
alert('This operation is not allowed');
return false;
}


return true;
}
// in html body tag place the following code
// body onLoad="disablekeyboardnavigation(this);"
//-------------------------------------------------------------------------------------------------

Wednesday, October 20, 2010

displaying html stored in mysql using php

The tutorial explains the MySQL query to set up the table and then displays the following MySQL code:

CREATE TABLE template (template_id INT(4) NOT NULL AUTO_INCREMENT PRIMARY KEY, Head_Open VARCHAR(60), Head_Close VARCHAR(60), Page_End VARCHAR(60), Date VARCHAR(60));
CREATE TABLE content (content_id INT(4) NOT NULL AUTO_INCREMENT PRIMARY KEY, title VARCHAR(60), body MEDIUMBLOB);

Next the author explains and displays the MySQL query to add some data to the tables:

INSERT INTO content (title, body) VALUES ( "MyPage", "This is my sample page, where I will use PHP and MySQL to template my website.
<p> Here is a list of things I like <ul><li>PHP Code</li><li>MySQL</li><li><a href=http://php.about.com>PHP @ About.com</a></li></ul>
<p> That is the end of my content.") ;
INSERT INTO template (Head_Open, Head_Close, Page_End, Date) VALUES ( "<html><head><title>", "</title><body>", "</body></html>",
"$b = time (); print date('m/d/y',$B) . '<br>';");

Next the tutorial explains and displays the following PHP code:

<?php
// Connects to your Database
mysql_connect("your.hostaddress.com", "username", "password") or die(mysql_error());
mysql_select_db("Database_Name") or die(mysql_error());

//This retrieves the template and puts into an array. No WHERE clause is used, because we only have one template in our database.
$coding = mysql_query("SELECT * FROM template") or die(mysql_error()); $template = mysql_fetch_array( $coding );

//This retrieves the content and puts into an array. Notice we are calling ID 1, this would change if we wanted to call a page stored on a different row
$text = mysql_query("SELECT * FROM content WHERE content_id =1") or die(mysql_error());
$content = mysql_fetch_array( $text );

//Actually puts the code and content on the page
Print $template['Head_Open'];
Print $content['title'];
Print $template['Head_Close'];

//When pulling PHP code we need to use EVAL
Eval ($template['Date']);

Print $content['body'];
Print $template['Page_End']; ?>

Obviously the script itself is rather well commented and simple to understand each line of code. The author does not, however, show or explain how to actually implement the PHP to display the result as a templated document/webpage. Perhaps the article was written for a more advanced user than myself ;p

Can someone show me how to implement the PHP code please?

I have entered the above PHP code into a file called 'template_001.php'.
No matter how I try to call on this file the result is either a blank white page or the prompt to open/save/edit the php file.
I'm using XAMPP 1.7.3 & Firefox. No changes to the XAMPP or Firefox installation are necessary as ONLY this script is not working. The problem is merely something I'm not doing right in the implementation of the script itself.

I have tried using it as an 'include' & as a 'require', however, I still have no HTML displayed.

The economics of this scripts usefulness is less important than understanding how to use it successfully.

I would be most grateful if anyone could explain how to make this work.

Cheers!

Tuesday, October 19, 2010

PHP FILES

Using the PHP file system function fopen(), we can create a new file. Let's look at this function more closely.
fopen ($filename, $mode);
The function fopen() takes in two arguments, the filename and the mode to either open or create a file.
• $filename - the name of the file. This may also include the absolute path where you want to create the file. Example, "/www/myapp/myfile.txt".
• $mode - mode is used to specify how you want to create the file. For example, you can set the mode to create for read only, or create a file for read and write. Below is the list of possible modes you can use.
PHP file fopen create modes
'w' Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, it attempt to create it.
'w+' Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it.
'a' Open for writing only; place the file pointer at the end of the file. If the file does not exist, attempt to create it.
'a+' Open for reading and writing; place the file pointer at the end of the file. If the file does not exist, attempt to create it.
For the list of all modes, please see php site.
Create file
Now let see some examples for creating a new files with fopen for reading and writing.
Example 1 - create new file for writing

The code above creates a new file myfile for writing only in the current directory.
The mode "w" creates a new file for writing, places the pointer in the beginning of the file. If the file already existed, it deletes everything in the file.
What happens when fopen fails?
When you create a file, the function fopen returns a file pointer. If the attempt to create a file fails for any reason, the function returns false.
Example 2 - create file for reading and writing

The code above creates a new file as does in example one but it creates the file for both reading and writing in the current directory.
The mode "w+" creates a new file for reading and writing, places the pointer in the beginning of the file. If the file already existed, it deletes everything from the file.
Similarly, you can use mode 'a' and 'a+' for creating new files. However with these modes, if the file already exists, it will not truncate the file (i.e. it will not delete any content in the file) and places the pointer at the end of the file for writing.
So, in the tutorial we learned how to create a new file using the php fopen function, next we will learn how to open existing files for reading and writing using the fopen function.

Friday, September 17, 2010

PHP Date add 1 month

PHP Date add 1 month

This example shows you how one month can be added to a PHP Date object. Date manupulation is one of the basic requirement of any business application. Example explained here can be used easily.

Code example to add 1 month:




//PHP Example code to add one moth to a date


$todayDate = date("Y-m-d");// current date
echo "Today: ".$todayDate;

//Add one day to today
$dateOneMonthAdded = strtotime(date("Y-m-d", strtotime($todayDate)) . "+1 month");

echo "After adding one month: ".date('l dS \o\f F Y', $dateOneMonthAdded);






The output of the program:
Today: 2009-08-25
After adding one month: Friday 25th of September 2009

HTML Forms : RADIO BUTTON

RADIO BUTTON - Printable Version
- Send Page To Friend












Radio buttons are used when you want to let the visitor select one - and just one - option from a set of alternatives. If more options are to be allowed at the same time you should use
check boxes instead.



--------------------------------------------------------------------------------


SETTINGS:

Below is a listing of valid settings for radio buttons:



The name setting tells which group of radio buttons the field belongs to. When you select one button, all other buttons in the same group are unselected.
If you couldn't define which group the current button belongs to, you could only have one group of radio buttons on each page.

The value setting defines what will be submitted if checked.

The align setting defines how the field is aligned.
Valid entries are: TOP, MIDDLE, BOTTOM, RIGHT, LEFT, TEXTTOP, BASELINE, ABSMIDDLE, ABSBOTTOM.
The alignments are explained in the image section. You can learn about the different alignments here.

The tabindex setting defines in which order the different fields should be activated when the visitor clicks the tab key.

set commands in oracle sql plus

SQL*PLUS - SET Statement
Set sqlplus system settings and defaults.

Syntax:
SET option value

SHO[W] option

Options: most of the options listed below have an abbreviated and a long form
e.g. APPINFO or APPI will do the same thing

APPI[NFO]{ON|OFF|text}
Application info for performance monitor (see DBMS_APPLICATION_INFO)

ARRAY[SIZE] {15|n}
Fetch size (1 to 5000) the number of rows that will be retrieved in one go.

AUTO[COMMIT] {OFF|ON|IMM[EDIATE]|n}
Autocommit commits after each SQL command or PL/SQL block

AUTOP[RINT] {OFF|ON}
Automatic PRINTing of bind variables.(see PRINT)

AUTORECOVERY [ON|OFF]
Configure the RECOVER command to automatically apply
archived redo log files during recovery - without any user confirmation.

AUTOT[RACE] {OFF|ON|TRACE[ONLY]} [EXP[LAIN]] [STAT[ISTICS]]
Display a trace report for SELECT, INSERT, UPDATE or DELETE statements
EXPLAIN shows the query execution path by performing an EXPLAIN PLAN.
STATISTICS displays SQL statement statistics.
Using ON or TRACEONLY with no explicit options defaults to EXPLAIN STATISTICS

BLO[CKTERMINATOR] {.|c|OFF|ON}
Set the non-alphanumeric character used to end PL/SQL blocks to c

CMDS[EP] {;|c|OFF|ON}
Change or enable command separator - default is a semicolon (;)

COLSEP { |text}
The text to be printed between SELECTed columns normally a space.

COM[PATIBILITY] {V5|V6|V7|V8|NATIVE}
Version of oracle - see also init.ora COMPATIBILITY=
You can set this back by up to 2 major versions e.g. Ora 9 supports 8 and 7

CON[CAT] {.|c|OFF|ON}
termination character for substitution variable reference
default is a period.

COPYC[OMMIT] {0|n}
The COPY command will fetch n batches of data between commits.
(n= 0 to 5000) the size of each fetch=ARRAYSIZE.
If COPYCOMMIT = 0, COPY will commit just once - at the end.

COPYTYPECHECK {OFF|ON}
Suppres the comparison of datatypes while inserting or appending to DB2

DEF[INE] {&|c|OFF|ON}
c = the char used to prefix substitution variables.
ON or OFF controls whether to replace substitution variables with their values.
(this overrides SET SCAN)

DESCRIBE [DEPTH {1|n|ALL}][LINENUM {ON|OFF}][INDENT {ON|OFF}]
Sets the depth of the level to which you can recursively describe an object
(1 to 50) see the DESCRIBE command

ECHO {OFF|ON}
Display commands as they are executed

EMB[EDDED] {OFF|ON}
OFF = report printing will start at the top of a new page.
ON = report printing may begin anywhere on a page.

ESC[APE] {\|c|OFF|ON}
Defines the escape character. OFF undefines. ON enables.

FEED[BACK] {6|n|OFF|ON}
Display the number of records returned (when rows >= n )
OFF (or n=0) will turn the display off
ON will set n=1

FLAGGER {OFF|ENTRY|INTERMED[IATE]|FULL}
Checks to make sure that SQL statements conform to the ANSI/ISO SQL92 standard.
non-standard constructs are flagged as errors and displayed
See also ALTER SESSION SET FLAGGER.

FLU[SH] {OFF|ON}
Buffer display output (OS)
(no longer used in Oracle 9)

HEA[DING] {OFF|ON}
print column headings

HEADS[EP] {||c|OFF|ON}
Define the heading separator character (used to divide a column heading onto > one line.)
OFF will actually print the heading separator char
see also: COLUMN command

INSTANCE [instance_path|LOCAL]
Change the default instance for your session, this command may only be issued when
not already connected and requires Net8

LIN[ESIZE] {150|n}
Width of a line (before wrapping to the next line)
Earlier versions default to 80, Oracle 9 is 150

LOBOF[FSET] {n|1}
Starting position from which CLOB and NCLOB data is retrieved and displayed

LOGSOURCE [pathname]
Change the location from which archive logs are retrieved during recovery
normally taken from LOG_ARCHIVE_DEST

LONG {80|n}
Set the maximum width (in chars) for displaying and copying LONG values.

LONGC[HUNKSIZE] {80|n}
Set the fetch size (in chars) for retrieving LONG values.

MARK[UP] HTML [ON|OFF]
[HEAD text] [BODY text] [TABLE text]
[ENTMAP {ON|OFF}][SPOOL {ON|OFF}]
[PRE[FORMAT] {ON|OFF}]
Output HTML text, which is the output used by iSQL*Plus.

NEWP[AGE] {1|n}
The number of blank lines between the top of each page and the top title.
0 = a formfeed between pages.

NULL text
Replace a null value with 'text'
The NULL clause of the COLUMN command will override this for a given column.

NUMF[ORMAT] format
The default number format.
see COLUMN FORMAT.

NUM[WIDTH] {10|n}
The default width for displaying numbers.

PAGES[IZE] {14|n}
The height of the page - number of lines.
0 will suppress all headings, page breaks, titles

PAU[SE] {OFF|ON|text}
press [Return] after each page
enclose 'text' in single quotes

RECSEP {WR[APPED]|EA[CH]|OFF}
Print a single line of the RECSEPCHAR between each record.
WRAPPED = print only for wrapped lines
EACH=print for every row

RECSEPCHAR {_|c}
Define the RECSEPCHAR character, default= ' '

SCAN {OFF|ON}
OFF = disable substitution variables and parameters

SERVEROUT[PUT] {OFF|ON} [SIZE n] [FOR[MAT] {WRA[PPED]|WOR[D_WRAPPED]|TRU[NCATED]}]
whether to display the output of stored procedures (or PL/SQL blocks)
i.e., DBMS_OUTPUT.PUT_LINE

SIZE = buffer size (2000-1,000,000) bytes

SHOW[MODE] {OFF|ON}
Display old and new settings of a system variable

SPA[CE] {1|n}
The number of spaces between columns in output (1-10)

SQLBL[ANKLINES] {ON|OFF}
Allow blank lines within an SQL command. reverts to OFF after the curent command/block.

SQLC[ASE] {MIX[ED]|LO[WER]|UP[PER]}
Convert the case of SQL commands and PL/SQL blocks
(but not the SQL buffer itself)

SQLPLUSCOMPAT[IBILITY] {x.y[.z]}
Set the behavior or output format of VARIABLE to that of the
release or version specified by x.y[.z].

SQLCO[NTINUE] {> |text}
Continuation prompt (used when a command is continued on an additional line using a hyphen -)

SQLN[UMBER] {OFF|ON}
Set the prompt for the second and subsequent lines of a command or PL/SQL block.
ON = set the SQL prompt = the line number.
OFF = set the SQL prompt = SQLPROMPT.

SQLPRE[FIX] {#|c}
set a non-alphanumeric prefix char for immediately executing one line of SQL (#)

SQLP[ROMPT] {SQL>|text}
Set the command prompt.

SQLT[ERMINATOR] {;|c|OFF|ON}|
Set the char used to end and execute SQL commands to c.
OFF disables the command terminator - use an empty line instead.
ON resets the terminator to the default semicolon (;).

SUF[FIX] {SQL|text}
Default file extension for SQL scripts

TAB {OFF|ON}
Format white space in terminal output.
OFF = use spaces to format white space.
ON = use the TAB char.
Note this does not apply to spooled output files.
The default is system-dependent. Enter SHOW TAB to see the default value.

TERM[OUT] {OFF|ON}
OFF suppresses the display of output from a command file
ON displays the output.
TERMOUT OFF does not affect the output from commands entered interactively.

TI[ME] {OFF|ON}
Display the time at the command prompt.

TIMI[NG] {OFF|ON}
ON = display timing statistics for each SQL command or PL/SQL block run.
OFF = suppress timing statistics

TRIM[OUT] {OFF|ON}
Display trailing blanks at the end of each line.
ON = remove blanks, improving performance
OFF = display blanks.
This does not affect spooled output.
SQL*Plus ignores TRIMOUT ON unless you set TAB ON.

TRIMS[POOL] {ON|OFF}
Allows trailing blanks at the end of each spooled line.
This does not affect terminal output.

UND[ERLINE] {-|c|ON|OFF}
Set the char used to underline column headings to c.

VER[IFY] {OFF|ON}
ON = list the text of a command before and after replacing substitution variables with values.
OFF = dont display the command.

WRA[P] {OFF|ON}
Controls whether to truncate or wrap the display of long lines.
OFF = truncate
ON = wrap to the next line
The COLUMN command (WRAPPED and TRUNCATED clause) can override this for specific columns.
The items in Gray on this page are deprecated from Oracle 9 onwards - also note that several of the options above have 'gone missing' from the official documentation set - HELP SET is a more accurate reference.
Get a list of these SET options in sql*plus with the command:
SQLPLUS> HELP SET
Example
A demo SQL script with the most common SET options
Related:
SQL*Plus commands



















/*
Multiple line comments
Can go between these delimiters

*/

SET TERM OFF
-- TERM = ON will display on terminal screen (OFF = show in LOG only)

SET ECHO ON
-- ECHO = ON will Display the command on screen (+ spool)
-- ECHO = OFF will Display the command on screen but not in spool files.
-- Interactive commands are always echoed to screen/spool.

SET TRIMOUT ON
-- TRIMOUT = ON will remove trailing spaces from output

SET TRIMSPOOL ON
-- TRIMSPOOL = ON will remove trailing spaces from spooled output

SET HEADING OFF
-- HEADING = OFF will hide column headings

SET FEEDBACK OFF
-- FEEDBACK = ON will count rows returned

SET PAUSE OFF
-- PAUSE = ON .. press return at end of each page

SET PAGESIZE 0
-- PAGESIZE = height 54 is 11 inches (0 will supress all headings and page brks)

SET LINESIZE 80
-- LINESIZE = width of page (80 is typical)

SET VERIFY OFF
-- VERIFY = ON will show before and after substitution variables

-- Start spooling to a log file
SPOOL C:\TEMP\MY_LOG_FILE.LOG

--
-- The rest of the SQL commands go here
--
SELECT * FROM GLOBAL_NAME;

SPOOL OFF

Oracle SQL*Plus
Version 11.1
General
Note: Oracle in its near infinite wisdom dropped sqlplusw.exe from the initial release of 11gR1. If want it you can copy in the executable from 10.2.0.1 and in most cases rename the DLL oraclient11.dll to oraclient10.dll. Then you will again have a usable interface. If you are as thrilled as we are about this send us an email and we will pass it along to Oracle.

Constants Constant Usage Example
SQL.LNO Line Number SELECT COUNT(*)
FROM all_objects
WHERE SUBSTR(object_name,1,1) BETWEEN 'A' AND 'W';

show lno
SQL.PNO Page Number SELECT object_name
FROM all_objects
WHERE SUBSTR(object_name,1,1) BETWEEN 'A' AND 'W';

show pno
SQL.RELEASE Oracle Version show release
SQL.SQLCODE Current error code show sqlcode
SQL.USER Currently connected user show user

Startup Parameters: Usage 1 Flags
Description

-H Displays the SQL*Plus version and the usage help
-V Displays the SQL*Plus version

sqlplus -C | -H
Startup Parameters: Usage 2 Flags
Description

-C Sets the compatibility of affected commands to the version specified. The version has the form "x.y[.z]. For example -C 10.2.0
-L Attempts to log on just once, instead of reprompting on error
-M

Wednesday, September 15, 2010

Javascript RegExp Object

JavaScript RegExp Object
RegExp, is short for regular expression.
Complete RegExp Object Reference
For a complete reference of all the properties and methods that can be used with the RegExp object, go to our complete RegExp object reference.
The reference contains a brief description and examples of use for each property and method!
What is RegExp?
A regular expression is an object that describes a pattern of characters.
When you search in a text, you can use a pattern to describe what you are searching for.
A simple pattern can be one single character.
A more complicated pattern can consist of more characters, and can be used for parsing, format checking, substitution and more.
Regular expressions are used to perform powerful pattern-matching and "search-and-replace" functions on text.
Syntax
var txt=new RegExp(pattern,modifiers);

or more simply:

var txt=/pattern/modifiers;
• pattern specifies the pattern of an expression
• modifiers specify if a search should be global, case-sensitive, etc.
RegExp Modifiers
Modifiers are used to perform case-insensitive and global searches.
The i modifier is used to perform case-insensitive matching.
The g modifier is used to perform a global match (find all matches rather than stopping after the first match).
Example 1
Do a case-insensitive search for "w3schools" in a string:
var str="Visit W3Schools";
var patt1=/w3schools/i;
The marked text below shows where the expression gets a match:
Visit W3Schools


Example 2
Do a global search for "is":
var str="Is this all there is?";
var patt1=/is/g;
The marked text below shows where the expression gets a match:
Is this all there is?


Example 3
Do a global, case-insensitive search for "is":
var str="Is this all there is?";
var patt1=/is/gi;
The marked text below shows where the expression gets a match:
Is this all there is?

test()
The test() method searches a string for a specified value, and returns true or false, depending on the result.
The following example searches a string for the character "e":
Example
var patt1=new RegExp("e");
document.write(patt1.test("The best things in life are free"));
Since there is an "e" in the string, the output of the code above will be:
true


exec()
The exec() method searches a string for a specified value, and returns the text of the found value. If no match is found, it returns null.
The following example searches a string for the character "e":
Example 1
var patt1=new RegExp("e");
document.write(patt1.exec("The best things in life are free"));
Since there is an "e" in the string, the output of the code above will be:
e

Tuesday, September 14, 2010

jquery demos

http://www.webdesignerwall.com/tutorials/jquery-tutorials-for-designers/

mathematical articles

Formatting Mathematical Articles with Cascading
Style Sheets
George Chavchanidze
Department of Theoretical Physics, A. Razmadze Institute of Mathematics, 1
Aleksidze Street, Tbilisi 0193, Georgia
Abstract. This page shows how to format mathematical articles with
Cascading Style Sheets (CSS). Simple XML 1.0 markup is used to capture
basic structure of math expressions while rendering is specified via CSS
2.0/2.1. Abilities and limitations of present approach are discussed.
Keywords: eXtensible Markup Language, Cascading Style Sheets,
Mathematics in XML
Date: Sun, 10 Oct 2004 (revised version)
1. Introduction
CSS is the simplest way to control formatting of XML and SGML
documents. Today it is mainly used in web design to render and style
(X)HTML documents, but its applications spread far beyond ordinary web
design and one can use XML and CSS to embed mathematical expressions
in web pages. Generally speaking it is easy to control general layout and
style of scientific documents with CSS, the only problem is rendering of
complex mathematical formulæ. So in this article we will mainly focus on
this problem and suggest relatively simple approach for rendering of
mathematical expressions that may appear in scientific papers. We use
simple XML 1.0 markup to capture basic structure of math expressions and
CSS 2.0/2.1 to specify their rendering (see [2]-[4] for specs).
Each mathematical expression may be formatted as inline equation like
z = 1/c or as block level (displayed) equation
z = 1/c (1)
Rendering of inline equations is more specific as one has to care about
height of line box.
2. Indices in display mode
In mathematical expressions indices are probably the most widespread
objects so it is essential to keep corresponding markup as simple as possible,
otherwise compactness and readability of XML source will be seriously
undermined. The simpliest way is to use CSS relative positioning to shift
indices up/downwards. Most of the browsers support relative positioning
and thus can easily process simple indices. Here are some examples of top
dzk = dxk + idyk (2)
ch2(x) − sh2(x) = 1 (3)
ch(3x) = 4ch3(x) − 3ch(x) (4)
Na − e− = Na+ (5)
and lower indices taken from mathematics and chemistry
Tmn = − Tnm (6)
Fe3O4 + 4H2 ? 3Fe + 4H2 (7)
Simple indices may be combined. Subscripts may precede superscripts and
vise versa.
Tmn = εnm
kSk
(8)
Tmn = εnm
kSk (9)
13Al27 + 2He4 = 15P30 + 0n1 (10)
Indices may be also positioned one over another in this way
∇mRn
ikl + ∇lRn
imk + ∇kRn
ilm = 0 (11)
However to archive correct alignment of such an indices one has to put them
in inline table. Here browser compatibility issues show up as some browsers
does not support inline tables. Nesting of simple indices is allowed.
dzk1 = dxk1 + idyk1 (12)
dzk(1) = dxk(1) + idyk(1) (13)
Tk1k2
= − Tk2k1
(14)
Tk(1)k(2) = − Tk(2)k(1) (15)
eA(1)eA(2) = eA(1) + A(2) (16)
Xh(F) = LXh
F (17)
∇k1Rk5
k2k3k4 + ∇k4Rk5
k2k1k3 + ∇k3Rk5
k2k4k1 = 0 (18)
∇ŝ1
Rŝ5 ŝ2ŝ3ŝ4
+ ∇ŝ4
Rŝ5 ŝ2ŝ1ŝ3
+ ∇ŝ3
Rŝ5 ŝ2ŝ4ŝ1
= 0 (19)
So rendering indices with CSS2 is not a big problem. Their rendering can be
controlled in details by both author and user through adjusting relative
positioning offsets, font-size and style in author and user style sheets.
3. Indices in inline mode
Here similar math expression appear inline. Note that relatively positioned
indices should not affect line height Tmn = − Tnm. Alternatively one can shift
indices using CSS vertical-align property used to control vertical alignment.
However, unlike relative positioning, vertical alignment may affect height of
line box. So it is better to use relative positioning εnm
kSk. Line breaks inside
equations are prohibited as browsers may generate line break in
inappropriate place (after all, there is no reliable algorithm for handling line
breaks in mathematical equations). Thus the simplest solution is to prohibit
all line breaks inside math expressions εnm
kSk (this can be done by setting
CSS 'white-space' property to 'nowrap') and mark those few points where
line breaks are allowed with an element that has CSS 'white-space' property
set to 'auto'. More complex indices ∇mRn
ikl can be used in inline mode as
well, but again some browsers does not like them. This happens due to weak
CSS support in those browsers. One can nest indices as follows ∇k1Rk5
k2k3k4 .
Nested indices are also shifted using relative positioning and thus they
should not change height of line box. Here are another samples of nested
superscripts eA(1)eA(2) and nested subscripts Xh(F) = LXh
F.
4. Fractions in display mode
Fractions are quite frequent in mathematical articles, so it is preferable to
have simple markup for fractions. Making it too simple results poor
rendering quality so we think that the minimal reasonable approach is to take
two elements, to mark fraction and its rows (numerator/denominator).
Fractions can be formatted as vertically centered inline tables. To reduce
markup anonymous table objects may be exploited. Below you see example
from statistics
A =
Tr(AW)
Tr(W)
(20)
another example from gravity
Rnm −
1
2
Rgnm = 0 (21)
and some samples from analysis and trigonometry
ln(2) = 1 −
1
2
+
1
3

1
4
+ ... (22)
B6 =
3617
510
(23)
ch(x) =
1
2
(ex + e− x) (24)
th(x ± y) =
th(x) ± th(y)
1 ± th(x)th(y)
(25)
Fractions may contain nested indices. Here are some samples from
mechanics
I =
m1m2
m1 + m2
x2 (26)
D =
4B3
ω2
(27)
examples from field theory
Fmn =
∂Am
∂xn

∂An
∂xm
(28)
Fmn =
∂Am
∂xn

∂An
∂xm
(29)
and other mathematical expressions
th(2x) =
2th(x)
1 + th2(x)
(30)
G = 1 −
1
32
+
1
52

1
72
+ ... (31)
Nesting of fractions is possible but limited to second order
g = 1 −
1
1 − ar
(32)
m =
1
1
m1
+ 1
m2
(33)
More deep nesting is also possible, but may require extra markup so at the
moment it is reasonable to limit nesting to second order as in real world
articles deeper nesting is rarely used and can be always avoided.
5. Fractions in inline mode
In inline mode fractions are rendered in the same manner as in block level
equations Tr(AW)
Tr(W) . The only difference is that inline fractions are slightly
compactified (height of numerator/denominator is reduced) th(x) ± th(y)
1 ± th(x)th(y) to
avoid possible line-height enlargement and nesting of fractions in inline
mode is not allowed but nesting of indices is possible so inline fractions may
contain nested indices m1m2
m1 + m2
x2 . Here is another example with nested
superscripts 2th(x)
1 + th2(x)
6. Operators in display mode
Rendering of indexed operators is much more complicated issue as in
general number of under and over scripts may be arbitrary and in addition
one needs to rearrange all this stuff when operators are nested in fractions or
appear inline. Also shape and baseline of glyphs may vary. At the moment
we will assume that only single under and over scripts are used (multiple
under scripts are really rarely used while multiple over scripts are almost
never used). One can format operators as inline tables. Below are some
sample integrals
B(m , n) =
1∫0
xm − 1(1 − x)n − 1dx (34)
Here are some sums
p =

m=1
pm
(35)
G = Σ
p, s ∈ Z
ApBs (36)
Product
Ω = Π
m ∈ N
Ω(m) (37)
Unification operator
A =
∞∪
m=1
A(m) (38)
and intersection
B(s) =
2n

m=1
B(m) (39)
Direct sum and tensor products are rendered in the same manner
Q
n⊕
k=1
xk =
n⊕
k=1
xQ[k]
(40)
 =
n⊗
k=1
m⊗
s=1
NksMs
(41)
Under and over scripts may contain nested indices
G = Σ
m1m2
Am1Bm2 (42)
F = Σ
m1 ≠ m2
pm1
pm2
(43)
Operators can be combined with indices and fractions to form complex
expressions
∞∫0
e− ax − e− bx
x
dx = ln
b
a
(44)
∞∫0
xne− axdx =
n!
an + 1
(45)
1∫0
dx
1 + 2x + x2
=
1
2
(46)
1∫0
sin2mx
c2 + x2
dx =
π
4c
(1 − e−2mc) (47)
1∫0
x2p − 1ln(1 + x)dx =
1
2p
2p
Σ
n=1
(− 1)n − 1
n
(48)
Nested fractions should not affect vertical alignment of parent fraction
1∫0
xm(1 − xn)pdx =
Γ(p + 1)Γ( m + 1
n )
nΓ(p + 1 + m + 1
n )
(49)
∞∫0
sin(mx)
eax + 1
dx =
1
2m

π
2ash( πm
a )
(50)
∞∫0
th( πx
2 )
1 + x2
sin(mx)dx =
m
em
− sh(m)ln(1 − e−2m) (51)
∞∫0
cos(mx)cos(nx)
ch(ax)
dx =
πch( πm
2a ) ch( πn
2a )
a(ch( πm
a ) + ch( πn
a ))
(52)
Operators can be nested inside fractions. But in this case it is better to
replace under/over scripts with sub/superscripts placed after operator
A = Σ n
k=1W(k)A(k)
Σ n
k=1 A(k)
(53)
S = Π n
k=1 Pk
Π n
k=1 Qk
(54)
F = Σ m
k=1 F(m)W(m)
Σ m
k=1W(m)
= Σ m
k=0 F(m)W(m)
Ŵ
(55)
So it is possible to render common operators with CSS.
7. Operators in inline mode
In inline mode it is better to replace under/over scripts with indices placed
after operator, Σ n
m=1 pm in this way possible line height distortions are
reduced Π s
m=0 Ω(m). The additional problem is that in different fonts glyphs
that correspond to mathematical operators like sums, products and intergals
have different shapes, baselines and sizes Σm1 ≠ m2
pm1
pm2
so if in one font
operators look perfectly centered in others they may appear to be distorted.
The problem will be partly resolved when we will have single font with
good coverage of all mathematical ranges (maybe STIX).
8. Under and Over scripts
Rendering of generic under and over scripted expressions is easier then
rendering of indexed operators. They are formatted as inline tables. Here is
for example limit
c−3 = lim
x → 0
x3s(x) (56)
Residue
I(z0) = Res
z = z0
F(z) (57)
Under script with brace (rendering of such a simple square under/over braces
is not a problem but making them round, or curly or allowing overlaps is
much more difficult to achieve, so currently it is better to stick to simplest
case).
V(n) = W ∧ W ∧ ⋯ ∧ W
n times
(58)
Below you see some samples from chemistry
+IV
Na2SO3 +
0
J2 + H2O =
+VI
Na2SO4 +
−I
2HJ (59)
+IV
MnO2 +
−I
4HCl =
+II
MnCl2 +
0
Cl2 + 2H2O (60)
+2e−
Zn + H2 SO4 = ZnSO4 + H2
(61)
Here is example from nuclear physics
Ra
226
→ Rn
222
+ He
4
(62)
Under over scripts are really rarely used. Below is rather artificial example
from chemistry.
27
Al
13
+
4
He
2
=
30
P
15
+
1n0
(63)
9. Vectors, Matrices and Cases
Vectors, matrices and cases can be formatted as inline tables. Here are
sample matrices and vectors. 'Hooks' are produced by inserting extra cells at
edges using CSS generated content and removing inner borders via border
collapse mechanism.
c11 c12 c13
c21 c22 c23
c31 c32 c33
x1
x2
x3
=
b1
b2
b3
(64)
Matrices may contain nested fractions, indices and operators
M3 =
M11 M12 M13
M21 M22 M23
M31 M32 M33
=
a2
b2 + c2 a3 − b2
c4 a2 + b2
12c 8a
12c b4 2a2
7b3
(65)
rendering of determinants is much easier as no 'hooks' are necessary.
det(M3) =
M11 M12 M13
M21 M22 M23
M31 M32 M33
=
a2
b2 + c2 a3 − b2
c4 a2 + b2
12c 8a
12c b4 2a2
7b3
(66)
Rendering of multivalues is slightly simplified.
ε(x) =
+1 {if x > 0}
0 {if x = 0}
−1 {if x < 0}
(67)
10. Large Brackets
Simple square brackets can be imitated using generated content and borders.
This is the simplest and most reliable way to handle them.
D = G(z) +
1
S(z)
3 (68)
Ĉ(m) =
m2
Π
k=m
kFk3(x) +
k5
Π
s = c4
Fs(x) + 12
Gs(x)
Fs(x) − 12Gs(x)
3k (69)
Ŝ± =
4θ2
6z3 + z2
3u
4b2

2c2
e± 3uc2ŵ2 + Σ
m1 ≠ m2
e±m1m2ŵ dŵ (70)
As an alternative solution one can compose brackets by combining Unicode
characters 239B-23AD (located in Misc. Technical range). Task can be
simplified using CSS generated content.
11. Diacritical Marks
Rendering of diacritical marks is not governed by CSS. This issue is
addressed by Unicode standard [1] that defines so called combining
diacritical marks like __?__??__?__̃_?__?__ that being combined with
ordinary Unicode characters must produce characters with over dots, hats,
tildes, bars etc.
q? + q?2 + q4 = c̃ (71)
but at the moment browsers does not support combining diacritical marks
properly and it is better to use precomposed characters
[Â , Ĥ] = 0 (72)
located in the following Unicode ranges: Latin-1 Supplement, Latin
Extended-A, Latin Extended-B, Latin Extended Additional.
12. Radicals
The most reliable way to settle issue with radicals is to use more simple
power notations
x =
− b ± (b² − 4ac)½
2a
(73)
R± = m2 ±
12c5
29w7
3/2 (74)
In this way one avoids dependence on font metrics.
13. Nesting Limitations
Our present style sheet uses simple 'shrink to fit' nesting scheme to ensure
that nested element does not affect height of its parent. Such a rendering
naturally imposes limits on nesting of certain expressions. In overall these
limitations are not severe and does not affect real world articles. For
example simple nesting of fractions is allowed
Q = B0 +
A0
B1 + A1
B2 + A2 / B3
(75)
but those who try to nest fractions deeper will encounter nesting limitation.
It is possible to remove this and other nesting limitations by using more
complex markup, but at the moment we don't want to do this as limitation
are not severe.
14. Conclusions
CSS2 is basically simple style language, but in spite of its simplicity it is
powerful enough to afford rendering of most of mathematical expressions.
So one can start using CSS for formatting of scientific and technical XML
documents already today. Rendering of some things like for instance
radicals, and deeply nested expressions are not fully addressed in the present
article. However it happened just because current CSS2 based solutions for
rendering of radicals are slightly artificial, while support for deep nesting
requires slightly more detailed markup then we currently use, so taking into
account that this issues are not urgent we think it is better to address them
later when we will have more natural solutions (like CSS3 math module).
References
1. B. Beeton et al.,Unicode Support for Mathematics, 2003
2. B. Bos et al., Cascading Style Sheets, level 2 revision 1, 2004
3. T. Bray et al., Extensible Markup Language (XML) 1.0, 2004
4. J. Clark, Associating Style Sheets with XML documents, 1999

for more reference go through this website
http://www.princexml.com/samples/math.pdf

Wednesday, September 8, 2010

sql server help

hi all you can find sql server help from following website url

http://www.thundersoftware.com/churchdb/sqltutorial/sql_tutorial.html

how to find imei number in phone

http://www.wikihow.com/Find-the-IMEI-Number-on-a-Mobile-Phone

Monday, August 23, 2010

Saturday, August 7, 2010

excel tip

excel tip
go to tools -> options ->edit tab and select allow cell drag and drop to add 1,2 in two cells and place mouse and drag to display list of numbers in excel sheet

Sunday, July 11, 2010

8. Working with Style Sheet Files

8. Working with Style Sheet Files
Before you start defining your style sheets, it's important to know how to create and use the files that will contain them. In this chapter, you'll learn how to create a style sheet file, and then apply that style sheet to an individual element, a whole Web page, or an entire Web site.

You'll learn how to create the content of your CSS style sheets in the chapters that follow.

Friday, July 9, 2010

Temporary tables in SQL Server

Temporary Tables

By Bill Graziano on 17 January 2001 | 15 Comments | Tags: Application Design, Table Design

Sophie writes "Can you use a Stored Procedure to open a table and copy data to a sort of virtual table (or a records set) so that you can change the values with and not affect the actual data in the actual table. And then return the results of the virtual table? Thanks!" This article covers temporary tables and tables variables and is updated for SQL Server 2005.

I love questions like this. This question is just a perfect lead in to discuss temporary tables. Here I am struggling to find a topic to write about and I get this wonderful question. Thank you very much Sophie.
Temporary Tables

The simple answer is yes you can. Let look at a simple CREATE TABLE statement:

CREATE TABLE #Yaks (
YakID int,
YakName char(30) )

You'll notice I prefixed the table with a pound sign (#). This tells SQL Server that this table is a local temporary table. This table is only visible to this session of SQL Server. When I close this session, the table will be automatically dropped. You can treat this table just like any other table with a few exceptions. The only real major one is that you can't have foreign key constraints on a temporary table. The others are covered in Books Online.

Temporary tables are created in tempdb. If you run this query:

CREATE TABLE #Yaks (
YakID int,
YakName char(30) )

select name
from tempdb..sysobjects
where name like '#yak%'

drop table #yaks

You'll get something like this:

name
------------------------------------------------------------------------------------
#Yaks_________________________ . . . ___________________________________00000000001D

(1 row(s) affected)

except that I took about fifty underscores out to make it readable. SQL Server stores the object with a some type of unique number appended on the end of the name. It does all this for you automatically. You just have to refer to #Yaks in your code.

If two different users both create a #Yaks table each will have their own copy of it. The exact same code will run properly on both connections. Any temporary table created inside a stored procedure is automatically dropped when the stored procedure finishes executing. If stored procedure A creates a temporary table and calls stored procedure B, then B will be able to use the temporary table that A created. It's generally considered good coding practice to explicitly drop every temporary table you create. If you are running scripts through SQL Server Management Studio or Query Analyzer the temporary tables are kept until you explicitly drop them or until you close the session.

Now let's get back to your question. The best way to use a temporary table is to create it and then fill it with data. This goes something like this:

CREATE TABLE #TibetanYaks(
YakID int,
YakName char(30) )

INSERT INTO #TibetanYaks (YakID, YakName)
SELECT YakID, YakName
FROM dbo.Yaks
WHERE YakType = 'Tibetan'

-- Do some stuff with the table



drop table #TibetanYaks

Obviously, this DBA knows their yaks as they're selecting the famed Tibetan yaks, the Cadillac of yaks. Temporary tables are usually pretty quick. Since you are creating and deleting them on the fly, they are usually only cached in memory.
Table Variables

If you are using SQL Server 2000 or higher, you can take advantage of the new TABLE variable type. These are similar to temporary tables except with more flexibility and they always stay in memory. The code above using a table variable might look like this:

DECLARE @TibetanYaks TABLE (
YakID int,
YakName char(30) )

INSERT INTO @TibetanYaks (YakID, YakName)
SELECT YakID, YakName
FROM dbo.Yaks
WHERE YakType = 'Tibetan'

-- Do some stuff with the table

Table variables don't need to be dropped when you are done with them.
Which to Use

* If you have less than 100 rows generally use a table variable. Otherwise use a temporary table. This is because SQL Server won't create statistics on table variables.
* If you need to create indexes on it then you must use a temporary table.
* When using temporary tables always create them and create any indexes and then use them. This will help reduce recompilations. The impact of this is reduced starting in SQL Server 2005 but it's still a good idea.

Answering the Question

And all this brings us back to your question. The final answer to your question might look something like this:

DECLARE @TibetanYaks TABLE (
YakID int,
YakName char(30) )

INSERT INTO @TibetanYaks (YakID, YakName)
SELECT YakID, YakName
FROM dbo.Yaks
WHERE YakType = 'Tibetan'

UPDATE @TibetanYaks


SET YakName = UPPER(YakName)

SELECT *
FROM @TibetanYaks

Global Temporary Tables

You can also create global temporary tables. These are named with two pound signs. For example, ##YakHerders is a global temporary table. Global temporary tables are visible to all SQL Server connections. When you create one of these, all the users can see it. These are rarely used in SQL Server.
Summary

That shows you an example of creating a temporary table, modifying it, and returning the values to the calling program. I hope this gives you what you were looking for.

Thursday, July 1, 2010

Administrator's Guide to SQL Server 2005--chapter01--Take Away To size your server and install the software, you need to understand the variables involved in the decision and then match up the options to create three possible choices: standard, enhanced, and optimal. To do that, you need to find out what the minimal possible configurations are and what to get if money is not an option. You can use the information in this section to develop your baseline, and then expand that with metrics to determine the second two options. If you make your baseline realistic and support it with the information that follows, you should be able to make a strong case for it. The bad news is that no magic formulas tell you what to buy and how to configure it. The best way to make the hardware decisions is to detail the information in some meaningful way and examine it to come up with a solution. An additional benefit is that after you have written everything down, you can talk with vendors and other professionals intelligently about your needs. I detail several processes here using simple spreadsheets, tables, and scripts. You can take these processes and create a programmatic system from them; remember, however, that at some level there is always an element of judgment that you will use from your own experiences and corporate environment. Every situation will differ, which is why no computer program can build your landscape for you. Some vendor programs perform this task, but they are for specific application servers, not for a generic use such as a database server. Unless your application maps to one of these calculators directly, you still need to do the work yourself. Variables First, build the variables from the information in this chapter. Use a separate table or spreadsheet for each and dedicate a separate grouping of these tables for each function the servers will perform. Application Begin with the application. The following spreadsheet is a representation of the kind of information you want to gather: Application Title: Application Overall Description: Application Class (ERP, CRM, etc.): Application Architecture Type, with description of each layer from data to presentation (remove those architectures not in use): Monolithic Client/Server Three-Tier Distributed Computing Service-Oriented Architecture Landscape Next, describe the type of environment the software will use. Record details regarding the number of sites, physical locations, and the number of users at each site: Farm Department Organization Enterprise User Information Create a list of the number of users expected for the application. For each location, categorize the users into types. For instance, in an ERP application, you might have 100 users that enter orders requests, 10 buyers, and so forth. Find out the hours the users will access the system, using Greenwich mean time if you are in multiple time zones. This information is important to know to develop your disaster recovery and maintenance windows. If you discover that you have no discernable maintenance windows, you must add a duplicate system to "fail over" to so that you can apply patches and so forth. Develop a "load profile" that gives a metric to the amount of resources that type of user will take. In the case of a user entering purchase orders, for instance, you might evaluate the system used to determine that they take 1 percent of the CPU, 14K of bandwidth, and 2K of storage per transaction. You can use those numbers to classify the users into high, medium, and low, or you can use a numeric scheme such as 1 to 10. Finally, record the functions within the application that this classification of user accesses, especially as they relate to reporting. Location Type Number Hours Load Profile Functions Accessed Decision Matrix The process to arrive at a good decision is to record what you know and use that information to answer what you do not know. What you know is explained in the variables section, and the decision matrix helps you develop answers to what you do not know. What you know is captured in the spreadsheets you just created, and what you do not know is which edition(s) of SQL Server to install and what to install them on. With that information filled out, you can put the variables into a matrix to determine the factors that will help you set up your systems. Assign a numeric set of values to each factor, using whatever scale is appropriate. In this example, I have set the numbers to range from 1 to 10, with 1 being a "lighter" value than 10. To further enhance the reliability of the decision, weight the factors that make sense in your environment. For instance, if speed is more important than growth, weight the user and I/O calculations higher than the projected growth values. After you put the measurements together in a matrix, you must figure what meets the need. You can create a single "atomic" value of a transaction and multiply that out over the variables or you can generalize the load across peak and base values. If you are unsure of creating the atomic transaction number, it is safer to estimate a peak load and put the base at half that value. Those numbers enable you to select a system that runs at a minimal level and one that can handle the peak load. In the middle of those systems is the "average" choice. I use the peak and base method in this example. In this chart, I take the variables I know and place them on the left. Each variable is given a score from 0 (not applicable/advisable) to 100 (perfectly suited), indicating how well that particular variable works on the choices of hardware and software. The numeric figure I use is not scientific, because I will weight the score for the environment that I have. The application I have is a Web-based architecture with a separate reporting instance, and the landscape at the organization is a "Business" type. The storage for the application is 100GB for the first year, with an estimated 10 percent growth pattern. My testing scenario against the application involved a Fibre Channel SAN with six LUNs presenting. I also used a 32-bit operating system and SQL Server edition. For this example, I have already filled out the user profile and used that information to get the following breakdown: Light (fewer than 10 transactions per day)25 users Normal (25100 transactions per day)350 users Heavy (150+ transactions or heavy reporting and analysis)100 users Mobile (local subset of data from system with periodic sync)15 users Remote (clients with limited access to main system)10 users Each transaction (averaged) in my testing showed the following loads on these objects, per minute: CPU .7% RAM 100K (released after each call) I/O .05% NIC 25K In some systems, each transaction generates a different load on these resources. To keep the example succinct, I averaged the transactions from the various user types based on testing. This is a valid method if your application will (over time) show an average load distribution. Your application might differ. To find out how your real-world application loads the system, measure the various objects such as CPU and RAM over a day of average use (or test to simulate that) and get the averages. Also calculate the standard deviations for those same periods. If the standard deviations are low, you can use the averages. If the standard deviations are high and you use the average method, you will end up with an underpowered system at critical times and an idle system at others, and a lot of unhappy users. In that situation, it is better to determine just how often the high values occur. If they occur often, optimize the system to handle the high values. I will consider the reporting system separate from the application server, so the information I gather in this exercise is for the application server only. I will follow the same process to develop the reporting server later. Using the information above, I developed the following matrix for my example: Loads Values CPU load (500 users at .7% per transaction) 350.00 % of capacity Memory (500 users at 100K per transaction) 48.83 MB Network bandwidth (500 users at 25K per transaction) 12 MB I/O load (at .05% per transaction) 25 % of capacity With the raw numbers on this chart, I can see that I need at least three and a half CPUs, and that is just for the application. That brings me to four full processors for the application and the operating system. I have to make a decision here, however, regarding growth. After checking with the developers, I discover that the application can federate (that is, break functions onto other servers). I decide that four processors in a single machine will be enough. If the system did not federate, I would recheck my numbers, and if they still held true, I would recommend more processors. Each decision affects others, so I might repeat the load testing with 64-bit servers and see whether I experience any gains there. Adding more than four processors kicks the SQL Server edition up a notch. The memory for the application is not a high value, but I want to keep as much cache as I can in RAM. I decide that 4GB of RAM will provide enough room for caching, locks, the operating system, and other utilities. Evaluating the network bandwidth, I see that I have plenty of network capability on the network interface card (NIC) that I will dedicate to the clients. I always include a separate NIC in a server for backups and replication of data, so I do not need to factor that traffic on the dedicated client network interface. My matrix also shows lots of room for growth with what is already in use over on the testing system. It is also fast, so I recommend a duplicate of that storage system for my production landscape. Based on all this information, I see that I need a SQL Server edition that can support four processors and has the capability for Reporting Services. Because the servers can federate and I do not need more than four processors on any one server, I can get by with Standard Edition. For the mobile users, I query the developers again and find that the Express Edition will work for the laptops they use. I now have enough information to begin researching the vendors for the best deal, all from fairly well-researched information. Although this is a simple representation, it does demonstrate the process. You can extrapolate from the information that you see here to create a system for your production applications. Remember that if the system will house multiple applications, you need to go through these exercises for each. Monitoring Using this process, you can now make the decisions for your environment and develop the metrics you will use to monitor the solution. Make sure that you instrument the system so that you can track the values over an appropriate interval, such as weekly or monthly. Each metric will have its own periodicity, so make sure your collection method takes that into account. I explain the mechanics of monitoring SQL Server further along in the book, but make sure you bring up this topic with the vendor or in-house developers. You need to make sure you can monitor their software, too. In Chapter 5, you will find that SQL Server 2005 provides a wealth of functions to monitor and track your SQL Server. You can use those features to monitor not only for growth, but also for performance. With your system installed and configured, let's explore a little more about the tools you have to control SQL Server.

Take Away
To size your server and install the software, you need to understand the variables involved in the decision and then match up the options to create three possible choices: standard, enhanced, and optimal. To do that, you need to find out what the minimal possible configurations are and what to get if money is not an option. You can use the information in this section to develop your baseline, and then expand that with metrics to determine the second two options. If you make your baseline realistic and support it with the information that follows, you should be able to make a strong case for it.

The bad news is that no magic formulas tell you what to buy and how to configure it. The best way to make the hardware decisions is to detail the information in some meaningful way and examine it to come up with a solution. An additional benefit is that after you have written everything down, you can talk with vendors and other professionals intelligently about your needs.

I detail several processes here using simple spreadsheets, tables, and scripts. You can take these processes and create a programmatic system from them; remember, however, that at some level there is always an element of judgment that you will use from your own experiences and corporate environment. Every situation will differ, which is why no computer program can build your landscape for you. Some vendor programs perform this task, but they are for specific application servers, not for a generic use such as a database server. Unless your application maps to one of these calculators directly, you still need to do the work yourself.

Variables
First, build the variables from the information in this chapter. Use a separate table or spreadsheet for each and dedicate a separate grouping of these tables for each function the servers will perform.

Application
Begin with the application. The following spreadsheet is a representation of the kind of information you want to gather:

Application Title:

Application Overall Description:

Application Class (ERP, CRM, etc.):

Application Architecture Type, with description of each layer from data to presentation (remove those architectures not in use):


Monolithic



Client/Server



Three-Tier



Distributed Computing



Service-Oriented Architecture


Landscape
Next, describe the type of environment the software will use. Record details regarding the number of sites, physical locations, and the number of users at each site:

Farm

Department

Organization

Enterprise

User Information
Create a list of the number of users expected for the application. For each location, categorize the users into types. For instance, in an ERP application, you might have 100 users that enter orders requests, 10 buyers, and so forth.

Find out the hours the users will access the system, using Greenwich mean time if you are in multiple time zones. This information is important to know to develop your disaster recovery and maintenance windows. If you discover that you have no discernable maintenance windows, you must add a duplicate system to "fail over" to so that you can apply patches and so forth.

Develop a "load profile" that gives a metric to the amount of resources that type of user will take. In the case of a user entering purchase orders, for instance, you might evaluate the system used to determine that they take 1 percent of the CPU, 14K of bandwidth, and 2K of storage per transaction. You can use those numbers to classify the users into high, medium, and low, or you can use a numeric scheme such as 1 to 10.

Finally, record the functions within the application that this classification of user accesses, especially as they relate to reporting.

Location
Type
Number
Hours
Load
Profile
Functions Accessed






Decision Matrix
The process to arrive at a good decision is to record what you know and use that information to answer what you do not know. What you know is explained in the variables section, and the decision matrix helps you develop answers to what you do not know. What you know is captured in the spreadsheets you just created, and what you do not know is which edition(s) of SQL Server to install and what to install them on.

With that information filled out, you can put the variables into a matrix to determine the factors that will help you set up your systems. Assign a numeric set of values to each factor, using whatever scale is appropriate. In this example, I have set the numbers to range from 1 to 10, with 1 being a "lighter" value than 10. To further enhance the reliability of the decision, weight the factors that make sense in your environment. For instance, if speed is more important than growth, weight the user and I/O calculations higher than the projected growth values.

After you put the measurements together in a matrix, you must figure what meets the need. You can create a single "atomic" value of a transaction and multiply that out over the variables or you can generalize the load across peak and base values. If you are unsure of creating the atomic transaction number, it is safer to estimate a peak load and put the base at half that value. Those numbers enable you to select a system that runs at a minimal level and one that can handle the peak load. In the middle of those systems is the "average" choice. I use the peak and base method in this example.

In this chart, I take the variables I know and place them on the left. Each variable is given a score from 0 (not applicable/advisable) to 100 (perfectly suited), indicating how well that particular variable works on the choices of hardware and software. The numeric figure I use is not scientific, because I will weight the score for the environment that I have.

The application I have is a Web-based architecture with a separate reporting instance, and the landscape at the organization is a "Business" type. The storage for the application is 100GB for the first year, with an estimated 10 percent growth pattern. My testing scenario against the application involved a Fibre Channel SAN with six LUNs presenting. I also used a 32-bit operating system and SQL Server edition.

For this example, I have already filled out the user profile and used that information to get the following breakdown:

Light (fewer than 10 transactions per day)25 users

Normal (25100 transactions per day)350 users

Heavy (150+ transactions or heavy reporting and analysis)100 users

Mobile (local subset of data from system with periodic sync)15 users

Remote (clients with limited access to main system)10 users

Each transaction (averaged) in my testing showed the following loads on these objects, per minute:

CPU .7%

RAM 100K (released after each call)

I/O .05%

NIC 25K

In some systems, each transaction generates a different load on these resources. To keep the example succinct, I averaged the transactions from the various user types based on testing. This is a valid method if your application will (over time) show an average load distribution. Your application might differ.

To find out how your real-world application loads the system, measure the various objects such as CPU and RAM over a day of average use (or test to simulate that) and get the averages. Also calculate the standard deviations for those same periods. If the standard deviations are low, you can use the averages.

If the standard deviations are high and you use the average method, you will end up with an underpowered system at critical times and an idle system at others, and a lot of unhappy users. In that situation, it is better to determine just how often the high values occur. If they occur often, optimize the system to handle the high values.

I will consider the reporting system separate from the application server, so the information I gather in this exercise is for the application server only. I will follow the same process to develop the reporting server later. Using the information above, I developed the following matrix for my example:

Loads
Values

CPU load (500 users at .7% per transaction)
350.00
% of capacity

Memory (500 users at 100K per transaction)
48.83
MB

Network bandwidth (500 users at 25K per transaction)
12
MB

I/O load (at .05% per transaction)
25
% of capacity





With the raw numbers on this chart, I can see that I need at least three and a half CPUs, and that is just for the application. That brings me to four full processors for the application and the operating system. I have to make a decision here, however, regarding growth.

After checking with the developers, I discover that the application can federate (that is, break functions onto other servers). I decide that four processors in a single machine will be enough. If the system did not federate, I would recheck my numbers, and if they still held true, I would recommend more processors. Each decision affects others, so I might repeat the load testing with 64-bit servers and see whether I experience any gains there. Adding more than four processors kicks the SQL Server edition up a notch.

The memory for the application is not a high value, but I want to keep as much cache as I can in RAM. I decide that 4GB of RAM will provide enough room for caching, locks, the operating system, and other utilities.

Evaluating the network bandwidth, I see that I have plenty of network capability on the network interface card (NIC) that I will dedicate to the clients. I always include a separate NIC in a server for backups and replication of data, so I do not need to factor that traffic on the dedicated client network interface.

My matrix also shows lots of room for growth with what is already in use over on the testing system. It is also fast, so I recommend a duplicate of that storage system for my production landscape.

Based on all this information, I see that I need a SQL Server edition that can support four processors and has the capability for Reporting Services. Because the servers can federate and I do not need more than four processors on any one server, I can get by with Standard Edition. For the mobile users, I query the developers again and find that the Express Edition will work for the laptops they use. I now have enough information to begin researching the vendors for the best deal, all from fairly well-researched information.

Although this is a simple representation, it does demonstrate the process. You can extrapolate from the information that you see here to create a system for your production applications. Remember that if the system will house multiple applications, you need to go through these exercises for each.

Monitoring
Using this process, you can now make the decisions for your environment and develop the metrics you will use to monitor the solution. Make sure that you instrument the system so that you can track the values over an appropriate interval, such as weekly or monthly. Each metric will have its own periodicity, so make sure your collection method takes that into account. I explain the mechanics of monitoring SQL Server further along in the book, but make sure you bring up this topic with the vendor or in-house developers. You need to make sure you can monitor their software, too.

In Chapter 5, you will find that SQL Server 2005 provides a wealth of functions to monitor and track your SQL Server. You can use those features to monitor not only for growth, but also for performance.

With your system installed and configured, let's explore a little more about the tools you have to control SQL Server.

Administrator's Guide to SQL Server 2005--chapter01--Installation process

Installation Process
All Microsoft software includes a simple installation program. Gone are the days when the system administrator had to set aside an entire week to install and configure the software. What I cover here is not the entire installation process, but the overall decisions you have to make during the install.


DBA 101
You can install SQL Server multiple times, using a separate designator for each installation. Microsoft calls these multiple installations "named instances" or simply "instances." Actually, the entire software suite is not installed multiple times, just enough of the binaries to make each instance unique. This feature allows you to have multiple security and configuration options. You could keep one instance at Service Pack 1 and another at Service Pack 2, for instance. Instances also allow you to have separate administrators for the same physical hardware.





When you install SQL Server for the first time, you can choose to have a named instance or a "default" instance. Using the default instance, your applications will refer to the server name alone as SQL Server; when you use a named instance, the format to refer to the SQL Server is SERVERNAME\INSTANCENAME. So, assuming you have installed SQL Server 2005 on a server named SVR1, you refer to the SQL Server default instance as SVR1. If you install the software again, this time as a named instance called INST2, you refer to it as SVR1\INST2.

When you install another instance of SQL Server, make sure you account for the increase in resources necessary to run it. Do not spend the same hardware twice without realizing that you have not added enough I/O and memory to carry the increased load. Instances are a convenience, not a way to buy fewer servers for the same load.

After you have read this chapter and planned out your system landscape, you will begin the actual installation. When you begin the installation, the primary choices you make are drive layouts and service accounts.

Before you install SQL Server, make sure you have your operating system current with the latest patches and security fixes and have all the utilities you need. In previous versions of SQL Server, it was also useful to have a mail client installed, but that is no longer the case.

First, you need to decide where you want to keep the binaries of the program and where you want to store data files. The optimal solution is to keep at least these five things apart: the SQL Server program files, data files, log files, index files, and the tempdb database files.

Next, pick a Windows account to run the SQL Server services. This account does not need administrative privileges on the local server or domain or enterprise admin rights. The installation handles assigning the account the proper privileges.

At least two services will be installed. One service will operate the SQL Server engine, another will operate the SQL Server Agent, which automates tasks and provides alerts and notifications. Use a separate account for each function and ensure that each is a specific Windows user account for that service. Make sure you set the password to something complex and set it not to expire. Do not use those accounts for anything else.

You will get one set of services for each instance. Use a separate set of accounts for each instance. The reason is that certain stored procedures (Transact-SQL code that runs on the server) might be allowed to access the operating system. If these are enabled (not always a wise choice anyway), using the same account across all instances loses the ability to track who has made changes to the system.

As you can see in Figure 1-1, when the installation program starts, it first installs the Windows Installer 2.0, the .NET Framework 2.0, and several SQL Server Setup support files. When that completes, it runs a system consistency check, which is a series of checks to ensure there is enough drive space, that the operating system is correct, and other housekeeping. You can see the output on my test system in Figure 1-2.


Figure 1-1.

[View full size image]







Figure 1-2.

[View full size image]





After the check runs, the system presents you with a list of options for the feature set you are interested in.

Do not install everything just because you think you might need it. That takes up space and makes significant changes to the way your installation is automatically configured. You can always come back and add features to the software later using this same installation program. On the other hand, if you are installing a test system (not production!) now, you can select everything. If you do not, we will add it later when we come to that feature in the book. In Figure 1-3, I've selected everything on this test installation.



Figure 1-3.

[View full size image]





Next you are asked about installing the software as a default versus a named instance. You are also asked where the programs and data should live and which account to use to start all the services. Because you have planned your installation, you are better able to intelligently answer these questions.

Two options at the end of the process might give you pause. The first option involves sending error reports to Microsoft in the case of a problem. The second deals with the usage of the tools you are using in SQL Server. In Figure 1-4, I've made both of these selections.



Figure 1-4.

[View full size image]





Think long and hard about these choices. The first reaction most technical professionals have is to clear these choices, because they are afraid of a privacy compromise. If you feel uncomfortable with these options or your organization policy prohibits them being set, then by all means deselect them. If you are willing to tolerate a little Big Brother, however, the information Microsoft receives from these choices can go a really long way toward making SQL Server a better, more secure platform. As you will learn in Appendix A, these installation check boxes make everyone's upgrade a little better.

If you take the defaults during the installation, you will not have any of the sample databases and code. This is desirable on a production server, but you will want to install these on development systems. To do that, go through the Control Panel in Windows and then select Add or Remove Programs. Select the Microsoft SQL Server 2005 Tools item and then click the Change button.

I usually add all the sample databases and examples on a development system, which will install the AdventureWorks database and (if you pick everything as I do) the AdventureWorks OLAP database, too.

You might want to make other changes after the system is installed. To do that, you use the SQL Server Surface Area Configuration tool. I cover that tool in a few chapters throughout the book.

Operating System Variables
Depending on the version of Windows your server is running, you need to set various switches and operating system variables. Windows Server 2003 and higher provides significant performance and security advantages over the earlier versions of Windows operating systems.

Regardless of the operating system version, keep in mind a few base settings. For starters, ensure that the system runs only SQL Server. Unless the installation is quite small, such as an Express Edition installation, you do not want to put any other applications on the server other than management utilities and backup software. It is tempting to put lots of applications on the new, not-heavily-used-yet SQL Server, but it could eventually conflict with SQL Server, and at the very least it will cause performance issues. Leave the SQL Server box for SQL Server.

Carefully consider the drive layout. The binaries for the operating system and other software should get its own physical drive, preferably inside the server hardware itself. The paging file should go on its own physical drive, too, and both of these should be kept away from the data, indexes, and tempdb files used by SQL Server.

If you are running Windows 2000 Server Editions, you need to set a few switches and options to take advantage of higher RAM amounts. If you are using more than 3GB of memory on a 32-bit CPU, you may want to enable the /3GB switch in the BOOT.INI file of the operating system. If you are using more than 4GB of RAM, you may want to use the /PAE switch, too.

Several caveats apply to these switches. You can find these in Books Online under the topic of "Enabling Memory Support for Over 4 GB of Physical Memory." The various settings and processes to follow depend on the operating system, processor type (32 or 64 bit), and the specific edition you are using. The SQL Server Web site at Microsoft also has several white papers on this topic; because each service pack might change these settings, check those resources for the most up-to-date information.

Post-Installation Configuration
With the planning for the server landscape complete, the final step is to predict the growth of the system. There are lots of fancy formulas to help you with this, and most of them amount to nothing more than an educated guess.

The better option is to monitor the system when it is in place and then use those numbers to do predictive analysis in the future. I explain more about that process in a bit. For the short term, plan for the growth you expect and add 10 to 25 percent, whichever your budget will allow. Most important of all, make sure the system you purchase can accept more CPUs and memory and is generally expandable.

After installation, gather metrics as you use the system. I show you how to do that in Chapter 5. Evaluate the metrics at least monthly and provide feedback to the site IT managers or whoever makes budget decisions. Most managers do not mind spending a little overtime to keep the infrastructure current, as opposed to a huge bill to change out the entire system.

There are many other factors in this decision process, but these are the primary ones to keep in mind. The "Take Away" section that follows shows a more complete exercise.

I have explained the versions and their capabilities and detailed the hardware components. Now it is time to put it all together and build your environment. In the following section, I have developed some processes that will help you document your variables, create a decision matrix, and then create a monitoring system for future growth.

Saturday, June 19, 2010

PHP QUESTIONS AND ANSWERS

PHP QUESTIONS AND ANSWERS



what is the difference between ph4 and php5
Interview .com Answer
The main difference is PHP5 has much more focus on Object
Oriented Programming. In PHP5 you can pass functions by
reference, you can have abstract classes, interfaces etc.

Question
What is the difference between PHP,ASP and JSP?
Interview .com Answer
All 3 are Server Side scripting language of which

ASP is developed by microsoft, runs on IIS

JSP developer by Sun, runs on Apache Tomcat

PHP is open source, runs on Apache

Answer
All 3 are Server Side scripting language of which

ASP is developed by microsoft, runs on IIS. But its Slower than PHP

JSP developer by Sun, runs on Apache Tomcat, Slower than PHP but good for big level of projects

PHP is open source, runs on Apache, Faster than all and best for small and middle level of projects
Answer
Hi all, i just found one useful information about recent
questions on php,mysql,js and css.
http://imsrinivas.com/2010/06/most-recent-interview-questions-on-php-mysql-javascript-html-and-css/

Question
How to find second highest salary
© ALL Interview .com Answer
SELECT sallary FROM employee ORDER BY sallary ASC limit 1,2

Answer
SELECT salary FROM Employee_table ORDER BY salary DESC LIMIT 1,1

Answer
For Second Highest Salary:
select salary from tbl_name order by salary desc limit 1,1
For Third Highest Salary:
select salary from tbl_name order by salary desc limit 2,1
For Fourth Highest Salary:
select salary from tbl_name order by salary desc limit 3,1

Answer
select max(salary) from tbl_name where salary !=(select
max(salary) from tbl_name);

Answer
Select MAX(Salary) from tbl
order by salary DESC limit 1,1

Answer
if we want to make use of nested query instead of the above,
try the following

select max(column_name) from table_name where column_name =
(select
max(column_name)-(highest_salary_number_for_calculation -1)
from blocks where bid);

Example :

For second highest salary:

select max(bid) from blocks where bid = (select max(bid)-1
from blocks);

For third highest salary:

select max(bid) from blocks where bid = (select max(bid)-2
from blocks);
Prakash.matte
Answer
select salary from employee where max(salary)<(select salary from employee) Question how set session expire time in php? ALL Interview .com Answer go to php.ini , set the time limit for the session Answer unset("username" "timeout",60) Answer Question is not for ini file and not for unsetting, it is for changing the session life time from php file. ini_set("session.gc_maxlifetime", number_of_seconds); We can override the php.ini settings (if we don't have access) from php file using ini_set() Answer u feel u dont have access php.ini , then go with .http , make changes Question Want to know the 10th max salary in salary table ALL Interview .com Answer SELECT sal FROM salary SORT BY sal desc limit 9,1 Answer SELECT sal FROM salary ORDER BY sal DESC 9,1 Question what is the default session expire time in php? what is default file attachment size in mail in php? © ALL Interview .com Answer Default Session expire time is 24mins Default attachement size is 2mb both can be changed in php.ini file. Answer 40 minutes,5mb Siddharth [Upcilon] Question how much a fresher php programmer can earn in india Interview .com Answer i think not more than seven-ten thousand. Sumit Answer not more than 3.500 to 4000 Question How to convert any type of video formate in flv formate in php can any buddy give me coding. estion Submitted By :: om Answer check ffmpeg functions http://imsrinivas.com/2010/06/most-recent-interview-questions-on-php-mysql-javascript-html-and-css/ - www.tolance.com What is the method used to upload a file in html Enctype=”multipart/form-data Hi All, Recently i have attended interviews for several companies.its been very difficult to clear an interview for experienced [5+] persons.So i decided to prepare the list of questions[ im sorry i didnt come up with answers as of now] which is asked in my recent interviews.Im very new to blogging once i found the free time i will definitely add answers for these questions.I think this is very very useful information for web developers whoever preparing for the interviews. And these are the most recent and important questions perticulary interview panel expecting the answers from the candidate.So prepare well and all the very best.!! PHP 1)What is the diff between php4 and php5 ? 2)How to edit php ini settings without manual access ? 3)Diff between Abstract and Interface ? 4)How to access class function without instance ? 5)Is multiple inheritance supports in PHP ? 6)Diff between explode and split ? 7)Tell some CURL options ? 8)Diff between SOAP and REST ? 9)In Abstract class is it possible to give all methods as abstract methods? 10)Advantages of OOPS ? 11)Diff between explode and implode ? 12)What is include_once and require_once ? 13)How to add content at the end of the file using file functions ? 14)How to read cookie expiry time in php ? 15)What is HTTP ? 16)Diff between GET and POST, Where we can see the submited data in POST method ? 17)Tell me about Session 18)What is the default uploaded file size ? 19)How to parse XML ? 20)What is simpleXml ? 21)How to restrict the class to inherit from another class ? 22)What are the security issues in PHP ? 23)What is JSON ? 24)What is Cross site scripting ? 25)Syntax for preg_match ? 26)What is array_combine ? will it support in php4 ? 27)Overloading and overriding in php5 ? 28)Explain about magic methods in php5 29)What is autoload ? 30)If browser disables the cookie how to maintain session using php ? 31)What is call method ? 32)Optimisation in PHP 33)What is mod_rewrite ? 34)What is .htaccess and what is the use of this file ? 35)Caching in php 36)What is register_globals ? 37)What is polymorphism 38)What is the use of Interface 39)Tell few string function names 40)Explain about web services MySql 1)Tell me about Triggers and Storedprocedures. 2)About normalization ? 3)Diff between primary key and foriegn key 4)Diff between primary key and unique key 5)What is INDEX and how to create index 6)About joins 7)Diff between MyIsam and InnoDB 8)What are the different mysql engines 9)Diff between subquery and corelated query 10)Write a query to fetch secong largest salary taking employee frm emp table 11)Query for Export and Import data 12)Syntax for trigger and stored procedure HTML 1)Diff between Div and Span 2)What is DTD ? How many types are there Explain about all 3)Diff between HTML and XHTML 4)Optimisation in HTML CSS 1)Explain about box model 2)Diff between margin and padding 3)Diff types for positioning 4)Diff between position absolute and relative 5)What is float ? 6)CSS sprites 7)Optimisation in CSS 8)Diff between display inline and block 9)What is cascading 10)Image sprites 11)Conditional css 12)Diff types of styling css 13)What is the priority levels for diff types of css styling 14)Explaing about external and inline 15)What is import ? What are storage engines in mysql MyISAM Default engine as of MySQL 3.23 with great performance CSV CSV storage engine MRG_MYISAM Collection of identical MyISAM tables BLACKHOLE /dev/null storage engine (anything you write to it disappears) FEDERATED Federated MySQL storage engine InnoDB Supports transactions, row-level locking, and foreign keys ARCHIVE Archive storage engine MEMORY Hash based, stored in memory, useful for temporary tables PHP Sessions - Why Use Them? As a website becomes more sophisticated, so must the code that backs it. When you get to a stage where your website need to pass along user data from one page to another, it might be time to start thinking about using PHP sessions. Advertise on Tizag.com A normal HTML website will not pass data from one page to another. In other words, all information is forgotten when a new page is loaded. This makes it quite a problem for tasks like a shopping cart, which requires data(the user's selected product) to be remembered from one page to the next. PHP Sessions - Overview A PHP session solves this problem by allowing you to store user information on the server for later use (i.e. username, shopping cart items, etc). However, this session information is temporary and is usually deleted very quickly after the user has left the website that uses sessions. It is important to ponder if the sessions' temporary storage is applicable to your website. If you require a more permanent storage you will need to find another solution, like a MySQL database. Sessions work by creating a unique identification(UID) number for each visitor and storing variables based on this ID. This helps to prevent two users' data from getting confused with one another when visiting the same webpage. Note:If you are not experienced with session programming it is not recommended that you use sessions on a website that requires high-security, as there are security holes that take some advanced techniques to plug. Starting a PHP Session Before you can begin storing user information in your PHP session, you must first start the session. When you start a session, it must be at the very beginning of your code, before any HTML or text is sent. Below is a simple script that you should place at the beginning of your PHP code to start up a PHP session. PHP Code:
This tiny piece of code will register the user's session with the server, allow you to start saving user information and assign a UID (unique identification number) for that user's session.
Storing a Session Variable
When you want to store user data in a session use the $_SESSION associative array. This is where you both store and retrieve session data. In previous versions of PHP there were other ways to perform this store operation, but it has been updated and this is the correct way to do it.
PHP Code:

Display:
Pageviews = 1
In this example we learned how to store a variable to the session associative array $_SESSION and also how to retrieve data from that same array.
PHP Sessions: Using PHP's isset Function
Now that you are able to store and retrieve data from the $_SESSION array, we can explore some of the real functionality of sessions. When you create a variable and store it in a session, you probably want to use it in the future. However, before you use a session variable it is necessary that you check to see if it exists already!
This is where PHP's isset function comes in handy. isset is a function that takes any variable you want to use and checks to see if it has been set. That is, it has already been assigned a value.
With our previous example, we can create a very simple pageview counter by using isset to check if the pageview variable has already been created. If it has we can increment our counter. If it doesn't exist we can create a pageview counter and set it to one. Here is the code to get this job done:
PHP Code:

The first time you run this script on a freshly opened browser the if statement will fail because no session variable views would have been stored yet. However, if you were to refresh the page the if statement would be true and the counter would increment by one. Each time you reran this script you would see an increase in view by one.
Cleaning and Destroying your Session
Although a session's data is temporary and does not require that you explicitly clean after yourself, you may wish to delete some data for your various tasks.
Imagine that you were running an online business and a user used your website to buy your goods. The user has just completed a transaction on your website and you now want to remove everything from their shopping cart.
PHP Code:

You can also completely destroy the session entirely by calling the session_destroy function.
PHP Code:

Destroy will reset your session, so don't call that function unless you are entirely comfortable losing all your stored session data!

Question ID:
php
1
/ 54

Author: none
Question:
You can get PHP variables sent by a GET HTTP request by:



a)
using the $_GET["varname"]

b)
using the argv["varname"]

c)
a or b


d)
none of the above

Question ID:
PHP
38
/ 54

Author: palmer
Question:
PHP 5 comes with a Reflection API including several Reflection classes



a)
true (Correct answer)

b)
false

c)


d)

Question ID:
SQL
22
/ 28

Author: none
Question:
Which of the following will NOT have an effect on the performance SELECT queries? Assume that table employee has char last(50), char first(50)



a)
ANALYZE TABLE employee

b)
OPTIMIZE TABLE employee

c)
ALTER TABLE employee ADD INDEX(last(20),first(20));


d)
ENHANCE TABLE employee
(Correct answer)

Question ID:
css
11
/ 16

Author: none
Question:
What tag do you use for internal style sheets?


a)
style

b)
css

c)
body


d)
the name of the surround html tag fro that element
Correct

Question ID:
html
1
/ 32

Author: none
Question:
How do you let a javascript method execute on loading of an HTML document?



a)
event_listener( "onload", method() )

b)
the onload attribute inside body tag

c)
you cannot call javascript methods on a HTML page load


d)

Correct

Question ID:
Javascript
13
/ 30

Author: joe
Question:
How do you place a javascript function into an tag if you only want to execute that function?


a)
click me

b)
click me (Correct answer)

c)
click me


d)
click me





________________________________________

Question ID:
css
3
/ 16

Author: none
Question:
What is an inline style?


a)
is embedded in the element but applies to a class of elements

b)
is embedded at the top of the page in the style element and applies to the whole site

c)
is embedded at the top of the page in the style element and applies to the whole page



d)
applies to one specific element
Correct

Question ID:
bash
8
/ 15

Author: none
Question:
What kind of a process does the following bring into the foreground? fg %?abc


a)
end of the process name is ''abc''

b)
proces name starts with ''abc''

c)
the whole process name is ''abc''


d)
any part of the process name has ''abc''
Correct -> d

Question ID:
PHP
43
/ 54

Author: matsumodo
Question:
If $a and $b are arrays, What will happen to the following code?
$c = $a + $b


a)
error

b)
warning

c)
each of the elements of $a are added to each of the elements of $b, result goes into each element of $c


d)
$c will have the union of $a and $b
Correct -> d)
Question ID:
php
6
/ 54

Author: none
Question:
What is the difference between print and echo?


a)
almost no difference, both set return values, both can have multiple expression statements

b)
echo is a little faster because it does not set a return value though neither print or echo have multiple expression statements

c)
print is a little faster because it does not set a return value


d)
Echo can have Multiple Expression statements AND is a little faster because it does not set a return value
Correct -> d)




Question ID:
HTML
27
/ 32

Author: none
Question:
How do you make a hyperlink?



a)
http://www.codesplunk.com

b)
http://www.codesplunk.com

c)
codesplunk


d)
codesplunk
Correct -> d)
Question ID:
php
2
/ 54

Author: none
Question:
Which of the following is true about PHP with regards to XML


a)
PHP5 XML handling is not backwards compatible with PHP4 XML handling

b)
PHP5 XML and PHP4 XML are different but backwards compatible

c)
there is no difference between PHP5/PHP4 XML handling


d)
none of the above
Answer a



Question ID:
php
3
/ 54

Author: none
Question:
Which of the following PHP Settings is NOT specified in the php.ini file?


a)
the level of error/warning output

b)
allow or disallow short tags


b)

c)


d)
A or C will work
Correct answer a



Question ID:
PHP
22
/ 54

Author: rufus
Question:
What are the differences between require and include, include_once?



a)
require throws a fatal error if it cannot find the page it is trying to include

b)
include_once and require_once will include the page at most one time, even if called multiple times

c)
require checks to make sure all variables in the included file are declared, throws error otherwise


d)
A and B (Correct answer d)



Question ID:
PHP
23
/ 54

Author: rufus
Question:
What is PEAR?



a)
a library of open-sourced code for PHP users

b)
answer A and has a command-line interface that can be used to automatically install "packages"

c)
answer A,B and includes the PHP foundation classes (PFC)


d)
answer A,B,C and does not include web services libraries
(Correct answer C)

Question ID:
PHP
24
/ 54

Author: none
Question:
What is a reference variable?


a)
a variable that can be accessed through another variable ex: $a='b'; $$a is equal to $b

b)
a variable that is passed to a function parameter, copied both ways

c)
a variable who's address is passed through a function parameter


d)
a variable used to access an object or structure
Correct Answer a

Question ID:
PHP
25
/ 54

Author: none
Question:
How To Get the Uploaded File Information in the Receiving Script?



a)
through an object $_SERVER['FILES']

b)
through the two dimensional array $_UPLOAD

c)
through an object $_UPLOAD


d)
through a two dimensional array called $_FILES
(Correct answer is d)

Question ID:
PHP
26
/ 54

Author: none
Question:
Why do I keep getting the wrong number whenever I set the variable equal to a number that starts with zero? Like $a=0246;


a)
PHP treats numbers that start with a zero as trinary

b)
PHP treats numbers that start with a zero as binary

c)
PHP treats numbers that start with a zero as hexadecimal


d)
PHP treats numbers that start with a zero as octal
(Correct answer is d)

Question ID:
PHP
27
/ 54

Author: blomfeldsj
Question:
How do you pass by reference in PHP?


a)
variables are passed by reference by default

b)
place a

c)
place a # sign in front of the parameter


d)
place the reference keyword before the parameter
Correct answer b


Question ID:
PHP
28
/ 54

Author: none
Question:
What does urlencode do?


a)
returns a string that converts special characters into % signs followed by two hex digits

b)
codes the url into binary string

c)
codes the url into a nonhuman readable string that can be decoded by urldecode


d)
(Correct answer a)

Question ID:
PHP
29
/ 54

Author: none
Question:
How do I find out how many parameters were passed into a function?


a)
num_args()

b)
getArgc()

c)
func_num_args()


d)
you can't unless you check each of the values of the arguments
Correct answer is c



________________________________________

Question ID:
PHP
30
/ 54

Author: none
Question:
How do you call a constructor for a parent class?


a)
parent( $arg )

b)
parent.constructor( $arg )

c)
parent->constructor( $arg )


d)
parent::constructor( $arg )



Correct answer is d
________________________________________

Question ID:
PHP
31
/ 54

Author: none
Question:
What are the most ways you can pass a variable from page to page


a)
Session, Cookies, Save to Server (DB or file)

b)
Form (hidden input field), Pass it through the Url string

c)
Session, Save to Server, Cookies, Pass it through the Url string


d)
A and B
Correct answer is d


Question ID:
PHP
32
/ 54

Author: none
Question:
What are some of the top level library packages found in PEAR?


a)
Authentication, HTTP, Mail, System

b)
Benchmarking, Configuaration, Direct X, GUI

c)
Semantic Web, TCP/IP, UDP, ARP


d)
A and B

Correct answer is a


Question ID:
PHP
33
/ 54

Author: none
Question:
Which delimeters are PHP programs surrounded by?



a)


b)
...

c)



d)

saigopal's shared items