Monday, March 24, 2008

Google AJAX Language API

What is the Google AJAX Language API?

With the AJAX Language API, you can translate and detect the language of blocks of text within a webpage using only Javascript.

more info

Monday, March 17, 2008

Android

Android is a software stack for mobile devices that includes an operating system, middleware and key applications. This early look at the Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.

 

http://code.google.com/android/what-is-android.html

http://www.helloandroid.com/node/258

Song Bird- Play music. Play the Web.

     

Songbird is a desktop media player mashed-up with the Web. Songbird is committed to playing the music you want, from the sites you want, on the devices you want, challenging the conventions of discovery, purchase, consumption and organization of music on the Internet.

Songbird is a player and a platform. Like Firefox, Songbird is an open source, Open Web project built on the Mozilla platform. Songbird provides a public playground for Web media mash-ups by providing developers with both desktop and Web APIs, developer resources and fostering Open Web media standards, to wit, an Open Media Web.

 

more info

SQL Prompt™ Latest version: 3.6.0 Intelligent code completion for SQL Server

 

SQL Prompt automates the retrieval of database object names, syntax and snippets as you write, intelligently offering only appropriate code choices. In addition to displaying the object creation-SQL script, SQL Prompt is highly customizable so you can make it perform exactly the way you want.

Using SQL Prompt will improve your productivity and dramatically reduce your time at the keyboard. See the animation below displaying a typical scripting event and how much effort and time SQL Prompt can save you.

more info

Friday, March 14, 2008

Detect application launched from command window

recently one in experts -exchange asked me how to detect application launched from command window.

 


   1: static void Main(string[] args)
   2: {
   3:     foreach (string arg in args)
   4:     {
   5:  
   6:         MessageBox.Show(arg);
   7:  
   8:     }
   9:  
  10:     Application.EnableVisualStyles();
  11:     Application.SetCompatibleTextRenderingDefault(false);
  12:     Application.Run(new Form1());
  13:  
  14:  
  15:    
  16: }

 


image


pass the parameters from the command window..this feature can be used to load the program based on various environment settings

Tuesday, March 11, 2008

BlackBerry Plug-in for Microsoft Visual Studio

BlackBerry® offers leading wireless solutions, providing access to a wide range of applications on a variety of BlackBerry smartphones, as well as BlackBerry enabled devices around the world. BlackBerry wireless solutions combine wireless devices with software and services to keep mobile professionals connected to the people, data and resources that drive their day.

 

BlackBerry Plug-in for Microsoft Visual Studio

The BlackBerry® Plug-in for Microsoft® Visual Studio® allows enterprise developers and system integrators to leverage existing Microsoft® based developer tools to wirelessly enable applications for BlackBerry® smartphones. It lets developers working within a .NET programming environment use their development tool of choice, while still taking advantage of the benefits of the BlackBerry® Mobile Data System (BlackBerry MDS). They can enjoy simplified wireless application development, deployment and management for the enterprise.

more info

Thursday, March 06, 2008

COALESCE() accepts a series of values and a value to use in the event that all items in the list are null; then, it returns the first not-null value. This tip describes two creative uses of the COALESCE() function in SQL Server.

this functionis very much usefull in building a comma seprated strings which i used in my project

i used this functions to get all the id's based on a common value




declare @oid varchar(8000)

SELECT @oid = COALESCE(@oid +',', '') +convert(varchar(1000),ConsumerOrderids )
from ConsumerOrderInfowhere consumerid = 124

select @orderdetailsid


the output was
1001,1002,1003

Sunday, November 25, 2007

Microsoft Popfly

 

Popfly is the fun and easy way to build and share mashups, gadgets, and Web pages. It’s made up of online visual tools for building Web pages and mashups and a social network where you can host, share, rate, comment and even remix creations from other Popfly users.

Add some fun to your Facebook page, web site, or Windows Live Spaces page. You can easily spice up your Web site or blog with Popfly by adding customized games like Whack-a-mole or asteroids with pictures of your friends and family or create custom quizzes or polls that you can easily embed on your Web site.

Build a home page. You can build a custom home page, say for your school’s sports team and choose from over 150 different themes, 10 styles, and 30 unique color themes for a unique visual design. You can then easily add things like team photos, a team schedule from an RSS feed, video from previous games, Virtual Earth maps with directions to game locations and more, all without writing code.

Mix and re-mix photos and videos. Popfly makes it easy to create and share beautiful slideshows using pictures from Flickr, Windows Live Spaces, Facebook or to embed a podcast or a video player hosting videos from Soapbox or YouTube and share it on your Facebook profile, Windows Live Spaces page, or any Web page.

