Tuesday, December 22, 2015

Benifits of Turmeric Milk?




Turmeric, also known as curcuma longa, is a very common herb. Often referred to as the “Queen of Spices,” its main characteristics are a pepper-like aroma, sharp taste and golden color. People across the globe use this herb in their cooking.
According to the Journal of the American Chemical Society, turmeric contains a wide range of antioxidant, antiviral, antibacterial, antifungal, anticarcinogenic, antimutagenic and anti-inflammatory properties.
It is also loaded with many healthy nutrients such as protein, dietary fiber, niacin, Vitamin C, Vitamin E, Vitamin K, potassium, calcium, copper, iron, magnesium and zinc. Due to all these factors, turmeric is often used to treat a wide variety of health problems.
turmeric health benefits
Sponsored links
Here are the top 10 health benefits of turmeric.

1. Prevents Cancer

cancer virus
Turmeric can help prevent prostate cancer, stop the growth of existing prostate cancer and even destroy cancer cells. Multiple researchers have found that the active components in turmeric makes it one of the best protectors against radiation-induced tumors. It also has a preventive effect against tumor cells such as T-cell leukemia, colon carcinomas and breast carcinomas.

2.Relieves Arthritis

rheumatoid arthtitis hand
The anti-inflammatory properties in turmeric are great for treating both osteoarthritis and rheumatoid arthritis. In addition, turmeric’s antioxidant property destroys free radicals in the body that damage body cells. It has been found that those suffering from rheumatoid arthritis who consume turmeric on a regular basis experience much relief from the moderate to mild joint pains as well as joint inflammation.

3. Controls Diabetes

diabetes
Turmeric can be used in the treatment of diabetes by helping to moderate insulin levels. It also improves glucose control and increases the effect of medications used to treat diabetes. Another significant benefit is turmeric’s effectiveness in helping reduce insulin resistance, which may prevent the onset of Type-2 diabetes. However, when combined with strong medications, turmeric can cause hypoglycemia (low blood sugar). It is best to consult a healthcare professional before taking turmeric capsules.

4. Reduces Cholesterol Level

cholestrol in artery
Research has proven that simply using turmeric as a food seasoning can reduce serum cholesterol levels. It is a known fact that high cholesterol can lead to other serious health problems. Maintaining a proper cholesterol level can prevent many cardiovascular diseases.

5. Immunity Booster

shield body from virus
Turmeric contains a substance known as lipopolysaccharide, which helps stimulate the body’s immune system. Its antibacterial, antiviral and antifungal agents also help strengthen the immune system. A strong immune system lessens the chance of suffering from colds, flu and coughs. If you do get a cold, a cough or the flu, you can feel better sooner by mixing one teaspoon of turmeric powder in a glass of warm milk and drinking it once daily.

6. Heals Wound

wound healing
Turmeric is a natural antiseptic and antibacterial agent and can be used as an effective disinfectant. If you have a cut or burn, you can sprinkle turmeric powder on the affected area to speed up the healing process. Turmeric also helps repair damaged skin and may be used to treat psoriasis and other inflammatory skin conditions.

7. Weight Management


Turmeric powder can be very helpful in maintaining an ideal body weight. A component present in turmeric helps increase the flow of bile, an important component in the breakdown of dietary fat. Those who wish to lose weight or treat obesity and other associated diseases can benefit from having one teaspoon of turmeric powder with every meal.

8. Prevents Alzheimer’s Disease

memory loss
Brain inflammation is suspected to be one of the leading causes of cognitive disorders such as Alzheimer’s disease. Turmeric supports overall brain health by aiding in the removal of plaque build-up in the brain and improving the flow of oxygen. This can also prevent or slow down the progression of Alzheimer’s disease.

9. Improves Digestion

improves digestion
Many key components in turmeric stimulate the gallbladder to produce bile, which then improvesdigestion and reduces symptoms of bloating and gas. Also, turmeric is helpful in treating most forms of inflammatory bowel disease including ulcerative colitis. However it is important to bear in mind that people suffering from any kind of gallbladder disease should not take turmeric as a dietary supplement as it may worsen the condition. It is best to consume turmeric in raw form when suffering from a digestive problem.

10. Prevents Liver Disease

