Showing posts with label guide. Show all posts
Showing posts with label guide. Show all posts

Friday, February 10, 2017

Guide to Vitamins Part 3

Guide to Vitamins Part 3



VITAMIN PRIMARY FOOD  DEFICIENCY
FUNCTION SOURCES   SYMPTOMS
C
(Ascorbic Acid) Forms collagen to hold  brussels sprouts, weakness, fatigue,
body cells together. strawberries, loss of appetite,
Helps maintain bones oranges, broccoli, weight loss, irrita-
& teeth, heal wounds, green peppers, bility, slow growth,
absorb iron and aids  grapefruit, collard increased risk of
resistance to infection. greens, cauliflower infection, swollen,
Prevents destruction  cantaloupe,  inflamed & bleeding
on B vitamins through tangerines,  gums, swollen &
oxidation. tomatoes,  aching joints, easy
asparagus, cabbage bruising, nosebleeds,
delayed wound
healing
D Increases absorption  fortified mlk, egg poor bone & tooth
of calcium and yolks, organ meats,  formation, bowed
phosphorus. Assists fortified breakfast legs, stunted 
in several phases of cereals. Sunlight growth, muscle
calcium & phosphorus weakness, softening
metabolism, aiding in of bones, pain in
bone & tooth develop- pelvis, back, legs; 
ment.  easily broken bones,
muscle twitching &
spasms
E Protects essential fatty plant oils (used in red blood cell 
acids & vitamin A from margarine & salad breakage & muscle
oxidation. Protects cell dressings), wheat weakness.
membranes. Protects germ, green leafy
red blood cells. Helps vegetables, nuts,
cells use oxygen to whole grains, liver,
yield energy egg yolks, legumes,
fruits, other 
vegetables
K Aids in formation of  green leafy  tendency to 
blood clotting proteins. vegetables, hemmorhage, 
Aids in regulation of cabbage-family delayed blood
blood calcium vegetables, liver, clotting

egg yolks, milk



Used with permission from A Year of Health Hints by Don R Powell, PHD and the American Institute for Preventive Medicine, copyright 2010. www.healthylife.com




Available link for download

Read more »

Sunday, February 5, 2017

Guide to building NET projects using Hudson

Guide to building NET projects using Hudson


In this guide Im going to show how to set up a C# project on the Continuous integration server Hudson. Ive been using Hudson on .NET projects since september and it works really well. Im going to use Media Portal as the example project.

The below goals will be solved in this guide:

  • Get the source code from the Subversion repository
    • Link change logs to the repository browser using ViewVC
  • Build the project using MBuild

  • Run the tests using NUnit and display the results together with a trend graph

  • Publish artifacts from the build (nightly builds)

  • Run FxCop on an assembly and display warnings (linked with source code) and a trend graph

  • Search the source code for TODO, FIXME comments and display the open tasks with links to the source code

Initial downloads
The following files are needed besides Java (at least 1.5). Get the latest version of all files and notice that the Hudson file has the extension .war and plugins .hpi. This guide assumes that MSBuild, NUnit and FxCop are already installed and working.
  • Hudson server application (download)

  • MSBuild plugin (download)

  • NUnit plugin (download)

  • Violations plugin (FxCop support among other such as Simian, CPD, PMD and PyLint) (download)

  • Open Tasks plugin (download)

Installation steps
Im going to install Hudson into c:Program FilesHudson.

  1. Copy the hudson.war file to c:Program FilesHudson

  2. Start Hudson through "java -DHUDSON_HOME=data -jar hudson.war". Verify that you can access Hudson through http://localhost:8080

  3. Copy the plugins to c:Program FilesHudsondataplugins

  4. Stop Hudson by pressing Ctrl+C in the command prompt where you started Hudson.

  5. Start Hudson again and you should be set to go.

Hudson system configuration
Follow the following steps to configure the tools that Hudson will use in building MediaPortal.

  1. Go to the System configuration at http://localhost:8080/configure.

  2. MSBuild Builder - Set the path to the MSBuild tool to C:WindowsMicrosoft.NETFrameworkv2.0.50727msbuild.exe


MediaPortal job configuration

  1. Click the "New job" link at the home page.

  2. Enter the name "MediaPortal", check the "Build a free-style software project" and press OK.


