ku 5th sem assignment

Upload: chitrangada-chakraborty

Post on 03-Apr-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Ku 5th Sem Assignment

    1/44

    KU 5TH SEM ASSIGNMENT - BSIT (TA) - 52 (WEB PROGRAMMING)Assignment: TA (Compulsory)

    1. What is the meaning of Web? Explain in detail the building elements of webWeb is a complex network of international , cross plateform, and cross cultural communicating devices, connected to eachother without any ordering or pattern.There are two most important building blocks of web:HTML and HTTP.

    HTML: - HTML stands for Hyper Text Markup Language. HTML is a very simple language usedto describe the logical structure of a document. Actually, HTML is often called programminglanguage it is really not. Programming languages are Turing-complete, or computable. Thatis, programming languages can be used to compute something such as the square root of pi orsome other such task. Typically programming languages use conditional branches and loopsand operate on data contained in abstract data structures. HTML is much easier than all of that.HTML is simply a markup language used to define a logical structure rather than computeanything.

    HTTP: - HTTP is a request-response type protocol. It is a language spoken between webbrowser (client software) and a web server (server software) so that can communicate with eachother and exchange files. Now let us understand how client/server system works using HTTP. Aclient/server system works something like this: A big piece of computer (called a server) sits insome office somewhere with a bunch of files that people might want access to. This computerruns a software package that listens all day long to requests over the wires.

    2. HTML is the Language of the Web Justify the statementHTML is often called a programming language it is really not. Programming languagesare Turing-complete, or computable. That is, programming languages can be used to compute somethingsuch as the square root of pi or some other such task. Typically programming languages use conditional

    branches and loops and operate on data contained in abstract data structures. HTML is much easier thanall of that. HTML is simply a markup language used to define a logical structure rather than computeanything.For example, it can describe which text the browser should emphasize, which text should be considered

    body text versus header text, and so forth.The beauty of HTML of course is that it is generic enough that it can be read and interpreted by a web

    browser running on any machine or operating system. This is because it only focuses on describing thelogical nature of the document, not on the specific style. The web browser is responsible for adding style.For instance emphasized text might be bolded in one browser and italicized in another. it is up to the

    browser to decide

    3. Give the different classification of HTML tags with examples for each categoryLIST OF HTML TAGS :-Tags for Document Structure HTML HEAD BODYHeading Tags TITLE BASE META STYLE LINKBlock-Level Text Elements ADDRESS BLOCKQUOTE DIV H1 through H6 P

  • 7/28/2019 Ku 5th Sem Assignment

    2/44

    PRE XMPLists DD DIR DL DT

    LI MENU OL ULText Characteristics B BASEFONT BIG BLINK CITE CODE EM FONT I

    KBD PLAINTEXT S SMALL

    4. Write CGI application which accepts 3 numbers from the user and displays biggest number using GET and

    POST methods#!/usr/bin/perl#print "Content-type:text/html\n\n";#$form = $ENV{'QUERY_STRING'};use CGI;$cgi = new CGI;

    print $cgi->header;print $cgi->start_html( "Question Ten" );

    my $one = $cgi->param( 'one' );my $two = $cgi->param( 'two' );my $three = $cgi->param( 'three' );if( $one && $two && $three ){$lcm = &findLCM( &findLCM( $one, $two ), $three );

    print "LCM is $lcm";}else{

    print '';

    print 'Enter First Number';

    print 'Enter Second Number';

    print 'Enter Third Number';

    print '';

    print "";}

    print $cgi->end_html;

  • 7/28/2019 Ku 5th Sem Assignment

    3/44

    sub findLCM(){my $x = shift;my $y = shift;my $temp, $ans;if ($x < $y) {$temp = $y;$y = $x;

    $x = $temp;}$ans = $y;$temp = 1;while ($ans % $x){$ans = $y * $temp;$temp++ ;}return $ans;}

    5. What is Javascript? Give its importance in web.JavaScript is an easy to learn way to Scriptyourweb pages that is have them to do actions that cannot be handled with

    HTML alone. With JavaScript, you can make text scroll across the screen like ticker tape; you can make pictures changewhen you move over them, or any other number of dynamic enhancement.JavaScript is generally only used inside of HTML document.

    i) JavaScript control document appearance and content.ii) JavaScript control the browser.iii) JavaScript interact with document content.iv) JavaScript interact with the user.v) JavaScript read and write client state with cookies.vi) JavaScript interact with applets.vii) JavaScript manipulate embedded images.

    6. Explain briefly Cascading Style SheetsCascading Style Sheet (CSS) is a part of DHTML that controls the look and placement of the element on the page. With

    CSS you can basically set any style sheet property of any element on a html page. One of the biggest advantages with theCSS instead of the regular way of changing the look of elements is that you split content from design. You can for instancelink a CSS file to all the pages in your site that sets the look of the pages, so if you want to change like the font size ofyour main text you just change it in the CSS file and all pages are updated.

    7. What is CGI? List the different CGI environment variablesCGI or Common Gateway Interface is a specification which allows web users to run program from their computer.CGIis a part of the web server that can communicate with other programs running on the server. With CGI, the web server cancall up a program, while passing user specific data to a program. The program then processes that data and the server

    passes the programs response back to the web browser.When a CGI program is called, the information that is made available to it can be roughly broken into three groups:-

    i). Information about client, server and user.ii). Form data that are user supplied.iii). Additional pathname information.

    Most Information about client, server and user is placed in CGI environmental variables. Form data that are user suppliedis incorporated in environment variables. Extra pathname information is placed in environment variables.i). GATEWAY_INTERFACET he revision of the common Gateway interface that the server uses.ii). SERVER_NAMEThe Servers hostname or IP address.iii). SERVER_PORTThe port number of the host on which the server is running.iv). REQUEST_METHODThe method with which the information request is issued.v). PATH_INFOExtra path information passed to the CGI program

    8. What is PERL? Explain PERl control structures with the help of an example

  • 7/28/2019 Ku 5th Sem Assignment

    4/44

    Perl control structures include conditional statement, such as if/elseif/else blocks as well as loop like for each, for andwhile.i). Conditional statements

    - If conditionThe structure is always started by the word if, followed by a condition to be evaluated, then a pair thebraces indicating the beginning and end of the code to be executed if the condition is true.

    If(condition){condition to be executed

    }- UnlessUnless is similar to if. You wanted to execute code only if a certain condition were false.

    If($ varname! = 23) {#code to execute if $ varname is not 23}

    - The same test can be done using unless:Unless ($ varname== 23) {#code to execute if $ varname is not 23}

    ii). LoopingLooping allow you to repeat code for as long as a condition is met. Perl has several loop control structures:foreach, for, while and until.- While LoopA while loop executes as long as a particular condition is true:

    While (condition) {#code to run as long as condition is true.

    }- Until LoopA until loops the reverse of while. It executes as long as a particular condition is not true:

    While (condition) {#code to run as long as condition is not true.}

    KU 5TH SEM ASSIGNMENT - BSIT (TB) - 51 (GRAPHICS & MULTIMEDIA)Assignment: TB (Compulsory)

    1. What is the need for computer graphics?Computers have become a powerful tool for the rapid and economicalproduction of pictures. Computer Graphics remains one of the most exciting and rapidly growing fields. Old Chinesesaying One picture is worth of thousand words can be modified in this computer era into One picture is worth of manykilobytes of data. It is natural to expect that graphical communication, which is an older and more popular method ofexchanging information than verbal communication, will often be more convenient when computers are utilized for this

    purpose. This is true because one must represent objects in two-dimensional and three-dimensional spaces. ComputerGraphics has revolutionized almost every computer-based application in science and technology.

    2. What is graphics processor? Why it is needed?To provide visual interface, additional processing capability is to beprovided to the existing CPU. The solution is to provide dedicated graphic processor. This helps in managing the screenfaster with an equivalent software algorithm executed on the CPU and certain amount of parallelism can be achieved forcompleting the graphic command. Several manufacturers of personal computers use a proprietary graphic processor. Forexample, Intel 82786 is essentially a line drawing processor; Texas Instruments 43010 is a high performance general-

    purpose processor.

    3. What is a pixel?Pixel (picture element): Pixel may be defined as the smallest size object or color spot that can be displayed and addressedon a monitor. Any image that is displayed on the monitor is made up of thousands of such small pixels. The closely spaced

    pixels divide the image area into a compact and uniform two-dimensional grid of pixel lines and columns.

    4. Why C language is popular for graphics programming?Turbo C++ is for C++ and C programmers. It is also compatible with ANSI C standard and fullysupports Kernighan and Ritchie definitions. It includes C++ class libraries, mouse support, multiple overlapping windows,Multi file editor, hypertext help, far objects and error analysis. Turbo C++ comes with a complete set of graphics functionsto facilitate preparation of charts and diagrams. It supports the same graphics adapters as turbo Pascal. The Graphicslibrary consists of over 70 graphics functions ranging from high level support like facil ity to set view port, draw 3-D barcharts, draw polygons to bitoriented functions like get image and put image. The graphics library supports numerousobjects, line styles and provides several text fonts to enable one to justify and orient text, horizontally and vertically. Itmay be noted that graphics functions use far pointers and it is not supported in the tiny memory model.

  • 7/28/2019 Ku 5th Sem Assignment

    5/44

    5. Define resolution.Resolution: Image resolution refers as the pixel spacing i.e. the distance from one pixel to the next pixel. A typical PCmonitor displays screen images with a resolution somewhere between 25 pixels per inch and 80 pixels per inch. Pixel isthe smallest element of a displayed image, and dots (red, green and blue) are the smallest elements of a display surface(monitor screen). The dot pitch is the measure of screen resolution. The smaller the dot pitch, the higher the resolution,sharpness and detail of the image displayed.

    6. Define aspect ratio.Aspect ratio: The aspect ratio of the image is the ratio of the number of X pixels to the number of Y pixels. The standardaspect ratio PCs is 4:3, and some use 5:4. Monitors are calibrated to this standard so that when you draw a circle it appearsto be a circle and not an ellipse.

    7. Why refreshing is required in CRT?When the electron beam strikes a dot of phosphor material, it glows for a fraction of a second and then fades. As

    brightness of the dots begins to reduce, the screen-image becomes unstable and gradually fades out. In order to maintain astable image, the electron beam must sweep the entire surface of the screen and then return to redraw it number of times

    per second. This process is called refreshing the screen. If the electron beam takes too long to return and redraw a pixel,the pixel begins to fade results in flicker in the image. In order to avoid flicker the screen image must be redrawnsufficiently quickly that the eye cannot tell that refresh is going on. The refresh rate is the number of times per second thatthe screen is refreshed. Some monitor uses a technique called interlacing for refreshing every line of the screen. In the first

    pass, odd-numbered lines are refreshed, and in the second pass, evennumbered lines are refreshed. This allows the

    refresh rate to be doubled because only half the screen is redrawn at a time.

    8. Name the different positioning devices.The devices discussed so far, the mouse, the tablet, the joystickare called positioning devices. They are able to

    position the curser at any point on the screen. (We can operate at that point or the chain of points) Often, one needsdevices that can point to a given position on the screen. This becomes essential when a diagram is already there on thescreen, but some changes are to be made. So, instead of trying to know its coordinates, it is advisable to simply point tothat portion of the picture and asks for changes. The simplest of such devices is the light pen. Its principle is extremelysimple.

    9. What are pointing devices?A pointing device is an input interface (specifically a human interface device) that allows a user to input spatial (i.e.,continuous and multi-dimensional) data to a computer. CAD systems and graphical user interfaces (GUI) allow the user tocontrol and provide data to the computer using physical gesturespoint, click, and dragfor example, by moving a

    hand-held mouse across the surface of the physical desktop and activating switches on the mouse. Movements of thepointing device are echoed on the screen by movements of the pointer (or cursor) and other visual changes.

    10. What is multimedia?The word Multimedia seems to be everywhere nowadays. The word multimedia is a compound of the Latin prefix multi meaning many, and the Latin-derived work media, which is the pluralofthe world medium. So multimedia simply means using more than one kind of medium.Multimedia is the mixture of two or more media effects-Hypertext, Still Images, sound, Animation and Video to beinteracted on a computer terminal.

    11. What are sound cards?Sound cards: The first sound blaster was an 8-bit card with 22 KHz sampling, besides being equipped with a number ofdrives and utilities. This became a king of model for the other sound cards. Next came the Sound Blaster Pro, again 8-bitsound but with a higher sampling rate of 44 KHz, which supports a wider frequency range. Then there was Yamaha OPL3

    chipset with more voices. Another development was built-in CD ROM interface through which huge files could be playeddirectly via the sound card.

    12. What is sampling?Sampling: Sampling is like breaking a sound into tiny piece and storing each piece as a small, digital sample of sound.The rate at which a sound is Sampled can affect its quality. The higher the sampling rate (the more pieces of sound tha tare stored) the better the quality of sound. Higher quality of sound will occupy a lot of space in hard disk because of moresamples.

    13. What is morphing?

  • 7/28/2019 Ku 5th Sem Assignment

    6/44

    Morphing: The best example would be the Kawasaki advertisement, where the motorbike changes into a cheetah, themuscle of MRF to a real muscle etc.. Morphing is making an image change into another by identifying key points so thatthe key points displacement, etc. are taken into consideration for the change.

    14. What is rendering?Rendering: The process of converting your designed objects with texturing and animation into an image or a series ofimages is called rendering. Here various parameters are available like resolution, colors type of render, etc.

    15. What is warping?Warping: Certain parts of the image could be marked for a change and made to change to different one. For examples, theeyes of the owl had to morph into the eyes of cat, the eyes can alone be marked and warped.

    16. Why we use scanner?Photographs, illustrations, and paintings continue to be made the old fashioned way, even by visual artists who areotherwise immersed in digital imaging technology. Traditional photographs, illustrations, and paintings are easilyimported into computers through the use of a device called a scanner.

    A Scanner scans over an image such as photo, drawing, logo, etc, converting it into an image and it can be seenon the screen. Using a good paint programme, Image Editor we can do adding, removing colors, filtering, Masking coloretc.

    17. What is ganut in Photoshop?

    Write yourself...

    18. What is a layer?

    The concept of layering is similar to that of compositing as we make the different layers by keying out the uniform colorand making it transparent so that layer beneath becomes visible. In case of future modifications we will be able to workwith individual layers and need not work with the image as a whole.

    19. What are editing tools? Why it is needed?You can use the editing tools to draw on a layer, and you can copy and paste selections to a layer.

    Many types of editing tools are:-

    i).Eraser tool: The eraser tool changes pixels in the image as you drag through them. You can choose to change the colorand transparency of the affected pixels, or to revert the affected area to its previously saved version.

    ii).Smudge tool: The smudge tool simulates the actions of dragging a finger through wet paint. The tool picks up colorfrom where the stroke begins and pushes it in the direction in which you drag.

    20. What is file format?

    File Format: When you create an image-either through scanning into your computer or drawing it from scratch on yourmonitor or captured through a camera, recorded voice or music from the two-in-one or recorded connecting a musicinstrument it must be saved to your disk. Otherwise it would become an ethereal artifact that could never again be seen orlistened. Once the computers power is turned off, its gone forever unless it is saved. The method by which the softwareorganizes the data in the saved file is called the file format.

    KU 5TH SEM ASSIGNMENT - BSIT (TB) - 53 (DATA WAREHOUSING & DATA

    MINING)

  • 7/28/2019 Ku 5th Sem Assignment

    7/44

    PART - AI. Note: Answer all the questions.a) What is Normalization? What are the different forms of Normalization ?The usual approach in normalization in database applications is to ensure that the data is divided into two or more tables,such that when the data in one of them is updated, it does not lead to anamolies of data (The student is advised to refer any

    book on data base management systems for details, if interested).

    The idea is to ensure that when combined, the data available is consistent. However, in data warehousing, one may eventend to break the large table into several denormalized smaller tables. This may lead to lots of extra space being used.But it helps in an indirect wayIt avoids the overheads of joining the data during queries.

    b) Define Data warehouse. What are roles of education in a data warehousing delivery process? Data Warehouse: In its simplest form, a data ware house is a collection of key pieces of information used to manage anddirect the business for the most profitable outcome. It would decide the amount of inventory to be held, the no. ofemployees to be hired, the amount to be procured on loan etc.,.The above definition may not be precise - but that is how data ware house systems are. There are different definitionsgiven by different authors, but we have this idea in mind and proceed. It is a large collection of data and a set of processmanagers that use this data to make information available. The data can be meta data, facts, dimensions and aggregations.The process managers can be load managers, ware house managers or query managers. The information made available issuch that they allow the end users to make informed decisions.Roles of education in a data warehousing delivery process:-

    This has two roles to play - one to make people, specially top level policy makers, comfortable with the concept. Thesecond role is to aid the prototyping activity. To take care of the education concept, an initial (usually scaled down)

    prototype is created and people are encouraged to interact with it. This would help achieve both the activities listed above.The users became comfortable with the use of the system and the ware house developer becomes aware of the limitationsof his prototype which can be improvised upon.

    c) What is process managers? What are the different types of process managers? Process Managers: These are responsible for the smooth flow, maintainance and upkeep of data into and out of thedatabase.The main types of process managers are:-i). Load manager: to take case of source interaction, data transformation and data load.ii). Ware house manger: to take care of data movement, meta data management and performancemonitoring.iii). Query manager: to control query scheduling and monitoring.

    We shall look into each of them briefly. Before that, we look at a schematic diagram that defines the boundaries of thethree types of managers.

    http://4.bp.blogspot.com/-W0RkmcDG9CE/UH_FwbNvpHI/AAAAAAAAJUY/mzS-PSRdhg0/s1600/part-a+c.jpg
  • 7/28/2019 Ku 5th Sem Assignment

    8/44

    d) Give the architectures of data mining systems.

    e) What are the guidelines for KDD environment ?It is customary in the computer industry to formulate rules of thumb that help information technology (IT) specialists toapply new developments. In setting up a reliable data mining environment we may follow the guidelines so that KDDsystem may work in a manner we desire.i). Support extremely large data setsii). Support hybrid learningiii). Establish a data warehouse

    iv). Introduce data cleaning facilitiesv). Facilitate working with dynamic codingvi). Integrate with decision support systemvii). Choose extendible architectureviii). Support heterogeneous databasesix). Introduce client/server architecturex). Introduce cache optimization

    PART - BII. Answer any FIVE full questions.1. a) With the help of a diagram explain architecture of data warehouse.The architecture for a data ware is indicated below. Before we proceed further, we should be clear about the concept ofarchitecture. It only gives the major items that make up a data ware house. The size and complexity of each of these items

    depend on the actual size of the ware house itself, the specific requirements of the ware house and the actual details ofimplementation.

    http://4.bp.blogspot.com/-Enb7FqPtHXc/UH_GGiTR5FI/AAAAAAAAJUg/c8y0rlSXtBQ/s1600/part-a+d.jpg
  • 7/28/2019 Ku 5th Sem Assignment

    9/44

    Before looking into the details of each of the managers we could get a broad idea about their functionality by mapping the

    processes that we studied in the previous chapter to the managers. The extracting and loading processes are taken care ofby the load manager. The processes of cleanup and transformation of data as also of back up and archiving are the duties

    of the ware house manage, while the query manager, as the name implies is to take case of query management.

    b) Indicate the important function of a Load Manager, Warehouse Manager.

    Important function of Load Manager:i) To extract data from the source (s)ii) To load the data into a temporary storage deviceiii) To perform simple transformations to map it to the structures of the data ware house.

    Important function of Warehouse Manager:i) Analyze the data to confirm data consistency and data integrity .ii) Transform and merge the source data from the temporary data storage into the ware house.iii) Create indexes, cross references, partition views etc.,.iv) Check for normalizations.v) Generate new aggregations, if needed.

    vi) Update all existing aggregationsvii) Create backups of data.viii) Archive the data that needs to be archived.

    2. a) Differentiate between vertical partitioning and horizontal partitioning.In horizontal partitioning, we simply the first few thousand entries in one partition, the second few thousand in the nextand so on. This can be done by partitioning by time, where in all data pertaining to the first month / f irst year is put in thefirst partition, the second one in the second partition and so on. The other alternatives can be based on different sizeddimensions, partitioning an other dimensions, petitioning on the size of the table and round robin partitions. Each of themhave certain advantages as well as disadvantages.In vertical partitioning, some columns are stored in one partition and certain other columns of the same row in a different

    partition. This can again be achieved either by normalization or row splitting. We will look into their relative trade offs.

    b) What is schema? Distinguish between facts and dimensions.

    A schema, by definition, is a logical arrangements of facts that facilitate ease of storage and retrieval, as described by theend users. The end user is not bothered about the overall arrangements of the data or the fields in it. For example, a salesexecutive, trying to project the sales of a particular item is only interested in the sales details of that item where as a tax

    practitioner looking at the same data will be interested only in the amounts received by the company and the profits made.The star schema looks a good solution to the problem of ware housing. It simply states that one should identify the factsand store it in the read-only area and the dimensions surround the area. Whereas the dimensions are liable to change, thefacts are not. But given a set of raw data from the sources, how does one identify the facts and the dimensions? It is notalways easy, but the following steps can help in that direction.i) Look for the fundamental transactions in the entire business process. These basic entitiesare the facts.

    http://4.bp.blogspot.com/-QXykiWd2w7s/UH_HE-g2qlI/AAAAAAAAJUw/6v334-3Bk0g/s1600/part-b+i.jpg
  • 7/28/2019 Ku 5th Sem Assignment

    10/44

    ii) Find out the important dimensions that apply to each of these facts. They are the candidatesfor dimension tables.iii) Ensure that facts do not include those candidates that are actually dimensions, with a set offacts attached to it.iv) Ensure that dimensions do not include these candidates that are actually facts.

    3. a) What is an event in data warehousing? List any five events.

    An event is defined as a measurable, observable occurrence of a defined action. If this definition is quite vague, it isbecause it encompasses a very large set of operations. The event manager is a software that continuously monitors thesystem for the occurrence of the event and then take any action that is suitable (Note that the event is a measurable andobservable occurrence). The action to be taken is also normally specific to the event.A partial list of the common events that need to be monitored are as follows: i). Running out of memory space.ii). A process dyingiii). A process using excessing resourceiv). I/O errorsv). Hardware failure

    b) What is summary table? Describe the aspects to be looked into while designing a summary table.The main purpose of using summary tables is to cut down the time taken to execute a specific query.The main methodology involves minimizing the volume of data being scanned each time the query is to be

    answered. In other words, partial answers to the query are already made available. For example, in theabove cited example of mobile market, if one expectsi) the citizens above 18 years of ageii) with salaries greater than 15,000 andiii) with professions that involve traveling are the potential customers, then, every time the query is to be processed (may

    be every month or every quarter), one will have to look at the entire data base to compute these values and then combinethem suitably to get the relevant answers. The other method is to prepare summary tables, which have the values

    pertaining toe ach of these sub-queries, before hand, and then combine them as and when the query is raised.Summary table are designed by following the steps given below:i) Decide the dimensions along which aggregation is to be done.ii) Determine the aggregation of multiple facts.iii) Aggregate multiple facts into the summary table.iv) Determine the level of aggregation and the extent of embedding.v) Design time into the table.

    vi) Index the summary table.

    4. a) List the significant issues in automatic cluster detection.Most of the issues related to automatic cluster detection are connected to the kinds of questions we want to be answered inthe data mining project, or data preparation for their successful application.i). Distance measureMost clustering techniques use for the distance measure the Euclidean distance formula (square root of the sum of thesquares of distances along each attribute axes).

    Non-numeric variables must be transformed and scaled before the clustering can take place. Dependingon this transformations, the categorical variables may dominate clustering results or they may be evencompletely ignored.ii). Choice of the right number of clustersIf the number of clusters k in the K-means method is not chosen so to match the natural structure of the data, the resultswill not be good. The proper way t alleviate this is to experiment with different values for k. In principle, the best k value

    will exhibit the smallest intra-cluster distances and largest inter-cluster distances.iii). Cluster interpretationOnce the clusters are discovered they have to be interpreted in order to have some value for the data mining project.

    b) Define data marting. List the reasons for data marting.The data mart stores a subset of the data available in the ware house, so that one need not always have to scan through theentire content of the ware house. It is similar to a retail outlet. A data mart speeds up the queries, since the volume of datato be scanned is much less. It also helps to have tail or made processes for different access tools, imposing controlstrategies etc.,.Following are the reasons for which data marts are created:

  • 7/28/2019 Ku 5th Sem Assignment

    11/44

    i) Since the volume of data scanned is small, they speed up the query processing.ii) Data can be structured in a form suitable for a user access tooiii) Data can be segmented or partitioned so that they can be used on different platforms and also different controlstrategies become applicable.

    5. a) Explain how to categorize data mining system.There are many data mining systems available or being developed. Some are specialized systems dedicated to a given data

    source or are confined to limited data mining functionalities, other are more versatile and comprehensive. Data miningsystems can be categorized according to various criteria among other classification are the following:a) Classification according to the type of data source mined: this classification categorizes data mining systems accordingto the type of data handled such as spatial data, multimedia data, time-series data, text data, World Wide Web, etc.b) Classification according to the data model drawn on: this classification categorizes data mining systems based on thedata model involved such as relational database, object-oriented database, data warehouse, transactional, etc.c) Classification according to the king of knowledge discovered: this classification categorizes data mining systems basedon the kind of knowledge discovered or data mining functionalities, such as characterization, discrimination, association,classification, clustering, etc. Some systems tend to be comprehensive systems offering several data mining functionalitiestogether.d) Classification according to mining techniques used: Data mining systems employ and provide different techniques. Thisclassification categorizes data mining systems according to the data analysis approach used such as machine learning,neural networks, genetic algorithms, statistics, visualization, database oriented or data warehouse-oriented, etc.

    b) List and explain different kind of data that can be mined.Different kind of data that can be mined are listed below:-i). Flat files: Flat files are actually the most common data source for data mining algorithms, especially at the researchlevel.ii). Relational Databases: A relational database consists of a set of tables containing either values of entity attributes, orvalues of attributes from entity relationships.iii). Data Warehouses: A data warehouse as a storehouse, is a repository of data collected from multiple data sources(often heterogeneous) and is intended to be used as a whole under the same unified schema.iv). Multimedia Databases: Multimedia databases include video, images, audio and text media. They can be stored onextended object-relational or object-oriented databases, or simply on a file system.v). Spatial Databases: Spatial databases are databases that in addition to usual data, store geographical information likemaps, and global or regional positioning.vi). Time-Series Databases: Time-series databases contain time related data such stock market data or logged activities.These databases usually have a continuous flow of new data coming in, which sometimes causes the need for a

    challenging real time analysis.vii). World Wide Web: The World Wide Web is the most heterogeneous and dynamic repository available. A very largenumber of authors and publishers are continuously contributing to its growth and metamorphosis and a massive number ofusers are accessing its resources daily.

    6. a) Give the syntax for task relevant data specification. Syntax for tax-relevant data specification:-The first step in defining a data mining task is the specification of the task-relevant data, that is, the data on which miningis to be performed. This involves specifying the database and tables or data warehouse containing the relevant data,conditions for selecting the relevant data, the relevant attributes or dimensions for exploration, and instructions regardingthe ordering or grouping of the data retrieved. DMQL provides clauses for the clauses for the specification of suchinformation, as follows:-i). use database (database_name) or use data warehouse (data_warehouse_name): The use clause directs the miningtask to the database or data warehouse specified.

    ii). from (relation(s)/cube(s)) [where(condition)]: The from and where clauses respectively specify the database tables ordata cubes involved, and the conditions defining the data to be retrieved.iii). in relevance to (attribute_or_dimension_list): This clause lists the attributes or dimensions for exploration.iv). order by (order_list): The order by clause specifies the sorting order of the task relevant data.v). group by (grouping_list): the group by clause specifies criteria for grouping the data.vi). having (conditions): The having cluase specifies the condition by which groups of data are considered relevant.

    b) Explain the designing of GUI based on data mining query language.A data mining query language provides necessary primitives that allow users to communicate with data mining systems.But novice users may find data mining query language difficult to use and the syntax difficult to remember. Instead , user

  • 7/28/2019 Ku 5th Sem Assignment

    12/44

    may prefer to communicate with data mining systems through a graphical user interface (GUI). In relational databasetechnology , SQL serves as a standard core language for relational systems , on top of which GUIs can easily be designed.Similarly, a data mining query language may serve as a core language for data mining system implementations, providinga basis for the development of GUI for effective data mining.A data mining GUI may consist of the following functional components:-a) Data collection and data mining query composition - This component allows the user to specify task-relevant datasets and to compose data mining queries. It is similar to GUIs used for the specification of relational queries.

    b) Presentation of discovered patternsThis component allows the display of the discovered patterns in various forms,including tables, graphs, charts, curves and other visualization techniques.c) Hierarchy specification and manipulation - This component allows for concept hierarchy specification , eithermanually by the user or automatically. In addition , this component should allow concept hierarchies to be modified by theuser or adjusted automatically based on a given data set distribution.d) Manipulation of data mining primitivesThis component may allow the dynamic adjustment of data miningthresholds, as well as the selection, display and modification of concept hierarchies. It may also allow the modification of

    previous data mining queries or conditions.e) Interactive multilevel miningThis component should allow roll-up or drill-down operations on discovered patterns.f) Other miscellaneous informationThis component may include on-line help manuals, indexed search , debuggingand other interactive graphical facilities.

    7. a) Explain how decision trees are useful in data mining.Decision trees are powerful and popular tools for classification and prediction. The attractiveness of tree-based methods is

    due in large part to the fact that, it is simple and decision trees represent rules. Rules can readily be expressed so that wehumans can understand them or in a database access language like SQL so that records falling into a particular categorymay be retrieved.

    b) Identify an application and also explain the techniques that can be incorporated in solving the problem using

    data mining techniques.Write yourself...

    8. Write a short notes on :

    i) Data Mining Querying Languageii) Schedule Manageriii) Data Formatting.i) Data Mining Querying LanguageA data mining language helps in effective knowledge discovery from the data mining systems. Designing

    a comprehensive data mining language is challenging because data mining covers a wide spectrum oftasks from data characterization to mining association rules, data classification and evolution analysis.Each task has different requirements. The design of an effective data mining query language requires adeep understanding of the power, limitation and underlying mechanism of the various kinds of data miningtasks.ii) Schedule managerThe scheduling is the key for successful warehouse management. Almost all operations in the warehouse need some type of scheduling. Every operating system will have its own scheduler and batchcontrol mechanism. But these schedulers may not be capable of fully meeting the requirements of a datawarehouse. Hence it is more desirable to have specially designed schedulers to manage the operations.iii) Data formattingFinal data preparation step which represents syntactic modifications to the data that do not change itsmeaning, but are required by the particular modelling tool chosen for the DM task. These include:a). reordering of the attributes or records: some modelling tools require reordering of the attributes

    (or records) in the dataset: putting target attribute at the beginning or at the end, randomizingorder of records (required by neural networks for example)

    b). changes related to the constraints of modelling tools: removing commas or tabs, specialcharacters, trimming strings to maximum allowed number of characters, replacing specialcharacters with allowed set of special characters.

    KU 5TH SEM ASSIGNMENT - BSIT (TB) - 52 (WEB PROGRAMMING)Assignment: TB (Compulsory)

    Part - A

  • 7/28/2019 Ku 5th Sem Assignment

    13/44

    a) What is the difference between Internet and Intranet? Internet: Internet is global network of networks.Internet is a tool for collaborating academic research,and it has become amedium for exchanging anddistributing information of all kinds. It is aninterconnection between several computers ofdifferent types belongingto various networks all over global.Intranet: Intranet is not global. It is a mini web that islimited to user machines and software program of particularsorganization or company

    b) List any five HTML tags.Five HTML tags are:-i). UL (unordered list):The UL tags displays a bulleted list. You can use the tags TYPE attribute to change the bulletstyle.ii). TYPE: defines the type of bullet used of each list item. The value can be one of the following-CIRCLE, DISC,SQUAREiii). LI (list item): The LI tag indicates an itemized element, which is usually preceded by bullet, a number, or a letter. TheLI is used inside list elements such as OL (ordered list) and UL (unordered list).iv). TABLES (table): The TABLE tag defines a table. Inside the TABLE tag, use the TR tag to define rows in the table,use the TH tag to define row or column headings, and the TD tag to define table cells.v). HTML (outermost tag): The HTML identifies a document as an HTML document. All HTML documents should startwith the and end with the tags.

    c) Write the difference between HTML and DHTML.HTML:HTML stands for Hyper Text MarkupLanguage. It is a language. HTML cant bedone after the page loads.HTML can be or not usedwith JavaScript.DHTML:DHTML stands for Dynamic Hyper TextMarkup Language. DHTML isnt really alanguage or a thing initself its just a mix of thosetechnologies. Dynamic HTML is simply HTMLthat can change even after a page has beenloaded into a browser. DHTML can be used with JavaScript.

    d) Explain the different types of PERL variables.Perl has three types of variables:i). Scalarsii). Arraysiii). Hashes.

    i). Scalars: A scalar variable stores a single (scalar) value.Perl scalar names are prefixed with a dollar sign ($), so for

    example, $username, and $url are all examples of scalar variable names. A scalar can hold data of anytype, be it a string, anumber, or whatnot. We can alsouse scalars in double-quoted strings: my $fnord = 23;my $blee = The magic number is$fnord.; Now if you print $blee, we will get The magic number is 23.Perl interpolates the variables in the string,replacingthe variable name with the value of that variable.ii). Arrays: An array stores an ordered list of values. Whilea scalar variable can only store one value, an arraycanstoremany. Perl array names are prefixed with a @-sign.e.g.:my @colors = (red,green,blue); foreach my$i(@colors) { print $i\n; }iii). Hashes: Hashes are an advanced form of array. One of the limitations of an array is that the information containedwithin it can be difficult to get to. For example, imagine that you have a list of people and their ages. The hash solves this

    problem very neatly by allowing us to access that @ages array not by an index, but by a scalar key. For example to use ageof different people we can use thier names as key to define a hash.

    e) How are JSPs better than servlets.Java programming knowledge is needed todevelop and maintain all aspects of the application,since the processing code

    and the HTML elements are jumped together.Changing the look and feel of theapplication,or adding support for a new type of client, requires theservlet code to beupdated and recompiled.Its hardto take advantage of web-page development tools whendesigning the application interface. If such tools areused todevelop the web page layout, the generatedHTML must then be manually embedded into theservletcode, a process whichis time consuming, error prone,and extremely boring. Adding JSP to the puzzle wesolvethese problems.So JSPs better thanservlets.

    Part - B

  • 7/28/2019 Ku 5th Sem Assignment

    14/44

    1. a) Explain GET and POST method with the help of an example.When a client sends a request to the server, theclients can also additional information with the URL todescribe whatexactly is required as output from theserver by using the GET method. The additionalsequenceof characters that areappended to URL is called a querystring. However, the length of the query string islimited to 240 characters. Moreover,the query string isvisible on the browser and can therefore be a securityrisk.to overcome these disadvantages, the POSTmethod can be used. The POST method sends the data as packetsthrough a separate socket connection. Thecompletetransaction is invisible because to the client. Thedisadvantageof POST method is that it is slower compared to

    theGET method because data is sent to the server asseparate packets.

    b) Explain in detail the role played by CGI programming in web programming.CGI opened the gates of more complex Web applications. It enabled developers to write scripts,which can communicate with server applications and databases. In addition, it enablesdevelopers to write scripts that could also parse client's input, process it, and present it in a userfriendly way.The Common Gateway Interface, or CGI, is a standard for external gateway

    programs to interface with information servers such as HTTP servers. A plain HTML documentthat the Web daemon retrieves is static, which means it exists in a constant state: a text file thatdoesn't change. A CGI program, on the other hand, is executed in real-time, so that it can outputdynamic information.CGI programming allows us to automate passing information to and from web pages. It can also

    be used to capture and process that information, or pass it off to other software (such as in an

    SQL database).CGI programs (sometimes called scripts) can be written in any programming language, but thetwo most commonly used are Perl and PHP. Despite all the flashy graphics, Internet technologyis fundamentally a text-based system. Perl was designed to be optimal for text processing, so itquickly became a popular CGI tool. PHP is a scripting language designed specifically to makeweb programming quick and easy.

    2. a) With the help of an example explain the embedding of an image in an HTML tag.

    b) Create a HTML page to demonstrate the usage of Anchor tags. A Cold Autumn DayIf this anchor is in a file called "nowhere.htm," you could define a link that jumps to theanchor as follows:

    Jump to the second section A Cold Autumn Day in the mystery "A man from Nowhere."

    3. a) Explain the usage of script tags.Using the SCRIPT Tag: The following example uses the SCRIPT tag to define a JavaScript script in the HEAD tag. Thescript is loaded before anything else in the document is loaded. The JavaScript code in this example defines a function,changeBGColor(), that changes the documents background color.The body of the document contains a form with two buttons. Each button invokes the changeBGColor()function to change the background of the document to a different color.

    Script Example

  • 7/28/2019 Ku 5th Sem Assignment

    15/44

    function changeBGColor (newcolor) {document.bgColor=newcolor;return false;}

    Select a background color:

    Your browser is not JavaScript-enabled.These buttons will not work.

    b) What is Java script? List the use of Java script. JavaScript is a scripting language (like a simple programming language). It is a language that can be used for client-sidescripting. JavaScript is only usedinside of HTML documents. With JavaScript, we can make text scroll across the screenlike ticker tape.

    The uses of JavaScript are:i). Control DocumentAppearance and Contentii). Control the Browseriii). Interact with Document Controliv). Interact withUserv). Read and Write Client State with Cookiesvi). Interact with Appletsvii). JavaScript is only usedinside of HTML documents.

    4. a) With the help of an example explain any five CGI environment variables.i). SERVER_NAME : The server's host name or IP address.ii). SERVER_PORT : The port number of the host on which the server is running.iii). SERVER_SOFTWARE : The name and version of the server software that is answering the client request.iv). SERVER_PROTOCOL : The name and revision of the information protocol that request came in with.

    v). GATEWAY_INTERFACE : The revision of the common gateway interface that the server uses.

    Example:-#!/usr/local/bin/perl

    print "Content-type: text/html", "\n\n";print "", "\n";print "About this Server", "\n";print "About this Server", "\n";print "";print "Server Name: ", $ENV{'SERVER_NAME'}, "
    ", "\n";print "Running on Port: ", $ENV{'SERVER_PORT'}, "
    ", "\n";print "Server Software: ", $ENV{'SERVER_SOFTWARE'}, "
    ", "\n";print "Server Protocol: ", $ENV{'SERVER_PROTOCOL'}, "
    ", "\n";print "CGI Revision: ", $ENV{'GATEWAY_INTERFACE'}, "
    ", "\n";

    print "", "\n";print "", "\n";exit (0);

    b) Write a CGI application which accepts three numbers from the used and display biggest number using GET and

    POST methods.#!/usr/bin/perl#print "Content-type:text/html\n\n";#$form = $ENV{'QUERY_STRING'};

  • 7/28/2019 Ku 5th Sem Assignment

    16/44

    use CGI;$cgi = new CGI;

    print $cgi->header;print $cgi->start_html( "Question Ten" );my $one = $cgi->param( 'one' );my $two = $cgi->param( 'two' );my $three = $cgi->param( 'three' );

    if( $one && $two && $three ){$lcm = &findLCM( &findLCM( $one, $two ), $three );

    print "LCM is $lcm";}else{

    print '';

    print 'Enter First Number';

    print 'Enter Second Number';

    print 'Enter Third Number

    ';print '';

    print "";}

    print $cgi->end_html;sub findLCM(){my $x = shift;my $y = shift;my $temp, $ans;if ($x < $y) {$temp = $y;$y = $x;

    $x = $temp;}$ans = $y;$temp = 1;while ($ans % $x){$ans = $y * $temp;$temp++ ;}return $ans;}

    5. a) List the differences between web server and application server. The main differences between Web servers and application servers :-

    A Web server is where Web components are deployed and run. An application server is wherecomponents that implement the business logic are deployed. For example, in a JSP-EJB Webapplication, the JSP pages will be deployed on the Web server whereas the EJB components will

    be deployed on the application servers.A Web server usually supports only HTTP (and sometimes SMTP and FTP). However, anapplication server supports HTTP as well as various other protocols such as SOAP.

    In other word :-Difference between AppServer and a Web server :-i). Webserver serves pages for viewing in web browser, application server provides exposes

  • 7/28/2019 Ku 5th Sem Assignment

    17/44

    businness logic for client applications through various protocolsii). Webserver exclusively handles http requests.application server serves bussiness logic toapplication programs through any number of protocols.iii). Webserver delegation model is fairly simple,when the request comes into the webserver,itsimply passes the request to the program best able to handle it(Server side program). It may notsupport transactions and database connection pooling.iv). Application server is more capable of dynamic behaviour than webserver. We can also

    configure application server to work as a webserver.Simply applic! ation server is a superset ofwebserver.

    b) What is a war file? Explain its importance.WAR or Web Application Archive file is packaged servlet Web application. Servlet applicationsare usually distributed as a WAR files.WAR file (which stands for "web application_ archive" ) is a JAR_ file used to distribute a collection of JavaServerPages_ , servlets_ , Java_ classes_ , XML_ files, tag libraries and static Web pages ( HTML_ and related files) thattogether constitute a Web application.

    6. a) Explain implicit objects out, request response in a JSP page.Following are the implicit objects in a JSP page:-out: This implicit object represents a JspWriter that provides a stream back to the requesting client. The most commonmethod of this object is out.println(),which prints text that will be displayed in the client's browser request: This implicit

    object represents the javax.servlet.HttpServletRequest interface. The request object is associated with every HTTP request.One common use of the request object is to access request parameters. You can do this by calling the request object'sgetParameter() method with the parameter name you are seeking. It will return a string with the values matching thenamed parameter. response: This implicit object represents the javax.servlet.HttpServletRequest object. The responseobject is used to pass data back to the requesting client. A common use of this object iswriting HTML output back to the client browser.

    b) With the help of an example explain JSP elements.JSP elements are of 3 types:-Directive: Specifies information about the page itself that remains the same between requests.For example, it can be used to specify whether session tracking is required or not, bufferingrequirements, and the name of the page that should be used to report errors.Action: Performs some action based on information that is required at the exact time the JSP

    page is requested by a browser. An action, for instance, can access parameters sent with therequest to lookup a database.Scripting: Allows you to add small pieces of code in JSP page.

    KU 5TH SEM PRACTICAL SOLUTIONS

    Set 1//1. Open an Image. And separate background using selection tool.Step 1: run PhotoshopStep 2: go to file menu -> openStep 3: select image ->click open

    Step 4: click on magic wand tool from tool menuStep 5: select on background of the image using magic wand toolStep 6: press delete on keyboardStep 7: go to file menu -> save asStep 8: select JPEG formatStep 9: enter file name -> click SAVE

    //2. Write a JSP page to display the number of hits to this page. (Hint: use application scope of java bean).

  • 7/28/2019 Ku 5th Sem Assignment

    18/44

    Page Counter Using URL RewritingPage Counter Using URL Rewriting This is the first time you have accessed this page. You have accessed the page once before. You have accessed the page times before.

    Click

    here to visit the page again.

    Set 2

    //1. Using pencil tool create an image of landscape, and color it with Brush tool.Step 1: run PhotoshopStep 2: click file menu -> new -> select size -> press OKStep 3: in dialog box, click on preset -> select landscape in size box -> press OKStep 4: click on pencil tool in tool menuStep 5: draw an image in landscape using pencil tool

    Step 6: right click on pencil tool and select brush toolStep 7: using brush tool, fill the color in landscape imageStep 8: go to file menu -> save asStep 9: select JPEG formatStep 10: enter file name -> click SAVE

    //2. Create an HTML page containing the following featuresa. Create a login JSP page with username, password and submit button.

    b. On submit, display message Thank you for logging in also create cookies to store username and

    password.c. Open login JSP page on a new browser. If the cookie is present the username and password field should be

    automatically populated with the values from the cookie.

    Please Enter Your Detials !
    First Name
    Last Name

  • 7/28/2019 Ku 5th Sem Assignment

    19/44

    Next.jsp

    JSP Page

    Set 3

    //1. Write a JSP program to display current date and time and suitable welcome message.

    a. If time is between 5AM and 12 PM display welcome message as Good Morningb. If time is between 12 PM and 5 PM display welcome message as Good Afternoonc. After 5PM display message as Good evening.Welcome

    5 && time12 && time17)out.println("\n Good Evening !");%>

    current time is ::

    //2. Using Rubberstamp tool, create a clone imageStep 1: run PhotoshopStep 2: go to file menu -> openStep 3: select image -> click openStep 4: select rubberstamp tool from tool menuStep 5: press ALT then left click on image to beginStep 6: click on the image and drag where you want to make clone of that imageStep 7: go to file -> save as

  • 7/28/2019 Ku 5th Sem Assignment

    20/44

    Step 8: select JPEG formatStep 9: enter file name -> click SAVE

    Set 4

    //1. Using Gradient tool, create some backgrounds for photos.

    Step 1: run PhotoshopStep 2: go to file menu -> new -> select size -> press okStep 3: select gradient tool from tool menuStep 4: choose gradient (linear/ radial/ angle/ diamond) from option toolbarStep 5: press left click on mouse then drag on image to create gradientStep 6: go to file -> save asStep 7: select JPEG formatStep 8: enter file name -> click SAVE

    //2. .Create an HTML page containing the following featuresa. A combo box containing the list of 7 colors: Violet, Indigo, Blue, Green, Yellow, Orange, Redb. Depending upon the color selected from the above combo box, the message in the status bar of the window

    must be reflect the value selected in the combo box (hint: on change event of the combo box).

    Showing Message in Status Barfunctionfn(){num=document.frm.vibgyor.selectedIndex;if(num==0){window.status="You have selected Violet.";}if(num==1){

    window.status="You have selected Indigo.";}if(num==2){window.status="You have selected Blue.";}if(num==3){window.status="You have selected Green.";}if(num==4){window.status="You have selected Yellow.";}

    if(num==5){window.status="You have selected Orange.";}if(num==6){window.status="You have selected Red.";}}

  • 7/28/2019 Ku 5th Sem Assignment

    21/44

    VioletIndigoBlueGreenYellowOrang

    Red

    Set 5

    //1. Create an HTML page containing the following featuresa. A combo box containing the list of 7 colors: Violet, Indigo, Blue, Green, Yellow, Orange, Redb. An empty 1X1 table with default background color: Whitec. Depending upon the color selected from the above combo box, the background of the table must be

    changed accordingly. (hint: on change event of the combo box).

    Changing Table Color by selecting color from the ComboBox

    functionfn(){

    num=document.frm.vibgyor.selectedIndex;if(num==0) {

    document.getElementById("tab").bgColor="Violet";}

    if(num==1){

    document.getElementById("tab").bgColor="Indigo";}if(num==2) {

    document.getElementById("tab").bgColor="Blue";}if(num==3){

    document.getElementById("tab").bgColor="Green";}if(num==4){

    document.getElementById("tab").bgColor="Yellow";

    }if(num==5){

    document.getElementById("tab").bgColor="Orange";} if(num==6){

    document.getElementById("tab").bgColor="Red";}

    }

  • 7/28/2019 Ku 5th Sem Assignment

    22/44

    VioletIndigoBlueGreenYellow

    OrangeRed



    NameRegistration Numberpriyanka rani072B5725

    //2. Import a JPEG format image and save it as a PSD image, using layer optionsDecrease the opacity of image.Tips: Ctrl + Shift + S = save as windowStep 1: run PhotoshopStep 2: go to file menu -> openStep 3: select a JPEG image -> click openStep 4: go to layer -> new -> click on layer from backgroundStep 5: enter layer name in dialog box -> press OKStep 6: press F7 then decrease opacityStep 7: go to file -> save asStep 8: select PSD format

    Step 9: enter file name -> click SAVE

    Set 6

    //1. Open a PORTRAIT image, convert it into grayscale. Now color the image Using COLOR BALANCE, LEVELS

    and CURVESStep 1: run PhotoshopStep 2: go to file menu -> openStep 3: select a portrait JPEG image ->click openStep 4: go to image -> mode -> click on GrayscaleStep 5: click discard in message box Step 6: go to image -> adjustments -> image -> click on curvesStep 7: adjust curves -> press OK

    Step 8: go to file -> save asStep 9: select JPEG formatStep 10: enter file name -> click SAVE

    //2. Write a HTML page containing an HTML form to capture the following properties from the user:a. Name (text box)b. Address (text area)c. Phone (text box)

    Write javascript functions

  • 7/28/2019 Ku 5th Sem Assignment

    23/44

    a. to validate Name to contain only alphabets and of maximum length should be 25 ; Show appropriate

    messages on failure

    b. to validate Address field to contain maximum length of 200 characters; Show appropriate on failure and

    focus the Address field text areac. to validate phone number to contain only numeric data; show appropriate messages on failure

    HTML form

    function f(){

    var name=document.f1.Name.value;var phone=document.f1.Phone.value;var address=document.f1.Address.value;

    if(name.length==""){

    alert("Please enter name");

    name.focus();return;

    }if (name.length> 25){

    alert("Name Field cannot contain more than 25 characters");name.focus();return;

    }if (!isNaN(name)){

    alert("Name field must be filled with only Alphabets");name.focus();return;

    }

    if(phone.length==""){

    alert("Please enter phone numbar");phone.focus();return;

    }if (isNaN(phone)){

    alert("Phone Number must be numeric");phone.focus();return;

    }

    if(address.length==""){

    alert("Please enter address");address.focus();return;

    }if (address.length> 200){

    alert("Address Field can contain maximum of 200 character");

  • 7/28/2019 Ku 5th Sem Assignment

    24/44

    }}

    A Sample FORM

    Name:
    Phone:
    Address:

  • 7/28/2019 Ku 5th Sem Assignment

    25/44

    }}

    //2. Open a portrait, select the eyeballs using marquee tool, and now change the color of eyes using Hue / saturation. Tips: Ctrl + U = Hue / saturationStep 1: run PhotoshopStep 2: go to file menu -> open

    Step 3: select image ->click openStep 4: click on marquee tool from tool menuStep 5: select eyeball from the image using marquee toolStep 6: press CTRL+UStep 7: adjust HUE AND SATURATION from dialog box -> press OKStep 8: go to file -> save asStep 9: select JPEG formatStep 10: enter file name -> click SAVE

    Set 8

    //1. Open 3 to 4 images in a same layer. Using filter effects create creative backgrounds for book cover page. Step 1: run Photoshop

    Step 2: go to file menu -> new -> select background size -> press OKStep 3: go to filter -> noise -> add noiseStep 4: adjust amount in noise dialog box -> press OKStep 5: go to file menu -> openStep 6: select 3-4 images -> click openStep 7: select images, copy and paste them in background one by one Step 8: go to file -> save asStep 9: select JPEG formatStep 10: enter file name -> click SAVE

    //2. Create a HTML page to display a list of film songs available in the library. The following are features of the

    pagea. The name of the songs must be hyper linked to the songs, so that the users must be able to download songs.b. The following is the song database available in the library:

    c. Library Name: Hariharan Music SiteSlno Song Name Film Artiste

    1 PATA-PATA Apthamitra Udith Narayan2 Kana Kanade Apthamitra Madhubalakrishna3 Anku Donku Apthamitra S P Balasubramanyam4 Kalavanu Thadeyoru Apthamitra Hariharan5 Bombe Anayya Unknown

    Hiriharan Songs Site

    Welcome to Hariharan's Songs Site

    S.No.Song NameFilmArtist

  • 7/28/2019 Ku 5th Sem Assignment

    26/44

    1.Patta-PattaApthamitraUdit Narayan

    2.

    Kana KanedeApthamitraMadhubalakirishna

    3.AnkuDonkuApthamitraS P Balasupramanniyam

    4.BombayAnaya

    Unknown

    Set 9

    //1. Create an HTML page to display the following data using tags

    First Name Last Name City Phone Number

    Shiva Rama Mysore 08212569964

    Pratap S Bangalore 08025689754Sreenivas G Mercara 08965445454

    Data Table

    First NameLast NameCity

    Phone Number

    ShivaRamaMysore08212569964

    Pratap

  • 7/28/2019 Ku 5th Sem Assignment

    27/44

    SBangalore08025689754

    ShrinivasG

    Mercara08965445454

    //2. Open an image and adjust a level of image.

    Tips: Ctrl + L = levelStep 1: run PhotoshopStep 2: go to file menu -> openStep 3: select an image -> click openStep 4: go to image -> adjustments -> click on level or press ctrl + lStep 5: adjust level -> press OK

    Step 6: go to file -> save asStep 7: select JPEG formatStep 8: enter file name -> click SAVE

    Set 10

    //1. Write HTML script to display Hello World, Welcome to the world of HTML. Put the title as World of

    HTML

    Welcome to the world of HTML

    "Hello WorldWelcome to the world of HTML"

    //2. Change an image size 22 cm x 29 cm to 44 cm x 58 cm. and resolution 72 to 300.Step 1: run PhotoshopStep 2: go to file menu -> openStep 3: select an image with 22 cm x 29 cm size -> click openStep 4: go to image -> image sizeStep 5: change image size to 44 cm x 58 cm size with 100 resolutions -> press OKStep 6: go to file -> save asStep 7: select JPEG format

    Step 8: enter file name -> click SAVE

    Set 11

    //1. Create some geometrical shapes, using shape tool.Step 1: run Photoshop

    Step 2: go to file menu -> new -> select size -> press OKStep 3: click on custom shape tool from tool menuStep 4: click on custom shape picker in options toolbar

  • 7/28/2019 Ku 5th Sem Assignment

    28/44

    Step 5: click on smart tag -> select all then click appendStep 6: choose shape from option toolbarStep 7: left click on background and drag mouse to draw shapeStep 8: go to file -> save asStep 9: select JPEG formatStep 10: enter file name -> click Save

    Set 12

    //1. Type text GRADATION and apply gradient tool on text.Step 1: run PhotoshopStep 2: go to file menu -> new -> select size -> click OKStep 3: click on text from tool menuStep 4: type text GRADATIONStep 5: click on layer from layer propertyStep 6: right click on selected layer and click on blending optionsStep 7: click and check on gradient overlayStep 8: adjust gradient or change angle to 0o -> then press OKStep 9: go to file menu -> save asStep 10: select JPEG format

    Step 11: enter file name -> click SAVE

    //2. Create an HTML page to display the following data using tagsFirst Name Last Name City Phone Number

    Shiva Rama Mysore 08212569964Pratap S Bangalore 08025689754Sreenivas G Mercara 08965445454

    Data Table

    First NameLast NameCityPhone Number

    ShivaRamaMysore08212569964

    PratapSBangalore08025689754

    ShrinivasGMercara08965445454

  • 7/28/2019 Ku 5th Sem Assignment

    29/44

    Set 13

    //1. Write C Program to create Indian Flag.#include#include#include#includeconst float PI=3.14154;void main(){int gdriver=DETECT,gmode=0;int I;Int x,y;initgraph(&gdriver,&gmode,"c:\\tc\\bgi");cleardevice();

    rectangle(0,0,639,479);outtextxy(250,20,"INDIAN FLAG");rectangle(80,50,560,380);line(80,160,560,160);line(80,270,560,270);setfillstyle(SOLID_FILL,LIGHTRED);floodfill(85,60,getmaxcolor());setfillstyle(SOLID_FILL,WHITE);floodfill(85,170,getmaxcolor());setfillstyle(SOLID_FILL,GREEN);floodfill(85,280,getmaxcolor());setcolor(BLUE);circle(320,215,50);for(I=0;I

  • 7/28/2019 Ku 5th Sem Assignment

    30/44

    p=0;q=0;

    j=0;flag=0;setcolor(WHITE);for(k=0;k=638)i=0;

    if(flag==0)j=j-2,q=q+2;

    if(flag==1)j=j+2,q=q-2;

    if(j=0)flag=0;

    delay(10);cleardevice();}getch();closegraph();

    }

    Set 14

    //1. Write Open GL Program to create a Window and display HELLO inside.#includevoid display(void){

    glClear(GL_COLOR_BUFFER_BIT);glColor3f(1.0,1.0,1.0);

  • 7/28/2019 Ku 5th Sem Assignment

    31/44

    glBegin(GL_POLYGON);glVertex3f(0.25,0.25,0.25);glVertex3f(0.75,0.25,0.0);glVertex3f(0.75,0.75,0.0);glVertex3f(0.25,0.75,0.0);glEnd();glFlush();

    }

    Void init(void){

    glClearColor(0.0,0.0,0.0,0.0);glMatrixMode(GL_PROJECTION);glLoadIdentity();glOrtho(0.0,1.0,0.0,1.0,-1.0,1.0);

    }

    Int main(int argc,char**argv){

    glutInit(&argc,argv);

    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);glutInitWindowSize(250,250);glutInitWindowPosition(100,100);glutCreateWindow(HELLO);init();

    glutDisplayFunc(display);glutMainLoop();return 0;}

    //2. Create a simple static web page for a college (assume necessary information)My College Site

    My College SiteHomeSitemapAbout Us

    Online AdmissionEnter your name:

    Gender: Male Female

    Qualification: Matric Enter



  • 7/28/2019 Ku 5th Sem Assignment

    32/44

    KU 6TH SEM PRACTICAL SOLUTIONS

    Set -11. Write a program for frame sorting technique used in buffers.

    #include

    #include

    #include

    structframe

    {

    int fslno;

    char finfo[20];

    };

    structframe arr[10];

    int n;

    void sort()

    {int i,j,ex;

    structframe temp;

    for(i=0;i

  • 7/28/2019 Ku 5th Sem Assignment

    33/44

    for(i=0;i

  • 7/28/2019 Ku 5th Sem Assignment

    34/44

    {

    for(j=0;j

  • 7/28/2019 Ku 5th Sem Assignment

    35/44

    staticvoid Main()

    {

    Thread thread1 = newThread(newThreadStart(A));

    Thread thread2 = newThread(newThreadStart(B));

    thread1.Start();

    thread2.Start();

    thread1.Join();

    thread2.Join();

    }

    staticvoid A()

    {

    Thread.Sleep(100);

    Console.WriteLine('A');

    }

    staticvoid B()

    {Thread.Sleep(1000);

    Console.WriteLine('B');

    }

    }

    }

    Set -31. Write a program for simple RSA/DES algorithm to encrypt and decrypt the data.

    #include

    #include

    double min(double x, double y){

    return(xy?x:y);

    }

    double gcd(double x,double y)

    {

    if(x==y)

    return(x);

    else

    return(gcd(min(x,y),max(x,y)-min(x,y)));

    }

    longdouble modexp(longdouble a,longdouble x,longdouble n)

    {

    longdouble r=1;

    while(x>0)

    {

  • 7/28/2019 Ku 5th Sem Assignment

    36/44

    if ((int)(fmodl(x,2))==1)

    {

    r=fmodl((r*a),n);

    }

    a=fmodl((a*a),n);

    x/=2;

    }

    return(r);

    }

    int main()

    {

    longdouble p,q,phi,n,e,d,cp,cq,dp,dq,mp,mq,sp,sq,rp,rq,qInv,h;

    longdouble ms,es,ds;

    do

    {

    printf("\n Enter prime numbers p and q:");

    scanf(" %Lf %Lf",&p,&q);

    }while(p==q);

    n=p*q;

    phi=(p-1)*(q-1);

    do

    {

    printf("\n Enter prime value of e:");

    scanf(" %Lf",&e);

    }

    while((gcd(e,phi)!=1)&&e>phi);

    for(d=1;d

  • 7/28/2019 Ku 5th Sem Assignment

    37/44

    {

    staticvoid Main(string[] args)

    {

    int i, j, divide = 0;

    i = 10;

    j = 0;

    try

    {

    divide = i / j;

    }

    catch (DivideByZeroException)

    {

    divide = 0;

    }

    finally

    {

    Console.WriteLine(divide); }

    Console.ReadLine();

    }

    }

    }

    Set -41. Write a program for Spanning Tree Algorithm (PRIM) to find loop less path.

    #include

    #include

    #include #define MAX 20

    #define INFINITY 999

    #include

    enumboolean {FALSE,TRUE};

    void prim(int c[][MAX],int t[MAX],int n);

    int mincost=0;

    int main()

    {

    int n,c[MAX][MAX],t[2*(MAX-1)];

    int i,j;

    clrscr();

    printf("\nTo find min path spanning tree");

    printf("\nEnter no of nodes:");

    scanf("%d",&n);

    printf("\nEnter the cost adjacency matrix");

    for(i=0;i

  • 7/28/2019 Ku 5th Sem Assignment

    38/44

    for(i=0;i

  • 7/28/2019 Ku 5th Sem Assignment

    39/44

    {

    staticvoid Main()

    {

    Widget w = newWidget();

    w++;

    Console.WriteLine(w._value);

    w++;

    Console.WriteLine(w._value);

    Widget g = newWidget();

    g++;

    Console.WriteLine(g._value);

    Widget t = w + g;

    Console.WriteLine(t._value);

    }

    }

    classWidget{

    publicint _value;

    publicstaticWidgetoperator +(Widget a, Widget b)

    {

    Widget widget = newWidget();

    widget._value = a._value + b._value;

    return widget;

    }

    publicstaticWidgetoperator ++(Widget w)

    {

    w._value++;

    return w;

    }

    }

    }

    Set -51. Write a program in C# to sort the students list based on their names. The students list is stored in a string array.

    using System;

    namespace ConsoleApplication4

    {

    classProgram

    {

    staticvoid Main(string[] args)

    {

    string[] students =

    { "Vikash", "Bhushan", "Deepak", "Tapas", "Suresh", "Avinash" };

  • 7/28/2019 Ku 5th Sem Assignment

    40/44

    Array arr = students;

    Array.Sort(arr);

    foreach (string item in arr)

    {

    Console.WriteLine(item);

    }

    Console.ReadLine();

    }

    }

    }

    2. Write a C# Program to demonstrate use of Virtual and override Key words in C#.

    using System;

    namespace ConsoleApplication1

    {

    classProgram{

    staticvoid Main(string[] args)

    {

    ChildClass cc = newChildClass();

    cc.Display();

    Console.ReadLine();

    }

    }

    classParentClass

    {

    publicvirtualvoid Display()

    {

    Console.WriteLine("Base Class");

    }

    }

    classChildClass:ParentClass

    {

    publicoverridevoid Display()

    {

    base.Display();

    Console.WriteLine("Derived Class");

    }

    }}

    Set -61. Write a program in C# , create a class called rectangle which consists of members side_1, side_2 and displayArea().

    Write another class square which inherits class rectangle. Take side of square as input and display the area of square on

    console

    using System;

  • 7/28/2019 Ku 5th Sem Assignment

    41/44

    namespace ConsoleApplication4

    {

    classProgram

    {

    staticvoid Main(string[] args)

    {

    square sq = newsquare();

    sq.displayArea();

    Console.ReadLine();

    }

    }

    classrectangle

    {

    publicint side_1 = 10;

    publicint side_2 = 20;

    publicvirtualvoid displayArea() {

    Console.WriteLine("Area of Rectangle is: " + side_1 * side_2);

    }

    }

    classsquare:rectangle

    {

    publicoverridevoid displayArea()

    {

    Console.WriteLine("Area of Square is: " + side_1 * side_1);

    }

    }

    }

    2. Write a program to multiply two matrices.

    #include

    int main(){

    int a[5][5],b[5][5],c[5][5],i,j,k,sum=0,m,n,o,p;

    printf("\nEnter the row and column of first matrix");

    scanf("%d %d",&m,&n);

    printf("\nEnter the row and column of second matrix");

    scanf("%d %d",&o,&p);

    if(n!=o){printf("Matrix mutiplication is not possible");

    printf("\nColumn of first matrix must be same as row of second matrix");

    }

    else{

    printf("\nEnter the First matrix->");

    for(i=0;i

  • 7/28/2019 Ku 5th Sem Assignment

    42/44

    printf("\nEnter the Second matrix->");

    for(i=0;i

  • 7/28/2019 Ku 5th Sem Assignment

    43/44

    using System;

    using System.Collections.Generic;

    using System.ComponentModel;

    using System.Linq;

    using System.Text;

    using System.Web;

    using System.Web.UI;

    using System.Web.UI.WebControls;

    namespace FirstServerControl

    {

    [DefaultProperty("Text")]

    [ToolboxData("")]

    publicclassServerControl1 : WebControl

    {

    [Bindable(true)]

    [Category("Appearance")][DefaultValue("")]

    [Localizable(true)]

    publicstring Text

    {

    get

    {

    String s = (String)ViewState["Text"];

    return ((s == null) ? "[" + this.ID + "]" : s);

    }

    set

    {

    ViewState["Text"] = value;

    }

    }

    protectedoverridevoid RenderContents(HtmlTextWriter output)

    {

    output.Write(Text);

    }

    }

    }

    2. Write a program to display a message Welcome to ASP.NET 8 times in increasing order of their font size using

    ASP.NET.

    WebForm1

  • 7/28/2019 Ku 5th Sem Assignment

    44/44

    Welcome to ASP.NET ASHISH