<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://michael.tsikerdekis.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://michael.tsikerdekis.com/" rel="alternate" type="text/html" /><updated>2026-02-13T14:39:02-08:00</updated><id>https://michael.tsikerdekis.com/feed.xml</id><title type="html">Michaeͥl Tsikerdekis</title><subtitle>Cybersecurity &amp; Security Architecture Leader | Associate Professor | Public Sector SOC Oversight | IEEE Senior Member</subtitle><author><name>Michaeͥl Tsikerdekis</name><email>Michael.Tsikerdekis@wwu.edu</email></author><entry><title type="html">What is the probability of getting an academic job?</title><link href="https://michael.tsikerdekis.com/2017/04/16/academicjob/" rel="alternate" type="text/html" title="What is the probability of getting an academic job?" /><published>2017-04-16T00:00:00-07:00</published><updated>2017-04-16T00:00:00-07:00</updated><id>https://michael.tsikerdekis.com/2017/04/16/academicjob</id><content type="html" xml:base="https://michael.tsikerdekis.com/2017/04/16/academicjob/"><![CDATA[<p>
	It is an interesting thought experiment that can be dissected in several ways depending on how it is addressed.</p>

<p>
	So, I figured why not just create github.com Shiny R application that builds estimates depending on the input. The current formula is a crude estimation that assumes there in an N population of positions that become available based on an independent probabiltiy p and there is a competing number of w applicants which are chosen at random. <strong>For CS and CE jobs in US and Canada based on CRA's survey data is around 50%.</strong></p>

<p>
	The Shiny R application for playing around wtih the input can be found here:&nbsp;<a href="https://tsikerdekis.shinyapps.io/AcademicJobProbability/">https://tsikerdekis.shinyapps.io/AcademicJobProbability/</a></p>

<p>
	The source can be found:&nbsp;<a href="https://github.com/tsikerdekis/AcademicJobProbability">https://github.com/tsikerdekis/AcademicJobProbability</a> (<strong>Pull requests more than welcome</strong>)</p>

<p>
	&nbsp;</p>]]></content><author><name>Michael Tsikerdekis</name><email>Michael.Tsikerdekis@wwu.edu</email><uri>http://michael.tsikerdekis.com</uri></author><summary type="html"><![CDATA[It is an interesting thought experiment that can be dissected in several ways depending on how it is addressed.]]></summary></entry><entry><title type="html">Hiding your real IP from the Internet using a proxy and securing it through your firewall</title><link href="https://michael.tsikerdekis.com/2015/07/14/sockproxy/" rel="alternate" type="text/html" title="Hiding your real IP from the Internet using a proxy and securing it through your firewall" /><published>2015-07-14T00:00:00-07:00</published><updated>2015-07-14T00:00:00-07:00</updated><id>https://michael.tsikerdekis.com/2015/07/14/sockproxy</id><content type="html" xml:base="https://michael.tsikerdekis.com/2015/07/14/sockproxy/"><![CDATA[<p>
	This article is not about setting up a proxy on your browser, skype or torrents. This is easy! Just go on your application's options and setup your proxy. You should of course have access to a proxy server that ideally does not retain any log files. If they do, then if those log files can be accessed by someone then your traffic history would be available to them. So, you got your proxy server (paid or free) with no log files and you have its port and authentication (if any). You set everything up on your browser or torrent application and that's it, right? All your traffic parsed through the proxy, others see the proxy's IP address while you are hidden behind the proxy. Well, that is not always the case and the reason boils down to he programming of the application that you are using. This is a guide on how to put an additional layer of protection through applying firewall.<br />
	&nbsp;</p>

<h2>
	<a href="http://tsikerdekis.wuwcorp.com/HidingYourIpThroughProxyAndFirewall#hn_Proxies">Proxies</a></h2>

<p>
	<br />
	Before I go into more details, I need to clarify the obvious. Proxies (such as SOCKS5) do not encrypt traffic from your ISP. If you were to look at the packets transmitted from your computer on the way to the proxy server, you could see what is the final destination of the packet. After packets leave the proxy server then your IP cannot be discovered unless it is in the information of the actual packet sent to the server and it is not encrypted. Notice I am using the term packet loosely here. So if you don't want a website, a torrent swarm or peers and skype knowing what is your IP address, proxies will do the trick. Your ISP will still be able to see what you are doing. The only workaround for this is an SSH tunnel or a VPN which is not going to be discussed in this post.<br />
	&nbsp;</p>

<h2>
	<a href="http://tsikerdekis.wuwcorp.com/HidingYourIpThroughProxyAndFirewall#hn_How_does_your_IP_leak">How does your IP leak?</a></h2>

<p>
	<br />
	This could happen in a number of ways. It all boils down to bad programming on the side of applications. Some are designed in such a way that when your proxy server is down, they just redirect all traffic through the normal route. Other times, some of the traffic is sent through the proxy while some packets may be sent outside the proxy. All it takes is one packet to leak and basically you failed to do what you were attempting to do (hiding your IP from the destination server).<br />
	&nbsp;</p>

<h2>
	<a href="http://tsikerdekis.wuwcorp.com/HidingYourIpThroughProxyAndFirewall#hn_Solution">Solution</a></h2>

<p>
	I am providing a solution for Ubuntu but a Windows solution would work in the same way. Also, Mac users may be able to follow this guide but instead use the ipfw command which is similar to iptables (linux's firewall).<br />
	<br />
	The problem is divided into two solutions: a) block all outgoing leaking traffic and b) don't answer to any calls that don't come from a proxy. The latter is not necessary with browsing but with torrents it is if you really want to appear that you don't have a torrent client on to the outside world.<br />
	<br />
	&nbsp;</p>

<h2>
	<a href="http://tsikerdekis.wuwcorp.com/HidingYourIpThroughProxyAndFirewall#hn_Blocking_incoming">Blocking incoming</a></h2>

<p>
	<br />
	Blocking an incoming connection is relatively easy. I am assuming that if you are behind a router you already port forwarded the relevant port for your application to the computer running the application. Sometimes,&nbsp;<a href="http://tsikerdekis.wuwcorp.com/UPnP">UPnP</a>&nbsp;takes care of that. So let's say that port 8000 is the one for your application. All you need to do is tell your firewall to accept packets to this port only when they come from your proxy and drop the rest. Let's say that your proxy's ip is 10.10.10.10. As root you just run:<br />
	&nbsp;</p>

<p>
	iptables -F<br />
	iptables -A INPUT -p tcp -s 10.10.10.10 --dport 8000 -j ACCEPT<br />
	iptables -A INPUT -p udp -s 10.10.10.10 --dport 8000 -j ACCEPT<br />
	iptables -A INPUT -p udp --dport 8000 -j DROP&nbsp;<br />
	iptables -A INPUT -p tcp --dport 8000 -j DROP</p>

<p>
	<br />
	<br />
	The first command deletes all previous rules on the firewall which by default there aren't any.<br />
	&nbsp;</p>

<h2>
	<a href="http://tsikerdekis.wuwcorp.com/HidingYourIpThroughProxyAndFirewall#hn_Blocking_outgoing_packets">Blocking outgoing packets</a></h2>

<p>
	<br />
	Windows are a bit easier at restricting rules for one application. Linux isn't. My solution for this is to run an application as another user and apply rules to that user. It is definitely safer this way but it takes a bit of work. I won't go into details on how to create a new user and run that application as that user but you can find guides online. Assuming you have this ready and verified using ps -faux that your application runs through that user (IMPORTANT since rules will apply only for that user) you can type the following as root.<br />
	&nbsp;</p>

<p>
	iptables -A OUTPUT -p tcp -m owner --uid-owner testing -d 10.10.10.10 -j ACCEPT<br />
	iptables -A OUTPUT -p udp -m owner --uid-owner testing -d 10.10.10.10 -j ACCEPT<br />
	iptables -A OUTPUT -p udp -m owner --uid-owner testing -d 192.168.0.0/24 -j ACCEPT<br />
	iptables -A OUTPUT -p tcp -m owner --uid-owner testing -d 192.168.0.0/24 -j ACCEPT<br />
	iptables -A OUTPUT -p tcp -m owner --uid-owner testing -d 127.0.0.1 -j ACCEPT<br />
	iptables -A OUTPUT -m owner --uid-owner deluge -j DROP</p>

<p>
	<br />
	<br />
	Basically accept outgoing traffic from this user to 10.10.10.10, all ips in the LAN (you don't have to do this though) and packets sent to localhost. The last option is used by some programs to communicate with others. You have to adjust your settings but the important part is that you DROP packets sent to any IP that you don't like. If you try to do anything with that user, you will find that no websites will open without a proxy on your browser.<br />
	<br />
	<br />
	If you combine all of the incoming and outgoing rules into one file, make it executable and place it here: /etc/network/if-pre-up.d/ then your firewall settings will not be deleted after a reboot.<br />
	<br />
	&nbsp;</p>

<h2>
	<a href="http://tsikerdekis.wuwcorp.com/HidingYourIpThroughProxyAndFirewall#hn_Verifying_that_it_works">Verifying that it works</a></h2>

<p>
	<br />
	A way to see what packets are hitting your interface is to use tcpdump. This shows incoming packets before they pass through the firewall and outgoing packets that already passed through the firewall.<br />
	&nbsp;</p>

<p>
	sudo tcpdump port 8000 -i wlan0</p>

<p>
	<br />
	<br />
	Here is a sample of what you would expect to see:</p>

<p>
	17:30:57.219187 IP michael-netbook.local.8000 &gt; 10.10.10.10.42869: UDP, length 111<br />
	17:30:57.430905 IP 10.10.10.10.42869 &gt; michael-netbook.local.8000: UDP, length 30<br />
	17:30:57.461266 IP 10.10.10.10.42869 &gt; michael-netbook.local.8000: UDP, length 380<br />
	17:30:57.461473 IP michael-netbook.local.8000 &gt; 10.10.10.10.42869: UDP, length 30<br />
	17:30:57.492072 IP 10.10.10.10.42869 &gt; michael-netbook.local.8000: UDP, length 380<br />
	17:30:57.492286 IP michael-netbook.local.8000 &gt; 10.10.10.10.42869: UDP, length 30<br />
	17:30:57.502889 IP 10.10.10.10.42869 &gt; michael-netbook.local.8000: UDP, length 380<br />
	17:30:57.503056 IP michael-netbook.local.8000 &gt; 10.10.10.10.42869: UDP, length 30<br />
	17:30:57.517659 IP 10.10.10.10.42869 &gt; michael-netbook.local.8000: UDP, length 380<br />
	17:30:57.517858 IP michael-netbook.local.8000 &gt; 10.10.10.10.42869: UDP, length 33</p>

<p>
	<br />
	<br />
	It is likely that you would still see incoming traffic. This can be due to a) you had an open connection before applying the rules and activating the proxy (this will persist for a while) and b) machines on the internet initiated port scans for whatever reason. If your IP is dynamic it is likely to see a (b) traffic mainly due to other users that used your IP before you got it.<br />
	<br />
	But is the firewall working? Well, let's see:<br />
	&nbsp;</p>

<p>
	michael@michael-netbook:~$ sudo iptables -nvx -L INPUT<br />
	Chain INPUT (policy ACCEPT 5814 packets, 2633217 bytes)<br />
	&nbsp; &nbsp; pkts &nbsp; &nbsp; &nbsp;bytes target &nbsp; &nbsp; prot opt in &nbsp; &nbsp; out &nbsp; &nbsp; source &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; destination &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br />
	&nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp;0 ACCEPT &nbsp; &nbsp; tcp &nbsp;-- &nbsp;* &nbsp; &nbsp; &nbsp;* &nbsp; &nbsp; &nbsp; 10.10.10.10 &nbsp; &nbsp; &nbsp; 0.0.0.0/0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tcp dpt:8000<br />
	&nbsp; &nbsp; 4210 &nbsp;3556857 ACCEPT &nbsp; &nbsp; udp &nbsp;-- &nbsp;* &nbsp; &nbsp; &nbsp;* &nbsp; &nbsp; &nbsp; 10.10.10.10 &nbsp; &nbsp; &nbsp; 0.0.0.0/0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;udp dpt:8000<br />
	&nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp;0 DROP &nbsp; &nbsp; &nbsp; udp &nbsp;-- &nbsp;* &nbsp; &nbsp; &nbsp;* &nbsp; &nbsp; &nbsp; 0.0.0.0/0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0.0.0.0/0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;udp dpt:8000<br />
	&nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp;0 DROP &nbsp; &nbsp; &nbsp; tcp &nbsp;-- &nbsp;* &nbsp; &nbsp; &nbsp;* &nbsp; &nbsp; &nbsp; 0.0.0.0/0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0.0.0.0/0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tcp dpt:8000</p>

<p>
	<br />
	<br />
	Ideally, you will not see DROPPED packages in the counters but even if you see that is a good thing. It means that people tried to sent you stuff from 8000 directly to your IP and you firewall blocked them. For the rest of the world, the port appears closed as if you don't have an application listening.<br />
	<br />
	How about your outgoing traffic?<br />
	&nbsp;</p>

<p>
	michael@michael-netbook:~$ sudo iptables -nvx -L OUTPUT<br />
	Chain OUTPUT (policy ACCEPT 1028 packets, 388980 bytes)<br />
	&nbsp; &nbsp; pkts &nbsp; &nbsp; &nbsp;bytes target &nbsp; &nbsp; prot opt in &nbsp; &nbsp; out &nbsp; &nbsp; source &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; destination &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br />
	&nbsp; &nbsp; 2585 &nbsp; 652144 ACCEPT &nbsp; &nbsp; tcp &nbsp;-- &nbsp;* &nbsp; &nbsp; &nbsp;* &nbsp; &nbsp; &nbsp; 0.0.0.0/0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;10.10.10.10 &nbsp; &nbsp; &nbsp; owner UID match 130<br />
	&nbsp; &nbsp; 4074 &nbsp; 336713 ACCEPT &nbsp; &nbsp; udp &nbsp;-- &nbsp;* &nbsp; &nbsp; &nbsp;* &nbsp; &nbsp; &nbsp; 0.0.0.0/0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;10.10.10.10 &nbsp; &nbsp; &nbsp; owner UID match 130<br />
	&nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp;0 ACCEPT &nbsp; &nbsp; udp &nbsp;-- &nbsp;* &nbsp; &nbsp; &nbsp;* &nbsp; &nbsp; &nbsp; 0.0.0.0/0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;192.168.0.0/24 &nbsp; &nbsp; &nbsp; owner UID match 130<br />
	&nbsp; &nbsp; &nbsp;552 &nbsp; 314414 ACCEPT &nbsp; &nbsp; tcp &nbsp;-- &nbsp;* &nbsp; &nbsp; &nbsp;* &nbsp; &nbsp; &nbsp; 0.0.0.0/0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;192.168.0.0/24 &nbsp; &nbsp; &nbsp; owner UID match 130<br />
	&nbsp; &nbsp; &nbsp;826 &nbsp; 423050 ACCEPT &nbsp; &nbsp; tcp &nbsp;-- &nbsp;* &nbsp; &nbsp; &nbsp;* &nbsp; &nbsp; &nbsp; 0.0.0.0/0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;127.0.0.1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;owner UID match 130<br />
	&nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp;0 DROP &nbsp; &nbsp; &nbsp; all &nbsp;-- &nbsp;* &nbsp; &nbsp; &nbsp;* &nbsp; &nbsp; &nbsp; 0.0.0.0/0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0.0.0.0/0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;owner UID match 130</p>

