Tuesday, August 16, 2011

How can you detect Browser Information in Silverlight?

 

Referred URL

http://www.kunal-chowdhury.com/2011/08/how-can-you-detect-browser-information.html 

Detecting browser information is not much difficult. You can use the inbuilt HtmlPage class available in the namespace called System.Windows.Browser. The class has static property called BrowserInformation of typeBrowserInformation. This returns the following properties:

 
public sealed class BrowserInformation
{
    public string ProductName { get; }
    public string ProductVersion { get; }
    public string Name { get; }
    public Version BrowserVersion { get; }
    public bool CookiesEnabled { get; }
    public string Platform { get; }
    public string UserAgent { get; }
}

BrowserInformation class is a sealed class which returns browser name, product name, product version, browser version, platform, user agent and whether the browser has cookies enabled.

Implementing Code


Let us start with the code implementation. Let's create two properties in code behind of the page. We will create string properties called "Platform" and "BrowserInformation". Here is the code for your reference:

 
public string Platform
{
    get { return (string)GetValue(PlatformProperty); }
    set { SetValue(PlatformProperty, value); }
}
 
public static readonly DependencyProperty PlatformProperty =
    DependencyProperty.Register("Platform", typeof(string), typeof(MainPage), new PropertyMetadata(string.Empty));
 
 
public string BrowserInformation
{
    get { return (string)GetValue(BrowserInformationProperty); }
    set { SetValue(BrowserInformationProperty, value); }
}
 
public static readonly DependencyProperty BrowserInformationProperty =
    DependencyProperty.Register("BrowserInformation", typeof(string), typeof(MainPage), new PropertyMetadata(string.Empty));

Now populate this properties from the code behind by extracting the proper property values from the HtmlPage.BrowserInformation property.

Here is the code that we are going to use for the demonstration:

 
var browserInfo = HtmlPage.BrowserInformation;
BrowserInformation = "You are using " + browserInfo.Name + " (Product Name: " + browserInfo.ProductName +
                     " - " + browserInfo.ProductVersion + ") Version: " +
                     browserInfo.BrowserVersion;
Platform = "You are on " + browserInfo.Platform + " platform and using User Agent: " + browserInfo.UserAgent;

Now design our XAML page with two TextBlocks binded with proper properties as shown below:

 
<StackPanel x:Name="LayoutRoot" Background="White" Width="400" 
            HorizontalAlignment="Center" VerticalAlignment="Center">
    <TextBlock Text="{Binding BrowserInformation, ElementName=userControl}" 
               TextWrapping="Wrap" Margin="5"/>
    <TextBlock Text="{Binding Platform, ElementName=userControl}"
               TextWrapping="Wrap" Margin="5"/>
</StackPanel>

That's all about our code implementation.

See it in Action


Build your project and run it in various browsers and you will see different information based on the running browser. I tested in various browsers, various versions and here is the report for each:

Tested in Internet Explorer 9

Tested in Firefox 5

Tested in Chrome 13

Tested in Chrome 14

Friday, August 12, 2011

Capgemini – Renault Nissan Completed Projects

 

Project name:  Microsoft Project Task Force (MPTF)
Client :  Renault Nissan Technology & Business Centre India, Chennai
Functional : Automotive 
Technology : ASP.Net 3.5, MOSS 2007, Windows Server 2008, SQL Server 2008.

Project Description:
MPTF is a customized intranet SharePoint portal with role based accessibility for Renault Headquartered in France. It contains three streams named Branding, Publishing and Search. Branding stream contains Themes, Master Pages, Banner, Header and footer menus. Publishing stream contains creation of article, Service and listing pages with Search Capability.
MPTF Search built on top of SharePoint search center functionality and it plays a vital role in MPTF project for searching inside document library and inside the site collections which is mapped under various search scopes. Search Results are configured with search facets web parts for filtering results on better way for the end user.

Role description:
* Independently setup Farm Configuration, Taxonomy, Content Types, Search Center Customization.
* Developed Event Handlers, Workflows, Feature Creation and Deployment, Independently customized advanced search center scopes consuming Sharepoint default services, filtering and output
* Integrated third party solutions like Sharepoint Shared Services Search Provider Property Creation (SSSPPC on CodePlex - managed properties migration), Logviewer (CodePlex)
* Prepared design documents and technical papers explaining development and design approach.

Cognizant Completed Projects

 

