Tuesday, February 14, 2012

How to delete all items from a table in Castle ActiveRecord

Suppose you have a table named Customer for example then to delete all rows from a table in Castle ActiveRecord call the following method defined in the table class:

public static void DeleteAll()
 {
     DeleteAll(typeof(Customer));
 }

Note that you can't call DeleteAll(typeof(Customer)) directly from any class because it's defined as private.

SquishIt with UTF-8 Support


In order to let SquishIt Support UTF-8 javascript files use the following:
<%= Bundle.JavaScript()
        .Add("~/Scripts/test.js")
        .WithAttribute("charset", "utf-8")
        .Render("~/Scripts/combined.js")
    %>


Incenter Barycentric Property

In a triangle ABC with edge AB denoted by c, BC denoted by a and CA denoted by b, incenter I of the triangle have the following barycentric property: a IA +b IB + c IC = 0.

Note: when a = b = c then the triangle is equilateral and the incenter and centroid of the triangle are coincident.