Popular Posts
Enable SSL connection for Jsoup import org.jsoup.Connection; import org.jsoup.Jsoup; import javax.net.ssl.*; import java.io.IOException; import java.security.KeyManagement... Word break tag : <wbr/> (HTML5) The  HTML  <wbr>  tag  is  used  defines  a  potential  line  break  point  if  needed.  This  stands  for  Word  BReak. This  is  u... Build an OpenVPN server on android device Preparation An android device, in this case, Sony xperia Z is used Root permission required Linux Deploy for deploy i...
Stats
Quickly get first and last day of month
public static class DateTimeExtension
{
    public static DateTime FirstDayOfMonth(this DateTime bsaeDate)
    {
        //return new DateTime(bsaeDate.Year, bsaeDate.Month, 1);
        return bsaeDate.AddDays(-bsaeDate.Day + 1);
    }

    public static DateTime LastDayOfMonth(this DateTime baseDate)
    {
        //return new DateTime(baseDate.Year, baseDate.Month + 1, 1).AddDays(-1);
        return baseDate.AddMonths(1).AddDays(-baseDate.AddMonths(1).Day);
    }
}
Permission Levels, SPBasePermissions, PermissionMask bit, and default assignments
enum bit Group Enum Name Name in browser Description R C D FC
12 12 List ManageLists Manage Lists Create and delete lists, add or remove columns in a list, and add or remove public views of a list. FC
10 9 List CancelCheckout Override Checkout Discard or check in a document which is checked out to another user. D FC
3 2 List AddListItems Add Items Add items to lists, add documents to document libraries, and add Web discussion comments. C D FC
4 3 List EditListItems Edit Items Edit items in lists, edit documents in document libraries, edit Web discussion comments in documents, and customize Web Part Pages in document libraries. C D FC
5 4 List DeleteListItems Delete Items Delete items from a list, documents from a document library, and Web discussion comments in documents. C D FC
2 1 List ViewListItems View Items View items in lists, documents in document libraries, and view Web discussion comments. R C D FC
6 5 List ApproveItems Approve Items Approve a minor version of a list item or document. D FC
7 6 List OpenItems Open Items View the source of documents with server-side file handlers. R C D FC
8 7 List ViewVersions View Versions View past versions of a list item or document. R C D FC
9 8 List DeleteVersions Delete Versions Delete past versions of a list item or document. C D FC
32 40 List CreateAlerts Create Alerts Create e-mail alerts. R C D FC
13 13 List ViewFormPages View Application Pages View forms, views, and application pages, and enumerate lists. R C D FC
23 26 Site ManagePermissions Manage Permissions Create and change permission levels on the Web site and assign permissions to users and groups. FC
19 22 Site ViewUsageData View Usage Data View reports on Web site usage. FC
21 24 Site ManageSubwebs Create Subsite Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites.  FC
28 31 Site ManageWeb Manage Web Site Grant the ability to perform all administration tasks for the Web site as well as manage content. Activate, deactivate, or edit properties of Web site scoped Features through the object model or through the user interface (UI). When granted on the root Web site of a site collection, activate, deactivate, or edit properties of site collection scoped Features through the object model. To browse to the Site Collection Features page and activate or deactivate site collection scoped Features through the UI, you must be a site collection administrator. FC
16 19 Site AddAndCustomizePages Add and Customize Pages Add, change, or delete HTML pages or Web Part Pages, and edit the Web site using a Windows SharePoint Services–compatible editor. D FC
17 20 Site ApplyThemeAndBorder Apply Theme and Border Apply a theme or borders to the entire Web site. D FC
18 21 Site ApplyStyleSheets Apply Style Sheets Apply a style sheet (.css file) to the Web site. D FC
22 25 Site CreateGroups Create Groups Create a group of users that can be used anywhere within the site collection. FC
24 27 Site BrowseDirectories Browse Directories Enumerate files and folders in a Web site using Microsoft Office SharePoint Designer 2007 and WebDAV interfaces. C D FC
20 23 Site CreateSSCSite Use Self-Service Site Creation Create a Web site using Self-Service Site Creation.
15 18 Site ViewPages View Pages View pages in a Web site. R C D FC
34 63 Site EnumeratePermissions Enumerate Permissions Enumerate permissions on the Web site, list, folder, document, or list item. FC
25 28 Site BrowseUserInfo Browse User Information View information about users of the Web site. R C D FC
31 39 Site ManageAlerts Manage Alerts Manage alerts for all users of the Web site. FC
30 38 Site UseRemoteAPIs Use Remote Interfaes Use SOAP, WebDAV, or Microsoft Office SharePoint Designer 2007 interfaces to access the Web site. R C D FC
29 37 Site UseClientIntegration Use Client Integration Features Use features that launch client applications; otherwise, users must work on documents locally and upload changes.  R C D FC
14 17 Site Open Open Allow users to open a Web site, list, or folder to access items inside that container. R C D FC
33 41 Site EditMyUserInfo Edit Personal User Information Allows a user to change his or her user information, such as adding a picture. C D FC
11 10 Personal ManagePersonalViews Manage Personal Views Create, change, and delete personal views of lists. C D FC
26 29 Personal AddDelPrivateWebParts Add/Remove Personal Web Parts Add or remove personal Web Parts on a Web Part Page. C D FC
27 30 Personal UpdatePersonalWebParts Update Personal Web Parts Update Web Parts to display personalized information. C D FC
1 0 EmptyMask EmptyMask Has no permissions on the Web site. Not available through the user interface.
35 1 FullMask FullMask Has all permissions on the Web site. Not available through the user interface.

From: http://techtrainingnotes.blogspot.tw/2010/01/sharepoint-permission-levels.html

Quick array compare
string[] array1 = { "A", "B", "C", "D" };
string[] array2 = { "B", "C", "D", "E" };
string[] array3 = { "C", "D", "A", "B" };
string[] array4 = { "A", "B", "C", "D" };

Console.WriteLine("1 Equals 2 : {0}", array1.Equals(array2));  // false
Console.WriteLine("1 Equals 3 : {0}", array1.Equals(array3));  // false
Console.WriteLine("1 Equals 4 : {0}", array1.Equals(array4));  // false

Console.WriteLine("1 SequenceEqual 2 : {0}", array1.SequenceEqual(array2));  // false
Console.WriteLine("1 SequenceEqual 3 : {0}", array1.SequenceEqual(array3));  // false
Console.WriteLine("1 SequenceEqual 4 : {0}", array1.SequenceEqual(array4));  // true

Console.WriteLine("1 Except 2 : {0}", !array1.Except(array2).Any());  // false
Console.WriteLine("1 Except 3 : {0}", !array1.Except(array3).Any());  // true
Console.WriteLine("1 Except 4 : {0}", !array1.Except(array4).Any());  // true