Source code management
MediaPortal uses a Subversion SCM. Hudson supports CVS and SVN out of the box, but there are many plugins for other SCMs. After checking out the files from the repository Hudson will show the new change sets since the previous build in the Build page. A detailed view of change sets can be seen in the Changes page as the name of the developer, files that were changed and the comment for the change. Each change set is linked to the MediaPortal subversion repository browser, so it is easy to browse the actual file that changed.

  1. Press the Subversion radio button to configure the SCM.
  2. Repository URL=https://mediaportal.svn.sourceforge.net/svnroot/mediaportal/trunk/mediaportal

  3. Local module directory=.

  4. Press the Advanced button

  5. Repository Browser=ViewSVN, URL=http://mediaportal.svn.sourceforge.net/viewvc/mediaportal/

To test the configuration, press Save and then Build. The source code will be downloaded from the repository and put into the Workspace. If there were any changes in the SCM repository they can be viewed in the Changes page.


When the build is completed verify that it has checked out the code by going to the Workspace page. Using the Workspace page you can browse and view the files that has been checked out and it doesnt matter if the files are on the master or on a distributed slave!

Building the project
Im going to build a Release version of MediaPortal using MSBuild and the mediaportal.sln solution file. Hudson also supports NAnt and many other build tools through plugins.

  1. Click the "Add build step" and select "Build a Visual Studio project or solution using MSBuild."

  2. MsBuild Build File=mediaportal.sln

  3. Command Line Arguments=/p:Configuration=Release

To test the configuration, press Save and then Build. Now the source code should be updated if there any changes and then built using MSBuild. While the build is running you can check the Console log that is updated as the build continues.


Running unit tests and showing the result
Hudson can read NUnit XML reports and display the results of them for each build. If a test fails, then it will be displayed in the Status page. Hudson will also show how many builds ago a test failed (its age); that way it is simple to see if a test failed in the current build. If a build has at least one failing unit tests then the build will become Unstable (yellow); otherwise it is marked as Successful (blue). After two builds you will get a trend graph showing the test results over time. To run the NUnit tests, Im running nunit-console from Hudson after the MSBuild has compiled all files.

  1. Click the "Add build step" and select "Execute Windows batch command"

  2. Command=
    "c:program files unit in unit-console.exe" MediaPortal.Tests inRELEASEMediaPortal.Tests.dll /xml=nunit-result.xml /config=test.config
    exit 0

  3. Check the "Publish NUnit test result report" and enter "nunit-result.xml"

Start a new build, now the unit tests will be run and their results are collected at the end of the build. When the build is completed, you can see how many tests there were, and how many failed, in the build in the Status page.

More information on namespace detail can be shown in the Test result page.

The test results are then displayed as a trend report. (This trend graph is copied from my python project, as it shows a variation over time)


Archiving build artifacts
It is good to archive the outputs (artifacts) from the build, so they can be retrieved later. This way it is possible to get a version of MediaPortal that was built a week ago, and compare the functionality to one built today. Hudson can be configured to store any number of files for each build, it can also be configured so only the latest successful builds artifacts are stored. As Im not really sure what the output from MediaPortal is, Im going to show how to archive the files for the MPInstaller.

  1. Click the "Archive the artifacts".

  2. Files to archive = MPInstaller inRelease*

In the next build, Hudson will store all files in the MPInstaller release folder so it can be retrieved later even if there are newer builds available.


Analyzing code with FxCop
Hudson can collect output from several quality metric tools and show them for each build. Similar to the unit tests, they will be displayed in a trend graph. For .NET projects, it is good to use FxCop. FxCop analyzes managed code assemblies and can be very good to use but it may also generate too many warnings at start, in this example I will only use the security rules and analyze the Core.dll assembly.

  1. Click the "Add build step" and select "Execute Windows batch command"

  2. Command =

    "c:Program FilesMicrosoft FxCop 1.35fxcopcmd.exe" /file:Core inReleaseCore.dll /rule:SecurityRules.dll /out:fxcop-result.xml
    exit 0

  3. Check the "Violations" check box, and set fxcop=fxcop-result.xml

Next build will take considerate longer time, as FxCop goes through the assembly and analyzes it to find potential problems. When the build finishes, you will see a nice summary on how many violations there are in the current build.