liver
Turmeric is a kind of natural liver detoxifier. The liver detoxifies the blood through the production of enzymes and turmeric increases production of these vital enzymes. These vital enzymes break down and reduce toxins in the body. Turmeric also is believed to invigorate and improve blood circulation. All of these factors support good liver health.
Given the numerous health benefits of turmeric, adding this powerful herb to your diet is one of the best things you can do to improve the quality of your life. You can add turmeric in powder form to curries, stir fried dishes, smoothies, warm milk and even to spicy salad dressings. Turmeric can be taken in pill form also. However, turmeric should not be used by people with gallstones or bile obstruction.


Tuesday, December 15, 2015

How to create a Windows Service with a Timer to Perform some action?




Timer Objects in Windows Services with C#.NET

        


Posted on 

Timer events can be very useful when you need to run a routine on a regular basis. In .NET, creating Windows services with the timer object is very easy to do. In this article we are going to create a timer which writes text to a file on regular intervals, and we’ll employ a Windows Service to control the timer.

Timer Object Concept
From the timer object (in the System.Timers namespace) we use the following properties and events:
Elapsed: Everything in the timer evolves around the Elapsed event, which is the event that is raised every interval. You create code to be executed and call that code in the Elapsed event.
Interval: Used to set the time between raising the Elapsed event.
AutoReset: Ensures that the timer will be reset after every Elapseevent. Therefore, if you would only like to execute the Elapse event once, you set the AutoReset property to false. When you omit the AutoReset property, it is assumed to be true.
Enabled: Used to tell the timer to start or stop.
Windows Service Concept
A Windows Service has very defined start and stop events. Starting and stopping timers using these events is very organized and is run as a background process. If you define the Windows Service to start automatically, you need not worry about starting the timer again; this background process will keep on running until you stop the service and disable it. Since this is a background process, there will not be a user interface to dialog with the user. In case of exceptions, messages would be written to the Windows Event Log.
Every Windows Service must have a Main method where you issue a Run command, which loads the service into the Services Control Manager. However, if you use Visual Studio.NET, all this code will be generated automatically.
{mospagebreak title=Setting up the Project}

1. Create a C# Windows Service project and name it TimerSrv.
Doekes

The project will come with a class, Service1.cs. Double-click Service1.cs in the project explorer to reveal the properties. Name the service TimerSrv and in theServiceName field also fill in TimerSrv.
Doekes
2. Next we are going to add an installer to the project. Click on the hyperlink Add Installer. A design screen will be added to the project with 2 controls:serviceProcessInstaller1 and ServiceInstaller1.
3. Click the serviceProcessInstaller1 control and, in the properties dialog, change the account to LocalSystem.
Doekes
4. In the serviceInstaller control, change the start type to Automatic, and give it a nice display name, like Timer Service.
Doekes

{mospagebreak title=Adding Code}
1. Switch to the code view of the Service1.cs file.
Note: we renamed the service to TimerSrv, so we need to change the Run command in the Main method of this class. Find the following line:

