Like us on Facebook and stand a chance to win pen drives!

Showing posts with label fourth-year. Show all posts




IDE: Netbeans
Add Spring framework to project classpath before compiling.

IDE: Netbeans
Add Spring library to project classpath before compiling.

IDE : Netbeans


Add Hibernate library to project classpath before compiling this project.




What is a data warehouse?
A data warehouse is a subject oriented, integrated, time variant,  non volatile collection of data in support of management's decision making process.

What is data mining?
Explore predictive hidden patterns from a large collection of data.

What is a surrogate key?
In order to isolate the data warehouse from source systems, we will introduce a technical surrogate key instead of re-using the source system's natural (business) key. If a surrogate key generation process is implemented correctly, adding a new source system to the data warehouse processing will not require major efforts.

What are Slowly Changing Dimensions?
 Dimensions that change over time are called Slowly Changing Dimensions. For instance, a product price changes over time; People change their names for some reason; Country and State names may change over time. These are  a few examples of Slowly Changing Dimensions since some changes are happening to them over a period of time.

Type 1 :  Overwriting the old values.
Type 2 :  Creating an another additional record.
Type 3 :  Creating new fields.

More>>

What is Star Schema?
More>>

What are Snowflake schemas?
Snowflake schemas normalize dimensions to eliminate redundancy. That is, the dimension data has been grouped into multiple tables instead of one large table. For example, a location dimension table in a star schema might be normalized into a location table and city table in a snowflake schema. While this saves space, it increases the number of dimension tables and requires more foreign key joins. The result is more complex queries and reduced query performance.

More>>

Supervised vs. Unsupervised learning
In supervised learning, the classes are predetermined. The data  presented to a machine learning algorithm is fully labelled. eg. neural networks

In unsupervised learning, algorithm decides how to group samples into classes that share common properties. eg. Clustering

What is KPI?
KPI stands for Key Performance Indicator.
 In Analysis Services, KPI is a collection of calculations that are associated with a measure group in a cube that are used to evaluate business success.
KPIs are created from existing measures. However, not all measures are good candidates for KPI utilization.

What is pivot table?
A pivot table makes it easy to extract information from a large table of data without use of formulas or functions. Extracted data can be sorted, filtered. Viewing data as dimensions are possible.

What is ETL?
In data Warehouse, data from different source systems are integrated, processed and stored.  The ETL (Extraction, Transformation and Loading) process handles these data and transforms it into a more consistent, standard formatted data. This ETL process is done with the help of an ETL tool and most widely used tools are Informatica, Data Stage, Ab Inito, Oracle Warehouse Builder etc.

The first step in ETL process is mapping the data between source systems and target database(data warehouse or data mart). The second step is cleansing of source data in staging area. The third step is transforming cleansed source data and then loading into the target system.

ETL Tasks/ Data Transformations

Filtering - The data Filter Operation takes all the row values from the input dataset,  tests the value of a field in the row for one a condition, if the condition is false for the attribute value of the row, then we ignore the row else we pass the row into to the result dataset.

Data lookup - Performs lookups by joining data in input columns with columns in a reference dataset.

Derive columns - Values of a column retrieved using other columns

Data cleansing -  The process of resolving inconsistencies and fixing  the anomalies in source data, typically as part of the ETL process.

Data validation - Data types, formats(email, url, zip code)

What is Meta Data?
 Data that describes data and other structures, such as objects,  business rules, and processes.
Eg. the schema design of a  data warehouse .
A repository contains metadata.

Difference between Relational modeling and Multidimensional modeling

1. Relational models are complex due to joins with other tables. Multidimensional modeling are very simple. Each of the dimension table has a direct relationship with the fact table.

2. Relational models are mostly normalized. Multidimensional modeling are radically denormalized.

3. Standard relational models are optimized for On Line Transaction Processing. OLTP needs the ability to efficiently update data. This is provided in a normalized database that has each value stored only once.
Multidimensional modeling are optimized for On Line Analytical Processing. OLAP needs the ability to retrieve data efficiently. Efficient data retrieval requires a minimum number of joins. This is provided with the simple structure of relationship in a Multidimensional modeling, where each dimension table is only a single join away from the fact table.