Project name :  Customer Data Repository (CDR)
Client :  Lexis Nexis, OHIO, US
Horizontal :  Advanced Solutions Group (ASG) 
Technology :  Windows Server 2008, MOSS 2007, Silverlight 3, ASP.Net 3.0, WCF Services.

Project Description:
Lexis Nexis provides solutions to professionals in law firms, corporations, government, law enforcement, tax, accounting, academic institutions and risk and compliance assessment.
The Customer Data Repository is internal information repository for Lexis Nexis. This application plays vital role in Lexis Nexis in maintaining customers information like their personal information, Workflows, Mind maps, Their Quotes, etc, Apart from that this application captures Lexis Nexis’s Concepts, Ongoing Research, Products available in their company and Internal Teams and their key contacts. The main functionality of the application provides search with wild card characters like Google and related search like Amazon.

Role description:
* Designed architecture based on end user size and independently created project solution with Business, Data and Application layers and setup TFS versioning control.
* Developed code for consumption of data from Sharepoint and exposing as WCF services, Implemented the Search Criteria Pattern in the Service Messages and Log4Net logging mechanism for better traceability. 
* Created tools for data verification and project deployment.
* Coordinating to offshore team from Ohio and took responsibility for delivering Iteration 1 tasks.

Honeywell Completed Projects

 

Project name:  Honeywell Manufacturing Execution System (Honeywell MES)
Client : Honeywell International, US
Functional :  Automation Control Systems
Technology :  Windows Server 2008, Sharepoint 3.0, Silverlight 3, ADO.net Data Services.

Project Description:
Honeywell MES is a Service Oriented Architecture based framework for developing projects to verticals like Petro Chemicals, Pharmaceuticals and Paper industries. This framework identifies some of the general functionality, controls to display the data visualization, Workflows, etc. This projects plays as middle tier application between ERP and Dynamic Control Systems. 
This Project shows entire production plant in Silverlight visual representation like plant equipments, flows, input and ports, operations, etc. The optimized solution for a production program can be planned by this application based on calculations.

Honeywell MES Information portal
Honeywell MES Information Portal helps product marketing and developer help website, It is Independently designed and developed in Silverlight consuming ASTORIA on top of Sharepoint. This website helps Honeywell MES consumers for periodic release of controls and updated information on Honeywell MES product. The controls and data services developed in Honeywell MES like Product Gallery, Gantt, Hero Bar has been used in portal.

Role description:
*MES Portal Server Setup and configuration of Sharepoint application.

* Independently developed MES Information portal consuming MES framework components and developed visualization controls like Gantt Chart, FAQ Populator, Hero Bar, Program Banner, Carousel Filmstrip Control, Carousel Rotation Control, Petrol Plant Flow sheet Simulation, MES Control Gallery and Program Status Control.
* Traveled to Oslo and Implemented MES framework setup for Honeywell Automation, Norway.
* Prepared design documents and technical papers explaining development and design approach.

HCL-CODC Completed Projects

 

Project Name :  Corporate Intranet Quality Portal & automated tools development
Technology :  MS ASP.Net 2.0, Flash MX, JavaScript 2, Fusion Charts, AJAX.Net, MS SQL Server 2005

Role description:
* Independently designed, developed and managed Intranet Quality portal in MOSS 2007 technologies and web applications in ASP.net 2.0, users, access permissions integrating with windows share point technologies 2003 with technical content documents.
* Concentrating on enhancing the organizational technical expertise by
* Analyzing and tuning application performance.
* Preparing a detailed User Guide and flash based demos for the application.
Automated applications and tools description:

1. Project      : “Operational review” (Opsreview) 
Project Description:

A web based repository application, which helps quality analyst to get project operational details from engineering project folks. It has modules like Opsreview projects-Business groups setup, initiate Opsreview for Business groups on every month, schedule Opsreview meeting to understand operational works in their projects and to assign operational action items, upload engineering project’s version based operational review reports in quality server with project - people mappings, Shows the uploaded reports depending upon the project-people mapping, With the help of Opsreview application wizard module, quality analyst Produce summary reports for each month Opsreview on Business group level by quality analysts.
The additional features like user based application color themes, Application error log, automated workflow mail for Opsreview Initiation, scheduled meetings, uploading reports, escalation to people who were not responding to operational review AI, Business group summary report creation.

