Wednesday, December 7, 2011

CALLING A FORM TO ANOTHER FORM IN ORACLE D2K/FORMS/10G


CALLING FORMS AT RUN TIME (FORM TO FORM CALLING IN ORACLE D2K)
This  topic is related to how you can call another form from existing form. Very important topic in Oracle d2k.
1.       We can call forms at run times in  three ways.
2.       Call_form:- it opens the form in model window mode i.e unless and until we close the called form , we cannot go back to the calling form.
3.       Open_form:- this open the form in modeless mode i.e we can work on both calling form and called form at the same time without closing any them.
4.       New_form:- this always close the calling form (ex. On successful login , the login screen closed and the application open).

All these three methods take on mandatory parameter i.e the complete path of FMX file to be called.

General points needs to be remember.
We need to add parameter for passing the values to different form. Four thing we need to be remember always.
1.       Declare parameter.
2.       Create parameter.
3.       Add parameter.
4.       Call form/open form/new form
5.       Destroy parameter.

Example :- I am writing a code which will illustrate you how we can call a form from another form.
DECLARE
P PARAMETER;
BEGIN
P:= CREATE_PARAMETER_LIST(‘ABC’);
ADD_PARAMETER(P,’P_EMPDEPTNO’,TEXT_PARAMETER,:DEPT.DEPTNO);
CALL_FORM(‘C:\EMP.FMX’,NO_HIDE,NO_REPLACE,NO_QUERY_ONLY,P);
DESTROY_PARAMETER_LIST(P);
END;
PARAMETER PASSING BETWEEN FORMS
WE CAN PASS VALUES FROM ONE FORM TO ANOTHER FORM WITH THE HELP OF PARAMETER.
STEPS:
1.       CREATE A FORM MODULE(CALLED FORM).
2.       CREATE A BASE TABLE BLOCK.
3.       CREATE A PARAMETER IN THE FORM.
4.       IN THE PROPERTY AND PARAMETER MENTION NAME, DATATYPE.
5.       IN A WHENNEW BLOCK INSTANCE TRIGGER OF THE BLOCK MENTION THE FOLLOWING
SET_BLOCK_PROPERTY(‘EMP’,DEFAULT_WHERE,’DEPTNO:=’||:PARAMETER.P_EMP_DEPTNO);
EXECUTE_QUERY;
6.       SAVE, COMPILE AND COMPILE THE FORM.
7.       CREATE THE NEW FORM .


POPUP MENU IN ORACLE D2K,10G,FORMS


POPUP MENU IN ORACLE D2K
1.       IN THE FORM MODULE , WE CAN CREATE A POPUP MENU.
2.       RIGHT CLICK ON THE POP UP MENU AND SELECT ‘MENU EDITOR’.
3.       DESIGN YOUR MENU IN THE MENU EDITOR.\
4.       WRITE CODE,SAVE AND COMPILE.
5.       NOW IN THE PROPERTY OF ANY FORM OBJECT UNDER THE PROPERTY ‘POP UP MENU’, SELECT OUR POPUP MENU.
6.       RUN YOUR FORM MODULE, RIGHT CLICK AT THE REQUIRED OBJECT AND SEE THE POP UP MENU.
NOTE:-
1.       TO MAKE THE MENU ITEM VISIBLE ON HORIZONTAL/VERTICAL TOOLBAR IN THE PROPERTY , MENU ITEM MENTION VISIBLE ON HORIZONTAL/VERTICAL TOOLBAR(YES/NO).

MENU IN ORACLE D2K/DEVELOPER 2000/ORACLE 10 G


MENU IN ORACLE D2K.
1.       IT IS ANOTHER IMPORTANT MODULE OF FORM BUILDER WHICH IS USED TO DESIGN MENU AND THE MENU CAN BE ATTACHED TO THE FORM MODULE.
2.       EXTEN IS MMB( ON GENRATION WE GET MMX AND ON CONVERT WE GET MMT).

STEP TO CREATE MENU IN ORACLE D2K.
1.CREATE A MENU MODULE.
2. UNDER THE MENU MOUDLE , CREATE A MENU.
3. RIGHT CLICK ON THE ‘MENU’ AND SELECT ‘MENU’ EDITOR.
4. DESIGN YOUR MENU IN THE MENU EDITOR USING THE DOWN AND RIGHT ARRAY KEY.
5. IN THE PROPERTY OF MENU ITEMS MENTION  NAME,LABEL, MENU ITEM TYPE(PLANE/CHECK/RADIO/MAGIC/SEPRATOR),COMMAND TYPE ,PL/SQL OR NULL,MENU ITEM CODE
6.NOW  SAVE,COMPILE , AND GENRATE THE MENU MODULE.
7. NOW, IN THE PROPERTY OF FORM MODULE ( WHEN EVER WE WANT TO ATTACHED THE MENU MODULE), USE A PROPERTY CALLED AS MENU MODULE. ( HERE WE NEED TO MENTION THE COMPLETE PATH OF MMX FILE).
8.SAVE,  COMPILE AND RUN OUR FORM MODULE.

