
November 25th, 2008

admin
The StringTokenizer class allows an application to break a string into tokens. The tokenization method is much simpler than the one used by the StreamTokenizer class. The StringTokenizer do not distinguish among identifiers, numbers, and quoted strings, nor do they recognize and skip comments.
The set of delimiters (the characters that separate tokens) may be specified either at creation time or on a per-token basis.
An instance of StringTokenizer behaves in one of two ways, depending on whether it was created with the returnDelims having the value True or False :
- If the flag is Flase
, delimiter characters serve to separate tokens. A token is a maximal sequence of consecutive characters that are not delimiters.
- If the flag is True
, delimiter characters are themselves considered to be tokens. A token is thus either one delimiter character, or a maximal sequence of consecutive characters that are not delimiters.
A StringTokenizer object internally maintains a current position within the string to be tokenized. Some operations advance this current position past the characters processed.
A token is returned by taking a substring of the string that was used to create the StringTokenizer object.
Example without Delimiter:-
StringTokenizer st = new StringTokenizer(“Example Of String Tokenizer”);
while (st.hasMoreTokens()) {
System.out.println(st.nextToken());
}
Output
=====
Example
of
String
Tokenizer
Example with Delimiter:-
StringTokenizer st = new StringTokenizer(“1$2$3$4″,”$”);
while (st.hasMoreTokens()) {
System.out.println(st.nextToken());
}
Output
=====
1
2
3
4
Popularity: 2% [?]

November 25th, 2008

admin
The iBATIS Data Mapper makes it easier to use a database with Java and .NET applications. iBATIS couples objects with stored procedures or SQL statements using a XML descriptor. Simplicity is the biggest advantage of the iBATIS Data Mapper over object relational mapping tools.
The iBatis framework is a lightweight data mapping framework and persistence API that can be used to quickly leverage a legacy database schema to generate a database persistence layer for your Java application. A set of XML encoded SQL Map files–one for each database table–holds SQL templates that are executed as prepared statements and map the expected results to Java domain classes. From application code, a layer of iBatis Data Access Objects (DAO) acts as the API that executes the SQL Map templates and assigns the results to the corresponding Java domain classes.
To enable communication among DAO layers and Sql Map layers, an XML configuration file describes each DAO interface and implementation class, as well as the location of a second XML configuration file that in turn points to each SQL Map file and contains the database connection information.
Popularity: 1% [?]

November 25th, 2008

admin
Database Creation :
CREATE DATABASE EMPLOYEE
Table Creation :
CREATE TABLE EMPINFO
(
ROWID INT IDENTITY(1,1) NOT NULL,
EMPID INT NOT NULL,
EMPNAME VARCHAR(50) NOT NULL,
EMPDEPT VARCHAR(3) NOT NULL,
EMPSAL INT NOT NULL,
EMPADDRESS VARCHAR(100) NOT NULL,
ACTIVE CHAR(1) NOT NULL DEFAULT ‘T’
)
Procedure Creation :
CREATE PROC EMPINFO_ADD_EDIT
(
@iEMPID INT,
@vEMPNAME VARCHAR(50),
@vEMPDEPT VARCHAR(3),
@iEMPSAL INT ,
@vEMPADDRESS VARCHAR(100),
@cACTIVE CHAR(1)
)
AS
DECLARE @CNT INT;
BEGIN
SET @CNT = 0;
SELECT @CNT = COUNT(*) FROM EMPINFO WHERE EMPID = @iEMPID;
IF(@CNT = 0)
BEGIN
INSERT INTO EMPINFO(EMPID,EMPNAME,EMPDEPT,EMPSAL,EMPADDRESS,ACTIVE)VALUES @iEMPID,@vEMPNAME,@vEMPDEPT,@iEMPSAL,@vEMPADDRESS,@cACTIVE)
END
ELSE
BEGIN
UPDATE EMPINFO SET EMPNAME = @vEMPNAME,EMPDEPT = @vEMPDEPT,EMPSAL = @iEMPSAL, EMPADDRESS = @vEMPADDRESS,ACTIVE = @cACTIVE WHERE EMPID = @iEMPID
END
END
Popularity: 2% [?]