<p>
	<br />
	<br />
	Ideally, this should also show no DROPPED packages but even if it does it just means that everything is working. It also means that your application attempted to send something by bypassing the proxy but your firewall crashed its attempts.<br />
	<br />
	But don't take my word for it. Setup these rules and then remove the proxy. Try using your application and monitor traffic. Does anything work? If not then your firewall is doing its job allowing traffic only through proxy even if programs attempt to bypass your settings.</p>]]></content><author><name>Michael Tsikerdekis</name><email>Michael.Tsikerdekis@wwu.edu</email><uri>http://michael.tsikerdekis.com</uri></author><summary type="html"><![CDATA[This article is not about setting up a proxy on your browser, skype or torrents. This is easy! Just go on your application's options and setup your proxy. You should of course have access to a proxy server that ideally does not retain any log files. If they do, then if those log files can be accessed by someone then your traffic history would be available to them. So, you got your proxy server (paid or free) with no log files and you have its port and authentication (if any). You set everything up on your browser or torrent application and that's it, right? All your traffic parsed through the proxy, others see the proxy's IP address while you are hidden behind the proxy. Well, that is not always the case and the reason boils down to he programming of the application that you are using. This is a guide on how to put an additional layer of protection through applying firewall. &nbsp;]]></summary></entry><entry><title type="html">Importing Wikipedia Dumps to Mysql</title><link href="https://michael.tsikerdekis.com/2013/07/14/importwikipedia/" rel="alternate" type="text/html" title="Importing Wikipedia Dumps to Mysql" /><published>2013-07-14T00:00:00-07:00</published><updated>2013-07-14T00:00:00-07:00</updated><id>https://michael.tsikerdekis.com/2013/07/14/importwikipedia</id><content type="html" xml:base="https://michael.tsikerdekis.com/2013/07/14/importwikipedia/"><![CDATA[<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">It can be quite frustrating adding Wikipedia Dumps in a local database. For some Wikipedias, such as the English Wikipedia, it takes a long time. This is a collection of scripts I've used to import Wikipedia dumps in Mysql.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<em style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; color: rgb(68, 68, 68); font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">Note: This guide is based on an Ubuntu server setup</em><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<em style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; color: rgb(68, 68, 68); font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">Warning: The restoring process is likely to take weeks for large Wikipedias such as the English Wikipedia</em></p>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<h2 id="hn_Step_1:_Install_MediaWiki" style="font-weight: 300; font-stretch: normal; font-size: 15pt; line-height: 18pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; margin: 0pt; color: rgb(153, 51, 85); padding-top: 10px; padding-bottom: 10px; text-shadow: rgb(238, 238, 238) 1px 1px 0px; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/WikipediaDumpstoMysql#hn_Step_1:_Install_MediaWiki" style="font-size: 15pt; line-height: 18pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 10px; padding-bottom: 10px; background-color: transparent;">Step 1: Install&nbsp;</a><a href="http://tsikerdekis.wuwcorp.com/MediaWiki" style="font-size: 15pt; line-height: 18pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 10px; padding-bottom: 10px; background-color: transparent;">MediaWiki</a></h2>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">This is the quickest way to develop an almost blank mediawiki db used by Wikipedia. You will need a typical&nbsp;</span><a class="ext" href="https://help.ubuntu.com/community/ApacheMySQLPHP" style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; text-align: justify;" target="\&quot;_new\&quot;">LAMP server</a><span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">.&nbsp;</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">Mediawiki uses innoDB tables. By default, all innodb tables are saved under one file on the disk. The file cannot shrink and can cause problems. It's best to use an option of&nbsp;</span><a href="http://tsikerdekis.wuwcorp.com/MySQL" style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; text-align: justify;">MySQL</a><span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">&nbsp;to create a seperate file on the disc per innodb table. To do this you need to do the following:</span></p>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<div class="code" style="border: 1px solid rgb(170, 170, 204); font-size: 11px; font-family: monospace; margin: auto; padding: 6px 5px 13px; overflow: auto; white-space: nowrap; line-height: 23.0399990081787px; background: rgb(243, 243, 255);">
	sudo /etc/my.cnf</div>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<form action="http://tsikerdekis.wuwcorp.com/WikipediaDumpstoMysql/grabcode" id="form_61092f4ded" method="post" style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<input class="grabcode" name="save" style="border-width: 1px; border-style: solid; border-color: rgb(239, 239, 239) rgb(170, 170, 204) rgb(170, 170, 204) rgb(238, 238, 255); color: rgb(51, 51, 102); font-stretch: normal; font-size: 10.0799999237061px; font-family: Verdana, sans-serif; padding-right: 0.2em; padding-left: 0.2em; line-height: 1em; float: right; background-color: rgb(208, 224, 240);" title="Download" type="submit" value="Grab" />&nbsp;</form>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">Find the [mysqld] part in the config file and add:</span></p>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<div class="code" style="border: 1px solid rgb(170, 170, 204); font-size: 11px; font-family: monospace; margin: auto; padding: 6px 5px 13px; overflow: auto; white-space: nowrap; line-height: 23.0399990081787px; background: rgb(243, 243, 255);">
	innodb_file_per_table=1</div>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<form action="http://tsikerdekis.wuwcorp.com/WikipediaDumpstoMysql/grabcode" id="form_61092f4ded_1" method="post" style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<input class="grabcode" name="save" style="border-width: 1px; border-style: solid; border-color: rgb(239, 239, 239) rgb(170, 170, 204) rgb(170, 170, 204) rgb(238, 238, 255); color: rgb(51, 51, 102); font-stretch: normal; font-size: 10.0799999237061px; font-family: Verdana, sans-serif; padding-right: 0.2em; padding-left: 0.2em; line-height: 1em; float: right; background-color: rgb(208, 224, 240);" title="Download" type="submit" value="Grab" />&nbsp;</form>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">Save the file and then on the terminal restart mysql:</span></p>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<div class="code" style="border: 1px solid rgb(170, 170, 204); font-size: 11px; font-family: monospace; margin: auto; padding: 6px 5px 13px; overflow: auto; white-space: nowrap; line-height: 23.0399990081787px; background: rgb(243, 243, 255);">
	service mysql restart</div>

<p>
	&nbsp;</p>

<form action="http://tsikerdekis.wuwcorp.com/WikipediaDumpstoMysql/grabcode" id="form_61092f4ded_2" method="post" style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<input class="grabcode" name="save" style="border-width: 1px; border-style: solid; border-color: rgb(239, 239, 239) rgb(170, 170, 204) rgb(170, 170, 204) rgb(238, 238, 255); color: rgb(51, 51, 102); font-stretch: normal; font-size: 10.0799999237061px; font-family: Verdana, sans-serif; padding-right: 0.2em; padding-left: 0.2em; line-height: 1em; float: right; background-color: rgb(208, 224, 240);" title="Download" type="submit" value="Grab" />&nbsp;</form>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">Note that any existing innodb tables will remain in the large ibfdata file but any newly created tables will be assigned a different file on the disk.&nbsp;</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">You will need to do some fine tuning on mysql for variables such as: innodb_buffer_pool_size, innodb_log_buffer_size, innodb_additional_mem_pool_size. You will have to investigate a bit to see what's best.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">Now you need to install mediawiki. You need to follow the&nbsp;</span><a class="ext" href="http://www.mediawiki.org/wiki/Manual:Installation_guide#Quick_installation_guide" style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; text-align: justify;" target="\&quot;_new\&quot;">Quick Installation Guide for Mediawiki</a><span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">. For the most part if you know your root password for mysql mediawiki can setup automatically the database, tables, and the user (if you don't want to have root as your user accessing the database).</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">At this point, if you know exactly which columns on a table you are going to need, you may want to turn some fields in smaller versions, so that they can still exist and avoid errors, however they won't occupy as much space. A good example is the text table that contains two blob fields that track changes. If you are not interested in these changes, you could always turn these blob fields in varchar(2) or something else and save space.</span></p>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<h2 id="hn_Step_2:_Find_dumps_and_retrieve_the_list" style="font-weight: 300; font-stretch: normal; font-size: 15pt; line-height: 18pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; margin: 0pt; color: rgb(153, 51, 85); padding-top: 10px; padding-bottom: 10px; text-shadow: rgb(238, 238, 238) 1px 1px 0px; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/WikipediaDumpstoMysql#hn_Step_2:_Find_dumps_and_retrieve_the_list" style="font-size: 15pt; line-height: 18pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 10px; padding-bottom: 10px; background-color: transparent;">Step 2: Find dumps and retrieve the list</a></h2>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">After the installation, you will need to figure out which dump contains the data that you want. There are many and they contain dumps for different tables. You can look some of the dumps&nbsp;</span><a class="ext" href="http://dumps.wikimedia.org/enwiki/" style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; text-align: justify;" target="\&quot;_new\&quot;">here</a><span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">. If you want another language Wikipedia, you have to change "enwiki" to reflect the prefix of the language that you are interested in (e.g., elwiki for Greek Wikipedia, cswiki for Czech Wikipedia, eswiki for Spanish Wikipedia).&nbsp;</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">Use this script to create a filelist.txt file containing all files to be downloaded. You will need a proper regular expression to capture the names of the files automatically. As an alternative, you could type all file names manually in a file names filelist.txt. Also you will need to setup the url variable to the directory containing the dumps that interest you.</span></p>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<div class="code" style="border: 1px solid rgb(170, 170, 204); font-size: 11px; font-family: monospace; margin: auto; padding: 6px 5px 13px; overflow: auto; white-space: nowrap; line-height: 23.0399990081787px; background: rgb(243, 243, 255);">
	<span class="kw1" style="color: rgb(177, 177, 0);">import</span>&nbsp;<span class="kw3" style="color: rgb(0, 0, 102);">urllib2</span>,&nbsp;<span class="kw3" style="color: rgb(0, 0, 102);">re</span><br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	<span class="co1" style="color: rgb(128, 128, 128); font-style: italic;">#main url to retrieve files</span><br style="clear: none; line-height: 0.9em;" />
	url =&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"http://dumps.wikimedia.org/enwiki/20130102/"</span><br style="clear: none; line-height: 0.9em;" />
	f =&nbsp;<span class="kw3" style="color: rgb(0, 0, 102);">urllib2</span>.<span class="me1">urlopen</span><span class="br0" style="color: rgb(102, 204, 102);">(</span>url<span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	data = f.<span class="me1">read</span><span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	a =&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="br0" style="color: rgb(102, 204, 102);">]</span><br style="clear: none; line-height: 0.9em;" />
	m =&nbsp;<span class="kw3" style="color: rgb(0, 0, 102);">re</span>.<span class="me1">findall</span><span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="st0" style="color: rgb(255, 0, 0);">"(enwiki-<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\d</span>*?-pages-meta-history<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\d</span>+?.xml-p.+?<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\.</span>7z)"</span>,data,<span class="kw3" style="color: rgb(0, 0, 102);">re</span>.<span class="me1">DOTALL</span><span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">for</span>&nbsp;item&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">in</span>&nbsp;m:<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">if</span>&nbsp;item&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">not</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">in</span>&nbsp;a:<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; a.<span class="me1">append</span><span class="br0" style="color: rgb(102, 204, 102);">(</span>item<span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">print</span>&nbsp;a<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	f =&nbsp;<span class="kw2" style="font-weight: bold;">open</span><span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="st0" style="color: rgb(255, 0, 0);">"filelist.txt"</span>,<span class="st0" style="color: rgb(255, 0, 0);">"w"</span><span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">for</span>&nbsp;<span class="kw2" style="font-weight: bold;">file</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">in</span>&nbsp;a:<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp; f.<span class="me1">write</span><span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="kw2" style="font-weight: bold;">file</span>+<span class="st0" style="color: rgb(255, 0, 0);">"<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span><span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	f.<span class="me1">close</span><span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="br0" style="color: rgb(102, 204, 102);">)</span></div>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<form action="http://tsikerdekis.wuwcorp.com/WikipediaDumpstoMysql/grabcode" id="form_61092f4ded_3" method="post" style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<input class="grabcode" name="save" style="border-width: 1px; border-style: solid; border-color: rgb(239, 239, 239) rgb(170, 170, 204) rgb(170, 170, 204) rgb(238, 238, 255); color: rgb(51, 51, 102); font-stretch: normal; font-size: 10.0799999237061px; font-family: Verdana, sans-serif; padding-right: 0.2em; padding-left: 0.2em; line-height: 1em; float: right; background-color: rgb(208, 224, 240);" title="Download" type="submit" value="Grab" />&nbsp;</form>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<h2 id="hn_Step_3:_Start_retrieving_and_importing" style="font-weight: 300; font-stretch: normal; font-size: 15pt; line-height: 18pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; margin: 0pt; color: rgb(153, 51, 85); padding-top: 10px; padding-bottom: 10px; text-shadow: rgb(238, 238, 238) 1px 1px 0px; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/WikipediaDumpstoMysql#hn_Step_3:_Start_retrieving_and_importing" style="font-size: 15pt; line-height: 18pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 10px; padding-bottom: 10px; background-color: transparent;">Step 3: Start retrieving and importing</a></h2>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">For this step you will need to save a couple of scripts. You will also need the filelist.txt file from the previous step. I have instruction that you need to follow for some files. Also, you may need to install p7zip ubuntu package.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">Save all of the following on your disk (same directory).</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">preimport.sql (source&nbsp;</span><a class="ext" href="http://www.brianstempin.com/2012/06/29/loading-the-english-wikipedia-dump-is-a-huge-pain/" style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; text-align: justify;" target="\&quot;_new\&quot;">Brian Stempin</a><span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">)</span></p>

<p>
	&nbsp;</p>

<div class="code" style="border: 1px solid rgb(170, 170, 204); font-size: 11px; font-family: monospace; margin: auto; padding: 6px 5px 13px; overflow: auto; white-space: nowrap; line-height: 23.0399990081787px; background: rgb(243, 243, 255);">
	<span class="kw1" style="color: rgb(177, 177, 0);">SET</span>&nbsp;autocommit=<span class="nu0" style="color: rgb(204, 102, 204);">0</span>;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">SET</span>&nbsp;unique_checks=<span class="nu0" style="color: rgb(204, 102, 204);">0</span>;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">SET</span>&nbsp;foreign_key_checks=<span class="nu0" style="color: rgb(204, 102, 204);">0</span>;<br style="clear: none; line-height: 0.9em;" />
	BEGIN;</div>

<p>
	&nbsp;</p>

<form action="http://tsikerdekis.wuwcorp.com/WikipediaDumpstoMysql/grabcode" id="form_61092f4ded_4" method="post" style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<input class="grabcode" name="save" style="border-width: 1px; border-style: solid; border-color: rgb(239, 239, 239) rgb(170, 170, 204) rgb(170, 170, 204) rgb(238, 238, 255); color: rgb(51, 51, 102); font-stretch: normal; font-size: 10.0799999237061px; font-family: Verdana, sans-serif; padding-right: 0.2em; padding-left: 0.2em; line-height: 1em; float: right; background-color: rgb(208, 224, 240);" title="Download" type="submit" value="Grab" />&nbsp;</form>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">postimport.sql (source&nbsp;</span><a class="ext" href="http://www.brianstempin.com/2012/06/29/loading-the-english-wikipedia-dump-is-a-huge-pain/" style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; text-align: justify;" target="\&quot;_new\&quot;">Brian Stempin</a><span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">)</span></p>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<div class="code" style="border: 1px solid rgb(170, 170, 204); font-size: 11px; font-family: monospace; margin: auto; padding: 6px 5px 13px; overflow: auto; white-space: nowrap; line-height: 23.0399990081787px; background: rgb(243, 243, 255);">
	COMMIT;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">SET</span>&nbsp;autocommit=<span class="nu0" style="color: rgb(204, 102, 204);">1</span>;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">SET</span>&nbsp;unique_checks=<span class="nu0" style="color: rgb(204, 102, 204);">1</span>;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">SET</span>&nbsp;foreign_key_checks=<span class="nu0" style="color: rgb(204, 102, 204);">1</span>;</div>

<p>
	&nbsp;</p>

