<?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>stej.com &#187; Ramblings</title>
	<atom:link href="http://stej.com/category/ramblings/feed/" rel="self" type="application/rss+xml" />
	<link>http://stej.com</link>
	<description>Jonathan&#039;s Sandbox</description>
	<lastBuildDate>Thu, 05 Apr 2012 15:41:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Blah Blah Blah</title>
		<link>http://stej.com/blah-blah-blah/</link>
		<comments>http://stej.com/blah-blah-blah/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 15:28:40 +0000</pubDate>
		<dc:creator>Mr. Jonathan</dc:creator>
				<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[Rambelings]]></category>

		<guid isPermaLink="false">http://stej.com/?p=198</guid>
		<description><![CDATA[Ok so whats up with blogging anyway. No one reads this stuff and no one cares. My friend has a blog (creativedevolution.com) and she draws pictures and she gets hundreds of hits a day. I wish I could draw like her. Now I just sound like an idiot!]]></description>
			<content:encoded><![CDATA[<p>Ok so whats up with blogging anyway. No one reads this stuff and no one cares.</p>
<p>My friend has a blog (<a title="creativedevolution.com" href="http://creativedevolution.com" target="_blank">creativedevolution.com</a>) and she draws pictures and she gets hundreds of hits a day. I wish I could draw like her.</p>
<p>Now I just sound like an idiot!</p>
]]></content:encoded>
			<wfw:commentRss>http://stej.com/blah-blah-blah/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Math Class</title>
		<link>http://stej.com/math-class/</link>
		<comments>http://stej.com/math-class/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 20:15:51 +0000</pubDate>
		<dc:creator>Mr. Jonathan</dc:creator>
				<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://stej.com/?p=189</guid>
		<description><![CDATA[I&#8217;m taking a discrete math class. And I&#8217;m bored to tears. Its not totally boring the first 10 mins of class are ok. That&#8217;s when I learn something new then the reset of the class is spent repeating the first 10 mins until everyone &#8220;gets it.&#8221; I can tell I&#8217;m not the only one; there [...]]]></description>
			<content:encoded><![CDATA[<p><html><br />
<body></p>
<p>
I&#8217;m taking a discrete math class. And I&#8217;m bored to tears.
</p>
<p>
Its not totally boring the first 10 mins of class are ok. That&#8217;s when I learn something new then the reset of the class is spent repeating the first 10 mins until everyone &#8220;gets it.&#8221; I can tell I&#8217;m not the only one; there are a few others as board as me.
</p>
<p>
Its not the teacher&#8217;s fault he actually makes this stuff interesting and is very good at explaining it at a level that my 10 year old could understand. Some people just don&#8217;t get it.
</p>
<p>
So here I am board with my laptop trying to look as if I&#8217;m paying attention and I get this bright idea. Make the computer do my homework for me. Yes I&#8217;ve written some code in C# that will calculate the properties of a relation of two sets. I started working on code to build the set but found out that it was already in the C# library so I scraped it.
</p>
<p>
Here is my Relation Class:
</p>
<p><code>
<pre>
    class Relation&lt;T> : Set&lt;Pair&lt;T>>
    {
        private Set&lt;T> _A;
        private Set&lt;T> _B;

        public Relation(Set&lt;T> A, Set&lt;T> B)
        {
            _A = A;
            _B = B;
        }

        public bool Add(T a, T b)
        {
            return Add(new Pair&lt;T>(a, b));
        }

        new public bool Add(Pair&lt;T> item)
        {
            if (_A.Contains(item.a) &#038;&#038; _B.Contains(item.b))
            {
                return base.Add(item);
            }
            else
            {
                return false;
            }
        }

        public bool IsReflexive()
        {
            IEnumerator&lt;Pair&lt;T>> ptr = GetEnumerator();

            while (ptr.MoveNext())
            {
                Pair&lt;T> op = ptr.Current;

                if (!op.a.Equals(op.b))
                {
                    return false;
                }
            }

            return true;
        }

        public bool IsSymmetric()
        {
            IEnumerator&lt;Pair&lt;T>> ptr = GetEnumerator();

            while (ptr.MoveNext())
            {
                Pair&lt;T> op = ptr.Current;

                if (!Contains(new Pair&lt;T>(op.b, op.a)))
                {
                    return false;
                }
            }

            return true;
        }

        public bool IsAntisymmetric()
        {
            IEnumerator&lt;Pair&lt;T>> ptr = GetEnumerator();

            while (ptr.MoveNext())
            {
                Pair&lt;T> op = ptr.Current;

                if (Contains(new Pair&lt;T>(op.b, op.a)))
                {
                    return false;
                }
            }

            return true;
        }

        public bool IsTransitive()
        {
            IEnumerator&lt;Pair&lt;T>> ptr_x = GetEnumerator();

            while (ptr_x.MoveNext())
            {
                Pair&lt;T> x = ptr_x.Current;

                IEnumerator&lt;Pair&lt;T>> ptr_y = GetEnumerator();

                while (ptr_y.MoveNext())
                {
                    Pair&lt;T> y = ptr_y.Current;

                    if (x.b.Equals(y.a))
                    {
                        if (!Contains(new Pair&lt;T>(x.a, y.b)))
                        {
                            return false;
                        }
                    }
                }
            }

            return true;
        }

        public Set&lt;T> SetA
        {
            get
            {
                return _A;
            }
        }

        public Set&lt;T> SetB
        {
            get
            {
                return _B;
            }
        }

        public Matrix&lt;bool> GetMatrix()
        {
            T[] A = _A.ToArray();
            T[] B = _B.ToArray();

            Matrix&lt;bool> M = new Matrix&lt;bool>(A.Length, B.Length);

            Array.Sort(A);
            Array.Sort(B);

            for (int a = 0; a &lt; A.Length; a++)
            {
                for (int b = 0; b &lt; B.Length; b++)
                {
                    if (Contains(new Pair&lt;T>(A[a], B[b])))
                    {
                        M.Set(a, b, true);
                    }
                    else
                    {
                        M.Set(a, b, false);
                    }
                }
            }

            return M;
        }
    }
</pre>
<p></code></p>
<p>
I also created a Matrix Class
</p>
<p><code>
<pre>
    class Matrix&lt;T> where T : struct
    {
        private int _rows;
        private int _cols;
        private T[,] _data;

        public Matrix(int rows, int cols)
        {
            _rows = rows;
            _cols = cols;
            _data = new T[_rows, _cols];
        }

        public Matrix(T[,] data)
            : this(data.GetLength(0), data.GetLength(1))
        {
            Set(data);
        }

        public void Set(T[,] data)
        {
            for (int r = 0; r &lt; _rows; r++)
            {
                for (int c = 0; c &lt; _cols; c++)
                {
                    _data[r, c] = data[r, c];
                }
            }
        }

        public void Set(int row, int col, T value)
        {
            _data[row, col] = value;
        }

        public T Get(int row, int col)
        {
            return _data[row, col];
        }

        public Matrix&lt;T> Join(Matrix&lt;T> rhs)
        {
            if (!(default(T) is bool))
            {
                throw new Exception("join can only be used on the Boolean data type");
            }

            if ((_rows != rhs._rows) || (_cols != rhs._cols))
            {
                throw new Exception("both matrices have to be the same size");
            }

            Matrix&lt;T> tmp = new Matrix&lt;T>(rhs._rows, rhs._cols);

            for (int r = 0; r &lt; rhs._rows; r++)
            {
                for (int c = 0; c &lt; rhs._cols; c++)
                {
                    tmp.Set(r, c, (dynamic)this.Get(r, c) || (dynamic)rhs.Get(r, c));
                }
            }

            return tmp;
        }

        public Matrix&lt;T> Meet(Matrix&lt;T> rhs)
        {
            if (!(default(T) is bool))
            {
                throw new Exception("meet can only be used on the Boolean data type");
            }

            Matrix&lt;T> tmp = new Matrix&lt;T>(rhs._rows, rhs._cols);

            for (int r = 0; r &lt; rhs._rows; r++)
            {
                for (int c = 0; c &lt; rhs._cols; c++)
                {
                    tmp.Set(r, c, (dynamic)this.Get(r, c) &#038;&#038; (dynamic)rhs.Get(r, c));
                }
            }

            return tmp;
        }

        public static Matrix&lt;T> operator +(Matrix&lt;T> lhs, Matrix&lt;T> rhs)
        {
            if (default(T) is bool)
            {
                throw new Exception("join cannot be used on the Boolean data type");
            }

            if ((lhs._rows != rhs._rows) || (lhs._cols != rhs._cols))
            {
                throw new Exception("both matrices have to be the same size");
            }

            Matrix&lt;T> tmp = new Matrix&lt;T>(lhs._rows, lhs._cols);

            for (int r = 0; r &lt; lhs._rows; r++)
            {
                for (int c = 0; c &lt; lhs._cols; c++)
                {
                    tmp.Set(r, c, (dynamic)lhs.Get(r, c) + (dynamic)rhs.Get(r, c));
                }
            }

            return tmp;
        }

        public static Matrix&lt;T> operator -(Matrix&lt;T> lhs, Matrix&lt;T> rhs)
        {
            if (default(T) is bool)
            {
                throw new Exception("join cannot be used on the Boolean data type");
            }

            if ((lhs._rows != rhs._rows) || (lhs._cols != rhs._cols))
            {
                throw new Exception("both matrices have to be the same size");
            }

            Matrix&lt;T> tmp = new Matrix&lt;T>(lhs._rows, lhs._cols);

            for (int r = 0; r &lt; lhs._rows; r++)
            {
                for (int c = 0; c &lt; lhs._cols; c++)
                {
                    tmp.Set(r, c, (dynamic)lhs.Get(r, c) - (dynamic)rhs.Get(r, c));
                }
            }

            return tmp;
        }

        public static Matrix&lt;T> operator *(Matrix&lt;T> lhs, Matrix&lt;T> rhs)
        {
            if (lhs._cols != rhs._rows)
            {
                throw new Exception("matrices are not conformable; lhs columns has to equal rhs rows");
            }

            Matrix&lt;T> tmp = new Matrix&lt;T>(lhs._rows, rhs._cols);

            for (int r = 0; r &lt; lhs._rows; r++)
            {
                for (int c = 0; c &lt; rhs._cols; c++)
                {
                    dynamic value = default(T);

                    for (int x = 0; x &lt; lhs._cols; x++)
                    {
                        if (value is bool)
                        {
                            value = value || ((dynamic)lhs.Get(r, x) &#038;&#038; (dynamic)rhs.Get(x, c));
                        }
                        else
                        {
                            value = value + (dynamic)lhs.Get(r, x) * (dynamic)rhs.Get(x, c);
                        }
                    }

                    tmp.Set(r, c, value);
                }
            }

            return tmp;
        }

        public static Matrix&lt;T> operator *(Matrix&lt;T> lhs, T rhs)
        {
            if (default(T) is bool)
            {
                throw new Exception("join cannot be used on the Boolean data type");
            }

            Matrix&lt;T> tmp = new Matrix&lt;T>(lhs._rows, lhs._cols);

            for (int r = 0; r &lt; lhs._rows; r++)
            {
                for (int c = 0; c &lt; lhs._cols; c++)
                {
                    tmp.Set(r, c, (dynamic)lhs.Get(r, c) * (dynamic)rhs);
                }
            }

            return tmp;
        }

        public Matrix&lt;T> Transpose()
        {
            Matrix&lt;T> tmp = new Matrix&lt;T>(this._cols, this._rows);

            for (int r = 0; r &lt; _rows; r++)
            {
                for (int c = 0; c &lt; _cols; c++)
                {
                    tmp.Set(c, r, Get(r, c));
                }
            }

            return tmp;
        }

        override public String ToString()
        {
            String m = String.Empty;

            for (int r = 0; r &lt; _rows; r++)
            {
                if (r > 0)
                {
                    m += "\n";
                }

                m += "[";

                for (int c = 0; c &lt; _cols; c++)
                {
                    if (c > 0)
                    {
                        m += " ";
                    }

                    T value = Get(r, c);

                    if (value is bool)
                    {
                        m += (dynamic)value == true ? "1" : "0";
                    }
                    else
                    {
                        m += value.ToString();
                    }
                }

                m += "]";
            }

            return m;
        }
    }
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://stej.com/math-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Write?</title>
		<link>http://stej.com/write/</link>
		<comments>http://stej.com/write/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 11:43:44 +0000</pubDate>
		<dc:creator>Mr. Jonathan</dc:creator>
				<category><![CDATA[Ramblings]]></category>

		<guid isPermaLink="false">http://stej.com/?p=158</guid>
		<description><![CDATA[If only I could write. Words that is. I&#8217;d have more interesting posts on this blog. #include &#60;iostream&#62; int main (int argc, char ** argv) { out &#60;&#60; "Instead I'll just write some code." &#60;&#60; std::endl; return 0; } Happy 4th of July!]]></description>
			<content:encoded><![CDATA[<p>If only I could write.</p>
<p>Words that is.</p>
<p>I&#8217;d have more interesting posts on this blog.</p>
<p><code><br />
#include &lt;iostream&gt;</p>
<p>int main (int argc, char ** argv)<br />
{<br />
  out &lt;&lt; "Instead I'll just write some code." &lt;&lt; std::endl;<br />
  return 0;<br />
}<br />
</code></p>
<p>Happy 4th of July!</p>
]]></content:encoded>
			<wfw:commentRss>http://stej.com/write/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Double Rainbow</title>
		<link>http://stej.com/double-rainbow/</link>
		<comments>http://stej.com/double-rainbow/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 00:13:26 +0000</pubDate>
		<dc:creator>Mr. Jonathan</dc:creator>
				<category><![CDATA[Ramblings]]></category>

		<guid isPermaLink="false">http://stej.com/?p=154</guid>
		<description><![CDATA[Dude it&#8217;s a double rainbow.]]></description>
			<content:encoded><![CDATA[<p>Dude it&#8217;s a double rainbow.</p>
<p><object width="367" height="300"><param name="movie" value="http://www.youtube.com/v/OQSNhk5ICTI?version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/OQSNhk5ICTI?version=3" type="application/x-shockwave-flash" width="367" height="300" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://stej.com/double-rainbow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Off Season</title>
		<link>http://stej.com/the-off-season/</link>
		<comments>http://stej.com/the-off-season/#comments</comments>
		<pubDate>Mon, 14 Mar 2011 01:22:55 +0000</pubDate>
		<dc:creator>Mr. Jonathan</dc:creator>
				<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[beach]]></category>

		<guid isPermaLink="false">http://stej.com/?p=147</guid>
		<description><![CDATA[I love the beach this time of year. Its quiet, peaceful and there are no people. Don&#8217;t get me wrong I like people, especial the young attractive ones, but there is just something about walking on the beach with your best friend and no one else around to bug you. I also enjoy the waves [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://stej.com/wp-content/uploads/2011/03/IMG_0206.jpg"><img src="http://stej.com/wp-content/uploads/2011/03/IMG_0206-300x225.jpg" alt="" title="fun-o-rama" width="300" height="225" class="aligncenter size-medium wp-image-148" /></a></p>
<p>I love the beach this time of year. Its quiet, peaceful and there are no people. Don&#8217;t get me wrong I like people, especial the young attractive ones, but there is just something about walking on the beach with your best friend and no one else around to bug you. I also enjoy the waves crashing and the cold wind in my face. Ok maybe the cold wind is a but much but the waves are nice.</p>
]]></content:encoded>
			<wfw:commentRss>http://stej.com/the-off-season/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SNOW!</title>
		<link>http://stej.com/snow/</link>
		<comments>http://stej.com/snow/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 15:02:54 +0000</pubDate>
		<dc:creator>Mr. Jonathan</dc:creator>
				<category><![CDATA[Ramblings]]></category>

		<guid isPermaLink="false">http://stej.com/?p=140</guid>
		<description><![CDATA[Did you know that it&#8217;s going to snow?]]></description>
			<content:encoded><![CDATA[<p>Did you know that it&#8217;s going to snow?</p>
<p><a href="http://stej.com/wp-content/uploads/2011/02/2011-02-01-b-ne_precfcst_600x405.jpg"><img src="http://stej.com/wp-content/uploads/2011/02/2011-02-01-b-ne_precfcst_600x405.jpg" alt="" title="2011 Blizzard " width="600" height="405" class="aligncenter size-full wp-image-141" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://stej.com/snow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snow Day, Again?</title>
		<link>http://stej.com/snow-day-again/</link>
		<comments>http://stej.com/snow-day-again/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 12:14:17 +0000</pubDate>
		<dc:creator>Mr. Jonathan</dc:creator>
				<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[Weather]]></category>
		<category><![CDATA[global warming]]></category>
		<category><![CDATA[snow]]></category>

		<guid isPermaLink="false">http://stej.com/2011/01/snow-day-again/</guid>
		<description><![CDATA[It&#8217;s not even February and we are already getting our second storm of the year. Last week we got over a foot of snow and I spent a good 4 hours clearing it from my driveway. Today we may get up to 6 more inches and then some freezing rain later tonight. Augggg!]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full" src="http://stej.com/wp-content/uploads/2011/01/20110118-071608.jpg" alt="" width="267" height="180" /></p>
<p>It&#8217;s not even February and we are already getting our second storm of the year. Last week we got over a foot of snow and I spent a good 4 hours clearing it from my driveway. Today we may get up to 6 more inches and then some freezing rain later tonight. Augggg!</p>
<p><img class="alignnone size-full" src="http://stej.com/wp-content/uploads/2011/01/20110118-071537.jpg" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://stej.com/snow-day-again/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>iPod Touch Test</title>
		<link>http://stej.com/ipod-touch-test/</link>
		<comments>http://stej.com/ipod-touch-test/#comments</comments>
		<pubDate>Sun, 16 Jan 2011 15:51:10 +0000</pubDate>
		<dc:creator>Mr. Jonathan</dc:creator>
				<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[Test]]></category>

		<guid isPermaLink="false">http://stej.com/2011/01/ipod-touch-test/</guid>
		<description><![CDATA[I bought myself an iPod touch with money I got for Christmas and my birthday. It&#8217;s pretty cool. It plays music and iPhone apps. I even downloaded an app to control my TiVo. This is my fist blog post from my iPod. And most likely my last. I only seem to do things once. Oh [...]]]></description>
			<content:encoded><![CDATA[<p>I bought myself an iPod touch with money I got for Christmas and my birthday. It&#8217;s pretty cool. It plays music and iPhone apps. I even downloaded an app to control my TiVo. </p>
<p>This is my fist blog post from my iPod. And most likely my last. I only seem to do things once. Oh well.  <br/><br/><a href="http://stej.com/wp-content/uploads/2011/01/20110116-115631.jpg"><img src="http://stej.com/wp-content/uploads/2011/01/20110116-115631.jpg" alt="" class="alignnone size-full" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://stej.com/ipod-touch-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First Post of 2011</title>
		<link>http://stej.com/first-post-of-2011/</link>
		<comments>http://stej.com/first-post-of-2011/#comments</comments>
		<pubDate>Sat, 15 Jan 2011 16:08:02 +0000</pubDate>
		<dc:creator>Mr. Jonathan</dc:creator>
				<category><![CDATA[Ramblings]]></category>

		<guid isPermaLink="false">http://stej.com/?p=124</guid>
		<description><![CDATA[This is going to be a short and sweet one but I&#8217;ve got to post something before January goes away. If you have a mobile device you should try this site on it. I think you&#8217;ll like what what you see.]]></description>
			<content:encoded><![CDATA[<p>This is going to be a short and sweet one but I&#8217;ve got to post something before January goes away.</p>
<p>If you have a mobile device you should try this site on it. I think you&#8217;ll like what what you see.</p>
]]></content:encoded>
			<wfw:commentRss>http://stej.com/first-post-of-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Christmas</title>
		<link>http://stej.com/christmas/</link>
		<comments>http://stej.com/christmas/#comments</comments>
		<pubDate>Sat, 25 Dec 2010 18:12:31 +0000</pubDate>
		<dc:creator>Mr. Jonathan</dc:creator>
				<category><![CDATA[Ramblings]]></category>

		<guid isPermaLink="false">http://stej.com/?p=121</guid>
		<description><![CDATA[Surprisingly we had a lot of gifts this Christmas. Thank You Santa!]]></description>
			<content:encoded><![CDATA[<p>Surprisingly we had a lot of gifts this Christmas.</p>
<p><img src="http://stej.com/wp-content/uploads/2010/12/IMG00349-225x300.jpg" alt="" title="2010 Christmas Tree" width="225" height="300" class="aligncenter size-medium wp-image-117" /></p>
<p>Thank You Santa!</p>
]]></content:encoded>
			<wfw:commentRss>http://stej.com/christmas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

