<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Drfarrel</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Drfarrel"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Drfarrel"/>
	<updated>2026-07-13T21:35:34Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/security_audit&amp;diff=84892</id>
		<title>CSC/ECE 517 Spring 2014/security audit</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/security_audit&amp;diff=84892"/>
		<updated>2014-05-08T19:43:31Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: Added Overview section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This wiki documents the more interesting results of a security audit against the main Expertiza server and the latest version of the Expertiza code. The audit made extensive use of Metaspolit, NMap, Wireshark and a few additional online scanners. These are realistic tools, used in the wild by blackhats and whitehats alike.&lt;br /&gt;
&lt;br /&gt;
= Scans =&lt;br /&gt;
&lt;br /&gt;
== Basic server info ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nslookup http://expertiza.ncsu.edu&lt;br /&gt;
Server:		209.18.47.61&lt;br /&gt;
Address:	209.18.47.61#53&lt;br /&gt;
&lt;br /&gt;
Non-authoritative answer:&lt;br /&gt;
Name:	http://expertiza.ncsu.edu&lt;br /&gt;
Address: 198.105.251.210&lt;br /&gt;
Name:	http://expertiza.ncsu.edu&lt;br /&gt;
Address: 66.152.109.110&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Nmap scans ==&lt;br /&gt;
&lt;br /&gt;
Collecting open ports.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nmap -Pn 66.152.109.110&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:18 EDT&lt;br /&gt;
Nmap scan report for 66-152-109-110.tvc-ip.com (66.152.109.110)&lt;br /&gt;
Host is up (0.038s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE&lt;br /&gt;
80/tcp  open   http&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 7.26 seconds&lt;br /&gt;
[~]$ nmap -Pn 198.105.251.210&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:18 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.058s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE&lt;br /&gt;
80/tcp  open   http&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 6.36 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Full port scan. No SSH port was shown in the default scan, but it's possible it has been changed to a non-default port.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nmap -Pn -p1-65535 66.152.109.110&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.45 ( http://nmap.org ) at 2014-04-29 17:03 EDT&lt;br /&gt;
Nmap scan report for 66-152-109-110.tvc-ip.com (66.152.109.110)&lt;br /&gt;
Host is up (0.038s latency).&lt;br /&gt;
Not shown: 65533 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE&lt;br /&gt;
80/tcp  open   http&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 128.19 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking for a firewall (none evident).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ sudo nmap -sA 66.152.109.110&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:26 EDT&lt;br /&gt;
Nmap scan report for 66-152-109-110.tvc-ip.com (66.152.109.110)&lt;br /&gt;
Host is up (0.034s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE      SERVICE&lt;br /&gt;
80/tcp  unfiltered http&lt;br /&gt;
443/tcp unfiltered https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 6.15 seconds&lt;br /&gt;
[~]$ sudo nmap -sA 198.105.251.210&lt;br /&gt;
Starting Nmap 6.45 ( http://nmap.org ) at 2014-04-29 16:57 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.056s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE      SERVICE&lt;br /&gt;
80/tcp  unfiltered http&lt;br /&gt;
443/tcp unfiltered https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 7.25 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check versions of running services.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nmap -sV 198.105.251.210&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:21 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.069s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE VERSION&lt;br /&gt;
80/tcp  open   http    nginx&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 16.04 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determine OS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ sudo nmap -A -Pn 198.105.251.210&lt;br /&gt;
[sudo] password for daniel: &lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:29 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.058s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE VERSION&lt;br /&gt;
80/tcp  open   http    nginx&lt;br /&gt;
|_http-methods: No Allow or Public header in OPTIONS response (status code 410)&lt;br /&gt;
| http-robots.txt: 1 disallowed entry &lt;br /&gt;
|_/&lt;br /&gt;
|_http-title: Site doesn't have a title (text/html).&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
Aggressive OS guesses: Linux 3.0 (95%), Linux 2.6.32 (93%), Linux 2.6.38 (93%), OpenWrt White Russian 0.9 (Linux 2.4.30) (90%), OpenWrt 0.9 - 7.09 (Linux 2.4.30 - 2.4.34) (90%), OpenWrt Kamikaze 7.09 (Linux 2.6.22) (90%), HP P2000 G3 NAS device (90%), Linux 2.4.18 (88%), D-Link DIR-615, Encore 3G, or EnGenius ESR-9752 WAP (88%), Linux 2.6.19 - 2.6.32 (88%)&lt;br /&gt;
No exact OS matches for host (test conditions non-ideal).&lt;br /&gt;
Network Distance: 13 hops&lt;br /&gt;
&lt;br /&gt;
TRACEROUTE (using port 443/tcp)&lt;br /&gt;
HOP RTT       ADDRESS&lt;br /&gt;
1   101.01 ms 10.0.0.1&lt;br /&gt;
2   136.69 ms cpe-075-182-096-001.nc.res.rr.com (75.182.96.1)&lt;br /&gt;
3   118.38 ms 66.26.47.101&lt;br /&gt;
4   118.44 ms ae19.rlghncpop-rtr1.southeast.rr.com (24.93.64.0)&lt;br /&gt;
5   125.87 ms 107.14.19.42&lt;br /&gt;
6   118.50 ms ae0.pr1.dca10.tbone.rr.com (107.14.17.200)&lt;br /&gt;
7   118.50 ms ix-17-0.tcore2.AEQ-Ashburn.as6453.net (216.6.87.149)&lt;br /&gt;
8   146.79 ms if-2-2.tcore1.AEQ-Ashburn.as6453.net (216.6.87.2)&lt;br /&gt;
9   139.47 ms if-7-2.tcore1.MLN-Miami.as6453.net (66.198.154.178)&lt;br /&gt;
10  146.84 ms 66.110.8.46&lt;br /&gt;
11  48.12 ms  10ge-ten1-2.mia-89p-cor-2.peer1.net (216.187.124.129)&lt;br /&gt;
12  53.93 ms  216.187.124.60&lt;br /&gt;
13  48.89 ms  198.105.251.210&lt;br /&gt;
&lt;br /&gt;
OS and Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 24.55 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Metasploit wmap ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ msfconsole&lt;br /&gt;
&lt;br /&gt;
       =[ metasploit v4.9.2-2014040906 [core:4.9 api:1.0] ]&lt;br /&gt;
+ -- --=[ 1299 exploits - 791 auxiliary - 217 post ]&lt;br /&gt;
+ -- --=[ 334 payloads - 35 encoders - 8 nops      ]&lt;br /&gt;
&lt;br /&gt;
msf &amp;gt; load wmap&lt;br /&gt;
&lt;br /&gt;
.-.-.-..-.-.-..---..---.&lt;br /&gt;
| | | || | | || | || |-'&lt;br /&gt;
`-----'`-'-'-'`-^-'`-'&lt;br /&gt;
[WMAP 1.5.1] ===  et [  ] metasploit.com 2012&lt;br /&gt;
[*] Successfully loaded plugin: wmap&lt;br /&gt;
msf &amp;gt; wmap_sites -a http://expertiza.ncsu.edu/&lt;br /&gt;
[*] Site created.&lt;br /&gt;
msf &amp;gt; wmap_sites -l&lt;br /&gt;
[*] Available sites&lt;br /&gt;
===============&lt;br /&gt;
&lt;br /&gt;
     Id  Host            Vhost           Port  Proto  # Pages  # Forms&lt;br /&gt;
     --  ----            -----           ----  -----  -------  -------&lt;br /&gt;
     0   152.14.105.146  152.14.105.146  80    http   0        0&lt;br /&gt;
msf &amp;gt; wmap_targets -t http://152.14.105.146/home.html&lt;br /&gt;
msf &amp;gt; wmap_targets -t http://152.14.105.146/home&lt;br /&gt;
msf &amp;gt; wmap_targets -l&lt;br /&gt;
[*] Defined targets&lt;br /&gt;
===============&lt;br /&gt;
&lt;br /&gt;
     Id  Vhost           Host            Port  SSL    Path&lt;br /&gt;
     --  -----           ----            ----  ---    ----&lt;br /&gt;
     0   152.14.105.146  152.14.105.146  80    false	/home.html&lt;br /&gt;
     1   152.14.105.146  152.14.105.146  80    false	/home&lt;br /&gt;
msf &amp;gt; wmap_run -t&lt;br /&gt;
[*] Testing target:&lt;br /&gt;
[*] 	Site: 152.14.105.146 (152.14.105.146)&lt;br /&gt;
[*] 	Port: 80 SSL: false&lt;br /&gt;
============================================================&lt;br /&gt;
[*] Testing started. 2014-04-21 02:33:20 -0400&lt;br /&gt;
[*] Loading wmap modules...&lt;br /&gt;
msf &amp;gt; wmap_run &lt;br /&gt;
[*] 39 wmap enabled modules loaded.&lt;br /&gt;
&amp;lt;snip&amp;gt;&lt;br /&gt;
[*] Done.&lt;br /&gt;
msf &amp;gt; wmap_vulns -l&lt;br /&gt;
msf &amp;gt; # No vuls discovered&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Metasploit dir_listing ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
msf &amp;gt; use auxiliary/scanner/http/dir_listing &lt;br /&gt;
msf auxiliary(dir_listing) &amp;gt; show options &lt;br /&gt;
&lt;br /&gt;
Module options (auxiliary/scanner/http/dir_listing):&lt;br /&gt;
&lt;br /&gt;
   Name     Current Setting  Required  Description&lt;br /&gt;
   ----     ---------------  --------  -----------&lt;br /&gt;
   PATH     /                yes       The path to identify directoy listing&lt;br /&gt;
   Proxies                   no        Use a proxy chain&lt;br /&gt;
   RHOSTS                    yes       The target address range or CIDR identifier&lt;br /&gt;
   RPORT    80               yes       The target port&lt;br /&gt;
   THREADS  1                yes       The number of concurrent threads&lt;br /&gt;
   VHOST                     no        HTTP server virtual host&lt;br /&gt;
&lt;br /&gt;
msf auxiliary(dir_listing) &amp;gt; set RHOSTS 66.152.109.110&lt;br /&gt;
RHOSTS =&amp;gt; 66.152.109.110&lt;br /&gt;
msf auxiliary(dir_listing) &amp;gt; run&lt;br /&gt;
&lt;br /&gt;
[*] Scanned 1 of 1 hosts (100% complete)&lt;br /&gt;
[*] Auxiliary module execution completed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Metasploit WebDAV IIS6 Unicode vulnerability ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
msf &amp;gt; use auxiliary/scanner/http/dir_webdav_unicode_bypass&lt;br /&gt;
msf auxiliary(dir_webdav_unicode_bypass) &amp;gt; set RHOSTS 66.152.109.110&lt;br /&gt;
RHOSTS =&amp;gt; 66.152.109.110&lt;br /&gt;
msf auxiliary(dir_webdav_unicode_bypass) &amp;gt; run&lt;br /&gt;
&lt;br /&gt;
[*] Using first 256 bytes of the response as 404 string&lt;br /&gt;
[*] Scanned 1 of 1 hosts (100% complete)&lt;br /&gt;
[*] Auxiliary module execution completed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Results and Future Work =&lt;br /&gt;
&lt;br /&gt;
This security audit addressed the HTTP server software and configuration, SQL injection attacks, XSS attacks and privilege escalation attacks via poorly coded checks. The major vulnerability that was detected and exploited was a result of the site's use of HTTP (cleartext) for all communication. The attacker was able to use Wireshark to quickly and easily intercept his own password. Perhaps more importantly, this audit should establish some confidence in the setup of the server used to host Expertiza. It withstood serious attacks from major tools like Metaspolit, which are very realistic examples of the types of automated scanning attacks the server is likely to face in practice. The site's use of cookies seems to be managed by Rails properly, preventing XSS attacks. The attacker was unable to find SQL injection attacks using sophisticated automated tools, but did note some sections of the codebase that don't follow SQL-related best practices. Two areas that need future study are the site's manual SQL code and privilege-related coding errors that could allow escalation attacks. The server itself and the site's protection against XSS attacks should be considered fairly robust at this time.&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/security_audit&amp;diff=84891</id>
		<title>CSC/ECE 517 Spring 2014/security audit</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/security_audit&amp;diff=84891"/>
		<updated>2014-05-08T19:33:25Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: /* Overview */ Added notes about results and future work&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Results and Future Work =&lt;br /&gt;
&lt;br /&gt;
This security audit addressed the HTTP server software and configuration, SQL injection attacks, XSS attacks and privilege escalation attacks via poorly coded checks. The major vulnerability that was detected and exploited was a result of the site's use of HTTP (cleartext) for all communication. The attacker was able to use Wireshark to quickly and easily intercept his own password. Perhaps more importantly, this audit should establish some confidence in the setup of the server used to host Expertiza. It withstood serious attacks from major tools like Metaspolit, which are very realistic examples of the types of automated scanning attacks the server is likely to face in practice. The site's use of cookies seems to be managed by Rails properly, preventing XSS attacks. The attacker was unable to find SQL injection attacks using sophisticated automated tools, but did note some sections of the codebase that don't follow SQL-related best practices. Two areas that need future study are the site's manual SQL code and privilege-related coding errors that could allow escalation attacks. The server itself and the site's protection against XSS attacks should be considered fairly robust at this time.&lt;br /&gt;
&lt;br /&gt;
= Scans =&lt;br /&gt;
&lt;br /&gt;
== Basic server info ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nslookup http://expertiza.ncsu.edu&lt;br /&gt;
Server:		209.18.47.61&lt;br /&gt;
Address:	209.18.47.61#53&lt;br /&gt;
&lt;br /&gt;
Non-authoritative answer:&lt;br /&gt;
Name:	http://expertiza.ncsu.edu&lt;br /&gt;
Address: 198.105.251.210&lt;br /&gt;
Name:	http://expertiza.ncsu.edu&lt;br /&gt;
Address: 66.152.109.110&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Nmap scans ==&lt;br /&gt;
&lt;br /&gt;
Collecting open ports.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nmap -Pn 66.152.109.110&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:18 EDT&lt;br /&gt;
Nmap scan report for 66-152-109-110.tvc-ip.com (66.152.109.110)&lt;br /&gt;
Host is up (0.038s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE&lt;br /&gt;
80/tcp  open   http&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 7.26 seconds&lt;br /&gt;
[~]$ nmap -Pn 198.105.251.210&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:18 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.058s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE&lt;br /&gt;
80/tcp  open   http&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 6.36 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Full port scan. No SSH port was shown in the default scan, but it's possible it has been changed to a non-default port.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nmap -Pn -p1-65535 66.152.109.110&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.45 ( http://nmap.org ) at 2014-04-29 17:03 EDT&lt;br /&gt;
Nmap scan report for 66-152-109-110.tvc-ip.com (66.152.109.110)&lt;br /&gt;
Host is up (0.038s latency).&lt;br /&gt;
Not shown: 65533 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE&lt;br /&gt;
80/tcp  open   http&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 128.19 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking for a firewall (none evident).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ sudo nmap -sA 66.152.109.110&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:26 EDT&lt;br /&gt;
Nmap scan report for 66-152-109-110.tvc-ip.com (66.152.109.110)&lt;br /&gt;
Host is up (0.034s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE      SERVICE&lt;br /&gt;
80/tcp  unfiltered http&lt;br /&gt;
443/tcp unfiltered https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 6.15 seconds&lt;br /&gt;
[~]$ sudo nmap -sA 198.105.251.210&lt;br /&gt;
Starting Nmap 6.45 ( http://nmap.org ) at 2014-04-29 16:57 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.056s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE      SERVICE&lt;br /&gt;
80/tcp  unfiltered http&lt;br /&gt;
443/tcp unfiltered https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 7.25 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check versions of running services.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nmap -sV 198.105.251.210&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:21 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.069s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE VERSION&lt;br /&gt;
80/tcp  open   http    nginx&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 16.04 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determine OS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ sudo nmap -A -Pn 198.105.251.210&lt;br /&gt;
[sudo] password for daniel: &lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:29 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.058s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE VERSION&lt;br /&gt;
80/tcp  open   http    nginx&lt;br /&gt;
|_http-methods: No Allow or Public header in OPTIONS response (status code 410)&lt;br /&gt;
| http-robots.txt: 1 disallowed entry &lt;br /&gt;
|_/&lt;br /&gt;
|_http-title: Site doesn't have a title (text/html).&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
Aggressive OS guesses: Linux 3.0 (95%), Linux 2.6.32 (93%), Linux 2.6.38 (93%), OpenWrt White Russian 0.9 (Linux 2.4.30) (90%), OpenWrt 0.9 - 7.09 (Linux 2.4.30 - 2.4.34) (90%), OpenWrt Kamikaze 7.09 (Linux 2.6.22) (90%), HP P2000 G3 NAS device (90%), Linux 2.4.18 (88%), D-Link DIR-615, Encore 3G, or EnGenius ESR-9752 WAP (88%), Linux 2.6.19 - 2.6.32 (88%)&lt;br /&gt;
No exact OS matches for host (test conditions non-ideal).&lt;br /&gt;
Network Distance: 13 hops&lt;br /&gt;
&lt;br /&gt;
TRACEROUTE (using port 443/tcp)&lt;br /&gt;
HOP RTT       ADDRESS&lt;br /&gt;
1   101.01 ms 10.0.0.1&lt;br /&gt;
2   136.69 ms cpe-075-182-096-001.nc.res.rr.com (75.182.96.1)&lt;br /&gt;
3   118.38 ms 66.26.47.101&lt;br /&gt;
4   118.44 ms ae19.rlghncpop-rtr1.southeast.rr.com (24.93.64.0)&lt;br /&gt;
5   125.87 ms 107.14.19.42&lt;br /&gt;
6   118.50 ms ae0.pr1.dca10.tbone.rr.com (107.14.17.200)&lt;br /&gt;
7   118.50 ms ix-17-0.tcore2.AEQ-Ashburn.as6453.net (216.6.87.149)&lt;br /&gt;
8   146.79 ms if-2-2.tcore1.AEQ-Ashburn.as6453.net (216.6.87.2)&lt;br /&gt;
9   139.47 ms if-7-2.tcore1.MLN-Miami.as6453.net (66.198.154.178)&lt;br /&gt;
10  146.84 ms 66.110.8.46&lt;br /&gt;
11  48.12 ms  10ge-ten1-2.mia-89p-cor-2.peer1.net (216.187.124.129)&lt;br /&gt;
12  53.93 ms  216.187.124.60&lt;br /&gt;
13  48.89 ms  198.105.251.210&lt;br /&gt;
&lt;br /&gt;
OS and Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 24.55 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Metasploit wmap ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ msfconsole&lt;br /&gt;
&lt;br /&gt;
       =[ metasploit v4.9.2-2014040906 [core:4.9 api:1.0] ]&lt;br /&gt;
+ -- --=[ 1299 exploits - 791 auxiliary - 217 post ]&lt;br /&gt;
+ -- --=[ 334 payloads - 35 encoders - 8 nops      ]&lt;br /&gt;
&lt;br /&gt;
msf &amp;gt; load wmap&lt;br /&gt;
&lt;br /&gt;
.-.-.-..-.-.-..---..---.&lt;br /&gt;
| | | || | | || | || |-'&lt;br /&gt;
`-----'`-'-'-'`-^-'`-'&lt;br /&gt;
[WMAP 1.5.1] ===  et [  ] metasploit.com 2012&lt;br /&gt;
[*] Successfully loaded plugin: wmap&lt;br /&gt;
msf &amp;gt; wmap_sites -a http://expertiza.ncsu.edu/&lt;br /&gt;
[*] Site created.&lt;br /&gt;
msf &amp;gt; wmap_sites -l&lt;br /&gt;
[*] Available sites&lt;br /&gt;
===============&lt;br /&gt;
&lt;br /&gt;
     Id  Host            Vhost           Port  Proto  # Pages  # Forms&lt;br /&gt;
     --  ----            -----           ----  -----  -------  -------&lt;br /&gt;
     0   152.14.105.146  152.14.105.146  80    http   0        0&lt;br /&gt;
msf &amp;gt; wmap_targets -t http://152.14.105.146/home.html&lt;br /&gt;
msf &amp;gt; wmap_targets -t http://152.14.105.146/home&lt;br /&gt;
msf &amp;gt; wmap_targets -l&lt;br /&gt;
[*] Defined targets&lt;br /&gt;
===============&lt;br /&gt;
&lt;br /&gt;
     Id  Vhost           Host            Port  SSL    Path&lt;br /&gt;
     --  -----           ----            ----  ---    ----&lt;br /&gt;
     0   152.14.105.146  152.14.105.146  80    false	/home.html&lt;br /&gt;
     1   152.14.105.146  152.14.105.146  80    false	/home&lt;br /&gt;
msf &amp;gt; wmap_run -t&lt;br /&gt;
[*] Testing target:&lt;br /&gt;
[*] 	Site: 152.14.105.146 (152.14.105.146)&lt;br /&gt;
[*] 	Port: 80 SSL: false&lt;br /&gt;
============================================================&lt;br /&gt;
[*] Testing started. 2014-04-21 02:33:20 -0400&lt;br /&gt;
[*] Loading wmap modules...&lt;br /&gt;
msf &amp;gt; wmap_run &lt;br /&gt;
[*] 39 wmap enabled modules loaded.&lt;br /&gt;
&amp;lt;snip&amp;gt;&lt;br /&gt;
[*] Done.&lt;br /&gt;
msf &amp;gt; wmap_vulns -l&lt;br /&gt;
msf &amp;gt; # No vuls discovered&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Metasploit dir_listing ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
msf &amp;gt; use auxiliary/scanner/http/dir_listing &lt;br /&gt;
msf auxiliary(dir_listing) &amp;gt; show options &lt;br /&gt;
&lt;br /&gt;
Module options (auxiliary/scanner/http/dir_listing):&lt;br /&gt;
&lt;br /&gt;
   Name     Current Setting  Required  Description&lt;br /&gt;
   ----     ---------------  --------  -----------&lt;br /&gt;
   PATH     /                yes       The path to identify directoy listing&lt;br /&gt;
   Proxies                   no        Use a proxy chain&lt;br /&gt;
   RHOSTS                    yes       The target address range or CIDR identifier&lt;br /&gt;
   RPORT    80               yes       The target port&lt;br /&gt;
   THREADS  1                yes       The number of concurrent threads&lt;br /&gt;
   VHOST                     no        HTTP server virtual host&lt;br /&gt;
&lt;br /&gt;
msf auxiliary(dir_listing) &amp;gt; set RHOSTS 66.152.109.110&lt;br /&gt;
RHOSTS =&amp;gt; 66.152.109.110&lt;br /&gt;
msf auxiliary(dir_listing) &amp;gt; run&lt;br /&gt;
&lt;br /&gt;
[*] Scanned 1 of 1 hosts (100% complete)&lt;br /&gt;
[*] Auxiliary module execution completed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Metasploit WebDAV IIS6 Unicode vulnerability ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
msf &amp;gt; use auxiliary/scanner/http/dir_webdav_unicode_bypass&lt;br /&gt;
msf auxiliary(dir_webdav_unicode_bypass) &amp;gt; set RHOSTS 66.152.109.110&lt;br /&gt;
RHOSTS =&amp;gt; 66.152.109.110&lt;br /&gt;
msf auxiliary(dir_webdav_unicode_bypass) &amp;gt; run&lt;br /&gt;
&lt;br /&gt;
[*] Using first 256 bytes of the response as 404 string&lt;br /&gt;
[*] Scanned 1 of 1 hosts (100% complete)&lt;br /&gt;
[*] Auxiliary module execution completed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/security_audit&amp;diff=84830</id>
		<title>CSC/ECE 517 Spring 2014/security audit</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/security_audit&amp;diff=84830"/>
		<updated>2014-04-29T21:20:09Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: /* Metasploit WebDAV IIS6 Unicode vulnerability */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This page will document a security audit of Expertiza.&lt;br /&gt;
&lt;br /&gt;
= Scans =&lt;br /&gt;
&lt;br /&gt;
== Basic server info ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nslookup http://expertiza.ncsu.edu&lt;br /&gt;
Server:		209.18.47.61&lt;br /&gt;
Address:	209.18.47.61#53&lt;br /&gt;
&lt;br /&gt;
Non-authoritative answer:&lt;br /&gt;
Name:	http://expertiza.ncsu.edu&lt;br /&gt;
Address: 198.105.251.210&lt;br /&gt;
Name:	http://expertiza.ncsu.edu&lt;br /&gt;
Address: 66.152.109.110&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Nmap scans ==&lt;br /&gt;
&lt;br /&gt;
Collecting open ports.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nmap -Pn 66.152.109.110&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:18 EDT&lt;br /&gt;
Nmap scan report for 66-152-109-110.tvc-ip.com (66.152.109.110)&lt;br /&gt;
Host is up (0.038s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE&lt;br /&gt;
80/tcp  open   http&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 7.26 seconds&lt;br /&gt;
[~]$ nmap -Pn 198.105.251.210&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:18 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.058s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE&lt;br /&gt;
80/tcp  open   http&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 6.36 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Full port scan. No SSH port was shown in the default scan, but it's possible it has been changed to a non-default port.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nmap -Pn -p1-65535 66.152.109.110&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.45 ( http://nmap.org ) at 2014-04-29 17:03 EDT&lt;br /&gt;
Nmap scan report for 66-152-109-110.tvc-ip.com (66.152.109.110)&lt;br /&gt;
Host is up (0.038s latency).&lt;br /&gt;
Not shown: 65533 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE&lt;br /&gt;
80/tcp  open   http&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 128.19 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking for a firewall (none evident).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ sudo nmap -sA 66.152.109.110&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:26 EDT&lt;br /&gt;
Nmap scan report for 66-152-109-110.tvc-ip.com (66.152.109.110)&lt;br /&gt;
Host is up (0.034s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE      SERVICE&lt;br /&gt;
80/tcp  unfiltered http&lt;br /&gt;
443/tcp unfiltered https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 6.15 seconds&lt;br /&gt;
[~]$ sudo nmap -sA 198.105.251.210&lt;br /&gt;
Starting Nmap 6.45 ( http://nmap.org ) at 2014-04-29 16:57 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.056s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE      SERVICE&lt;br /&gt;
80/tcp  unfiltered http&lt;br /&gt;
443/tcp unfiltered https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 7.25 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check versions of running services.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nmap -sV 198.105.251.210&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:21 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.069s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE VERSION&lt;br /&gt;
80/tcp  open   http    nginx&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 16.04 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determine OS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ sudo nmap -A -Pn 198.105.251.210&lt;br /&gt;
[sudo] password for daniel: &lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:29 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.058s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE VERSION&lt;br /&gt;
80/tcp  open   http    nginx&lt;br /&gt;
|_http-methods: No Allow or Public header in OPTIONS response (status code 410)&lt;br /&gt;
| http-robots.txt: 1 disallowed entry &lt;br /&gt;
|_/&lt;br /&gt;
|_http-title: Site doesn't have a title (text/html).&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
Aggressive OS guesses: Linux 3.0 (95%), Linux 2.6.32 (93%), Linux 2.6.38 (93%), OpenWrt White Russian 0.9 (Linux 2.4.30) (90%), OpenWrt 0.9 - 7.09 (Linux 2.4.30 - 2.4.34) (90%), OpenWrt Kamikaze 7.09 (Linux 2.6.22) (90%), HP P2000 G3 NAS device (90%), Linux 2.4.18 (88%), D-Link DIR-615, Encore 3G, or EnGenius ESR-9752 WAP (88%), Linux 2.6.19 - 2.6.32 (88%)&lt;br /&gt;
No exact OS matches for host (test conditions non-ideal).&lt;br /&gt;
Network Distance: 13 hops&lt;br /&gt;
&lt;br /&gt;
TRACEROUTE (using port 443/tcp)&lt;br /&gt;
HOP RTT       ADDRESS&lt;br /&gt;
1   101.01 ms 10.0.0.1&lt;br /&gt;
2   136.69 ms cpe-075-182-096-001.nc.res.rr.com (75.182.96.1)&lt;br /&gt;
3   118.38 ms 66.26.47.101&lt;br /&gt;
4   118.44 ms ae19.rlghncpop-rtr1.southeast.rr.com (24.93.64.0)&lt;br /&gt;
5   125.87 ms 107.14.19.42&lt;br /&gt;
6   118.50 ms ae0.pr1.dca10.tbone.rr.com (107.14.17.200)&lt;br /&gt;
7   118.50 ms ix-17-0.tcore2.AEQ-Ashburn.as6453.net (216.6.87.149)&lt;br /&gt;
8   146.79 ms if-2-2.tcore1.AEQ-Ashburn.as6453.net (216.6.87.2)&lt;br /&gt;
9   139.47 ms if-7-2.tcore1.MLN-Miami.as6453.net (66.198.154.178)&lt;br /&gt;
10  146.84 ms 66.110.8.46&lt;br /&gt;
11  48.12 ms  10ge-ten1-2.mia-89p-cor-2.peer1.net (216.187.124.129)&lt;br /&gt;
12  53.93 ms  216.187.124.60&lt;br /&gt;
13  48.89 ms  198.105.251.210&lt;br /&gt;
&lt;br /&gt;
OS and Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 24.55 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Metasploit wmap ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ msfconsole&lt;br /&gt;
&lt;br /&gt;
       =[ metasploit v4.9.2-2014040906 [core:4.9 api:1.0] ]&lt;br /&gt;
+ -- --=[ 1299 exploits - 791 auxiliary - 217 post ]&lt;br /&gt;
+ -- --=[ 334 payloads - 35 encoders - 8 nops      ]&lt;br /&gt;
&lt;br /&gt;
msf &amp;gt; load wmap&lt;br /&gt;
&lt;br /&gt;
.-.-.-..-.-.-..---..---.&lt;br /&gt;
| | | || | | || | || |-'&lt;br /&gt;
`-----'`-'-'-'`-^-'`-'&lt;br /&gt;
[WMAP 1.5.1] ===  et [  ] metasploit.com 2012&lt;br /&gt;
[*] Successfully loaded plugin: wmap&lt;br /&gt;
msf &amp;gt; wmap_sites -a http://expertiza.ncsu.edu/&lt;br /&gt;
[*] Site created.&lt;br /&gt;
msf &amp;gt; wmap_sites -l&lt;br /&gt;
[*] Available sites&lt;br /&gt;
===============&lt;br /&gt;
&lt;br /&gt;
     Id  Host            Vhost           Port  Proto  # Pages  # Forms&lt;br /&gt;
     --  ----            -----           ----  -----  -------  -------&lt;br /&gt;
     0   152.14.105.146  152.14.105.146  80    http   0        0&lt;br /&gt;
msf &amp;gt; wmap_targets -t http://152.14.105.146/home.html&lt;br /&gt;
msf &amp;gt; wmap_targets -t http://152.14.105.146/home&lt;br /&gt;
msf &amp;gt; wmap_targets -l&lt;br /&gt;
[*] Defined targets&lt;br /&gt;
===============&lt;br /&gt;
&lt;br /&gt;
     Id  Vhost           Host            Port  SSL    Path&lt;br /&gt;
     --  -----           ----            ----  ---    ----&lt;br /&gt;
     0   152.14.105.146  152.14.105.146  80    false	/home.html&lt;br /&gt;
     1   152.14.105.146  152.14.105.146  80    false	/home&lt;br /&gt;
msf &amp;gt; wmap_run -t&lt;br /&gt;
[*] Testing target:&lt;br /&gt;
[*] 	Site: 152.14.105.146 (152.14.105.146)&lt;br /&gt;
[*] 	Port: 80 SSL: false&lt;br /&gt;
============================================================&lt;br /&gt;
[*] Testing started. 2014-04-21 02:33:20 -0400&lt;br /&gt;
[*] Loading wmap modules...&lt;br /&gt;
msf &amp;gt; wmap_run &lt;br /&gt;
[*] 39 wmap enabled modules loaded.&lt;br /&gt;
&amp;lt;snip&amp;gt;&lt;br /&gt;
[*] Done.&lt;br /&gt;
msf &amp;gt; wmap_vulns -l&lt;br /&gt;
msf &amp;gt; # No vuls discovered&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Metasploit dir_listing ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
msf &amp;gt; use auxiliary/scanner/http/dir_listing &lt;br /&gt;
msf auxiliary(dir_listing) &amp;gt; show options &lt;br /&gt;
&lt;br /&gt;
Module options (auxiliary/scanner/http/dir_listing):&lt;br /&gt;
&lt;br /&gt;
   Name     Current Setting  Required  Description&lt;br /&gt;
   ----     ---------------  --------  -----------&lt;br /&gt;
   PATH     /                yes       The path to identify directoy listing&lt;br /&gt;
   Proxies                   no        Use a proxy chain&lt;br /&gt;
   RHOSTS                    yes       The target address range or CIDR identifier&lt;br /&gt;
   RPORT    80               yes       The target port&lt;br /&gt;
   THREADS  1                yes       The number of concurrent threads&lt;br /&gt;
   VHOST                     no        HTTP server virtual host&lt;br /&gt;
&lt;br /&gt;
msf auxiliary(dir_listing) &amp;gt; set RHOSTS 66.152.109.110&lt;br /&gt;
RHOSTS =&amp;gt; 66.152.109.110&lt;br /&gt;
msf auxiliary(dir_listing) &amp;gt; run&lt;br /&gt;
&lt;br /&gt;
[*] Scanned 1 of 1 hosts (100% complete)&lt;br /&gt;
[*] Auxiliary module execution completed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Metasploit WebDAV IIS6 Unicode vulnerability ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
msf &amp;gt; use auxiliary/scanner/http/dir_webdav_unicode_bypass&lt;br /&gt;
msf auxiliary(dir_webdav_unicode_bypass) &amp;gt; set RHOSTS 66.152.109.110&lt;br /&gt;
RHOSTS =&amp;gt; 66.152.109.110&lt;br /&gt;
msf auxiliary(dir_webdav_unicode_bypass) &amp;gt; run&lt;br /&gt;
&lt;br /&gt;
[*] Using first 256 bytes of the response as 404 string&lt;br /&gt;
[*] Scanned 1 of 1 hosts (100% complete)&lt;br /&gt;
[*] Auxiliary module execution completed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/security_audit&amp;diff=84829</id>
		<title>CSC/ECE 517 Spring 2014/security audit</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/security_audit&amp;diff=84829"/>
		<updated>2014-04-29T21:17:34Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This page will document a security audit of Expertiza.&lt;br /&gt;
&lt;br /&gt;
= Scans =&lt;br /&gt;
&lt;br /&gt;
== Basic server info ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nslookup http://expertiza.ncsu.edu&lt;br /&gt;
Server:		209.18.47.61&lt;br /&gt;
Address:	209.18.47.61#53&lt;br /&gt;
&lt;br /&gt;
Non-authoritative answer:&lt;br /&gt;
Name:	http://expertiza.ncsu.edu&lt;br /&gt;
Address: 198.105.251.210&lt;br /&gt;
Name:	http://expertiza.ncsu.edu&lt;br /&gt;
Address: 66.152.109.110&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Nmap scans ==&lt;br /&gt;
&lt;br /&gt;
Collecting open ports.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nmap -Pn 66.152.109.110&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:18 EDT&lt;br /&gt;
Nmap scan report for 66-152-109-110.tvc-ip.com (66.152.109.110)&lt;br /&gt;
Host is up (0.038s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE&lt;br /&gt;
80/tcp  open   http&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 7.26 seconds&lt;br /&gt;
[~]$ nmap -Pn 198.105.251.210&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:18 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.058s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE&lt;br /&gt;
80/tcp  open   http&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 6.36 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Full port scan. No SSH port was shown in the default scan, but it's possible it has been changed to a non-default port.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nmap -Pn -p1-65535 66.152.109.110&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.45 ( http://nmap.org ) at 2014-04-29 17:03 EDT&lt;br /&gt;
Nmap scan report for 66-152-109-110.tvc-ip.com (66.152.109.110)&lt;br /&gt;
Host is up (0.038s latency).&lt;br /&gt;
Not shown: 65533 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE&lt;br /&gt;
80/tcp  open   http&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 128.19 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking for a firewall (none evident).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ sudo nmap -sA 66.152.109.110&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:26 EDT&lt;br /&gt;
Nmap scan report for 66-152-109-110.tvc-ip.com (66.152.109.110)&lt;br /&gt;
Host is up (0.034s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE      SERVICE&lt;br /&gt;
80/tcp  unfiltered http&lt;br /&gt;
443/tcp unfiltered https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 6.15 seconds&lt;br /&gt;
[~]$ sudo nmap -sA 198.105.251.210&lt;br /&gt;
Starting Nmap 6.45 ( http://nmap.org ) at 2014-04-29 16:57 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.056s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE      SERVICE&lt;br /&gt;
80/tcp  unfiltered http&lt;br /&gt;
443/tcp unfiltered https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 7.25 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check versions of running services.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nmap -sV 198.105.251.210&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:21 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.069s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE VERSION&lt;br /&gt;
80/tcp  open   http    nginx&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 16.04 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determine OS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ sudo nmap -A -Pn 198.105.251.210&lt;br /&gt;
[sudo] password for daniel: &lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:29 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.058s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE VERSION&lt;br /&gt;
80/tcp  open   http    nginx&lt;br /&gt;
|_http-methods: No Allow or Public header in OPTIONS response (status code 410)&lt;br /&gt;
| http-robots.txt: 1 disallowed entry &lt;br /&gt;
|_/&lt;br /&gt;
|_http-title: Site doesn't have a title (text/html).&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
Aggressive OS guesses: Linux 3.0 (95%), Linux 2.6.32 (93%), Linux 2.6.38 (93%), OpenWrt White Russian 0.9 (Linux 2.4.30) (90%), OpenWrt 0.9 - 7.09 (Linux 2.4.30 - 2.4.34) (90%), OpenWrt Kamikaze 7.09 (Linux 2.6.22) (90%), HP P2000 G3 NAS device (90%), Linux 2.4.18 (88%), D-Link DIR-615, Encore 3G, or EnGenius ESR-9752 WAP (88%), Linux 2.6.19 - 2.6.32 (88%)&lt;br /&gt;
No exact OS matches for host (test conditions non-ideal).&lt;br /&gt;
Network Distance: 13 hops&lt;br /&gt;
&lt;br /&gt;
TRACEROUTE (using port 443/tcp)&lt;br /&gt;
HOP RTT       ADDRESS&lt;br /&gt;
1   101.01 ms 10.0.0.1&lt;br /&gt;
2   136.69 ms cpe-075-182-096-001.nc.res.rr.com (75.182.96.1)&lt;br /&gt;
3   118.38 ms 66.26.47.101&lt;br /&gt;
4   118.44 ms ae19.rlghncpop-rtr1.southeast.rr.com (24.93.64.0)&lt;br /&gt;
5   125.87 ms 107.14.19.42&lt;br /&gt;
6   118.50 ms ae0.pr1.dca10.tbone.rr.com (107.14.17.200)&lt;br /&gt;
7   118.50 ms ix-17-0.tcore2.AEQ-Ashburn.as6453.net (216.6.87.149)&lt;br /&gt;
8   146.79 ms if-2-2.tcore1.AEQ-Ashburn.as6453.net (216.6.87.2)&lt;br /&gt;
9   139.47 ms if-7-2.tcore1.MLN-Miami.as6453.net (66.198.154.178)&lt;br /&gt;
10  146.84 ms 66.110.8.46&lt;br /&gt;
11  48.12 ms  10ge-ten1-2.mia-89p-cor-2.peer1.net (216.187.124.129)&lt;br /&gt;
12  53.93 ms  216.187.124.60&lt;br /&gt;
13  48.89 ms  198.105.251.210&lt;br /&gt;
&lt;br /&gt;
OS and Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 24.55 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Metasploit wmap ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ msfconsole&lt;br /&gt;
&lt;br /&gt;
       =[ metasploit v4.9.2-2014040906 [core:4.9 api:1.0] ]&lt;br /&gt;
+ -- --=[ 1299 exploits - 791 auxiliary - 217 post ]&lt;br /&gt;
+ -- --=[ 334 payloads - 35 encoders - 8 nops      ]&lt;br /&gt;
&lt;br /&gt;
msf &amp;gt; load wmap&lt;br /&gt;
&lt;br /&gt;
.-.-.-..-.-.-..---..---.&lt;br /&gt;
| | | || | | || | || |-'&lt;br /&gt;
`-----'`-'-'-'`-^-'`-'&lt;br /&gt;
[WMAP 1.5.1] ===  et [  ] metasploit.com 2012&lt;br /&gt;
[*] Successfully loaded plugin: wmap&lt;br /&gt;
msf &amp;gt; wmap_sites -a http://expertiza.ncsu.edu/&lt;br /&gt;
[*] Site created.&lt;br /&gt;
msf &amp;gt; wmap_sites -l&lt;br /&gt;
[*] Available sites&lt;br /&gt;
===============&lt;br /&gt;
&lt;br /&gt;
     Id  Host            Vhost           Port  Proto  # Pages  # Forms&lt;br /&gt;
     --  ----            -----           ----  -----  -------  -------&lt;br /&gt;
     0   152.14.105.146  152.14.105.146  80    http   0        0&lt;br /&gt;
msf &amp;gt; wmap_targets -t http://152.14.105.146/home.html&lt;br /&gt;
msf &amp;gt; wmap_targets -t http://152.14.105.146/home&lt;br /&gt;
msf &amp;gt; wmap_targets -l&lt;br /&gt;
[*] Defined targets&lt;br /&gt;
===============&lt;br /&gt;
&lt;br /&gt;
     Id  Vhost           Host            Port  SSL    Path&lt;br /&gt;
     --  -----           ----            ----  ---    ----&lt;br /&gt;
     0   152.14.105.146  152.14.105.146  80    false	/home.html&lt;br /&gt;
     1   152.14.105.146  152.14.105.146  80    false	/home&lt;br /&gt;
msf &amp;gt; wmap_run -t&lt;br /&gt;
[*] Testing target:&lt;br /&gt;
[*] 	Site: 152.14.105.146 (152.14.105.146)&lt;br /&gt;
[*] 	Port: 80 SSL: false&lt;br /&gt;
============================================================&lt;br /&gt;
[*] Testing started. 2014-04-21 02:33:20 -0400&lt;br /&gt;
[*] Loading wmap modules...&lt;br /&gt;
msf &amp;gt; wmap_run &lt;br /&gt;
[*] 39 wmap enabled modules loaded.&lt;br /&gt;
&amp;lt;snip&amp;gt;&lt;br /&gt;
[*] Done.&lt;br /&gt;
msf &amp;gt; wmap_vulns -l&lt;br /&gt;
msf &amp;gt; # No vuls discovered&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Metasploit dir_listing ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
msf &amp;gt; use auxiliary/scanner/http/dir_listing &lt;br /&gt;
msf auxiliary(dir_listing) &amp;gt; show options &lt;br /&gt;
&lt;br /&gt;
Module options (auxiliary/scanner/http/dir_listing):&lt;br /&gt;
&lt;br /&gt;
   Name     Current Setting  Required  Description&lt;br /&gt;
   ----     ---------------  --------  -----------&lt;br /&gt;
   PATH     /                yes       The path to identify directoy listing&lt;br /&gt;
   Proxies                   no        Use a proxy chain&lt;br /&gt;
   RHOSTS                    yes       The target address range or CIDR identifier&lt;br /&gt;
   RPORT    80               yes       The target port&lt;br /&gt;
   THREADS  1                yes       The number of concurrent threads&lt;br /&gt;
   VHOST                     no        HTTP server virtual host&lt;br /&gt;
&lt;br /&gt;
msf auxiliary(dir_listing) &amp;gt; set RHOSTS 66.152.109.110&lt;br /&gt;
RHOSTS =&amp;gt; 66.152.109.110&lt;br /&gt;
msf auxiliary(dir_listing) &amp;gt; run&lt;br /&gt;
&lt;br /&gt;
[*] Scanned 1 of 1 hosts (100% complete)&lt;br /&gt;
[*] Auxiliary module execution completed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Metasploit WebDAV IIS6 Unicode vulnerability ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
msf auxiliary(dir_webdav_unicode_bypass) &amp;gt; run&lt;br /&gt;
&lt;br /&gt;
[*] Using first 256 bytes of the response as 404 string&lt;br /&gt;
[*] Scanned 1 of 1 hosts (100% complete)&lt;br /&gt;
[*] Auxiliary module execution completed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/security_audit&amp;diff=84556</id>
		<title>CSC/ECE 517 Spring 2014/security audit</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/security_audit&amp;diff=84556"/>
		<updated>2014-04-21T07:31:53Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: /* Nmap scans */ Added many more scan results&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This page will document a security audit of Expertiza.&lt;br /&gt;
&lt;br /&gt;
= Scans =&lt;br /&gt;
&lt;br /&gt;
== Basic server info ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nslookup http://expertiza.ncsu.edu&lt;br /&gt;
Server:		209.18.47.61&lt;br /&gt;
Address:	209.18.47.61#53&lt;br /&gt;
&lt;br /&gt;
Non-authoritative answer:&lt;br /&gt;
Name:	http://expertiza.ncsu.edu&lt;br /&gt;
Address: 198.105.251.210&lt;br /&gt;
Name:	http://expertiza.ncsu.edu&lt;br /&gt;
Address: 66.152.109.110&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Nmap scans ==&lt;br /&gt;
&lt;br /&gt;
Collecting open ports.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nmap -Pn 66.152.109.110&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:18 EDT&lt;br /&gt;
Nmap scan report for 66-152-109-110.tvc-ip.com (66.152.109.110)&lt;br /&gt;
Host is up (0.038s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE&lt;br /&gt;
80/tcp  open   http&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 7.26 seconds&lt;br /&gt;
[~]$ nmap -Pn 198.105.251.210&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:18 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.058s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE&lt;br /&gt;
80/tcp  open   http&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 6.36 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking for a firewall (none evident).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ sudo nmap -sA 66.152.109.110&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:26 EDT&lt;br /&gt;
Nmap scan report for 66-152-109-110.tvc-ip.com (66.152.109.110)&lt;br /&gt;
Host is up (0.034s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE      SERVICE&lt;br /&gt;
80/tcp  unfiltered http&lt;br /&gt;
443/tcp unfiltered https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 6.15 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check versions of running services.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nmap -sV 198.105.251.210&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:21 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.069s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE VERSION&lt;br /&gt;
80/tcp  open   http    nginx&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 16.04 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Determine OS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ sudo nmap -A -Pn 198.105.251.210&lt;br /&gt;
[sudo] password for daniel: &lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:29 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.058s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE VERSION&lt;br /&gt;
80/tcp  open   http    nginx&lt;br /&gt;
|_http-methods: No Allow or Public header in OPTIONS response (status code 410)&lt;br /&gt;
| http-robots.txt: 1 disallowed entry &lt;br /&gt;
|_/&lt;br /&gt;
|_http-title: Site doesn't have a title (text/html).&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
Aggressive OS guesses: Linux 3.0 (95%), Linux 2.6.32 (93%), Linux 2.6.38 (93%), OpenWrt White Russian 0.9 (Linux 2.4.30) (90%), OpenWrt 0.9 - 7.09 (Linux 2.4.30 - 2.4.34) (90%), OpenWrt Kamikaze 7.09 (Linux 2.6.22) (90%), HP P2000 G3 NAS device (90%), Linux 2.4.18 (88%), D-Link DIR-615, Encore 3G, or EnGenius ESR-9752 WAP (88%), Linux 2.6.19 - 2.6.32 (88%)&lt;br /&gt;
No exact OS matches for host (test conditions non-ideal).&lt;br /&gt;
Network Distance: 13 hops&lt;br /&gt;
&lt;br /&gt;
TRACEROUTE (using port 443/tcp)&lt;br /&gt;
HOP RTT       ADDRESS&lt;br /&gt;
1   101.01 ms 10.0.0.1&lt;br /&gt;
2   136.69 ms cpe-075-182-096-001.nc.res.rr.com (75.182.96.1)&lt;br /&gt;
3   118.38 ms 66.26.47.101&lt;br /&gt;
4   118.44 ms ae19.rlghncpop-rtr1.southeast.rr.com (24.93.64.0)&lt;br /&gt;
5   125.87 ms 107.14.19.42&lt;br /&gt;
6   118.50 ms ae0.pr1.dca10.tbone.rr.com (107.14.17.200)&lt;br /&gt;
7   118.50 ms ix-17-0.tcore2.AEQ-Ashburn.as6453.net (216.6.87.149)&lt;br /&gt;
8   146.79 ms if-2-2.tcore1.AEQ-Ashburn.as6453.net (216.6.87.2)&lt;br /&gt;
9   139.47 ms if-7-2.tcore1.MLN-Miami.as6453.net (66.198.154.178)&lt;br /&gt;
10  146.84 ms 66.110.8.46&lt;br /&gt;
11  48.12 ms  10ge-ten1-2.mia-89p-cor-2.peer1.net (216.187.124.129)&lt;br /&gt;
12  53.93 ms  216.187.124.60&lt;br /&gt;
13  48.89 ms  198.105.251.210&lt;br /&gt;
&lt;br /&gt;
OS and Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 24.55 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Metasploit wmap ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ msfconsole&lt;br /&gt;
&lt;br /&gt;
       =[ metasploit v4.9.2-2014040906 [core:4.9 api:1.0] ]&lt;br /&gt;
+ -- --=[ 1299 exploits - 791 auxiliary - 217 post ]&lt;br /&gt;
+ -- --=[ 334 payloads - 35 encoders - 8 nops      ]&lt;br /&gt;
&lt;br /&gt;
msf &amp;gt; load wmap&lt;br /&gt;
&lt;br /&gt;
.-.-.-..-.-.-..---..---.&lt;br /&gt;
| | | || | | || | || |-'&lt;br /&gt;
`-----'`-'-'-'`-^-'`-'&lt;br /&gt;
[WMAP 1.5.1] ===  et [  ] metasploit.com 2012&lt;br /&gt;
[*] Successfully loaded plugin: wmap&lt;br /&gt;
msf &amp;gt; wmap_sites -a http://expertiza.ncsu.edu/&lt;br /&gt;
[*] Site created.&lt;br /&gt;
msf &amp;gt; wmap_sites -l&lt;br /&gt;
[*] Available sites&lt;br /&gt;
===============&lt;br /&gt;
&lt;br /&gt;
     Id  Host            Vhost           Port  Proto  # Pages  # Forms&lt;br /&gt;
     --  ----            -----           ----  -----  -------  -------&lt;br /&gt;
     0   152.14.105.146  152.14.105.146  80    http   0        0&lt;br /&gt;
msf &amp;gt; wmap_targets -t http://152.14.105.146/home.html&lt;br /&gt;
msf &amp;gt; wmap_targets -t http://152.14.105.146/home&lt;br /&gt;
msf &amp;gt; wmap_targets -l&lt;br /&gt;
[*] Defined targets&lt;br /&gt;
===============&lt;br /&gt;
&lt;br /&gt;
     Id  Vhost           Host            Port  SSL    Path&lt;br /&gt;
     --  -----           ----            ----  ---    ----&lt;br /&gt;
     0   152.14.105.146  152.14.105.146  80    false	/home.html&lt;br /&gt;
     1   152.14.105.146  152.14.105.146  80    false	/home&lt;br /&gt;
msf &amp;gt; wmap_run -t&lt;br /&gt;
[*] Testing target:&lt;br /&gt;
[*] 	Site: 152.14.105.146 (152.14.105.146)&lt;br /&gt;
[*] 	Port: 80 SSL: false&lt;br /&gt;
============================================================&lt;br /&gt;
[*] Testing started. 2014-04-21 02:33:20 -0400&lt;br /&gt;
[*] Loading wmap modules...&lt;br /&gt;
msf &amp;gt; wmap_run &lt;br /&gt;
[*] 39 wmap enabled modules loaded.&lt;br /&gt;
&amp;lt;snip&amp;gt;&lt;br /&gt;
[*] Done.&lt;br /&gt;
msf &amp;gt; wmap_vulns -l&lt;br /&gt;
msf &amp;gt; # No vuls discovered&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/security_audit&amp;diff=84555</id>
		<title>CSC/ECE 517 Spring 2014/security audit</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/security_audit&amp;diff=84555"/>
		<updated>2014-04-21T07:20:30Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: Added basic nmap scans, better formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This page will document a security audit of Expertiza.&lt;br /&gt;
&lt;br /&gt;
= Scans =&lt;br /&gt;
&lt;br /&gt;
== Basic server info ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nslookup http://expertiza.ncsu.edu&lt;br /&gt;
Server:		209.18.47.61&lt;br /&gt;
Address:	209.18.47.61#53&lt;br /&gt;
&lt;br /&gt;
Non-authoritative answer:&lt;br /&gt;
Name:	http://expertiza.ncsu.edu&lt;br /&gt;
Address: 198.105.251.210&lt;br /&gt;
Name:	http://expertiza.ncsu.edu&lt;br /&gt;
Address: 66.152.109.110&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Nmap scans ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ nmap -Pn 66.152.109.110                                                               3:18:22&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:18 EDT&lt;br /&gt;
Nmap scan report for 66-152-109-110.tvc-ip.com (66.152.109.110)&lt;br /&gt;
Host is up (0.038s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE&lt;br /&gt;
80/tcp  open   http&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 7.26 seconds&lt;br /&gt;
[~]$ nmap -Pn 198.105.251.210                                                              3:18:43&lt;br /&gt;
&lt;br /&gt;
Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-21 03:18 EDT&lt;br /&gt;
Nmap scan report for 198.105.251.210&lt;br /&gt;
Host is up (0.058s latency).&lt;br /&gt;
Not shown: 998 filtered ports&lt;br /&gt;
PORT    STATE  SERVICE&lt;br /&gt;
80/tcp  open   http&lt;br /&gt;
443/tcp closed https&lt;br /&gt;
&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 6.36 seconds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Metasploit wmap ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ msfconsole&lt;br /&gt;
&lt;br /&gt;
       =[ metasploit v4.9.2-2014040906 [core:4.9 api:1.0] ]&lt;br /&gt;
+ -- --=[ 1299 exploits - 791 auxiliary - 217 post ]&lt;br /&gt;
+ -- --=[ 334 payloads - 35 encoders - 8 nops      ]&lt;br /&gt;
&lt;br /&gt;
msf &amp;gt; load wmap&lt;br /&gt;
&lt;br /&gt;
.-.-.-..-.-.-..---..---.&lt;br /&gt;
| | | || | | || | || |-'&lt;br /&gt;
`-----'`-'-'-'`-^-'`-'&lt;br /&gt;
[WMAP 1.5.1] ===  et [  ] metasploit.com 2012&lt;br /&gt;
[*] Successfully loaded plugin: wmap&lt;br /&gt;
msf &amp;gt; wmap_sites -a http://expertiza.ncsu.edu/&lt;br /&gt;
[*] Site created.&lt;br /&gt;
msf &amp;gt; wmap_sites -l&lt;br /&gt;
[*] Available sites&lt;br /&gt;
===============&lt;br /&gt;
&lt;br /&gt;
     Id  Host            Vhost           Port  Proto  # Pages  # Forms&lt;br /&gt;
     --  ----            -----           ----  -----  -------  -------&lt;br /&gt;
     0   152.14.105.146  152.14.105.146  80    http   0        0&lt;br /&gt;
msf &amp;gt; wmap_targets -t http://152.14.105.146/home.html&lt;br /&gt;
msf &amp;gt; wmap_targets -t http://152.14.105.146/home&lt;br /&gt;
msf &amp;gt; wmap_targets -l&lt;br /&gt;
[*] Defined targets&lt;br /&gt;
===============&lt;br /&gt;
&lt;br /&gt;
     Id  Vhost           Host            Port  SSL    Path&lt;br /&gt;
     --  -----           ----            ----  ---    ----&lt;br /&gt;
     0   152.14.105.146  152.14.105.146  80    false	/home.html&lt;br /&gt;
     1   152.14.105.146  152.14.105.146  80    false	/home&lt;br /&gt;
msf &amp;gt; wmap_run -t&lt;br /&gt;
[*] Testing target:&lt;br /&gt;
[*] 	Site: 152.14.105.146 (152.14.105.146)&lt;br /&gt;
[*] 	Port: 80 SSL: false&lt;br /&gt;
============================================================&lt;br /&gt;
[*] Testing started. 2014-04-21 02:33:20 -0400&lt;br /&gt;
[*] Loading wmap modules...&lt;br /&gt;
msf &amp;gt; wmap_run &lt;br /&gt;
[*] 39 wmap enabled modules loaded.&lt;br /&gt;
&amp;lt;snip&amp;gt;&lt;br /&gt;
[*] Done.&lt;br /&gt;
msf &amp;gt; wmap_vulns -l&lt;br /&gt;
msf &amp;gt; # No vuls discovered&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/security_audit&amp;diff=84554</id>
		<title>CSC/ECE 517 Spring 2014/security audit</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/security_audit&amp;diff=84554"/>
		<updated>2014-04-21T07:19:34Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: Added nslookup results&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This page will document a security audit of Expertiza.&lt;br /&gt;
&lt;br /&gt;
= Scans =&lt;br /&gt;
&lt;br /&gt;
== Basic server info ==&lt;br /&gt;
&lt;br /&gt;
[~]$ nslookup http://expertiza.ncsu.edu&lt;br /&gt;
Server:		209.18.47.61&lt;br /&gt;
Address:	209.18.47.61#53&lt;br /&gt;
&lt;br /&gt;
Non-authoritative answer:&lt;br /&gt;
Name:	http://expertiza.ncsu.edu&lt;br /&gt;
Address: 198.105.251.210&lt;br /&gt;
Name:	http://expertiza.ncsu.edu&lt;br /&gt;
Address: 66.152.109.110&lt;br /&gt;
&lt;br /&gt;
== Metasploit wmap ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ msfconsole&lt;br /&gt;
&lt;br /&gt;
       =[ metasploit v4.9.2-2014040906 [core:4.9 api:1.0] ]&lt;br /&gt;
+ -- --=[ 1299 exploits - 791 auxiliary - 217 post ]&lt;br /&gt;
+ -- --=[ 334 payloads - 35 encoders - 8 nops      ]&lt;br /&gt;
&lt;br /&gt;
msf &amp;gt; load wmap&lt;br /&gt;
&lt;br /&gt;
.-.-.-..-.-.-..---..---.&lt;br /&gt;
| | | || | | || | || |-'&lt;br /&gt;
`-----'`-'-'-'`-^-'`-'&lt;br /&gt;
[WMAP 1.5.1] ===  et [  ] metasploit.com 2012&lt;br /&gt;
[*] Successfully loaded plugin: wmap&lt;br /&gt;
msf &amp;gt; wmap_sites -a http://expertiza.ncsu.edu/&lt;br /&gt;
[*] Site created.&lt;br /&gt;
msf &amp;gt; wmap_sites -l&lt;br /&gt;
[*] Available sites&lt;br /&gt;
===============&lt;br /&gt;
&lt;br /&gt;
     Id  Host            Vhost           Port  Proto  # Pages  # Forms&lt;br /&gt;
     --  ----            -----           ----  -----  -------  -------&lt;br /&gt;
     0   152.14.105.146  152.14.105.146  80    http   0        0&lt;br /&gt;
msf &amp;gt; wmap_targets -t http://152.14.105.146/home.html&lt;br /&gt;
msf &amp;gt; wmap_targets -t http://152.14.105.146/home&lt;br /&gt;
msf &amp;gt; wmap_targets -l&lt;br /&gt;
[*] Defined targets&lt;br /&gt;
===============&lt;br /&gt;
&lt;br /&gt;
     Id  Vhost           Host            Port  SSL    Path&lt;br /&gt;
     --  -----           ----            ----  ---    ----&lt;br /&gt;
     0   152.14.105.146  152.14.105.146  80    false	/home.html&lt;br /&gt;
     1   152.14.105.146  152.14.105.146  80    false	/home&lt;br /&gt;
msf &amp;gt; wmap_run -t&lt;br /&gt;
[*] Testing target:&lt;br /&gt;
[*] 	Site: 152.14.105.146 (152.14.105.146)&lt;br /&gt;
[*] 	Port: 80 SSL: false&lt;br /&gt;
============================================================&lt;br /&gt;
[*] Testing started. 2014-04-21 02:33:20 -0400&lt;br /&gt;
[*] Loading wmap modules...&lt;br /&gt;
msf &amp;gt; wmap_run &lt;br /&gt;
[*] 39 wmap enabled modules loaded.&lt;br /&gt;
&amp;lt;snip&amp;gt;&lt;br /&gt;
[*] Done.&lt;br /&gt;
msf &amp;gt; wmap_vulns -l&lt;br /&gt;
msf &amp;gt; # No vuls discovered&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/security_audit&amp;diff=84553</id>
		<title>CSC/ECE 517 Spring 2014/security audit</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/security_audit&amp;diff=84553"/>
		<updated>2014-04-21T06:53:35Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: Added basic wmap scan data&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
This page will document a security audit of Expertiza.&lt;br /&gt;
&lt;br /&gt;
== Metasploit wmap ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[~]$ msfconsole&lt;br /&gt;
&lt;br /&gt;
       =[ metasploit v4.9.2-2014040906 [core:4.9 api:1.0] ]&lt;br /&gt;
+ -- --=[ 1299 exploits - 791 auxiliary - 217 post ]&lt;br /&gt;
+ -- --=[ 334 payloads - 35 encoders - 8 nops      ]&lt;br /&gt;
&lt;br /&gt;
msf &amp;gt; load wmap&lt;br /&gt;
&lt;br /&gt;
.-.-.-..-.-.-..---..---.&lt;br /&gt;
| | | || | | || | || |-'&lt;br /&gt;
`-----'`-'-'-'`-^-'`-'&lt;br /&gt;
[WMAP 1.5.1] ===  et [  ] metasploit.com 2012&lt;br /&gt;
[*] Successfully loaded plugin: wmap&lt;br /&gt;
msf &amp;gt; wmap_sites -a http://expertiza.ncsu.edu/&lt;br /&gt;
[*] Site created.&lt;br /&gt;
msf &amp;gt; wmap_sites -l&lt;br /&gt;
[*] Available sites&lt;br /&gt;
===============&lt;br /&gt;
&lt;br /&gt;
     Id  Host            Vhost           Port  Proto  # Pages  # Forms&lt;br /&gt;
     --  ----            -----           ----  -----  -------  -------&lt;br /&gt;
     0   152.14.105.146  152.14.105.146  80    http   0        0&lt;br /&gt;
msf &amp;gt; wmap_targets -t http://152.14.105.146/home.html&lt;br /&gt;
msf &amp;gt; wmap_targets -t http://152.14.105.146/home&lt;br /&gt;
msf &amp;gt; wmap_targets -l&lt;br /&gt;
[*] Defined targets&lt;br /&gt;
===============&lt;br /&gt;
&lt;br /&gt;
     Id  Vhost           Host            Port  SSL    Path&lt;br /&gt;
     --  -----           ----            ----  ---    ----&lt;br /&gt;
     0   152.14.105.146  152.14.105.146  80    false	/home.html&lt;br /&gt;
     1   152.14.105.146  152.14.105.146  80    false	/home&lt;br /&gt;
msf &amp;gt; wmap_run -t&lt;br /&gt;
[*] Testing target:&lt;br /&gt;
[*] 	Site: 152.14.105.146 (152.14.105.146)&lt;br /&gt;
[*] 	Port: 80 SSL: false&lt;br /&gt;
============================================================&lt;br /&gt;
[*] Testing started. 2014-04-21 02:33:20 -0400&lt;br /&gt;
[*] Loading wmap modules...&lt;br /&gt;
msf &amp;gt; wmap_run &lt;br /&gt;
[*] 39 wmap enabled modules loaded.&lt;br /&gt;
&amp;lt;snip&amp;gt;&lt;br /&gt;
[*] Done.&lt;br /&gt;
msf &amp;gt; wmap_vulns -l&lt;br /&gt;
msf &amp;gt; # No vuls discovered&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014&amp;diff=84552</id>
		<title>CSC/ECE 517 Spring 2014</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014&amp;diff=84552"/>
		<updated>2014-04-21T06:48:07Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: Added link to wiki that will document my security audit project&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[CSC/ECE_517_Fall_2012/example_page]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/ch1a 1a rt]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/ch1a 1e rm]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/ch1 1w1h jg ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/ch1 1w1b np]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/ch1 1w1f mj]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/ch1a 1d mm]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/ch1a 1c yj]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/ch1 1w1l m]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/ch1 1w1m bm]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/ch1a 1p fy]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/oss E1401 lmn]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/oss E1402 mmb]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/oss E1404 mnp]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/oss E1405 irw]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/oss E1406 st]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/oss S1402 jyy]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/oss E1413 mnp]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/oss E1414 st]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2014/security_audit]]&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/oss_E1405_irw&amp;diff=84255</id>
		<title>CSC/ECE 517 Spring 2014/oss E1405 irw</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/oss_E1405_irw&amp;diff=84255"/>
		<updated>2014-04-01T03:14:04Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: /* Objective 2: Add additional tests */ Added note about better tests vs more tests&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Improve tests &amp;amp; investigate regex warnings for student_task '''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
This model allows for much of the functionality the student requires to interact effectively with expertiza. Here a student is able to sign up for topics, form teams, submit assignments, review other students' work, and check his or her own scores.&lt;br /&gt;
&lt;br /&gt;
== Work accomplished ==&lt;br /&gt;
&lt;br /&gt;
=== Objective 1: Fix existing tests ===&lt;br /&gt;
&lt;br /&gt;
Initially, there were 26 tests with errors. Many tests required functionality or fixtures that were likely changed by people working on expertiza over the years.&lt;br /&gt;
&lt;br /&gt;
==== Issues ====&lt;br /&gt;
&lt;br /&gt;
Many fixtures required to correct the tests were missing, and had to be added or created. Additionally, several tests were referencing deleted elements of fixture files which were added in order to correct test functionality. Finally, there were certain elements of the code itself in the controller file which had to be corrected in order for tests to run.&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
&lt;br /&gt;
All tests now pass without errors, failures or deprecation warnings:&lt;br /&gt;
&lt;br /&gt;
.........................&lt;br /&gt;
&lt;br /&gt;
Finished in 1.235192136 seconds.&lt;br /&gt;
&lt;br /&gt;
25 tests, 26 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Objective 2: Add additional tests ===&lt;br /&gt;
&lt;br /&gt;
After digging into the code, it became clear that what's needed isn't more tests, but better tests. The existing tests were very obtuse and frequently broken. They are now much more maintainable.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
There is no current unit test file for student_task, which means there aren't unit tests. Such tests should be added in the future in order to ensure proper functionality.&lt;br /&gt;
&lt;br /&gt;
With regard to student_task_controller_test.rb, it really should be refactored more than expanded. It has reasonable test coverage, what it needs is easier to understand, more elegant tests.&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/oss_E1405_irw&amp;diff=84253</id>
		<title>CSC/ECE 517 Spring 2014/oss E1405 irw</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/oss_E1405_irw&amp;diff=84253"/>
		<updated>2014-04-01T03:10:43Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: Added note about refactoring existing tests, added test passing details&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Improve tests &amp;amp; investigate regex warnings for student_task '''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