2. Project       : “ASTRA” 
Project Description:
A web based automated audit tracking tool that provides a centralized Web-based repository for all audit documentation that makes search and retrieval easy. It provides advanced tracking capability every step of the way, from scheduling and planning to execution to completion. The main flow of application includes quality analyst to assign auditors, schedule/ change audits on each projects, to track audit findings like non conformity action, best practices and observations has been submitted by auditors. Provision for auditee to respond the non conformity and observation provision for auditor to verify and close the audit.
The other added features of the web application includes flash graphs, User based color theme settings using style sheets , Application error log, Analysis reports on cycle wise, Audit wise, Business group wise based on project, audit findings, audit status, audit summary and audits by auditor.
Sends remainder mails to concerned stake holders regarding escalation for not submitting audit report, responding NCR, Observations and audit closure.

3. Project         : “Metrics Automation”
Project Description:
A web based application which computes the metrics data computation depends upon the raw data uploaded in excel file, imported into database and computes the Bug closure rate, Bug Validity rate by each engineers in project.
The other added features of the web application includes flash graphs for BCR and BVR on individual engineers/ each project, User based color theme settings using style sheets, Application error log, etc.,

4. Project        : “Automated Q-Portal backup & Database updater”
Technology      :
MS Windows 2003 server, MS VB.Net 2.0, Share point services 2003, MS SQL Server 2005
Project Description:
A VB.Net 2003 based scheduled task application which takes care backing up of quality portal and database and updates user permission for project managers, leads, etc, inside share point site with project-people mapping and sends automated intimation mail on daily basis. 

Monday, August 8, 2011

How to Prepare Your Class Library to Support Application Library Caching?

 

Referred URL

http://www.kunal-chowdhury.com/2011/08/how-to-prepare-your-class-library-to.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+kunal-chowdhury/Silverlight+(Kunal's+Blog+-+Silverlight)

What is Application Library Caching?

First of all, let us discuss on "Application Library Caching". Assembly caching is not a new thing in Silverlight 4. It was present since Silverlight 3. Already we all know about the on demand download of XAP. To do this, we need to write code for downloading the external xap files using the WebClient.

And this Application Library caching does the similar thing for you very. Suppose, if you have a bigger application and used a huge external libraries, either 3rd part or your own, this easy step will help you make a separate zip file for them which can be downloaded on demand without writing any additional code.

Read more about the feature in this blog post: Application Library Caching in Silverlight 4.

Prepare Project

Before starting let us create our own Silverlight application solution, where we will have a Class library project too. It is not require to put the class library project in the same solution but for the demo purpose, we will use the same solution here.

Below is our project structure where we have our own custom library called "ExtensionLibrary", one Silverlight application named "LibraryCachingDemo" and the hosting web project called "LibraryCachingDemo.Web":

Library Caching Demo - Project Structure

Once we are done with the project creation, we will build the project which will generate the dll file for the class library project. Just add the Assembly Reference of this DLL to the main application project and build it once again. This will create the application XAP with the assembly added inside that.

Library Caching Demo - Add Assembly Reference of Class Library

Now it's the time to split out the library out of the XAP and use the feature of Application Library Caching.

Signing the Class Library

Before implementing the same in our application, it is require to sign the assembly of the library. To do this, right click on the library project and click Properties from the context menu. This will open up the properties page. As shown below, go to the "Signing" tab and create a Strong name key file and sign the assembly with that:

Library Caching Demo - Signing the Library

After signing the assembly, build the project to recreate the assembly which is signed with a strong key. Now you need to extract the "Public Key Token" out of the dll. To do this, the easiest process is installing the dll in the GAC by giving the command "gacutil -i <DLL_FILE_PATH>" from the Visual Studio Command Prompt. This will register it in GAC. Make sure to open the Visual Studio Command Prompt as an Administrator.

Here is the screenshot of the same:

Library Caching Demo - Add Library to the GAC

After this step, go to the GAC and extract the public key token from the installed assembly. Note down the key as it will be require in the next step. After you get the key, you can remove the assembly from the GAC as it is not required in next steps.

Generate the Manifest

Once you have a signed copy of the assembly with a Public Key Token, go to the original dll file path (in our case, the Bin\Debug folder) and create a new file called "ExtensionLibrary.extmap.xml". Make sure that, this file has the same name of the dll assembly.

Library Caching Demo - Create Assembly Manifest File