<form action="http://tsikerdekis.wuwcorp.com/WikipediaDumpstoMysql/grabcode" id="form_61092f4ded_5" method="post" style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<input class="grabcode" name="save" style="border-width: 1px; border-style: solid; border-color: rgb(239, 239, 239) rgb(170, 170, 204) rgb(170, 170, 204) rgb(238, 238, 255); color: rgb(51, 51, 102); font-stretch: normal; font-size: 10.0799999237061px; font-family: Verdana, sans-serif; padding-right: 0.2em; padding-left: 0.2em; line-height: 1em; float: right; background-color: rgb(208, 224, 240);" title="Download" type="submit" value="Grab" />&nbsp;</form>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">mwimport.pl (original source&nbsp;</span><a class="ext" href="http://meta.wikimedia.org/wiki/Data_dumps/mwimport" style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; text-align: justify;" target="\&quot;_new\&quot;">here</a><span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">)</span></p>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<div class="code" style="border: 1px solid rgb(170, 170, 204); font-size: 11px; font-family: monospace; margin: auto; padding: 6px 5px 13px; overflow: auto; white-space: nowrap; line-height: 23.0399990081787px; background: rgb(243, 243, 255);">
	- You can drastically speed up the&nbsp;<a href="http://perldoc.perl.org/functions/import.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">import</span></a>&nbsp;process by commenting the insert line that adds information&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">for</span>&nbsp;the text table. Look&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">for</span>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"Comment this to save time"</span>&nbsp;in the code below.<br style="clear: none; line-height: 0.9em;" />
	<span class="co1" style="color: rgb(128, 128, 128); font-style: italic;">#!/usr/bin/perl -w</span><br style="clear: none; line-height: 0.9em;" />
	=head1 NAME<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	mwimport -- quick&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">and</span>&nbsp;dirty mediawiki importer<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	=head1 SYNOPSIS<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	cat pages.xml | mwimport&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">[</span>-<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>&nbsp;N|--skip=N<span class="br0" style="color: rgb(102, 204, 102);">]</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	=cut<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">use</span>&nbsp;strict;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">use</span>&nbsp;Getopt::<span class="me2">Long</span>;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">use</span>&nbsp;Pod::<span class="me2">Usage</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="re0" style="color: rgb(0, 0, 255);">$cnt_page</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$cnt_rev</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">%namespace</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$ns_pattern</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$committed</span>&nbsp;=&nbsp;<span class="nu0" style="color: rgb(204, 102, 204);">0</span>;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$skip</span>&nbsp;=&nbsp;<span class="nu0" style="color: rgb(204, 102, 204);">0</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="co1" style="color: rgb(128, 128, 128); font-style: italic;">## set this to 1 to match "mwdumper --format=sql:1.5" as close as possible</span><br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">sub</span>&nbsp;Compat<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span>&nbsp;<span class="nu0" style="color: rgb(204, 102, 204);">0</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="co1" style="color: rgb(128, 128, 128); font-style: italic;"># 512kB is what mwdumper uses, but 4MB gives much better performance here</span><br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$Buffer_Size</span>&nbsp;= Compat ?&nbsp;<span class="nu0" style="color: rgb(204, 102, 204);">512</span>*<span class="nu0" style="color: rgb(204, 102, 204);">1024</span>&nbsp;:&nbsp;<span class="nu0" style="color: rgb(204, 102, 204);">4</span>*<span class="nu0" style="color: rgb(204, 102, 204);">1024</span>*<span class="nu0" style="color: rgb(204, 102, 204);">1024</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">sub</span>&nbsp;textify<span class="br0" style="color: rgb(102, 204, 102);">(</span>$<span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$l</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">for</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">if</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span><a href="http://perldoc.perl.org/functions/defined.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">defined</span></a>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>/&amp;quot;/<span class="st0" style="color: rgb(255, 0, 0);">"/ig;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; s/&amp;lt;/&lt;/ig;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; s/&amp;gt;/&gt;/ig;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; /&amp;(?!amp;)(.*?;)/ and die "</span>textify: does&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">not</span>&nbsp;know &amp;$<span class="nu0" style="color: rgb(204, 102, 204);">1</span><span class="st0" style="color: rgb(255, 0, 0);">";<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; s/&amp;amp;/&amp;/ig;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; $l = length $_;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; s/<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\\</span>/<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\\</span><span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\\</span>/g;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; s/<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>/<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\\</span>n/g;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; s/'/<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\\</span>'/ig;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; Compat and s/"</span>/\\<span class="st0" style="color: rgb(255, 0, 0);">"/ig;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; $_ = "</span><span class="st0" style="color: rgb(255, 0, 0);">'$_'</span><span class="st0" style="color: rgb(255, 0, 0);">";<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; } else {<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; $l = 0;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; $_ = "</span><span class="st0" style="color: rgb(255, 0, 0);">''</span><span class="st0" style="color: rgb(255, 0, 0);">";<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; }<br style="clear: none; line-height: 0.9em;" />
	&nbsp; }<br style="clear: none; line-height: 0.9em;" />
	&nbsp; return $l;<br style="clear: none; line-height: 0.9em;" />
	}<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	sub getline()<br style="clear: none; line-height: 0.9em;" />
	{<br style="clear: none; line-height: 0.9em;" />
	&nbsp; $_ = &lt;&gt;;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; defined $_ or die "</span><a href="http://perldoc.perl.org/functions/eof.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">eof</span></a>&nbsp;at line $.\n<span class="st0" style="color: rgb(255, 0, 0);">";<br style="clear: none; line-height: 0.9em;" />
	}<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	sub ignore_elt($)<br style="clear: none; line-height: 0.9em;" />
	{<br style="clear: none; line-height: 0.9em;" />
	&nbsp; m|^<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\s</span>*&lt;$_[0]&gt;.*?&lt;/$_[0]&gt;<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>$| or die "</span>expected&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>&nbsp;element in line $.\n<span class="st0" style="color: rgb(255, 0, 0);">";<br style="clear: none; line-height: 0.9em;" />
	&nbsp; getline;<br style="clear: none; line-height: 0.9em;" />
	}<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	sub simple_elt($$)<br style="clear: none; line-height: 0.9em;" />
	{<br style="clear: none; line-height: 0.9em;" />
	&nbsp; if (m|^<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\s</span>*&lt;$_[0]<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\s</span>*/&gt;<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>$|) {<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; $_[1]{$_[0]} = '';<br style="clear: none; line-height: 0.9em;" />
	&nbsp; } elsif (m|^<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\s</span>*&lt;$_[0]&gt;(.*?)&lt;/$_[0]&gt;<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>$|) {<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; $_[1]{$_[0]} = $1;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; } else {<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; die "</span>expected&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>&nbsp;element in line $.\n<span class="st0" style="color: rgb(255, 0, 0);">";<br style="clear: none; line-height: 0.9em;" />
	&nbsp; }<br style="clear: none; line-height: 0.9em;" />
	&nbsp; getline;<br style="clear: none; line-height: 0.9em;" />
	}<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	sub simple_opt_elt($$)<br style="clear: none; line-height: 0.9em;" />
	{<br style="clear: none; line-height: 0.9em;" />
	&nbsp; if (m|^<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\s</span>*&lt;$_[0]<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\s</span>*/&gt;<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>$|) {<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; $_[1]{$_[0]} = '';<br style="clear: none; line-height: 0.9em;" />
	&nbsp; } elsif (m|^<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\s</span>*&lt;$_[0]&gt;(.*?)&lt;/$_[0]&gt;<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>$|) {<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; $_[1]{$_[0]} = $1;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; } else {<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; return;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; }<br style="clear: none; line-height: 0.9em;" />
	&nbsp; getline;<br style="clear: none; line-height: 0.9em;" />
	}<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	sub redirect_elt($)<br style="clear: none; line-height: 0.9em;" />
	{<br style="clear: none; line-height: 0.9em;" />
	&nbsp; if (m|^<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\s</span>*&lt;redirect<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\s</span>*title="</span><span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="br0" style="color: rgb(102, 204, 102);">[</span>^<span class="st0" style="color: rgb(255, 0, 0);">"]*)"</span>\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*/&gt;\n$|<span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span>&nbsp;<span class="co1" style="color: rgb(128, 128, 128); font-style: italic;"># " -- GeSHI syntax highlighting breaks on this line</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>redirect<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;= $<span class="nu0" style="color: rgb(204, 102, 204);">1</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">else</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; simple_opt_elt redirect =&gt;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/return.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">return</span></a>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; getline;<br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">sub</span>&nbsp;opening_tag<span class="br0" style="color: rgb(102, 204, 102);">(</span>$<span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; m|^\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*&lt;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>&gt;\n$|&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;<a href="http://perldoc.perl.org/functions/die.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">die</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"expected $_[0] element in line $.<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; getline;<br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">sub</span>&nbsp;closing_tag<span class="br0" style="color: rgb(102, 204, 102);">(</span>$<span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; m|^\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*&lt;/<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>&gt;\n$|&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;<a href="http://perldoc.perl.org/functions/die.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">die</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"$_[0]: expected closing tag in line $.<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; getline;<br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">sub</span>&nbsp;si_nss_namespace<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; m|^\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*&lt;namespace key=<span class="st0" style="color: rgb(255, 0, 0);">"(-?<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\d</span>+)"</span><span class="br0" style="color: rgb(102, 204, 102);">[</span>^/<span class="br0" style="color: rgb(102, 204, 102);">]</span>*?/&gt;<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>\n|<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;m|^\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*&lt;namespace key=<span class="st0" style="color: rgb(255, 0, 0);">"(-?<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\d</span>+)"</span><span class="br0" style="color: rgb(102, 204, 102);">[</span>^&gt;<span class="br0" style="color: rgb(102, 204, 102);">]</span>*?&gt;<span class="br0" style="color: rgb(102, 204, 102);">(</span>.*?<span class="br0" style="color: rgb(102, 204, 102);">)</span>&lt;/namespace&gt;\n|<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;<a href="http://perldoc.perl.org/functions/die.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">die</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"expected namespace element in line $.<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$namespace</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>$<span class="nu0" style="color: rgb(204, 102, 204);">2</span><span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;= $<span class="nu0" style="color: rgb(204, 102, 204);">1</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; getline;<br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">sub</span>&nbsp;si_namespaces<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; opening_tag<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="st0" style="color: rgb(255, 0, 0);">"namespaces"</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/eval.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">eval</span></a>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">while</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="nu0" style="color: rgb(204, 102, 204);">1</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; si_nss_namespace;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="co1" style="color: rgb(128, 128, 128); font-style: italic;"># note: $@ is always defined</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; $@ =~ /^expected namespace element /&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;<a href="http://perldoc.perl.org/functions/die.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">die</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"namespaces: $@"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$ns_pattern</span>&nbsp;=&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">'^('</span>.<a href="http://perldoc.perl.org/functions/join.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">join</span></a><span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="st0" style="color: rgb(255, 0, 0);">'|'</span>,<a href="http://perldoc.perl.org/functions/map.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">map</span></a>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span>&nbsp;<a href="http://perldoc.perl.org/functions/quotemeta.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">quotemeta</span></a>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;<a href="http://perldoc.perl.org/functions/keys.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">keys</span></a>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">%namespace</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>.<span class="st0" style="color: rgb(255, 0, 0);">'):'</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; closing_tag<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="st0" style="color: rgb(255, 0, 0);">"namespaces"</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>;<br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">sub</span>&nbsp;siteinfo<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; opening_tag<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="st0" style="color: rgb(255, 0, 0);">"siteinfo"</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/eval.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">eval</span></a>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">%site</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; simple_elt sitename =&gt; \<span class="re0" style="color: rgb(0, 0, 255);">%site</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; simple_elt base =&gt; \<span class="re0" style="color: rgb(0, 0, 255);">%site</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; simple_elt generator =&gt; \<span class="re0" style="color: rgb(0, 0, 255);">%site</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$site</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>generator<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;=~ /^MediaWiki&nbsp;<span class="nu0" style="color: rgb(204, 102, 204);">1</span>.20wmf1$/<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;<a href="http://perldoc.perl.org/functions/warn.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">warn</span></a><span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="st0" style="color: rgb(255, 0, 0);">"siteinfo: untested generator '$site{generator}',"</span>,<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">" expect trouble ahead<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; simple_elt&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">case</span>&nbsp;=&gt; \<span class="re0" style="color: rgb(0, 0, 255);">%site</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; si_namespaces;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/print.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">print</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"-- MediaWiki XML dump converted to SQL by mwimport<br style="clear: none; line-height: 0.9em;" />
	BEGIN;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	-- Site: $site{sitename}<br style="clear: none; line-height: 0.9em;" />
	-- URL: $site{base}<br style="clear: none; line-height: 0.9em;" />
	-- Generator: $site{generator}<br style="clear: none; line-height: 0.9em;" />
	-- Case: $site{case}<br style="clear: none; line-height: 0.9em;" />
	--<br style="clear: none; line-height: 0.9em;" />
	-- Namespaces:<br style="clear: none; line-height: 0.9em;" />
	"</span>,<a href="http://perldoc.perl.org/functions/map.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">map</span></a>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"-- $namespace{$_}: $_<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/sort.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">sort</span></a>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$namespace</span><span class="br0" style="color: rgb(102, 204, 102);">{</span><span class="re0" style="color: rgb(0, 0, 255);">$a</span><span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;&lt;=&gt;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$namespace</span><span class="br0" style="color: rgb(102, 204, 102);">{</span><span class="re0" style="color: rgb(0, 0, 255);">$b</span><span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;<a href="http://perldoc.perl.org/functions/keys.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">keys</span></a>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">%namespace</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; $@&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">and</span>&nbsp;<a href="http://perldoc.perl.org/functions/die.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">die</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"siteinfo: $@"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; closing_tag<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="st0" style="color: rgb(255, 0, 0);">"siteinfo"</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>;<br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">sub</span>&nbsp;pg_rv_contributor<span class="br0" style="color: rgb(102, 204, 102);">(</span>$<span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">if</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span>m|^\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*&lt;contributor deleted=<span class="st0" style="color: rgb(255, 0, 0);">"deleted"</span>\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*/&gt;\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*\n|<span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; getline;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">else</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; opening_tag&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"contributor"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">%c</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/eval.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">eval</span></a>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; simple_elt username =&gt; \<span class="re0" style="color: rgb(0, 0, 255);">%c</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; simple_elt id =&gt; \<span class="re0" style="color: rgb(0, 0, 255);">%c</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>contrib_user<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;=&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$c</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>username<span class="br0" style="color: rgb(102, 204, 102);">}</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>contrib_id<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;&nbsp; =&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$c</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>id<span class="br0" style="color: rgb(102, 204, 102);">}</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">if</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span>$@<span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; $@ =~ /^expected username element /&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;<a href="http://perldoc.perl.org/functions/die.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">die</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"contributor: $@"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/eval.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">eval</span></a>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp; simple_elt ip =&gt; \<span class="re0" style="color: rgb(0, 0, 255);">%c</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>contrib_user<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;=&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$c</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>ip<span class="br0" style="color: rgb(102, 204, 102);">}</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; $@&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">and</span>&nbsp;<a href="http://perldoc.perl.org/functions/die.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">die</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"contributor: $@"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; closing_tag&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"contributor"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">sub</span>&nbsp;pg_rv_comment<span class="br0" style="color: rgb(102, 204, 102);">(</span>$<span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">if</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span>m|^\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*&lt;comment\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*/&gt;\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*\n|<span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; getline;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">elsif</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span>m|^\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*&lt;comment deleted=<span class="st0" style="color: rgb(255, 0, 0);">"deleted"</span>\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*/&gt;\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*\n|<span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; getline;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">elsif</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span>s|^\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*<span class="re4" style="color: rgb(0, 153, 153);">&lt;comment&gt;</span><span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="br0" style="color: rgb(102, 204, 102);">[</span>^&lt;<span class="br0" style="color: rgb(102, 204, 102);">]</span>*<span class="br0" style="color: rgb(102, 204, 102);">)</span>||g<span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">while</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="nu0" style="color: rgb(204, 102, 204);">1</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>comment<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;.= $<span class="nu0" style="color: rgb(204, 102, 204);">1</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">last</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">if</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; getline;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; s|^<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="br0" style="color: rgb(102, 204, 102);">[</span>^&lt;<span class="br0" style="color: rgb(102, 204, 102);">]</span>*<span class="br0" style="color: rgb(102, 204, 102);">)</span>||;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; closing_tag&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"comment"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">else</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/return.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">return</span></a>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">sub</span>&nbsp;pg_rv_text<span class="br0" style="color: rgb(102, 204, 102);">(</span>$<span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">if</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span>m|^\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*&lt;text xml:space=<span class="st0" style="color: rgb(255, 0, 0);">"preserve"</span>\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*/&gt;\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*\n|<span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>text<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;=&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">''</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; getline;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">elsif</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span>m|^\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*&lt;text deleted=<span class="st0" style="color: rgb(255, 0, 0);">"deleted"</span>\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*/&gt;\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*\n|<span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>text<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;=&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">''</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; getline;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">elsif</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span>s|^\<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>*&lt;text xml:space=<span class="st0" style="color: rgb(255, 0, 0);">"preserve"</span>&gt;<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="br0" style="color: rgb(102, 204, 102);">[</span>^&lt;<span class="br0" style="color: rgb(102, 204, 102);">]</span>*<span class="br0" style="color: rgb(102, 204, 102);">)</span>||g<span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">while</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="nu0" style="color: rgb(204, 102, 204);">1</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>text<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;.= $<span class="nu0" style="color: rgb(204, 102, 204);">1</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">last</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">if</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; getline;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; s|^<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="br0" style="color: rgb(102, 204, 102);">[</span>^&lt;<span class="br0" style="color: rgb(102, 204, 102);">]</span>*<span class="br0" style="color: rgb(102, 204, 102);">)</span>||;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; closing_tag&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"text"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">else</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/die.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">die</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"expected text element in line $.<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$start</span>&nbsp;=&nbsp;<a href="http://perldoc.perl.org/functions/time.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">time</span></a>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">sub</span>&nbsp;stats<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$s</span>&nbsp;=&nbsp;<a href="http://perldoc.perl.org/functions/time.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">time</span></a>&nbsp;-&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$start</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$s</span>&nbsp;||=&nbsp;<span class="nu0" style="color: rgb(204, 102, 204);">1</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/printf.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">printf</span></a>&nbsp;<span class="kw2" style="font-weight: bold;">STDERR</span>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"%9d pages (%7.3f/s), %9d revisions (%7.3f/s) in %d seconds<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>,<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$cnt_page</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$cnt_page</span>/<span class="re0" style="color: rgb(0, 0, 255);">$s</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$cnt_rev</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$cnt_rev</span>/<span class="re0" style="color: rgb(0, 0, 255);">$s</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$s</span>;<br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="co1" style="color: rgb(128, 128, 128); font-style: italic;">### flush_rev($text, $rev, $page)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">sub</span>&nbsp;flush_rev<span class="br0" style="color: rgb(102, 204, 102);">(</span>$$$<span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;<a href="http://perldoc.perl.org/functions/return.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">return</span></a>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">for</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$i</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span>,<span class="nu0" style="color: rgb(204, 102, 204);">1</span>,<span class="nu0" style="color: rgb(204, 102, 204);">2</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="re0" style="color: rgb(0, 0, 255);">$i</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>&nbsp;=~&nbsp;<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>/,\n?$//;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/print.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">print</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"INSERT INTO text(old_id,old_text,old_flags) VALUES $_[0];<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>;&nbsp;<span class="co1" style="color: rgb(128, 128, 128); font-style: italic;">#Comment this to save time</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">2</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">and</span>&nbsp;<a href="http://perldoc.perl.org/functions/print.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">print</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"INSERT INTO page(page_id,page_namespace,page_title,page_restrictions,page_counter,page_is_redirect,page_is_new,page_random,page_touched,page_latest,page_len) VALUES $_[2];<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/print.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">print</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"INSERT INTO revision(rev_id,rev_page,rev_text_id,rev_comment,rev_user,rev_user_text,rev_timestamp,rev_minor_edit,rev_deleted,rev_len,rev_parent_id) VALUES $_[1];<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">for</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$i</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span>,<span class="nu0" style="color: rgb(204, 102, 204);">1</span>,<span class="nu0" style="color: rgb(204, 102, 204);">2</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="re0" style="color: rgb(0, 0, 255);">$i</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>&nbsp;=&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">''</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="co1" style="color: rgb(128, 128, 128); font-style: italic;">### flush($text, $rev, $page)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">sub</span>&nbsp;flush<span class="br0" style="color: rgb(102, 204, 102);">(</span>$$$<span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; flush_rev&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">1</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">2</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/print.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">print</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"COMMIT;<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$committed</span>&nbsp;=&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$cnt_page</span>;<br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="co1" style="color: rgb(128, 128, 128); font-style: italic;">### pg_revision(\%page, $skip, $text, $rev, $page)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">sub</span>&nbsp;pg_revision<span class="br0" style="color: rgb(102, 204, 102);">(</span>$$$$$<span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$rev</span>&nbsp;=&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><span class="br0" style="color: rgb(102, 204, 102);">}</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; opening_tag&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"revision"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/eval.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">eval</span></a>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">%revision</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; simple_elt id =&gt;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$rev</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; simple_opt_elt parentid =&gt;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$rev</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; simple_elt timestamp =&gt;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$rev</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; pg_rv_contributor&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$rev</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; simple_opt_elt minor =&gt;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$rev</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; pg_rv_comment&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$rev</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; pg_rv_text&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$rev</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; simple_opt_elt sha1 =&gt;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$rev</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; simple_opt_elt model =&gt;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$rev</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; simple_opt_elt&nbsp;<a href="http://perldoc.perl.org/functions/format.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">format</span></a>&nbsp;=&gt;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$rev</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; $@&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">and</span>&nbsp;<a href="http://perldoc.perl.org/functions/die.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">die</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"revision: $@"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; closing_tag&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"revision"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">1</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">and</span>&nbsp;<a href="http://perldoc.perl.org/functions/return.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">return</span></a>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$$rev</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>id<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;=~ /^\d+$/&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;<a href="http://perldoc.perl.org/functions/return.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">return</span></a><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/warn.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">warn</span></a><span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="st0" style="color: rgb(255, 0, 0);">"page '$_[0]{title}': ignoring bogus revision id '$$rev{id}'<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>latest_len<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;= textify&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$$rev</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>text<span class="br0" style="color: rgb(102, 204, 102);">}</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">for</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$f</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span><a href="http://perldoc.perl.org/functions/qw.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">qw</span></a><span class="br0" style="color: rgb(102, 204, 102);">(</span>comment contrib_user<span class="br0" style="color: rgb(102, 204, 102);">)</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; textify&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$$rev</span><span class="br0" style="color: rgb(102, 204, 102);">{</span><span class="re0" style="color: rgb(0, 0, 255);">$f</span><span class="br0" style="color: rgb(102, 204, 102);">}</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$$rev</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>timestamp<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;=~<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>/^<span class="br0" style="color: rgb(102, 204, 102);">(</span>\d\d\d\d<span class="br0" style="color: rgb(102, 204, 102);">)</span>-<span class="br0" style="color: rgb(102, 204, 102);">(</span>\d\d<span class="br0" style="color: rgb(102, 204, 102);">)</span>-<span class="br0" style="color: rgb(102, 204, 102);">(</span>\d\d<span class="br0" style="color: rgb(102, 204, 102);">)</span>T<span class="br0" style="color: rgb(102, 204, 102);">(</span>\d\d<span class="br0" style="color: rgb(102, 204, 102);">)</span>:<span class="br0" style="color: rgb(102, 204, 102);">(</span>\d\d<span class="br0" style="color: rgb(102, 204, 102);">)</span>:<span class="br0" style="color: rgb(102, 204, 102);">(</span>\d\d<span class="br0" style="color: rgb(102, 204, 102);">)</span>Z$/<span class="st0" style="color: rgb(255, 0, 0);">'$1$2$3$4$5$6'</span>/<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;<a href="http://perldoc.perl.org/functions/return.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">return</span></a>&nbsp;<a href="http://perldoc.perl.org/functions/warn.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">warn</span></a><span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="st0" style="color: rgb(255, 0, 0);">"page '$_[0]{title}' rev $$rev{id}: "</span>,<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"bogus timestamp '$$rev{timestamp}'<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">2</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>&nbsp;.=&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"($$rev{id},$$rev{text},'utf-8'),<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$$rev</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>minor<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;=&nbsp;<a href="http://perldoc.perl.org/functions/defined.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">defined</span></a>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$$rev</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>minor<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;?&nbsp;<span class="nu0" style="color: rgb(204, 102, 204);">1</span>&nbsp;:&nbsp;<span class="nu0" style="color: rgb(204, 102, 204);">0</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">3</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>&nbsp;.=&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"($$rev{id},$_[0]{id},$$rev{id},$$rev{comment},"</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; .<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="re0" style="color: rgb(0, 0, 255);">$$rev</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>contrib_id<span class="br0" style="color: rgb(102, 204, 102);">}</span>||<span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; .<span class="st0" style="color: rgb(255, 0, 0);">",$$rev{contrib_user},$$rev{timestamp},$$rev{minor},0,$_[0]{latest_len},$_[0]{latest}),<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>latest<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;=&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$$rev</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>id<span class="br0" style="color: rgb(102, 204, 102);">}</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>latest_start<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;=&nbsp;<a href="http://perldoc.perl.org/functions/substr.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">substr</span></a>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$$rev</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>text<span class="br0" style="color: rgb(102, 204, 102);">}</span>,&nbsp;<span class="nu0" style="color: rgb(204, 102, 204);">0</span>,&nbsp;<span class="nu0" style="color: rgb(204, 102, 204);">60</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">if</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span><a href="http://perldoc.perl.org/functions/length.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">length</span></a>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">2</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>&nbsp;&gt;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$Buffer_Size</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; flush_rev&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">2</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">3</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">4</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>do_commit<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;=&nbsp;<span class="nu0" style="color: rgb(204, 102, 204);">1</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; ++<span class="re0" style="color: rgb(0, 0, 255);">$cnt_rev</span>&nbsp;%&nbsp;<span class="nu0" style="color: rgb(204, 102, 204);">1000</span>&nbsp;==&nbsp;<span class="nu0" style="color: rgb(204, 102, 204);">0</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">and</span>&nbsp;stats;<br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="co1" style="color: rgb(128, 128, 128); font-style: italic;">### page($text, $rev, $page)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">sub</span>&nbsp;page<span class="br0" style="color: rgb(102, 204, 102);">(</span>$$$<span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; opening_tag&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"page"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">%page</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; ++<span class="re0" style="color: rgb(0, 0, 255);">$cnt_page</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/eval.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">eval</span></a>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; simple_elt title =&gt; \<span class="re0" style="color: rgb(0, 0, 255);">%page</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; simple_opt_elt ns =&gt; \<span class="re0" style="color: rgb(0, 0, 255);">%page</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; simple_elt id =&gt; \<span class="re0" style="color: rgb(0, 0, 255);">%page</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; redirect_elt \<span class="re0" style="color: rgb(0, 0, 255);">%page</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; simple_opt_elt restrictions =&gt; \<span class="re0" style="color: rgb(0, 0, 255);">%page</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$page</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>latest<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;=&nbsp;<span class="nu0" style="color: rgb(204, 102, 204);">0</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">while</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="nu0" style="color: rgb(204, 102, 204);">1</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; pg_revision \<span class="re0" style="color: rgb(0, 0, 255);">%page</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$skip</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">1</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">2</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="co1" style="color: rgb(128, 128, 128); font-style: italic;"># note: $@ is always defined</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; $@ =~ /^expected revision element /&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;<a href="http://perldoc.perl.org/functions/die.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">die</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"page: $@"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; closing_tag&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"page"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">if</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="re0" style="color: rgb(0, 0, 255);">$skip</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; --<span class="re0" style="color: rgb(0, 0, 255);">$skip</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">else</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$page</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>id<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;=~ /^\d+$/<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;<a href="http://perldoc.perl.org/functions/warn.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">warn</span></a><span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="st0" style="color: rgb(255, 0, 0);">"page '$page{title}': bogus id '$page{id}'<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$ns</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">if</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="re0" style="color: rgb(0, 0, 255);">$page</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>title<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;=~&nbsp;<a href="http://perldoc.perl.org/functions/s.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">s</span></a>/<span class="re0" style="color: rgb(0, 0, 255);">$ns_pattern</span>//o<span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$ns</span>&nbsp;=&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$namespace</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>$<span class="nu0" style="color: rgb(204, 102, 204);">1</span><span class="br0" style="color: rgb(102, 204, 102);">}</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">else</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$ns</span>&nbsp;=&nbsp;<span class="nu0" style="color: rgb(204, 102, 204);">0</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">for</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$f</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span><a href="http://perldoc.perl.org/functions/qw.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">qw</span></a><span class="br0" style="color: rgb(102, 204, 102);">(</span>title restrictions<span class="br0" style="color: rgb(102, 204, 102);">)</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; textify&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$page</span><span class="br0" style="color: rgb(102, 204, 102);">{</span><span class="re0" style="color: rgb(0, 0, 255);">$f</span><span class="br0" style="color: rgb(102, 204, 102);">}</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">if</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span>Compat<span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$page</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>redirect<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;=&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$page</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>latest_start<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;=~ /^<span class="st0" style="color: rgb(255, 0, 0);">'#(?:REDIRECT|redirect) / ?<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp; 1 : 0;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; } else {<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; $page{redirect} = $page{latest_start} =~ /^'</span><span class="co1" style="color: rgb(128, 128, 128); font-style: italic;">#REDIRECT /i ? 1 : 0;</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$page</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>title<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;=~&nbsp;<a href="http://perldoc.perl.org/functions/y.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">y</span></a>/ /_/;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">if</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span>Compat<span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">2</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>&nbsp;.=&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"($page{id},$ns,$page{title},$page{restrictions},0,"</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp; .<span class="st0" style="color: rgb(255, 0, 0);">"$page{redirect},0,RAND(),"</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span class="st0" style="color: rgb(255, 0, 0);">"DATE_ADD('1970-01-01', INTERVAL UNIX_TIMESTAMP() SECOND)+0,"</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span class="st0" style="color: rgb(255, 0, 0);">"$page{latest},$page{latest_len}),<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">else</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">2</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>&nbsp;.=&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"($page{id},$ns,$page{title},$page{restrictions},0,"</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp; .<span class="st0" style="color: rgb(255, 0, 0);">"$page{redirect},0,RAND(),NOW()+0,$page{latest},$page{latest_len}),<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">if</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="re0" style="color: rgb(0, 0, 255);">$page</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>do_commit<span class="br0" style="color: rgb(102, 204, 102);">}</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; flush&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">0</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">1</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$_</span><span class="br0" style="color: rgb(102, 204, 102);">[</span><span class="nu0" style="color: rgb(204, 102, 204);">2</span><span class="br0" style="color: rgb(102, 204, 102);">]</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/print.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">print</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"BEGIN;<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">sub</span>&nbsp;terminate<br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<a href="http://perldoc.perl.org/functions/die.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">die</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"terminated by SIG$_[0]<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>;<br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$SchemaVer</span>&nbsp;=&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">'0.8'</span>;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$SchemaLoc</span>&nbsp;=&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"http://www.mediawiki.org/xml/export-$SchemaVer/"</span>;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$Schema</span>&nbsp;&nbsp; &nbsp;=&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"http://www.mediawiki.org/xml/export-$SchemaVer.xsd"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$help</span>;<br style="clear: none; line-height: 0.9em;" />
	GetOptions<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="st0" style="color: rgb(255, 0, 0);">"skip=i"</span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; \<span class="re0" style="color: rgb(0, 0, 255);">$skip</span>,<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"help"</span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; \<span class="re0" style="color: rgb(0, 0, 255);">$help</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;pod2usage<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="nu0" style="color: rgb(204, 102, 204);">2</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>;<br style="clear: none; line-height: 0.9em;" />
	<span class="re0" style="color: rgb(0, 0, 255);">$help</span>&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">and</span>&nbsp;pod2usage<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="nu0" style="color: rgb(204, 102, 204);">1</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	getline;<br style="clear: none; line-height: 0.9em;" />
	m|^&lt;mediawiki \Qxmlns=<span class="st0" style="color: rgb(255, 0, 0);">"$SchemaLoc"</span>&nbsp;xmlns:xsi=<span class="st0" style="color: rgb(255, 0, 0);">"http://www.w3.org/2001/XMLSchema-instance"</span>&nbsp;xsi:schemaLocation=<span class="st0" style="color: rgb(255, 0, 0);">"$SchemaLoc $Schema"</span>&nbsp;version=<span class="st0" style="color: rgb(255, 0, 0);">"$SchemaVer"</span>\E xml:lang=<span class="st0" style="color: rgb(255, 0, 0);">".."</span>&gt;$|<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;<a href="http://perldoc.perl.org/functions/die.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">die</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"unknown schema or invalid first line<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>;<br style="clear: none; line-height: 0.9em;" />
	getline;<br style="clear: none; line-height: 0.9em;" />
	<span class="re0" style="color: rgb(0, 0, 255);">$SIG</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>TERM<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;=&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$SIG</span><span class="br0" style="color: rgb(102, 204, 102);">{</span>INT<span class="br0" style="color: rgb(102, 204, 102);">}</span>&nbsp;= \&amp;terminate;<br style="clear: none; line-height: 0.9em;" />
	siteinfo;<br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">my</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="re0" style="color: rgb(0, 0, 255);">$text</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$rev</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$page</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;=&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="st0" style="color: rgb(255, 0, 0);">''</span>,&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">''</span>,&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">''</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>;<br style="clear: none; line-height: 0.9em;" />
	<a href="http://perldoc.perl.org/functions/eval.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">eval</span></a>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">while</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">(</span><span class="nu0" style="color: rgb(204, 102, 204);">1</span><span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">{</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; page&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$text</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$rev</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$page</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">}</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">}</span>;<br style="clear: none; line-height: 0.9em;" />
	$@ =~ /^expected page element /&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;<a href="http://perldoc.perl.org/functions/die.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">die</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"$@ (committed $committed pages)<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>;<br style="clear: none; line-height: 0.9em;" />
	flush&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$text</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$rev</span>,&nbsp;<span class="re0" style="color: rgb(0, 0, 255);">$page</span>;<br style="clear: none; line-height: 0.9em;" />
	stats;<br style="clear: none; line-height: 0.9em;" />
	m|&lt;/mediawiki&gt;|&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;<a href="http://perldoc.perl.org/functions/die.html" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;"><span class="kw3" style="color: rgb(0, 0, 102);">die</span></a>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"mediawiki: expected closing tag in line $.<span class="es0" style="color: rgb(0, 0, 153); font-weight: bold;">\n</span>"</span>;<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	=head1 COPYRIGHT<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	Copyright&nbsp;<span class="nu0" style="color: rgb(204, 102, 204);">2007</span>&nbsp;by Robert Bihlmeyer<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	This program is free software; you can redistribute it&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">and</span>/<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;modify<br style="clear: none; line-height: 0.9em;" />
	it under the terms of the GNU General Public License as published by<br style="clear: none; line-height: 0.9em;" />
	the Free Software Foundation; either version&nbsp;<span class="nu0" style="color: rgb(204, 102, 204);">2</span>&nbsp;of the License,&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span><br style="clear: none; line-height: 0.9em;" />
	<span class="br0" style="color: rgb(102, 204, 102);">(</span>at your option<span class="br0" style="color: rgb(102, 204, 102);">)</span>&nbsp;any later version.<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	You may also redistribute&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">and</span>/<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;modify this software under the terms<br style="clear: none; line-height: 0.9em;" />
	of the GNU Free Documentation License without invariant sections,&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">and</span><br style="clear: none; line-height: 0.9em;" />
	without front-cover&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;back-cover texts.<br style="clear: none; line-height: 0.9em;" />
	&nbsp;<br style="clear: none; line-height: 0.9em;" />
	This program is distributed in the hope that it will be useful,<br style="clear: none; line-height: 0.9em;" />
	but WITHOUT ANY WARRANTY; without even the implied warranty of<br style="clear: none; line-height: 0.9em;" />
	MERCHANTABILITY&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">or</span>&nbsp;FITNESS FOR A PARTICULAR PURPOSE. &nbsp;See the<br style="clear: none; line-height: 0.9em;" />
	GNU General Public License&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">for</span>&nbsp;more details.</div>

