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

<channel>
	<title>2657 Productions News &#187; Geekiness</title>
	<atom:link href="http://news.mrdwab.com/category/geekiness/feed/" rel="self" type="application/rss+xml" />
	<link>http://news.mrdwab.com</link>
	<description>..:: Whereabouts and Whatabouts of the 2657 World ::..</description>
	<lastBuildDate>Sat, 13 Feb 2010 17:17:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Sampling with replacement in R</title>
		<link>http://news.mrdwab.com/2009-11-30/sampling-with-replacement-in-r/</link>
		<comments>http://news.mrdwab.com/2009-11-30/sampling-with-replacement-in-r/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 09:32:28 +0000</pubDate>
		<dc:creator>Ananda</dc:creator>
				<category><![CDATA[(all categories)]]></category>
		<category><![CDATA[Geekiness]]></category>
		<category><![CDATA[Useless Knowledge]]></category>
		<category><![CDATA[probability]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[sampling]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://news.mrdwab.com/?p=535</guid>
		<description><![CDATA[<p>In my last post about sampling (Simple sampling with R) we were doing simple sampling without replacement&#8211;that is, each item could only be selected once. However, there are times when you want to simulate sampling with replacement. For example, if you wanted to simulate sampling the results of rolling a dice 50 times, your outcomes [...]]]></description>
			<content:encoded><![CDATA[<p>In my last post about sampling (<a href="http://news.mrdwab.com/2009-11-29/simple-sampling-with-r/" title="Simple sampling with R">Simple sampling with R</a>) we were doing simple sampling without replacement&#8211;that is, each item could only be selected once. However, there are times when you want to simulate sampling with replacement. For example, if you wanted to simulate sampling the results of rolling a dice 50 times, your outcomes each time could be a 1, 2, 3, 4, 5 or 6, but 50 is more than 6, so you need to let the software &#8220;replace&#8221; the sample before it takes another sample.</p>
<p>This post explains how to do this with R.</p>
<p><span id="more-535"></span></p>
<pre class="r"><span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r slc"># Can we sample from things that are not numbers, for</span>
<span class="r sym">&gt;</span> <span class="r slc"># example, pretend we are taking M&amp;Ms out of a jar that</span>
<span class="r sym">&gt;</span> <span class="r slc"># has blue, green, and red M&amp;Ms?</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> candy <span class="r sym">=</span> <span class="r kwc">c</span><span class="r sym">(</span><span class="r str">&quot;blue&quot;</span><span class="r sym">,</span><span class="r str">&quot;green&quot;</span><span class="r sym">,</span><span class="r str">&quot;red&quot;</span><span class="r sym">)</span>
<span class="r sym">&gt;</span> <span class="r kwc">sample</span><span class="r sym">(</span>candy<span class="r sym">,</span> <span class="r num">20</span><span class="r sym">,</span> <span class="r kwc">replace</span><span class="r sym">=</span><span class="r kwb">T</span><span class="r sym">)</span>
 <span class="r sym">[</span><span class="r num">1</span><span class="r sym">]</span> <span class="r str">&quot;red&quot;</span>   <span class="r str">&quot;red&quot;</span>   <span class="r str">&quot;red&quot;</span>   <span class="r str">&quot;red&quot;</span>   <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;red&quot;</span>
 <span class="r sym">[</span><span class="r num">8</span><span class="r sym">]</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;green&quot;</span>
<span class="r sym">[</span><span class="r num">15</span><span class="r sym">]</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;red&quot;</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r slc"># &quot;replace=T&quot; is required since there are only three items</span>
<span class="r sym">&gt;</span> <span class="r slc"># in our list. It means that we can sample the same item</span>
<span class="r sym">&gt;</span> <span class="r slc"># more than one time.</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r slc"># What about probability?</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r kwc">sample</span><span class="r sym">(</span>candy<span class="r sym">,</span> <span class="r num">20</span><span class="r sym">,</span> <span class="r kwc">replace</span><span class="r sym">=</span><span class="r kwb">T</span><span class="r sym">,</span> prob<span class="r sym">=</span><span class="r kwc">c</span><span class="r sym">(</span><span class="r num">0.7</span><span class="r sym">,</span> <span class="r num">0.2</span><span class="r sym">,</span> <span class="r num">0.1</span><span class="r sym">))</span>
 <span class="r sym">[</span><span class="r num">1</span><span class="r sym">]</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>
 <span class="r sym">[</span><span class="r num">8</span><span class="r sym">]</span> <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>
<span class="r sym">[</span><span class="r num">15</span><span class="r sym">]</span> <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;blue&quot;</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r slc"># A second time</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r kwc">sample</span><span class="r sym">(</span>candy<span class="r sym">,</span> <span class="r num">20</span><span class="r sym">,</span> <span class="r kwc">replace</span><span class="r sym">=</span><span class="r kwb">T</span><span class="r sym">,</span> prob<span class="r sym">=</span><span class="r kwc">c</span><span class="r sym">(</span><span class="r num">0.7</span><span class="r sym">,</span> <span class="r num">0.2</span><span class="r sym">,</span> <span class="r num">0.1</span><span class="r sym">))</span>
 <span class="r sym">[</span><span class="r num">1</span><span class="r sym">]</span> <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>
 <span class="r sym">[</span><span class="r num">8</span><span class="r sym">]</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;green&quot;</span>
<span class="r sym">[</span><span class="r num">15</span><span class="r sym">]</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;red&quot;</span>   <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;blue&quot;</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r slc"># Notice how, in general, we have more blues and greens</span>
<span class="r sym">&gt;</span> <span class="r slc"># and almost no reds. You can sort these results too, but</span>
<span class="r sym">&gt;</span> <span class="r slc"># then  you don't see the sequence in which the items</span>
<span class="r sym">&gt;</span> <span class="r slc"># were selected, which might also be interesting. Here</span>
<span class="r sym">&gt;</span> <span class="r slc"># are three more samples, sorted so you can see the effect</span>
<span class="r sym">&gt;</span> <span class="r slc"># that setting the probability has on the outcome.</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r kwc">sort</span><span class="r sym">(</span><span class="r kwc">sample</span><span class="r sym">(</span>candy<span class="r sym">,</span> <span class="r num">20</span><span class="r sym">,</span> <span class="r kwc">replace</span><span class="r sym">=</span><span class="r kwb">T</span><span class="r sym">,</span> prob<span class="r sym">=</span><span class="r kwc">c</span><span class="r sym">(</span><span class="r num">0.7</span><span class="r sym">,</span> <span class="r num">0.2</span><span class="r sym">,</span> <span class="r num">0.1</span><span class="r sym">)))</span>
 <span class="r sym">[</span><span class="r num">1</span><span class="r sym">]</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>
 <span class="r sym">[</span><span class="r num">8</span><span class="r sym">]</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>
<span class="r sym">[</span><span class="r num">15</span><span class="r sym">]</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;red&quot;</span>   <span class="r str">&quot;red&quot;</span>
<span class="r sym">&gt;</span> <span class="r kwc">sort</span><span class="r sym">(</span><span class="r kwc">sample</span><span class="r sym">(</span>candy<span class="r sym">,</span> <span class="r num">20</span><span class="r sym">,</span> <span class="r kwc">replace</span><span class="r sym">=</span><span class="r kwb">T</span><span class="r sym">,</span> prob<span class="r sym">=</span><span class="r kwc">c</span><span class="r sym">(</span><span class="r num">0.7</span><span class="r sym">,</span> <span class="r num">0.2</span><span class="r sym">,</span> <span class="r num">0.1</span><span class="r sym">)))</span>
 <span class="r sym">[</span><span class="r num">1</span><span class="r sym">]</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>
 <span class="r sym">[</span><span class="r num">8</span><span class="r sym">]</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>
<span class="r sym">[</span><span class="r num">15</span><span class="r sym">]</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;red&quot;</span>   <span class="r str">&quot;red&quot;</span>   <span class="r str">&quot;red&quot;</span>   <span class="r str">&quot;red&quot;</span>
<span class="r sym">&gt;</span> <span class="r kwc">sort</span><span class="r sym">(</span><span class="r kwc">sample</span><span class="r sym">(</span>candy<span class="r sym">,</span> <span class="r num">20</span><span class="r sym">,</span> <span class="r kwc">replace</span><span class="r sym">=</span><span class="r kwb">T</span><span class="r sym">,</span> prob<span class="r sym">=</span><span class="r kwc">c</span><span class="r sym">(</span><span class="r num">0.7</span><span class="r sym">,</span> <span class="r num">0.2</span><span class="r sym">,</span> <span class="r num">0.1</span><span class="r sym">)))</span>
 <span class="r sym">[</span><span class="r num">1</span><span class="r sym">]</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>
 <span class="r sym">[</span><span class="r num">8</span><span class="r sym">]</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;green&quot;</span>
<span class="r sym">[</span><span class="r num">15</span><span class="r sym">]</span> <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;green&quot;</span> <span class="r str">&quot;red&quot;</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r slc"># You can also assign a name to the probability set before</span>
<span class="r sym">&gt;</span> <span class="r slc"># you start your sample instead of typing out the</span>
<span class="r sym">&gt;</span> <span class="r slc"># probabilities each time you take a sample.</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> ProbCandy <span class="r sym">=</span> <span class="r kwc">c</span><span class="r sym">(</span><span class="r num">0.7</span><span class="r sym">,</span> <span class="r num">0.2</span><span class="r sym">,</span> <span class="r num">0.1</span><span class="r sym">)</span>
<span class="r sym">&gt;</span> <span class="r kwc">sort</span><span class="r sym">(</span><span class="r kwc">sample</span><span class="r sym">(</span>candy<span class="r sym">,</span> <span class="r num">20</span><span class="r sym">,</span> <span class="r kwc">replace</span><span class="r sym">=</span><span class="r kwb">T</span><span class="r sym">,</span> prob<span class="r sym">=</span>ProbCandy<span class="r sym">))</span>
 <span class="r sym">[</span><span class="r num">1</span><span class="r sym">]</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>
 <span class="r sym">[</span><span class="r num">8</span><span class="r sym">]</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>
<span class="r sym">[</span><span class="r num">15</span><span class="r sym">]</span> <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;blue&quot;</span>  <span class="r str">&quot;green&quot;</span>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://news.mrdwab.com/2009-11-30/sampling-with-replacement-in-r/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple sampling with R</title>
		<link>http://news.mrdwab.com/2009-11-29/simple-sampling-with-r/</link>
		<comments>http://news.mrdwab.com/2009-11-29/simple-sampling-with-r/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 09:10:08 +0000</pubDate>
		<dc:creator>Ananda</dc:creator>
				<category><![CDATA[Geekiness]]></category>
		<category><![CDATA[Useless Knowledge]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[sampling]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://news.mrdwab.com/?p=530</guid>
		<description><![CDATA[<p>I mentioned in an earlier post (Am I inconsistent?) that I got interested in R because Amy had asked me to help her with some sampling at one point. Since that was my starting point, I thought I would share some of my experiments with you.</p>
<p>In this post:</p>

Simple random sampling
Simple random sampling with a seed
Sorting [...]]]></description>
			<content:encoded><![CDATA[<p>I mentioned in an earlier post (<a href="http://news.mrdwab.com/2009-11-15/am-i-inconsistent/" title="Am I inconsistent?">Am I inconsistent?</a>) that I got interested in R because Amy had asked me to help her with some sampling at one point. Since that was my starting point, I thought I would share some of my experiments with you.</p>
<p>In this post:</p>
<ol>
<li>Simple random sampling</li>
<li>Simple random sampling with a seed</li>
<li>Sorting your sample</li>
</ol>
<p><span id="more-530"></span></p>
<pre class="r"><span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r slc"># Sample 30 from 1 to 300</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r kwc">sample</span><span class="r sym">(</span><span class="r num">300</span><span class="r sym">,</span> <span class="r num">30</span><span class="r sym">)</span>
 <span class="r sym">[</span><span class="r num">1</span><span class="r sym">]</span>  <span class="r num">44 200 258 290 165 132 287  70 118 241  11 191 194 192</span>
<span class="r sym">[</span><span class="r num">15</span><span class="r sym">]</span> <span class="r num">127 143  55 217  49 130 263 203  26  46 251 142  72 107</span>
<span class="r sym">[</span><span class="r num">29</span><span class="r sym">]</span>  <span class="r num">77  31</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r slc"># A second time</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r kwc">sample</span><span class="r sym">(</span><span class="r num">300</span><span class="r sym">,</span> <span class="r num">30</span><span class="r sym">)</span>
 <span class="r sym">[</span><span class="r num">1</span><span class="r sym">]</span> <span class="r num">101 108  25 289 257 102 110  45 173 197 202 168 134 225</span>
<span class="r sym">[</span><span class="r num">15</span><span class="r sym">]</span> <span class="r num">184 155 226  68  86  51  90 204 159 263 245 201 213 169</span>
<span class="r sym">[</span><span class="r num">29</span><span class="r sym">]</span> <span class="r num">127  11</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r slc"># What about a replicable sample?</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r kwc">set.seed</span><span class="r sym">(</span><span class="r num">123</span><span class="r sym">)</span>
<span class="r sym">&gt;</span> <span class="r kwc">sample</span><span class="r sym">(</span><span class="r num">300</span><span class="r sym">,</span> <span class="r num">30</span><span class="r sym">)</span>
 <span class="r sym">[</span><span class="r num">1</span><span class="r sym">]</span>  <span class="r num">87 236 122 263 279  14 156 262 162 133 278 132 196 165</span>
<span class="r sym">[</span><span class="r num">15</span><span class="r sym">]</span>  <span class="r num">30 257  70  12  93 269 250 194 179 276 181 195 150 163</span>
<span class="r sym">[</span><span class="r num">29</span><span class="r sym">]</span>  <span class="r num">79  40</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r slc"># A second time</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r kwc">set.seed</span><span class="r sym">(</span><span class="r num">123</span><span class="r sym">)</span>
<span class="r sym">&gt;</span> <span class="r kwc">sample</span><span class="r sym">(</span><span class="r num">300</span><span class="r sym">,</span> <span class="r num">30</span><span class="r sym">)</span>
 <span class="r sym">[</span><span class="r num">1</span><span class="r sym">]</span>  <span class="r num">87 236 122 263 279  14 156 262 162 133 278 132 196 165</span>
<span class="r sym">[</span><span class="r num">15</span><span class="r sym">]</span>  <span class="r num">30 257  70  12  93 269 250 194 179 276 181 195 150 163</span>
<span class="r sym">[</span><span class="r num">29</span><span class="r sym">]</span>  <span class="r num">79  40</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r slc"># Can we sort the output to make the result easy to see?</span>
<span class="r sym">&gt;</span> <span class="r slc"># ========================================================</span>
<span class="r sym">&gt;</span> <span class="r kwc">set.seed</span><span class="r sym">(</span><span class="r num">123</span><span class="r sym">)</span>
<span class="r sym">&gt;</span> <span class="r kwc">sort</span><span class="r sym">(</span><span class="r kwc">sample</span><span class="r sym">(</span><span class="r num">300</span><span class="r sym">,</span> <span class="r num">30</span><span class="r sym">))</span>
 <span class="r sym">[</span><span class="r num">1</span><span class="r sym">]</span>  <span class="r num">12  14  30  40  70  79  87  93 122 132 133 150 156 162</span>
<span class="r sym">[</span><span class="r num">15</span><span class="r sym">]</span> <span class="r num">163 165 179 181 194 195 196 236 250 257 262 263 269 276</span>
<span class="r sym">[</span><span class="r num">29</span><span class="r sym">]</span> <span class="r num">278 279</span>
</pre>
<h2>What is &#8220;set.seed&#8221; for?</h2>
<p>The &#8220;set.seed&#8221; function in R can help when you want to verify or replicate a sample. In this case, the seed I used was &#8220;123&#8243; (but it can be any number you want it to be). So, if you run the same sample with the same seed in R, you should get the same results as me. If you ran the same sample without a seed, each time, you would get a different result.</p>
<p>Disclaimer: I&#8217;m not by any measures an expert in R. I have just been experimenting with the software. By the way, if you want to experiment with any of the code I mention here, you can first <a href="http://www.r-project.org">download R</a>, copy the code, and in R, go to &#8220;Edit > Paste commands only&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://news.mrdwab.com/2009-11-29/simple-sampling-with-r/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Page Creator is gone&#8230;.</title>
		<link>http://news.mrdwab.com/2009-11-23/google-page-creator-is-gone/</link>
		<comments>http://news.mrdwab.com/2009-11-23/google-page-creator-is-gone/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 17:29:31 +0000</pubDate>
		<dc:creator>Ananda</dc:creator>
				<category><![CDATA[(all categories)]]></category>
		<category><![CDATA[General News]]></category>
		<category><![CDATA[Humor]]></category>
		<category><![CDATA[India]]></category>
		<category><![CDATA[Scribbles]]></category>
		<category><![CDATA[Stories]]></category>
		<category><![CDATA[Website]]></category>
		<category><![CDATA[archives]]></category>

		<guid isPermaLink="false">http://news.mrdwab.com/?p=482</guid>
		<description><![CDATA[<p>And, they didn&#8217;t do such a great job of transferring the Google Page Creator content to Google Sites. So, I&#8217;ve decided to delete the content from Google Page Creator and transfer it here instead. This site has so much random content already; four more random articles shouldn&#8217;t make too much of a difference.</p>
<p>Read on to [...]]]></description>
			<content:encoded><![CDATA[<p>And, they didn&#8217;t do such a great job of transferring the Google Page Creator content to Google Sites. So, I&#8217;ve decided to delete the content from Google Page Creator and transfer it here instead. This site has so much random content already; four more random articles shouldn&#8217;t make too much of a difference.</p>
<p>Read on to find:</p>
<ul>
<li><a href="http://news.mrdwab.com/2009-11-23/do-indians-have-a-sense-of-humor/">Do Indians have a sense of humor AKA &#8220;Irony over the stinky river&#8230;.&#8221;</a></li>
<li><a href="http://news.mrdwab.com/2009-11-23/marina-beach/">Marina Beach AKA &#8220;The sweet smelling ocean spray on Chennai’s shores….&#8221;</a></li>
<li><a href="http://news.mrdwab.com/2009-11-23/wetwo-brand/">Wetwo Brand AKA &#8220;Population Control, Indian Style….&#8221;</a></li>
<li><a href="http://news.mrdwab.com/2009-11-23/submission/">Submission AKA &#8220;Quick, shhh! The Big-boss has just entered….&#8221;</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://news.mrdwab.com/2009-11-23/google-page-creator-is-gone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making an A6 booklet in OpenOffice.org the easy way</title>
		<link>http://news.mrdwab.com/2009-11-19/making-an-a6-booklet-in-openoffice-org-the-easy-way/</link>
		<comments>http://news.mrdwab.com/2009-11-19/making-an-a6-booklet-in-openoffice-org-the-easy-way/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 02:46:02 +0000</pubDate>
		<dc:creator>Ananda</dc:creator>
				<category><![CDATA[(all categories)]]></category>
		<category><![CDATA[Geekiness]]></category>
		<category><![CDATA[OpenOffice.org]]></category>
		<category><![CDATA[elementary]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://news.mrdwab.com/?p=460</guid>
		<description><![CDATA[<p>Tutorial level: Elementary</p>
<p>I recently had to create an A6 booklet for an event that was being hosted by DHAN Foundation/Tata-Dhan Academy. At first, I thought it would be a nightmare to design and print it—particularly because I only had one day to do the layout for a 60+ page book—but it turns out that using [...]]]></description>
			<content:encoded><![CDATA[<p>Tutorial level: Elementary</p>
<p>I recently had to create an A6 booklet for an event that was being hosted by DHAN Foundation/Tata-Dhan Academy. At first, I thought it would be a nightmare to design and print it—particularly because I only had one day to do the layout for a 60+ page book—but it turns out that using OpenOffice.org (OOo) Writer makes the task quite simple.</p>
<p><span id="more-460"></span></p>
<p>Before going into details, here&#8217;s the logic I applied. One option was to assume I was only printing one copy of the book. In that case, it would make sense to lay the book out onto 7.5 A4 sheets (eight pages will fit on one sheet when printed double-sided). But, since I was going to print a couple of thousands of these, I could do the smart thing: do a simple double-sided “brochure” print from OOo Writer, turn my stack of paper around, and print the same file again. That way, you end up with two sets of the same page on each sheet, which means you can simply cut the sheet in half, fold the cut pieces in half, and you have two books ready to be stapled!</p>
<p>Here&#8217;s the simple step-by-step solution:</p>
<ol>
<li>Create an A6 size page in the “Styles and Formatting” panel (A6 is 105mm x 148mm).</li>
<li>Go ahead and type your content as you normally would.</li>
<li>When you are done, go to “File > Print” and in the dialog box, click “Options”. Under “Options” make sure that “Brochure” is selected.</li>
<li>Print a full set of your document (you can duplex too, though this can be done later in the copying stage). </li>
<li>Turn your stack of printed papers around and print a full set again.</li>
</ol>
<p>Imagining you had just a four-page document, you would have something that resembled Illustration 1.</p>
<p><div id="attachment_461" class="wp-caption alignright" style="width: 222px"><a href="http://news.mrdwab.com/2009-11-19/making-an-a6-booklet-in-openoffice-org-the-easy-way/a6-layout/" rel="attachment wp-att-461"><img src="http://news.mrdwab.com/wp-content/uploads/2009/11/A6-Layout-212x300.jpg" alt="If you were creating a four-page booklet, your print might look something like this." title="A6 Layout" width="212" height="300" class="size-medium wp-image-461" /></a><p class="wp-caption-text">If you were creating a four-page booklet, your print might look something like this.</p></div>Now, all you would have to do is cut the sheet in half, fold, and you&#8217;re good to go!</p>
<p>For me, the nice thing about doing the layout this way is that I can easily have not only a print-ready document, but I can also use the PDF export feature built-in to OpenOffice.org Writer and I can also easily have a nice PDF to share say by email or online—all with no extra work.<br />
It really is that easy!</p>
<p>Of course, another option is to simply create an A5 booklet and reduce it to 70% of the original size get the same results, but I think this is much more logical.</p>
<p>By the way, the only time I typically use metric is when I&#8217;m designing for A sheets. Here&#8217;s the breakdown of common A sizing in millimeters:</p>
<ul>
<li>A3 = 297 × 420</li>
<li>A4 = 210 × 297</li>
<li>A5 = 148 × 210</li>
<li>A6 = 105 × 148</li>
</ul>
<p>You&#8217;ve probably noticed that each smaller size is pretty much exactly half of the previous size. This is one advantage over the letter size used in the US. You can read more about <a href="http://en.wikipedia.org/wiki/Paper_size">page sizing standards at Wikipedia</a>.</p>
<h2>Downloads</h2>
<p>The following files might help to give you an idea of what to expect in terms of different types of outputs.</p>
<ul>
<li>OpenOffice.org Writer file [<a href='http://news.mrdwab.com/wp-content/uploads/2009/11/A6-Layout-in-OpenOffice.odt'>download</a>]</li>
<li>Direct PDF export from OpenOffice.org [<a href='http://news.mrdwab.com/wp-content/uploads/2009/11/A6-Layout-in-OpenOffice-regular-export.pdf'>download</a>]</li>
<li>PDF of what you can expect if you used &#8220;File > Print&#8221; with &#8220;Brochure&#8221; selected [<a href='http://news.mrdwab.com/wp-content/uploads/2009/11/A6-Layout-in-OpenOffice-printed-version.pdf'>download</a>]</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://news.mrdwab.com/2009-11-19/making-an-a6-booklet-in-openoffice-org-the-easy-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Am I inconsistent?</title>
		<link>http://news.mrdwab.com/2009-11-15/am-i-inconsistent/</link>
		<comments>http://news.mrdwab.com/2009-11-15/am-i-inconsistent/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 14:27:53 +0000</pubDate>
		<dc:creator>Ananda</dc:creator>
				<category><![CDATA[(all categories)]]></category>
		<category><![CDATA[(non) fiction]]></category>
		<category><![CDATA[Geekiness]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[OpenOffice.org]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[students]]></category>
		<category><![CDATA[Tata-Dhan Academy]]></category>

		<guid isPermaLink="false">http://news.mrdwab.com/?p=458</guid>
		<description><![CDATA[<p>I won&#8217;t pretend that I don&#8217;t have any illegal software installed on my computers, but here are a couple of scenarios that have occurred at work recently.</p>
<p>A student came to me with his new laptop and asked me &#8220;Can I have a copy of Office 2007?&#8221; </p>
<p>I thought for a minute and said, &#8220;Um, why? [...]]]></description>
			<content:encoded><![CDATA[<p>I won&#8217;t pretend that I don&#8217;t have any illegal software installed on my computers, but here are a couple of scenarios that have occurred at work recently.</p>
<p>A student came to me with his new laptop and asked me &#8220;Can I have a copy of Office 2007?&#8221; </p>
<p>I thought for a minute and said, &#8220;Um, why? What do you have right now?&#8221;</p>
<p>&#8220;They installed Office 2003 when I purchased the laptop.&#8221;</p>
<p>&#8220;So, what&#8217;s wrong with that version.&#8221;</p>
<p>Silence.</p>
<p><span id="more-458"></span></p>
<p>&#8220;Is there anything in particular that you need to do with Office 2007? What are the features that are different.&#8221;</p>
<p>Still silence, and some uncomfortable looks. </p>
<p>&#8220;It&#8217;s easier to use,&#8221; the student says finally, at which point I decide it&#8217;s time to be mean and have some fun.</p>
<p>&#8220;Wait. Let me see if I understand you correctly,&#8221; I start. &#8220;You&#8217;re telling me that you want me to steal for you&#8211;you want me to engage in criminal activities&#8211;just to make your life easier?&#8221;</p>
<p>More recently, I observed two students lingering over my colleague&#8217;s desk with their laptops in hand, waiting for &#8220;DJ Orissa&#8221; (that&#8217;s the nickname I&#8217;ve given my colleague) to finish up whatever he was working on.</p>
<p>&#8220;What&#8217;s going on here?&#8221; I ask them.</p>
<p>&#8220;We&#8217;ve come to get SPSS from Jena Sir,&#8221; they say, totally straight-faced. </p>
<p>&#8220;Really?&#8221; I ask, then look over at DJ. &#8220;What are you going to use SPSS for? Why do you need it?&#8221; (These are first term students, by the way, most of whom have only recently started exploring quantitative analysis, research, economics, and so on.)</p>
<p>Here, again, some silence. And now, DJ is also looking at the students to see if they are able to give a good reason that they should be given the software. When they can&#8217;t, DJ and I decide that perhaps they don&#8217;t need the software. Amy, who is also there at work with me, points them to <a href="http://en.wikipedia.org/wiki/Comparison_of_statistical_packages" target="_blank">Wikipedia&#8217;s article comparing different statistical software</a>, and we decide that if they do some homework and can give us convincing reasons to give them illegal software, we might begin to take them more seriously.</p>
<p>But, am I being inconsistent in my actions here? On the one hand, I have illegal software installed on my computers (although, for the most part, my work computer is illegal-software free) but on the other hand, I won&#8217;t let my students come to me and get illegal software to install on their computer. I don&#8217;t really think that I&#8217;m being inconsistent though. Part of the reason I have this software is for my own &#8220;self-teaching&#8221; and I only download the software that I really think has things I&#8217;d like to learn how to do. Then, after figuring something out with commercial software, I look to open-source and freeware to see if I can replicate the effect with them. That, for example, is how I came to love <a href="http://www.openoffice.org/" target="_blank">OpenOffice.org</a>.</p>
<p>My exploration of software, until recently, had nothing to do with statistical tools. Then, Amy had to go to the US for a couple of weeks and needed my help doing some random sampling for her (using Stata). At that point, she had a system with some four or five steps and three or four files being created. I figured there must be a better way, so I downloaded <a href="http://www.r-project.org/" target="_blank">R</a> to see what it was all about. It turns out that in R, something like that is a simple single line of syntax.</p>
<p>So, coming back now to the students situation, I asked DJ Orissa what the students would need to do.</p>
<p>&#8220;Well,&#8221; he said, &#8220;SPSS makes it really easy to create a <a href="http://en.wikipedia.org/wiki/Correlation_matrix#Correlation_matrices" target="_blank">correlation matrix</a> between your variables. You can do it in Excel also, but it is not as easy. And, SPSS will also give you the degree of significance for each pair of variables in the matrix.&#8221; With that, I asked him to send me some data and a copy of the matrix generated by SPSS and I said I&#8217;d explore some alternatives and get back to him.</p>
<p>Back to R now. Getting a correlation matrix is a piece of cake. Unfortunately, significance is not included in their table. So, I hunt a little bit more and find out that you can download an additional library for R (R is totally modular in that way) and get what you need in a matter of seconds. That, and you can create a nice <a href="http://en.wikipedia.org/wiki/Scatterplot" target="_blank">scatter-plot</a> matrix that lets you visualize your data. Pretty spiffy.</p>
<p>But, as Amy pointed out, nobody likes syntax (which is too bad, because even with SPSS, most of its power probably lies in the things you can do if you learn the syntax) but syntax is required for working with R. So, are there even other alternatives? How about <a href="http://statpages.org/miller/openstat/" target="_blank">OpenStat</a>? For someone who has used SPSS, the interface (menu order and so on) are pretty easy to learn quickly, and, while you don&#8217;t get the same nice tables that you will get from SPSS, you get all the same information in a matter of mouse clicks.</p>
<p>Amy had another observation though, and it&#8217;s the self-perceived &#8220;higher status&#8221; that accompanies someone who says they have SPSS&#8211;even if all that they know how to do is enter data into the program. At the Academy, you are some kind of data-god if you claim to know how to use SPSS, and you are practically the god-of-all-gods if you also have a copy of the ridiculously overpriced (almost $1,800!) software. When Amy mentioned her observation, I remembered a student from the eight batch of PDM students who actually put on his resume that he knew how to use SPSS. I doubt that he knew how to do very much though&#8230;.</p>
<p>But this gets me back to whether I&#8217;m consistent or not. A lot of times on my weekends, I like to download some new software and figure it out. I&#8217;ve actually gotten pretty efficient at it, to the point that, with many programs, I am able to figure out how to use it pretty effectively within a day. </p>
<p>On the other hand, the students that come to me asking for illegal software typically belong to the &#8220;95%&#8221; portion of the &#8220;95/5&#8243; rule that you hear about common programs like Microsoft Word or Microsoft Excel. The &#8220;rule&#8221; (which is probably mythical, but I&#8217;m beginning to think it&#8217;s true) essentially says that 95% of the users of such software only know how to use 5% of the software&#8217;s features. In other words, most of the people who write &#8220;Microsoft Office&#8221; under the computer skills portion of their resume probably really mean to write that they know how to create a file, type, do some rudimentary formatting like making text bold or italic, cut and paste, and that&#8217;s about it.</p>
<p>Now, if some students had come to me and gotten a copy of OpenOffice.org or R or Scribus or the Gimp or Photoscape or [insert name of other open-source or freeware product here] and found that they really had outgrown the product, maybe I would be a little bit more open minded toward their thievery&#8230;.</p>
<p>By the way, SPSS is now PASW now that IBM has bought it.</p>
]]></content:encoded>
			<wfw:commentRss>http://news.mrdwab.com/2009-11-15/am-i-inconsistent/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CintaNotes and TiddlyWiki and Dropbox Fun</title>
		<link>http://news.mrdwab.com/2009-10-20/cintanotes-and-tiddlywiki-and-dropbox-fun/</link>
		<comments>http://news.mrdwab.com/2009-10-20/cintanotes-and-tiddlywiki-and-dropbox-fun/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 02:08:56 +0000</pubDate>
		<dc:creator>Ananda</dc:creator>
				<category><![CDATA[(all categories)]]></category>
		<category><![CDATA[Geekiness]]></category>
		<category><![CDATA[experiments]]></category>
		<category><![CDATA[freeware]]></category>
		<category><![CDATA[web tools]]></category>

		<guid isPermaLink="false">http://news.mrdwab.com/?p=435</guid>
		<description><![CDATA[<p>Kiran just reminded me the other day of something I heard about some one year ago or something, but which I had sort of shrugged off because of my slow internet connection: Dropbox. Well, with the reminder came with another set of exploration, in particular, beyond backup, sharing, and synchronization&#8211;all of which Dropbox does really [...]]]></description>
			<content:encoded><![CDATA[<p>Kiran just reminded me the other day of something I heard about some one year ago or something, but which I had sort of shrugged off because of my slow internet connection: Dropbox. Well, with the reminder came with another set of exploration, in particular, beyond backup, sharing, and synchronization&#8211;all of which Dropbox does really well&#8211;can it really do anything more for me?</p>
<p>Let&#8217;s see where the fun takes us&#8230;.<br />
<span id="more-435"></span><br />
I wanted to see how much of the Microsoft Office suite I could replace with free programs. <a href="http://www.openoffice.org/">OpenOffice.org</a> did a great job with replacing the standard everyday stuff&#8211;Microsoft Word and Excel, for example&#8211;but it didn&#8217;t have anything to replace <a href="http://office.microsoft.com/en-us/onenote/default.aspx">OneNote</a>, which had quickly become one of my favorite programs to use when I was completing my masters.</p>
<p>I tried a few different &#8220;personal wiki&#8221; type programs, my favorite of which was <a href="http://www.tiddlywiki.com/">TiddlyWiki</a>. If you haven&#8217;t tried it out yet, you should&#8211;it&#8217;s really pretty cool. A one file notebook, with some pretty slick navigation. The thing I didn&#8217;t like about TiddlyWiki though was that it required you to know or use at least a little bit of their wiki markup. The payoff was that by doing so, you ended up with a pretty fun interlinked wiki that was, in the developer&#8217;s terms, non-linear. This makes sense to a certain level, because we don&#8217;t really think linearly, but it can be a little difficult to get the hang of if you have been conditioned to use files and folders in your physical life as well as in your computerized life.</p>
<p>So, I explored some more, and I found <a href="http://cintanotes.com/">CintaNotes</a>&#8211;a lightweight portable application that seems to do just enough of what I actually need to have done and without too much extra fluff. (&#8220;How lightweight?&#8221; you ask. When I start OneNote, it requires some 25MB of RAM&#8211;CintaNotes comes in under 4MB.) All I really need, after all, is a quick place to type some notes&#8211;like ideas for the <a href="http://thegrumpywriter.wordpress.com">Grumpy Writer&#8217;s Grumps</a> or drafts of emails and so on&#8211;and I don&#8217;t want to have to bother about saving my files, where I saved them, what name I used, and so on. CintaNotes does that. It just has a &#8220;backup&#8221; folder that includes hourly, daily, and weekly backups of my files, it autosaves, saves on close, lets me search&#8230; in other words, it just lets me get to work quickly.</p>
<p>These two programs were pretty well-positioned to do everything I typically did with OneNote; but, could it be even better?</p>
<p>It turns out that, yes, it could be a lot better. This is where services like <a href="https://www.dropbox.com/referrals/NTI1NTY1MjQ5">Dropbox</a> or <a href="http://www.syncplicity.com/">Syncplicity</a> come into play. And, by &#8220;piece of cake&#8221; I mean a hell of a lot easier than you could ever expect using OneNote&#8217;s built in synchronizing options. All you do is download the files to your synchronized folders. Then whether you are using your computer at work or at home, you have the most recent notes that you&#8217;ve been working on&#8230;.</p>
<hr /><strong>Afterthought #1</strong>: One of the advantages of TiddlyWiki here is that you could easily view your notes online. So, what does that mean for you? Well, you could easily create a low-maintenance website with TiddlyWiki for free. First, simply unzip your empty TiddlyWiki html page to your public folder in, say, Dropbox; second, figure out the URL you would need to share your public TiddlyWiki file (which will probably be something awkward to remember); third, go to a site like <a href="http://tr.im">http://tr.im</a> and &#8220;trim&#8221; your long URL into something more user-friendly. Some sites let you customize your trimmed URL. Not quite the same as having your own domain name, but then again, this is free!</p>
<p><strong>Afterthought #2</strong>: With a little bit of creativity extending from Afterthought #1, you can create a pretty full-fledged website using your 2GB+ of free storage space. For example, you can upload your pictures, music files, and so on to your public folder, copy the relevant links, add them to your TiddlyWiki, and you&#8217;re set. Again, since you only have to worry about maintaining one page, that&#8217;s pretty nice. (Oh, and make sure that one of the first things you do when you start using TiddlyWiki is that you turn off the creating a file backup feature. When you think about it, since a lot of these online storage and synchronizing tools have a built-in versioning system, keeping multiple backups on top of that is somewhat redundant.)</p>
<p><strong>Afterthought #3</strong>: Some people may not like CintaNotes for exactly the reasons I do like it. In essence, all that you get with CintaNotes is like a nice notepad that gives you super fast search, note tagging, and so on. This makes it not quite OneNote because with OneNote it was easy to attach screenclippings, soundclips, and more to anything you were working on. On the other hand, it is not fully developed and lacks some otherwise important features, like linking to files, or even linking to other notes.</p>
<p><strong>Afterthought #4</strong>: I know that neither of these are do exactly what OneNote is capable of doing. If you had a tablet PC, for example, OneNote even lets you write on your computer as if it were a notepad. The closest things you can get to that (as far as I&#8217;ve found) are <a href="http://notebook.zoho.com" target="_blank">Zoho Notebook</a> and <a href="http://www.evernote.com">Evernote</a>. Still, try everything out and see what works best for you.</p>
<p>Here are the links:</p>
<ul>
<li><a href="http://cintanotes.com/">CintaNotes</a></li>
<li><a href="http://www.tiddlywiki.com/">TiddlyWiki</a></li>
<li><a href="http://notebook.zoho.com" target="_blank">Zoho Notebook</a></li>
<li><a href="http://www.evernote.com" target="_blank">Evernote</a></li>
<li><a href="http://tr.im/">tr.im</a></li>
<li><a href="https://www.dropbox.com/referrals/NTI1NTY1MjQ5">Dropbox</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://news.mrdwab.com/2009-10-20/cintanotes-and-tiddlywiki-and-dropbox-fun/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Drop caps with OpenOffice.org Writer</title>
		<link>http://news.mrdwab.com/2009-09-21/drop-caps-with-openoffice-org-writer/</link>
		<comments>http://news.mrdwab.com/2009-09-21/drop-caps-with-openoffice-org-writer/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 15:23:44 +0000</pubDate>
		<dc:creator>Ananda</dc:creator>
				<category><![CDATA[(all categories)]]></category>
		<category><![CDATA[Geekiness]]></category>
		<category><![CDATA[OpenOffice.org]]></category>
		<category><![CDATA[elementary]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://news.mrdwab.com/?p=419</guid>
		<description><![CDATA[<p>Tutorial Level: Elementary</p>
<p style="text-align: center;"></p>
<p>From time to time, I like some minor embellishments in my design, and one such embellishment I use is the drop cap that you commonly find in magazines and so on. In OpenOffice.org (OOo) it is pretty easy to do this throughout a document. As with the last tutorial, this one [...]]]></description>
			<content:encoded><![CDATA[<p>Tutorial Level: Elementary</p>
<p style="text-align: center;"><a href="http://news.mrdwab.com/wp-content/uploads/2009/09/screenshot.5.png"><img class="size-full wp-image-420 aligncenter" title="Drop Caps with OpenOffice.org Writer" src="http://news.mrdwab.com/wp-content/uploads/2009/09/screenshot.5.png" alt="Drop Caps with OpenOffice.org Writer" width="381" height="262" /></a></p>
<p>From time to time, I like some minor embellishments in my design, and one such embellishment I use is the drop cap that you commonly find in magazines and so on. In OpenOffice.org (OOo) it is pretty easy to do this throughout a document. As with <a href="http://news.mrdwab.com/2009-07-26/automation-with-openoffice-org-writer/">the last tutorial</a>, this one is also going to focus on how it can be done automatically using “Styles and Formatting” rather than having to manually recreate the effect on each paragraph.</p>
<p><span id="more-419"></span></p>
<p>First, there is one assumption. We do not want a drop cap on all paragraphs—that would look silly. The only place we want the drop cap is in the first paragraph immediately following a level 1 heading (which we&#8217;ll assume is being used for chapter titles and so on).</p>
<p>With that assumption, here&#8217;s how I would proceed.</p>
<div id="attachment_425" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-425" href="http://news.mrdwab.com/2009-09-21/drop-caps-with-openoffice-org-writer/screenshot-1-2/"><img class="size-medium wp-image-425" title="Paragraph Style Organizer Tab" src="http://news.mrdwab.com/wp-content/uploads/2009/09/screenshot.1-300x230.png" alt="Illustration 1: Paragraph Style Organizer Tab (click for more info)" width="300" height="230" /></a><p class="wp-caption-text">Illustration 1: Paragraph Style Organizer Tab (click for more info)</p></div>
<ol>
<li>Create a style called “Text body drop cap”.
<ul>
<li>To do this, first open “Styles and Formatting”, then right click in the “Paragraph Styles” section and select “new”.</li>
<li>Under the “Organizer” tab, use the following settings: “Next Style” is “Text body”. “Linked With” is also “Text body” (see Illustration 1).</li>
<li>Under the “Drop Caps” tab, make sure that “Display drop caps” is checked and modify according to your preference. Note here that you can either have single letter drop caps, multiple letter drop caps, or whole word drop caps (See Illustration 2).</li>
<li>When you&#8217;re done setting your styles, click on “OK.”</li>
</ul>
</li>
<li>With “Styles and Formatting” still open, style your “Heading 1” to your liking. Also, on the “Organizer” tab, change “Next Style” from “Text body” to your new style, “Text body drop cap”.</li>
</ol>
<div id="attachment_426" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-426" href="http://news.mrdwab.com/2009-09-21/drop-caps-with-openoffice-org-writer/screenshot-2/"><img class="size-medium wp-image-426" title="Paragraph Styles Drop Caps Tab" src="http://news.mrdwab.com/wp-content/uploads/2009/09/screenshot.2-300x230.png" alt="Settings for Drop Caps under the Paragraph Styles menu (click for more info)" width="300" height="230" /></a><p class="wp-caption-text">Illustration 2: Settings for Drop Caps under the Paragraph Styles menu (click for more info)</p></div>
<p>And that&#8217;s it! Now you have nice drop caps for your document.</p>
<h2>Making your drop caps fancy</h2>
<p>Sometimes, it is nice to make your drop caps look a little different from the rest of your text by, say, using a different font or a different color. Again, using “Styles and Formatting” this is quite easy. What is required is that we also create what&#8217;s called a “character style” to be applied to the drop cap. (OOo lets you create styles for paragraphs, characters, frames, pages, and lists.)</p>
<p>You&#8217;ll see that there is already a character style called “Drop Caps”. Right click on that and select “Modify” to get a dialogue box where you can change things like the font, the font color, and so on. Then, go back to the third sub-point of step two above (Illustration 2) and, where it says “Character Style”, select “Drop Caps” from the drop-down menu.</p>
<h2>Additional notes</h2>
<p>One of the things that OOo does automatically for you is eliminate drop caps or make drop caps smaller according to your paragraph length. If, for example, your drop caps were set to be three lines, but your paragraph is only one line, it would not have a drop cap; similarly, if the paragraph were two lines, the drop cap would only cover those two lines.</p>
<p>Another thing you can do is adjust the spacing between your drop cap and the rest of your text. This can be useful if the font you&#8217;ve used for the drop cap is particularly ornamental and needs to be visually offset from the rest of the text.</p>
<h3>Downloads</h3>
<p>Download the following OpenDocument text file to see what my settings were in OOo and the PDF to see what the output could look like.</p>
<ul>
<li>OpenOffice.org Writer file [<a href="http://news.mrdwab.com/wp-content/uploads/2009/09/OpenOffice-Drop-Caps.odt">download</a>]</li>
<li>Final PDF output [<a href="http://news.mrdwab.com/wp-content/uploads/2009/09/OpenOffice-Drop-Caps.pdf">download</a>]</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://news.mrdwab.com/2009-09-21/drop-caps-with-openoffice-org-writer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disappearing Photos</title>
		<link>http://news.mrdwab.com/2009-08-10/disappearing-photos/</link>
		<comments>http://news.mrdwab.com/2009-08-10/disappearing-photos/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 16:02:26 +0000</pubDate>
		<dc:creator>Ananda</dc:creator>
				<category><![CDATA[(all categories)]]></category>
		<category><![CDATA[General News]]></category>
		<category><![CDATA[Pictures]]></category>
		<category><![CDATA[Website]]></category>
		<category><![CDATA[photo-set]]></category>

		<guid isPermaLink="false">http://news.mrdwab.com/?p=366</guid>
		<description><![CDATA[<p>I was looking through my posts the other day and I just realized that somehow, my Gallery2 installation totally disappeared. What that means, unfortunately, is that there are a whole bunch of old posts (like my 2007 India Vacation posts) which have a whole bunch of broken links.</p>
<p>Browsing through my file manager, I found that [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking through my posts the other day and I just realized that somehow, my Gallery2 installation totally disappeared. What that means, unfortunately, is that there are a whole bunch of old posts (like my <a href="http://news.mrdwab.com/category/india/2007-vacation/">2007 India Vacation</a> posts) which have a whole bunch of broken links.</p>
<p>Browsing through my file manager, I found that all the albums were still there, but the way that Gallery2 dealt out photos hid their actual album location and gave some sort of &#8220;fake&#8221; link. I tried to reinstall Gallery2, but in the process got a whole bunch of errors, so I thought I would explore the Gallery3.</p>
<p>So, now, all of the photos have been migrated over to Gallery3 (which I think I already like a bit more than Gallery2), and when I have some time to do some boring link-fixing, I guess I will get around to fixing my broken links. In the meantime, if you find any references to photos which show a broken photo placeholder, you can head over to <a href="http://photos.mrdwab.com">photos.mrdwab.com</a> and see if you can find them there.</p>
]]></content:encoded>
			<wfw:commentRss>http://news.mrdwab.com/2009-08-10/disappearing-photos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automation with OpenOffice.org Writer</title>
		<link>http://news.mrdwab.com/2009-07-26/automation-with-openoffice-org-writer/</link>
		<comments>http://news.mrdwab.com/2009-07-26/automation-with-openoffice-org-writer/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 10:30:16 +0000</pubDate>
		<dc:creator>Ananda</dc:creator>
				<category><![CDATA[(all categories)]]></category>
		<category><![CDATA[Geekiness]]></category>
		<category><![CDATA[OpenOffice.org]]></category>
		<category><![CDATA[intermediate]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://news.mrdwab.com/?p=245</guid>
		<description><![CDATA[<p>Tutorial Level: Intermediate</p>
<p>At the Tata-Dhan Academy where I work, with each new batch of students, we try to promote the adoption of freeware or open-source software instead of promoting the already ridiculous levels of piracy that goes on around here. So, during our orientation, we introduce the students to OpenOffice.org—something which, unfortunately, causes many of [...]]]></description>
			<content:encoded><![CDATA[<p>Tutorial Level: Intermediate</p>
<p>At the <strong>Tata-Dhan Academy</strong> where I work, with each new batch of students, we try to promote the adoption of freeware or open-source software instead of promoting the already ridiculous levels of piracy that goes on around here. So, during our orientation, we introduce the students to <a href="http://www.openoffice.org/" target="_blank">OpenOffice.org</a>—something which, unfortunately, causes many of them to groan and complain. However, I really do prefer OpenOffice.org Writer over Microsoft Word for several reasons, and one reason is that I find it very easy to automate certain document layout features that would require a lot of extra work in Microsoft Word.</p>
<p>Consider the following requirements:</p>
<ul>
<li>You&#8217;re compiling an A5-sized booklet of stories.</li>
<li>You want each story to have its title on a right-hand (odd numbered) page, and you want this page to have a background color.</li>
<li>The story itself should also start on a right-hand page, about halfway down the page (maybe you&#8217;re planning to put a picture in the top half of the page).</li>
<li>The first paragraph of the story should have a drop-cap of two to three lines (depending on how many lines the actual paragraph takes up); the rest of the paragraphs 	will have normal styling.</li>
<li>When the story goes beyond its first page, you want the text to be in two columns.</li>
</ul>
<p>So, is there a way to “automate” this to a certain extent?</p>
<p>With OpenOffice.org (OOo) Writer&#8217;s style options, once you&#8217;ve spent a little bit of time setting your styles up, doing something like this is not too difficult.</p>
<p>Here&#8217;s how we go about it.<br />
<span id="more-245"></span></p>
<h2>Step 1: Page Styles</h2>
<div id="attachment_246" class="wp-caption alignright" style="width: 175px"><a rel="attachment wp-att-246" href="http://news.mrdwab.com/2009-07-26/automation-with-openoffice-org-writer/screenshot-6/"><img class="size-medium wp-image-246" title="OpenOffice.org Styles and Formatting" src="http://news.mrdwab.com/wp-content/uploads/2009/07/screenshot.6-165x300.jpg" alt="&quot;Applied Styles&quot; in the Styles and Formatting toolbar in OO.o" width="165" height="300" /></a><p class="wp-caption-text">&quot;Applied Styles&quot; in the Styles and Formatting toolbar in OO.o. Click on image to read more.</p></div><br />
We need at least three page styles here: (1) one for the story&#8217;s title; (2) one for the story&#8217;s first page; and (3) one for the rest of the story. So, heading over to “page styles” section of the “Styles and Formatting” panel in OOo Writer, we can go ahead and create some custom pages. We will also link these three page styles so that the program knows that first it needs to apply page style 1, then page style 2, then page style 3.</p>
<p>For this purpose, I&#8217;ve created three page styles: “Story Title,” “Story First Page,” and “Story Continuation.” For “Story Title” I&#8217;ve set the margins to zero all around, and applied a background color. I&#8217;ve then assigned the “next style” setting to be “Story First Page.” For “Story First Page,” I&#8217;ve set my top page margin to four inches and I&#8217;ve set the “next style” to be “Story Continuation.” For these two pages, I&#8217;ve declared that they are only “right” pages—always an odd number. For “Story Continuation,” I&#8217;ve said to turn the header and footer on (so I can put the story title in the header, and the page number in the footer), I&#8217;ve said that text on the page should be in two columns, and  I&#8217;ve left the “next style” as “Story Continuation.” These pages have been declared as both right and left, so they will continue logically.</p>
<p><div id="attachment_247" class="wp-caption alignnone" style="width: 310px"><a rel="attachment wp-att-247" href="http://news.mrdwab.com/2009-07-26/automation-with-openoffice-org-writer/screenshot-1/"><img class="size-medium wp-image-247" title="The &quot;Next Style&quot; option" src="http://news.mrdwab.com/wp-content/uploads/2009/07/screenshot.1-300x221.jpg" alt="For most elements in the &quot;Styles and Formatting&quot; toolbar, you can define the &quot;Next Style&quot;" width="300" height="221" /></a><p class="wp-caption-text">For most elements in the &quot;Styles and Formatting&quot; toolbar, you can define the &quot;Next Style&quot;. Click on image to read more.</p></div>
<h2>Step 2: Text Styles</h2>
<p>For this particular document, I need at least three text styles: (1) one for the story title; (2) one for the first paragraph of the story (where we have the drop-cap); and (3) one for the rest of the story.</p>
<p>Because I might want to create a table of contents at some time, I will use “Heading 1” for the story title, and I&#8217;ll create two special styles for the rest of the document: “Story Text First Paragraph” and “Story Text Continuation Paragraph.” Remember, I want my story title (Heading 1) to be on the “Story Title” page, my first paragraph (Story Text First Paragraph) to be on a “Story First Page” styled page. So, when I am defining the styles for “Heading 1,” I set the next style to be “Story Text First Paragraph” and I select the options to insert a page break before, with the page style “Story Title” applied. Similarly, for “Story Text First Paragraph,” I set the next style to be “Story Text Continuation Paragraph” and I select the option to insert a page break before with the page style “Story First Page” applied.</p>
<div id="attachment_248" class="wp-caption alignnone" style="width: 310px"><a rel="attachment wp-att-248" href="http://news.mrdwab.com/2009-07-26/automation-with-openoffice-org-writer/screenshot-3/"><img class="size-medium wp-image-248" title="Automatic Page Breaks" src="http://news.mrdwab.com/wp-content/uploads/2009/07/screenshot.3-300x230.jpg" alt="Automatic page breaks are possible with different types of text. " width="300" height="230" /></a><p class="wp-caption-text">Automatic page breaks are possible with different types of text. Click on image to read more.</p></div>
<h2>Step 3: Start Typing</h2>
<p>No. Really, that&#8217;s pretty much it. You can now start typing your document and have it automatically insert blank pages where it should, start pages in the right place, format text correctly for you and so on. You can do some further embellishments, like having the headers on your page automatically change according to the story you&#8217;re on. This is simple to do since you are using a heading, but I think I&#8217;ll save that lesson for another time.</p>
<h2>Downloads</h2>
<p>Anyway, download these two files to see exactly which styles I applied and to view the resulting PDF.</p>
<ul>
<li>OpenOffice.org Writer File [<a href="http://news.mrdwab.com/wp-content/uploads/2009/07/OpenOffice.org-Automation.odt">Download</a>] [<a rel="attachment wp-att-249" href="http://news.mrdwab.com/2009-07-26/automation-with-openoffice-org-writer/openoffice-org-automation/">Read More</a>]</li>
<li>Final PDF output [<a href="http://news.mrdwab.com/wp-content/uploads/2009/07/OpenOffice.org-Automation.pdf">Download</a>] [<a rel="attachment wp-att-250" href="http://news.mrdwab.com/2009-07-26/automation-with-openoffice-org-writer/openoffice-org-automation-2/">Read More</a>]</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://news.mrdwab.com/2009-07-26/automation-with-openoffice-org-writer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More websites&#8230;. I&#8217;m on a roll&#8230;.</title>
		<link>http://news.mrdwab.com/2008-07-06/more-websites-im-on-a-roll/</link>
		<comments>http://news.mrdwab.com/2008-07-06/more-websites-im-on-a-roll/#comments</comments>
		<pubDate>Sun, 06 Jul 2008 15:13:55 +0000</pubDate>
		<dc:creator>Ananda Mahto</dc:creator>
				<category><![CDATA[(all categories)]]></category>
		<category><![CDATA[Website]]></category>
		<category><![CDATA[Tata-Dhan Academy]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://news.mrdwab.com/?p=110</guid>
		<description><![CDATA[<p>Like I said in my last post, I&#8217;ve been trying to keep myself busy.</p>
<p>This time, it is a website to highlight student life and student work at the Tata-Dhan Academy. What can I say? When the students don&#8217;t try to test my skills at detecting plagiarism, I actually enjoy a lot of the work and [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://news.mrdwab.com/2008-07-06/more-websites-im-on-a-roll/2008-07-06_001253/' rel="attachment wp-att-111"><img src="http://news.mrdwab.com/wp-content/uploads/2008/07/2008-07-06_001253-300x243.png" alt="The Student Driven Tata-Dhan Academy Website" title="TDA PDM Website" width="300" height="243" class="alignright size-medium wp-image-111" /></a>Like I said in my last post, I&#8217;ve been trying to keep myself busy.</p>
<p>This time, it is a website to highlight student life and student work at the Tata-Dhan Academy. What can I say? When the students don&#8217;t try to test my skills at detecting plagiarism, I actually enjoy a lot of the work and activities that go on at work&#8230;. </p>
<p>Originally, this was going to be something intgrated with the regular DHAN Foundation website, but the students and I decided we needed something that we could update more frequently and more quickly, so we decided to go with my favorite&#8212;Wordpress. </p>
<p>So, <a href="http://tdapdm.wordpress.com">head on over to the website</a> and check it out!</p>
]]></content:encoded>
			<wfw:commentRss>http://news.mrdwab.com/2008-07-06/more-websites-im-on-a-roll/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