Now open the said file and add the following XML code into that:

Library Caching Demo - Create Assembly Manifest Definition

This actually adds the manifest for the dll. Make sure that, you entered the name of the assembly, version, public key token, relative path and the name of the ZIP file properly as shown above.

Here is the complete XML code for your reference:

 
<?xml version="1.0"?>
<manifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <assembly>
    <name>ExtensionLibrary</name>
    <version>1.0.0.0</version>
    <publickeytoken>38955262d53ca29f</publickeytoken>
    <relpath>ExtensionLibrary.dll</relpath>
    <extension downloadUri="ExtensionLibrary.zip" />
  </assembly>
</manifest>

This step will ask the compiler to not include the dll inside the XAP and create a separate ZIP file for the said assembly if application library caching is set for the application.

Adding Support for Application Library Caching


This is the final step. Right click on the Silverlight Application project and go to it's properties panel. In the "Silverlight" tab, just check the "Reduce XAP size by using application library caching" option as shown below:

Library Caching Demo - Enable Application Library Caching

Now build your application once again and this time you will notice that one ZIP file named "ExtensionLibrary.zip" has been created in the "ClientBin" folder of the application project. Also open the XAP file and this time you will notice that the dll file is not present in the XAP.

Library Caching Demo - Assembly Output as External ZIP

Download


You can download the complete Source Code of the article from here:

10 Unprofessional Behaviors to Avoid - Subroto Bagchi

 

Referred URL:

http://monster.typepad.com/monsterblog/2011/08/10-unprofessional-behaviors-to-avoid.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+MonsterBlog+(The+Monster+Blog)

 

In his new book "The Professional," Subroto Bagchi, the vice chairman and cofounder of MindTree Ltd. and a columnist for "Forbes India," lays out a clear-cut set of criteria that can guide the modern worker in truly and consistently professional behavior. By exploring a variety of professional dilemmas in a broad spectrum of industries, he answers some of the tough questions that workers face.

He also describes ten behaviors that are clearly unprofessional -- his "top ten markers of unprofessional conduct." If you're not sure how to respond to a situation at work, let this list be a guide for what not to do:

1. Missing a Deadline
You know how much you hate it when other people miss their deadlines to you. Bagchi says you should keep this feeling in mind when it comes to your own deadlines.

2. Failing to Be Forthright
Bagchi points out that missed deadlines -- whether due to poor estimation of how much time it will take to get a job done or due to unavoidable circumstances -- usually "announce their arrival in advance," but that people ignore warning signs (or hope the problem will solve itself.)

"If communicated proactively to the right person," Bagchi says, "most problems not only get addressed, but they can also be converted into an opportunity."

He also advises delivering bad news in person (or at least via telephone).

3. Withholding Information
Bagchi describes not disclosing conflicts of interest as one area where this is likely to happen.

4. Not Respecting Privacy of Information
"Consent should never be assumed," says Bagchi. "However close and long-standing the relationship may be, consent has to be formally sought and formally recorded each time there is a transaction."

5. Not Respecting "Need to Know"
Here, Bagchi uses the example of spouses who work and says, "It is important to avoid what is known as 'pillow talk' -- sharing official informaiton at home."

6. Plagiarizing
Bagchi outlines three steps for citing sources: "state why you have chosen to pull ... [the] information, acknowledge the source and, most important, state your own reasoned conclusion."

7. Passing the Blame
"Just as we say a poor workman blames his tools," Bagchi says, "a bad professional blames his associates."

8. Overstating Qualifications and Experience
"Unfortunately," says Bagchi, "job seekers sometimes trivialize the difference between exposure and expertise when it comes to writing resumes.... I have often received resumes of young engineers who have done just an internship of short duration in an organization, but who claimed to have designed an entire enterprise application while being there."

"While it may be easy to bluff one's way into a job or assignment, it becomes a complete loss of face at the time of execution and leaves a bad taste in everyone's mouth," he adds.

9. Frequently Changing Jobs
Of course, not all job changes are voluntary, but Bagchi objects to "mindless job changes." He says, "Failed job changes have as much to do with the individual as with the organization, and ... people who pass off the blame simply demonstrate an opportunistic mind-set."

10. Not Taking Care of Your Appearance
"Your attire must inspire credibility," says Bagchi. He adds that it should follow written (and unwritten) rules for your organization and profession, and that dressing in a way that distracts is not a good idea.