4. SQL queries required to manipulate relational data. MDX queries required to manipulate multi-dimensional data

5. Tables are units of relational data storage. Cubes are units of multi-dimensional data storage.

What is a Gini index?
How impure a node is after splitting has occurred.

Author : Julian Pereira
Year : 2012

 







Version control is the art of managing changes to information. It has long been a critical tool for programmers, who typically spend their time making small changes to software and then undoing or checking some of those changes the next day. Imagine a team of such developers working concurrently - and perhaps even simultaneously on the very same files! - and you can see why a good system is needed to manage the potential chaos.

VisualSVN is a professional grade Subversion integration plug-in for Visual Studio.
Key benefits of VisualSVN are:
Unbeatable reliability: Visual Studio will never crash or hang because of VisualSVN.
Seamless integration: VisualSVN automatically handles added or renamed files and reflects these operations to Subversion.
Real-time status: VisualSVN carefully tracks and displays all the current changes made to your working copy.
Short learning curve: VisualSVN utilizes TortoiseSVN dialogs and provides a smart wizard to put your sources under Subversion.

TortoiseSVN is a free open-source Windows client for the Apache™ Subversion® version control system. That is, TortoiseSVN manages files and directories over time. Files are stored in a central repository. The repository is much like an ordinary file server, except that it remembers every change ever made to your files and directories. This allows you to recover older versions of your files and examine the history of how and when your data changed, and who changed it. This is why many people think of Subversion and version control systems in general as a sort of “time machine”. Some version control systems are also software configuration management (SCM) systems. These systems are specifically tailored to manage trees of source code, and have many features that are specific to software development - such as natively understanding programming languages, or supplying tools for building software. Subversion, however, is not one of these systems; it is a general system that can be used to manage any collection of files, including source code.

This tutorial demonstrates how to install VisualSVN and TortoiseSVN  client.






EAD EJB Lab









Project Proposal


SRS Document


Mid Review Document


Today we gonna build a simple MVC application using ASP.net MVC3 template. The tutorial does not intend to teach you ASP.net MVC3 framework. There are so many resources on the internet that might help you getting started with this technology. So we focus on building a simple application using models, views, controllers, filters and other ASP.net specific things. Remember  MVC is a design pattern and it can also be  implemented in other programing languages like PHP.
Final result

Book Mgmt


Download Project

1. Creating New Project
creating-project


creating-project



2. Folder Structure
directory structure


3. Changing the default controller.
You can change the default controller in Global.asax file by specifying the controller name and action method.
Changing the default controller


4. Adding Dojo files
We are using Dojo data grid for displaying data records. Therefore please download Dojo latest version and include them in Scripts folder.


5. Creating Book Modal
Right click on Models -> Add -> Class
Book.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
 
namespace BooksApp.Models
{
public class Book
{
public int Id { get; set; }
[Required]
public string Name { get; set; }
[Required]
public string Author { get; set; }
[Required]
public float Price { get; set; }
}
}
 
6. Creating BookFacade class For a real application database operations can be placed in this class. For the sake of simplicity we omit mapping entity to database. Right click on Models -> Add -> Class BookFacade.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using BooksApp.Models;
 
namespace BooksApp.Facade
{
public class BookFacade
{
public static List<Book> bookList { get; set; }
 
public static List<Book> GetBookList()
{
if (bookList == null)
{
bookList = new List<Book>();
for (int i = 0; i < 10; i++)
{
bookList.Add(new Book {Id = i, Name = "Book " + i, Author = "Author " + i, Price = i * 20 });
}
 
}
return bookList;
}
 
public static Book FindBook(int id)
{
var bookList = GetBookList();
return bookList.Find(x => x.Id == id);
}
 
public static void Add(Book book)
{
var bookList = GetBookList();
book.Id = bookList.Max(x => x.Id) + 1;
bookList.Add(book);
}
 
public static void Delete(int id)
{
var bookList = GetBookList();
Book book = bookList.Find(x => x.Id == id);
bookList.Remove(book);
}
 
}
}
7. Creating BookController Right click on Controllers-> Add -> Controller BookController
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BooksApp.Models;
using BooksApp.Facade;
using BooksApp.Filters;
 