ServicesToRun = new System.ServiceProcess.ServiceBase[]
{ new Service1() };
Now, change this to the following:
ServicesToRun = new System.ServiceProcess.ServiceBase[]
{ new TimerSrv() };
2. In the top of the file add use statements:
Use System.IO; 
// we need this to write to the file  
use System.Timers; 
//we need this to create the timer.
3. Somewhere in the class, add a new private void AddToFile() method. We will use this to write text to a file.
private void AddToFile(string contents)
{
     //set up a filestream
     FileStream fs = new 
FileStream(@”c:timerserv.txt”,
           FileMode.OpenOrCreate, FileAccess.Write);
     //set up a streamwriter for adding text
     StreamWriter sw = new StreamWriter(fs);
     //find the end of the underlying filestream
     sw.BaseStream.Seek(0, SeekOrigin.End);
     //add the text 
     sw.WriteLine(contents);
     //add the text to the underlying filestream
     sw.Flush();
     //close the writer
     sw.Close();
}
Now we can start coding the events.
{mospagebreak title=Coding the Windows Service Start and Stop Event Handlers}
In the Service1.cs file we only need to write code for the OnStart and OnStopevents. In the OnStart() void method, add the following line of code:
AddToFile(“Starting Service”);
Now, in the OnStop event add the following line:
AddToFile(“Stopping Service”);
This is all we need to do to have a working Windows Service. Next we’ll add the timer to the service.
Creating the Timer
Just under the class definition in the Service1.cs file, add the following global variables:
//Initialize the timer
Timer timer = new Timer();
The idea behind the timer is that it sleeps for a specified period (defined by the interval method), and then executes the code specified with the elapsed event. We need to define a method that will be executed when the Elapsed event occurs, and we do this with the following code, which adds a line of text to the file:
Private void OnElapsedTime(object source, ElapsedEventArgs e)
{
     AddToFile(“ Another entry”);
}
Now we can setup the timer.
In the OnStart method we add code to reflect what to do when the elapsed event is raised. In this case, we need to invoke the OnElapsedTime method we defined above, set the interval (in milliseconds) the project needs to sleep, and enable the timer so it raises the Elapsed event.
The complete OnStart method looks like this:
protected override void OnStart(string[] args)
{
     //add line to the file 
     AddToFile(“starting service”);
//ad 1: handle Elapsed event 
timer.Elapsed += new ElapsedEventHandler(OnElapsedTime);
//ad 2: set interval to 1 minute (= 60,000 milliseconds)
timer.Interval = 60000;
//ad 3: enabling the timer
timer.Enabled = true;
}
The OnStop event also needs to be modified. A mere timer.Enabled = falsesuffices. The complete OnStop method looks like this:
protected override void OnStop()
{
     timer.Enabled = false;
     AddToFile(“stopping service”);
}
That’s all the coding we need to do!
{mospagebreak title=Building and Installing the Service}
Build the executable: Build->Build Solution
In order to install the service we need to use the installutil console command, which comes with the .NET Framework.
Open a command line window by going to Start -> Programs -> Microsoft Visual Studio.Net -> Visual Studio.Net Tools -> Visual Studio.Net Command Prompt, and change to the directory where the executable is located. Enter the following command:
installutil TimerServ.exe
// Whatever you defined the executable 
// name to be.

Doekes
Now the service is installed. To start and stop the service, go to Control Panel -> Administrative Tools -> Services.  Right click the service and select Start.
Now the service is started, and you will be able to see entries in the log file we defined in the code.
Conclusion
Creating a timer, using a Windows Service, with Visual Studio.Net is not such a difficult task. This article showed the entire process of creating a timer object and using a Windows Service as the control vehicle.

Sunday, December 13, 2015

Display a Print Button on Sharepoint WebPage?


Problem:

Want to Print a single webpart instead of printing the whole page on SharePoint.



Solution:


<input onclick="javascript:void(PrintWebPart())" type="button" value="Print Web Part"/> 
<script language="JavaScript">
//Controls which Web Part or zone to print
var WebPartElementID = "WebPartWPQ3";
//Function to print Web Part
function PrintWebPart()
{
var bolWebPartFound = false;
if (document.getElementById != null)
{
//Create html to print in new window
var PrintingHTML = '<HTML>\n<HEAD>\n';
//Take data from Head Tag
if (document.getElementsByTagName != null)
{
var HeadData= document.getElementsByTagName("HEAD");
if (HeadData.length > 0)
PrintingHTML += HeadData[0].innerHTML;
}
PrintingHTML += '\n</HEAD>\n<BODY>\n';
var WebPartData = document.getElementById(WebPartElementID);
if (WebPartData != null)
{
PrintingHTML += WebPartData.innerHTML;
bolWebPartFound = true;
}
else
{
bolWebPartFound = false;
alert ('Cannot Find Web Part');
}
}

PrintingHTML += '\n</BODY>\n</HTML>';
//Open new window to print
if (bolWebPartFound)
{
var PrintingWindow = window.open("","PrintWebPart","width=800,height=600,scrollbars,resizable,menubar,toolbar");
PrintingWindow.document.open();
PrintingWindow.document.write(PrintingHTML);

// Open Print Window
PrintingWindow.print();

}

}

</script>

Check your Exit / Re-Entry in KSA ?


Step 1: Click the below link..
https://www.eserve.com.sa/VVSWeb/


Step 2: 

Step 3: 

Step 4:

Step 5: 
Step 6:


Secure you Asp .NET by Web.config & Global.ascx?

Add to Global.ascx protected void Application_BeginRequest(object sender,EventArgs e)     {         //to remove x frame         Resp...