Unify your online personality. Popfly enables you to customize and stitch together your online persona in one place. You can create mashups that show what you dug on Digg.com, what you are buying or selling on eBay, you Halo 3 game scores, what Facebook events you’re attending, what your friends are doing on Twitter, and much more. 

In addition, Popfly offers a powerful web programming environment and social network so you can bring in new data sources, create new ways to display information, or even create and share full Visual Studio projects.

Tuesday, November 20, 2007

Selecting a single radio button inside a grid view

the below code will explain how to change your code for selecting a single radio button inside a grid view.

by default we can select multiple radio buttons inside a grid view.to make it a single selection we need to add a script..

below code explain that


  1 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="CategoryID" DataMember="DefaultView" DataSourceID="SqlDataSource1"> 
  2 <Columns> 
  3 <asp:TemplateField> 
  4 <ItemTemplate> 
  5 <input type="radio" runat="server" id="rdOption" onclick="SelectOne(this,'GridView1')"  VALUE="rdo" /> 
  6 </ItemTemplate> 
  7 <HeaderStyle CssClass="Head" /> 
  8 <ItemStyle CssClass="Item" />
  9 </asp:TemplateField> 
 10
 11 <asp:BoundField DataField="CategoryID" HeaderText="CategoryID" InsertVisible="False" ReadOnly="True" SortExpression="CategoryID" > 
 12 <HeaderStyle CssClass="Head" /> 
 13 <ItemStyle CssClass="Item" /> 
 14 </asp:BoundField> 
 15
 16 <asp:BoundField DataField="CategoryName" HeaderText="CategoryName" SortExpression="CategoryName" > 
 17 <ItemStyle CssClass="Item" /> 
 18 <HeaderStyle CssClass="Head" /> 
 19 </asp:BoundField> 
 20 </Columns> 
 21 </asp:GridView>


add the following javascript

  1 <script language="javascript"> 
  2
  3 function SelectOne(rdo,gridName) 
  4 { 
  5    all=document.getElementsByTagName("input"); 
  6    for(i=0;i<all.length;i++) 
  7    { 
  8      if(all[i].type=="radio") 
  9      { 
 10         var count=all[i].name.indexOf(gridName+'$ctl' ); 
 11         if(count!=-1) 
 12         { 
 13            all[i].checked=false; 
 14         } 
 15       } 
 16     } 
 17    rdo.checked=true; 
 18 } 
 19 </script>


the Script will be called in the on click event of the radio button in the grid

Monday, October 01, 2007

The Write Less, Do More, JavaScript Library..Jquery



jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript.

What jQuery Does

The jQuery library provides a general-purpose abstraction layer for common web scripting, and is therefore useful in almost every scripting situation. Its extensible nature means that we could never cover all possible uses and functions in a single book, as plug-ins are constantly being developed to add new abilities.

The core features, though, address the following needs:

1.Access parts of a page.

2.Modify the appearance of a page.

3.Alter the content of a page.

4.Respond to a user's interaction with a page.

5.Add animation to a page

6.Retrieve information from a server without refreshing a page.
(AJAX)

7.Simplify common JavaScript tasks.

more info -

http://jquery.com/
http://15daysofjquery.com/
http://jquery.com/blog/

Monday, September 24, 2007

Developer Extension To Mozilla

The Web Developer extension adds a menu and a toolbar to the browser with various web developer tools. It is designed for Firefox, Flock, Mozilla and Seamonkey, and will run on any platform that these browsers support including Windows, Mac OS X and Linux.

Monday, September 17, 2007


Speed up your web pages with YSlow a tool from Yahoo Developer Network

YSlow analyzes web pages and tells you why they're slow based on the rules for high performance web sites.

YSlow is a Firefox add-on integrated with the popular Firebug web development tool.

YSlow gives you:

* Performance report card
* HTTP/HTML summary
* List of components in the page
* Tools including JSLint

more info...

Thursday, September 06, 2007

Find string between and xml or html string

 
The following code can be usefull to search a string with in an html tag
 
private string ParseHtml(string strInput, string key)
{
string returnValue = string.Empty;

int startIndex = strInput.ToUpper().IndexOf("<" + key.ToUpper() + ">");

int endIndex = strInput.ToUpper().IndexOf("</" + key.ToUpper() + ">");

if(startIndex != -1 && endIndex != -1)

{

returnValue = strInput.Substring(startIndex + (key.Length + 2), endIndex - (startIndex + (key.Length + 2))).ToString();
}

return returnValue;

}

 