November 23rd, 2008

admin
Linked list is one of the fundamental concepts in the data structure. It consists of a set of nodes, each containing a ‘data’ field and one or two references (pointing to adjacent nodes). It is a self referential datatype since it contains reference(s) of the adjacent (next or previous) datum of the same type.
Advantage :
Advantage of linked list compared to conventional array are
- Insertions and deletions of nodes can be done at anywhere in the list.
- List size can be increased and decreased in runtime.
- Order of the linked items can be different from how it is stored in memory or disk, thus allowing the list of items to be traversed in different order.
Types of linked lists exist are Singly linked list, Doubly linked list and Circular linked list.
Popularity: 1% [?]

November 23rd, 2008

admin
Palindrome Checking Using C:
#include <stdio.h>
#include <conio.h>
#include <string.h>
#define size 26
void main()
{
char strsrc[size];
char strtmp[size];
printf("\n Enter String:= ");
gets(strsrc);
strcpy(strtmp,strsrc);
strrev(strtmp);
if(strcmp(strsrc,strtmp)==0)
printf("\n Entered string \"%s\" ispalindrome",strsrc);
else
printf("\n Entered string \"%s\" is not palindrome",strsrc);
getch();
}
Popularity: 1% [?]

November 21st, 2008

admin
The md5 method is used to convert the string value into md5 value.
The syntax is,
string md5 ( string $str [, bool $raw_output ] )
Parameters
str : The string.
raw_output : If the optional raw_output is set to TRUE, then the md5 digest is instead returned in raw binary format with a length of 16. Defaults to FALSE.
For Example,
echo “The MD5 value of ‘ForDevelopers’ is ” . md5(“ForDevelopers”);
Popularity: 1% [?]

November 21st, 2008

admin
If the collation property of a data base is
1.Latin1_General_BIN its case-sensitive
2.SQL_Latin1_General_CP1_CI_AS or Latin1_General_CI_AI its case-insensitive
There are two ways to find out the SQL Server Database Collation
1. Using DATABASEPROPERTYEX
DATABASEPROPERTYEX gets the current setting of the specified database option or property for the specified database.
Syntax :-
DATABASEPROPERTYEX ( database , property )
SELECT DATABASEPROPERTYEX(‘testdb’, ‘Collation’)
This returns the testdb Database Collation property value say if this testdb is a case-sensitive database then it returns
Latin1_General_BIN

2.Using Sql Server Management Studio
Step 1 : Open Sql Server Management Studio.
Step 2 : Right Click on database and click its properties

After clicking the properties you get a database properties modal box such as
The red box shows the collation property value of that database.
Popularity: 3% [?]

November 21st, 2008

admin
Yahoo! Glue is a new beta search engine which was initially launched in india as Yahoo Glue India and tested.Yahoo! Glue gets the best content around the web by a single search term in one page that is it displays web pages,news headlines,images,youtube videos,yahoo answer,blog search,flicker photos,wikipedia ect.. cool is’nt it.
Here i have made a search about barack obama which displays information about obama from various corners of the web.Yahoo! Glue home page diaplays top 10 pages from there system.The search keyword ‘barack obama’ is one of the top 10 pages in glue.
Glue does not give the web search result normally instead it provides the specialized information best on web. By this users will receive more relevant, visually appealing search results from across the Web in one page.
Yahoo! Glue now(Nov 19 2008) comes for US relevance and would be available world across soon.
Popularity: 1% [?]

November 20th, 2008

admin
For example we will have two textboxes such as ‘TextBox1′ and ‘TextBox2′.Now we will encrypt ‘TextBox1′ value using MD5 in Dot Net and display the encrypted value in ‘TextBox2′.
string pwd = “”;
pwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(TextBox1.Text, “MD5″);
TextBox2.Text = pwd;
Popularity: 1% [?]