Thursday, May 27, 2010

User stories and Sprint planning

User Stories are stories that we jot down during discussion with customers / clients. This will give us a brief idea about the requirement. If you are working with the company who deals with internal products then Product owners will become your customer/ clients. Have a look at Description field in below image to find out some of the basic examples of user stories.



Sprint planning is the task to play with all user stories and make them a well order list. Pre-requisition to start sprint planning is to have your whole team with you in the meeting and your product / project owner’s has clear idea of user stories. Once you have rough list of all user stories, scrum master can initiate with making them perfect order list. One has to take one by one all user sorties and have to discuss them with the team to fill all columns in the sprint planning doc.

Normally there are different patterns to design the doc, but you have to pick one standard format. Please refer image for example. Almost all columns in the image are self explanatory still I would like to explain few.

1) Description – User stories
2) Initial estimate – Depending on complexity and time needed you can rank this column in 1 to 13, in which 13 being highest.
3) Adjusted estimate – After planning if you felt that estimates needs to be updated then put re-estimate in this column.
4) Adjustment factor - Adjusted estimate – initial estimate / initial estimate
5) Value – This will be given by product / project owner / clients i.e. High, Medium or Low

To sum up above, points those needs to be consider while creating this doc are estimates, complexity, priority and owner value. If these factors are not enough, one can also consider Uncertainty, dependencies and frequency of use to have more clear idea.

Friday, February 19, 2010

Sprint & Scrum

The Scrum process begins by reviewing a product backlog with the product owner. You identify the highest-priority features and then estimate how many will fit into a sprint. These features then compose the sprint backlog. A sprint is a predefined period of time, usually 2 to 4 weeks, during which the team analyzes, designs, constructs, tests, and documents the selected features.

The team holds a daily status meeting, referred to as the daily Scrum, to review feature status. This meeting has specific guidelines as below:

• The meeting starts sharp on time.

• All are welcome, but only “developers” may speak

• The meeting is “time boxed” to 15 minutes

• The meeting should happen at the same location and same time every day During the meeting, each team member answers three questions:
1. What have you accomplished since our last meeting?
2. What are you planning to do today?
3. Do you have any problems preventing you from accomplishing your goal?
(It is the role of the Scrum Master to facilitate resolution of these impediments. Typically this should occur outside the context of the Daily Scrum so that it may stay under 15 minutes.)

When a sprint is completed, the features are demonstrated to the customer, and the team and the customer decide whether additional work is needed or if the sprint work is approved to be released to a beta or production environment. Each sprint is followed by a retrospective during which the team lists items that went well or poorly;

action plans are documented to keep the successes going and to improve the areas that performed poorly.

Scrum strengths:
Prioritized delivery —Features are delivered in a sequence that ties to business value.
Status transparency —The daily meetings expose the project status.
Team accountability —Everyone signs off on the work that will be pursued during the sprint.
Continuous delivery —Scrum delivers product features (commercial software or web portals) continuously.

Scrum weaknesses:
Scrum doesn’t want specialists. It may be difficult to quickly convert an existing team from a group of specialists to a group where anyone can perform any task.
A Scrum team can’t be successful without a strong ScrumMaster, which makes the process highly dependent on one individual.

Scrum is incredibly popular today—it’s almost become synonymous with the term agile development. Scrum provides a great, repeatable process that is well suited for product development and steady-state release management.

Thursday, February 18, 2010

Agile Principles – 3C 2M2R 2D IST

Customer satisfaction - Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.

Change request - Welcome changing requirements, even late in development. Agile processes harness change for the customer's competitive advantage.

Release cycle - Deliver working software frequently, from a couple of weeks to a couple of months, with a preference to the shorter timescale.

Communication - Business people and developers must work together daily throughout the project.

Resource management - Build projects around motivated individuals. Give them the environment and support they need, and trust them to get the job done.

Discussions/Meetings - The most efficient and effective method of conveying information to and within a development team is face-to-face conversation.

Milestones - Working software is the primary measure of progress.

Maintenance - Agile processes promote sustainable development. The sponsors, developers, and users should be able to maintain a constant pace indefinitely.

Design - Continuous attention to technical excellence and good design enhances agility.

Simplicity - the art of maximizing the amount of work ‘not done is essential’

Teamwork - The best architectures, requirements, and designs emerge from self-organizing teams.

Improvement - At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly.

Tuesday, December 29, 2009

Generic Handler

Overview