<p>
	&nbsp;</p>

<form action="http://tsikerdekis.wuwcorp.com/WikipediaDumpstoMysql/grabcode" id="form_61092f4ded_6" method="post" style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<input class="grabcode" name="save" style="border-width: 1px; border-style: solid; border-color: rgb(239, 239, 239) rgb(170, 170, 204) rgb(170, 170, 204) rgb(238, 238, 255); color: rgb(51, 51, 102); font-stretch: normal; font-size: 10.0799999237061px; font-family: Verdana, sans-serif; padding-right: 0.2em; padding-left: 0.2em; line-height: 1em; float: right; background-color: rgb(208, 224, 240);" title="Download" type="submit" value="Grab" />&nbsp;</form>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">adddb.sh - You will need to change the urll variable to the url that you will be using. Wikipedia releases some files under bz2 compression and other files under 7z. I left a line commented in this script that you need to enable in case your files are bz2 and not 7z (don't forget to comment the line underneath that that deals with 7z). Finally, you will need to add your mysql username password and database.</span></p>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<div class="code" style="border: 1px solid rgb(170, 170, 204); font-size: 11px; font-family: monospace; margin: auto; padding: 6px 5px 13px; overflow: auto; white-space: nowrap; line-height: 23.0399990081787px; background: rgb(243, 243, 255);">
	!/bin/bash<br style="clear: none; line-height: 0.9em;" />
	<span class="re2" style="color: rgb(0, 0, 255);">urll=</span><span class="st0" style="color: rgb(255, 0, 0);">'http://dumps.wikimedia.org/enwiki/20130102/'</span><br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">for</span>&nbsp;i&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">in</span>&nbsp;$<span class="br0" style="color: rgb(102, 204, 102);">(</span>&nbsp;<span class="kw2" style="font-weight: bold;">cat</span>&nbsp;filelist.txt&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">)</span>;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">do</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="kw3" style="color: rgb(0, 0, 102);">echo</span>&nbsp;retrieving:&nbsp;<span class="re1" style="color: rgb(0, 0, 255);">$i</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="kw2" style="font-weight: bold;">wget</span>&nbsp;<span class="re1" style="color: rgb(0, 0, 255);">$urll</span><span class="re1" style="color: rgb(0, 0, 255);">$i</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="kw3" style="color: rgb(0, 0, 102);">echo</span>&nbsp;mwimport:&nbsp;<span class="re1" style="color: rgb(0, 0, 255);">$i</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="re3">#bzcat&nbsp;<span class="re1" style="color: rgb(0, 0, 255);">$i</span>&nbsp;|&nbsp;<span class="kw2" style="font-weight: bold;">perl</span>&nbsp;mwimport.pl &gt; temp.sql</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp; 7za e -so&nbsp;<span class="re1" style="color: rgb(0, 0, 255);">$i</span>&nbsp;|perl mwimport.pl &gt; temp.sql<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="re2" style="color: rgb(0, 0, 255);">result=</span>$<span class="br0" style="color: rgb(102, 204, 102);">(</span>&nbsp;<span class="kw2" style="font-weight: bold;">tail</span>&nbsp;temp.sql -n1&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">)</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="re2" style="color: rgb(0, 0, 255);">result1=</span><span class="st0" style="color: rgb(255, 0, 0);">'COMMIT;'</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="kw3" style="color: rgb(0, 0, 102);">echo</span>&nbsp;checking...<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="kw3" style="color: rgb(0, 0, 102);">echo</span>&nbsp;<span class="re1" style="color: rgb(0, 0, 255);">$result</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">if</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">[</span>&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"$result"</span>&nbsp;=&nbsp;<span class="st0" style="color: rgb(255, 0, 0);">"$result1"</span>&nbsp;<span class="br0" style="color: rgb(102, 204, 102);">]</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">then</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="kw3" style="color: rgb(0, 0, 102);">echo</span>&nbsp;OKAY:&nbsp;<span class="re1" style="color: rgb(0, 0, 255);">$i</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="kw2" style="font-weight: bold;">rm</span>&nbsp;<span class="re1" style="color: rgb(0, 0, 255);">$i</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="kw2" style="font-weight: bold;">cat</span>&nbsp;preimport.sql temp.sql postimport.sql | mysql -f -u &lt;USER IN MYSQL&gt; -p&lt;PASSWORD&gt; --<span class="re2" style="color: rgb(0, 0, 255);">database=</span>&lt;MEDIAWIKI DB&gt;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="kw2" style="font-weight: bold;">rm</span>&nbsp;temp.sql<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">else</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="kw3" style="color: rgb(0, 0, 102);">echo</span>&nbsp;FAIL:&nbsp;<span class="re1" style="color: rgb(0, 0, 255);">$i</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="kw3" style="color: rgb(0, 0, 102);">exit</span><br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="kw1" style="color: rgb(177, 177, 0);">fi</span><br style="clear: none; line-height: 0.9em;" />
	<span class="kw1" style="color: rgb(177, 177, 0);">done</span></div>

<p>
	&nbsp;</p>

<form action="http://tsikerdekis.wuwcorp.com/WikipediaDumpstoMysql/grabcode" id="form_61092f4ded_7" method="post" style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<input class="grabcode" name="save" style="border-width: 1px; border-style: solid; border-color: rgb(239, 239, 239) rgb(170, 170, 204) rgb(170, 170, 204) rgb(238, 238, 255); color: rgb(51, 51, 102); font-stretch: normal; font-size: 10.0799999237061px; font-family: Verdana, sans-serif; padding-right: 0.2em; padding-left: 0.2em; line-height: 1em; float: right; background-color: rgb(208, 224, 240);" title="Download" type="submit" value="Grab" />&nbsp;</form>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<h2 id="hn_Step_4:_Run_sh_adddb.sh" style="font-weight: 300; font-stretch: normal; font-size: 15pt; line-height: 18pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; margin: 0pt; color: rgb(153, 51, 85); padding-top: 10px; padding-bottom: 10px; text-shadow: rgb(238, 238, 238) 1px 1px 0px; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/WikipediaDumpstoMysql#hn_Step_4:_Run_sh_adddb.sh" style="font-size: 15pt; line-height: 18pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 10px; padding-bottom: 10px; background-color: transparent;">Step 4: Run "sh adddb.sh"</a></h2>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">The script will start retrieving the first file in filelist.txt, extract it and process it using mwimport.pl, check on whether the extraction is successful and finally add the information to the database. After that, it will delete the file and carry on with the second file in filelist.txt all the way to the end.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">You will need to do this preferably under a screen. If you don't have it installed:</span></p>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<div class="code" style="border: 1px solid rgb(170, 170, 204); font-size: 11px; font-family: monospace; margin: auto; padding: 6px 5px 13px; overflow: auto; white-space: nowrap; line-height: 23.0399990081787px; background: rgb(243, 243, 255);">
	<span class="kw2" style="font-weight: bold;">sudo</span>&nbsp;aptitude&nbsp;<span class="kw2" style="font-weight: bold;">install</span>&nbsp;screen<br style="clear: none; line-height: 0.9em;" />
	screen -t Restoringwiki<br style="clear: none; line-height: 0.9em;" />
	<span class="kw2" style="font-weight: bold;">sh</span>&nbsp;adddb.<span class="kw2" style="font-weight: bold;">sh</span></div>

<p>
	&nbsp;</p>

<p>
	&nbsp;</p>

<form action="http://tsikerdekis.wuwcorp.com/WikipediaDumpstoMysql/grabcode" id="form_61092f4ded_8" method="post" style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<input class="grabcode" name="save" style="border-width: 1px; border-style: solid; border-color: rgb(239, 239, 239) rgb(170, 170, 204) rgb(170, 170, 204) rgb(238, 238, 255); color: rgb(51, 51, 102); font-stretch: normal; font-size: 10.0799999237061px; font-family: Verdana, sans-serif; padding-right: 0.2em; padding-left: 0.2em; line-height: 1em; float: right; background-color: rgb(208, 224, 240);" title="Download" type="submit" value="Grab" />&nbsp;</form>

<p>
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">Ctrl+A+D will detach the screen. It's still active in the background. To view the progress you can enter that screen again by using "screen -r " and hit tab to get the number of the screen automatically.</span></p>]]></content><author><name>Michael Tsikerdekis</name><email>Michael.Tsikerdekis@wwu.edu</email><uri>http://michael.tsikerdekis.com</uri></author><summary type="html"><![CDATA[It can be quite frustrating adding Wikipedia Dumps in a local database. For some Wikipedias, such as the English Wikipedia, it takes a long time. This is a collection of scripts I've used to import Wikipedia dumps in Mysql. Note: This guide is based on an Ubuntu server setup Warning: The restoring process is likely to take weeks for large Wikipedias such as the English Wikipedia]]></summary></entry><entry><title type="html">Bayes Factor</title><link href="https://michael.tsikerdekis.com/2012/07/14/BayesFactor/" rel="alternate" type="text/html" title="Bayes Factor" /><published>2012-07-14T00:00:00-07:00</published><updated>2012-07-14T00:00:00-07:00</updated><id>https://michael.tsikerdekis.com/2012/07/14/BayesFactor</id><content type="html" xml:base="https://michael.tsikerdekis.com/2012/07/14/BayesFactor/"><![CDATA[<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">Contrary to NHST where you have a p value along with the effect size to determine whether there is an effect and how big is it, Bayes factor answers both of these questions. In other words, one simple result determines which hypothesis is asserted and by how much according to your data.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">You determine which hypothesis is more likely given the data based on the Bayes Factor. The way to interpret a general Bayes Factor is the following. If a Bayes factor is denoted as BFxy then you say that the data are n times more likely under Hx than Hy. An example based on the BF10 would be that the data would be 0.53 times more likely under H1 than H0. If we use the BF01 then we would say that the data are 1.87 times more likely under H0 than H1(which is more meaningful). Basically, one version of Bayes factor(e.g. BF01) is the inverted version of the other(e.g BF10). Pick the version of Bayes factor that is above 1.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	&nbsp;</p>

<h2 id="hn_Interpreting_a_Bayes_Factor" style="font-weight: 300; font-stretch: normal; font-size: 15pt; line-height: 18pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; margin: 0pt; color: rgb(153, 51, 85); padding-top: 10px; padding-bottom: 10px; text-shadow: rgb(238, 238, 238) 1px 1px 0px; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/BayesFactor#hn_Interpreting_a_Bayes_Factor" style="font-size: 15pt; line-height: 18pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 10px; padding-bottom: 10px; background-color: transparent;">Interpreting a Bayes Factor</a></h2>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">There is a scale used to determine how strong is the evidence presented by the Bayes factor. The scale was developed by Harold Jeffreys in his book "Theory of probability" (H. Jeffreys (1961). The Theory of Probability (3 ed.). Oxford. p. 432).</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	&nbsp;</p>

<table class="data" style="border-width: 2px; border-color: rgb(204, 204, 204); color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<tbody>
		<tr>
			<th style="border-color: rgb(204, 204, 204); padding: 0.1em 0.25em; background-color: rgb(238, 238, 238);">
				Bayes Factor</th>
			<th style="border-color: rgb(204, 204, 204); padding: 0.1em 0.25em; background-color: rgb(238, 238, 238);">
				Strength of Evidence</th>
		</tr>
		<tr>
			<td style="border-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				&lt; 1:1</td>
			<td style="border-top-style: solid; border-bottom-style: solid; border-left-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				Negative (Supports the opposite model)</td>
		</tr>
		<tr>
			<td style="border-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				1:1 to 3:1</td>
			<td style="border-top-style: solid; border-bottom-style: solid; border-left-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				Barely worth mentioning</td>
		</tr>
		<tr>
			<td style="border-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				3:1 to 10:1</td>
			<td style="border-top-style: solid; border-bottom-style: solid; border-left-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				Substantial</td>
		</tr>
		<tr>
			<td style="border-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				10:1 to 30:1</td>
			<td style="border-top-style: solid; border-bottom-style: solid; border-left-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				Strong</td>
		</tr>
		<tr>
			<td style="border-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				30:1 to 100:1</td>
			<td style="border-top-style: solid; border-bottom-style: solid; border-left-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				Very strong</td>
		</tr>
		<tr>
			<td style="border-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				&gt; 100:1</td>
			<td style="border-top-style: solid; border-bottom-style: solid; border-left-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				Decisive<br />
				&nbsp;</td>
		</tr>
	</tbody>
</table>

<p>
	&nbsp;</p>]]></content><author><name>Michael Tsikerdekis</name><email>Michael.Tsikerdekis@wwu.edu</email><uri>http://michael.tsikerdekis.com</uri></author><summary type="html"><![CDATA[Contrary to NHST where you have a p value along with the effect size to determine whether there is an effect and how big is it, Bayes factor answers both of these questions. In other words, one simple result determines which hypothesis is asserted and by how much according to your data. You determine which hypothesis is more likely given the data based on the Bayes Factor. The way to interpret a general Bayes Factor is the following. If a Bayes factor is denoted as BFxy then you say that the data are n times more likely under Hx than Hy. An example based on the BF10 would be that the data would be 0.53 times more likely under H1 than H0. If we use the BF01 then we would say that the data are 1.87 times more likely under H0 than H1(which is more meaningful). Basically, one version of Bayes factor(e.g. BF01) is the inverted version of the other(e.g BF10). Pick the version of Bayes factor that is above 1. &nbsp;]]></summary></entry><entry><title type="html">Bayesian Test of Independence</title><link href="https://michael.tsikerdekis.com/2012/07/14/independencetest/" rel="alternate" type="text/html" title="Bayesian Test of Independence" /><published>2012-07-14T00:00:00-07:00</published><updated>2012-07-14T00:00:00-07:00</updated><id>https://michael.tsikerdekis.com/2012/07/14/independencetest</id><content type="html" xml:base="https://michael.tsikerdekis.com/2012/07/14/independencetest/"><![CDATA[<h1 id="hn_Bayesian_Test_of_Independence" style="font-weight: 300; font-stretch: normal; font-size: 18pt; line-height: 19pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; margin: 0pt; color: rgb(153, 51, 85); padding-bottom: 5px; border-style: none; text-shadow: rgb(221, 221, 221) 1px 1px 0px; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/BayesianTestofIndependence#hn_Introduction" style="font-size: 15pt; line-height: 18pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 10px; padding-bottom: 10px; background-color: transparent;">Introduction</a></h1>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">The following test behaves alot like the chi-square test of independence. It can work with ordinal, categorical and even dichotomous variables (any case that can give you a contingency table).</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	&nbsp;</p>