NOTE:- 1.  FOR RADIO MENU ITEMS, MENTION
MENU ITEM TYPE : RADIO,
 MENU ITEM RADIO GROUP :-  MENTION ANY VALUE BUT IT HAS TO BE SAME FOR ALL THE RADIO MENU ITEM OF THE GROUP)
2. FOR CHECK MENU ITEM MENTION ITEM TYPE : CHECK.
3.  FOR MAGIC MENU ITEM , ITEM TYPE SHOULD BE :MAGIC
    MAGIC MENU ITEM :- ( SELECT THE MATIC MENU ITEM LIKE CUT,COPY,PASTE ETC AS PER OUR REQ.)

Wednesday, May 11, 2011

ORACLE SQL


SQL
1.       THIS WAS DEVELOPED BY IBM AND IT IS BASED ON C LANGUAGE.
2.       ‘SQL’ STANDS FOR STRUCTURE QUERY LANGUAGE AND IT IS USED BY ALL RDBMS IN THE WORLD LIKE ORACLE,SYSBASE,SQL.SERVER, ACCESS.
3.       PARTS OF SQL ARE.
A.      DDL :- DATA DEFINATION LANGUAGE(CREATE,ALTER,DROP).
B.      DML:- DATA MANUPILATION LANGUAGE. (INSERT,UPDATE,DELETE,SELECT)
C.      DCL:- DATA CONTROL LANGAUGE(GRANT,REVOKE).
D.      TCL:- TRANSCTION CONTROL LANGUAGE.

\* ALL  EXAM IN THIS TUTORIAL ARE REFRENCED TO SCOTT  USER
TABLE NAME IS EMP, DEPT.
*/

SELECT STATEMENT.

1.       THIS IS USED TO GET THE RECORDS FROM TABLE ON THE BASIS OF SOME ONDITION.
SYNTAX:-
SELECT ,,….
FROM

WHERE
GROUP BY

HAVING
ORDER BY


EXAMAPLE  BASED ON EMP AND DEPT TABLE.

DISPLAY DETAILS OF EMPLOYEE WORKING IN DEPTNO 10 OR 20 AND HAVING SAL>200
ANS. SELECT * FROM EMP
           WHERE DEPTNO =10 OR DEPTNO 20 AND SAL>200.
2.       TO GET ALL COLUM FROM ANY TABLE,WE NEED TO USE THE SYMBOL ‘*’.
3.       IF WE DO NOT USE ANY ‘WHERE’ CONDITION THEN ALL THE RECORDS FROM THE TABLE WILL BE SELECTED.
4.       WE CAN USE OPERATOR FOR FILTRATION.
5.       SOME OF THE OPERATORS IN SQL ARE
A.      AIRTHMETIC OPERATOR(+,-,*,/)
B.      LOGICAL OPERATOR(AND,OR,NOT)
C.      RELATIONAL  OPERATOR (<,>,<=,>=)
D.      SPECIAL OPERATOR (LIKE,IN,BETWEEN)


LIKE
THIS OPERATOR SEARCHES ON THE BASIS OF WILD CARD CHARS I.E
UNDERSCORE(_) :- CAN REPLACE ONLY ONE CHARATER.
PERCENTAGE(%) :- CAN REPLACE MORE THAN ONE CHARATER.

..TO BE CONTINUED...

Thursday, December 2, 2010

Triggle in Oracle 10g

Trigger in Pl-sql/oracle/Oracle 10g forms and reports

