Wednesday, February 15, 2012

How to: WebDataGrid paging when there are more pages

QuickPages is a method of paging which will give links to a limited number of pages before and after the current page index.   Below is an example of the Paging behavior which is setup to display 3 quick pages along with a "First" and "Last" quick link.  This setup provides the best user experience for paged records which return more than 8 pages of data.

<ig:Paging PagerAppearance="Both" PagerMode="NumericFirstLast" 
QuickPages="3" PageSize="20"
FirstPageText="First" LastPageText="Last" >
</ig:Paging>

Hope this helps!

FSFS vs BDB

FSFS and BDB are Subversion file system implementations. Traditionally Berkeley DB (BDB) was the standard file system used by Subversion. It solves many serious concerns with BDB such as data corruption and added improvements such as smaller space requirements. Now the FSFS is the standard, the default setting, and recommended by Subversion developers.

How FSFS is Better

  • Write access not required for read operations
  • Little or no need for recovery
  • Smaller repositories
  • Platform-independent
  • Can host on network file system
  • No unmask issues
  • Standard backup software
  • Can split up repository across multiple spools
  • More easily understood repository layout
  • Faster handling of directories with many files
  • (Fine point) Fast "svn log -v" over big revisions
  • (Marginal) Can give insert-only access to revs subdir for commits

How FSFS is Worse

  • More server work for head checkout
  • Finalization delay
  • Lower commit throughput
  • Immature code
  • Big directories full of revision files
  • (Developers) More difficult to index

SVN and SVN Repository

Subversion (SVN) is a very popular open source versioning system. It manages files, directories, and changes made to files and directories over time by single of multiple users

SVN is a client-server application where the SVN repository serves the tasks of a server. It is a central storage place which stores information in the form of a file system tree. Users share data by reading and writing to the repository. The repository keeps track of all changes written to the file i.e. modifications to the files, file contents, and directory structure. Users see the latest version of the file system by default but they can view every change ever make to the contents of the repository.

A decade ago Concurrent Versioning System (CVS) was the most-widely used versioning. It is built on Revision Control System (RCS) and thus inherits its flaws and this inheritance is precisely the reason it is very difficult to fix these flaws in CVS. SVN was created to overcome the flaws of CVS. It offers all the benefits of CVS without its flaws.

Although SVN is primarily used by programmer to track their project, it is capable of managing any sort of file collection. Important features of SVN are:

  • users can store ongoing work (code, docs, data, etc.) in a central repository
  • users can access the latest versions in the central repository
  • automates the process of updating local working copy of the project with modifications made by others?
  • users can track all changes ever made and revert to previous versions

Following are some important features which make SVN a better choice over CVS.

  • Subversion versions entire trees i.e directories, renames, and file metadata
  • changes are atomic. If you commit files a.aspx and b.aspx.cs, either both will be updated or neither will be updated
  • tagging and branching are not resource intensive
  • Subversion is designed as a client/server application

Tuesday, February 07, 2012

Redirect HTTP to HTTPS in ASP.NET

Recently I got to do this when one of our site was hosted on Go Daddy Hosted Server. They don’t have SSL redirect functionality for Windows environment, so we need to write some script to support this.

I have done something like this by writing few lines of code in Global.asax file in your web project.

void Application_BeginRequest(Object sender, EventArgs e)
{
if (ConfigurationManager.AppSettings["APIEnvironment"].ToUpper() == "LIVE"
&& Request.ServerVariables["HTTP_HOST"].ToString().ToLower().Trim() != "localhost") // turn the mode OFF in development
{
if (HttpContext.Current.Request.IsSecureConnection.Equals(false))
{
Response.Redirect("https://" + Request.ServerVariables["HTTP_HOST"] + HttpContext.Current.Request.RawUrl);
}
}
}

Hope this helps. Coffee cup

Jeff Bridges - Hold On You Lyrics

 

I’ve been loved
And I’ve been alone
All my life I’ve been a rollin’ stone
Done everything that a man can do
Everything but get a hold on you
Done everything that a man can do
Everything but get a hold on you

I’ve been blessed
And I’ve been cursed
All my lies have been unrehearsed
A wall of fire that I’ve walked through
Only tryin’ to get a hold on you
A wall of fire that I walked through
Only tryin’ to get a hold on you

I saw you waitin’ at the gate
But I arrived a moment late
I saw you shed a single tear
And still I can’t get there from here

I’ve been high
And I’ve been low
I’ve been people that I don’t know
Been to China and old Peru
Only tryin’ to get a hold on you
Been to China and to Peru
I’m only tryin’ to get a hold on you
Only tryin’ to get a hold on you

This is a beautiful song. I Love this song.Smile