<h2 id="hn_References" style="font-weight: 300; font-stretch: normal; font-size: 15pt; line-height: 18pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; margin: 0pt; color: rgb(153, 51, 85); padding-top: 10px; padding-bottom: 10px; text-shadow: rgb(238, 238, 238) 1px 1px 0px; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/BayesianTestofIndependence#hn_References" style="font-size: 15pt; line-height: 18pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 10px; padding-bottom: 10px; background-color: transparent;">References</a></h2>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">This method is based on the book "</span><a class="ext" href="http://bayes.bgsu.edu/bcwr/" style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; text-align: justify;" target="\&quot;_new\&quot;">Bayesian Computation With R</a><span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">" by Jim Albert. If you want to learn more about the model and the code you can read the book or the article.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">For the procedure you need R and the&nbsp;</span><a href="http://tsikerdekis.wuwcorp.com/LearnBayes" style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; text-align: justify;">LearnBayes</a><span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">&nbsp;package that can be installed in R using the command</span><em style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; color: rgb(68, 68, 68); font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">install.packages('<a href="http://tsikerdekis.wuwcorp.com/LearnBayes" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;">LearnBayes</a>')</em><span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	&nbsp;</p>

<h2 id="hn_Procedure_Highlights" style="font-weight: 300; font-stretch: normal; font-size: 15pt; line-height: 18pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; margin: 0pt; color: rgb(153, 51, 85); padding-top: 10px; padding-bottom: 10px; text-shadow: rgb(238, 238, 238) 1px 1px 0px; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/BayesianTestofIndependence#hn_Procedure_Highlights" style="font-size: 15pt; line-height: 18pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 10px; padding-bottom: 10px; background-color: transparent;">Procedure Highlights</a></h2>

<h3 id="hn_Input" style="font-stretch: normal; font-size: 12pt; line-height: 15pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; font-weight: 300; margin: 0pt; color: rgb(170, 170, 170); padding-top: 5px; padding-bottom: 5px; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/BayesianTestofIndependence#hn_Input" style="font-size: 12pt; line-height: 15pt; width: auto; color: rgb(170, 170, 170); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 5px; padding-bottom: 5px; background-color: transparent;">Input</a></h3>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">You need to type the data for your contingency table or feed it to your tabledata variable. Additionally, you need to specify the rows and columns for your table.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	&nbsp;</p>

<div class="code" style="border: 1px solid rgb(170, 170, 204); font-size: 11px; font-family: monospace; margin: auto; padding: 6px 5px 13px; overflow: auto; white-space: nowrap; line-height: 23.0399990081787px; background: rgb(243, 243, 255);">
	#---------------INPUT DATA------------------<br style="clear: none; line-height: 0.9em;" />
	tabledata = c(6,9,40,34) # Enter data first row by row and then column by column<br style="clear: none; line-height: 0.9em;" />
	tablerows = 3 # rows in the contigency table<br style="clear: none; line-height: 0.9em;" />
	tablecolumns = 4 # columns in the contigency table<br style="clear: none; line-height: 0.9em;" />
	#-------------------------------------------</div>

<form action="http://tsikerdekis.wuwcorp.com/BayesianTestofIndependence/grabcode" id="form_61092f4ded" method="post" style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<input class="grabcode" name="save" style="border-width: 1px; border-style: solid; border-color: rgb(239, 239, 239) rgb(170, 170, 204) rgb(170, 170, 204) rgb(238, 238, 255); color: rgb(51, 51, 102); font-stretch: normal; font-size: 10.0799999237061px; font-family: Verdana, sans-serif; padding-right: 0.2em; padding-left: 0.2em; line-height: 1em; float: right; background-color: rgb(208, 224, 240);" title="Download" type="submit" value="Grab" />&nbsp;</form>

<p>
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">The hypotheses are:</span></p>

<ul style="list-style-image: url(http://tsikerdekis.wuwcorp.com/templates/modified1/images/sqw.gif); margin-top: 0px; margin-bottom: 0px; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<li style="margin: 0.5em;">
		H0: There is no dependency between the two variables</li>
	<li style="margin: 0.5em;">
		H1: There is a dependency between the two variables</li>
	<li style="margin: 0.5em;">
		H~0: There is almost no dependency. This hypothesis tests for a model close to independence.</li>
</ul>

<p>
	&nbsp;</p>

<h3 id="hn_Output" style="font-stretch: normal; font-size: 12pt; line-height: 15pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; font-weight: 300; margin: 0pt; color: rgb(170, 170, 170); padding-top: 5px; padding-bottom: 5px; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/BayesianTestofIndependence#hn_Output" style="font-size: 12pt; line-height: 15pt; width: auto; color: rgb(170, 170, 170); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 5px; padding-bottom: 5px; background-color: transparent;">Output</a></h3>

<div class="code" style="border: 1px solid rgb(170, 170, 204); font-size: 11px; font-family: monospace; margin: auto; padding: 6px 5px 13px; overflow: auto; white-space: nowrap; line-height: 23.0399990081787px; background: rgb(243, 243, 255);">
	Your table:&nbsp;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;[,1] [,2]<br style="clear: none; line-height: 0.9em;" />
	[1,] &nbsp; &nbsp;6 &nbsp; 40<br style="clear: none; line-height: 0.9em;" />
	[2,] &nbsp; &nbsp;9 &nbsp; 34<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	The uniform table to be compared with your table:&nbsp;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;[,1] [,2]<br style="clear: none; line-height: 0.9em;" />
	[1,] &nbsp; &nbsp;1 &nbsp; &nbsp;1<br style="clear: none; line-height: 0.9em;" />
	[2,] &nbsp; &nbsp;1 &nbsp; &nbsp;1<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	-----------Results--------------<br style="clear: none; line-height: 0.9em;" />
	Bayes Factor(BF10) for H1 Dependence over H0 Independence: &nbsp;0.4660114&nbsp;<br style="clear: none; line-height: 0.9em;" />
	Bayes Factor(BF01) for H0 Independence over H1 Dependence: &nbsp;2.14587&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	-----------Additional Model Results--------------<br style="clear: none; line-height: 0.9em;" />
	Bayes factor in support of the model close to independence versus the model of independence:<br style="clear: none; line-height: 0.9em;" />
	&nbsp; log.K log.BF &nbsp; BF<br style="clear: none; line-height: 0.9em;" />
	1 &nbsp; &nbsp; 2 &nbsp;-1.76 0.17<br style="clear: none; line-height: 0.9em;" />
	2 &nbsp; &nbsp; 3 &nbsp;-0.50 0.61<br style="clear: none; line-height: 0.9em;" />
	3 &nbsp; &nbsp; 4 &nbsp;-0.25 0.78<br style="clear: none; line-height: 0.9em;" />
	4 &nbsp; &nbsp; 5 &nbsp;-0.07 0.93<br style="clear: none; line-height: 0.9em;" />
	5 &nbsp; &nbsp; 6 &nbsp;-0.02 0.98<br style="clear: none; line-height: 0.9em;" />
	6 &nbsp; &nbsp; 7 &nbsp; 0.00 1.00<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	-------Results--------------<br style="clear: none; line-height: 0.9em;" />
	Bayes Factor(BF10) for H~0 Close to Independence over H0 Independence: &nbsp;0.9954232&nbsp;<br style="clear: none; line-height: 0.9em;" />
	Bayes Factor(BF01) for H0 Independence over H~0 Close to Independence: &nbsp;1.004598</div>

<form action="http://tsikerdekis.wuwcorp.com/BayesianTestofIndependence/grabcode" id="form_61092f4ded_1" method="post" style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<input class="grabcode" name="save" style="border-width: 1px; border-style: solid; border-color: rgb(239, 239, 239) rgb(170, 170, 204) rgb(170, 170, 204) rgb(238, 238, 255); color: rgb(51, 51, 102); font-stretch: normal; font-size: 10.0799999237061px; font-family: Verdana, sans-serif; padding-right: 0.2em; padding-left: 0.2em; line-height: 1em; float: right; background-color: rgb(208, 224, 240);" title="Download" type="submit" value="Grab" />&nbsp;</form>

<p>
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">You need to always verify that your table looks the way that it should. The code is still a bit buggy and sometimes rows get changed for columns. In case your table looks the opposite way, just change the numbers between rows and columns.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">The code performs two analyses. The first, tests the independence hypothesis against the dependence hypothesis. The second analysis tests the hypothesis of Independence against the hypothesis close to independence.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span class="underline" style="text-decoration: underline; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">Read the&nbsp;<a href="http://tsikerdekis.wuwcorp.com/BayesFactor" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;">Bayes Factor</a>&nbsp;page for how you should interpret these results.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">In this example, H0 is 2.14 times more likely than H1. The evidence is not really strong however. Additionally, the second test failed to provide support for a model close to independence.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	&nbsp;</p>

<h2 id="hn_Code" style="font-weight: 300; font-stretch: normal; font-size: 15pt; line-height: 18pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; margin: 0pt; color: rgb(153, 51, 85); padding-top: 10px; padding-bottom: 10px; text-shadow: rgb(238, 238, 238) 1px 1px 0px; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/BayesianTestofIndependence#hn_Code" style="font-size: 15pt; line-height: 18pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 10px; padding-bottom: 10px; background-color: transparent;">Code</a></h2>

