Tuesday, October 26, 2010

Snagit Screen Capture Software



“Snagit is the most useful tool you will find to combine pictures, words, and other objects into a meaningful illustration…”

Monday, October 25, 2010

Sandcastle (software)

Sandcastle is a documentation generator from Microsoft that automatically produces MSDN style reference documentation out of reflection information of .NET assemblies and XML documentation comments found in the source code of these assemblies. It can also be used to produce compiled user documentation from Microsoft Assistance Markup Language (MAML) with the same look and feel as reference documentation.


Sandcastle Help File Builder

Sandcastle, created by Microsoft, is a tool used for creating MSDN-style documentation from .NET assemblies and their associated XML comments files. The current version is the May 2008 release. It is command line based and has no GUI front-end, project management features, or an automated build process like those that you can find in NDoc. The Sandcastle Help File Builder was created to fill in the gaps, provide the missing NDoc-like features that are used most often, and provide graphical and command line based tools to build a help file in an automated fashion.

Thursday, August 19, 2010

How to replace selected textarea value using javascript

  1. // code for IE
  2. var textarea = document.getElementById("textarea");
  3. if (document.selection)
  4. {
  5. textarea.focus();
  6. var sel = document.selection.createRange();
  7. // alert the selected text in textarea
  8. alert(sel.text);
  9. // Finally replace the value of the selected text
  10. // with this new replacement one
  11. sel.text = '' + sel.text + '';
  12. }
  13. // code for Mozilla
  14. var textarea = document.getElementById("textarea");
  15. var len = textarea.value.length;
  16. var start = textarea.selectionStart;
  17. var end = textarea.selectionEnd;
  18. var sel = textarea.value.substring(start, end);
  19. // This is the selected text and alert it
  20. alert(sel);
  21. var replace = '' + sel + '';
  22. // Here we are replacing the selected text with this one

  23. textarea.value = textarea.value.substring(0,start) + replace + textarea.value.substring(end,len);

Sunday, August 1, 2010

Repository Has Not Been Enabled To Accept Revision Propchanges

Solution

To correct this, I needed to create a file in the "hooks" folder of my Subversion repository. On my system, it was located at C:\svn\repository\hooks. I created a file called "pre-revprop-change.bat", and I set the contents to this:

rem Only allow log messages to be changed.
if "%4" == "svn:log" exit 0
echo Property '%4' cannot be changed >&2
exit 1

This solution was suggested in the TortoiseSVN documentation.

Wednesday, July 14, 2010

Fluent NHibernate, One-to-many with Orphan Delete

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;
using FluentNHibernate.Mapping;
using NUnit.Framework;

namespace NStackExample.Data.Tests
{

public class Parent : Entity
{

private ICollection m_Children = new HashSet();

public virtual ICollection Children
{
get { return m_Children; }
protected set { m_Children = value; }
}

}

public class Child : Entity
{

private Parent m_Parent;

public virtual Parent Parent
{
get { return m_Parent; }
set { m_Parent = value; }
}

}

public class ParentMapping : ClassMap
{
public ParentMapping()
{
Id((Parent x) => x.ID).GeneratedBy.GuidComb();
HasMany((Parent x) => x.Children)
.AsSet()
.WithForeignKeyConstraintName("ParentChildren")
.Cascade.AllDeleteOrphan()
.Inverse();
}
}

public class ChildMapping : ClassMap
{
public ChildMapping()
{
Id((Child x) => x.ID).GeneratedBy.GuidComb();
References((Child x) => x.Parent)
.Cascade.All()
.WithForeignKey("ChildParent")
.Not.Nullable();
}
}

[TestFixture()]
public class ParentMappingTests
{

[Test()]
public void CanCascadeSaveFromParentToChild()
{
Guid ID;
Parent P;
Child C;
using (SQLiteDatabaseScope Scope = new SQLiteDatabaseScope())
{
using (ISession Session = Scope.OpenSession())
{
using (ITransaction Tran = Session.BeginTransaction())
{
P = new Parent();

//Add a child of the parent
C = new Child { Parent = P };
P.Children.Add(C);

ID = (Guid) Session.Save(P);
Tran.Commit();
}
Session.Clear();

using (ITransaction Tran = Session.BeginTransaction())
{

P = Session.Get(ID);

Assert.IsNotNull(P);
Assert.AreEqual(ID, P.ID);

Assert.AreEqual(1, P.Children.Count);
Assert.AreNotSame(C, P.Children.First());
Assert.AreEqual(C.ID , P.Children.First().ID );
Assert.AreSame(P.Children.First().Parent, P);

Tran.Commit();

}
}

}
}

[Test()]
public void CanDeleteOrphanFromParentToChildren()
{
Guid ID;
Parent P;
Child C;
using (SQLiteDatabaseScope Scope = new SQLiteDatabaseScope())
{
using (ISession Session = Scope.OpenSession())
{
using (ITransaction Tran = Session.BeginTransaction())
{
P = new Parent();

//Add a child of the parent
C = new Child { Parent = P };
P.Children.Add(C);

ID = (Guid) Session.Save(P);
Tran.Commit();
}
Session.Clear();

using (ITransaction Tran = Session.BeginTransaction())
{

P = Session.Get(ID);

Assert.IsNotNull(P);
Assert.AreEqual(ID, P.ID);

Assert.AreEqual(1, P.Children.Count);
Assert.AreNotSame(C, P.Children.First());
Assert.AreEqual(C.ID, P.Children.First().ID );
Assert.AreSame(P.Children.First().Parent, P);

Tran.Commit();
}
Session.Clear();

//Orphan the child
C = P.Children.First();
P.Children.Remove(C);
C.Parent = null;

using (ITransaction Tran = Session.BeginTransaction())
{
//Orhpaned child should be deleted
Session.SaveOrUpdate(P);
Tran.Commit();
}
Session.Clear();

using (ITransaction Tran = Session.BeginTransaction())
{
P = Session.Get(ID);

Assert.AreEqual(0, P.Children.Count);

Tran.Commit();

}
}
}
}

}

}

Tuesday, July 13, 2010

Passing parameter with the OnSuccess or OnComplete event in Ajax.BeginForm

passing a parameter with the OnSuccess event in a Ajax.ActionLink or Ajax.BeginForm is bit tricky...

< script type="text/javascript">
function ExeOnComplete(strParam1)
{
 alert('strParam1');
}
< /script>"


using (Ajax.BeginForm("Create", "Profile", new AjaxOptions { HttpMethod = "Post", OnComplete = "function(){ExeOnComplete('abc');}"}))
{
// your code here
}

Wednesday, July 7, 2010

Excellent FREE resource for learning Domain Driven Design

If you asked developers what books they should read, most would (or should) include Domain Driven Design by Eric Evans.

Why is it important?

The patterns and practices outlined in this book will help you develop more successful software solutions.

How?

Eric Evans shows how you can improve communication with your customer (by doing things like developing a ubiquitous language), implement agile practices and create maintainable solutions which follow good software development principles.

One of common criticisms of the book is that ‘it does go on a bit’.

The good news is that the folks over at InfoQ have come up with ‘Domain Driven Design Quickly’ which summarizes what Domain Driven Design is about.

The even better news is that it’s FREE if you register with InfoQ, which is no bad thing because it’s a fantastic resource with videos, presentations and some very good articles.

post ref : http://www.arrangeactassert.com/excellent-free-resource-for-learning-domain-driven-design/

5 Strategies for Getting More Work Done in Less Time

Summary.    You’ve got more to do than could possibly get done with your current work style. You’ve prioritized. You’ve planned. You’ve dele...