An ASP.NET HTTP handler is the process that runs in response to a request made to an ASP.NET Web application. The most common handler is an ASP.NET page handler that processes .aspx files. When users request an .aspx file, the request is processed by the page through the page handler. You can create your own HTTP handlers that render custom output to the browser.

MSDN Link

For detail understanding of the topic you can use msdn link i.e. http://msdn.microsoft.com/en-us/library/bb398986.aspx

Example

Now let’s take one practical example of generic handler so that we can understand in better way.

Functional requirement – lets say developer wants to push user email address in to some database using client side form post, but before posting the form developer also want to send an email on that email address. To implement this functionality there are few alternate options but lets go with generic handler.

1) Aspx page

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<html>
<head>
<script language="javascript">
function createXMLHttpRequest() {
try { return new XMLHttpRequest(); } catch (e) { }
try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { }
try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { }
return null;
}
function SendEmail() {
var xmlHttpReq = createXMLHttpRequest();
xmlHttpReq.open("GET", "Handler.ashx?email=" + document.getElementById('email').value, false);
xmlHttpReq.send(null);
var yourJSString = xmlHttpReq.responseText;
}
</script>
<title>Untitled Page</title>
</head>
<body>
<form action="https://www.xyz.com/" method="post" >

<input id="email" maxlength="100" name="email" size="50" type="text" />

<input type="button" onclick="SendEmail()" value="submit"/>
</form>
</body>
</html>

2) Handler.ashx

<%@ WebHandler Language="C#" Class="Handler" %>

using System;
using System.Web;

public class Handler : IHttpHandler {

public void ProcessRequest(HttpContext context)
{

System.Web.Mail.MailMessage msgMail = new System.Web.Mail.MailMessage();
msgMail.To = context.Request.QueryString["email"].ToString();
msgMail.From = "nishant@zzz.com";
msgMail.Subject = "Hey";
msgMail.BodyFormat = System.Web.Mail.MailFormat.Html;
string strBody = "<html><body>hey ... <br>" +
" <font color=\"red\">how are you..? </font></body></html>";
msgMail.Body = strBody;
System.Web.Mail.SmtpMail.SmtpServer = "yyy.123.abc";
System.Web.Mail.SmtpMail.Send(msgMail);
context.Response.Write("done");
}

public bool IsReusable {
get {
return false;
}
}

}

Above two steps is all about implementing generic handler. In the first step we have just call handler file by passing querystring to it. i.e. “SendEmail()” function in aspx page. In the second step we have added a generic handler by adding new file to the application. Once we added new generic handler file, it will automatically implement ‘IHttpHandler’ interface and will be having empty implementation of ‘ProcessRequest’ and ‘IsReusable’ methods. Now once we call the handler file from javascript it will sent the control to ‘ProcessRequest’ method of the handler class. And as we can see in above example we are suppose to write our cutome logic in ‘ProcessRequest’ method.

That’s all isn’t it easy to implement handler and not only its easy way, it has only one event unlike the page so it is faster then page level request execution, and thus it also improves the performacne :)

Friday, November 27, 2009

XSLT handbook / Cheat-sheet

Howdy,

This time I came up with an XSLT handbook. Being a developer if you ever come cross to XSLT development this blog can help you. As over here I have added all most all kwon topics using which you can start programming in XSLT. Though I have in brief about each topic to know in detail you can click on name of the topic an you will be redirect to the w3school site which i have used to write this blog. hope you all will enjoy this handbook while working with XSLT :)


1) Xsl:stylesheet/xsl:transform - The root element that declares the document to be an XSL style sheet is <xsl:stylesheet> or <xsl:transform>. <xsl:stylesheet> and <xsl:transform> are completely synonymous and either can be used!

2) Href - To provide link or reference syntax would be <?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>

3) Xsl:template - An XSL style sheet consists of one or more set of rules that are called templates. A template contains rules to apply when a specified node is matched. <xsl:template match="/">

4) Xsl:value-of - The <xsl:value-of> element is used to extract the value of a selected node. Example - <td><xsl:value-of select="catalog/cd/title" /></td>

5) Xsl:for-each - The <xsl:for-each> element allows you to do looping in XSLT. Legal filter operators are: = (equal), != (not equal), < less than, > greater than. Example - <xsl:for-each select="catalog/cd"> <p><xsl:value-of select="title" /></p> </xsl:for-each>

6) xsl:sort - The <xsl:sort> element is used to sort the output. Example - <xsl:sort select="artist"/>