This model allows for much of the functionality the student requires to interact effectively with expertiza. Here a student is able to sign up for topics, form teams, submit assignments, review other students' work, and check his or her own scores.&lt;br /&gt;
&lt;br /&gt;
== Work accomplished ==&lt;br /&gt;
&lt;br /&gt;
=== Objective 1: Fix existing tests ===&lt;br /&gt;
&lt;br /&gt;
Initially, there were 26 tests with errors. Many tests required functionality or fixtures that were likely changed by people working on expertiza over the years.&lt;br /&gt;
&lt;br /&gt;
==== Issues ====&lt;br /&gt;
&lt;br /&gt;
Many fixtures required to correct the tests were missing, and had to be added or created. Additionally, several tests were referencing deleted elements of fixture files which were added in order to correct test functionality. Finally, there were certain elements of the code itself in the controller file which had to be corrected in order for tests to run.&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
&lt;br /&gt;
All tests now pass without errors, failures or deprecation warnings:&lt;br /&gt;
&lt;br /&gt;
.........................&lt;br /&gt;
&lt;br /&gt;
Finished in 1.235192136 seconds.&lt;br /&gt;
&lt;br /&gt;
25 tests, 26 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Objective 2: Add additional tests ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
There is no current unit test file for student_task, which means there aren't unit tests. Such tests should be added in the future in order to ensure proper functionality.&lt;br /&gt;
&lt;br /&gt;
With regard to student_task_controller_test.rb, it really should be refactored more than expanded. It has reasonable test coverage, what it needs is easier to understand, more elegant tests.&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83616</id>
		<title>CSC/ECE 517 Spring 2014/ch1 1w1l m</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83616"/>
		<updated>2014-02-24T04:28:22Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: /* See Also */ Added some links to resources I found helpful&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Design Patterns Involving Closures =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== Explanation of Closures ===&lt;br /&gt;