namespace BooksApp.Controllers
{
public class BookController : Controller
{
//
// GET: /Book/
 
public ActionResult Index()
{
return View();
}
 
public ActionResult Create()
{
return View();
}
 
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(Book book)
{
if (book.Name.Length < 5)
{
ModelState.AddModelError("Book name", "Book name should have five or more characters.");
}
if (!ModelState.IsValid)
{
return View("Create",book);
}
BookFacade.Add(book);
return RedirectToAction("Index");
}
 
public ActionResult GetData(int id)
{
Book book = BookFacade.FindBook(id);
return View(book);
}
 
[RightChecker(AllowedBookIds = "5,6,7")]
public ActionResult Delete(int id)
{
Book book = BookFacade.FindBook(id);
if (book != null)
{
BookFacade.Delete(id);
}
return RedirectToAction("Index");
 
}
 
/////////////////////////AJAX/////////////////////////////
 
public ActionResult GetJSON()
{
return Json(BookFacade.GetBookList(), JsonRequestBehavior.AllowGet);
 
}
 
public ActionResult Ajax()
{
return View();
}
 
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create_AJAX(Book book)
{
BookFacade.Add(book);
return new EmptyResult();
}
 
}
}

Adding views
8. Adding Create View
 create view


<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<BooksApp.Models.Book>" %>
 
<!DOCTYPE html>
 
<html>
<head runat="server">
<title>Create</title>
</head>
<body>
<script src="<%: Url.Content("~/Scripts/jquery-1.5.1.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>
 
<% using (Html.BeginForm("Create","Book")) { %>
<%: Html.ValidationSummary(true) %>
<fieldset>
<legend>Book</legend>
 
<div>
<%: Html.LabelFor(model => model.Name) %>
</div>
<div>
<%: Html.EditorFor(model => model.Name) %>
<%: Html.ValidationMessageFor(model => model.Name) %>
</div>
 
<div>
<%: Html.LabelFor(model => model.Author) %>
</div>
<div>
<%: Html.EditorFor(model => model.Author) %>
<%: Html.ValidationMessageFor(model => model.Author) %>
</div>
 
<div>
<%: Html.LabelFor(model => model.Price) %>
</div>
<div>
<%: Html.EditorFor(model => model.Price)%>
<%: Html.ValidationMessageFor(model => model.Price)%>
</div>
 
<p>
<input type="submit" value="Create" />
</p>
</fieldset>
<% } %>
 
<div>
<%: Html.ActionLink("Back to List", "Index") %>
</div>
</body>
</html>

9. Adding GetData View


Get Data View





<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<BooksApp.Models.Book>" %>
 
<!DOCTYPE html>
 
<html>
<head runat="server">
<title>Book Details</title>
</head>
<body>
<fieldset>
<legend>Book</legend>
 
<div>Name</div>
<div>
<%: Html.DisplayFor(model => model.Name) %>
</div>
 
<div>Author</div>
<div>
<%: Html.DisplayFor(model => model.Author) %>
</div>
 
<div>Price</div>
<div>
<%: Html.DisplayFor(model => model.Price) %>
</div>
</fieldset>
<p>
 
<%: Html.ActionLink("Edit", "Edit", new { id=Model.Id }) %> |
<%: Html.ActionLink("Back to List", "Index") %>
</p>
</body>
</html>

10. Adding Index View


&lt;%@ Page Language=&quot;C#&quot; Inherits=&quot;System.Web.Mvc.ViewPage&lt;dynamic&gt;&quot; %&gt;
 
&lt;!DOCTYPE html&gt;
 
&lt;html&gt;
&lt;head runat=&quot;server&quot;&gt;
&lt;title&gt;Index&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
@import &quot;../../Scripts/dojo/dijit/themes/dijit.css&quot;;
@import &quot;../../Scripts/dojo/dojox/grid/resources/Grid.css&quot;;
@import &quot;../../Scripts/dojo/dojox/grid/resources/tundraGrid.css&quot;;
@import &quot;../../Scripts/dojo/dijit/themes/tundra/tundra.css&quot;;
&lt;/style&gt;
 