7) Xsl:if - The <xsl:if> element is used to put a conditional test against the content of the XML file. Example - <xsl:if test="price > 10"> logic.. </xsl:if>

8) Xsl:choose - The <xsl:choose> element is used in conjunction with <xsl:when> and <xsl:otherwise> to express multiple conditional tests <xsl:choose> <xsl:when test="price > 10"> some logic.. </xsl:when> <xsl:when test="price > 9"> some logic </xsl:when> <xsl:otherwise> default logic </xsl:otherwise> </xsl:choose>

9) Xsl:apply-templates - The <xsl:apply-templates> element applies a template to the current element or to the current element's child nodes. If we add a select attribute to the <xsl:apply-templates> element it will process only the child element that matches the value of the attribute. We can use the select attribute to specify in which order the child nodes are to be processed. Syntax - <xsl:apply-templates select="expression" mode="name">

10) xsl:variable - The <xsl:variable> element is used to declare a local or global variable. Syntax - <xsl:variable name="name" select="expression">

11) xsl:call-template - The <xsl:call-template> element calls a named template. Syntax - <xsl:call-template name="templatename">

12) xsl:attribute - The <xsl:attribute> element is used to add attributes to elements. Note that the <xsl:attribute> element replaces existing attributes with equivalent names. Example - <a><xsl:attribute name="href"><xsl:value-of select="RSSLinks/FeedLink"/></xsl:attribute> <img src="images/rss_xml.gif" border="0"/></a>

13) xsl:import - The <xsl:import> element is a top-level element that is used to import the contents of one style sheet into another. An imported style sheet has lower precedence than the importing style sheet. Note that this element must appear as the first child node of <xsl:stylesheet> or <xsl:transform>. syntax - <xsl:import href="URI"/>

14) xsl:apply-imports - The <xsl:apply-imports> element applies a template rule from an imported style sheet. Template rules in imported style sheets have lower precedence than template rules in main style sheets. The <xsl:apply-imports> is used when we want to use a template rule from the imported style sheet rather than an equivalent rule in the main style sheet. Syntax - <xsl:apply-imports/>

15) xsl:attribute-set - The <xsl:attribute-set> element creates a named set of attributes. The attribute-set can be applied as whole to the output document. Note that it Must be child of <xsl:stylesheet> or <xsl:transform>. Example - <xsl:attribute-set name="font"><xsl:attribute name="fname">Arial</xsl:attribute> <xsl:attribute name="size">14px</xsl:attribute><xsl:attribute name="color">red</xsl:attribute> </xsl:attribute-set>

16) xsl:comment - The <xsl:comment> element is used to create a comment node in the result tree. Syntax - <xsl:comment>This is a comment!</xsl:comment>

17) xsl:copy - The <xsl:copy> element creates a copy of the current node. Note that Namespace nodes of the current node are automatically copied as well, but child nodes and attributes of the current node are not automatically copied!

18) xsl:copy-of - The <xsl:copy-of> element creates a copy of the current node. Note that namespace nodes, child nodes, and attributes of the current node are automatically copied as well! This element can be used to insert multiple copies of the same node into different places in the output. Syntax - <xsl:copy-of select="expression"/>

19) xsl:element - The <xsl:element> element is used to create an element node in the output document. Example - <xsl:element name="singer"><xsl:value-of select="artist" /> </xsl:element>

20) xsl:include - The <xsl:include> element is a top-level element that includes the contents of one style sheet into another. An included style sheet has the same precedence as the including style sheet. Note that this element must appear as a child node of <xsl:stylesheet> or <xsl:transform>. Systax - <xsl:include href="URI"/>


21) xsl:key - The <xsl:key> element is a top-level element which declares a named key that can be used in the style sheet with the key() function. Syntax - <xsl:key name="name" match="pattern" use="expression"/>

22) xsl:message - The <xsl:message> element writes a message to the output. This element is primarily used to report errors. This element can contain almost any other XSL element (<xsl:text>, <xsl:value-of>, etc.). The terminate attribute gives you the choice to either quit or continue the processing when an error occurs. Example - <xsl:message terminate="yes"> Error: Artist is an empty string! </xsl:message>

23) xsl:namespace-alias - The <xsl:namespace-alias> element is used to replace a namespace in the style sheet to a different namespace in the output. Note that <xsl:namespace-alias> is a top-level element, and must be a child node of <xsl:stylesheet> or <xsl:transform>.