&lt;br /&gt;
====Blocks in Ruby====&lt;br /&gt;
A block is a segment of code that can be used as an argument for a method[http://www.robertsosinski.com/2008/12/21/understanding-ruby-blocks-procs-and-lambdas/]. These segments of code may have their own initialized variables only able to be referenced locally in the block, much like in a method. Single line blocks are commonly encapsulated in curly braces after a method call, and multi-line blocks are between &amp;quot;do&amp;quot; and &amp;quot;end&amp;quot; statements. A block's code is not executed when it is encountered, but rather after all instances of the yield statement within the method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 =begin  &lt;br /&gt;
  Ruby Code blocks are chunks of code between braces or  &lt;br /&gt;
  between do- end that you can associate with method invocations  &lt;br /&gt;
 =end  &lt;br /&gt;
 def call_block  &lt;br /&gt;
  puts 'Start of method'  &lt;br /&gt;
  # you can call the block using the yield keyword  &lt;br /&gt;
  yield  &lt;br /&gt;
  yield  &lt;br /&gt;
  puts 'End of method'  &lt;br /&gt;
 end  &lt;br /&gt;
 # Code blocks may appear only in the source adjacent to a method call  &lt;br /&gt;
 call_block {puts 'In the block'}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The above code outputs the following:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;gt;ruby p022codeblock.rb  &lt;br /&gt;
    Start of method  &lt;br /&gt;
    In the block  &lt;br /&gt;
    In the block  &lt;br /&gt;
    End of method  &lt;br /&gt;
    &amp;gt;Exit code: 0  &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====So what's a closure?====&lt;br /&gt;
Very simply, a closure is a function that can use a variable that was valid within the scope that the closure was defined, but need not be in-scope where the closure is called.[https://www.princeton.edu/~achaney/tmve/wiki100k/docs/Closure_(computer_science).html] A quick example is very illustrative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 def closure_builder(message=&amp;quot;Default&amp;quot;):&lt;br /&gt;
     def closure():&lt;br /&gt;
         # Message is in-scope here&lt;br /&gt;
         print message&lt;br /&gt;
     return closure&lt;br /&gt;
 &lt;br /&gt;
 # Build two functions&lt;br /&gt;
 default_closure = closure_builder()&lt;br /&gt;
 custom_closure = closure_builder(&amp;quot;Custom&amp;quot;)&lt;br /&gt;
 del closure_builder&lt;br /&gt;
 &lt;br /&gt;
 # Call the closures you built&lt;br /&gt;
 default_closure()  # Amazingly, prints &amp;quot;Default&amp;quot;&lt;br /&gt;
 custom_closure()  # Amazingly, prints &amp;quot;Custom&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Decorators ===&lt;br /&gt;
&lt;br /&gt;
[https://wiki.python.org/moin/PythonDecorators Decorators] are an interesting and powerful language feature that can be implemented elegantly with closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def decorate(func):&lt;br /&gt;
     def decorated_func():&lt;br /&gt;
         print &amp;quot;About to call func&amp;quot;&lt;br /&gt;
         func()&lt;br /&gt;
         print &amp;quot;Back from calling func&amp;quot;&lt;br /&gt;
     return decorated_func&lt;br /&gt;
 &lt;br /&gt;
 @decorate&lt;br /&gt;
 def func_to_decorate():&lt;br /&gt;
     print &amp;quot;In func_to_decorate&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 func_to_decorate()&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [~517/wiki]$ chmod ug+x decorator.py&lt;br /&gt;
 [~517/wiki]$ ./decorator.py&lt;br /&gt;
 About to call func&lt;br /&gt;
 In func_to_decorate&lt;br /&gt;
 Back from calling func&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Command Pattern===&lt;br /&gt;
The [https://en.wikipedia.org/wiki/Command_pattern Command Pattern] can be implemented using proc objects, which are the closure of an object.&lt;br /&gt;
&lt;br /&gt;
In the Command Pattern, commands for objects to be implemented are queued and can be executed at any time. Arguments are considered passed when the method is called.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 count = 0&lt;br /&gt;
 &lt;br /&gt;
 commands = []&lt;br /&gt;
 (1..10).each do |i|&lt;br /&gt;
   commands &amp;lt;&amp;lt; proc { count +=i }&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 puts &amp;quot;Count is initially #{count}&amp;quot;&lt;br /&gt;
 commands.each { |cmd| cmd.call }&lt;br /&gt;
 puts &amp;quot;Performed all commands. count is #{count}&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Strategy Pattern===&lt;br /&gt;
The [http://www.codeproject.com/Articles/52807/Design-Patterns-Part-1-The-Strategy-Pattern Strategy Pattern] allows an algorithms behavior to be determined at runtime. It describes the definition of a family of interchangeable algorithm classes whose functionality is different for identically named methods. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 class Fighter&lt;br /&gt;
  def initialize(&amp;amp;fighting_behavior)&lt;br /&gt;
    @finish_move = fighting_behavior&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
  def finish_opponent&lt;br /&gt;
    @finish_move.call&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
  &lt;br /&gt;
 boxer = Fighter.new { puts 'Left hook to the body!' }&lt;br /&gt;
 boxer.finish_opponent #=&amp;gt; Left hook to the body!&lt;br /&gt;
  &lt;br /&gt;
 mortal_kombat_warrior = Fighter.new { puts 'Blast him with a lighting bolt' }&lt;br /&gt;
 mortal_kombat_warrior.finish_opponent #=&amp;gt; Blast him with a lighting bolt&lt;br /&gt;
  &lt;br /&gt;
 mma = Fighter.new { puts 'Put you to sleep, Good Night!' }&lt;br /&gt;
 mma.finish_opponent #=&amp;gt; Put you to sleep, Good Night!&lt;br /&gt;
  &lt;br /&gt;
 lion = Fighter.new { puts 'Bites your head off' }&lt;br /&gt;
 lion.finish_opponent #=&amp;gt; Bites your head off!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Function Factory ===&lt;br /&gt;
&lt;br /&gt;
A version of the classic [http://python-3-patterns-idioms-test.readthedocs.org/en/latest/Factory.html Factory Pattern], but for use with functions, can be implemented easily with the help of closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def status():&lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;Returns the status of the system. Just a stub, for demo.&lt;br /&gt;
 &lt;br /&gt;
     :returns: Always returns True. Just a demo.&lt;br /&gt;
 &lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
     return True&lt;br /&gt;
 &lt;br /&gt;
 def messenger_factory(messenger_type):&lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;Builds very lightweight messenger functions.&lt;br /&gt;
 &lt;br /&gt;
     :param messenger_type: Currently supported types are human and wire.&lt;br /&gt;
     :type messenger_type: string&lt;br /&gt;
     :returns: Function that creates messages of the required format.&lt;br /&gt;
 &lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
     version = &amp;quot;Version 1.0&amp;quot;&lt;br /&gt;
     dynamic_status = status&lt;br /&gt;
     if messenger_type == &amp;quot;human&amp;quot;:&lt;br /&gt;
         def human_messenger():&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;Messenger with a format that is human-readable.&lt;br /&gt;
 &lt;br /&gt;
             :returns: Human-readable string of status and version.&lt;br /&gt;
 &lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             return &amp;quot;Status is {}. Version is {}&amp;quot;.format(dynamic_status(), version)&lt;br /&gt;
         return human_messenger&lt;br /&gt;
     elif messenger_type == &amp;quot;wire&amp;quot;:&lt;br /&gt;
         def wire_messenger():&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;Messenger with format that is ready to be put on the wire.&lt;br /&gt;
 &lt;br /&gt;
             :returns: JSON (dict) message with status and version.&lt;br /&gt;
 &lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             return {&amp;quot;version&amp;quot;: version, &amp;quot;status&amp;quot;: dynamic_status()}&lt;br /&gt;
         return wire_messenger&lt;br /&gt;
     else:&lt;br /&gt;
         raise ValueError(&amp;quot;Unexpected messenger type: {}&amp;quot;.format(messenger_type))&lt;br /&gt;
 &lt;br /&gt;
 human_messenger = messenger_factory(&amp;quot;human&amp;quot;)&lt;br /&gt;
 wire_messenger = messenger_factory(&amp;quot;wire&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Human: {}&amp;quot;.format(human_messenger())&lt;br /&gt;
 print &amp;quot;Wire: {}&amp;quot;.format(wire_messenger())&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [~517/wiki]$ chmod ug+x func_factory.py&lt;br /&gt;
 [~517/wiki]$ ./func_factory.py&lt;br /&gt;
 Human: Status is True. Version is Version 1.0&lt;br /&gt;
 Wire: {'status': True, 'version': 'Version 1.0'}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [http://www.robertsosinski.com/2008/12/21/understanding-ruby-blocks-procs-and-lambdas/ Understanding Ruby Blocks, Procs and Lambdas]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Closure_(computer_programming) Closure (Computer Programming)]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Software_design_pattern Software Design Patterns]&lt;br /&gt;
* [http://joeybutler.net/ruby/what-is-a-closure What is a Closure?]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83615</id>
		<title>CSC/ECE 517 Spring 2014/ch1 1w1l m</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83615"/>
		<updated>2014-02-24T04:23:17Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: /* Blocks in Ruby */ Added citation for block def&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Design Patterns Involving Closures =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== Explanation of Closures ===&lt;br /&gt;
&lt;br /&gt;
====Blocks in Ruby====&lt;br /&gt;
A block is a segment of code that can be used as an argument for a method[http://www.robertsosinski.com/2008/12/21/understanding-ruby-blocks-procs-and-lambdas/]. These segments of code may have their own initialized variables only able to be referenced locally in the block, much like in a method. Single line blocks are commonly encapsulated in curly braces after a method call, and multi-line blocks are between &amp;quot;do&amp;quot; and &amp;quot;end&amp;quot; statements. A block's code is not executed when it is encountered, but rather after all instances of the yield statement within the method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 =begin  &lt;br /&gt;
  Ruby Code blocks are chunks of code between braces or  &lt;br /&gt;
  between do- end that you can associate with method invocations  &lt;br /&gt;
 =end  &lt;br /&gt;
 def call_block  &lt;br /&gt;
  puts 'Start of method'  &lt;br /&gt;
  # you can call the block using the yield keyword  &lt;br /&gt;
  yield  &lt;br /&gt;
  yield  &lt;br /&gt;
  puts 'End of method'  &lt;br /&gt;
 end  &lt;br /&gt;
 # Code blocks may appear only in the source adjacent to a method call  &lt;br /&gt;
 call_block {puts 'In the block'}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The above code outputs the following:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;gt;ruby p022codeblock.rb  &lt;br /&gt;
    Start of method  &lt;br /&gt;
    In the block  &lt;br /&gt;
    In the block  &lt;br /&gt;
    End of method  &lt;br /&gt;
    &amp;gt;Exit code: 0  &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====So what's a closure?====&lt;br /&gt;
Very simply, a closure is a function that can use a variable that was valid within the scope that the closure was defined, but need not be in-scope where the closure is called.[https://www.princeton.edu/~achaney/tmve/wiki100k/docs/Closure_(computer_science).html] A quick example is very illustrative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 def closure_builder(message=&amp;quot;Default&amp;quot;):&lt;br /&gt;
     def closure():&lt;br /&gt;
         # Message is in-scope here&lt;br /&gt;
         print message&lt;br /&gt;
     return closure&lt;br /&gt;
 &lt;br /&gt;
 # Build two functions&lt;br /&gt;
 default_closure = closure_builder()&lt;br /&gt;
 custom_closure = closure_builder(&amp;quot;Custom&amp;quot;)&lt;br /&gt;
 del closure_builder&lt;br /&gt;
 &lt;br /&gt;
 # Call the closures you built&lt;br /&gt;
 default_closure()  # Amazingly, prints &amp;quot;Default&amp;quot;&lt;br /&gt;
 custom_closure()  # Amazingly, prints &amp;quot;Custom&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Decorators ===&lt;br /&gt;
&lt;br /&gt;
[https://wiki.python.org/moin/PythonDecorators Decorators] are an interesting and powerful language feature that can be implemented elegantly with closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def decorate(func):&lt;br /&gt;
     def decorated_func():&lt;br /&gt;
         print &amp;quot;About to call func&amp;quot;&lt;br /&gt;
         func()&lt;br /&gt;
         print &amp;quot;Back from calling func&amp;quot;&lt;br /&gt;
     return decorated_func&lt;br /&gt;
 &lt;br /&gt;
 @decorate&lt;br /&gt;
 def func_to_decorate():&lt;br /&gt;
     print &amp;quot;In func_to_decorate&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 func_to_decorate()&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [~517/wiki]$ chmod ug+x decorator.py&lt;br /&gt;
 [~517/wiki]$ ./decorator.py&lt;br /&gt;
 About to call func&lt;br /&gt;
 In func_to_decorate&lt;br /&gt;
 Back from calling func&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Command Pattern===&lt;br /&gt;
The [https://en.wikipedia.org/wiki/Command_pattern Command Pattern] can be implemented using proc objects, which are the closure of an object.&lt;br /&gt;
&lt;br /&gt;
In the Command Pattern, commands for objects to be implemented are queued and can be executed at any time. Arguments are considered passed when the method is called.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 count = 0&lt;br /&gt;
 &lt;br /&gt;
 commands = []&lt;br /&gt;
 (1..10).each do |i|&lt;br /&gt;
   commands &amp;lt;&amp;lt; proc { count +=i }&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 puts &amp;quot;Count is initially #{count}&amp;quot;&lt;br /&gt;
 commands.each { |cmd| cmd.call }&lt;br /&gt;
 puts &amp;quot;Performed all commands. count is #{count}&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Strategy Pattern===&lt;br /&gt;
The [http://www.codeproject.com/Articles/52807/Design-Patterns-Part-1-The-Strategy-Pattern Strategy Pattern] allows an algorithms behavior to be determined at runtime. It describes the definition of a family of interchangeable algorithm classes whose functionality is different for identically named methods. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 class Fighter&lt;br /&gt;
  def initialize(&amp;amp;fighting_behavior)&lt;br /&gt;
    @finish_move = fighting_behavior&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
  def finish_opponent&lt;br /&gt;
    @finish_move.call&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
  &lt;br /&gt;
 boxer = Fighter.new { puts 'Left hook to the body!' }&lt;br /&gt;
 boxer.finish_opponent #=&amp;gt; Left hook to the body!&lt;br /&gt;
  &lt;br /&gt;
 mortal_kombat_warrior = Fighter.new { puts 'Blast him with a lighting bolt' }&lt;br /&gt;
 mortal_kombat_warrior.finish_opponent #=&amp;gt; Blast him with a lighting bolt&lt;br /&gt;
  &lt;br /&gt;
 mma = Fighter.new { puts 'Put you to sleep, Good Night!' }&lt;br /&gt;
 mma.finish_opponent #=&amp;gt; Put you to sleep, Good Night!&lt;br /&gt;
  &lt;br /&gt;
 lion = Fighter.new { puts 'Bites your head off' }&lt;br /&gt;
 lion.finish_opponent #=&amp;gt; Bites your head off!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Function Factory ===&lt;br /&gt;
&lt;br /&gt;
A version of the classic [http://python-3-patterns-idioms-test.readthedocs.org/en/latest/Factory.html Factory Pattern], but for use with functions, can be implemented easily with the help of closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def status():&lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;Returns the status of the system. Just a stub, for demo.&lt;br /&gt;
 &lt;br /&gt;
     :returns: Always returns True. Just a demo.&lt;br /&gt;
 &lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
     return True&lt;br /&gt;
 &lt;br /&gt;
 def messenger_factory(messenger_type):&lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;Builds very lightweight messenger functions.&lt;br /&gt;
 &lt;br /&gt;
     :param messenger_type: Currently supported types are human and wire.&lt;br /&gt;
     :type messenger_type: string&lt;br /&gt;
     :returns: Function that creates messages of the required format.&lt;br /&gt;
 &lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
     version = &amp;quot;Version 1.0&amp;quot;&lt;br /&gt;
     dynamic_status = status&lt;br /&gt;
     if messenger_type == &amp;quot;human&amp;quot;:&lt;br /&gt;
         def human_messenger():&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;Messenger with a format that is human-readable.&lt;br /&gt;
 &lt;br /&gt;
             :returns: Human-readable string of status and version.&lt;br /&gt;
 &lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             return &amp;quot;Status is {}. Version is {}&amp;quot;.format(dynamic_status(), version)&lt;br /&gt;
         return human_messenger&lt;br /&gt;
     elif messenger_type == &amp;quot;wire&amp;quot;:&lt;br /&gt;
         def wire_messenger():&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;Messenger with format that is ready to be put on the wire.&lt;br /&gt;
 &lt;br /&gt;
             :returns: JSON (dict) message with status and version.&lt;br /&gt;
 &lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             return {&amp;quot;version&amp;quot;: version, &amp;quot;status&amp;quot;: dynamic_status()}&lt;br /&gt;
         return wire_messenger&lt;br /&gt;
     else:&lt;br /&gt;
         raise ValueError(&amp;quot;Unexpected messenger type: {}&amp;quot;.format(messenger_type))&lt;br /&gt;
 &lt;br /&gt;
 human_messenger = messenger_factory(&amp;quot;human&amp;quot;)&lt;br /&gt;
 wire_messenger = messenger_factory(&amp;quot;wire&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Human: {}&amp;quot;.format(human_messenger())&lt;br /&gt;
 print &amp;quot;Wire: {}&amp;quot;.format(wire_messenger())&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [~517/wiki]$ chmod ug+x func_factory.py&lt;br /&gt;
 [~517/wiki]$ ./func_factory.py&lt;br /&gt;
 Human: Status is True. Version is Version 1.0&lt;br /&gt;
 Wire: {'status': True, 'version': 'Version 1.0'}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83614</id>
		<title>CSC/ECE 517 Spring 2014/ch1 1w1l m</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83614"/>
		<updated>2014-02-24T04:22:09Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: /* So what's a closure? */ Cited definition of closure&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Design Patterns Involving Closures =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== Explanation of Closures ===&lt;br /&gt;
&lt;br /&gt;
====Blocks in Ruby====&lt;br /&gt;
A block is a segment of code that can be used as an argument for a method. These segments of code may have their own initialized variables only able to be referenced locally in the block, much like in a method. Single line blocks are commonly encapsulated in curly braces after a method call, and multi-line blocks are between &amp;quot;do&amp;quot; and &amp;quot;end&amp;quot; statements. A block's code is not executed when it is encountered, but rather after all instances of the yield statement within the method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 =begin  &lt;br /&gt;
  Ruby Code blocks are chunks of code between braces or  &lt;br /&gt;
  between do- end that you can associate with method invocations  &lt;br /&gt;
 =end  &lt;br /&gt;
 def call_block  &lt;br /&gt;
  puts 'Start of method'  &lt;br /&gt;
  # you can call the block using the yield keyword  &lt;br /&gt;
  yield  &lt;br /&gt;
  yield  &lt;br /&gt;
  puts 'End of method'  &lt;br /&gt;
 end  &lt;br /&gt;
 # Code blocks may appear only in the source adjacent to a method call  &lt;br /&gt;
 call_block {puts 'In the block'}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The above code outputs the following:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;gt;ruby p022codeblock.rb  &lt;br /&gt;
    Start of method  &lt;br /&gt;
    In the block  &lt;br /&gt;
    In the block  &lt;br /&gt;
    End of method  &lt;br /&gt;
    &amp;gt;Exit code: 0  &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====So what's a closure?====&lt;br /&gt;
Very simply, a closure is a function that can use a variable that was valid within the scope that the closure was defined, but need not be in-scope where the closure is called.[https://www.princeton.edu/~achaney/tmve/wiki100k/docs/Closure_(computer_science).html] A quick example is very illustrative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 def closure_builder(message=&amp;quot;Default&amp;quot;):&lt;br /&gt;
     def closure():&lt;br /&gt;
         # Message is in-scope here&lt;br /&gt;
         print message&lt;br /&gt;
     return closure&lt;br /&gt;
 &lt;br /&gt;
 # Build two functions&lt;br /&gt;
 default_closure = closure_builder()&lt;br /&gt;
 custom_closure = closure_builder(&amp;quot;Custom&amp;quot;)&lt;br /&gt;
 del closure_builder&lt;br /&gt;
 &lt;br /&gt;
 # Call the closures you built&lt;br /&gt;
 default_closure()  # Amazingly, prints &amp;quot;Default&amp;quot;&lt;br /&gt;
 custom_closure()  # Amazingly, prints &amp;quot;Custom&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Decorators ===&lt;br /&gt;
&lt;br /&gt;
[https://wiki.python.org/moin/PythonDecorators Decorators] are an interesting and powerful language feature that can be implemented elegantly with closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def decorate(func):&lt;br /&gt;
     def decorated_func():&lt;br /&gt;
         print &amp;quot;About to call func&amp;quot;&lt;br /&gt;
         func()&lt;br /&gt;
         print &amp;quot;Back from calling func&amp;quot;&lt;br /&gt;
     return decorated_func&lt;br /&gt;
 &lt;br /&gt;
 @decorate&lt;br /&gt;
 def func_to_decorate():&lt;br /&gt;
     print &amp;quot;In func_to_decorate&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 func_to_decorate()&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [~517/wiki]$ chmod ug+x decorator.py&lt;br /&gt;
 [~517/wiki]$ ./decorator.py&lt;br /&gt;
 About to call func&lt;br /&gt;
 In func_to_decorate&lt;br /&gt;
 Back from calling func&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Command Pattern===&lt;br /&gt;
The [https://en.wikipedia.org/wiki/Command_pattern Command Pattern] can be implemented using proc objects, which are the closure of an object.&lt;br /&gt;
&lt;br /&gt;
In the Command Pattern, commands for objects to be implemented are queued and can be executed at any time. Arguments are considered passed when the method is called.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 count = 0&lt;br /&gt;
 &lt;br /&gt;
 commands = []&lt;br /&gt;
 (1..10).each do |i|&lt;br /&gt;
   commands &amp;lt;&amp;lt; proc { count +=i }&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 puts &amp;quot;Count is initially #{count}&amp;quot;&lt;br /&gt;
 commands.each { |cmd| cmd.call }&lt;br /&gt;
 puts &amp;quot;Performed all commands. count is #{count}&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Strategy Pattern===&lt;br /&gt;
The [http://www.codeproject.com/Articles/52807/Design-Patterns-Part-1-The-Strategy-Pattern Strategy Pattern] allows an algorithms behavior to be determined at runtime. It describes the definition of a family of interchangeable algorithm classes whose functionality is different for identically named methods. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 class Fighter&lt;br /&gt;
  def initialize(&amp;amp;fighting_behavior)&lt;br /&gt;
    @finish_move = fighting_behavior&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
  def finish_opponent&lt;br /&gt;
    @finish_move.call&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
  &lt;br /&gt;
 boxer = Fighter.new { puts 'Left hook to the body!' }&lt;br /&gt;
 boxer.finish_opponent #=&amp;gt; Left hook to the body!&lt;br /&gt;
  &lt;br /&gt;
 mortal_kombat_warrior = Fighter.new { puts 'Blast him with a lighting bolt' }&lt;br /&gt;
 mortal_kombat_warrior.finish_opponent #=&amp;gt; Blast him with a lighting bolt&lt;br /&gt;
  &lt;br /&gt;
 mma = Fighter.new { puts 'Put you to sleep, Good Night!' }&lt;br /&gt;
 mma.finish_opponent #=&amp;gt; Put you to sleep, Good Night!&lt;br /&gt;
  &lt;br /&gt;
 lion = Fighter.new { puts 'Bites your head off' }&lt;br /&gt;
 lion.finish_opponent #=&amp;gt; Bites your head off!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Function Factory ===&lt;br /&gt;
&lt;br /&gt;
A version of the classic [http://python-3-patterns-idioms-test.readthedocs.org/en/latest/Factory.html Factory Pattern], but for use with functions, can be implemented easily with the help of closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def status():&lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;Returns the status of the system. Just a stub, for demo.&lt;br /&gt;
 &lt;br /&gt;
     :returns: Always returns True. Just a demo.&lt;br /&gt;
 &lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
     return True&lt;br /&gt;
 &lt;br /&gt;
 def messenger_factory(messenger_type):&lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;Builds very lightweight messenger functions.&lt;br /&gt;
 &lt;br /&gt;
     :param messenger_type: Currently supported types are human and wire.&lt;br /&gt;
     :type messenger_type: string&lt;br /&gt;
     :returns: Function that creates messages of the required format.&lt;br /&gt;
 &lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
     version = &amp;quot;Version 1.0&amp;quot;&lt;br /&gt;
     dynamic_status = status&lt;br /&gt;
     if messenger_type == &amp;quot;human&amp;quot;:&lt;br /&gt;
         def human_messenger():&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;Messenger with a format that is human-readable.&lt;br /&gt;
 &lt;br /&gt;
             :returns: Human-readable string of status and version.&lt;br /&gt;
 &lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             return &amp;quot;Status is {}. Version is {}&amp;quot;.format(dynamic_status(), version)&lt;br /&gt;
         return human_messenger&lt;br /&gt;
     elif messenger_type == &amp;quot;wire&amp;quot;:&lt;br /&gt;
         def wire_messenger():&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;Messenger with format that is ready to be put on the wire.&lt;br /&gt;
 &lt;br /&gt;
             :returns: JSON (dict) message with status and version.&lt;br /&gt;
 &lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             return {&amp;quot;version&amp;quot;: version, &amp;quot;status&amp;quot;: dynamic_status()}&lt;br /&gt;
         return wire_messenger&lt;br /&gt;
     else:&lt;br /&gt;
         raise ValueError(&amp;quot;Unexpected messenger type: {}&amp;quot;.format(messenger_type))&lt;br /&gt;
 &lt;br /&gt;
 human_messenger = messenger_factory(&amp;quot;human&amp;quot;)&lt;br /&gt;
 wire_messenger = messenger_factory(&amp;quot;wire&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Human: {}&amp;quot;.format(human_messenger())&lt;br /&gt;
 print &amp;quot;Wire: {}&amp;quot;.format(wire_messenger())&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [~517/wiki]$ chmod ug+x func_factory.py&lt;br /&gt;
 [~517/wiki]$ ./func_factory.py&lt;br /&gt;
 Human: Status is True. Version is Version 1.0&lt;br /&gt;
 Wire: {'status': True, 'version': 'Version 1.0'}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83612</id>
		<title>CSC/ECE 517 Spring 2014/ch1 1w1l m</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83612"/>
		<updated>2014-02-24T04:13:32Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: /* Decorators */ Added external reference for decorators&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Design Patterns Involving Closures =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== Explanation of Closures ===&lt;br /&gt;
&lt;br /&gt;
====Blocks in Ruby====&lt;br /&gt;
A block is a segment of code that can be used as an argument for a method. These segments of code may have their own initialized variables only able to be referenced locally in the block, much like in a method. Single line blocks are commonly encapsulated in curly braces after a method call, and multi-line blocks are between &amp;quot;do&amp;quot; and &amp;quot;end&amp;quot; statements. A block's code is not executed when it is encountered, but rather after all instances of the yield statement within the method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 =begin  &lt;br /&gt;
  Ruby Code blocks are chunks of code between braces or  &lt;br /&gt;
  between do- end that you can associate with method invocations  &lt;br /&gt;
 =end  &lt;br /&gt;
 def call_block  &lt;br /&gt;
  puts 'Start of method'  &lt;br /&gt;
  # you can call the block using the yield keyword  &lt;br /&gt;
  yield  &lt;br /&gt;
  yield  &lt;br /&gt;
  puts 'End of method'  &lt;br /&gt;
 end  &lt;br /&gt;
 # Code blocks may appear only in the source adjacent to a method call  &lt;br /&gt;
 call_block {puts 'In the block'}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The above code outputs the following:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;gt;ruby p022codeblock.rb  &lt;br /&gt;
    Start of method  &lt;br /&gt;
    In the block  &lt;br /&gt;
    In the block  &lt;br /&gt;
    End of method  &lt;br /&gt;
    &amp;gt;Exit code: 0  &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====So what's a closure?====&lt;br /&gt;
Very simply, a closure is a function that can use a variable that was valid within the scope that the closure was defined, but need not be in-scope where the closure is called. A quick example is very illustrative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 def closure_builder(message=&amp;quot;Default&amp;quot;):&lt;br /&gt;
     def closure():&lt;br /&gt;
         # Message is in-scope here&lt;br /&gt;
         print message&lt;br /&gt;
     return closure&lt;br /&gt;
 &lt;br /&gt;
 # Build two functions&lt;br /&gt;
 default_closure = closure_builder()&lt;br /&gt;
 custom_closure = closure_builder(&amp;quot;Custom&amp;quot;)&lt;br /&gt;
 del closure_builder&lt;br /&gt;
 &lt;br /&gt;
 # Call the closures you built&lt;br /&gt;
 default_closure()  # Amazingly, prints &amp;quot;Default&amp;quot;&lt;br /&gt;
 custom_closure()  # Amazingly, prints &amp;quot;Custom&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Decorators ===&lt;br /&gt;
&lt;br /&gt;
[https://wiki.python.org/moin/PythonDecorators Decorators] are an interesting and powerful language feature that can be implemented elegantly with closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def decorate(func):&lt;br /&gt;
     def decorated_func():&lt;br /&gt;
         print &amp;quot;About to call func&amp;quot;&lt;br /&gt;
         func()&lt;br /&gt;
         print &amp;quot;Back from calling func&amp;quot;&lt;br /&gt;
     return decorated_func&lt;br /&gt;
 &lt;br /&gt;
 @decorate&lt;br /&gt;
 def func_to_decorate():&lt;br /&gt;
     print &amp;quot;In func_to_decorate&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 func_to_decorate()&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [~517/wiki]$ chmod ug+x decorator.py&lt;br /&gt;
 [~517/wiki]$ ./decorator.py&lt;br /&gt;
 About to call func&lt;br /&gt;
 In func_to_decorate&lt;br /&gt;
 Back from calling func&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Command Pattern===&lt;br /&gt;
The [https://en.wikipedia.org/wiki/Command_pattern Command Pattern] can be implemented using proc objects, which are the closure of an object.&lt;br /&gt;
&lt;br /&gt;
In the Command Pattern, commands for objects to be implemented are queued and can be executed at any time. Arguments are considered passed when the method is called.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 count = 0&lt;br /&gt;
 &lt;br /&gt;
 commands = []&lt;br /&gt;
 (1..10).each do |i|&lt;br /&gt;
   commands &amp;lt;&amp;lt; proc { count +=i }&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 puts &amp;quot;Count is initially #{count}&amp;quot;&lt;br /&gt;
 commands.each { |cmd| cmd.call }&lt;br /&gt;
 puts &amp;quot;Performed all commands. count is #{count}&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Strategy Pattern===&lt;br /&gt;
The [http://www.codeproject.com/Articles/52807/Design-Patterns-Part-1-The-Strategy-Pattern Strategy Pattern] allows an algorithms behavior to be determined at runtime. It describes the definition of a family of interchangeable algorithm classes whose functionality is different for identically named methods. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 class Fighter&lt;br /&gt;
  def initialize(&amp;amp;fighting_behavior)&lt;br /&gt;
    @finish_move = fighting_behavior&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
  def finish_opponent&lt;br /&gt;
    @finish_move.call&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
  &lt;br /&gt;
 boxer = Fighter.new { puts 'Left hook to the body!' }&lt;br /&gt;
 boxer.finish_opponent #=&amp;gt; Left hook to the body!&lt;br /&gt;
  &lt;br /&gt;
 mortal_kombat_warrior = Fighter.new { puts 'Blast him with a lighting bolt' }&lt;br /&gt;
 mortal_kombat_warrior.finish_opponent #=&amp;gt; Blast him with a lighting bolt&lt;br /&gt;
  &lt;br /&gt;
 mma = Fighter.new { puts 'Put you to sleep, Good Night!' }&lt;br /&gt;
 mma.finish_opponent #=&amp;gt; Put you to sleep, Good Night!&lt;br /&gt;
  &lt;br /&gt;
 lion = Fighter.new { puts 'Bites your head off' }&lt;br /&gt;
 lion.finish_opponent #=&amp;gt; Bites your head off!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Function Factory ===&lt;br /&gt;
&lt;br /&gt;
A version of the classic [http://python-3-patterns-idioms-test.readthedocs.org/en/latest/Factory.html Factory Pattern], but for use with functions, can be implemented easily with the help of closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def status():&lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;Returns the status of the system. Just a stub, for demo.&lt;br /&gt;
 &lt;br /&gt;
     :returns: Always returns True. Just a demo.&lt;br /&gt;
 &lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
     return True&lt;br /&gt;
 &lt;br /&gt;
 def messenger_factory(messenger_type):&lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;Builds very lightweight messenger functions.&lt;br /&gt;
 &lt;br /&gt;
     :param messenger_type: Currently supported types are human and wire.&lt;br /&gt;
     :type messenger_type: string&lt;br /&gt;
     :returns: Function that creates messages of the required format.&lt;br /&gt;
 &lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
     version = &amp;quot;Version 1.0&amp;quot;&lt;br /&gt;
     dynamic_status = status&lt;br /&gt;
     if messenger_type == &amp;quot;human&amp;quot;:&lt;br /&gt;
         def human_messenger():&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;Messenger with a format that is human-readable.&lt;br /&gt;
 &lt;br /&gt;
             :returns: Human-readable string of status and version.&lt;br /&gt;
 &lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             return &amp;quot;Status is {}. Version is {}&amp;quot;.format(dynamic_status(), version)&lt;br /&gt;
         return human_messenger&lt;br /&gt;
     elif messenger_type == &amp;quot;wire&amp;quot;:&lt;br /&gt;
         def wire_messenger():&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;Messenger with format that is ready to be put on the wire.&lt;br /&gt;
 &lt;br /&gt;
             :returns: JSON (dict) message with status and version.&lt;br /&gt;
 &lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             return {&amp;quot;version&amp;quot;: version, &amp;quot;status&amp;quot;: dynamic_status()}&lt;br /&gt;
         return wire_messenger&lt;br /&gt;
     else:&lt;br /&gt;
         raise ValueError(&amp;quot;Unexpected messenger type: {}&amp;quot;.format(messenger_type))&lt;br /&gt;
 &lt;br /&gt;
 human_messenger = messenger_factory(&amp;quot;human&amp;quot;)&lt;br /&gt;
 wire_messenger = messenger_factory(&amp;quot;wire&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Human: {}&amp;quot;.format(human_messenger())&lt;br /&gt;
 print &amp;quot;Wire: {}&amp;quot;.format(wire_messenger())&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [~517/wiki]$ chmod ug+x func_factory.py&lt;br /&gt;
 [~517/wiki]$ ./func_factory.py&lt;br /&gt;
 Human: Status is True. Version is Version 1.0&lt;br /&gt;
 Wire: {'status': True, 'version': 'Version 1.0'}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83611</id>
		<title>CSC/ECE 517 Spring 2014/ch1 1w1l m</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83611"/>
		<updated>2014-02-24T04:12:15Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: /* Strategy Pattern */ Link to Strategy Pattern reference&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Design Patterns Involving Closures =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== Explanation of Closures ===&lt;br /&gt;
&lt;br /&gt;
====Blocks in Ruby====&lt;br /&gt;
A block is a segment of code that can be used as an argument for a method. These segments of code may have their own initialized variables only able to be referenced locally in the block, much like in a method. Single line blocks are commonly encapsulated in curly braces after a method call, and multi-line blocks are between &amp;quot;do&amp;quot; and &amp;quot;end&amp;quot; statements. A block's code is not executed when it is encountered, but rather after all instances of the yield statement within the method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 =begin  &lt;br /&gt;
  Ruby Code blocks are chunks of code between braces or  &lt;br /&gt;
  between do- end that you can associate with method invocations  &lt;br /&gt;
 =end  &lt;br /&gt;
 def call_block  &lt;br /&gt;
  puts 'Start of method'  &lt;br /&gt;
  # you can call the block using the yield keyword  &lt;br /&gt;
  yield  &lt;br /&gt;
  yield  &lt;br /&gt;
  puts 'End of method'  &lt;br /&gt;
 end  &lt;br /&gt;
 # Code blocks may appear only in the source adjacent to a method call  &lt;br /&gt;
 call_block {puts 'In the block'}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The above code outputs the following:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;gt;ruby p022codeblock.rb  &lt;br /&gt;
    Start of method  &lt;br /&gt;
    In the block  &lt;br /&gt;
    In the block  &lt;br /&gt;
    End of method  &lt;br /&gt;
    &amp;gt;Exit code: 0  &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====So what's a closure?====&lt;br /&gt;
Very simply, a closure is a function that can use a variable that was valid within the scope that the closure was defined, but need not be in-scope where the closure is called. A quick example is very illustrative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 def closure_builder(message=&amp;quot;Default&amp;quot;):&lt;br /&gt;
     def closure():&lt;br /&gt;
         # Message is in-scope here&lt;br /&gt;
         print message&lt;br /&gt;
     return closure&lt;br /&gt;
 &lt;br /&gt;
 # Build two functions&lt;br /&gt;
 default_closure = closure_builder()&lt;br /&gt;
 custom_closure = closure_builder(&amp;quot;Custom&amp;quot;)&lt;br /&gt;
 del closure_builder&lt;br /&gt;
 &lt;br /&gt;
 # Call the closures you built&lt;br /&gt;
 default_closure()  # Amazingly, prints &amp;quot;Default&amp;quot;&lt;br /&gt;
 custom_closure()  # Amazingly, prints &amp;quot;Custom&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Decorators ===&lt;br /&gt;
&lt;br /&gt;
Decorators are an interesting and powerful language feature that can be implemented elegantly with closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def decorate(func):&lt;br /&gt;
     def decorated_func():&lt;br /&gt;
         print &amp;quot;About to call func&amp;quot;&lt;br /&gt;
         func()&lt;br /&gt;
         print &amp;quot;Back from calling func&amp;quot;&lt;br /&gt;
     return decorated_func&lt;br /&gt;
 &lt;br /&gt;
 @decorate&lt;br /&gt;
 def func_to_decorate():&lt;br /&gt;
     print &amp;quot;In func_to_decorate&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 func_to_decorate()&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [~517/wiki]$ chmod ug+x decorator.py&lt;br /&gt;
 [~517/wiki]$ ./decorator.py&lt;br /&gt;
 About to call func&lt;br /&gt;
 In func_to_decorate&lt;br /&gt;
 Back from calling func&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Command Pattern===&lt;br /&gt;
The [https://en.wikipedia.org/wiki/Command_pattern Command Pattern] can be implemented using proc objects, which are the closure of an object.&lt;br /&gt;
&lt;br /&gt;
In the Command Pattern, commands for objects to be implemented are queued and can be executed at any time. Arguments are considered passed when the method is called.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 count = 0&lt;br /&gt;
 &lt;br /&gt;
 commands = []&lt;br /&gt;
 (1..10).each do |i|&lt;br /&gt;
   commands &amp;lt;&amp;lt; proc { count +=i }&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 puts &amp;quot;Count is initially #{count}&amp;quot;&lt;br /&gt;
 commands.each { |cmd| cmd.call }&lt;br /&gt;
 puts &amp;quot;Performed all commands. count is #{count}&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Strategy Pattern===&lt;br /&gt;
The [http://www.codeproject.com/Articles/52807/Design-Patterns-Part-1-The-Strategy-Pattern Strategy Pattern] allows an algorithms behavior to be determined at runtime. It describes the definition of a family of interchangeable algorithm classes whose functionality is different for identically named methods. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 class Fighter&lt;br /&gt;
  def initialize(&amp;amp;fighting_behavior)&lt;br /&gt;
    @finish_move = fighting_behavior&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
  def finish_opponent&lt;br /&gt;
    @finish_move.call&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
  &lt;br /&gt;
 boxer = Fighter.new { puts 'Left hook to the body!' }&lt;br /&gt;
 boxer.finish_opponent #=&amp;gt; Left hook to the body!&lt;br /&gt;
  &lt;br /&gt;
 mortal_kombat_warrior = Fighter.new { puts 'Blast him with a lighting bolt' }&lt;br /&gt;
 mortal_kombat_warrior.finish_opponent #=&amp;gt; Blast him with a lighting bolt&lt;br /&gt;
  &lt;br /&gt;
 mma = Fighter.new { puts 'Put you to sleep, Good Night!' }&lt;br /&gt;
 mma.finish_opponent #=&amp;gt; Put you to sleep, Good Night!&lt;br /&gt;
  &lt;br /&gt;
 lion = Fighter.new { puts 'Bites your head off' }&lt;br /&gt;
 lion.finish_opponent #=&amp;gt; Bites your head off!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Function Factory ===&lt;br /&gt;
&lt;br /&gt;
A version of the classic [http://python-3-patterns-idioms-test.readthedocs.org/en/latest/Factory.html Factory Pattern], but for use with functions, can be implemented easily with the help of closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def status():&lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;Returns the status of the system. Just a stub, for demo.&lt;br /&gt;
 &lt;br /&gt;
     :returns: Always returns True. Just a demo.&lt;br /&gt;
 &lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
     return True&lt;br /&gt;
 &lt;br /&gt;
 def messenger_factory(messenger_type):&lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;Builds very lightweight messenger functions.&lt;br /&gt;
 &lt;br /&gt;
     :param messenger_type: Currently supported types are human and wire.&lt;br /&gt;
     :type messenger_type: string&lt;br /&gt;
     :returns: Function that creates messages of the required format.&lt;br /&gt;
 &lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
     version = &amp;quot;Version 1.0&amp;quot;&lt;br /&gt;
     dynamic_status = status&lt;br /&gt;
     if messenger_type == &amp;quot;human&amp;quot;:&lt;br /&gt;
         def human_messenger():&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;Messenger with a format that is human-readable.&lt;br /&gt;
 &lt;br /&gt;
             :returns: Human-readable string of status and version.&lt;br /&gt;
 &lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             return &amp;quot;Status is {}. Version is {}&amp;quot;.format(dynamic_status(), version)&lt;br /&gt;
         return human_messenger&lt;br /&gt;
     elif messenger_type == &amp;quot;wire&amp;quot;:&lt;br /&gt;
         def wire_messenger():&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;Messenger with format that is ready to be put on the wire.&lt;br /&gt;
 &lt;br /&gt;
             :returns: JSON (dict) message with status and version.&lt;br /&gt;
 &lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             return {&amp;quot;version&amp;quot;: version, &amp;quot;status&amp;quot;: dynamic_status()}&lt;br /&gt;
         return wire_messenger&lt;br /&gt;
     else:&lt;br /&gt;
         raise ValueError(&amp;quot;Unexpected messenger type: {}&amp;quot;.format(messenger_type))&lt;br /&gt;
 &lt;br /&gt;
 human_messenger = messenger_factory(&amp;quot;human&amp;quot;)&lt;br /&gt;
 wire_messenger = messenger_factory(&amp;quot;wire&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Human: {}&amp;quot;.format(human_messenger())&lt;br /&gt;
 print &amp;quot;Wire: {}&amp;quot;.format(wire_messenger())&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [~517/wiki]$ chmod ug+x func_factory.py&lt;br /&gt;
 [~517/wiki]$ ./func_factory.py&lt;br /&gt;
 Human: Status is True. Version is Version 1.0&lt;br /&gt;
 Wire: {'status': True, 'version': 'Version 1.0'}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83609</id>
		<title>CSC/ECE 517 Spring 2014/ch1 1w1l m</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83609"/>
		<updated>2014-02-24T04:11:03Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: /* Command Pattern */ Link to description of CMD Pattern&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Design Patterns Involving Closures =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== Explanation of Closures ===&lt;br /&gt;
&lt;br /&gt;
====Blocks in Ruby====&lt;br /&gt;
A block is a segment of code that can be used as an argument for a method. These segments of code may have their own initialized variables only able to be referenced locally in the block, much like in a method. Single line blocks are commonly encapsulated in curly braces after a method call, and multi-line blocks are between &amp;quot;do&amp;quot; and &amp;quot;end&amp;quot; statements. A block's code is not executed when it is encountered, but rather after all instances of the yield statement within the method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 =begin  &lt;br /&gt;
  Ruby Code blocks are chunks of code between braces or  &lt;br /&gt;
  between do- end that you can associate with method invocations  &lt;br /&gt;
 =end  &lt;br /&gt;
 def call_block  &lt;br /&gt;
  puts 'Start of method'  &lt;br /&gt;
  # you can call the block using the yield keyword  &lt;br /&gt;
  yield  &lt;br /&gt;
  yield  &lt;br /&gt;
  puts 'End of method'  &lt;br /&gt;
 end  &lt;br /&gt;
 # Code blocks may appear only in the source adjacent to a method call  &lt;br /&gt;
 call_block {puts 'In the block'}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The above code outputs the following:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;gt;ruby p022codeblock.rb  &lt;br /&gt;
    Start of method  &lt;br /&gt;
    In the block  &lt;br /&gt;
    In the block  &lt;br /&gt;
    End of method  &lt;br /&gt;
    &amp;gt;Exit code: 0  &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====So what's a closure?====&lt;br /&gt;
Very simply, a closure is a function that can use a variable that was valid within the scope that the closure was defined, but need not be in-scope where the closure is called. A quick example is very illustrative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 def closure_builder(message=&amp;quot;Default&amp;quot;):&lt;br /&gt;
     def closure():&lt;br /&gt;
         # Message is in-scope here&lt;br /&gt;
         print message&lt;br /&gt;
     return closure&lt;br /&gt;
 &lt;br /&gt;
 # Build two functions&lt;br /&gt;
 default_closure = closure_builder()&lt;br /&gt;
 custom_closure = closure_builder(&amp;quot;Custom&amp;quot;)&lt;br /&gt;
 del closure_builder&lt;br /&gt;
 &lt;br /&gt;
 # Call the closures you built&lt;br /&gt;
 default_closure()  # Amazingly, prints &amp;quot;Default&amp;quot;&lt;br /&gt;
 custom_closure()  # Amazingly, prints &amp;quot;Custom&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Decorators ===&lt;br /&gt;
&lt;br /&gt;
Decorators are an interesting and powerful language feature that can be implemented elegantly with closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def decorate(func):&lt;br /&gt;
     def decorated_func():&lt;br /&gt;
         print &amp;quot;About to call func&amp;quot;&lt;br /&gt;
         func()&lt;br /&gt;
         print &amp;quot;Back from calling func&amp;quot;&lt;br /&gt;
     return decorated_func&lt;br /&gt;
 &lt;br /&gt;
 @decorate&lt;br /&gt;
 def func_to_decorate():&lt;br /&gt;
     print &amp;quot;In func_to_decorate&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 func_to_decorate()&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [~517/wiki]$ chmod ug+x decorator.py&lt;br /&gt;
 [~517/wiki]$ ./decorator.py&lt;br /&gt;
 About to call func&lt;br /&gt;
 In func_to_decorate&lt;br /&gt;
 Back from calling func&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Command Pattern===&lt;br /&gt;
The [https://en.wikipedia.org/wiki/Command_pattern Command Pattern] can be implemented using proc objects, which are the closure of an object.&lt;br /&gt;
&lt;br /&gt;
In the Command Pattern, commands for objects to be implemented are queued and can be executed at any time. Arguments are considered passed when the method is called.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 count = 0&lt;br /&gt;
 &lt;br /&gt;
 commands = []&lt;br /&gt;
 (1..10).each do |i|&lt;br /&gt;
   commands &amp;lt;&amp;lt; proc { count +=i }&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 puts &amp;quot;Count is initially #{count}&amp;quot;&lt;br /&gt;
 commands.each { |cmd| cmd.call }&lt;br /&gt;
 puts &amp;quot;Performed all commands. count is #{count}&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Strategy Pattern===&lt;br /&gt;
The Strategy Pattern allows an algorithms behavior to be determined at runtime. It describes the definition of a family of interchangeable algorithm classes whose functionality is different for identically named methods. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 class Fighter&lt;br /&gt;
  def initialize(&amp;amp;fighting_behavior)&lt;br /&gt;
    @finish_move = fighting_behavior&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
  def finish_opponent&lt;br /&gt;
    @finish_move.call&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
  &lt;br /&gt;
 boxer = Fighter.new { puts 'Left hook to the body!' }&lt;br /&gt;
 boxer.finish_opponent #=&amp;gt; Left hook to the body!&lt;br /&gt;
  &lt;br /&gt;
 mortal_kombat_warrior = Fighter.new { puts 'Blast him with a lighting bolt' }&lt;br /&gt;
 mortal_kombat_warrior.finish_opponent #=&amp;gt; Blast him with a lighting bolt&lt;br /&gt;
  &lt;br /&gt;
 mma = Fighter.new { puts 'Put you to sleep, Good Night!' }&lt;br /&gt;
 mma.finish_opponent #=&amp;gt; Put you to sleep, Good Night!&lt;br /&gt;
  &lt;br /&gt;
 lion = Fighter.new { puts 'Bites your head off' }&lt;br /&gt;
 lion.finish_opponent #=&amp;gt; Bites your head off!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Function Factory ===&lt;br /&gt;
&lt;br /&gt;
A version of the classic [http://python-3-patterns-idioms-test.readthedocs.org/en/latest/Factory.html Factory Pattern], but for use with functions, can be implemented easily with the help of closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def status():&lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;Returns the status of the system. Just a stub, for demo.&lt;br /&gt;
 &lt;br /&gt;
     :returns: Always returns True. Just a demo.&lt;br /&gt;
 &lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
     return True&lt;br /&gt;
 &lt;br /&gt;
 def messenger_factory(messenger_type):&lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;Builds very lightweight messenger functions.&lt;br /&gt;
 &lt;br /&gt;
     :param messenger_type: Currently supported types are human and wire.&lt;br /&gt;
     :type messenger_type: string&lt;br /&gt;
     :returns: Function that creates messages of the required format.&lt;br /&gt;
 &lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
     version = &amp;quot;Version 1.0&amp;quot;&lt;br /&gt;
     dynamic_status = status&lt;br /&gt;
     if messenger_type == &amp;quot;human&amp;quot;:&lt;br /&gt;
         def human_messenger():&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;Messenger with a format that is human-readable.&lt;br /&gt;
 &lt;br /&gt;
             :returns: Human-readable string of status and version.&lt;br /&gt;
 &lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             return &amp;quot;Status is {}. Version is {}&amp;quot;.format(dynamic_status(), version)&lt;br /&gt;
         return human_messenger&lt;br /&gt;
     elif messenger_type == &amp;quot;wire&amp;quot;:&lt;br /&gt;
         def wire_messenger():&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;Messenger with format that is ready to be put on the wire.&lt;br /&gt;
 &lt;br /&gt;
             :returns: JSON (dict) message with status and version.&lt;br /&gt;
 &lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             return {&amp;quot;version&amp;quot;: version, &amp;quot;status&amp;quot;: dynamic_status()}&lt;br /&gt;
         return wire_messenger&lt;br /&gt;
     else:&lt;br /&gt;
         raise ValueError(&amp;quot;Unexpected messenger type: {}&amp;quot;.format(messenger_type))&lt;br /&gt;
 &lt;br /&gt;
 human_messenger = messenger_factory(&amp;quot;human&amp;quot;)&lt;br /&gt;
 wire_messenger = messenger_factory(&amp;quot;wire&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Human: {}&amp;quot;.format(human_messenger())&lt;br /&gt;
 print &amp;quot;Wire: {}&amp;quot;.format(wire_messenger())&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [~517/wiki]$ chmod ug+x func_factory.py&lt;br /&gt;
 [~517/wiki]$ ./func_factory.py&lt;br /&gt;
 Human: Status is True. Version is Version 1.0&lt;br /&gt;
 Wire: {'status': True, 'version': 'Version 1.0'}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83606</id>
		<title>CSC/ECE 517 Spring 2014/ch1 1w1l m</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83606"/>
		<updated>2014-02-24T04:01:56Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: /* Function Factory */ Added link to Factory Pattern example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Design Patterns Involving Closures =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== Explanation of Closures ===&lt;br /&gt;
&lt;br /&gt;
====Blocks in Ruby====&lt;br /&gt;
A block is a segment of code that can be used as an argument for a method. These segments of code may have their own initialized variables only able to be referenced locally in the block, much like in a method. Single line blocks are commonly encapsulated in curly braces after a method call, and multi-line blocks are between &amp;quot;do&amp;quot; and &amp;quot;end&amp;quot; statements. A block's code is not executed when it is encountered, but rather after all instances of the yield statement within the method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 =begin  &lt;br /&gt;
  Ruby Code blocks are chunks of code between braces or  &lt;br /&gt;
  between do- end that you can associate with method invocations  &lt;br /&gt;
 =end  &lt;br /&gt;
 def call_block  &lt;br /&gt;
  puts 'Start of method'  &lt;br /&gt;
  # you can call the block using the yield keyword  &lt;br /&gt;
  yield  &lt;br /&gt;
  yield  &lt;br /&gt;
  puts 'End of method'  &lt;br /&gt;
 end  &lt;br /&gt;
 # Code blocks may appear only in the source adjacent to a method call  &lt;br /&gt;
 call_block {puts 'In the block'}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The above code outputs the following:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;gt;ruby p022codeblock.rb  &lt;br /&gt;
    Start of method  &lt;br /&gt;
    In the block  &lt;br /&gt;
    In the block  &lt;br /&gt;
    End of method  &lt;br /&gt;
    &amp;gt;Exit code: 0  &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====So what's a closure?====&lt;br /&gt;
Very simply, a closure is a function that can use a variable that was valid within the scope that the closure was defined, but need not be in-scope where the closure is called. A quick example is very illustrative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 def closure_builder(message=&amp;quot;Default&amp;quot;):&lt;br /&gt;
     def closure():&lt;br /&gt;
         # Message is in-scope here&lt;br /&gt;
         print message&lt;br /&gt;
     return closure&lt;br /&gt;
 &lt;br /&gt;
 # Build two functions&lt;br /&gt;
 default_closure = closure_builder()&lt;br /&gt;
 custom_closure = closure_builder(&amp;quot;Custom&amp;quot;)&lt;br /&gt;
 del closure_builder&lt;br /&gt;
 &lt;br /&gt;
 # Call the closures you built&lt;br /&gt;
 default_closure()  # Amazingly, prints &amp;quot;Default&amp;quot;&lt;br /&gt;
 custom_closure()  # Amazingly, prints &amp;quot;Custom&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Decorators ===&lt;br /&gt;
&lt;br /&gt;
Decorators are an interesting and powerful language feature that can be implemented elegantly with closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def decorate(func):&lt;br /&gt;
     def decorated_func():&lt;br /&gt;
         print &amp;quot;About to call func&amp;quot;&lt;br /&gt;
         func()&lt;br /&gt;
         print &amp;quot;Back from calling func&amp;quot;&lt;br /&gt;
     return decorated_func&lt;br /&gt;
 &lt;br /&gt;
 @decorate&lt;br /&gt;
 def func_to_decorate():&lt;br /&gt;
     print &amp;quot;In func_to_decorate&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 func_to_decorate()&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [~517/wiki]$ chmod ug+x decorator.py&lt;br /&gt;
 [~517/wiki]$ ./decorator.py&lt;br /&gt;
 About to call func&lt;br /&gt;
 In func_to_decorate&lt;br /&gt;
 Back from calling func&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Command Pattern===&lt;br /&gt;
The command Pattern can be implemented using proc objects, which are the closure of an object&lt;br /&gt;
&lt;br /&gt;
In the command pattern, commands for objects to be implemented are queued and can be executed at any time. Arguments are considered passed when the method is called.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 count = 0&lt;br /&gt;
 &lt;br /&gt;
 commands = []&lt;br /&gt;
 (1..10).each do |i|&lt;br /&gt;
   commands &amp;lt;&amp;lt; proc { count +=i }&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 puts &amp;quot;Count is initially #{count}&amp;quot;&lt;br /&gt;
 commands.each { |cmd| cmd.call }&lt;br /&gt;
 puts &amp;quot;Performed all commands. count is #{count}&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Strategy Pattern===&lt;br /&gt;
The Strategy Pattern allows an algorithms behavior to be determined at runtime. It describes the definition of a family of interchangeable algorithm classes whose functionality is different for identically named methods. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 class Fighter&lt;br /&gt;
  def initialize(&amp;amp;fighting_behavior)&lt;br /&gt;
    @finish_move = fighting_behavior&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
  def finish_opponent&lt;br /&gt;
    @finish_move.call&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
  &lt;br /&gt;
 boxer = Fighter.new { puts 'Left hook to the body!' }&lt;br /&gt;
 boxer.finish_opponent #=&amp;gt; Left hook to the body!&lt;br /&gt;
  &lt;br /&gt;
 mortal_kombat_warrior = Fighter.new { puts 'Blast him with a lighting bolt' }&lt;br /&gt;
 mortal_kombat_warrior.finish_opponent #=&amp;gt; Blast him with a lighting bolt&lt;br /&gt;
  &lt;br /&gt;
 mma = Fighter.new { puts 'Put you to sleep, Good Night!' }&lt;br /&gt;
 mma.finish_opponent #=&amp;gt; Put you to sleep, Good Night!&lt;br /&gt;
  &lt;br /&gt;
 lion = Fighter.new { puts 'Bites your head off' }&lt;br /&gt;
 lion.finish_opponent #=&amp;gt; Bites your head off!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Function Factory ===&lt;br /&gt;
&lt;br /&gt;
A version of the classic [http://python-3-patterns-idioms-test.readthedocs.org/en/latest/Factory.html Factory Pattern], but for use with functions, can be implemented easily with the help of closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def status():&lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;Returns the status of the system. Just a stub, for demo.&lt;br /&gt;
 &lt;br /&gt;
     :returns: Always returns True. Just a demo.&lt;br /&gt;
 &lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
     return True&lt;br /&gt;
 &lt;br /&gt;
 def messenger_factory(messenger_type):&lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;Builds very lightweight messenger functions.&lt;br /&gt;
 &lt;br /&gt;
     :param messenger_type: Currently supported types are human and wire.&lt;br /&gt;
     :type messenger_type: string&lt;br /&gt;
     :returns: Function that creates messages of the required format.&lt;br /&gt;
 &lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
     version = &amp;quot;Version 1.0&amp;quot;&lt;br /&gt;
     dynamic_status = status&lt;br /&gt;
     if messenger_type == &amp;quot;human&amp;quot;:&lt;br /&gt;
         def human_messenger():&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;Messenger with a format that is human-readable.&lt;br /&gt;
 &lt;br /&gt;
             :returns: Human-readable string of status and version.&lt;br /&gt;
 &lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             return &amp;quot;Status is {}. Version is {}&amp;quot;.format(dynamic_status(), version)&lt;br /&gt;
         return human_messenger&lt;br /&gt;
     elif messenger_type == &amp;quot;wire&amp;quot;:&lt;br /&gt;
         def wire_messenger():&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;Messenger with format that is ready to be put on the wire.&lt;br /&gt;
 &lt;br /&gt;
             :returns: JSON (dict) message with status and version.&lt;br /&gt;
 &lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             return {&amp;quot;version&amp;quot;: version, &amp;quot;status&amp;quot;: dynamic_status()}&lt;br /&gt;
         return wire_messenger&lt;br /&gt;
     else:&lt;br /&gt;
         raise ValueError(&amp;quot;Unexpected messenger type: {}&amp;quot;.format(messenger_type))&lt;br /&gt;
 &lt;br /&gt;
 human_messenger = messenger_factory(&amp;quot;human&amp;quot;)&lt;br /&gt;
 wire_messenger = messenger_factory(&amp;quot;wire&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Human: {}&amp;quot;.format(human_messenger())&lt;br /&gt;
 print &amp;quot;Wire: {}&amp;quot;.format(wire_messenger())&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [~517/wiki]$ chmod ug+x func_factory.py&lt;br /&gt;
 [~517/wiki]$ ./func_factory.py&lt;br /&gt;
 Human: Status is True. Version is Version 1.0&lt;br /&gt;
 Wire: {'status': True, 'version': 'Version 1.0'}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83605</id>
		<title>CSC/ECE 517 Spring 2014/ch1 1w1l m</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83605"/>
		<updated>2014-02-24T03:59:37Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: Added example of a Factory Pattern for functions using closures&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Design Patterns Involving Closures =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== Explanation of Closures ===&lt;br /&gt;
&lt;br /&gt;
====Blocks in Ruby====&lt;br /&gt;
A block is a segment of code that can be used as an argument for a method. These segments of code may have their own initialized variables only able to be referenced locally in the block, much like in a method. Single line blocks are commonly encapsulated in curly braces after a method call, and multi-line blocks are between &amp;quot;do&amp;quot; and &amp;quot;end&amp;quot; statements. A block's code is not executed when it is encountered, but rather after all instances of the yield statement within the method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 =begin  &lt;br /&gt;
  Ruby Code blocks are chunks of code between braces or  &lt;br /&gt;
  between do- end that you can associate with method invocations  &lt;br /&gt;
 =end  &lt;br /&gt;
 def call_block  &lt;br /&gt;
  puts 'Start of method'  &lt;br /&gt;
  # you can call the block using the yield keyword  &lt;br /&gt;
  yield  &lt;br /&gt;
  yield  &lt;br /&gt;
  puts 'End of method'  &lt;br /&gt;
 end  &lt;br /&gt;
 # Code blocks may appear only in the source adjacent to a method call  &lt;br /&gt;
 call_block {puts 'In the block'}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The above code outputs the following:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;gt;ruby p022codeblock.rb  &lt;br /&gt;
    Start of method  &lt;br /&gt;
    In the block  &lt;br /&gt;
    In the block  &lt;br /&gt;
    End of method  &lt;br /&gt;
    &amp;gt;Exit code: 0  &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====So what's a closure?====&lt;br /&gt;
Very simply, a closure is a function that can use a variable that was valid within the scope that the closure was defined, but need not be in-scope where the closure is called. A quick example is very illustrative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 def closure_builder(message=&amp;quot;Default&amp;quot;):&lt;br /&gt;
     def closure():&lt;br /&gt;
         # Message is in-scope here&lt;br /&gt;
         print message&lt;br /&gt;
     return closure&lt;br /&gt;
 &lt;br /&gt;
 # Build two functions&lt;br /&gt;
 default_closure = closure_builder()&lt;br /&gt;
 custom_closure = closure_builder(&amp;quot;Custom&amp;quot;)&lt;br /&gt;
 del closure_builder&lt;br /&gt;
 &lt;br /&gt;
 # Call the closures you built&lt;br /&gt;
 default_closure()  # Amazingly, prints &amp;quot;Default&amp;quot;&lt;br /&gt;
 custom_closure()  # Amazingly, prints &amp;quot;Custom&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Decorators ===&lt;br /&gt;
&lt;br /&gt;
Decorators are an interesting and powerful language feature that can be implemented elegantly with closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def decorate(func):&lt;br /&gt;
     def decorated_func():&lt;br /&gt;
         print &amp;quot;About to call func&amp;quot;&lt;br /&gt;
         func()&lt;br /&gt;
         print &amp;quot;Back from calling func&amp;quot;&lt;br /&gt;
     return decorated_func&lt;br /&gt;
 &lt;br /&gt;
 @decorate&lt;br /&gt;
 def func_to_decorate():&lt;br /&gt;
     print &amp;quot;In func_to_decorate&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 func_to_decorate()&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [~517/wiki]$ chmod ug+x decorator.py&lt;br /&gt;
 [~517/wiki]$ ./decorator.py&lt;br /&gt;
 About to call func&lt;br /&gt;
 In func_to_decorate&lt;br /&gt;
 Back from calling func&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Command Pattern===&lt;br /&gt;
The command Pattern can be implemented using proc objects, which are the closure of an object&lt;br /&gt;
&lt;br /&gt;
In the command pattern, commands for objects to be implemented are queued and can be executed at any time. Arguments are considered passed when the method is called.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 count = 0&lt;br /&gt;
 &lt;br /&gt;
 commands = []&lt;br /&gt;
 (1..10).each do |i|&lt;br /&gt;
   commands &amp;lt;&amp;lt; proc { count +=i }&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 puts &amp;quot;Count is initially #{count}&amp;quot;&lt;br /&gt;
 commands.each { |cmd| cmd.call }&lt;br /&gt;
 puts &amp;quot;Performed all commands. count is #{count}&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Strategy Pattern===&lt;br /&gt;
The Strategy Pattern allows an algorithms behavior to be determined at runtime. It describes the definition of a family of interchangeable algorithm classes whose functionality is different for identically named methods. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 class Fighter&lt;br /&gt;
  def initialize(&amp;amp;fighting_behavior)&lt;br /&gt;
    @finish_move = fighting_behavior&lt;br /&gt;
  end&lt;br /&gt;
 &lt;br /&gt;
  def finish_opponent&lt;br /&gt;
    @finish_move.call&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
  &lt;br /&gt;
 boxer = Fighter.new { puts 'Left hook to the body!' }&lt;br /&gt;
 boxer.finish_opponent #=&amp;gt; Left hook to the body!&lt;br /&gt;
  &lt;br /&gt;
 mortal_kombat_warrior = Fighter.new { puts 'Blast him with a lighting bolt' }&lt;br /&gt;
 mortal_kombat_warrior.finish_opponent #=&amp;gt; Blast him with a lighting bolt&lt;br /&gt;
  &lt;br /&gt;
 mma = Fighter.new { puts 'Put you to sleep, Good Night!' }&lt;br /&gt;
 mma.finish_opponent #=&amp;gt; Put you to sleep, Good Night!&lt;br /&gt;
  &lt;br /&gt;
 lion = Fighter.new { puts 'Bites your head off' }&lt;br /&gt;
 lion.finish_opponent #=&amp;gt; Bites your head off!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Function Factory ===&lt;br /&gt;
&lt;br /&gt;
A version of the classic Factory Pattern, but for use with functions, can be implemented easily with the help of closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def status():&lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;Returns the status of the system. Just a stub, for demo.&lt;br /&gt;
 &lt;br /&gt;
     :returns: Always returns True. Just a demo.&lt;br /&gt;
 &lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
     return True&lt;br /&gt;
 &lt;br /&gt;
 def messenger_factory(messenger_type):&lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;Builds very lightweight messenger functions.&lt;br /&gt;
 &lt;br /&gt;
     :param messenger_type: Currently supported types are human and wire.&lt;br /&gt;
     :type messenger_type: string&lt;br /&gt;
     :returns: Function that creates messages of the required format.&lt;br /&gt;
 &lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
     version = &amp;quot;Version 1.0&amp;quot;&lt;br /&gt;
     dynamic_status = status&lt;br /&gt;
     if messenger_type == &amp;quot;human&amp;quot;:&lt;br /&gt;
         def human_messenger():&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;Messenger with a format that is human-readable.&lt;br /&gt;
 &lt;br /&gt;
             :returns: Human-readable string of status and version.&lt;br /&gt;
 &lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             return &amp;quot;Status is {}. Version is {}&amp;quot;.format(dynamic_status(), version)&lt;br /&gt;
         return human_messenger&lt;br /&gt;
     elif messenger_type == &amp;quot;wire&amp;quot;:&lt;br /&gt;
         def wire_messenger():&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;Messenger with format that is ready to be put on the wire.&lt;br /&gt;
 &lt;br /&gt;
             :returns: JSON (dict) message with status and version.&lt;br /&gt;
 &lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             return {&amp;quot;version&amp;quot;: version, &amp;quot;status&amp;quot;: dynamic_status()}&lt;br /&gt;
         return wire_messenger&lt;br /&gt;
     else:&lt;br /&gt;
         raise ValueError(&amp;quot;Unexpected messenger type: {}&amp;quot;.format(messenger_type))&lt;br /&gt;
 &lt;br /&gt;
 human_messenger = messenger_factory(&amp;quot;human&amp;quot;)&lt;br /&gt;
 wire_messenger = messenger_factory(&amp;quot;wire&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 print &amp;quot;Human: {}&amp;quot;.format(human_messenger())&lt;br /&gt;
 print &amp;quot;Wire: {}&amp;quot;.format(wire_messenger())&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [~517/wiki]$ chmod ug+x func_factory.py&lt;br /&gt;
 [~517/wiki]$ ./func_factory.py&lt;br /&gt;
 Human: Status is True. Version is Version 1.0&lt;br /&gt;
 Wire: {'status': True, 'version': 'Version 1.0'}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83584</id>
		<title>CSC/ECE 517 Spring 2014/ch1 1w1l m</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83584"/>
		<updated>2014-02-23T07:28:49Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: Removed some section headers that I don't think should be developed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Design Patterns Involving Closures =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== Explanation of Closures ===&lt;br /&gt;
&lt;br /&gt;
Very simply, a closure is a function that can use a variable that was valid within the scope that the closure was defined, but need not be in-scope where the closure is called. A quick example is very illustrative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 def closure_builder(message=&amp;quot;Default&amp;quot;):&lt;br /&gt;
     def closure():&lt;br /&gt;
         # Message is in-scope here&lt;br /&gt;
         print message&lt;br /&gt;
     return closure&lt;br /&gt;
 &lt;br /&gt;
 # Build two functions&lt;br /&gt;
 default_closure = closure_builder()&lt;br /&gt;
 custom_closure = closure_builder(&amp;quot;Custom&amp;quot;)&lt;br /&gt;
 del closure_builder&lt;br /&gt;
 &lt;br /&gt;
 # Call the closures you built&lt;br /&gt;
 default_closure()  # Amazingly, prints &amp;quot;Default&amp;quot;&lt;br /&gt;
 custom_closure()  # Amazingly, prints &amp;quot;Custom&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Decorators ===&lt;br /&gt;
&lt;br /&gt;
Decorators are an interesting and powerful language feature that can be implemented elegantly with closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def decorate(func):&lt;br /&gt;
     def decorated_func():&lt;br /&gt;
         print &amp;quot;About to call func&amp;quot;&lt;br /&gt;
         func()&lt;br /&gt;
         print &amp;quot;Back from calling func&amp;quot;&lt;br /&gt;
     return decorated_func&lt;br /&gt;
 &lt;br /&gt;
 @decorate&lt;br /&gt;
 def func_to_decorate():&lt;br /&gt;
     print &amp;quot;In func_to_decorate&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 func_to_decorate()&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [~517/wiki]$ chmod ug+x decorator.py&lt;br /&gt;
 [~517/wiki]$ ./decorator.py&lt;br /&gt;
 About to call func&lt;br /&gt;
 In func_to_decorate&lt;br /&gt;
 Back from calling func&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83583</id>
		<title>CSC/ECE 517 Spring 2014/ch1 1w1l m</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83583"/>
		<updated>2014-02-23T07:27:22Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: Added a design pattern example - decorators&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Design Patterns Involving Closures =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== Explanation of Closures ===&lt;br /&gt;
&lt;br /&gt;
Very simply, a closure is a function that can use a variable that was valid within the scope that the closure was defined, but need not be in-scope where the closure is called. A quick example is very illustrative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 def closure_builder(message=&amp;quot;Default&amp;quot;):&lt;br /&gt;
     def closure():&lt;br /&gt;
         # Message is in-scope here&lt;br /&gt;
         print message&lt;br /&gt;
     return closure&lt;br /&gt;
 &lt;br /&gt;
 # Build two functions&lt;br /&gt;
 default_closure = closure_builder()&lt;br /&gt;
 custom_closure = closure_builder(&amp;quot;Custom&amp;quot;)&lt;br /&gt;
 del closure_builder&lt;br /&gt;
 &lt;br /&gt;
 # Call the closures you built&lt;br /&gt;
 default_closure()  # Amazingly, prints &amp;quot;Default&amp;quot;&lt;br /&gt;
 custom_closure()  # Amazingly, prints &amp;quot;Custom&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Decorators ===&lt;br /&gt;
&lt;br /&gt;
Decorators are an interesting and powerful language feature that can be implemented elegantly with closures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def decorate(func):&lt;br /&gt;
     def decorated_func():&lt;br /&gt;
         print &amp;quot;About to call func&amp;quot;&lt;br /&gt;
         func()&lt;br /&gt;
         print &amp;quot;Back from calling func&amp;quot;&lt;br /&gt;
     return decorated_func&lt;br /&gt;
 &lt;br /&gt;
 @decorate&lt;br /&gt;
 def func_to_decorate():&lt;br /&gt;
     print &amp;quot;In func_to_decorate&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 func_to_decorate()&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 [~517/wiki]$ chmod ug+x decorator.py&lt;br /&gt;
 [~517/wiki]$ ./decorator.py&lt;br /&gt;
 About to call func&lt;br /&gt;
 In func_to_decorate&lt;br /&gt;
 Back from calling func&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Narration ==&lt;br /&gt;
&lt;br /&gt;
== Links to Important Terms ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83582</id>
		<title>CSC/ECE 517 Spring 2014/ch1 1w1l m</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83582"/>
		<updated>2014-02-23T07:12:57Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: /* What is a closure? */ A bit more trimming of closure example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Design Patterns Involving Closures =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== What is a closure? ===&lt;br /&gt;
&lt;br /&gt;
Very simply, a closure is a function that can use a variable that was valid within the scope that the closure was defined, but need not be in-scope where the closure is called. A quick example is very illustrative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 def closure_builder(message=&amp;quot;Default&amp;quot;):&lt;br /&gt;
     def closure():&lt;br /&gt;
         # Message is in-scope here&lt;br /&gt;
         print message&lt;br /&gt;
     return closure&lt;br /&gt;
 &lt;br /&gt;
 # Build two functions&lt;br /&gt;
 default_closure = closure_builder()&lt;br /&gt;
 custom_closure = closure_builder(&amp;quot;Custom&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 # Call the closures you built&lt;br /&gt;
 default_closure()  # Amazingly, prints &amp;quot;Default&amp;quot;&lt;br /&gt;
 custom_closure()  # Amazingly, prints &amp;quot;Custom&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
== Narration ==&lt;br /&gt;
&lt;br /&gt;
== Links to Important Terms ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83581</id>
		<title>CSC/ECE 517 Spring 2014/ch1 1w1l m</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83581"/>
		<updated>2014-02-23T07:12:23Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: /* What is a closure? */ Tried to shorten closure example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Design Patterns Involving Closures =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== What is a closure? ===&lt;br /&gt;
&lt;br /&gt;
Very simply, a closure is a function that can use a variable that was valid within the scope that the closure was defined, but need not be in-scope where the closure is called. A quick example is very illustrative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 def closure_builder(message=&amp;quot;Default&amp;quot;):&lt;br /&gt;
     def closure():&lt;br /&gt;
         # Message is in-scope here&lt;br /&gt;
         print message&lt;br /&gt;
     return closure&lt;br /&gt;
 &lt;br /&gt;
 # Build two functions&lt;br /&gt;
 default_closure = closure_builder()&lt;br /&gt;
 custom_closure = closure_builder(&amp;quot;Custom&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 # Call the closures you built&lt;br /&gt;
 default_closure()  # Amazingly, prints &amp;quot;Default&amp;quot;&lt;br /&gt;
 custom_closure()  # Amazingly, prints &amp;quot;Custom&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
== Narration ==&lt;br /&gt;
&lt;br /&gt;
== Links to Important Terms ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83580</id>
		<title>CSC/ECE 517 Spring 2014/ch1 1w1l m</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83580"/>
		<updated>2014-02-23T07:11:03Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: Somewhat better closure example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Design Patterns Involving Closures =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== What is a closure? ===&lt;br /&gt;
&lt;br /&gt;
Very simply, a closure is a function that can use a variable that was valid within the scope that the closure was defined, but need not be in-scope where the closure is called. A quick example is very illustrative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/usr/bin/env python&lt;br /&gt;
 &lt;br /&gt;
 # Define a function that makes use of closures&lt;br /&gt;
 def closure_builder(message=&amp;quot;Default&amp;quot;):&lt;br /&gt;
     def closure():&lt;br /&gt;
         # Message is in-scope here&lt;br /&gt;
         print message&lt;br /&gt;
     return closure&lt;br /&gt;
 &lt;br /&gt;
 # Build two functions&lt;br /&gt;
 default_closure = closure_builder()&lt;br /&gt;
 custom_closure = closure_builder(&amp;quot;Custom&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 # In case you're not convinced&lt;br /&gt;
 del closure_builder&lt;br /&gt;
 &lt;br /&gt;
 # Call the closures you built&lt;br /&gt;
 default_closure()  # Amazingly, prints &amp;quot;Default&amp;quot;&lt;br /&gt;
 custom_closure()  # Amazingly, prints &amp;quot;Custom&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
== Narration ==&lt;br /&gt;
&lt;br /&gt;
== Links to Important Terms ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83579</id>
		<title>CSC/ECE 517 Spring 2014/ch1 1w1l m</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2014/ch1_1w1l_m&amp;diff=83579"/>
		<updated>2014-02-23T06:55:32Z</updated>

		<summary type="html">&lt;p&gt;Drfarrel: Added basic definition of a closure&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Design Patterns Involving Closures =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== What is a closure? ===&lt;br /&gt;
&lt;br /&gt;
Very simply, a closure is a function that can use a reference to a variable that was valid within the scope that the closure was defined, but need not be in-scope where the closure is called. A quick example is very illustrative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; def closure_builder():&lt;br /&gt;
 ...     message = &amp;quot;String, in-scope where closure is defined&amp;quot;&lt;br /&gt;
 ...     def closure(new_msg=None):&lt;br /&gt;
 ...         if new_msg is None:&lt;br /&gt;
 ...             print message&lt;br /&gt;
 ...         else:&lt;br /&gt;
 ...             print new_msg&lt;br /&gt;
 ...     return closure&lt;br /&gt;
 ... &lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; default_closure = closure_builder()&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; del closure_builder  # Without closures, the message var would be gone now&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; default_closure()  # But it's still here!&lt;br /&gt;
 String, in-scope where closure is defined&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; default_closure(&amp;quot;I can do this too, although it's bit obvious&amp;quot;)&lt;br /&gt;
 I can do this too, although it's bit obvious&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
== Narration ==&lt;br /&gt;
&lt;br /&gt;
== Links to Important Terms ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Drfarrel</name></author>
	</entry>
</feed>