<div class="code" style="border: 1px solid rgb(170, 170, 204); font-size: 11px; font-family: monospace; margin: auto; padding: 6px 5px 13px; overflow: auto; white-space: nowrap; line-height: 23.0399990081787px; background: rgb(243, 243, 255);">
	# clears workspace: &nbsp;<br style="clear: none; line-height: 0.9em;" />
	rm(list=ls(all=TRUE))<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	#---------------INPUT DATA------------------<br style="clear: none; line-height: 0.9em;" />
	tabledata = c(6,9,40,34) # Enter data first row by row and then column by column<br style="clear: none; line-height: 0.9em;" />
	tablerows = 2 # rows in the contigency table<br style="clear: none; line-height: 0.9em;" />
	tablecolumns = 2 # columns in the contigency table<br style="clear: none; line-height: 0.9em;" />
	#-------------------------------------------<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	library(LearnBayes)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	tablesize = c(tablecolumns,tablerows)<br style="clear: none; line-height: 0.9em;" />
	data=matrix(tabledata,tablesize)<br style="clear: none; line-height: 0.9em;" />
	cat("\r\nYour table: \r\n")<br style="clear: none; line-height: 0.9em;" />
	print(data)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	#chisq.test(data)<br style="clear: none; line-height: 0.9em;" />
	#fisher.test(data)<br style="clear: none; line-height: 0.9em;" />
	totalrowscolumns = tablerows * tablecolumns<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	a=matrix(rep(1,totalrowscolumns),tablesize)<br style="clear: none; line-height: 0.9em;" />
	cat("\r\nThe uniform table to be compared with your table: \r\n")<br style="clear: none; line-height: 0.9em;" />
	print(a)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	BF10 = ctable(data,a) #BF in support of the dependence hypothesis<br style="clear: none; line-height: 0.9em;" />
	BF01 = &nbsp;1 /BF10<br style="clear: none; line-height: 0.9em;" />
	cat("\r\n-----------Results--------------\r\n")<br style="clear: none; line-height: 0.9em;" />
	cat("Bayes Factor(BF10) for H1 Dependence over H0 Independence: ",BF10,"\r\n")<br style="clear: none; line-height: 0.9em;" />
	cat("Bayes Factor(BF01) for H0 Independence over H1 Dependence: ",BF01,"\r\n")<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	log.K=seq(2,7)<br style="clear: none; line-height: 0.9em;" />
	compute.log.BF=function(log.K)<br style="clear: none; line-height: 0.9em;" />
	&nbsp; log(bfindep(data,exp(log.K),100000)$bf)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	log.BF=sapply(log.K,compute.log.BF)<br style="clear: none; line-height: 0.9em;" />
	BF=exp(log.BF)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	#BF in support of the alternative model close to independence<br style="clear: none; line-height: 0.9em;" />
	#Bayes factor against independence assuming alternatives close to independence<br style="clear: none; line-height: 0.9em;" />
	cat("\r\n-----------Additional Model Results--------------\r\n")<br style="clear: none; line-height: 0.9em;" />
	cat("Bayes factor in support of the model close to independence versus the model of independence:\r\n")<br style="clear: none; line-height: 0.9em;" />
	print(round(data.frame(log.K,log.BF,BF),2))<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	#Plotting<br style="clear: none; line-height: 0.9em;" />
	plot(log.K,log.BF)<br style="clear: none; line-height: 0.9em;" />
	lines(log.K,log.BF)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	cat("\r\n-----------Results--------------\r\n")<br style="clear: none; line-height: 0.9em;" />
	cat("Bayes Factor(BF~00) for H~0 Close to Independence over H0 Independence: ",max(BF),"\r\n")<br style="clear: none; line-height: 0.9em;" />
	cat("Bayes Factor(BF0~0) for H0 Independence over H~0 Close to Independence: ",1/max(BF),"\r\n")</div>

<form action="http://tsikerdekis.wuwcorp.com/BayesianTestofIndependence/grabcode" id="form_61092f4ded_2" method="post" style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<input class="grabcode" name="save" style="border-width: 1px; border-style: solid; border-color: rgb(239, 239, 239) rgb(170, 170, 204) rgb(170, 170, 204) rgb(238, 238, 255); color: rgb(51, 51, 102); font-stretch: normal; font-size: 10.0799999237061px; font-family: Verdana, sans-serif; padding-right: 0.2em; padding-left: 0.2em; line-height: 1em; float: right; background-color: rgb(208, 224, 240);" title="Download" type="submit" value="Grab" />&nbsp;</form>

<p>
	&nbsp;</p>]]></content><author><name>Michael Tsikerdekis</name><email>Michael.Tsikerdekis@wwu.edu</email><uri>http://michael.tsikerdekis.com</uri></author><summary type="html"><![CDATA[Introduction]]></summary></entry><entry><title type="html">Bayesian t-test hypothesis testing for two independent groups</title><link href="https://michael.tsikerdekis.com/2012/07/14/ttest/" rel="alternate" type="text/html" title="Bayesian t-test hypothesis testing for two independent groups" /><published>2012-07-14T00:00:00-07:00</published><updated>2012-07-14T00:00:00-07:00</updated><id>https://michael.tsikerdekis.com/2012/07/14/ttest</id><content type="html" xml:base="https://michael.tsikerdekis.com/2012/07/14/ttest/"><![CDATA[<h2 id="hn_Introduction" style="font-weight: 300; font-stretch: normal; font-size: 15pt; line-height: 18pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; margin: 0pt; color: rgb(153, 51, 85); padding-top: 10px; padding-bottom: 10px; text-shadow: rgb(238, 238, 238) 1px 1px 0px; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/BayesianttestTwoIndependentGroups#hn_Introduction" style="font-size: 15pt; line-height: 18pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 10px; padding-bottom: 10px; background-color: transparent;">Introduction</a></h2>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">This method can be used in the same circumstances that one would use the regular independent t-test; when you want to statistically compare the means of two groups. Both groups should have their data normally distributed.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	&nbsp;</p>

<h2 id="hn_References" style="font-weight: 300; font-stretch: normal; font-size: 15pt; line-height: 18pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; margin: 0pt; color: rgb(153, 51, 85); padding-top: 10px; padding-bottom: 10px; text-shadow: rgb(238, 238, 238) 1px 1px 0px; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/BayesianttestTwoIndependentGroups#hn_References" style="font-size: 15pt; line-height: 18pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 10px; padding-bottom: 10px; background-color: transparent;">References</a></h2>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">This method is based on the book "</span><a class="ext" href="http://www.ejwagenmakers.com/BayesCourse/BayesBook.html" style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; text-align: justify;" target="\&quot;_new\&quot;">A Practical Course in Bayesian Graphical Modeling</a><span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">" by Michael Lee and Eric-Jan Wagenmakers. Additionally, a published scientific article can be found&nbsp;</span><a class="ext" href="http://www.ruudwetzels.com/articles/Wetzelsetal2009_SDtest.pdf" style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; text-align: justify;" target="\&quot;_new\&quot;">here</a><span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">. Either or both are good to cite when using this method. Some of the code may has been changed in order to make the application of the analysis easier. If you want to learn more about the model and the code you can read the book or the article.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">For the procedure you need R and Openbugs.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	&nbsp;</p>

<h2 id="hn_Procedure_highlights" style="font-weight: 300; font-stretch: normal; font-size: 15pt; line-height: 18pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; margin: 0pt; color: rgb(153, 51, 85); padding-top: 10px; padding-bottom: 10px; text-shadow: rgb(238, 238, 238) 1px 1px 0px; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/BayesianttestTwoIndependentGroups#hn_Procedure_highlights" style="font-size: 15pt; line-height: 18pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 10px; padding-bottom: 10px; background-color: transparent;">Procedure highlights</a></h2>

<h3 id="hn_Input" style="font-stretch: normal; font-size: 12pt; line-height: 15pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; font-weight: 300; margin: 0pt; color: rgb(170, 170, 170); padding-top: 5px; padding-bottom: 5px; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/BayesianttestTwoIndependentGroups#hn_Input" style="font-size: 12pt; line-height: 15pt; width: auto; color: rgb(170, 170, 170); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 5px; padding-bottom: 5px; background-color: transparent;">Input</a></h3>

<div class="code" style="border: 1px solid rgb(170, 170, 204); font-size: 11px; font-family: monospace; margin: auto; padding: 6px 5px 13px; overflow: auto; white-space: nowrap; line-height: 23.0399990081787px; background: rgb(243, 243, 255);">
	setwd("/the/directory/for/both/of/your/files/") #this will help the program find the location of the model<br style="clear: none; line-height: 0.9em;" />
	group1 = c(49,13,50,64,21,23,15,7,32,8,17,15,19,16,33) #your set of values for group 1<br style="clear: none; line-height: 0.9em;" />
	group2 = c(41,20,53,41,20,44,31,24,24,44,15,35,32,25,35) #your set of values for group 2<br style="clear: none; line-height: 0.9em;" />
	openbugsmodel = "Ttest_2.txt" #specify the location for the file that contains the OpenBugs code<br style="clear: none; line-height: 0.9em;" />
	priorforh1 = dcauchy(0) #prior for the case of delta&lt;&gt;0<br style="clear: none; line-height: 0.9em;" />
	priorforh2 = 2*dcauchy(0) #prior for the case of delta&lt;0<br style="clear: none; line-height: 0.9em;" />
	priorforh3 = 2*dcauchy(0) #prior for the case of delta&gt;0<br style="clear: none; line-height: 0.9em;" />
	#Advanced input<br style="clear: none; line-height: 0.9em;" />
	itterations = 30000 #Don't change these unless you know what you're doing<br style="clear: none; line-height: 0.9em;" />
	burnin = 3000 #Don't change these unless you know what you're doing</div>

<form action="http://tsikerdekis.wuwcorp.com/BayesianttestTwoIndependentGroups/grabcode" id="form_61092f4ded" method="post" style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<input class="grabcode" name="save" style="border-width: 1px; border-style: solid; border-color: rgb(239, 239, 239) rgb(170, 170, 204) rgb(170, 170, 204) rgb(238, 238, 255); color: rgb(51, 51, 102); font-stretch: normal; font-size: 10.0799999237061px; font-family: Verdana, sans-serif; padding-right: 0.2em; padding-left: 0.2em; line-height: 1em; float: right; background-color: rgb(208, 224, 240);" title="Download" type="submit" value="Grab" />&nbsp;</form>

<p>
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">Set the first three lines according to your setup and data or feed the variables your own data. You also need to set the file that contains the Openbugs model which you can find at the end of this page. If you wish to change the priors you can, just remember that you need to adjust the prior for hypothesis 2 and hypothesis 3 in order apply only for positive or negative numbers. Also you can change the iterations and the burnin if you want to improve your results. These need to be reported in your paper later on.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	&nbsp;</p>

<h5 id="hn_Output" style="font-weight: 400; font-stretch: normal; font-size: 12pt; line-height: 15pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; color: rgb(170, 170, 170); margin: 0pt; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/BayesianttestTwoIndependentGroups#hn_Output" style="font-size: 12pt; line-height: 15pt; width: auto; color: rgb(170, 170, 170); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; background-color: transparent;">Output</a></h5>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">The hypotheses for this test are:</span></p>

<ul style="list-style-image: url(http://tsikerdekis.wuwcorp.com/templates/modified1/images/sqw.gif); margin-top: 0px; margin-bottom: 0px; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<li style="margin: 0.5em;">
		H0 - δ = 0: there is no difference between the two groups</li>
	<li style="margin: 0.5em;">
		H1 - δ &lt;&gt;0: there is a difference between the two groups</li>
	<li style="margin: 0.5em;">
		H2 - δ &lt; 0: group 2 has larger values than group 1</li>
	<li style="margin: 0.5em;">
		H3 - δ &gt; 0: group 1 has larger values than group 2</li>
</ul>

<p>
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">The output produces a set of results in text along with the probability distribution plots for each one of them. Both are useful for making a decision about your hypothesis. As an example, you can use the graph and determine if at the point δ=0 your posterior(your results after the data) are higher or lower than the prior(your initial belief). If the posterior is higher than the prior at δ=0 then it reinforces the fact that the null hypothesis(H0) is probably true. If the posterior is lower than the prior then the data weakens your belief that the null hypothesis is true. Bayes factors are automatically reported on the graphs.</span></p>

<div class="code" style="border: 1px solid rgb(170, 170, 204); font-size: 11px; font-family: monospace; margin: auto; padding: 6px 5px 13px; overflow: auto; white-space: nowrap; line-height: 23.0399990081787px; background: rgb(243, 243, 255);">
	-----------Results--------------<br style="clear: none; line-height: 0.9em;" />
	Bayes Factor(BF10) for H1 delta&lt;&gt;0 over H0 delta=0: &nbsp;0.5346907&nbsp;<br style="clear: none; line-height: 0.9em;" />
	Bayes Factor(BF01) for H0 delta=0 over H1 delta&lt;&gt;0: &nbsp;1.87024&nbsp;<br style="clear: none; line-height: 0.9em;" />
	---<br style="clear: none; line-height: 0.9em;" />
	Bayes Factor(BF20) for H2 delta&lt;0 over H0 delta=0: &nbsp;0.9432402&nbsp;<br style="clear: none; line-height: 0.9em;" />
	Bayes Factor(BF02) for H0 delta=0 over H2 delta&lt;0: &nbsp;1.060175&nbsp;<br style="clear: none; line-height: 0.9em;" />
	---<br style="clear: none; line-height: 0.9em;" />
	Bayes Factor(BF30) for H3 delta&gt; over H0 delta=0: &nbsp;0.1256324&nbsp;<br style="clear: none; line-height: 0.9em;" />
	Bayes Factor(BF03) for H0 delta=0 over H3 delta&gt;0: &nbsp;7.959729&nbsp;<br style="clear: none; line-height: 0.9em;" />
	---</div>

<form action="http://tsikerdekis.wuwcorp.com/BayesianttestTwoIndependentGroups/grabcode" id="form_61092f4ded_1" method="post" style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<input class="grabcode" name="save" style="border-width: 1px; border-style: solid; border-color: rgb(239, 239, 239) rgb(170, 170, 204) rgb(170, 170, 204) rgb(238, 238, 255); color: rgb(51, 51, 102); font-stretch: normal; font-size: 10.0799999237061px; font-family: Verdana, sans-serif; padding-right: 0.2em; padding-left: 0.2em; line-height: 1em; float: right; background-color: rgb(208, 224, 240);" title="Download" type="submit" value="Grab" />&nbsp;</form>

<p>
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span class="underline" style="text-decoration: underline; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">Please read the&nbsp;<a href="http://tsikerdekis.wuwcorp.com/BayesFactor" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;">Bayes Factor</a>&nbsp;page for how to interpret it.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">In the first two cases the evidence is "Barely worth mentioning" for H0. But, the third result (7.67) is considered "Substantial" evidence in favor of H0, indicating that when we consider if group 1 has a bigger effect than group 2, there is substantial evidence to say that is unlikely(providing proof for H0).</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">When publishing you are going to have to report also the process you obtained your results and the numbers of itterations for the MCMC test along with the burnin value and the chains(in this case 3).</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	&nbsp;</p>

<h5 id="hn_Code" style="font-weight: 400; font-stretch: normal; font-size: 12pt; line-height: 15pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; color: rgb(170, 170, 170); margin: 0pt; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/BayesianttestTwoIndependentGroups#hn_Code" style="font-size: 12pt; line-height: 15pt; width: auto; color: rgb(170, 170, 170); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; background-color: transparent;">Code</a></h5>

<h4 id="hn_R_code" style="font-weight: 300; font-stretch: normal; font-size: 13pt; line-height: 18pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; margin: 0pt; color: rgb(170, 170, 170); padding-top: 5px; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/BayesianttestTwoIndependentGroups#hn_R_code" style="font-size: 13pt; line-height: 18pt; width: auto; color: rgb(170, 170, 170); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 5px; background-color: transparent;">R code</a></h4>

