Saturday, August 30, 2008

Android apps store - by Google

Its a new lime way of Google, on Thursday Google walks to start application store similiar to iPhone's App, this storeis for Android apps.

Actually, I am also very much beginner to this one as anyone else.

To more in details please visit:

Android Developers Blog

http://www.infoworld.com/archives/emailPrint.jsp?R=printThis&A=/article/08/08/28/Google_introduces_Android_apps_store_1.html

Please share your update knowledge about technical news.

Sunday, August 10, 2008

MicroSoft's Greatest Release : SQL Server 2008

On Wednesday MicroSoft releases SQL Server 2008 .

This is the great invention to the older ones' like SQL Server 2000 and SQL Server 2005. But, all the work is not put ahead Microsoft on top in the Warehouse Market. There are still Oracle, IBM abd TeraData.

For viewers and MicroSoft Well-wishers [like me...] are very much happy to read this news.

Lets share the news and celebaret the among our world.

For more info visit :
http://www.informationweek.com/shared/printableArticle.jhtml?articleID=209903873

Classes and Structures

Lets take these in general words, these are template from which you define object to access their functionalities. The programmers of C++ and Java are well aware from these two names. Till now from above reading you new that Classes are reference type and structures are value type so they are stored on Heap and Stack respectively in memory.

Structures
A structure in C# is simply a composite data type [you are well aware from composite data type, refer to data types for more details], which consists number of members of other types. The structure define simply by using the struct keyword



struct enroll
{
public string name, fname, mname;
public string char sex;
Public int age;
public string address;
}




Important points towards structures

There are some points towards structures:
1. Structures are C# composite data types
2. By default like classes structures are public
3. Sealed and Abstract modifiers cant applicable on structures
4. Structures have no inheritance features
5. A variable of structure type contains all the data of structure
6. Structures cant allow a destructor
7. By default C# provides a constructor with no parameter, but explicitly you cant use and replace it.
8. Initializations of fields are not allowed.


Classes
It is cleared from above study that Classes are reference type. A class is a collection of its data members. Data members are those members of class which contains the data of class like fields, constants and events etc. Class is declared simply just followed by class keyword with optional modifiers; by default C# classes are public.



class myClass
{
public int xyz;
public string name;
public const int y=22;
}







In above, all members are public, when we declare members we can optionally supply modifiers, in C# all class members private by default.



/* This Example is a part of different
* examples shown in Book:
* C#2005 Beginners: A Step Ahead
* Written by: Gaurav Arora
* Reach at : gaurav.aroraose@yahoo.co.in*/
// File name : classstructue.cs
using System;
namespace CSharp.AStepAhead.classstructue
{
class enroll
{
string name, fname;
int age;
char sex;
void getInfo()
{
Console.WriteLine("Enter Name: ");
name = Console.ReadLine();
Console.WriteLine("Enter Father Name: ");
fname = Console.ReadLine();
Console.WriteLine("Enter age: ");
age = int.Parse(Console.ReadLine());
Console.WriteLine("Enter Sex [Male -m, Female - f]: ");
sex = char.Parse(Console.ReadLine());
}
void showInfo()
{
Console.Clear();
Console.WriteLine("You have provided following information(s): \n");
Console.WriteLine(" Name : {0}\n Father Name : {1}\n Age : {2}\n Sex : {3}", name, fname, age, sex);
Console.ReadLine();
}
static void Main()
{
//Create an object of class
enroll objEnroll = new enroll();
objEnroll.getInfo();
objEnroll.showInfo();
}
}
}



Moonlight : Handles Silverlight Application in Unix

As you knew that Mono project provides the platform to run .Net application on UNIX. Now, there is a new term Silverlight in the field of .Net so, what about the UNIX fellows.
Will they stand alone?
No, Mono has decided to plan Moonlight which runs on Unix for Silverlight.

To do the same:
-One need SDK
-Build Silverlight program

For more detail please visit: http://www.mono-project.com/Moonlight

Mono Project - CAS