Finding source code comments
A nice plugin is the Tasks plugin as it will go through the sources, and find specific comments that should be watched. In this example Im going to search for TODO or FIXME comments,

  1. Click the "Scan workspace for open tasks".

  2. Files to scan = **/*.cs

  3. High priority=FIXME

  4. Normal priority=TODO

If the plugin finds any comments in the source they will be displayed in the build page.

There will also be a trend graph so it is possible to monitor that the tasks are decreasing over time. Together with the summary on what comments were found, the full source code can be viewed.





Summary
I hope this was a useful guide to start building .NET projects with Hudson, one of the many CI servers. As shown above it does not take much configuration to start building a project using Hudson. The best way to start using continuous integration is to start building the project. Then focus on running unit tests and other quality metrics so you can monitor the quality progress on your project.

Currently there are some plugins in the pipeline that could be interesting for .NET developers:
  • A SCM implementation for Microsofts Team System

  • Support for CodePlex issues and Wiki words in change set comment. And a very simple configuration to check out code from a CodePlex project

  • Support for displaying coverage stats using NCover and MS own coverage tool

Available link for download

Read more »

Saturday, February 4, 2017

Guide to Vitamins Part 1

Guide to Vitamins Part 1



In this week’s topic and the next few ones, we will enumerate different vitamins needed by our bodies, functions, sources, and deficiency symptoms.


VITAMIN PRIMARY FOOD  DEFICIENCY
FUNCTION SOURCES   SYMPTOMS
A for healthy skin, hair  dark green vegetables, night blindness
and mucous membrane, deep yellow fruits such dry, rough skin;
normal vision, proper as apricots, peaches,  susceptibility to 
tooth and bone  cantaloupe, carrots,   infection; dry
development and  sweet potatoes, pumpkin   eyes; stunted 
resistance to infection squash, liver, eggs, dairy bone growth;
poor tooth enamel
B1 release of energy from  green peas, legumes  loss of appetite
(Thiamine) food, appetite regulation,  collard greens, oranges fatigue, mental
growth & muscle tone,  asparagus, whole grains, confusion, 
proper function of heart lean meat, oysters  moodiness,
& nervous system irritability,
forgetfulness,
muscle weakness, 
leg cramps,
enlarged heart 
B2 helps cells use oxygen, milk & dairy products skin disorders, esp.
(Riboflavin) important in metabolism  dark green vegetables cracks at corners
of protein, fat, &  whole grains, legumes of mouth; dermatitis
carbohydrates, helps  sardines, eggs, tuna hypersentivity to
keep skin, & mucous oysters, lean meat,  light, reddening of
membranes healthy chicken  cornea; digestive
disturbances
B3 participates in metabolism nuts, legumes, dark green skin disorders, esp.
(Niacin) of protein, fat and  vegetables, whole grains,  on parts exposed to 
carbohydrates; helps cells  lean meat, fish, poultry sun; red, swollen 
use oxygen; promotes  tongue; indigestion,
healthy skin, nerves, and  diarrhea, mental
digestive tract disorders, depression
anxiety, confusion



Used with permission from A Year of Health Hints by Don R Powell, PHD and the American Institute for Preventive Medicine, copyright 2010. www.healthylife.com




Available link for download

Read more »

Sunday, January 29, 2017

Guide to Minerals Part 3

Guide to Minerals Part 3



MINERAL PRIMARY FOOD  DEFICIENCY
FUNCTION SOURCES   SYMPTOMS
Potassium Needed for muscle  fresh fruits and  muscle weakness
contraction, heart action, vegetables, milk & irregular heartbeat
nerve transmission, fluid dairy products, nuts apathy, confusion
balance. Involved in  legumes, lean meat loss of appetite
making proteins. Needed (deficiencies are 
for maintenance of acid-  unlikely, unless
base balance.  Required  excessive water loss
for formation of glycogen occurs through 
(short-term storage of vomiting, diarrhea,
energy) extreme sweating
Selenium Works with vitamin E to  seafoods, lean meat heart muscle 
act as antioxidant and  whole grains, wheat abnormalities, 
protect cell membranes germ, milk, organ anemia
meats
Sodium Needed for normal fluid salt, soy sauce,  muscle cramps,
balance, both inside and monosodium glu- weakness, mental
outside cells; nerve tamate (MSG), most apathy, loss of 
transmission, acid-base processed foods appetite (deficiencies
balance and muscle (especially soups, are unlikely, unless 
contraction sauces, and cured  another medical
meats), milk and  problem exists)
dairy products, meat
Zinc Works as part of many  milk and dairy  retarded growth,
enzymes. Present in products, whole prolonged wound 
insulin. Needed for making grains, vegetables, healing, slow sexual
reproductive hormones, liver, egg yolks, development, loss
normal sense of taste oysters, lean meat, of taste (and as a
and wound healing fish, poultry result, loss of 
appetite)

Used with permission from A Year of Health Hints by Don R Powell, PHD and the American Institute for Preventive Medicine, copyright 2010. www.healthylife.com





Available link for download

Read more »