<div class="code" style="border: 1px solid rgb(170, 170, 204); font-size: 11px; font-family: monospace; margin: auto; padding: 6px 5px 13px; overflow: auto; white-space: nowrap; line-height: 23.0399990081787px; background: rgb(243, 243, 255);">
	# clears workspace: &nbsp;<br style="clear: none; line-height: 0.9em;" />
	rm(list=ls(all=TRUE))<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	#---------------INPUT DATA------------------<br style="clear: none; line-height: 0.9em;" />
	setwd("/the/directory/for/both/of/your/files/") #this will help the program find the location of the modelthe model<br style="clear: none; line-height: 0.9em;" />
	group1 = c(1,5,4,2,1,2,3,1,2,3,1,2,5,4,7,8,9,7,5,3,2,3,4,6,7,6,4,7) #your set of values for group 1<br style="clear: none; line-height: 0.9em;" />
	group2 = c(5,4,3,3,4,6,6,8,7,6,5,7,7,6,5,6,7,5,4,5,6,7,8,5,6,7,8,9) #your set of values for group 2<br style="clear: none; line-height: 0.9em;" />
	openbugsmodel = "Ttest_2.txt"<br style="clear: none; line-height: 0.9em;" />
	priorforh1 = dcauchy(0) #prior for the case of delta&lt;&gt;0<br style="clear: none; line-height: 0.9em;" />
	priorforh2 = 2*dcauchy(0) #prior for the case of delta&lt;0<br style="clear: none; line-height: 0.9em;" />
	priorforh3 = 2*dcauchy(0) #prior for the case of delta&gt;0<br style="clear: none; line-height: 0.9em;" />
	#Advanced input<br style="clear: none; line-height: 0.9em;" />
	itterations = 30000 #Don't change these unless you know what you're doing<br style="clear: none; line-height: 0.9em;" />
	burnin = 3000 #Don't change these unless you know what you're doing<br style="clear: none; line-height: 0.9em;" />
	#-------------------------------------------<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	library(R2OpenBUGS)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	n1 = length(group1)<br style="clear: none; line-height: 0.9em;" />
	n2 = length(group2)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	# Rescale:<br style="clear: none; line-height: 0.9em;" />
	group2 = group2-mean(group1)<br style="clear: none; line-height: 0.9em;" />
	group2 = group2/sd(group1)<br style="clear: none; line-height: 0.9em;" />
	group1 = as.vector(scale(group1))<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	data=list("group1", "group2", "n1", "n2") # to be passed on to WinBUGS<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	inits=function()<br style="clear: none; line-height: 0.9em;" />
	{<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; list(delta=rnorm(1,0,1),mu=rnorm(1,0,1),sigma=runif(1,0,5))<br style="clear: none; line-height: 0.9em;" />
	}<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	# Parameters to be monitored<br style="clear: none; line-height: 0.9em;" />
	parameters=c("delta")<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	# The following command calls WinBUGS with specific options.<br style="clear: none; line-height: 0.9em;" />
	# For a detailed description see Sturtz, Ligges, &amp; Gelman (2005).<br style="clear: none; line-height: 0.9em;" />
	samples = bugs(data, inits, parameters,<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; model.file =openbugsmodel,<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; n.chains=3, n.iter=itterations, n.burnin=burnin, n.thin=1,<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; DIC=T,&nbsp;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; codaPkg=F, debug=F)<br style="clear: none; line-height: 0.9em;" />
	# Now the values for the monitored parameters are in the "samples" object,&nbsp;<br style="clear: none; line-height: 0.9em;" />
	# ready for inspection.<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	samples$summary # overview<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	# Please work through the analyses below one at a time<br style="clear: none; line-height: 0.9em;" />
	######################################################<br style="clear: none; line-height: 0.9em;" />
	# Analysis 1. H1: delta ~ Cauchy (unrestricted case)<br style="clear: none; line-height: 0.9em;" />
	######################################################<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	# Collect posterior samples across all chains:<br style="clear: none; line-height: 0.9em;" />
	delta.posterior &nbsp;= samples$sims.list$delta &nbsp;<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	#============ BFs based on logspline fit ===========================<br style="clear: none; line-height: 0.9em;" />
	library(polspline) # this package can be installed from within R<br style="clear: none; line-height: 0.9em;" />
	fit.posterior = logspline(delta.posterior)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	# 95% confidence interval:<br style="clear: none; line-height: 0.9em;" />
	x0=qlogspline(0.025,fit.posterior)<br style="clear: none; line-height: 0.9em;" />
	x1=qlogspline(0.975,fit.posterior)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	posterior &nbsp; &nbsp; = dlogspline(0, fit.posterior) # this gives the pdf at point delta = 0<br style="clear: none; line-height: 0.9em;" />
	prior &nbsp; &nbsp; &nbsp; &nbsp; = priorforh1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # height of order--restricted prior at delta = 0<br style="clear: none; line-height: 0.9em;" />
	BF10 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= prior/posterior<br style="clear: none; line-height: 0.9em;" />
	BF01 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= posterior/prior<br style="clear: none; line-height: 0.9em;" />
	cat("-----------Results--------------\r\n")<br style="clear: none; line-height: 0.9em;" />
	cat("Bayes Factor(BF10) for H1 delta&lt;&gt;0 over H0 delta=0: ",BF10,"\r\n")<br style="clear: none; line-height: 0.9em;" />
	cat("Bayes Factor(BF01) for H0 delta=0 over H1 delta&lt;&gt;0: ",BF01,"\r\n")<br style="clear: none; line-height: 0.9em;" />
	cat("---\r\n")<br style="clear: none; line-height: 0.9em;" />
	if (BF10&gt;=BF01){<br style="clear: none; line-height: 0.9em;" />
	&nbsp; BFplot=BF10<br style="clear: none; line-height: 0.9em;" />
	&nbsp; BFtext = bquote(BF[1][0])<br style="clear: none; line-height: 0.9em;" />
	&nbsp; }else{<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; BFplot=BF01<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; BFtext = bquote(BF[0][1])<br style="clear: none; line-height: 0.9em;" />
	&nbsp; }<br style="clear: none; line-height: 0.9em;" />
	BFplot=round(BFplot,2)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	#============ Plot Prior and Posterior &nbsp;===========================<br style="clear: none; line-height: 0.9em;" />
	par(cex.main = 1.5, mar = c(5, 6, 4, 5) + 0.1, mgp = c(3.5, 1, 0), cex.lab = 1.5,<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; font.lab = 2, cex.axis = 1.3, bty = "n", las=1)<br style="clear: none; line-height: 0.9em;" />
	xlow &nbsp;= -3<br style="clear: none; line-height: 0.9em;" />
	xhigh = 3<br style="clear: none; line-height: 0.9em;" />
	yhigh = 4<br style="clear: none; line-height: 0.9em;" />
	Nbreaks = 80<br style="clear: none; line-height: 0.9em;" />
	y = hist(delta.posterior, Nbreaks, prob=T, border="white", ylim=c(0,yhigh), xlim=c(xlow,xhigh), lwd=2, lty=1, ylab="Density", xlab=" ", main=" ", axes=F)&nbsp;<br style="clear: none; line-height: 0.9em;" />
	#white makes the original histogram -- with unwanted vertical lines -- invisible<br style="clear: none; line-height: 0.9em;" />
	lines(c(y$breaks, max(y$breaks)), c(0,y$intensities,0), type="S", lwd=2, lty=1)&nbsp;<br style="clear: none; line-height: 0.9em;" />
	axis(1, at = c(-4,-3,-2,-1,0,1,2,3,4), lab=c("-4","-3","-2","-1","0", "1", "2", "3", "4"))<br style="clear: none; line-height: 0.9em;" />
	axis(2)<br style="clear: none; line-height: 0.9em;" />
	mtext(expression(delta), side=1, line = 2.8, cex=2)<br style="clear: none; line-height: 0.9em;" />
	#now bring in log spline density estimation:<br style="clear: none; line-height: 0.9em;" />
	par(new=T)<br style="clear: none; line-height: 0.9em;" />
	plot(fit.posterior, ylim=c(0,yhigh), xlim=c(xlow,xhigh), lty=1, lwd=1, axes=F)<br style="clear: none; line-height: 0.9em;" />
	points(0, dlogspline(0, fit.posterior),pch=19, cex=2)<br style="clear: none; line-height: 0.9em;" />
	# plot the prior:<br style="clear: none; line-height: 0.9em;" />
	par(new=T)<br style="clear: none; line-height: 0.9em;" />
	plot ( function( x ) dcauchy( x, 0, 1 ), xlow, xhigh, ylim=c(0,yhigh), xlim=c(xlow,xhigh), lwd=1, lty=1, ylab=" ", xlab = " ", axes=F)&nbsp;<br style="clear: none; line-height: 0.9em;" />
	axis(1, at = c(-4,-3,-2,-1,0,1,2,3,4), lab=c("-4","-3","-2","-1","0", "1", "2", "3", "4"))<br style="clear: none; line-height: 0.9em;" />
	axis(2)<br style="clear: none; line-height: 0.9em;" />
	points(0, dcauchy(0), pch=19, cex=2)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	text(-1,3.5, expression(H[0]: &nbsp;delta == 0),cex=2)<br style="clear: none; line-height: 0.9em;" />
	text(-1,3, expression(H[1]: &nbsp;delta != 0),cex=2)<br style="clear: none; line-height: 0.9em;" />
	text(-1,2.5, bquote(.(BFtext) &nbsp;== .(BFplot)),cex=2)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	###########################################################################<br style="clear: none; line-height: 0.9em;" />
	# Analysis 2. H1: delta ~ Cauchy^- (restricted case, negative values only)<br style="clear: none; line-height: 0.9em;" />
	###########################################################################<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	# Collect posterior samples across all chains:<br style="clear: none; line-height: 0.9em;" />
	delta.posterior &nbsp;= samples$sims.list$delta<br style="clear: none; line-height: 0.9em;" />
	# selects only negative delta's:<br style="clear: none; line-height: 0.9em;" />
	delta.posterior &nbsp;= delta.posterior[which(delta.posterior&lt;0)]<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	#============ BFs based on logspline fit ===========================<br style="clear: none; line-height: 0.9em;" />
	fit.posterior = logspline(delta.posterior,ubound=0) # NB. note the bound<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	# 95% confidence interval:<br style="clear: none; line-height: 0.9em;" />
	x0=qlogspline(0.025,fit.posterior)<br style="clear: none; line-height: 0.9em;" />
	x1=qlogspline(0.975,fit.posterior)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	posterior &nbsp; &nbsp; = dlogspline(0, fit.posterior) # this gives the pdf at point delta = 0<br style="clear: none; line-height: 0.9em;" />
	prior &nbsp; &nbsp; &nbsp; &nbsp; = priorforh2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # height of order--restricted prior at delta = 0<br style="clear: none; line-height: 0.9em;" />
	BF10 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= prior/posterior<br style="clear: none; line-height: 0.9em;" />
	BF01 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= posterior/prior<br style="clear: none; line-height: 0.9em;" />
	cat("Bayes Factor(BF20) for H2 delta&lt;0 over H0 delta=0: ",BF10,"\r\n")<br style="clear: none; line-height: 0.9em;" />
	cat("Bayes Factor(BF02) for H0 delta=0 over H2 delta&lt;0: ",BF01,"\r\n")<br style="clear: none; line-height: 0.9em;" />
	cat("---\r\n")<br style="clear: none; line-height: 0.9em;" />
	if (BF10&gt;=BF01){<br style="clear: none; line-height: 0.9em;" />
	&nbsp; BFplot=BF10<br style="clear: none; line-height: 0.9em;" />
	&nbsp; BFtext = bquote(BF[2][0])<br style="clear: none; line-height: 0.9em;" />
	}else{<br style="clear: none; line-height: 0.9em;" />
	&nbsp; BFplot=BF01<br style="clear: none; line-height: 0.9em;" />
	&nbsp; BFtext = bquote(BF[0][2])<br style="clear: none; line-height: 0.9em;" />
	}<br style="clear: none; line-height: 0.9em;" />
	BFplot=round(BFplot,2)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	#============ Plot Prior and Posterior &nbsp;===========================<br style="clear: none; line-height: 0.9em;" />
	par(cex.main = 1.5, mar = c(5, 6, 4, 5) + 0.1, mgp = c(3.5, 1, 0), cex.lab = 1.5,<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; font.lab = 2, cex.axis = 1.3, bty = "n", las=1)<br style="clear: none; line-height: 0.9em;" />
	xlow &nbsp;= -3<br style="clear: none; line-height: 0.9em;" />
	xhigh = 0<br style="clear: none; line-height: 0.9em;" />
	yhigh = 12<br style="clear: none; line-height: 0.9em;" />
	Nbreaks = 80<br style="clear: none; line-height: 0.9em;" />
	y = hist(delta.posterior, Nbreaks, prob=T, border="white", ylim=c(0,yhigh), xlim=c(xlow,xhigh), lwd=2, lty=1, ylab="Density", xlab=" ", main=" ", axes=F)&nbsp;<br style="clear: none; line-height: 0.9em;" />
	#white makes the original histogram -- with unwanted vertical lines -- invisible<br style="clear: none; line-height: 0.9em;" />
	lines(c(y$breaks, max(y$breaks)), c(0,y$intensities,0), type="S", lwd=2, lty=1)&nbsp;<br style="clear: none; line-height: 0.9em;" />
	axis(1, at = c(-3,-2,-1,0), lab=c("-3","-2","-1","0"))<br style="clear: none; line-height: 0.9em;" />
	axis(2)<br style="clear: none; line-height: 0.9em;" />
	mtext(expression(delta), side=1, line = 2.8, cex=2)<br style="clear: none; line-height: 0.9em;" />
	#now bring in log spline density estimation:<br style="clear: none; line-height: 0.9em;" />
	par(new=T)<br style="clear: none; line-height: 0.9em;" />
	plot(fit.posterior, ylim=c(0,yhigh), xlim=c(xlow,xhigh), lty=1, lwd=1, axes=F)<br style="clear: none; line-height: 0.9em;" />
	points(0, dlogspline(0, fit.posterior),pch=19, cex=2)<br style="clear: none; line-height: 0.9em;" />
	# plot the prior:<br style="clear: none; line-height: 0.9em;" />
	par(new=T)<br style="clear: none; line-height: 0.9em;" />
	plot ( function( x ) 2*dcauchy( x, 0, 1 ), xlow, xhigh, ylim=c(0,yhigh), xlim=c(xlow,xhigh), lwd=1, lty=1, ylab=" ", xlab = " ", axes=F)&nbsp;<br style="clear: none; line-height: 0.9em;" />
	axis(1, at = c(-3,-2,-1,0), lab=c("-3","-2","-1","0"))<br style="clear: none; line-height: 0.9em;" />
	axis(2)<br style="clear: none; line-height: 0.9em;" />
	points(0, 2*dcauchy(0), pch=19, cex=2)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	text(-2,10, expression(H[0]: &nbsp;delta == 0),cex=2)<br style="clear: none; line-height: 0.9em;" />
	text(-2,8, expression(H[2]: &nbsp;delta &lt; 0),cex=2)<br style="clear: none; line-height: 0.9em;" />
	text(-2,6, bquote(.(BFtext) &nbsp;== .(BFplot)),cex=2)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	###########################################################################<br style="clear: none; line-height: 0.9em;" />
	# Analysis 3. H1: delta ~ Cauchy^+ (restricted case, positive values only)<br style="clear: none; line-height: 0.9em;" />
	###########################################################################<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	# Collect posterior samples across all chains:<br style="clear: none; line-height: 0.9em;" />
	delta.posterior &nbsp;= samples$sims.list$delta &nbsp;<br style="clear: none; line-height: 0.9em;" />
	# selects only positive delta's:<br style="clear: none; line-height: 0.9em;" />
	delta.posterior &nbsp;= delta.posterior[which(delta.posterior&gt;0)]<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	#============ BFs based on logspline fit ===========================<br style="clear: none; line-height: 0.9em;" />
	fit.posterior = logspline(delta.posterior,lbound=0) # NB. note the bound<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	# 95% confidence interval:<br style="clear: none; line-height: 0.9em;" />
	x0=qlogspline(0.025,fit.posterior)<br style="clear: none; line-height: 0.9em;" />
	x1=qlogspline(0.975,fit.posterior)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	posterior &nbsp; &nbsp; = dlogspline(0, fit.posterior) # this gives the pdf at point delta = 0<br style="clear: none; line-height: 0.9em;" />
	prior &nbsp; &nbsp; &nbsp; &nbsp; = priorforh3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # height of order--restricted prior at delta = 0<br style="clear: none; line-height: 0.9em;" />
	BF10 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= prior/posterior #this produces the decimal version. if you inverse this you get the odds<br style="clear: none; line-height: 0.9em;" />
	BF01 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= posterior/prior<br style="clear: none; line-height: 0.9em;" />
	cat("Bayes Factor(BF30) for H3 delta&gt;0 over H0 delta=0: ",BF10,"\r\n")<br style="clear: none; line-height: 0.9em;" />
	cat("Bayes Factor(BF03) for H0 delta=0 over H3 delta&gt;0: ",BF01,"\r\n")<br style="clear: none; line-height: 0.9em;" />
	cat("---\r\n")<br style="clear: none; line-height: 0.9em;" />
	if (BF10&gt;=BF01){<br style="clear: none; line-height: 0.9em;" />
	&nbsp; BFplot=BF10<br style="clear: none; line-height: 0.9em;" />
	&nbsp; BFtext = bquote(BF[3][0])<br style="clear: none; line-height: 0.9em;" />
	}else{<br style="clear: none; line-height: 0.9em;" />
	&nbsp; BFplot=BF01<br style="clear: none; line-height: 0.9em;" />
	&nbsp; BFtext = bquote(BF[0][3])<br style="clear: none; line-height: 0.9em;" />
	}<br style="clear: none; line-height: 0.9em;" />
	BFplot=round(BFplot,2)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	#============ Plot Prior and Posterior &nbsp;===========================<br style="clear: none; line-height: 0.9em;" />
	par(cex.main = 1.5, mar = c(5, 6, 4, 5) + 0.1, mgp = c(3.5, 1, 0), cex.lab = 1.5,<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; font.lab = 2, cex.axis = 1.3, bty = "n", las=1)<br style="clear: none; line-height: 0.9em;" />
	xlow &nbsp;= 0<br style="clear: none; line-height: 0.9em;" />
	xhigh = 3<br style="clear: none; line-height: 0.9em;" />
	yhigh = 12<br style="clear: none; line-height: 0.9em;" />
	Nbreaks = 80<br style="clear: none; line-height: 0.9em;" />
	y = hist(delta.posterior, Nbreaks, prob=T, border="white", ylim=c(0,yhigh), xlim=c(xlow,xhigh), lwd=2, lty=1, ylab="Density", xlab=" ", main=" ", axes=F)&nbsp;<br style="clear: none; line-height: 0.9em;" />
	#white makes the original histogram -- with unwanted vertical lines -- invisible<br style="clear: none; line-height: 0.9em;" />
	lines(c(y$breaks, max(y$breaks)), c(0,y$intensities,0), type="S", lwd=2, lty=1)&nbsp;<br style="clear: none; line-height: 0.9em;" />
	axis(1, at = c(0,1,2,3,4), lab=c("0", "1", "2", "3", "4"))<br style="clear: none; line-height: 0.9em;" />
	axis(2)<br style="clear: none; line-height: 0.9em;" />
	mtext(expression(delta), side=1, line = 2.8, cex=2)<br style="clear: none; line-height: 0.9em;" />
	#now bring in log spline density estimation:<br style="clear: none; line-height: 0.9em;" />
	par(new=T)<br style="clear: none; line-height: 0.9em;" />
	plot(fit.posterior, ylim=c(0,yhigh), xlim=c(xlow,xhigh), lty=1, lwd=1, axes=F)<br style="clear: none; line-height: 0.9em;" />
	points(0, dlogspline(0, fit.posterior),pch=19, cex=2)<br style="clear: none; line-height: 0.9em;" />
	# plot the prior:<br style="clear: none; line-height: 0.9em;" />
	par(new=T)<br style="clear: none; line-height: 0.9em;" />
	plot ( function( x ) 2*dcauchy( x, 0, 1 ), xlow, xhigh, ylim=c(0,yhigh), xlim=c(xlow,xhigh), lwd=1, lty=1, ylab=" ", xlab = " ", axes=F)&nbsp;<br style="clear: none; line-height: 0.9em;" />
	axis(1, at = c(0,1,2,3,4), lab=c("0", "1", "2", "3", "4"))<br style="clear: none; line-height: 0.9em;" />
	axis(2)<br style="clear: none; line-height: 0.9em;" />
	points(0, 2*dcauchy(0), pch=19, cex=2)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	text(2,10, expression(H[0]: &nbsp;delta == 0),cex=2)<br style="clear: none; line-height: 0.9em;" />
	text(2,8, expression(H[3]: &nbsp;delta &gt; 0),cex=2)<br style="clear: none; line-height: 0.9em;" />
	text(2,6, bquote(.(BFtext) &nbsp;== .(BFplot)),cex=2)</div>

<form action="http://tsikerdekis.wuwcorp.com/BayesianttestTwoIndependentGroups/grabcode" id="form_61092f4ded_2" method="post" style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<input class="grabcode" name="save" style="border-width: 1px; border-style: solid; border-color: rgb(239, 239, 239) rgb(170, 170, 204) rgb(170, 170, 204) rgb(238, 238, 255); color: rgb(51, 51, 102); font-stretch: normal; font-size: 10.0799999237061px; font-family: Verdana, sans-serif; padding-right: 0.2em; padding-left: 0.2em; line-height: 1em; float: right; background-color: rgb(208, 224, 240);" title="Download" type="submit" value="Grab" />&nbsp;</form>