I have very little idea about Mono Project, it is a Software platform which helps to develop cross-platform applications. This is a great one helps us to run .net on Unix.
It has C# Compiler http://www.mono-project.com/CSharp_Compiler, Mono Runtime http://www.mono-project.com/Mono:Runtime,
These all are as per ECMA http://www.mono-project.com/ECMA
In Version Mono 1.2 there is no security model like CAS – Code Access Security, but in future version Mono will be with CAS.

For more information please visit : http://www.mono-project.com/CAS

World’s costlier computer: Human Being

Teacher: Tell me the name of cheapest computer in the universe
KMG: Human Being
There is whispering in class, teacher also shocked.
Teacher: What are you saying? How?
KMG: I am right mam
There are noises in the class and teacher is in angry mood
Teacher [strictly]: You are wrong, sit down.
KMG: I can prove it mam
Teacher: I said, sit down. Otherwise you will punish.
KMG: No, mam let me prove:
-Humans have CPU: their brain
-Humans have vision: their eyes
-Humans also need resources: Glucose, air, water etc.
-Humans have voice: Can communicate in different languages
There is silence in class, teacher asked suddenly
Teacher: Ok, Ok but how it is cheap.
KMG: Humans have heart: No computer has heart
Heart pumps 24X7 and then its CPU work and functioning. It’s absolutely free.
Neuron system developed on the basis of human CPU
Teacher: Yes, yes
Suddenly, another student interfere
Pankaj: No, mam it’s not cheaper. It is costlier in compare to Computers
It creates noise
It creates pollution
It cuts greenery
It makes bombs
It creates partitions between regions
Today, brain is heavy on heart and nobody control it.
Mam, Human-being knew there is no life without Greenery, Air, Sun, Water, they knew piece is the best, then why they are playing with their lives.
Teacher: Pankaj, this is not our subject.
KMG: No, mam, its. Sorry, mam, I was wrong Pankaj is right. Is it possible to control human-being like Operator can control computers.
Teacher: silence
Pankaj: Mam, we are growing we need piece, greenery and want to be cheaper computer in the world
Teacher: Right
KMG: If you knew it then why don’t you teach others?
Teacher: Again silence
Pankaj: Are they big student mam?
Teacher: Don’t know who will teach them or how they will learn all these? But, till that day “World’s Costlier Computer is Human-Being”.

There are lots of questions in the mind of students, which can easily be ignored. But, what about you.

Think it again and again…..

Tuesday, August 5, 2008

Got Editor's Choice Award

I am feeling great to share good news with all of you. I got the prestigious award from dotnetspider, this is a prestigious award in the life of any Technical guy. This is the golden day in my life.

I am very much thankful to the community to choose me for such a great honor. For more info please Visit this page for the list of winners - http://www.dotnetspider.com/credits/Index.aspx.

Monday, August 4, 2008

A Simple VideoPlayer Custom COntrol - Uses in application

In my previous post, I have presented a Video Player Custom control which plays all type of streaming media. Now, here I am presenting a simple way to apply the same custom control in web application.

File Name : VideoPLayerCustomControl.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="VideoPLayerCustomControl.aspx.cs"
Inherits="VideoPLayerCustomControl" %>

<%@ Register TagPrefix="whPlayer" TagName= "vaPlayer" Src="~/videoPlayer.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Video Player Using Custom Control</title>
</head>
<body>
<form id="form1" runat="server">
<div align="center">
<whPlayer:vaPlayer ID="videoPlayer" autoStart="true" runat="server" />
<br />
<asp:ValidationSummary id="valSumm" runat="server" />
<asp:Label ID="lblVideoName" Text="Enter Video Name" runat ="server" />
<asp:TextBox ID="txtVideoName" runat="server" EnableViewState="true" Text="D:\Videos\AVSEQ06.DAT" />
<asp:Button ID="btnPlayVide" runat="server" OnClick="btnPlayVide_Click" Text="Play Video" />
<asp:RequiredFieldValidator id="rfvtxtVideoName" ControlToValidate="txtVideoName" text="*" ErrorMessage="Please eneter Video to play" runat="server" />