string str = "<from>jeebu@abc.com</from>";

MessageBox.Show(ParseHtml(str ,"from"));

will return jeebu@abc.com

Tuesday, August 14, 2007

Proud to be an indian

Celeberating 60th year of indian independence

Sunday, July 15, 2007

Web 2.0 Busy Dialog Box

The below created code will help in showing a loading form when a busy server process is going on

it will also disable all the controls in the form so that the server process is not interpreted.

All the javascript,css codes are embedded in js and css file

   1: <LINK href="style.css" type="text/css" rel="stylesheet">
   2: <SCRIPT language="JavaScript" src="loader.js"></SCRIPT>

Style.css


 



   1: BODY 
   2: { 
   3:     PADDING-RIGHT:  0px; 
   4:     PADDING-LEFT:   0px; 
   5:     PADDING-BOTTOM: 0px; 
   6:     MARGIN:         0px; 
   7:     PADDING-TOP:    0px 
   8: } 
   9:  
  10: #BackGroundFade 
  11: { 
  12:      DISPLAY: none; 
  13:      FILTER:  alpha(opacity=80); 
  14:      LEFT:    0px; 
  15:      WIDTH:   100%; 
  16:      POSITION: absolute; 
  17:      TOP: 0px; 
  18:      BACKGROUND-COLOR: #ffffff; 
  19:      opacity: 0.8 
  20: } 
  21:  
  22: #ForeGroundActive 
  23: { 
  24:    FILTER: alpha(opacity=60); 
  25:    BORDER-RIGHT: #000000 0px solid; 
  26:    BORDER-TOP: #000000 0px solid; 
  27:    LEFT: 0px; 
  28:    BORDER-LEFT: #000000 0px solid; 
  29:    WIDTH: 300px; 
  30:    BORDER-BOTTOM: #000000 0px solid; 
  31:    POSITION: absolute; 
  32:    TOP: 0px; 
  33:    HEIGHT: 300px; 
  34:    BACKGROUND-COLOR: #ffffff;
  35:    opacity: 0.8 
  36: } 
  37:  
  38: .LoadingText
  39: {
  40:   FONT-SIZE: 11px;
  41:   COLOR: #6c7473;
  42:   FONT-FAMILY: arial
  43: }
  44:  
  45: .Text
  46: {
  47:   FONT-SIZE: 11px;
  48:   FONT-FAMILY: arial;
  49:   COLOR: #6c7473
  50: }

Loader.js



   1: var loader = new Image();
   2: loader.src = "rollera.gif";
   3:   
   4: function Loading(loadingtext)
   5: {
   6:     BackGroundFade();
   7:     Fore_ground_panel_activate(loadingtext);
   8:     
   9: }
  10:  
  11: function Fore_ground_panel_activate(loadingtext)
  12: {
  13:     var fore_ground_panel;
  14:     var w = 300; 
  15:     var h = 300;
  16:     
  17:     this.fore_ground_panel = document.createElement ('DIV');
  18:     document.body.appendChild(this.fore_ground_panel);
  19:     this.fore_ground_panel.id = 'ForeGroundActive';
  20:  
  21:     var brSize        = this.getBrowserSize();
  22:     var bodyWidth    = brSize[0];
  23:     var bodyHeight    = brSize[1];
  24:     xc = Math.round((bodyWidth/2)-(w/2))
  25:     yc = Math.round((bodyHeight/2)-(h/2))
  26:     
  27:     this.fore_ground_panel.style.left = xc + "px";
  28:     this.fore_ground_panel.style.top  = yc + "px";
  29:     this.fore_ground_panel.style.display = 'block';
  30:     var HTML = "<table border=0><tr><td><img src='" + loader.src + "'>&nbsp;&nbsp;&nbsp;&nbsp;</td><td><p class=LoadingText><b>" + loadingtext + " </b></p></td></tr>"
  31:        this.fore_ground_panel.innerHTML =HTML;
  32:        
  33:    }
  34:  
  35: function BackGroundFade()
  36: {
  37:     var back_ground_panel;
  38:     var brSize;
  39:     var bodyWidth;
  40:     var bodyHeight;
  41:             
  42:     brSize        = this.getBrowserSize();
  43:     bodyWidth    = brSize[0];
  44:     bodyHeight    = brSize[1];
  45:                 
  46:     this.back_ground_panel = document.createElement('DIV');
  47:     this.back_ground_panel.id = 'BackGroundFade';
  48:     this.back_ground_panel.style.height = bodyHeight + 'px';;
  49:     document.body.appendChild(this.back_ground_panel);
  50:     this.back_ground_panel.style.display = 'block'
  51:     
  52: }
  53:  
  54: function getBrowserSize()
  55: {
  56:     var bodyWidth    ;
  57:     var bodyHeight  ;
  58:     
  59:     bodyWidth=    document.documentElement.clientWidth;
  60:     bodyHeight    =    document.documentElement.clientHeight;
  61:     
  62:     if (self.innerHeight)
  63:     { 
  64:         // all except Explorer 
  65:         bodyWidth    =    self.innerWidth; 
  66:         bodyHeight    =    self.innerHeight; 
  67:         
  68:     }  
  69:     else if (document.documentElement && document.documentElement.clientHeight) 
  70:     {
  71:         // Explorer 6 Strict Mode          
  72:         bodyWidth    =    document.documentElement.clientWidth; 
  73:         bodyHeight    =    document.documentElement.clientHeight; 
  74:     } 
  75:     else if (document.body) 
  76:     {// other Explorers          
  77:         bodyWidth    =    document.body.clientWidth; 
  78:         bodyHeight    =    document.body.clientHeight; 
  79:     } 
  80:     return [bodyWidth,bodyHeight];        
  81:         
  82: }
  83: function LoadDefault()
  84: {
  85:     var page_screen = document.getElementById('BackGroundFade');
  86:     page_screen.style.display = 'none';
  87: }
  88: function hideSelect()
  89: {
  90:     for (j=0; j<document.forms.length; j++) 
  91:     {
  92:         var theForm = document.forms[j]
  93:         for(i=0; i<theForm.elements.length; i++)
  94:         {
  95:         alert(theForm.elements.name)
  96:             if(theForm.elements.type == "select-one") 
  97:             {
  98:             theForm.elements.style.visibility = "hidden";
  99:             }
 100:         } 
 101:     }
 102: } 
 103:  
 104:  
 105:  
 106:     

