Thursday, February 23, 2012

Infragistics: How to set Application Styling settings through Web.Config

You can use the AppStyling Visual Studio Add-in which is available from the Tools menu in Visual Studio or alternatively, you can manually add the settings into your web.config as seen below.
<configSections>  
   <section name="infragistics.web" 
type="System.Configuration.SingleTagSectionHandler,System, Version=1.0.3300.0, 
Culture=neutral, 
PublicKeyToken=b77a5c561934e089" />
</configSections>
<infragistics.web styleSetName="ElectricBlue" styleSetPath="~/ig_res" 
enableAppStyling="true" />


Good luck

Wednesday, February 22, 2012

Top 6 Firefox Extensions for Web Developer

Every one knows that Firefox has tons of plug-ins and add-on’s, but there are a few any web developer must know and use.

FireBug: Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.

FireShot: FireShot is a Firefox extension that creates screenshots of web pages. Unlike other extensions, this plugin provides a set of editing and annotation tools, which let users quickly modify captures and insert text and graphical annotations. Such functionality will be especially useful for web designers, testers and content reviewers. It’s possible to choose whether entire web page or only visible part of this page should be captured.
Screenshots can be uploaded to server, saved to disk (PNG, JPEG, BMP), copied to clipboard, e-mailed and sent to external editor for further processing.

CSSMate: Inline CSS Editing Evolved. Originally a port of the fantastic EditCSS tool that I’ve been using for many months. I’ve gutted it, made each stylesheet load into a separate tab. Removed the save load clear functionality as i found it to be useless and added in support for loading stylesheets that have a media type of “all” instead of “screen”.

ViewSourceWith: The main goal consists to view page source with external applications but you can also…
- open page source as DOM document, read faq
- open CSS and JS files present on page
- open images using your preferred image viewer (e.g. GIMP or ACDSee)
- open PDF links with Acrobat Reader or Foxit Reader or what you prefer
- edit textboxes content with your preferred editor and automatically see modified text on browser when you re-switch focus on it, this simplifies wiki pages editing, read faq
- open server side pages that generate the browser content, this simplifies web developer’s debug, read server-faq
- open files listed in Javascript console. When editor open file the cursor can be moved to line number shown on javascript console, read js faq
For desperate cases you can add Microsoft IE to editor list.

Web Developer: Maybe the most succesfull of all, has great reviews. Adds a menu and a toolbar with various web developer tools.

These description are take from the Firefox add-ons site.

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

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.

Go Banana, Eat Banana


Never, put your banana in the refrigerator!!! This is interesting.
After reading this, you'll never look at a banana in the same way again.

Bananas contain three natural sugars - sucrose, fructose and glucose combined with fiber. A banana gives an instant, sustained and substantial boost of energy.

Research has proven that just two bananas provide enough energy for a strenuous 90-minute workout. No wonder the banana is the number one fruit with the world's leading athletes.

But energy isn't the only way a banana can help us keep fit.

It can also help overcome or prevent a substantial number of illnesses and conditions, making it a must to add to our daily diet.

Depression: According to a recent survey undertaken by MIND amongst people suffering from depression, many felt much better after eating a banana. This is because bananas contain tryptophan, a type of protein that the body converts into serotonin, known to make you relax, improve your mood and generally make you feel happier.

PMS: Forget the pills - eat a banana. The vitamin B6 it contains regulates blood glucose levels, which can affect your mood.
Anemia: High in iron, bananas can stimulate the production of hemoglobin in the blood and so helps in cases of anemia.

Blood Pressure: This unique tropical fruit is extremely high in potassium yet low in salt, making it perfect to beat blood pressure. So much so, the US Food and Drug Administration has just allowed the banana industry to make official claims for the fruit's ability to reduce the risk of blood pressure and stroke.

Brain Power: 200 students at a Twickenham (Middlesex) school were helped through their exams this year by eating bananas at breakfast, break, and lunch in a bid to boost their brain power. Research has shown that the potassium-packed fruit can assist learning by making pupils more alert.

Constipation: High in fiber, including bananas in the diet can help restore normal bowel action, helping to overcome the problem without resorting to laxatives.

Hangovers: One of the quickest

ways of curing a hangover is to make a banana milkshake, sweetened with honey. The banana calms the stomach and, with the help of the honey, builds up depleted blood sugar levels, while the milk soothes and re-hydrates your system.

Heartburn: Bananas have a natural antacid effect in the body, so if you suffer from heartburn, try eating a banana for soothing relief.

Morning Sickness: Snacking on bananas between meals helps to keep blood sugar levels up and avoid morning sickness.