</div>
</form>
</body>
</html>
File Name : VideoPLayerCustomControl.aspx.cs
/* This Example is a part of different
* examples shown in Book:
* C#2005 Beginners: A Step Ahead
* Written by: Gaurav Arora
* Reach at : g_arora@hotmail.com */
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class VideoPLayerCustomControl : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["sourceUrl"] != null)
this.videoPlayer.sourceUrl = Convert.ToString(Request.QueryString["sourceUrl"]);

videoPlayer.autoStart = true;
videoPlayer.height = "300";
videoPlayer.width = "300";
}

protected void btnPlayVide_Click(object sender, EventArgs e)
{
if(IsValid)
Response.Redirect("videoplayercustomcontrol.aspx?sourceUrl=" + txtVideoName.Text);

}
}

Steps to run the application
1. Open VS2005
2. Select New Web application

3. Add new Page from existing pages and browse to attachment
4. Run the applcation by prssing F5

OR

3. If not want to add new page just copy and paste the content from above, code(s)
4. Make sure all contents would be copied and then press F5

and then Enjoy the video...

A VideoPlayer - Custom Control

Some day ago, I have faced a little problem to show streaming contents on my Web-Projects, I have gone through many R & d’s and then decided to write a custom control for the same, then I have written a custom control.

Here, the same, I want to share with you:
File Name : videoPlayer.ascx

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="videoPlayer.ascx.cs" Inherits="videoPlayer" %>
<asp:PlaceHolder ID="phError" runat="server" Visible="false">
<%asp:Label ID="lblError" runat="server" ForeColor="Red" Text="Error" />
</asp:PlaceHolder>
<asp:Table ID="tblPlayer" runat="server" BorderWidth="1">
<asp:TableRow>
<asp:TableCell>
<asp:Literal ID="ltVideo" runat="server" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>

Now, lets start to write code-behind as follows:
File Name : videoPlayer.ascx.cs