&lt;script type=&quot;text/javascript&quot; src=&quot;../../Scripts/dojo/dojo/dojo.js&quot;
djconfig=&quot;isDebug:false,  debugAtAllCosts:false&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;../../Scripts/dojo/dijit/dijit.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
 
&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
dojo.require(&quot;dojox.grid.DataGrid&quot;);
dojo.require(&quot;dojo.data.ItemFileWriteStore&quot;);
 
dojo.ready(function () {
 
DisplayAll();
});
 
function DisplayAll() {
 
var that = this;
 
// The parameters to pass to xhrGet, the url, how to handle it, and the callbacks.
var xhrArgs = {
url: &quot;../Book/GetJSON&quot;,
handleAs: &quot;json&quot;,
preventCache: true,
load: function (data, ioargs) {
that.PopulateGrid(data); //This will populate the grid
},
error: function (error, ioargs) {
alert(ioargs.xhr.status);
}
 
}
 
// Call the asynchronous xhrGet
 
dojo.xhrGet(xhrArgs);
}
 
function PopulateGrid(store) {
 
var jsonString = &quot;{identifier: \&quot;Id\&quot;, items: &quot; + dojo.toJson(store) + &quot;}&quot;;  //Creates the Json data that supports the grid structure. The identifier value should be unique or errors will be thrown
 
var dataStore = new dojo.data.ItemFileReadStore({ data: dojo.fromJson(jsonString) }); //Converts it back to an object and set it as the store
 
/*set up layout of the grid that will be columns*/
var gridStructure = [
{ field: 'Id', name: 'Book Id', styles: 'text-align: center;', width: 20 },
{ field: 'Name', name: 'Name', width: 20 },
{ field: 'Author', name: 'Author', width: 20 },
{ field: 'Price', name: 'Price', width: 30} //&quot;field&quot; matches to the JSON objects field
];
/*create a new grid:*/
 
var bookGrid = dijit.byId('gridS');
if (bookGrid == null) { //Only create a grid if there grid already created
var grid = new dojox.grid.DataGrid({
id: 'gridS',
store: dataStore,
structure: gridStructure,
rowSelector: '30px',
height: '300px'
},
&quot;gridDivTag&quot;); //The div tag that is used to place the grid
/*Call startup() to render the grid*/
grid.startup();
}
else {
 
bookGrid._refresh();
bookGrid.setStore(dataStore); //Setting the new datastore after entering new data
}
 
}
 
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div&gt;
&lt;h1&gt;Welcome to Book Management Section&lt;/h1&gt;
&lt;% //HtmlAnchor %&gt;
 
&lt;div id=&quot;gridDivTag&quot;&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;%: Html.ActionLink(&quot;Add New&quot;, &quot;Create&quot;) %&gt;
&lt;%: Html.ActionLink(&quot;Ajax Call&quot;, &quot;Ajax&quot;) %&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
11. Adding AJAX ViewI wanna create this view just to demonstrate AJAX operations with ASP.NET MVC3
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
 
<!DOCTYPE html>
 
<html>
<head id="Head1" runat="server">
<title>Ajax</title>
<style type="text/css">
@import "../../Scripts/dojo/dijit/themes/dijit.css";
@import "../../Scripts/dojo/dojox/grid/resources/Grid.css";
@import "../../Scripts/dojo/dojox/grid/resources/tundraGrid.css";
@import "../../Scripts/dojo/dijit/themes/tundra/tundra.css";
.style1
{
width: 134px;
}
</style>
 
<script type="text/javascript" src="../../Scripts/dojo/dojo/dojo.js" djconfig="isDebug:false,  debugAtAllCosts:false"></script>
<script src="../../Scripts/dojo/dijit/dijit.js" type="text/javascript"></script>
 
<script language="javascript" type="text/javascript">
dojo.require("dojox.grid.DataGrid");
dojo.require("dojo.data.ItemFileWriteStore");
 
