<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-556559323835562341</id><updated>2024-08-28T00:51:50.182-07:00</updated><category term="closure"/><category term="self invoking function"/><title type='text'>All about Technology</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://versasolution.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://versasolution.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-556559323835562341.post-2676736262129625859</id><published>2011-04-29T10:39:00.000-07:00</published><updated>2011-04-29T10:39:19.803-07:00</updated><title type='text'>What is Unobtrusive JavaScript?</title><content type='html'>If we look at the dictionary, the word obtrusive means &quot;having or showing a disposition to obtrude, as by imposing onself or one&#39;s opinions on others&quot;. The synonyms are as interfering, meddlesome, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hence, unobtrusive is just the opposite of obtrusive i.e non interfering or meddlesome.&lt;br /&gt;
Unobtrusive Javascript as it suggest just means non-interfering or non-meddlesome javascript.&lt;br /&gt;
&lt;br /&gt;
If we are able to remove the javascript from the source document and place it in an external file, then we are alomost there to say we have achieved unobtrusive javascript. The reason we stressed almost there is because &quot;unobtrusive javascript&quot; is a technique where we separate the behaviour layer from the presentation layer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
ch_client = &quot;Versasolution&quot;;
ch_width = 550;
ch_height = 250;
ch_type = &quot;mpu&quot;;
ch_sid = &quot;Chitika Default&quot;;
ch_backfill = 1;
ch_color_site_link = &quot;0000cc&quot;;
ch_color_title = &quot;0000cc&quot;;
ch_color_border = &quot;ffffff&quot;;
ch_color_text = &quot;000000&quot;;
ch_color_bg = &quot;ffffff&quot;;
&lt;/script&gt;&lt;br /&gt;
&lt;script src=&quot;http://scripts.chitika.net/eminimalls/amm.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://versasolution.blogspot.com/feeds/2676736262129625859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://versasolution.blogspot.com/2011/04/what-is-unobtrusive-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/2676736262129625859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/2676736262129625859'/><link rel='alternate' type='text/html' href='http://versasolution.blogspot.com/2011/04/what-is-unobtrusive-javascript.html' title='What is Unobtrusive JavaScript?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-556559323835562341.post-6278188278858420934</id><published>2011-04-25T21:40:00.000-07:00</published><updated>2011-04-25T21:40:02.390-07:00</updated><title type='text'>Javascript : Closer look at closure</title><content type='html'>Closure as defined in &quot;Javascript closures for dummies&quot; : &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;a closure is the local variables for a function - kept alive &lt;em&gt;after&lt;/em&gt; the function has returned, or&lt;/li&gt;
&lt;li&gt;a closure is a stack-frame which is &lt;em&gt;not deallocated&lt;/em&gt; when the function returns. (as if a &#39;stack-frame&#39; were malloc&#39;ed instead of being on the stack!)&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://versasolution.blogspot.com/feeds/6278188278858420934/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://versasolution.blogspot.com/2011/04/javascript-closer-look-at-closure.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/6278188278858420934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/6278188278858420934'/><link rel='alternate' type='text/html' href='http://versasolution.blogspot.com/2011/04/javascript-closer-look-at-closure.html' title='Javascript : Closer look at closure'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-556559323835562341.post-308868680278150305</id><published>2011-04-25T19:17:00.000-07:00</published><updated>2011-04-25T19:17:25.455-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="closure"/><category scheme="http://www.blogger.com/atom/ns#" term="self invoking function"/><title type='text'>Javascript : Self-invoking functions  :   function() { } ();</title><content type='html'>A self invoking function is one that&#39;s invoked as soon as it&#39;s declared. &lt;br /&gt;
They are they run immediately upon read by the browser.&lt;br /&gt;
&lt;br /&gt;
Understanding this concept will help you to understand closure in javascript. &lt;br /&gt;
&lt;br /&gt;
[code : javascript ]&lt;br /&gt;
&amp;nbsp;var obj = function () {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var private1 = 1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var private2 = 2;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var priv_func = function () {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(private1);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public1: &#39;one&#39;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public2: &#39;two&#39;,&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pub_func: function () {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(this.public1);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(private2);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;[code : html]&lt;br /&gt;
&amp;lt;input type=&quot;button&quot; value=&quot;click me&quot; onclick=&quot;obj.pub_func();&quot; /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If you run the above example you will probably receive an error message like &quot; Object doesn&#39;t support property or method &#39;pub_func&#39;&quot;. The reason being the object is not created yet.&lt;br /&gt;
&lt;br /&gt;
Well, we have a solution to this problem in javascript in the form of &quot;self invoking function&quot;. We will need to get the browser invoke it as soon as it is definded by insert &quot;( );&quot; at the end of the function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;[code : javascript ]&lt;br /&gt;
&amp;nbsp;var obj = function () {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var private1 = 1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var private2 = 2;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var priv_func = function () {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(private1);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public1: &#39;one&#39;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public2: &#39;two&#39;,&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pub_func: function () {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(this.public1);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(private2);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } ();</content><link rel='replies' type='application/atom+xml' href='http://versasolution.blogspot.com/feeds/308868680278150305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://versasolution.blogspot.com/2011/04/javascript-self-invoking-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/308868680278150305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/308868680278150305'/><link rel='alternate' type='text/html' href='http://versasolution.blogspot.com/2011/04/javascript-self-invoking-functions.html' title='Javascript : Self-invoking functions  :   function() { } ();'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-556559323835562341.post-9211548053196144976</id><published>2010-08-24T08:25:00.000-07:00</published><updated>2010-08-24T08:26:34.858-07:00</updated><title type='text'>Don&#39;t get caught up with IComparable and IComparer, just implement it.</title><content type='html'>IComparable and IComparer sounds similar but don&#39;t get caught up by their name, even though they have similar names they serve different purpose.&lt;br /&gt;
If we want to have an ability of sorting or comparison capability for our custom objects, then we must impelment either or both of these interfaces.&lt;br /&gt;
&lt;br /&gt;
Lets start by creating an object called &quot;Employee&quot; and add them to a list called employees.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;class Employee &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string Name { get; set; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public int Id { get; set; }&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;color: #38761d;&quot;&gt;static void Main(string[] args)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var employees = new List&amp;lt;Employee&amp;gt;();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; employees.Add(new Employee { Id = 6666, Name = &quot;Jack&quot; });&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; employees.Add(new Employee { Id = 1111, Name = &quot;John&quot; });&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; employees.Add(new Employee { Id = 2222, Name = &quot;David&quot; });&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;br /&gt;
Now, if your try to sort this by&lt;br /&gt;
employees.Sort() then you will get and exception :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #e06666;&quot;&gt;InvalidOperationException was unhandled&lt;/div&gt;&lt;div style=&quot;color: #e06666;&quot;&gt;&quot;Failed to compare two elements in the array.&quot;&lt;/div&gt;&lt;div style=&quot;color: #e06666;&quot;&gt;Inner Exception : {&quot;At least one object must implement IComparable.&quot;}&lt;/div&gt;&lt;br /&gt;
In other words, the error is asking us what we mean&amp;nbsp;by sorting employees.&lt;br /&gt;
&amp;nbsp;Well, it is clear from the exception that we need to implement the IComparable interface to be able to sort the employees list.&lt;br /&gt;
&lt;div style=&quot;background-color: #ffe599;&quot;&gt;IComparable is used for comparing two objects of a particular type. It can be thought of as default sort provider for our objects.&lt;/div&gt;Hence, we implment the IComparable as follows :&lt;br /&gt;
&lt;div style=&quot;color: #134f5c;&quot;&gt;class Employee : IComparable&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string Name { get; set; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public int Id { get; set; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Implement IComparable CompareTo method - provide default sort order.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int IComparable.CompareTo(object obj)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Employee c = (Employee)obj;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return String.Compare(this.Name, c.Name);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #e06666;&quot;&gt;The IComparable requires the implementation of a method called CompareTo.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now if you do&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;employees.Sort() , &lt;/span&gt;&lt;/b&gt;it will sort based on the Name.&lt;br /&gt;
ICompares is similar to IComparable but it can provide additional comparison mechanisms. We may want to sort our list in descending / ascending order or may want to order our object based on several fields or properties, it is all achieveable by using IComparer.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #e06666;&quot;&gt;IComparer requires the implementation of the method called Compare and takes two parameters&lt;/span&gt;. They are two objects we are going to compare.&lt;br /&gt;
&lt;br /&gt;
We can implement IComparer as follows :&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;class EmployeeComparer : IComparer&amp;lt;Employee&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public int Compare(Employee emp1, Employee emp2)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (emp1 == null &amp;amp; emp2 == null)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (emp1 == null)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return -1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (emp2 == null)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (emp1.Id &amp;lt; emp2.Id)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return -1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (emp1.Id == emp2.Id)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Once you have implmented the IComparer you will be able to use&lt;br /&gt;
&lt;b style=&quot;color: #351c75;&quot;&gt;employees.Sort(new EmployeeComparer());&amp;nbsp;&lt;/b&gt;&amp;nbsp; to do you comparison.&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;References&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: white;&quot;&gt;http://www.aspfree.com/c/a/C-Sharp/Building-Csharp-Comparable-Objects-IComparable-versus-IComparer/2/&lt;/div&gt;&lt;div style=&quot;color: white;&quot;&gt;http://support.microsoft.com/kb/320727&lt;/div&gt;&lt;div style=&quot;color: white;&quot;&gt;http://codebetter.com/blogs/david.hayden/archive/2005/03/06/56584.aspx&lt;/div&gt;&lt;div style=&quot;color: white;&quot;&gt;http://dpatrickcaldwell.blogspot.com/2009/03/implementing-icomparer-in-c.html&lt;/div&gt;&lt;span style=&quot;color: white;&quot;&gt;http://www.c-sharpcorner.com/uploadfile/camurphy/csharplists03302006170209pm/csharplists.aspx&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://versasolution.blogspot.com/feeds/9211548053196144976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://versasolution.blogspot.com/2010/08/dont-get-caught-up-with-icomparable-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/9211548053196144976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/9211548053196144976'/><link rel='alternate' type='text/html' href='http://versasolution.blogspot.com/2010/08/dont-get-caught-up-with-icomparable-and.html' title='Don&#39;t get caught up with IComparable and IComparer, just implement it.'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-556559323835562341.post-4427040918626232199</id><published>2010-08-23T09:03:00.000-07:00</published><updated>2010-08-23T20:07:39.286-07:00</updated><title type='text'>C# - Fibonacci  and lambda expression using Func Delegate</title><content type='html'>All of us who deal with C# in day to day&amp;nbsp;life must have come across Func&lt;span xmlns=&quot;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;typeparameter&quot;&gt;T&lt;/span&gt;, &lt;span class=&quot;typeparameter&quot;&gt;TResult&lt;/span&gt;&lt;span xmlns=&quot;&quot;&gt;&amp;gt;&lt;/span&gt; Delegate many times, where T is the type of the parameter of the method and TResult the type of the return value of the method that this delegate encapsulates.&lt;br /&gt;
&lt;br /&gt;
Lets try using Func on the Fibonacci squence.&lt;br /&gt;
&lt;div style=&quot;background-color: lime;&quot;&gt;Fibonacci sequence is a sequence of the numbers where the next number is found by adding up the two numbers before it.&lt;/div&gt;eg.&lt;br /&gt;
&lt;span class=&quot;large&quot;&gt;0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span class=&quot;large&quot;&gt;2 is found by adding the two numbers before it(1+1)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;large&quot;&gt;3 is found by adding the two numbers before it(1+2)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span class=&quot;large&quot;&gt;&lt;/span&gt;&lt;br /&gt;
This Fibonacci Sequence can be written as a &quot;Rule&quot; :&lt;br /&gt;
&lt;div class=&quot;larger&quot; style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The Rule is &lt;b&gt;x&lt;sub&gt;n&lt;/sub&gt; = x&lt;sub&gt;n-1&lt;/sub&gt; + x&lt;sub&gt;n-2&lt;/sub&gt;&lt;/b&gt;&lt;/div&gt;&lt;div align=&quot;center&quot; class=&quot;larger&quot;&gt;&lt;br /&gt;
&lt;/div&gt;where:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;x&lt;sub&gt;n&lt;/sub&gt;&lt;/b&gt; is term number &quot;n&quot;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;x&lt;sub&gt;n-1&lt;/sub&gt;&lt;/b&gt; is the previous term (n-1)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;x&lt;sub&gt;n-2&lt;/sub&gt;&lt;/b&gt; is the term before that (n-2)&lt;/li&gt;
&lt;/ul&gt;There are many ways we can write the &quot;Fibonacci&quot; in C#:&lt;br /&gt;
&lt;br /&gt;
A.&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;public static int Fibonacci(int n)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int previous = -1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int result = 1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt;= n; i++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int sum = result + previous;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; previous = result;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = sum;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return result;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
B.&lt;br /&gt;
&lt;div style=&quot;color: #38761d;&quot;&gt;static int Fibonacci (int x)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; if (x &amp;lt;= 1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; return Fibonacci (x-1) + Fibonacci (x-2);&lt;br /&gt;
}&lt;/div&gt;C. Using the .Net 3.5 we can wirte this using Func&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;static void Main()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;Func&amp;lt;int, int&amp;gt; fib = null;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;fib = n =&amp;gt; n &amp;gt; 1 ? fib(n - 1) + fib(n - 2) : n;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(fib.Invoke(10)); &lt;br /&gt;
}&lt;/div&gt;&lt;div style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;Other example of Func :&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;static void Main()&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; Func&amp;lt;int, string&amp;gt; funcTest = (x) =&amp;gt; string.Format(&quot;String is = {0}&quot;, x);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;}&amp;nbsp;&lt;/span&gt; &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://versasolution.blogspot.com/feeds/4427040918626232199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://versasolution.blogspot.com/2010/08/c-fibonacci-and-lambda-expression-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/4427040918626232199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/4427040918626232199'/><link rel='alternate' type='text/html' href='http://versasolution.blogspot.com/2010/08/c-fibonacci-and-lambda-expression-using.html' title='C# - Fibonacci  and lambda expression using Func&lt;T, TResult&gt; Delegate'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-556559323835562341.post-3290702110366245118</id><published>2010-08-22T05:58:00.000-07:00</published><updated>2010-08-22T05:58:56.710-07:00</updated><title type='text'>Protect your Data in USB via BitLocker</title><content type='html'>Out of many data encryption packages, &quot;BitLocker&quot; is one of them.&lt;br /&gt;
We all face the same problem of securing our USB drives from the prying eyes. Well, &lt;b&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;BitLocker comes with Windows 7 Ultimate edition&lt;/span&gt;&lt;/b&gt; for our &lt;b&gt;rescue&lt;/b&gt; and it is easy to setup.&lt;br /&gt;
Just Right-click your USB drive select &quot;Turn on BitLocker&quot; and follow the easy instructions to protect your private files.</content><link rel='replies' type='application/atom+xml' href='http://versasolution.blogspot.com/feeds/3290702110366245118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://versasolution.blogspot.com/2010/08/protect-your-data-in-usb-via-bitlocker.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/3290702110366245118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/3290702110366245118'/><link rel='alternate' type='text/html' href='http://versasolution.blogspot.com/2010/08/protect-your-data-in-usb-via-bitlocker.html' title='Protect your Data in USB via BitLocker'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-556559323835562341.post-152081174863931492</id><published>2010-08-22T05:43:00.000-07:00</published><updated>2010-08-22T05:43:44.242-07:00</updated><title type='text'>Computer - Evil Maid attack</title><content type='html'>While researching the net over the security, I came across the term &quot;Evil Maid&quot; attack.&lt;br /&gt;
So, what is the &quot;Evil maid&quot; attack?&lt;br /&gt;
&lt;br /&gt;
Well, here&#39;s the story.&lt;br /&gt;
Lets assume you leave you laptop in a hotel room and go lunch/dinner. The house maid comes in to clean the room.But, she is just any ordinary house maid, while she is there she installs the boot loader and key logger, then shuts down your laptop.&lt;br /&gt;
You return to the hotel room, you power on your laptop, enter the passphrase,  do you work.&lt;br /&gt;
The next day, when the maid returns, she  returns, most likely to either retrieve the key and restore the previous  boot loader, erasing her tracks.&lt;br /&gt;
Now she has access to your data, can  image the drive for offline analysis and perform all sort of nasty stuffs as desired. Hence, the term &quot;Evil Maid&quot;.</content><link rel='replies' type='application/atom+xml' href='http://versasolution.blogspot.com/feeds/152081174863931492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://versasolution.blogspot.com/2010/08/computer-evil-maid-attack.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/152081174863931492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/152081174863931492'/><link rel='alternate' type='text/html' href='http://versasolution.blogspot.com/2010/08/computer-evil-maid-attack.html' title='Computer - Evil Maid attack'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-556559323835562341.post-2803722061185709330</id><published>2010-08-20T07:53:00.000-07:00</published><updated>2010-08-20T07:53:59.182-07:00</updated><title type='text'>What is Encapsulation and Ripple Effects?</title><content type='html'>When we hear the word &quot;encapsulation&quot; we think about &quot;the condition of being enclosed&quot;. This concept may be similar in the programming world but we got to think what is encapsulation used for?&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #134f5c;&quot;&gt;Are we encapsulating the object to protect the object or could it be for something else?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Generally, encapsulation is often mistook for the information hiding. Of course, it can be used for information hiding but encapsulating an object is not about securing/protecting the object. &quot;Encapsulation is about freeing your consumer from the knowledge of your implementation details. By doing so, you insulate your consumer from any ripple effect of changes to your implementation&quot; ( from &lt;a href=&quot;http://thetechcandy.wordpress.com/2010/01/04/encapsulation-is-not-information-hiding&quot;&gt;http://thetechcandy.wordpress.com/2010/01/04/encapsulation-is-not-information-hiding&lt;/a&gt;&quot;).&lt;br /&gt;
&lt;br /&gt;
Let me elaborate this, No matter how hard we try, we will often need to go back and modify the code after an application has been deployed. This could be due to the design flaw, change in requirement or many other reason.Eventually, this can lead us to the ripple effect where we will need to change many lines of code throughout application and retest them all. Now, if we have used encapsulation correctly we can change the private data structure without affecting how an object belonging to that class gets used in client code.</content><link rel='replies' type='application/atom+xml' href='http://versasolution.blogspot.com/feeds/2803722061185709330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://versasolution.blogspot.com/2010/08/what-is-encapsulation-and-ripple.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/2803722061185709330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/2803722061185709330'/><link rel='alternate' type='text/html' href='http://versasolution.blogspot.com/2010/08/what-is-encapsulation-and-ripple.html' title='What is Encapsulation and Ripple Effects?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-556559323835562341.post-1258238772449477997</id><published>2010-08-20T00:43:00.000-07:00</published><updated>2010-08-20T00:43:31.045-07:00</updated><title type='text'>WCF - The document format is not recognized (the content type is &#39;text/html; charset=UTF-8&#39;).</title><content type='html'>Well, I faced a strange issue today while trying to deploy my WCF Service on a server.&lt;br /&gt;
&lt;br /&gt;
Everything seemed to work perfectly, and I can even see the service on my browser, until when I tried to test this through a &quot;wcftestclient&quot; I encountered this error message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;Error: Cannot obtain Metadata from http://192.168.0.15:8090/service.svc &lt;/span&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the &lt;/span&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;specified address. &lt;/span&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.&lt;/span&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;WS-Metadata Exchange Error&amp;nbsp;&amp;nbsp;&amp;nbsp; URI: http://192.168.0.15:8090/service.svc&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;Metadata contains a reference that cannot be resolved: &#39;http://192.168.0.15:8090/service.svc&#39;.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;There was no endpoint listening at http://192.168.0.15:8090/service.svc that could accept the message. &lt;/span&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;This is often caused by an incorrect address or SOAP action. &lt;/span&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;See InnerException, if present, for more details.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;The remote server returned an error: (404) Not Found.HTTP GET Error&amp;nbsp;&amp;nbsp;&amp;nbsp; URI: http://192.168.0.15:8090/service.svc&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;The document at the url http://192.168.0.15:8090/service.svc was not recognized as a known document type.The error message from each known type may help &lt;/span&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;you fix the problem:-&lt;/span&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&amp;nbsp;Report from &#39;http://192.168.0.15:8090/service.svc&#39; is &#39;The document format is not recognized (the content type is &#39;text/html; charset=UTF-8&#39;).&#39;.- &lt;/span&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;Report from &#39;DISCO Document&#39; is &#39;There was an error downloading &#39;http://&lt;b&gt;myComputer.mydomain.local&lt;/b&gt;:8090/Service.svc?disco&#39;.&#39;.&amp;nbsp; -&lt;/span&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;The remote name could not be resolved: &#39;&lt;b&gt;myComputer.mydomain.local&lt;/b&gt;&#39;- Report from &#39;WSDL Document&#39; is &#39;The document format is not recognized (the content type is &lt;/span&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&#39;text/html; charset=UTF-8&#39;).&#39;.- &lt;/span&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;br style=&quot;color: #351c75;&quot; /&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;Report from &#39;XML Schema&#39; is &#39;&lt;u&gt;The document format is not recognized (the content type is &#39;text/html; charset=UTF-8&#39;).&lt;/u&gt;&#39;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I could not figure out what the issue was. It worked perfectly on other machine and it was basically the copy from the other server. But I was getting the above error.&lt;br /&gt;
&lt;br /&gt;
After trying for couple of ours from my machine connecting to this server. I decide I will install free version of &quot;WCFStorm-Lite&quot; on the server and see I can download the meta-data on the &#39;wcftestclient&#39;. And guess, what I was able to do it, which puzzled me more.&lt;br /&gt;
&lt;b&gt;Why would it run on the local mahince but not over the network??&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Well, the answer my friend is in the question itself. Some the DNS address of the server I was trying to connect to wasn&#39;t registered by our IT department.&lt;br /&gt;
Hence, what was happening was whenever I try to connect to the ip-address, to get the meta-data it was actually trying to connect to &quot;myComputer.myDomain.local&quot; but since &quot;myComputer.myDomain.local&quot; was configured for any ip-address it was getting lost.&lt;br /&gt;
&lt;br /&gt;
Hence, what I had to do was to get my &quot;IT Department&quot; to register &quot;myComputer.myDomain.local&quot; for the ip-address &quot;192.168.0.15&quot;. Even tested this my trying to &quot;&lt;span style=&quot;color: #990000;&quot;&gt;ping myComputer.myDomain.local&lt;/span&gt;&quot; which resolved to &lt;span style=&quot;color: #990000;&quot;&gt;192.168.0.15&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #7f6000;&quot;&gt;&lt;b&gt;Finally, tested the WCFTestClient and it worked like a charm.&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
If any of you out there are having the same issue try the solution above, it may fix your issue as well.&lt;br /&gt;
Good Luck.</content><link rel='replies' type='application/atom+xml' href='http://versasolution.blogspot.com/feeds/1258238772449477997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://versasolution.blogspot.com/2010/08/wcf-document-format-is-not-recognized.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/1258238772449477997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/1258238772449477997'/><link rel='alternate' type='text/html' href='http://versasolution.blogspot.com/2010/08/wcf-document-format-is-not-recognized.html' title='WCF - The document format is not recognized (the content type is &#39;text/html; charset=UTF-8&#39;).'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-556559323835562341.post-7952547331347073247</id><published>2010-08-19T02:02:00.000-07:00</published><updated>2010-08-19T02:02:41.385-07:00</updated><title type='text'>TestCaseAttribute  a friend in NUnit</title><content type='html'>Most of us are already familiar with the NUnit. I hope we all have written lots and lots of test cases to check our code. Among many attributes of NUnit, one of my favourite is a&amp;nbsp; &#39;TestCaseAttribute&#39;.&lt;br /&gt;
&lt;br /&gt;
As quoted on Nunit.org &quot;&lt;b&gt;TestCaseAttribute&lt;/b&gt; serves the dual purpose of marking a method with    parameters as a test method and providing inline data to be used when    invoking that method.&quot;&lt;br /&gt;
&lt;br /&gt;
This attribute helps us to run few common test on a single go and also helps us to group thest test cases together.&lt;br /&gt;
eg.&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;summary&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ///&lt;span style=&quot;color: #38761d;&quot;&gt;A test for Divide&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ///&amp;lt;/summary&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;span style=&quot;color: #38761d;&quot;&gt;TestCase&lt;/span&gt;(12, 3, Result = 4)]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;span style=&quot;color: #38761d;&quot;&gt;TestCase&lt;/span&gt;(12, 2, Result = 6)]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;span style=&quot;color: #38761d;&quot;&gt;TestCase&lt;/span&gt;(12, 4, Result = 3)]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;span style=&quot;color: #38761d;&quot;&gt;TestCase&lt;/span&gt;(12, 0, ExpectedException = typeof(System&lt;span style=&quot;color: #38761d;&quot;&gt;.DivideByZeroException&lt;/span&gt;),&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TestName = &quot;&lt;span style=&quot;color: red;&quot;&gt;DivisionByZeroThrowsExceptionType&lt;/span&gt;&quot;)]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;span style=&quot;color: #38761d;&quot;&gt;TestCase&lt;/span&gt;(12, 0, ExpectedExceptionName = &quot;&lt;span style=&quot;color: red;&quot;&gt;System.DivideByZeroException&lt;/span&gt;&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TestName = &quot;&lt;span style=&quot;color: red;&quot;&gt;DivisionByZeroThrowsException&lt;/span&gt;&quot;)]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; public double&lt;/span&gt; DivideTest(&lt;span style=&quot;color: #0b5394;&quot;&gt;int &lt;/span&gt;x , &lt;span style=&quot;color: #0b5394;&quot;&gt;int &lt;/span&gt;y)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #0b5394;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;Functions&lt;/span&gt;.Divide(x, y);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmo0zFYkxt0XV5uILa4BVVQVQy2dN1niuLRPEK-bn3xni-ZxM1z5_HiKpSnPFLBd7F7TgU6PexHPrx9kLDR5QENghH2rZijaKbAOrHEGJalx7M_Bjg9voKpQUQiNHj2SFM0KVx7OblLa0/s1600/nunitTestCaseAttribute.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmo0zFYkxt0XV5uILa4BVVQVQy2dN1niuLRPEK-bn3xni-ZxM1z5_HiKpSnPFLBd7F7TgU6PexHPrx9kLDR5QENghH2rZijaKbAOrHEGJalx7M_Bjg9voKpQUQiNHj2SFM0KVx7OblLa0/s320/nunitTestCaseAttribute.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;I hope we can all use this attribute and use this functionality to make our life lot easier.</content><link rel='replies' type='application/atom+xml' href='http://versasolution.blogspot.com/feeds/7952547331347073247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://versasolution.blogspot.com/2010/08/testcaseattribute-friend-in-nunit.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/7952547331347073247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/7952547331347073247'/><link rel='alternate' type='text/html' href='http://versasolution.blogspot.com/2010/08/testcaseattribute-friend-in-nunit.html' title='TestCaseAttribute  a friend in NUnit'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmo0zFYkxt0XV5uILa4BVVQVQy2dN1niuLRPEK-bn3xni-ZxM1z5_HiKpSnPFLBd7F7TgU6PexHPrx9kLDR5QENghH2rZijaKbAOrHEGJalx7M_Bjg9voKpQUQiNHj2SFM0KVx7OblLa0/s72-c/nunitTestCaseAttribute.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-556559323835562341.post-2654449285595110966</id><published>2010-08-17T23:07:00.001-07:00</published><updated>2010-08-17T23:10:17.736-07:00</updated><title type='text'>Adding new template to your blog.</title><content type='html'>&lt;a href=&quot;http://about-new-blogger.blogspot.com/&quot;&gt;http://about-new-blogger.blogspot.com/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.betatemplates.com/2009/06/submit-site-sitemap-to-google.html&quot;&gt;http://www.betatemplates.com/2009/06/submit-site-sitemap-to-google.html &lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://versasolution.blogspot.com/feeds/2654449285595110966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://versasolution.blogspot.com/2010/08/adding-new-template-to-your-blog.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/2654449285595110966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/2654449285595110966'/><link rel='alternate' type='text/html' href='http://versasolution.blogspot.com/2010/08/adding-new-template-to-your-blog.html' title='Adding new template to your blog.'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-556559323835562341.post-1569977207972827365</id><published>2010-08-17T22:27:00.000-07:00</published><updated>2010-08-17T22:27:49.828-07:00</updated><title type='text'>A new wave of click-jacking exploiting the browser saved password feature</title><content type='html'>A good friend of mine Anthony sent this today. I thought I will make everyone aware of this a well.&lt;br /&gt;
&lt;br /&gt;
Click jacking has always been something of a not-so-useful attack due to the majority of sites that could be exploited using click jacking requiring some form of manual input.&amp;nbsp; Not so anymore. The advent of the Facebook ‘Like this’ button and variants has given attackers a new way to exploit click-jacking by hiding a transparent “Like this” button over an apparent link or other button. When the user clicks what they think is a link or innocuous button, the “Like this” button receives the click instead and signs the user up as a fan of a malicious site. This works in two ways. First, it gives immediate access to profile information and pictures that are viewable by friends, as well as the names and account ids of your personal friends. Secondly, attackers are using these tricks to build fake trust by giving pages that have links to malware or other exploits thousands of “fans”. Once trust has been established, an attacker may attempt to trick users into installing a malicious Facebook app, visit a malicious website, or to post messages on the user’s wall to attempt to socially engineer the user’s friends into being compromised as well.&lt;br /&gt;
&lt;br /&gt;
Another attack vector growing in popularity involves Trojan/malware that target the saved-password feature present in modern browsers. These attacks can be fairly sophisticated, examining the user’s browser history for likely targets then using injection techniques to get the browser to auto-fill the username and password fields in a hidden form which can then be read by the software. Other variants monitor the active browser tab for password fields and attempt to capture any automatically filled information when a user visits a site they have saved credentials for. Of these, a new malicious “do it yourself” tool known as Facebook Hacker is a very striking example of how these attacks are being commoditized. Facebook Hacker presents a simple configuration form for the attacker to fill in, and a build button which will take that configuration and build an executable that contains a variety of exploit modules designed to read the protected password stores of many modern browsers, Instant messaging clients, and email applications. There are also modules to enumerate the credentials for dialup and VPN connections. The captured data is transmitted over a TLS secured link to the configured repository. Along with the password gathering, Facebook Hacker presents an additional threat as it will attempt to disable recognised anti-virus applications, firewall software, and packet inspection systems, leaving the compromised computer vulnerable to infections from other sources.&lt;br /&gt;
&lt;br /&gt;
A recent study reported that of the samples captured information, 75% of users use the same password for email and other applications. For security purposes, it is highly recommended that at the minimum users should have separate passwords for all sensitive applications and only use a common password for services that do not contain sensitive or personally identifiable information. Passwords can be constructed using a scheme that incorporates the purpose of the password allowing for complex but easily remembers passwords to be used for different sensitive services.</content><link rel='replies' type='application/atom+xml' href='http://versasolution.blogspot.com/feeds/1569977207972827365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://versasolution.blogspot.com/2010/08/new-wave-of-click-jacking-exploiting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/1569977207972827365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/1569977207972827365'/><link rel='alternate' type='text/html' href='http://versasolution.blogspot.com/2010/08/new-wave-of-click-jacking-exploiting.html' title='A new wave of click-jacking exploiting the browser saved password feature'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-556559323835562341.post-3519298978299387867</id><published>2010-08-16T06:36:00.000-07:00</published><updated>2010-08-16T06:36:07.874-07:00</updated><title type='text'>Unit Testing , NUnit and Assert</title><content type='html'>&lt;blockquote&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;Unit Testing &lt;/span&gt;&lt;/blockquote&gt;Most of us are used to testing the software once it completes the software development cycle. And many of us have a perspective of testing being just bug-fixing. Testing the software at the very end results in error detection at the very end as well, which may result in costing us more than if we had known the issue at the early stage.&lt;br /&gt;
&lt;br /&gt;
Unit testing is a method by which we can test the usability of the piece of our source code. It helps us to determine the function we have written is fit to be used.&lt;br /&gt;
Moreover, it also helps us to determince if the function we have written still works at the later date, hence, helping us in regression testing.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;NUnit&lt;/span&gt;&lt;/blockquote&gt;NUnit is one of the many tools we can use for Unit Testing.&lt;br /&gt;
It is an open source product which can be downloaded from &lt;a href=&quot;http://www.nunit.org/&quot;&gt;http://www.nunit.org&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
NUnit requires test cases and one or more test fixtures. Each test must contain at least one assertion.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;Example&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
Lets assume we want to test this function&lt;br /&gt;
&amp;nbsp;public static int Divide(int x, int y)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return x / y;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
To test this function in NUnit , we are required to create a test fixture and then a test itself.&lt;br /&gt;
&lt;br /&gt;
[TestFixture]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public class FunctionsTest&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Test]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void DivideTest()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Assert.AreEqual(4, Divide(12, 3));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }</content><link rel='replies' type='application/atom+xml' href='http://versasolution.blogspot.com/feeds/3519298978299387867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://versasolution.blogspot.com/2010/08/unit-testing-nunit-and-assert.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/3519298978299387867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/3519298978299387867'/><link rel='alternate' type='text/html' href='http://versasolution.blogspot.com/2010/08/unit-testing-nunit-and-assert.html' title='Unit Testing , NUnit and Assert'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-556559323835562341.post-7889937020584893410</id><published>2010-08-13T15:18:00.000-07:00</published><updated>2010-08-13T15:18:25.809-07:00</updated><title type='text'>What is  Modular  , Object-Based and Object-Oriented?</title><content type='html'>Lets clear our mind.&lt;br /&gt;
What is Modular ?&lt;br /&gt;
What is Object-based?&lt;br /&gt;
What is Object-Oriented ? How are they different?&lt;br /&gt;
&lt;br /&gt;
If a language only supports encapsulation of objects it is modular.&lt;br /&gt;
But, if it supports encapsulation and polymorphism it is object based.&lt;br /&gt;
Whereas, if a language supports encapsulation, polymorphism and inheritance is it Object-Oriented.</content><link rel='replies' type='application/atom+xml' href='http://versasolution.blogspot.com/feeds/7889937020584893410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://versasolution.blogspot.com/2010/08/what-is-modular-object-based-and-object.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/7889937020584893410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/556559323835562341/posts/default/7889937020584893410'/><link rel='alternate' type='text/html' href='http://versasolution.blogspot.com/2010/08/what-is-modular-object-based-and-object.html' title='What is  Modular  , Object-Based and Object-Oriented?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>