Wednesday, February 15, 2012

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

Thursday, February 02, 2012

Some of the healthiest Foods On Earth

 

Berries

    All berries are low in sugar and high in fiber. Blueberries have been shown to increase memory in lab studies, and raspberries and strawberries are loaded with ellagic acid, a powerful antioxidant that seems to have some anti-cancer properties, according to the American Cancer Society.

Beans

    Beans are extremely high in fiber, which helps to control weight, prevent or manage diabetes and blood sugar, and may help prevent colon cancer and protect against heart disease. The National Institute of Medicine recommends 25-38 grams of fiber a day. The average American gets only 4-11 grams. One cup of beans provides 11-17 grams. 

Nuts

    Some of the largest and most important long-term studies of diet and health have shown that eating nuts several times a week is consistent with a risk of heart attack and heart disease that is 30%-50% lower than the general population. Just one ounce of nuts--almonds, macadamia, Brazil, walnuts, pecans--eaten three to five times a week seems to be the magic number.

Wild Salmon

    Fish is the ultimate anti-aging food. Cold-water fatty fish like wild salmon, sardines, mackerel and herring contain omega-3 fats that protect the brain and the heart, improve mood, and lower blood pressure and triglycerides.

Raw Milk

    Raw, organic milk nearly always comes from grass-fed cows and contains high levels of cancer-fighting CLA (conjugated linoleic acid) as well as a rich assortment of vitamins, minerals and beneficial bacteria (like Lactobacillus acidophilus) .

Grass-Fed Meat

    Meat from grass-fed cows has a much different fat profile than ordinary supermarket meat: high in omega-3s, lower in potentially harmful omega-6s and loaded with CLA, a kind of fat known for its anti-cancer activity. A superb source of protein and vitamin B12, it's also missing the antibiotics, steroids and hormones found in the meat that comes from feedlot farms.

Eggs

    Considered by many to be nature's most perfect food, the egg is high in protein and relatively low in calories. The yolk contains choline, one of the most important nutrients for the brain, as well as lutein and xeazanthin, two critical nutrients for eye health

Brassica Vegetables

    Cabbage, Brussels sprouts, broccoli and kale all contain plant compounds called indoles that help reduce the risk of cancer. In addition to a stunning range of vitamins and minerals, they also contain sulforaphane, an important plant chemical that helps the body detoxify health-damaging chemicals.

Apples

    Not only do they keep the doctor away, they also appear to do the same for lung cancer, diabetes and asthma. An apple contains five grams of fiber and a rich blend of nutrients including the bone-building vitamin K and the anti-inflammatory nutrient quercetin. And there's no better way to control your appetite than an apple eaten about half an hour before a big meal.

Onions and Garlic

   In an impressive number of published studies, the consumption of onions and garlic has demonstrated protective effects against stomach, prostate and esophageal cancer. Along with broccoli, tea and apples, onions and garlic are among a select group of foods found to reduce mortality from heart disease by 20%.

Pomegranate Juice

   Called "a natural Viagra" by researchers at Tel Aviv University, pomegranate juice is loaded with antioxidants. Studies show it can reduce blood pressure and plaque in the arteries. New research indicates it also slows the progression of tumors. Four to eight ounces a day is highly recommended.

Green Tea

Though all teas are great for you, green tea has a unique profile of plant chemicals that have anti-cancer activity. It's now fairly established that green tea may help prevent the following types of cancers in humans: bladder, colon, esophagus, pancreas, rectum and stomach. If that's not enough, it also appears to help with weight control.