dojo.ready(function () {
 
DisplayAll();
});
 
function book() {
this.Name = dojo.byId("name").value;
this.Author = dojo.byId("author").value;
this.Price = dojo.byId("price").value;
}
function addBook_post() {
var bookObj = new book();
 
var xhrArgs = {
url: "../Book/Create_AJAX",
headers: { //Adding the request headers
"Content-Type": "application/json; charset=utf-8" // This is important to model bind to the server
},
postData: dojo.toJson(bookObj, true), //Converting the object in to Json to be sent the action method
handleAs: "json",
load: function (data) {
DisplayAll();
 
},
error: function (error) {
alert('error');
}
}
 
dojo.xhrPost(xhrArgs);
}
 
function DisplayAll() {
 
var that = this;
 
// The parameters to pass to xhrGet, the url, how to handle it, and the callbacks.
var xhrArgs = {
url: "../Book/GetJSON",
handleAs: "json",
preventCache: true,
load: function (data, ioargs) {
that.PopulateGrid(data); //This will populate the grid
},
error: function (error, ioargs) {
alert(ioargs.xhr.status);
}
 
}
 
// Call the asynchronous xhrGet
 
dojo.xhrGet(xhrArgs);
}
 
function PopulateGrid(store) {
 
var jsonString = "{identifier: \"Id\", items: " + dojo.toJson(store) + "}";  //Creates the Json data that supports the grid structure. The identifier value should be unique or errors will be thrown
 
var dataStore = new dojo.data.ItemFileReadStore({ data: dojo.fromJson(jsonString) }); //Converts it back to an object and set it as the store
 
/*set up layout of the grid that will be columns*/
var gridStructure = [
{ field: 'Id', name: 'Book Id', styles: 'text-align: center;', width: 20 },
{ field: 'Name', name: 'Name', width: 20 },
{ field: 'Author', name: 'Author', width: 20 },
{ field: 'Price', name: 'Price', width: 30} //"field" matches to the JSON objects field
];
/*create a new grid:*/
 
var bookGrid = dijit.byId('gridS');
if (bookGrid == null) { //Only create a grid if there grid already created
var grid = new dojox.grid.DataGrid({
id: 'gridS',
store: dataStore,
structure: gridStructure,
rowSelector: '30px',
height: '300px'
},
"gridDivTag"); //The div tag that is used to place the grid
/*Call startup() to render the grid*/
grid.startup();
}
else {
 
bookGrid._refresh();
bookGrid.setStore(dataStore); //Setting the new datastore after entering new data
}
 
}
 
</script>
</head>
<body >
<form id="form1" runat="server">
<div>
<h1>Welcome to Book Management Section</h1>
 
<div id="gridDivTag"></div>
<br /><br />
 
<table style="width: 400px;">
<caption>
Add New Book</caption>
<tr>
<td>
&nbsp;
Name</td>
<td>
&nbsp;
<input id="name" type="text" />
</td>
</tr>
<tr>
<td>
&nbsp;
Author</td>
<td>
&nbsp;
<input id="author" type="text" />
</td>
</tr>
<tr>
<td>
&nbsp; Price</td>
<td>
&nbsp;
<input id="price" type="text" />
</td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
<input id="add_post" type="submit" value="Add Via Post" onclick="addBook_post()" />
 
</td>
</tr>
</table>
 
<br /><br />
<%: Html.ActionLink("Add New", "Create") %>      <%: Html.ActionLink("Ajax Call", "Ajax") %>
</div>
</form>
</body>
</html>
strong>Sample testing links
http://localhost:3616/
http://localhost:3616/Book/Create
http://localhost:3616/Book/Ajax
http://localhost:3616/Book/GetData/1
http://localhost:3616/Book/GetJSON
Obviously port number may change according to your environment.

ITPM Past Papers - Final/Repeat

Mid Term Past Papers

2011

2012

Greylevel transforms


[Applet Courtesy : http://www.imageprocessingbasics.com]
Copyright © 2012 SLIIT Helper.