1.    it is a db object which is a collection of pl/sql codes and it automatically get executed whenever any dml event happens provided trigger has been written for that DML event.
2.    Trigger has three section i.e. events, restrictions and when condition (optional.
3.    Pl sql trigger is divided into two parts. 1. Row level 2. Statement level.


Row Level Statement Trigger.
1.    Row level trigger is executed for each and every row affected by DML stmt.
2.    we need to use for each row for row level trigger.
3.    used in those cases where we need to depend on the values of every record of any column of any table.
4.    eg. Any name begin inserted must be in letter capital.

Statement Level Trigger.

1.    Statement level trigger is executed only once irrespective of No. of records affected by the dml statement.
2.    Every trigger is by default STMT level trigger.
3.    Used for restrictions like No Deletion allowed on Sunday on emp table.

Syntax.

CREATE [ OR REPLACE]
TRIGGER

BEFORE | AFTER 
INSERT  [ OR DELETE]
OF (OPTIONAL) 
ON FOR EACH ROW (OPTIONAL) REFRENCING NEW AS  OLD AS WHEN () (OPTIONAL) Note. 1.    to follow any value of any col. Of any record of any table within the execution section of a trigger always used :old.and :new.2.    Theses two can be followed only with in a row level trigger. :new. Refers to new values or that col for that row (Applicable for updated and insert) :old.Refers to old values for that col for that record (Applicable for both delete and update) Example:- Create or replace  Trigger tr_ex Before delete On  insert or update On emp For each row Declare  V_msg varchar2(200) Begin If inserting then  V_msg := ‘inserting….’ Elsif deleting then  V_msg := ‘deleting………….’; Elsif updating then V_msg := ‘deleting…’; End if; Dbms_output.put_line(V_msg); End; Q.    Create a trigger which will automatic make the first letter of  every name inserted | updated into capital letter irrespective of any case enter by user. Create or replace trigger Tr_name Before update or insert Of ename On emp For each row Begin Dbms_output.put_line(‘before change name = ‘ ||.new.ename); End; / Example of Statement level trigger. CREATE OR REPLACE TRIGGER TR_DELETE BEFORE DELTE ON EMP BEGIN IF TRIM(TO_CHAR(SYSDATE,’DAY’)) = ‘SUNDAY’ THEN RAISE _APPLICATION_ERROR  ( -20001,’NO DELTETION ALLOW ON SUNDAY); END IF; END; INSTEAD OF TRIGGER. This is used to perform DML operation on base table through join view. Create or replace trigger tr_instead  Instead of  Insert or update or delete On v_join Referencing new as N old as O For each row Declare V_count number; Begin  If inserting then Select count(*) into v_count from dept Where deptno = :n.deptno; If v_count = 0 then  Insert into dept values(:n.deptno,:n.dname,:n.loc); End if; Insert into emp (empno,ename,sal) values (:n.empno,:n.ename,:n.sal); Elsif updating then Update emp Set sal = :n.sal where empno = :o.empno; Update dept Set dname = :n.dname where deptno = :o.deptno; Elsif deleting then  Delete from emp where empno = :o.empno; Delete from dept where deptno = :o.deptno; End if; End; / 

Friday, October 22, 2010

COde for Report calling from Oracle d2k

declare
p paramlist;
appid pls_integer;
curtimer timer;
begin
p := create_parameter_list('abc');
add_parameter(p,'dno',text_parameter,:block2.deptno);
add_parameter(p,'DESTYPE',TEXT_PARAMETER,'file');
ADD_PARAMETER(P,'DESNAME',TEXT_PARAMETER,'c:\'||:block2.deptno||'.PDF');
ADD_PARAMETER(P,'DESFORMAT',TEXT_PARAMETER,'pdf');
ADD_PARAMETER(P,'PARAMFORM',TEXT_PARAMETER,'NO');

run_product(REPORTS,'c:\6i\emp.rdf',asynchronous,runtime,filesystem,p);
-- host('cmd /C START C:\'||:block2.deptno||'.pdf',NO_SCREEN );
host('cmd /C START iexplore C:\'||:block2.deptno||'.pdf',NO_SCREEN);


/*host('C:\Program Files\Internet Explorer\iexplore.exe');
appid := dde.app_begin(' C:\ankur2.pdf',DDE.APP_MODE_MINIMIZED); */


destroy_parameter_list(p);


end;

Thursday, October 21, 2010

Diffrence between two date, Pl-sql program result in Years - Month-format

Helo frnds

I am uploading this code.
work in pl-sql
DECLARE
DATE1 DATE;
DATE2 DATE;
V_NO NUMBER;
V_YEAR NUMBER;
V_MONTH NUMBER;
BEGIN
DATE1 := TO_DATE('&DATE1');
DATE2 := TO_DATE('&DATE2');
V_NO := DATE1 - DATE2;
IF (v_NO<0) THEN v_NO := V_NO * (-1);
END IF;
V_YEAR := TRUNC(V_NO/365);
V_NO := MOD(V_NO , 365);
V_MONTH := TRUNC(v_NO/30);
V_NO := MOD(V_NO,30);
DBMS_OUTPUT.PUT_LINE(V_YEAR ||' YEARS ' || V_MONTH ||' MONTH ' || V_NO || ' DAYS');
END;
/

Wednesday, October 20, 2010

PL-SQL program for calculating wheather a number is amstron or not

DECLARE
A NUMBER := &ENTER_THE_NUMBER;
B NUMBER := 0;
C NUMBER;
D NUMBER;
BEGIN
c := A;
WHILE(a!=0)
LOOP
D := MOD(A,10);
DBMS_OUTPUT.PUT_LINE(D);
B := B + (D*D*D);
DBMS_OUTPUT.PUT_LINE(B);
A := FLOOR(A/10);
DBMS_OUTPUT.PUT_LINE(A);
END LOOP;
IF (B = C) THEN DBMS_OUTPUT.PUT_LINE(' THIS IS A AMSTRON NUMBER');
ELSE
DBMS_OUTPUT.PUT_LINE('THIS IS NOT A AMSTRONG NUMBER' || B);
END IF;
END;
/
Please Comment on this

Monday, October 18, 2010

Oracle Develper 2000/D2k/10g Basics tutorial



Form Builder

1. Minimum component required to develop a module is
• Window
• Canvas
• Block
• Item
Window:- this forms object is used to provide physical support to canvas.
Canvas :- this is used to provide physical support to item.
Item:- this is used to accept value from user at run time.
Some of the GUI item are Text Box, Button, Radio Button, Check Box

Block:-
• This is a collection of item and it does not any physical significance. Block always have logically significance.
• There are two type of block DB block and control block

Imp Point.
1 to follow the value of any item of any block use
:.
2. to refer to any item of block , user block name.itemname/
3. to take cursor to any item at run time user go_item(‘blockname.item.name’);
4. to clear block user clear_block;


some of the system defined built ins are.
1. go_item(‘item name’);
2. go_block(‘block name’);
3. go_record(‘sr.no.of.record’);
4. next_item
5. next_block
6. next_record;
7. previous_item
8. previous_block
9. previous_record
10. clear_block
11. clear_item
12. clear_record
13. clear_form
14. execute_query
15. last_record

Object Navigator has two view i.e

1. Ownership view :-
It show the relationship between block and item.
2. physical view :-
it shows the relation between window, canvass and item.
Items are linked to a canvas through its properties.
Canvas is linked to window through properties.

Base table Block

1. This block is associated with a DB object like table,view,procedure.
2. based table block can be created in two ways i.e through wizard, and through manually

Through the wizard.
1. Create a block through object navigator.
2. Select wizard from dialog box.
3. Keep on clicking on next button till the time you get finish button.
4. Save, compile and run the report.

Note
1. use the runtime menu option and toolbar option to do DML operation on a base table block.
2. Some of imp. Menu option are query menu, record menu, block menu.


Cd
code for + button when-button-pressed
:ankur.result := :ankur.result_no1 + :ankur:result_no_2;

Code for – button when button pressed

:ankur.result := :ankur.result_no1 - :ankur:result_no_2;

Code for * button when button pressed

:ankur.result := :ankur.result_no1 * :ankur:result_no_2;

Code for / button when button pressed

:ankur.result := :ankur.result_no1 / :ankur:result_no_2;

How to create a base table block manually

1. crate a block
2. select the option manual from the new block dialog box and say ok
3. in the layout editor, place the items in the block by selecting the block name from list box for block on top right of canvas.
4. in the property of block mention , Name, Datasource type(table), insert/update/delete/query/allowing (yes/no),
5. Now in the property of items mention Name,Data type, Size Colum name,

Control block

1. this is not associated with any DB object
It is used for following purposes (Calculator, Button to do some action.)

Crate a Control block.
1. create a block.
2. in the prop of block (named blocks (no))
3. place items in the block and make required changed in the property of items
Some of the builtin are

Enter_query;
Execute_query;
Create_Record;
Delete_record;
Commit;
Exit_form
First/last/next/pervious-record;


Wednesday, October 13, 2010

Editor in Oracle Developer 2000/d2k/forms



Oracle forms/Oracle Reports/Oracle /Oracle D2k/Oracle 2000 /Oracle 10G
Editor :- (Cnt+e)

1. this is used to show an editor user to enter information in a more comfortable way, used for fields like, address, comments, name etc
2. there are 3 type of editor
• default editor
• system defined editor
• user defined editor


DEFAULT EDITOR :- every text box is by default associated with a default editor

SYSTEM EDITOR :- in the property of text item we can use ‘system editor’ to show system editor at run time.
( who notepad/textpat/wordpad depending on what is editor that is associated with oracle in the file init.ora)

User defined editor :-

1. we can create our own editor and show it to user as per our requirement using a built in procedure i.e show_editor

Syntax

Show editor (‘name of editor’,message_in,x_pos,y-pos,message_out,Boolean_val,out parameter);

Out parameter will return true if user clicked ok on editor and false if user cancelled the
Editor.

Various ways to used editor at run time.

1. on the text itme.
2. edit menu :- edit on the text item.
3. Built in procedure:- ‘edit –texttem’ in the triggers
4. show_editor

Steps for create an editor.
1. create an editor
2. Make changes in the property of editor as per requirement.
3. Show editor using show editor/others ways at run time.





Code for editor button (when-button-pressed) of job field of emp block :-

Declare
B Boolean;
V_job varchar2(4000);
Begin
Show_editor
(‘ed_job’,:emp.job,100,100,v_job,b);
If b then
If length(v_job)>9 then
Message(‘you can enter 9 letter only’);
Message(‘’);
Raise form_trigger_failure;
Else
:emp.job := v_job;
End if;
Else
Message(‘cancelled’);
Message(‘’);
End if ;
End;

Alert in Oracle D2k




Alert :-

1. This is used to display message to the user to confirm any action.
2. use show_alert to show the alert at run time.
3. the above function returns the following values (number()
88 alert_button1
89 alert_button2
90 alert_button3
4. u can change the following attribute of an alert at run time
(title,message,label of button)

Steps for creating a alert.
1. create an alert in object navigator through + command
2. make changed in the property of alert as per requirement.
3. now show the alert at run time using show_alert.


Code for ‘Key-delrec’ trigger at form level ( name of alert is alert_confirm)

Declare
Alt_ret_val numbers;
Begin
Set_alert_property ( ‘alert_confirm’, TITLE,’Confirming Delete Action’);
Set_alert_property ( ‘alert_confirm’,Alert_message_text,’Sure to delete this record ?? ‘);
Set_alert_button_property(‘alert_confirm’,alert_button,label,’plz delete’);
Alert_ret_val := show_alert(‘alert_confirm’);
If alert_ret_val := alert_button1 then delete_record;
Else
Message(‘you cance the operation’);
Message(‘’);
End if;
End;

Note :-
Max you can have 3 button and min you can have 1 button in an alert.
You can not change no of button at run time.

Code for delte record button is

Do_key(‘delete_record’);

It will make a call to key dec-rec

EMP BLOCK image



Monday, October 11, 2010

Trigger in D2kTrigger in D2kTrigger in D2k
















Trigger in D2k

1. Trigger in form builder are available at three level ie item level, Block level and form level.
2. The area of application of trigger is dependent on the level where it has been defined.
3. If the same trigger has been defined at more than one level than the execution of trigger depends on the value of the property of trigger i.e. ‘ execution hierarchy’.
Override
1. It will override the entire higher level trigger having same name.
before
1. Lower level will be executed before its immediate parent level
After
1. lower level trigger will be executed after its immediate parent.

The lower level trigger will be always available but reverse is not true.



you can help for more these two pic following link








Trigger in form builder is divided into five parts.

1. Pre
2. post
3. when
4. on
5. key

Pre – Trigger. This trigger is executed before the current event.
Some of the pre trigger event are
1. pre-commit
2. pre-form
3. pre-logon
4. pre-text-item
5. pre-block

Pre-Query:-
1. This trigger is executed before any query is send to the database for execution.
2. it is used to validate the user input before sending the user-input to db to remove unnecessary presence on DB.

Code for Pre Query.


If :emp.deptno not in (10,20,30) then message (:emp.deptno ’ does not exict’);
Message(‘’);
Raise form_trigger_failure;
Length(:emp.empno) <4>







Post – trigger :->
1. These trigger are executed after the corresponding event.
2. some of the post trigger
• post-logon
• post-block
• post-query
• post-insert/update/delete
• post-text-item

Post-query:- this trigger is executed after the execution of query in the block
3. pre-query is executed only once and post-query is executed that many no. of times records returned by the query submitted to DB.


Code for Post –Query Emp block

Declare
V_groeg_sal number;
V_grade char(1);
Begin
V_groeg_sal := :emp.T_gross_sal;
If v_gross_sal >= 50000 and v_gross_sal <= 7000 then v_grade := ‘a’; Else v_gross_sal >= 3000 and v_gross_sal <>
1. this is executed one the cursor/control goes from the item.
2. use this trigger to populate any value like grade on the basis of gross sal(sal + comm.)


When trigger ->

1. These trigger get executed when the corresponding event happens.
2. some of the when –trigger
when –button-pressed
when-validate-item
when-validate-record
when-new-item-instance
when-new-record-instance
when-new-block-instance
when-create-record


when-validate-item :-

it is executed when the control comes out of any item after making changes in th e value that item.


When-validate-record :- executed when the control goes out of the current record after making changes in the record.

When –create-record

This trigger is executed when a new record is created in the block.
This is the only trigger in form builder when the forms does not ask you to save changes if we have allocated some value to my field of the block.

Code for when –create-record at emp block

:emp.sal := 200;
:emp.comm := 100;

Code for when-validate-item of Sal field
If :emp.sal<2000> 2000’);
Raise form_trigger_failure;
End if;

Code at blk level
When-validate-record of emp block

If :emp.sal<:emp.comm Then Message(‘plz enter sal>comm’);
Message(‘’);
Raise form_trigger_failure;
Else if :emp.name is null or length(:emp.ename)<4> these trigger executed during corresponding event.

Some of the trigger are.

On-error
On-message
On-logon
On-insertupdatedelete

On-error:-> in this trigger is executed when any errors happens at run time which is a system defined error.
Some of the keyword are

Error-code
Error-type
Error-text

On-message

This is executed when any message comes at run time from form builder.

Keywords

Message-code
Message-type
Message-text
Code for on-error at form level

If error_code = 50016
Then message(‘plz enter only number’);
Message(‘’);
Else
Message(Error_code - ‘ error_type ’ ‘ error_text);
Message(‘’)


Key trigger :-> these trigger are executed whenever a corr. Runtime key is used

Key Trigger Bultin
F7 Key-enter Enter_query
F8 Key-executed Execute_query
F9 Key-listval List-values
F10 Key-commit Commit
F6 Key-crerec Create_record
Shift+f6 Key-delrec Delete_record

1. we can use key trigger to override the default functionality of run time keys.
2. we can use do_key (‘buil-in’) to call the corr/key trigger.
3. for example do_key(‘commit’) will made a call to key-commit trigger.
4. we can also use execute-trigger (‘any trigger name’) to execute the code of any trigger

execute_trigger(‘key-nxtrec’);

Code :-> for key-nexrec

If :system.last_record = ‘true’ then
Message (‘ you are already at last record’);
Message(‘’);
Raise form_trigger_failure;
Else
Next_record;
End if;

Code for next_record button

Button
D0-key(‘next_record’);
Execute_trigger(‘key-nxtrec’);



Code for key-up

If :system.cursor_record = ‘1’
Then message(‘ you are already at first record’);
Message(‘’);
Raise form_trigger_failure;
Else
Previous_record;
End if;

Tuesday, August 17, 2010

100 Rupee New Coin

Hello Friends
this is the new hundered ruppe Coin which will used soon in our life so see this
and enter commetn how it is
I have this coin .
Thanks
Ankur Garg

Wednesday, July 28, 2010

HTML5 :-

Opera, Firefox, and IE 9 (preview only) already support it, and lots of websites are already using it. So what are you waiting for? We delve into its features and capabilities to get you started.

The buzz around HTML 5 is getting louder by the day. Most major browsers have already started supporting it, and many companies have already embedded it in their websites. It's time you also started exploring its capabilities before everyone gets on the bandwagon and leaves you behind. Here, we discuss everything about its features and capabilities.

Who is behind HTML5?
HTML5 is a decentralized concept and is promoted by WHATWG (Web hypertext Application technology working group). This group was formed in June 2004 after a disagreement within the W3C group due to the deviation in ideas of some members from HTML to XHTML. And many top people from Mozilla, Google and Apple did not want to leave HTML as a standard and hence they formed WHATWG.

Direct Hit!

Applies To: Web Developers, technology evangelists
USP: Add more power to your websites with HTML5
Primary Link: www.w3.org/TR/html5/
Search Engine Keywords: HTML 5

HTML5's development started in 2004 and is not released yet. But few browsers have already started supporting it so you can play around with its new features. HTML5 is no doubt one of the most talked about buzz word on Internet today and it claims to change the way web applications are developed by making them stronger.

Features at a glance
Doctype: HTML5 suggested the removal of various doctypes and recommends sticking to the following.

Generic structure of a webpage: Almost every website has very similar page structure viz header, navigation (also called menu), content section and the footer. HTML5 has them defined as generic tags, so that every time a new webpage is created, you do not have to define the div, span, id, class etc for these portions of the webpage.

New Controls: With the advent of HTML5 some new controls are introduced. These are the controls which are commonly used on a webpage, but at present a developer has to write code for them on each & every webpage he develops.

Less error prone code: As mentioned above, there are a few new controls which are there by default in HTML5, such that a developer does not have to write a code for it. This results in making a web application more robust as a developer has to write less number of lines of code compared to what he used to write before HTML5. We will illustrate this later through examples.

Productivity: Most of the time a web developer struggles to achieve cross browser compliance for his web application. This results in wasting a lot of productive time, because he has to tweak his code over and again so that it behaves the same way across different browsers. We will see how HTML5 is going to help in making application cross browser compatible. At present, we define the structure of a page using div, span. Then we style the page using cascade style sheet (CSS) using the Id, class which are defined in the HTML. But let me show you how you can define the HTML & CSS for the image page layout in HTML5.

HTML (say index.html)

header Tag




section tag


article tag



footer tag

The above is a sample HTML code showing the new tags, header, nav, section, article, and footer.

You might have already noticed that the above code does not contain any div or span tags. But still it gives you the same effect as a conventional div like page structure would have given. The CSS properties can be defined with the names of the tags. Now let's see the CSS code which styles a webpage.

body {background-color:white; color: black; text-align:center;}
header, footer, nav, section, article {display:block;border: 1px solid black;}
header {width:100%; background-color:blue;}
header h1{margin: 0px;padding: 0px;color: #fff;}
nav {width:30%; background-color:#8182CF;float:left;}
section {width:69%; background-color:SpringGreen ; float:right;height: 232px;}
article {width:70%; margin:2em 10%; background-color:turquoise;}
p{font-size: 22px;}
footer {width:100%; background-color:pink; clear:both;}

Now create a blank HTML file and type the new HTML tags as written above along with this CSS code. You will be able to see the webpage similar to what is shown in the image.

Note: Open your HTML file in Firefox, Opera, Chrome or even in Safari browser. If you try to open this HTML file in IE, you will not get the expected result, because these tags are not yet supported in IE. However, there is a workaround in JavaScript to make these tags work even in IE. Let's see how we can achieve this.

New Controls
HTML5 has introduced many new controls which makes the life of a web developer easier. Out of the many new controls introduced, I am going to show the ones I like the most.

DatePicker: If you are a developer, then you might have a pet JavaScript which renders a nice datepicker on the webpages you create. The script which you include, no doubt sends a HTTP request, downloads the resources and then renders. That adds into page load time and results in slower rendering of the webpage. But in HTML5, you can include this fancy datepicker by simply adding the type=�date� in the input tag.

Slider Control: HTML5 also has the control to insert the slider, if needed. Those who use sliders are using readymade JQuery plugins or either building their sliders from scratch. So that again is expensive in terms of productivity. But the HTML5 allows you to embed a slider with minimum and maximum values defined. One such example is shown below.


Audio & Video: It is hard to embed Audio or Video on to your web page. First of all you require a script which allows you to stream the media files on your webpage. And on the other hand, the visitors need to install the plugins into their browsers to successfully view/listen the media you embedded. Overall it's a pain for both the developer and the user. HTML5 has the solution by allowing developers to embed Audio & Video files directly into a webpage with simple tags.

The above code embeds an audio player which plays the sample.ogg audio sample after clicking the play button. And the same is true for the following video tag.

Less code and productivity:There is major improvement in the way we define HTML forms. Almost every form created on a webpage to take input from the user requires validation. For the client side validation the developers have to write JavaScript code and this code is repeated in almost every website, one way or the other. But with the introduction of �required� attribute, one can rely on the browser to handle such validations. The following code is an example of validation :







So the above lines of code are enough for validating the empty field, valid email address and a valid URL. You do not have to write JavaScript code, which not only makes your HTML page lighter but also the built-in validation of the browser ensures lesser bugs in the final code. Productivity is increased since the developer does not have to repeat the same code for each and every form and then calling events and functions etc.

Note: For all the demos shown in this article, we are using Opera v10.5. You will be able to see some of the HTML5 tags working in Firefox as well, but for now Opera supports all of them. Unfortunately IE does not support any of the tags as of now.

Sachin Khosla, Founder, Digimantra.com

Thursday, June 24, 2010

RecruitMent of a Girl Friend

Dear Friends,



Due to recession, I left my Girlfriend (as part of my cost cutting
efforts). I need new one now, so pass on this information to your
female friends...



Applications are invited for the following post. The package and
incentives are mentioned below:



Designation: Junior girl friend (trainee)



Experience: Must have ditched at least 2 guys (Fresher with excellent
credentials will be considered)



Other requirement: Should have the Potential to do street bargaining
and fight if required.





Age: 18-23 (if the individual is too good looking but not in the age
group can also apply, special consideration will be undertaken for
them)

Height, weight, complexions no bar, but is subjective.



Perks and incentives:



Total gross (Monthly) :

• 2 gifts worth not exceeding Rs. 1000 /-(any precious metals, stones)

• Bike rides each duration 1 hour

• Trips to National Highways

• 5 Trips to Hanuman Mandir / Siddhi vinayak Temple

• Kulfis / Chocó bars at a regular gap of 3 days

• Daily Provision of Samosa/Bread Pakoda/Bhel worth Rs. 10 /-

• 2 movies per month (Except on weekends)

• Visits to Shopping Malls and BARISTA every weekend (At your own expense)



A Pair of Jeans or T-shirts according to demand will be gifted,
subject to finance availability and to the size available with the
shopkeeper.



Net Deductions (Monthly): Affair Fund and Un-professional taxes will
be informed on joining.

The probation period is 6 months, after which confirmation (with
Promotion to fulltime Girlfriend)



Please NOTE:

1. Girls who left in the last 2 months need not apply.

2. Ex-girlfriends will be eligible only if they agree to the above
mentioned conditions.



There is more:

For girls who are not eligible, can take advantage of the referral
program by referring their friends, colleagues etc.

Candle light/Tube light dinner will be given on every referral, even
if candidate is not selected.

Search never ends!!



Interested candidates can send their resume with



Subject: Name/fresher-exp/age..

Photo must be attached in the email



Note: Applications without photo will be rejected.

-
Thanks & Regards-

Ankur Garg
9013254429

Monday, June 14, 2010

Famous Controversies in World Cup history

The World Cup has given football fans many a moment to cherish but disgrace and controversies have also been a part of it. From Maradona's infamous 'Hand of God' to Zidane's Headbutt, take a look at the major controversies that left fans angry and exasperated.

1) It is rather strange that the most controversial goal of football history bears the name of God! 'The hand of God'- as Diego Maradona himself had described it, had occurred during the quarterfinal encounter between England and Argentina at the 1986 Football World Cup. Maradona leapt into the air to net the ball passed by Steve Hodge past England's goalie Peter Shilton. Later, the replays clearly showed that Maradona had indeed manipulated the goal used his palm. Minutes later, Maradona scored a second goal which is regarded as the best goal in the World Cup history. In fact the best and worst goals of football history happened during the same match, the very match that gave birth to the hostile soccer war between England and Argentina.

2) France's pride Zinadene Zidane was sent off in extra-time during their final match against Italy in 2006. Zidane had earlier netted a penalty kick, giving France an early lead. But Italy's Marco Materrazi scored an equalizer with a header soon. During extra time, Materazzi and Zidane got engaged in a wordy duel after Materazzi pulled Zidane's jersey. An angry Zidane, headbutted Marco thereby earning a red card. Later Zidane justified his action saying that he was prompted to do so because of the Italian's verbal insults and that he would rather die than apologising to Marco. However Zidane did apologise for setting a wrong example for the kids. Italy eventually won the match in a penalty shootout 5-3. Despite the incident, Zidane was allowed to keep the Golden Ball award.

3) The whole nation crucified Beckham for England's early exit in the 1998 World Cup. Beckham was fouled by Argentine Simione, and instead of waiting for the referee to take action, Beckham retaliated by kicking Simione back. Referee Kim Milton Nielsen issued a red card, and Beckham was sent off. The 10 men English squad eventually lost to arch-rivals Argentina. Simione later admitted to simulating the injury in order to get Beckham expelled. However Beckham paid his sweet revenge by netting a free kick against Argentina in the 2002 WC.

4) The price Columbian Andre Escobar had to pay for his self goal was his own life. During the 1994 US WC, Columbia was playing against the home team while Escobar's ill-fated attempt to stop John Harkes shot resulted in a self goal. The US won the match, paving way to Columbia's early exit. Latin American football is associated with betting issues of drug lords and Columbia's early exit is alleged to have caused gambling losses to some. Escobar was murdered in revenge for his own goal. He was shot outside a bar and the killer fired 12 bullets on him shouting 'Goal'. Ironically, Escobar who always wore the number 2 jersey was nicknamed 'The immortal number 2'.

5) In the 1982 World Cup, France was at its attacking best and virtually unstoppable. In their match against Kuwait they had scored three goals and when Alain Giresse netted the fourth he was astounded as there was a pitch invasion by the president of the Kuwaiti Football Association, Sheikh Fahid Al-Ahmad Al-Sabah who insisted that the goal was scored only after his players had heard a whistle blown from the stands and stopped playing.

6) Ahn Jung-Hwan was the executioner of Italian squad at the 2002 South Korea World Cup. It was Ahn's golden goal that resulted in the early expulsion of Azurris. Ahn was then playing for Italian club Perugia. After he scored the goal against Italy, the club owner Luciano Gaucci cancelled his contract saying that he has no intention of paying someone who destroyed Italian football. Ahn became a national hero for SKorea, but was ostracised by his club.