24) xsl:number - The <xsl:number> element is used to determine the integer position of the current node in the source. It is also used to format a number. Example - <xsl:number value="12" grouping-size="1" grouping-separator="#" format="I"/> Output: X#I#I

25) xsl:output - The <xsl:output> element defines the format of the output document. Note that <xsl:output> is a top-level element, and must appear as a child node of <xsl:stylesheet> or <xsl:transform>.

26) xsl:param - The <xsl:param> element is used to declare a local or global parameter. Note that the parameter is global if it's declared as a top-level element, and local if it's declared within a template. Syntax - <xsl:param name="name" select="expression">

27) xsl:strip-space and xsl:preserve-space - The <xsl:preserve-space> element is used to define the elements for which white space should be preserved. The <xsl:strip-space> element is used to define the elements for which white space should be removed. Note that the preserving white space is the default setting, so using the <xsl:preserve-space> element is only necessary if the <xsl:strip-space> element is used. Note that the <xsl:preserve-space> element and the <xsl:strip-space> element are top-level elements. Example - <xsl:strip-space elements="country company price year" /> <xsl:preserve-space elements="title artist" />

28) xsl:processing-instruction - The <xsl:processing-instruction> element writes a processing instruction to the output. Syntax - <xsl:processing-instruction name="process-name">

29) xsl:text - The <xsl:text> element is used to write literal text to the output. This element may contain literal text, entity references, and #PCDATA. Syntax - <xsl:text disable-output-escaping="yes|no">

30) xsl:with-param - The <xsl:with-param> element defines the value of a parameter to be passed into a template. Note that the value of the name attribute of <xsl:with-param> must match a name in an <xsl:param> element (the <xsl:with-param> element is ignored if there is no match). Also note that the <xsl:with-param> element is allowed within <xsl:apply-templates> and <xsl:call-template>. You can add a value to the parameter by the content of the <xsl:with-param> element OR by the select attribute! Syntax - <xsl:with-param name="name" select="expression">

31) xsl:decimal-format - The <xsl:decimal-format> element defines the characters and symbols to be used when converting numbers into strings, with the format-number() function. All countries do not use the same characters for separating the decimal part from the integer part, and for grouping digits. With the <xsl:decimal-format> element you can change special characters to other symbols. This element is a top level element. The format-number() function can refer to the <xsl:decimal-format> element by name. Example - <xsl:decimal-format name="euro" decimal-separator="," grouping-separator="."/>

32) xsl:fallback - The <xsl:fallback> element specifies an alternate code to run if the XSL processor does not support an XSL element. Syntax - <xsl:fallback> <!-- Content: template --> </xsl:fallback>

33) current() - The current() function returns a node-set that contains only the current node. Usually the current node and the context node are the same. <xsl:value-of select="current()"/> is equal to <xsl:value-of select="."/> However, there is one difference. Look at the following XPath expression: "catalog/cd". This expression selects the <catalog> child nodes of the current node, and then it selects the <cd> child nodes of the <catalog> nodes. This means that on each step of evaluation, the "." has a different meaning. The following line: <xsl:apply-templates select="//cd[@title=current()/@ref]"/> will process all cd elements that have a title attribute with value equal to the value of the current node's ref attribute. This is different from <xsl:apply-templates select="//cd[@title=./@ref]"/> that will process all cd elements that have a title attribute and a ref attribute with the same value.

34) document() - The document() function is used to access nodes in an external XML document. The external XML document must be valid and parsable. One way to use this function is to look up data in an external document. For example we want to find the Celsius value from a Fahrenheit value and we refer to a document that contains some pre-computed results: <xsl:value-of select="document('celsius.xml')/celsius/result[@value=$value]"/>

35) format-number() - The format-number() function is used to convert a number into a string. Syntax - string format-number(number,format,[decimalformat])

36) generate-id() - The generate-id() function returns a string value that uniquely identifies a specified node. If the node-set specified is empty, an empty string is returned. If you omit the node-set parameter, it defaults to the current node. Example - <a href="#{generate-id(artist)}">

37) key() - The key() function returns a node-set from the document, using the index specified by an <xsl:key> element.

Thursday, November 12, 2009

Creating and transforming XML using LINQ