the following code will set the attribute for calling the javascript indicationg a process is going on



   1: Button2.Attributes.Add("OnClick","javascript:Loading('loading');");


function BackGroundFade() 

will create a div tag and which covers the whole form so that the user cannot click on any controls



function Fore_ground_panel_activate(loadingtext);

will create div with the loading image ...we can change the caption of the text for each button click



Thursday, July 12, 2007

My community Credit Award


Friday, June 01, 2007

Google Mashup Editor - Mashup Framework and Tools

Google Mashup Editor is an AJAX development framework and a set of tools that enable developers to quickly and easily create simple web applications and mashups with Google services like Google Maps and Google Base. Google Mashup Editor is a great tool for grabbing information from feeds and letting users see and manipulate it.

Creating applications with Google Mashup Editor is simple and uses technologies you're familiar with. With our declarative XML tags, JavaScript, CSS, and HTML, you can build applications in less time and with less work. For advanced developers, Google Mashup Editor allows you to be more expressive by tapping into our JavaScript API.

more info
Google Mashup Editor Getting Started Guide

Sunday, May 20, 2007

My first smart phone application in visual studio 2005

What Is a Smartphone?

The worldwide mobile wireless industry is quickly moving from traditional, voice-based cellular phone services to combined voice and data services, as a result of increasing demand for mobile data access and the deployment of high-speed wireless data services utilizing a variety of wireless technologies.

Microsoft Smartphone refers to Microsoft’s platform for next-generation cell phones—basically a software architecture with Windows CE as the operating system, plus a rich set of applications such as Pocket Internet Explorer and Pocket Outlook and powerful software development tools such as .NET Compact Framework and Visual Studio 2005.




Visual Studio 2005 is the major multi-language IDE (Integrated Development Environment) for Windows applications. Both managed and unmanaged code of Windows desktop applications can be developed using Visual Studio 2005. It allows managed and unmanaged Pocket PC and Smartphone application programming targeting Windows Mobile devices. With the .NET Framework on their target systems or devices, developers can use a single set of .NET Framework classes in different languages,
with the same naming and calling convention, and similar syntax. In particular, mobile application developers can leverage their experience and programming techniques obtained from smart client application development with Visual Studio 2005, and the only difference is the class libraries: They will work with a subset of the desktop .NET Framework class libraries. Visual Studio 2005 (and the previous version,Visual Studio .NET) is the key element for rapid and high-performance .NET application development,testing, and deployment over various systems and devices.