/* This Example is a part of different
* examples shown in Book:
* C#2005 Beginners: A Step Ahead
* Written by: Gaurav Arora
* Reach at : g_arora@hotmail.com */
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class videoPlayer : System.Web.UI.UserControl
{
#region Properties to customize the Video/Audio Control

///
/// true:FullScreen, false:CustomSize
///
public Boolean isFullSize
{
set
{
ViewState["isFullSize"] = value;
}
get
{
if (ViewState["isFullSize"] != null)
return Convert.ToBoolean(ViewState["isFullSize"]);
else
return true;
}
}
///
/// Full url-path of Video/Audio
///
public String sourceUrl
{

set
{
ViewState["sourceUrl"] = value;
}
get
{
if (ViewState["sourceUrl"] != null)
return Convert.ToString(ViewState["sourceUrl"]);
else
return "http://www.video.com/myVideo.mpeg"; //Default video

}

}
///
/// width of player
///
public String width
{
set
{
ViewState["width"] = value;
}
get
{
if (ViewState["width"] != null)
return Convert.ToString(ViewState["width"]);
else
return "640";
}
}
///
/// Height of player
///
public String height
{
set
{
ViewState["height"] = value;
}
get
{
if (ViewState["height"] != null)
return Convert.ToString(ViewState["height"]);
else
return "480";
}
}
///
/// Custom message when player initializes
///
public String standByMessage
{
set
{
ViewState["standByMessage"] = value;
}
get
{
if (ViewState["standByMessage"] != null)
return Convert.ToString(ViewState["standByMessage"]);
else
return "Please wait while the player inializes...";
}
}
///
/// States whether media automatic starts or not
///
public Boolean autoStart
{
set
{
ViewState["autoStart"] = value;
}
get
{
if (ViewState["autoStart"] != null)
return Convert.ToBoolean(ViewState["autoStart"]);
else
return true;
}
}
///
/// -100 is fully left, 100 is fully right.
///
public String balance
{
set
{
ViewState["balance"] = value;
}
get
{
try
{
if (ViewState["balance"] != null)
return Convert.ToString(ViewState["balance"]);
else
return "0";
}
catch
{
return "0";
}
}
}
///
/// Position in seconds when starting.
///
public Int32 currentPosition
{
set
{
ViewState["currentPosition"] = value;
}
get
{
if (ViewState["currentPosition"] != null)
return Convert.ToInt32(ViewState["currentPosition"]);
else
return 0;
}
}

///
/// Show play/stop/pause controls
///
public Boolean showcontrols
{
set
{
ViewState["showcontrols"] = value;
}
get
{
if (ViewState["showcontrols"] != null)
return Convert.ToBoolean(ViewState["showcontrols"]);
else
return true;
}
}
///
/// Allow right-click
///
public Boolean contextMenu
{
set
{
ViewState["contextMenu"] = value;
}
get
{
if (ViewState["contextMenu"] != null)
return Convert.ToBoolean(ViewState["contextMenu"]);
else
return false;
}
}
///
/// Toggle sound on/off
///
public Boolean mute
{
set
{
ViewState["mute"] = value;
}
get
{
if (ViewState["mute"] != null)
return Convert.ToBoolean(ViewState["mute"]);
else
return false;
}
}
///
/// Number of times the content will play
///
public Int32 playCount
{
set
{
ViewState["playCount"] = value;
}
get
{
if (ViewState["playCount"] != null)
return Convert.ToInt32(ViewState["playCount"]);
else
return 1;
}

}
///
/// 0.5=Slow, 1.0=Normal, 2.0=Fast
///
public Double rate
{
set
{
ViewState["rate"] = value;
}
get
{
if (ViewState["rate"] != null)
return Convert.ToDouble(ViewState["rate"]);
else
return 1.0;
}
}
///
/// full, mini, custom, none, invisible
///
public String uiMode
{
set
{
ViewState["uiMode"] = value;
}
get
{
if (ViewState["uiMode"] != null)
return Convert.ToString(ViewState["uiMode"]);
else
return "Full";
}
}
///
/// Show or hide the name of the file/url
///
public Boolean showDisplay
{
set
{
ViewState["showDisplay"] = value;
}
get
{
if (ViewState["showDisplay"] != null)
return Convert.ToBoolean(ViewState["showDisplay"]);
else
return false;
}
}

///
/// 0=lowest, 50= normal, 100=highest
///
public Int32 volume
{
set
{
ViewState["volume"] = value;
}
get
{
if (ViewState["volume"] != null)
return Convert.ToInt32(ViewState["volume"]);
else
return 50;
}
}

#endregion

protected void Page_Load(object sender, EventArgs e)
{

try
{
ltVideo.Text = this.VideoPlayer(this.sourceUrl, this.isFullSize);
}
catch (Exception ex)
{
lblError.Text = ex.ToString();
phError.Visible = true;
}
}

#region VideoPlayer
///
/// Return the whPlayer to Play Video/ Audio Content
///
/// Source of content
/// Size of Player
///
private string VideoPlayer(string strsourceUrl, bool boolFullSize)
{
string whPlayer = "";
strsourceUrl = strsourceUrl + "";
strsourceUrl = strsourceUrl.Trim();

if (strsourceUrl.Length < 0)
{
//play content
}
else
{
throw new System.ArgumentNullException("strsourceUrl");
}


if (boolFullSize)
{
//this.width = String.Empty;
//this.height = String.Empty;
this.width = "800";
this.height = "600";
}
else
{
//continue with supplied width/height
}

whPlayer = whPlayer + "";

return whPlayer;
}
#endregion
}

In Next article, I will tell you how to use the VideoPlayer Custom Control?

Sunday, August 3, 2008

Really Midori supersedes Windows?

I have got news from one of my reader that in future there will be a new name Midori instead of Windows. Till today there is no official definition for Midori but Midori is a componentized and a non-windows operating system.

So, let’s prepare for a new upcoming era. I want to share the news with all of you, just visit: Microsoft prepares for end of Windows with Midori