Wednesday, March 04, 2009

Exploring Assembly in .NET

The Intermediate Language Disassembler (ildasm.exe),which comes with the .NET SDK allows to view a dll contents,manifest CIL code and Metadata…

ildasm can be loaded from command prompt(start –> Programs –> Microsoft Visual Studio 2008 – > Visual Studio 2008 Command Prompt

for demonstration i have developed a class with contains a method for getting the TotalPrice

  





   1: using System;


   2: using System.Collections.Generic;


   3: using System.Linq;


   4: using System.Web;


   5:  


   6: namespace www.buddhasmiles.blogspot.com


   7: {


   8:     public class buddha_class


   9:     {


  10:         public decimal GetTotalPrice()


  11:         {


  12:             decimal grandTotalPrice = 0, itemTotalPrice = 0, itemDiscountedTotalPrice = 0, itemTotalPriceCommodtity = 0;


  13:  


  14:             itemDiscountedTotalPrice = Convert.ToDecimal("100");


  15:             grandTotalPrice += itemDiscountedTotalPrice;


  16:  


  17:             return grandTotalPrice;


  18:         }


  19:  


  20:     }


  21: }




i open the dll using the ildasm and here is the output



image



for viewing the CIL just double click each method



Lutz Roeder’s Reflector( http://www.aisto.com/roeder/dotnet.)



Another free tool similar like ildasm …a great s/w where we can see the code in multiple languages



image

Thursday, November 06, 2008

Watir

Watir stands for “Web Application Testing in Ruby”. It is pronounced water.

Watir is an open-source library for automating web browsers. It allows you to write tests that are easy to read and maintain. It is simple and flexible.

Watir drives browsers the same way people do. It clicks links, fills in forms, presses buttons. Watir also checks results, such as whether expected text appears on the page.

Watir is a family of Ruby libraries. They support Internet Explorer on Windows, Firefox on Windows, Mac and Linux, and Safari on Mac.

more info

Tuesday, August 05, 2008

Integrating Telephony Services into .NET Applications

Learn how developers using Microsoft .NET framework can use SIP Objects.NET to gain simple and flexible access to telephony networks. SIP Objects.NET enables developers to access a wide variety of enterprise or traditional carrier networks by leveraging technologies such as Avayas SIP Application Server.

more info

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