Posts

Showing posts from August, 2014

ViewData vs ViewBag vs TempData vs Session

Image
In MVC there are three ways - ViewData, ViewBag and TempData to pass data from controller to view . We can also use Session to persist data during a user session. ViewData ViewData is a dictionary object that is derived from ViewDataDictionary class.      public ViewDataDictionary ViewData { get; set; } ViewData is a property of ControllerBase class. ViewData is used to pass data from controller to corresponding view. It’s life lies only during the current request. If redirection occurs then it’s value becomes null. It’s required typecasting for getting data and check for null values to avoid error. ViewBag ViewBag is a dynamic property that takes advantage of the new dynamic features in C# 4.0. Basically it is a wrapper around the ViewData and also used to pass data from controller to corresponding view.      public Object ViewBag { get; } ViewBag is a property of ControllerBase class. It’s life also lies only during the curren...

Augmented Reality

Steps To Follow 1.Go to the site https://developer.vuforia.com - Register and then login 2. In Target Manager Create Database, Add the target to the dataset. (Add width of the image. Image size will be width*Height)The no. of stars indicate the level to which the target can be augmented. 0 stars indicate the target cannot be augmented. 3. Select download to download the dataset to the unity editor 4. Go to unity, right click Assets->Import Package-> Custom Packages select all and click import 5. Select AR Camera and select the dataset and the target image. 6.Check the below checkboxes. · load dataset name · activate To Augment an object: 1. Go to Assets->Qualcom Augmented Reality->Prefab->Image Target 2. Drag and drop Image target to Hierarchy 3. From the Image target Behaviour select Dataset and Image Target 4. Create a gameobject(cube) as a child of image target, scale it to the required size. To Augment a Video: 1. Add vid...

Unity 3D

What is Unity3D? Unity3D is a powerful cross-platform 3D engine and a user friendly development environment. Easy enough for the beginner and powerful enough for the expert; Unity should interest anybody who wants to easily create 3D games and applications for mobile, desktop, the web, and consoles. Creating a Prefab A Prefab is a stored collection containing one or more complete GameObjects with components attached and properties set. Prefabs are asset types, so they do not appear in the scene in their own right. However, they can be used to create instances of the stored objects in the scene. Each instance is a copy of the original prefab. For example, you might use a prefab to store a tree object and then create many instances of the tree in a forest scene. By default, changes made to the prefab are automatically applied to all the instances, and so using prefabs can be a good way to maintain consistency among a set of objects. However, you can also break the link between the i...

Filters Using Dataset and Dataview

Using Dataset filtering the data and merging it to the same Dataset ds = Select * from Query; QryStr = "ID =" + 3; DataSet dsview = new DataSet(); dsview = ds; DataRow[] dr = dsview.Tables[1].Select(QryStr); if (dr.Length > 0) {      DataTable dt = dsview.Tables[1].Select(QryStr).CopyToDataTable();      ds.Tables[1].Clear();     ds.Tables[1].Merge(dt); } Using Dataview filtering the data  ds = Select * from Query; DataView dvstatus = new DataView(ds.Tables[0]); string QryStr = string.Empty; QryStr = "ID = 2 " + " Or ID = 3" + " Or ID = 7"; dvstatus.RowFilter = QryStr;  if (dvstatus.Count > 0) {    ddlStatus.DataSource = dvstatus;    ddlStatus.DataBind; }