.NET Compact Framework Type System
.NET languages such as Visual C# and Visual Basic are based on the same type system as the .NET Compact Framework and use the same class library. Thus, developers familiar with one .NET language (and therefore the .NET Compact Framework type system) can easily move to another .NET language.Every class in the .NET Compact Framework, including those with built-in value types, is directly or indirectly inherited from the System.Object class. Only single inheritance is allowed in the .NET Framework and .NET Compact Framework; a class cannot have more than one base classes. Any userdefined classes are inherited from the System.Object class if no base class is explicitly specified.

Windows Mobile 5.0 SDK for Smartphone
The Windows Mobile 5.0 SDK for Smartphone includes the Smartphone emulators (which are also in Visual Studio 2005), some command-lines tools, help files, header files, and libraries for native code development.
You can download the SDK from www.microsoft.com/downloads/
details.aspx?familyid=DC6C00CB-738A-4B97-8910-5CD29AB5F8D9&displaylang=en.

ActiveSync
You need to have Microsoft ActiveSync to connect your Smartphone device to your Windows PC.ActiveSync acts as the gateway between your PC and your Windows Mobile device so that you can easily transfer files or synchronize application data such as e-mail, a calendar, and so on. For Smartphone development, ActiveSync is needed by Visual Studio to transfer data between the development PC and the device or the emulator. You can download ActiveSync from www.microsoft.com/windows
mobile/activesync/default.mspx.

Types
There are two kinds of objects in the .NET Compact Framework: built-in value types and reference types. A value type is a primitive data type that holds only values. They are actually structures allocated on the stack. Reference types are instances of classes and must be created using the new keyword.

Generics
The .NET Compact Framework 2.0 and later support parametric polymorphism using generics.

To create an instance of a generic Stack object that holds a MyObj type in C#, you can do the following:
System.Collections.Generic.Stack myObj = new
System.Collections.Generic.Stack ();

Exception Handling
Exceptions are runtime errors that need to be handled to avoid program crashes. The .NET Framework and the .NET Compact Framework provide a built-in mechanism to handle exceptions using the wellknown



try.
{

}
catch
{
}

finally
{
}


Visual Studio 2005 will put your project into a solution, which is simply a collection of projects, one of which is designated as the “Startup” project. The Form Designer shows an image of a conceptual Smartphone with Form1
loaded into its screen. The form appears to be empty; no controls have been placed onto it. However, there is already a control named “mainMenu1” at the bottom of the form. Usually, all forms in Smartphone applications should have a Main Menu control for soft keys immediately under the screen of a Smartphone.The automatically generated project now has only two files: Form1.cs and Program.cs. Form1.cs is the
GUI interface with which a Smartphone user will interact, whereas Program.cs is the place where the.NET Compact Framework will find the main entry point and load the application.


here are my screen shots of my fist application written for smart phone





Thursday, May 17, 2007



Microsoft® Visual Studio® code name “Orcas” delivers on Microsoft’s vision of smart client applications by enabling developers to rapidly create connected applications that deliver the highest quality rich user experiences. With Visual Studio code name “Orcas”, organizations will find it easier than ever before to capture and analyze information so that they can make effective business decisions. Visual Studio code name “Orcas” enables any size organization to rapidly create more secure, manageable & reliable applications that take advantage of Windows Vista and the 2007 Office system.

more

Wednesday, May 16, 2007

Auto Numbering in Grid view

this article shows how to do auto numbering in grid view

in some cases we need to provide numbering of rows

in the folowing example i have connected a datatable with grid view

here is the htmnl code of grid view



<asp:GridView ID="GridView1" runat="server" AllowPaging="True" OnRowDataBound="GridView1_RowDataBound" AutoGenerateColumns="False" ShowFooter="True" PageSize="5" OnPageIndexChanging="GridView1_PageIndexChanging">
<Columns>
<asp:TemplateField HeaderText="No" Visible="False"></asp:TemplateField>
<asp:BoundField DataField="name" HeaderText="Name" />
<asp:BoundField DataField="gender" HeaderText="Gender" />

<asp:BoundField DataField="origin" HeaderText="Origin" />
</Columns>
</asp:GridView>




protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
DataRowView drv = (DataRowView) e.Row.DataItem;

if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].Text = Convert.ToString(e.Row.DataItemIndex + 1);
if (drv["gender"].ToString() == "M")
{
e.Row.Cells[3].Text = "Male";
}
else
{
e.Row.Cells[3].Text = "Female";

}

}
}


e.Row.Cells[0].Text = Convert.ToString(e.Row.DataItemIndex + 1);
is the line giving auto numbering

also the datatable has a field called gender which contains the value M/F

if it is M cell will contain Male
if it is F cell will contain Female