<p>
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	&nbsp;</p>

<h4 id="hn_OpenBugs_code" style="font-weight: 300; font-stretch: normal; font-size: 13pt; line-height: 18pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; margin: 0pt; color: rgb(170, 170, 170); padding-top: 5px; background-color: transparent;">
	<a href="http://tsikerdekis.wuwcorp.com/OpenBugs" style="font-size: 13pt; line-height: 18pt; width: auto; color: rgb(170, 170, 170); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 5px; background-color: transparent;">OpenBugs</a><a class="heading" href="http://tsikerdekis.wuwcorp.com/BayesianttestTwoIndependentGroups#hn_OpenBugs_code" style="font-size: 13pt; line-height: 18pt; width: auto; color: rgb(170, 170, 170); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 5px; background-color: transparent;">&nbsp;code</a></h4>

<div class="code_header" style="color: rgb(51, 51, 102); border-top-width: 1px; border-style: solid solid none; border-top-color: rgb(170, 170, 204); border-right-width: 1px; border-right-color: rgb(170, 170, 204); border-left-width: 1px; border-left-color: rgb(170, 170, 204); font-family: Verdana, Arial, sans-serif; font-size: 14.3999996185303px; padding-right: 3px; padding-left: 3px; margin-top: 5px; margin-right: auto; margin-left: auto; line-height: 1.5em; background-color: rgb(208, 224, 240);">
	Ttest_2.txt</div>

<div class="code" style="border: 1px solid rgb(170, 170, 204); font-size: 11px; font-family: monospace; margin: auto; padding: 6px 5px 13px; overflow: auto; white-space: nowrap; line-height: 23.0399990081787px; background: rgb(243, 243, 255);">
	model<br style="clear: none; line-height: 0.9em;" />
	{&nbsp;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; for (i in 1:n1)<br style="clear: none; line-height: 0.9em;" />
	&nbsp; {<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; group1[i] ~ dnorm(muX,lambdaXY)<br style="clear: none; line-height: 0.9em;" />
	&nbsp; }<br style="clear: none; line-height: 0.9em;" />
	&nbsp; for (i in 1:n2)<br style="clear: none; line-height: 0.9em;" />
	&nbsp; {<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp; group2[i] ~ dnorm(muY,lambdaXY)<br style="clear: none; line-height: 0.9em;" />
	&nbsp; }<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	&nbsp; lambdaXY &lt;- pow(sigmaXY,-2)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	&nbsp; delta &nbsp; &nbsp; &nbsp; ~ dnorm(0,lambdaDelta)<br style="clear: none; line-height: 0.9em;" />
	&nbsp; lambdaDelta ~ dchisqr(1)<br style="clear: none; line-height: 0.9em;" />
	&nbsp; &nbsp;&nbsp;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; sigma &nbsp; &nbsp;~ dnorm(0,sigmaChi)<br style="clear: none; line-height: 0.9em;" />
	&nbsp; sigmaChi ~ dchisqr(1)<br style="clear: none; line-height: 0.9em;" />
	&nbsp; sigmaXY &lt;- abs(sigma)<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	&nbsp; mu &nbsp; &nbsp;~ dnorm(0,muChi)<br style="clear: none; line-height: 0.9em;" />
	&nbsp; muChi ~ dchisqr(1)<br style="clear: none; line-height: 0.9em;" />
	&nbsp;&nbsp;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; alpha &lt;- delta*sigmaXY&nbsp; &nbsp;&nbsp;<br style="clear: none; line-height: 0.9em;" />
	<br style="clear: none; line-height: 0.9em;" />
	&nbsp; muX &lt;- mu + alpha*0.5&nbsp;<br style="clear: none; line-height: 0.9em;" />
	&nbsp; muY &lt;- mu - alpha*0.5&nbsp;<br style="clear: none; line-height: 0.9em;" />
	}</div>

<form action="http://tsikerdekis.wuwcorp.com/BayesianttestTwoIndependentGroups/grabcode" id="form_61092f4ded_3" method="post" style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<input class="grabcode" name="save" style="border-width: 1px; border-style: solid; border-color: rgb(239, 239, 239) rgb(170, 170, 204) rgb(170, 170, 204) rgb(238, 238, 255); color: rgb(51, 51, 102); font-stretch: normal; font-size: 10.0799999237061px; font-family: Verdana, sans-serif; padding-right: 0.2em; padding-left: 0.2em; line-height: 1em; float: right; background-color: rgb(208, 224, 240);" title="Download Ttest_2.txt" type="submit" value="Grab" />&nbsp;</form>

<p>
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	&nbsp;</p>

<h2 id="hn_Additional_information" style="font-weight: 300; font-stretch: normal; font-size: 15pt; line-height: 18pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; margin: 0pt; color: rgb(153, 51, 85); padding-top: 10px; padding-bottom: 10px; text-shadow: rgb(238, 238, 238) 1px 1px 0px; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/BayesianttestTwoIndependentGroups#hn_Additional_information" style="font-size: 15pt; line-height: 18pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 10px; padding-bottom: 10px; background-color: transparent;">Additional information</a></h2>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">The model specifications are:</span></p>

<div class="code" style="border: 1px solid rgb(170, 170, 204); font-size: 11px; font-family: monospace; margin: auto; padding: 6px 5px 13px; overflow: auto; white-space: nowrap; line-height: 23.0399990081787px; background: rgb(243, 243, 255);">
	Group 1 ~ Normal distribution ( μ + α/2, σ^2) #These are the only known values<br style="clear: none; line-height: 0.9em;" />
	Group 2 ~ Normal distribution ( μ - α/2, σ^2) #These are the only known values<br style="clear: none; line-height: 0.9em;" />
	σ ~ Cauchy distribution(0,1)+<br style="clear: none; line-height: 0.9em;" />
	μ ~ Cauchy distribution(0,1)<br style="clear: none; line-height: 0.9em;" />
	α = σ * δ<br style="clear: none; line-height: 0.9em;" />
	δ ~ Cauchy distribution(0,1) # This is assumed for H1 for the model while H0 is considered δ=0</div>

<form action="http://tsikerdekis.wuwcorp.com/BayesianttestTwoIndependentGroups/grabcode" id="form_61092f4ded_4" method="post" style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<input class="grabcode" name="save" style="border-width: 1px; border-style: solid; border-color: rgb(239, 239, 239) rgb(170, 170, 204) rgb(170, 170, 204) rgb(238, 238, 255); color: rgb(51, 51, 102); font-stretch: normal; font-size: 10.0799999237061px; font-family: Verdana, sans-serif; padding-right: 0.2em; padding-left: 0.2em; line-height: 1em; float: right; background-color: rgb(208, 224, 240);" title="Download" type="submit" value="Grab" />&nbsp;</form>

<p>
	&nbsp;</p>]]></content><author><name>Michael Tsikerdekis</name><email>Michael.Tsikerdekis@wwu.edu</email><uri>http://michael.tsikerdekis.com</uri></author><summary type="html"><![CDATA[Introduction]]></summary></entry><entry><title type="html">Bayesian Statistical Hypothesis Testing for HCI</title><link href="https://michael.tsikerdekis.com/2012/01/01/BayesianHCI/" rel="alternate" type="text/html" title="Bayesian Statistical Hypothesis Testing for HCI" /><published>2012-01-01T00:00:00-08:00</published><updated>2012-01-01T00:00:00-08:00</updated><id>https://michael.tsikerdekis.com/2012/01/01/BayesianHCI</id><content type="html" xml:base="https://michael.tsikerdekis.com/2012/01/01/BayesianHCI/"><![CDATA[<h6 style="font-size: 15pt; margin: 0pt; font-weight: 300; font-stretch: normal; line-height: 18pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; color: rgb(153, 51, 85); padding-top: 10px; padding-bottom: 10px; text-shadow: rgb(238, 238, 238) 1px 1px 0px; background-color: transparent;">
	<a class="heading" href="http://tsikerdekis.wuwcorp.com/BayesianHCIstats#hn_Disclaimer_Please_read_this_first" style="font-size: 15pt; line-height: 18pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; margin: 0pt; padding-top: 10px; padding-bottom: 10px; background-color: transparent;">Disclaimer (Please read this first!)</a></h6>

<h5 id="hn_Evidence_for_and_against_the_null_hypothesis_is_possible_:-" style="margin: 0pt; padding-top: 10px; padding-bottom: 10px; font-weight: 300; font-size: 15pt; font-stretch: normal; line-height: 18pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; background-color: transparent;">
	<em style="margin: 0pt; padding-top: 10px; padding-bottom: 10px; color: rgb(153, 51, 85); outline: 0px; font-size: 15pt; line-height: 18pt; width: auto; text-shadow: rgb(238, 238, 238) 1px 1px 0px; font-stretch: normal; font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; background-color: transparent;">Evidence for and against the null hypothesis is possible :-)</em></h5>

<div style="float: right;">
	<blockquote class="oval-thought" style="width: 135px; margin-right: auto; margin-bottom: 40px; margin-left: 10px; position: relative; padding: 25px 20px; text-align: center; color: rgb(255, 255, 255); border-radius: 110px 60px; background: linear-gradient(rgb(46, 136, 196), rgb(7, 86, 152));">
		<p style="font-size: 1.25em;">
			Found anything interesting? Any comments or errors?<a href="http://tsikerdekis.wuwcorp.com/Contact" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;">Contact me :-)</a></p>
	</blockquote>
</div>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">I started this wiki so that I can try and gather as many procedures(and code) as I can that currently exists in Bayesian statistics. The goal is to create an&nbsp;</span><em style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; color: rgb(68, 68, 68); font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">easy to read, easy to apply</em><span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">&nbsp;guide for each method depending on your data and your design. Although this is geared towards HCI research, most of these methods can be applied in other scientific disciplines such as social sciences, psychology and others. The philosophy behind this guide is to always keep things simple. Just as I don't ask for my visitors on this website to understand HTTP requests, the same should apply for someone that wants to perform Bayesian statistics. You only need to know what is your input, and how to interpret the output. Therefore, the emphasis here is taken away from the math aspects of bayesian statistics.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">My inspiration for developing such content was the site&nbsp;</span><a class="ext" href="http://yatani.jp/HCIstats" style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; text-align: justify;" target="\&quot;_new\&quot;">Statistics for HCI Research</a><span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">&nbsp;by Koji Yatani. It is an excellent guide for NHST analysis for HCI.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">Keep in mind that&nbsp;</span><em style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; color: rgb(68, 68, 68); font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">I am not an expert of statistics</em><span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">. The contents provided here is basically what I learned from my experience of HCI research and by reading different online/offline materials. I always double-check the content before posting, but it still may be not 100% accurate or even wrong. So,&nbsp;</span><em style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; color: rgb(68, 68, 68); font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">use the contents on this website at your discretion</em><span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">. I own no responsibility on any kind of consequences, such as you have done a wrong analysis after reading my wiki or your papers do not get into a conference or a journal, or your adviser doesn't like your analysis.&nbsp;</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">I also strongly recommend you get a second opinion on your analysis from other kinds of resources before you really perform a test. If you have found any factual errors, please email me(tsikerdekis@gmail.com). Your comments would be greatly appreciated. Also, I am always looking for R(matlab,stata) code that can perform hypothesis testing so don't hesitate to let me know about it.</span></p>

<hr style="border-top-style: solid; border-width: 1px 0px 0px; border-top-color: rgb(238, 238, 238); margin: 8px auto; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;" />

<h2 id="hn_Basics_of_statistics_A_quick_introduction_to_things_you_need_to_know" style="font-weight: 300; font-stretch: normal; font-size: 15pt; line-height: 18pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; margin: 0pt; color: rgb(153, 51, 85); padding-top: 10px; padding-bottom: 10px; text-shadow: rgb(238, 238, 238) 1px 1px 0px; background-color: transparent;">
	<span style="font-size: 15pt; line-height: 18pt; margin: 0pt; padding-top: 10px; padding-bottom: 10px;">Basics of statistics (A qui</span><font color="#993355"><span style="font-size: 15pt; line-height: 18pt; margin: 0pt; padding-top: 10px; padding-bottom: 10px;">ck introduction to things you need to know)</span></font></h2>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">There are 4 types of variables that you need to know and identify.&nbsp;</span></p>

<ul style="list-style-image: url(http://tsikerdekis.wuwcorp.com/templates/modified1/images/sqw.gif); margin-top: 0px; margin-bottom: 0px; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<li style="margin: 0.5em;">
		<em>Interval/Numerical/Ratio</em>&nbsp;are ordered sets of data (usually numbers) that maintain equal distance between their space (e.g., the distance between 2 and 3 is equal to the distance between 3 and 4).</li>
	<li style="margin: 0.5em;">
		<em>Ordinal</em>&nbsp;are ordered sets of data that do not show an equal distance between their elements. (e.g., "very strong" is definitely higher than "strong" and the same applies for "extremely strong" but the distance between this elements is not necessary equal.)</li>
	<li style="margin: 0.5em;">
		<em>Nominal/Categorical</em>&nbsp;are sets of data with no order (e.g., countries is a good example).</li>
	<li style="margin: 0.5em;">
		<em>Dichotomous</em>&nbsp;are categorical variables that have only two levels (e.g., sex can have values only male and female.)</li>
</ul>

<p>
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">You will also need a general understanding of the&nbsp;</span><a href="http://tsikerdekis.wuwcorp.com/BayesFactor" style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px; text-align: justify;">Bayes Factor</a><span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">. However, I have connected the link to every procedure's interpretation section as well.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">Finally, Bayesian procedures have their pros and cons just as NHST analysis(guide development in progress) BUT the single most appealing thing for me is the power to provide evidence&nbsp;</span><em style="font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; color: rgb(68, 68, 68); font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">for the null hypothesis</em><span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">. Yes, with Bayesian methods you can do it!</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	&nbsp;</p>

<hr style="border-top-style: solid; border-width: 1px 0px 0px; border-top-color: rgb(238, 238, 238); margin: 8px auto; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;" />

<h2 id="hn_What_statistical_test_should_I_use" style="font-weight: 300; font-stretch: normal; font-size: 15pt; line-height: 18pt; font-family: 'Droid Serif', 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', Arial, 'Trebuchet MS', Verdana, sans-serif; margin: 0pt; color: rgb(153, 51, 85); padding-top: 10px; padding-bottom: 10px; text-shadow: rgb(238, 238, 238) 1px 1px 0px; background-color: transparent;">
	<span style="font-size: 15pt; line-height: 18pt; margin: 0pt; padding-top: 10px; padding-bottom: 10px;">What statistical test should I use?</span></h2>

<p>
	<span style="color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">While with NHST analysis answers are straight forward, Bayesian statistics is still a field under development. This is especially true when it comes to hypothesis testing. The following is a set of techniques that I managed to gather.</span><br style="clear: none; line-height: 0.9em; color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; text-align: justify;" />
	&nbsp;</p>

<table class="data" style="border-width: 2px; border-color: rgb(204, 204, 204); color: rgb(68, 68, 68); font-family: 'Droid Serif', 'Open Sans', Cambria, Georgia, 'DejaVu Serif', serif; font-size: 14.3999996185303px; line-height: 23.0399990081787px; text-align: justify;">
	<tbody>
		<tr>
			<th style="border-color: rgb(204, 204, 204); padding: 0.1em 0.25em; background-color: rgb(238, 238, 238);">
				&nbsp;</th>
			<th colspan="4" style="border-color: rgb(204, 204, 204); padding: 0.1em 0.25em; background-color: rgb(238, 238, 238);">
				<div class="center" style="text-align: center;">
					Types of your dependent/independent variables</div>
			</th>
		</tr>
		<tr>
			<th style="border-color: rgb(204, 204, 204); padding: 0.1em 0.25em; background-color: rgb(238, 238, 238);">
				&nbsp;</th>
			<th style="border-color: rgb(204, 204, 204); padding: 0.1em 0.25em; background-color: rgb(238, 238, 238);">
				Interval/Ratio</th>
			<th style="border-color: rgb(204, 204, 204); padding: 0.1em 0.25em; background-color: rgb(238, 238, 238);">
				Interval/Ratio, Ordinal</th>
			<th style="border-color: rgb(204, 204, 204); padding: 0.1em 0.25em; background-color: rgb(238, 238, 238);">
				Ordinal,Categorical</th>
			<th style="border-color: rgb(204, 204, 204); padding: 0.1em 0.25em; background-color: rgb(238, 238, 238);">
				Dichotomous</th>
		</tr>
		<tr>
			<td style="border-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				Compare two unpaired groups</td>
			<td style="border-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				<a href="http://tsikerdekis.wuwcorp.com/BayesianttestTwoIndependentGroups" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;">Bayesian t-test</a></td>
			<td style="border-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				Bayesianmannwhitney Bayesian Mann-Whitney test</td>
			<td style="border-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				<a href="http://tsikerdekis.wuwcorp.com/BayesianTestofIndependence" style="font-family: inherit; font-size: inherit; line-height: 13pt; width: auto; color: rgb(153, 51, 85); text-shadow: rgb(238, 238, 238) 1px 1px 0px;">Bayesian test of independence</a></td>
			<td style="border-top-style: solid; border-bottom-style: solid; border-left-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				Bayesianbinomialtesting Bayesian Binomial</td>
		</tr>
		<tr>
			<td style="border-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				Compare two paired groups</td>
			<td style="border-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				--</td>
			<td style="border-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				--</td>
			<td style="border-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				--</td>
			<td style="border-top-style: solid; border-bottom-style: solid; border-left-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				--</td>
		</tr>
		<tr>
			<td style="border-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				Find relationship between two variables</td>
			<td style="border-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				--</td>
			<td style="border-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				--</td>
			<td style="border-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				--</td>
			<td style="border-top-style: solid; border-bottom-style: solid; border-left-style: solid; border-color: rgb(204, 204, 204); padding: 0.1em 0.25em;">
				--</td>
		</tr>
	</tbody>
</table>

<p>
	&nbsp;</p>]]></content><author><name>Michael Tsikerdekis</name><email>Michael.Tsikerdekis@wwu.edu</email><uri>http://michael.tsikerdekis.com</uri></author><summary type="html"><![CDATA[Disclaimer (Please read this first!)]]></summary></entry></feed>