7) When it comes to controversies, the Argentinians can't be left behind. During the 1978 World Cup, Argentina was involved in a notorious controversy when they beat a paralyzed Peruvian side 6-0 to qualify for the finals. Rumours had it that Peru players were paid handsomely to fix the score.

8) The 2002 World Cup was a hot bed of controversies as hosts South Korea made it to the semi-finals with Italy, Spain and Portugal crying foul. Most of South Korea's oppositions claimed that they had been on the rough side of refereeing decisions as five gaols scored against the Koreans were disallowed and three opposition players were sent off. But the Italians were hit the hardest as the Koreans were awarded a dodgy penalty against them to knock them out in the second round.

9) In previous World Cup, during the England vs Portugal knock-out tie, we witnessed an unusual incident of club teammates take on each other on the field. The teammates in question are Portugal's Christiano Ronaldo and England's Wayne Rooney. Ronaldo's gesture to the referee, after Rooney stepped on Portuguese defender Richardo Carvalho's groin, saw an agitated Rooney shove Ronaldo, with Rooney being red-carded after the incident. England went on to lose this game and were knocked-out of World Cup 2006.

10)During the 1982 World Cup, West Germany were on the brink of being knocked out afetr a shock 2-1 defeat of West Germany by Algeria. With Algeria completing their group matches with a 3-2 win over Chile the previous day, West Germany and Austria faced each other both knowing that a win for Germany by one or two goals would see both teams progress on goal difference at the expense of the Africans. Once Germany scored, the game descended into a non-competitive farce. So much so that the Spanish crowd called for both teams to be ejected from the competition while a disgruntled Algerian FA lodged an official complaint with FIFA about the contrived result. FIFA ruled that the result should stand, but as a direct result all final matches in the group stages would be played simultaneously.

Stay tuned to soccerphase for more updates. Follow us on facebook @ http://bit.ly/aHf7SN

Shreyas Pujari

Team Soccerphase

For Full Detail You Can Go

SOCCER MAGAZINE IN INDIA/ LIVE ONLINE COMMENTRY/WORLD CUP NEWS