XML has achieved tremendous adoption as a basis for formatting data whether in Word files, in configuration files, or in databases; XML seems to be everywhere. Yet, from a development perspective, XML is still hard to work with. If you ask the average software developer to work in XML you will likely hear a heavy sigh. The API choices for working with XML seem to be either aged and verbose such as DOM or XML specific such as XQuery or XSLT which require motivation, study, and time to master. LINQ to XML, a component of the LINQ project, aims to address this issue. LINQ to XML is a modernized in-memory XML programming API designed to take advantage of the latest .NET Framework language innovations. It provides both DOM and XQuery/XPath like functionality in a consistent programming experience across the different LINQ-enabled data access technologies.

In this article I will explore some of the features available in .NET Framework release 3.5 related to LINQ for XML. This is, of course, not an extensive discussion, merely a familiarization and stepping stone for more learning and exploration.

Let’s start with one of the old ways of creating the xml. Then later on I will explain how the same can be written using new LINQ to XML API.

Old WAY of doing things

public void CreateEmployeesOld()
{
XmlElement root = m_doc.CreateElement("employees");
root.AppendChild(AddEmployee(1, "John doe", DateTime.Parse("12/12/2005"), true));
root.AppendChild(AddEmployee(2, "Kim", DateTime.Parse("11/23/1999"), true));
root.AppendChild(AddEmployee(3, "Carla", DateTime.Parse("2/6/2008"), false));
root.AppendChild(AddEmployee(4, "Aleks", DateTime.Parse("10/6/1998"), false));
m_doc.AppendChild(root);
Response.Write(m_doc.OuterXml);
}

private static XmlElement AddEmployee(int ID, string name, DateTime hireDate, bool isSalaried)
{
XmlElement employee = m_doc.CreateElement("employee");
XmlElement nameElement = m_doc.CreateElement("name");
nameElement.InnerText = name;
XmlElement hireDateElement = m_doc.CreateElement("hire_date");
hireDateElement.InnerText = hireDate.ToShortDateString();
employee.SetAttribute("id", ID.ToString());
employee.SetAttribute("salaried", isSalaried.ToString());
employee.AppendChild(nameElement);
employee.AppendChild(hireDateElement);
return employee;
}

Now say for, once you have created the employee xml and now you want to transform it to new set of xml elements, then old way need help of XSLT. But in below example of LINQ to XML I have explained that too. How easy it would be to transform one xml to another one without using XSLT

New WAY of doing things

public void CreateEmployeesNew()
{
// creating employee xml
XDocument doc = new XDocument(
new XDeclaration("1.0", "utf-8", "yes"),
new XComment("A sample xml file"),
new XElement("employees",
new XElement("employee",
new XAttribute("id", 1),
new XAttribute("salaried", "true"),
new XElement("name", "John doe"),
new XElement("hire_date", "12/12/2005")),
new XElement("employee",
new XAttribute("id", 2),
new XAttribute("salaried", "true"),
new XElement("name", "Kim"),
new XElement("hire_date", "11/23/1999")),
new XElement("employee",
new XAttribute("id", 3),
new XAttribute("salaried", "false"),
new XElement("name", "Carla"),
new XElement("hire_date", "2/6/2008")),
new XElement("employee",
new XAttribute("id", 4),
new XAttribute("salaried", "false"),
new XElement("name", "Aleks"),
new XElement("hire_date", "10/6/1998"))
)
);
Response.Write("
" + doc + "
");

// transforming employee xml in to newer xml format.
XElement element = new XElement("salaried_employees", from e in doc.Descendants("employee")
where e.Attribute("salaried").Value == "true"
select new XElement("employee",
new XElement(e.Element("name"))));
Response.Write("
" + element + "
");
}

To conclude this I would say, XML is fantastic construct that has been deeply ingrained into just about everything. Having the ability to easily construct, query, transform and manipulate XML documents is an invaluable service that will improve the speed of which applications can be built and the quality of those applications.This article is not an exhaustive investigation of LINQ to XML; there have been many other articles, snippets and blogs written on the subject. It mainly just a taste and familiarization of what is possible using .NET 3.5.

Saturday, October 31, 2009

LINQ kick start with basic samples

Hi guys,

For some developers LINQ is still new, as they still working on 2.0. So for those who are bingers to the LINQ, I would like to share few stuff. Although whatever I am writing over here is available in the msdn, I will try to present that all in some different flavor.

Mostly in this article I have covered small but helpful features provided with LINQ.
Generally, using LINQ we are supposed to play with three type of collection. i.e.

  • LINQ: Language Integrated Query for in memory objects (LINQ to Objects)
  • DLINQ: Language Integrated Query for databases (LINQ to ADO NET)
  • XLINQ: Language Integrated Query for XML (LINQ to XML)
Over here for showing examples, I have used only object collection. So everyone can try out these samples within few minutes.

1) So, let’s start with simplest example of LINQ.
int[] numbers = { 4, 5, 3, 1, 9, 8, 6, 7, 2, 0 };
// other operators that can be used are &&, ==,> etc…
var firstFive = from n in numbers where n < 5 select n; //This will filter the collection and if you print firstFive then it would show 4, 3, 1, 2, 0.

2) We can even use two collection to filter the objects for e.g.
string[] digits = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };
var lowNums = from n in numbers where n < 5 select digits[n]; // This will filter the collection and if you print lowNums then it would show four, three, one, two, zero.