Mosquito bites: Before reaching for the insect bite cream, try rubbing the affected area with the inside of a banana skin. Many people find it amazingly successful at reducing swelling and irritation.

Nerves: Bananas are high in B vitamins that help calm the nervous system.

Overweight and at work? Studies at the Institute of Psychology in Austria found pressure at work leads to gorging on comfort food like chocolate and crisps. Looking at 5,000 hospital patients, researchers found the most obese were more likely to be in high-pressure jobs. The report concluded that, to avoid panic-induced food cravings, we need to control our blood sugar levels by snacking on high carbohydrate foods every two hours to keep levels steady.
Ulcers: The banana is used as the dietary food against intestinal disorders because of its soft texture and smoothness. It is the only raw fruit that can be eaten without distress in over-chronicler cases. It also neutralizes over-acidity and reduces irritation by coating the lining of the stomach.

Temperature control: Many other cultures see bananas as a "cooling" fruit that can lower both the physical and emotional temperature of expectant mothers. In Thailand, for example, pregnant women eat bananas to ensure their baby is born with a cool temperature.

Seasonal Affective Disorder (SAD): Bananas can help SAD sufferers because they contain the natural mood enhancer tryptophan.

Smoking & Tobacco Use: Bananas can also help people trying to give up smoking. The B6, B12 they contain, as well as the potassium! m and magnesium found in them, help the body recover from the effects of nicotine withdrawal.

Stress: Potassium is a vital mineral, which helps normalize the heartbeat, sends oxygen to the brain and regulates your body's water balance. When we are stressed, our metabolic rate rises, thereby reducing our potassium levels. These can be rebalanced with the help of a high-potassium banana snack.
Strokes: According to research in "The New England Journal of Medicine, 'eating bananas as part of a regular diet can cut the risk of death by strokes by as much as 40%!

Warts: Those keen on natural alternatives swear that if you want to kill off a wart, take a piece of banana skin and place it on the wart, with the yellow side out.. Carefully hold the skin in place with a plaster or surgical tape!

So, a banana really is a natural remedy for many ills. When you compare it to an apple, it has four times the protein, twice the carbohydrate, three times the phosphorus, five times the vitamin A and iron, and twice the other vitamins and minerals. It is also rich in potassium and is one of the best value foods around So maybe its time to change that well-known phrase so that we say, "A banana a day keeps the doctor away!"

Share this with friends, if you like the banana....

PS: Bananas must be the reason monkeys are so happy all the time! I will add one here; want a quick shine on our shoes?? Take the INSIDE of the banana skin, and rub directly on the shoe...polish with dry cloth.
Amazing fruit!!!

10 Great investing rules

  1. Put all your eggs in one basket and watch that basket!
  2. When the ducks quack, feed them
  3. Markets make opinions, not the other way round
  4. Buy low, sell high
  5. When the rest of the world is mad, we must imitate them in some measure
  6. During a bull market nobody needs a broker. During a bear market nobody wants one
  7. Every man his own broker
  8. Markets can remain irrational longer than you can remain solvent
  9. A mine is a hole in the ground with a liar standing over it
  10. Be diffident when others exalt, and with a secret joy buy when others think it in their interests to sell.

Interesting isn’t it.

How to: change DB owner name using T-SQL

Here is how you can do it using SQL Statement.

Method 1:

Using this method first we’ll get all the db objects and update with new db owner name.

DECLARE tabcurs CURSOR
FOR
SELECT 'olddbowner.' + [name]
FROM sysobjects
WHERE xtype = 'u'

OPEN tabcurs
DECLARE @tname NVARCHAR(517)
FETCH NEXT FROM tabcurs INTO @tname

WHILE @@fetch_status = 0
BEGIN

EXEC sp_changeobjectowner @tname, 'dbo'

FETCH NEXT FROM tabcurs INTO @tname
END
CLOSE tabcurs
DEALLOCATE tabcurs



Method 2:


This approach is simple and straight forward. Using this we will build the statements and you can copy them from the result window and execute


declare @OldOwner varchar(100) declare @NewOwner varchar(100) 
set @OldOwner = '353446_eda_db'
set @NewOwner = 'dbo'


SELECT 'sp_changeobjectowner ''[' + s.name + '].[' + p.name + ']'', ''' + @NewOwner + '''
GO'

FROm sys.Procedures p INNER JOIN
sys.Schemas s on p.schema_id = s.schema_id WHERE s.Name = @OldOwner
union
select 'sp_changeobjectowner ''[' + table_schema + '].[' + table_name + ']'', ''' + @NewOwner + '''
GO'

from information_schema.tables where Table_schema = @OldOwner


Hope this helps.