3) We can also perform some arithmetic operation. For e.g.
If we want to add 1 in all digit of numbers collection before we use it to render. We can do that using + sign. i.e.
var numsPlusOne = from n in numbers select n + 1; // As a result if we print numsPlusOne collection it would print like 5, 6, 4 and so on. Similarly we can use other arithmetic signs -, * and /

4) It is also possible with LINQ to use ToLower and ToUpper for e.g.
string[] words = { "aPPLE", "BlUeBeRrY", "cHeRry" };
var LowerWords = from w in words select w.ToLower(); // As a result if we print LowerWords it would print like apple, blueberry, cherry.

5) Taking particular items or skipping them would be easy with LINQ for e.g.
var first3Numbers = numbers.Take(3); //will print 4, 5, 3
var allButFirst7Numbers = numbers.Skip(7); //will print 7, 2, 0

6) Even taking particular items with condition or skipping them would be possible with LINQ for e.g.
var firstNumbersLessThan6 = numbers.TakeWhile(n => n < 6); //will result as first four digit 4, 5, 3, 1.
var firstNumbersLessThan6 = numbers.SkipWhile(n => n < 6); //will result as last six digit 9, 8, 6, 7, 2, 0.

7) We can also use orderby with LINQ for e.g
string[] words = { "cherry", "apple", "blueberry" };
var sortedWords = from w in words orderby w select w; //this will result as apple, blueberry, cherry.

8) We can also reverse the collection using LINQ for e.g
var firstFiveReverse = (from n in numbers where n < 5 select n).Reverse(); //will result as 0, 2, 1, 3, 4.

9) It is also possible to use distinct or group by with LINQ for e.g.
int[] Factors = { 2, 2, 3, 5, 5 };
var uniqueFactors = Factors.Distinct(); will print 2, 3, 5.

10) We can use union, intersect and except with LINQ for e.g.
int[] numbersA = { 0, 2, 4, 5, 6, 8, 9 };
int[] numbersB = { 1, 3, 5, 7, 8 };
var uniqueNumbers = numbersA.Union(numbersB); // this will print all unique numbers from both the collection.
IEnumerable aOnlyNumbers = numbersA.Except(numbersB);// this will print all numberA’s digit except numbersB’s digit.
var commonNumbers = numbersA.Intersect(numbersB); //this will print common numbers of both the collection.

11) The conversion of collection object to list, array or dictionary is possible using LINQ for e.g.
string[] words = { "cherry", "apple", "blueberry" };
var sortedWords = from w in words orderby w select w;
var wordList = sortedWords.ToList(); // here we have converted string array to list.

12) You can even find out particular type of item from the object collection for e.g.
object[] numbers = { null, 1.0, "two", 3, 4.0f, 5, "six", 7.0 };
var doubles = numbers.OfType(); //will print 1.0, 7.0

13) One can search first element or element at any particular position.
int firstNumOrDefault = numbers.First(); //will print 4.
int fourthLowNum = (from n in numbers where n < 5 select n).ElementAt(3); //will print 1.

14) We can use count, min, max, sum, average, aggregate with LINQ.
var uniqueFactorsCount = Factors.Distinct().Count(); //will print 3.
Same way of Count() we can use any of the above function.

15) We can also use concat functionality with LINQ.
var allNumbers = numbersA.Concat(numbersB); //this will print 0, 2, 4, 5, 6, 8, 9, 1, 3, 5, 7, 8.

I feel once we understand the capability and usage of LINQ then we will start implementing it in our day to day programming. So this is just an effort to give some basic idea about what we can do with LINQ. I feel this is at least enough to start with.