<?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>MJCBlog.Net</title>
	<atom:link href="http://www.mjcblog.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mjcblog.net</link>
	<description></description>
	<lastBuildDate>Sun, 08 Nov 2009 02:33:53 +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>Flash External Interface &#8220;addCallback&#8221; Gotcha in Internet Explorer</title>
		<link>http://www.mjcblog.net/2009/11/flash-external-interface-addcallback-gotcha-in-internet-explorer/</link>
		<comments>http://www.mjcblog.net/2009/11/flash-external-interface-addcallback-gotcha-in-internet-explorer/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 02:32:31 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.mjcblog.net/?p=155</guid>
		<description><![CDATA[Just learned this one the hard way. Apparently in Internet Explorer, a Flash application cannot use the &#8220;ExternalInterface&#8221; to add a callback named &#8216;play&#8217;. This list of reserved words also includes &#8217;stop&#8217;, &#8216;tags&#8217;, &#8216;item&#8217;, &#8216;length&#8217; and possibly others.
Makes sense, but it took me a while to figure this one out since it does not seem [...]]]></description>
			<content:encoded><![CDATA[<p>Just learned this one the hard way. Apparently in Internet Explorer, a Flash application cannot use the &#8220;ExternalInterface&#8221; to add a callback named &#8216;play&#8217;. This list of reserved words also includes &#8217;stop&#8217;, &#8216;tags&#8217;, &#8216;item&#8217;, &#8216;length&#8217; and possibly others.</p>
<p>Makes sense, but it took me a while to figure this one out since it does not seem to be documented anywhere. For a while there, I was a very frustrated developer!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mjcblog.net/2009/11/flash-external-interface-addcallback-gotcha-in-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Holy Spam Batman!</title>
		<link>http://www.mjcblog.net/2009/07/holy-spam-batman/</link>
		<comments>http://www.mjcblog.net/2009/07/holy-spam-batman/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 14:36:00 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[General Banter]]></category>

		<guid isPermaLink="false">http://www.mjcblog.net/?p=150</guid>
		<description><![CDATA[It seems as though my blog has become the target of spam. Almost daily now, I get a few comments that consist of nothing but spam. Someone should tell these spammers that no one reads this blog or visits it for that matter, so they&#8217;re just wasting their own time!
]]></description>
			<content:encoded><![CDATA[<p>It seems as though my blog has become the target of spam. Almost daily now, I get a few comments that consist of nothing but spam. Someone should tell these spammers that no one reads this blog or visits it for that matter, so they&#8217;re just wasting their own time!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mjcblog.net/2009/07/holy-spam-batman/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Minor Update to IMapper Library</title>
		<link>http://www.mjcblog.net/2009/04/minor-update-to-imapper-library/</link>
		<comments>http://www.mjcblog.net/2009/04/minor-update-to-imapper-library/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 19:53:36 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[General Banter]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.mjcblog.net/?p=139</guid>
		<description><![CDATA[I made a small change to the IMapper library today.  It should now play nicely with other JavaScript libraries.
The alteration will ensure that &#8220;$&#8221; is referencing jQuery, at least within the scope of the library. This symbol is used by a variety of JavaScript libraries, most notably Prototype.
Obviously, the ready() method used to initialize [...]]]></description>
			<content:encoded><![CDATA[<p>I made a small change to the <a title="IMapper Library" href="http://www.mjcblog.net/imapper-library/" target="_self">IMapper library</a> today.  It should now play nicely with other JavaScript libraries.</p>
<p>The alteration will ensure that &#8220;$&#8221; is referencing jQuery, at least within the scope of the library. This symbol is used by a variety of JavaScript libraries, most notably <a title="Prototype JavaScript Library" href="http://www.prototypejs.org/" target="_blank">Prototype</a>.</p>
<p>Obviously, the <em>ready()</em> method used to initialize IMapper will be slightly different depending upon your setup.  I would highly recommend reading up using <a title="Using jQuery with Other Libraries" href="http://docs.jquery.com/Using_jQuery_with_Other_Libraries" target="_blank">jQuery with other libraries</a> before you actually attempt too.</p>
<p>I haven&#8217;t extensively tested the update.  If you are using IMapper (with jQuery) and another JavaScript library that uses the &#8220;$&#8221; symbol please let me know if there are any name conflicts or bugs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mjcblog.net/2009/04/minor-update-to-imapper-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FB_PIC Update</title>
		<link>http://www.mjcblog.net/2009/03/fb_pic-update/</link>
		<comments>http://www.mjcblog.net/2009/03/fb_pic-update/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 03:24:42 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[General Banter]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.mjcblog.net/?p=123</guid>
		<description><![CDATA[A long time ago I wrote a GreaseMonkey script dubbed &#8220;FB_PIC&#8221; for Facebook.  The script has one simple function: when you mouse over profile links, it&#8217;ll show the full-sized profile picture for that given user.  Today I noticed Facebook altered their interface so I decided to make some updates to FB_PIC.
Please note that due to [...]]]></description>
			<content:encoded><![CDATA[<p>A long time ago I wrote a <a title="Greasespot" href="http://www.greasespot.net/" target="_blank">GreaseMonkey</a> script dubbed <a title="FB_PIC" href="http://www.breakbase.com/fbpic/" target="_blank">&#8220;FB_PIC&#8221;</a> for Facebook.  The script has one simple function: when you mouse over profile links, it&#8217;ll show the full-sized profile picture for that given user.  Today I noticed Facebook altered their interface so I decided to make some updates to FB_PIC.</p>
<p>Please note that due to how the Facebook UI works, FB_PIC has trouble keeping up with page changes.  I am still working on an efficient work around to coupe with Facebook&#8217;s very unique UI.  In the mean time if you notice that FB_PIC isn&#8217;t working as exepected just refresh the page.  This will re-bind all of the nessecary events to the apporiate elements.</p>
<p>For more details exactly what FB_PIC is and how to get it, head on over the <a title="FB_PIC" href="http://www.breakbase.com/fbpic/" target="_blank">FB_PIC</a> page and check it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mjcblog.net/2009/03/fb_pic-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Full Tree Selects via Materialized Paths</title>
		<link>http://www.mjcblog.net/2009/03/full-tree-selects-via-materialized-paths/</link>
		<comments>http://www.mjcblog.net/2009/03/full-tree-selects-via-materialized-paths/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 18:51:45 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.mjcblog.net/?p=112</guid>
		<description><![CDATA[At my internship I have been working on this really awesome in-house analytics systems.  One of the database tables used in this project behaves as a self-referential tree.  Since I am using Ruby on Rails for this project, I decided to go with the acts_as_tree plugin on this particular model.  This plugin adds various tree [...]]]></description>
			<content:encoded><![CDATA[<p>At my <a title="IMRE" href="http://www.imre.com" target="_blank">internship</a> I have been working on this really awesome in-house analytics systems.  One of the database tables used in this project behaves as a self-referential tree.  Since I am using Ruby on Rails for this project, I decided to go with the <a title="acts_as_tree Class Methods" href="http://api.rubyonrails.org/classes/ActiveRecord/Acts/Tree/ClassMethods.html" target="_blank">acts_as_tree</a> plugin on this particular model.  This plugin adds various tree related methods with a minimal requirement that a foreign key column named &#8220;parent_id&#8221; exists in the corresponding table.</p>
<p>This plugin functioned as expected and something can certainly be said for sheer simplicity that this particular tree structure employs.  The complication arose when my application called for a full select of all the descendants from a given node.  This particular tree structure doesn&#8217;t support an efficient way to grab all of the corresponding descendant records.</p>
<p><span id="more-112"></span></p>
<p>So I decided to implement a <a title="Materialized Path" href="http://www.dbazine.com/oracle/or-articles/tropashko4" target="_blank">Materialized Path</a> on top of my simple tree structure by adding a path column to the table. Here is a sample of what my tree table would look like.  For the sake of the example, we&#8217;ll call this table Nodes:</p>
<table style="margin:0 auto;text-align:center" border="0" cellspacing="4" cellpadding="2">
<tbody>
<tr>
<th>id</th>
<th>parent_id</th>
<th>path</th>
</tr>
<tr>
<td>1</td>
<td>NULL</td>
<td>N1</td>
</tr>
<tr>
<td>2</td>
<td>NULL</td>
<td>N2</td>
</tr>
<tr>
<td>3</td>
<td>1</td>
<td>N1.N3</td>
</tr>
<tr>
<td>4</td>
<td>2</td>
<td>N2.N4</td>
</tr>
<tr>
<td>5</td>
<td>3</td>
<td>N1.N3.N5</td>
</tr>
<tr>
<td>6</td>
<td>4</td>
<td>N2.N4.N6</td>
</tr>
</tbody>
</table>
<p>You can see here how each path is being constructed by concatenating a given node&#8217;s parent path with a it&#8217;s ID number.  I like to prefix each ID number with the first letter of the models name, hence the &#8220;N&#8221; from &#8220;Nodes&#8221;.  Keep in mind that any piece of unique data can be used, it doesn&#8217;t need to be the ID number.  My analytics system uses an alternative string of unique data for the materialized path.</p>
<p>Now grabbing all of the descendants for node 2 is quite simple really; here&#8217;s a sample SQL query:<br />
<code><br />
SELECT * FROM nodes WHERE path LIKE "N2%";</code></p>
<p>This will grab N2 as well as all of it&#8217;s descendants.  If you just want to exclusively grab the descendants of N2 simply added a &#8220;.&#8221; to end of our LIKE clause; such a query would look like:<br />
<code><br />
SELECT * FROM nodes WHERE path LIKE "N2.%";</code></p>
<p>The Rails code for adding this functionality is equally simple.  A <em>before_create</em> callback in the given for the model will do the trick.  Here is a quick sample:<br />
<code><br />
before_create do |n|<br />
&nbsp;&nbsp;self.path = "#{n.parent.path}.N#{id}"<br />
end</code></p>
<p>Also note, that depending on the data type used for the path column, you maybe limited on how deep the descendants can go.  For instances, a varchar(255) column only allows 255 characters, so if each node takes up an average 5 characters we&#8217;re limited to 51 nodes.  While this may seem like a lot, it&#8217;s something to just keep in mind when implementing this solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mjcblog.net/2009/03/full-tree-selects-via-materialized-paths/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu &#8220;Cheap Trick&#8221; Denial of Service</title>
		<link>http://www.mjcblog.net/2009/02/ubuntu-denial-of-service/</link>
		<comments>http://www.mjcblog.net/2009/02/ubuntu-denial-of-service/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 20:09:42 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Operating Systems]]></category>

		<guid isPermaLink="false">http://www.mjcblog.net/?p=103</guid>
		<description><![CDATA[Here&#8217;s a little something I learned the hard way today &#8211; you can&#8217;t login into Ubuntu (and presumably other Linux distros) via GDM without a correctly configured /tmp/ directory.  Thus running something along the lines of:
rm -rf /tmp/
will prevent anyone from logging in through GDM after a reboot. I might use this little trick in [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a little something I learned the hard way today &#8211; you can&#8217;t login into Ubuntu (and presumably other Linux distros) via GDM without a correctly configured <em>/tmp/</em> directory.  Thus running something along the lines of:</p>
<div style="margin: 0px 40px 10px;"><code>rm -rf /tmp/</code></div>
<p>will prevent anyone from logging in through GDM after a reboot. I might use this little trick in my upcoming Case Studies live fire exercise this Wednesday, but I will explain more about that in later posts.</p>
<p>The solution is quite simple really; first reboot your box into recovery mode and then drop into a root shell.  Now run the following commands and all will be well:</p>
<div style="margin: 0px 40px 10px;"><code> rm -r /tmp/<br />
mkdir /tmp/<br />
chmod 1777 /tmp/<br />
shutdown -r now</code></div>
<p><span id="more-103"></span></p>
<p>By the way, I am going to make an effort to post here more often.  Between my security classes this semester and my internship I should have a lot of advice, code and tidbits of information to post about.  So in the coming weeks my blog <em>should</em> have a lot more content to it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mjcblog.net/2009/02/ubuntu-denial-of-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Experience with Google Maps API</title>
		<link>http://www.mjcblog.net/2008/12/my-experience-with-google-maps-api/</link>
		<comments>http://www.mjcblog.net/2008/12/my-experience-with-google-maps-api/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 01:41:52 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.mjcblog.net/?p=21</guid>
		<description><![CDATA[A few weeks ago, I was tasked with improving the Google Maps feature for a major project at my internship.  The map was part of a location-based search feature that is used on several different parts of the project. Essentially, a user enters a zip code and some other search parameters and a list of [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, I was tasked with improving the Google Maps feature for a major project at my <a title="Imre Communications" href="http://www.imrecommunications.com/" target="_blank">internship</a>.  The map was part of a location-based search feature that is used on several different parts of the project. Essentially, a user enters a zip code and some other search parameters and a list of locations is generated and mapped out for them.  While I am an experienced JavaScript programmer, and am familiar with a lot of related libraries and APIs, the Google Maps API is one that I had yet to introduce myself to.  So when presented with this task, I jumped at the opportunity and began to read up on various <a title="Google Maps API Documentation " href="http://code.google.com/apis/maps/documentation/reference.html" target="_blank">API documentation</a> that Google provides.</p>
<p>As expected, the features and functionality provided to individual developers by the API is impressive.  One can achieve virtually all of the functions that Google&#8217;s own mapping service provides and then some.  Since the project I was working on called for a fairly simple mapping system (the basic markers and info window we&#8217;re all accustomed too), I didn&#8217;t really get a chance to learn all of the nifty features provided by the API.  Once I get some much needed free time over winter break, I am sure I will learn more about the API and possibly throw together a simple web application showcasing what I have learned.</p>
<p>In developing the mapping feature for this project, it became clear that I needed some sort of library to help manage the various pieces of data and events.  I decided to create a <a title="Wikipedia: Singleton Pattern" href="http://en.wikipedia.org/wiki/Singleton_pattern" target="_blank">Singleton Class</a> that uses <a title="jQuery JavaScript Library " href="http://jquery.com/" target="_blank">jQuery</a> to help manage the map overall.  My code uses the <a title="Module Pattern" href="http://yuiblog.com/blog/2007/06/12/module-pattern/" target="_blank">Module Pattern</a> as described by Douglas Crockford.  While the name, Module Pattern, may seem misleading (I think &#8216;Singleton Pattern&#8217; does it better justice), the Module Pattern is a rather useful JavaScript design pattern that eliminates the need for global variables and enables some key Object Oriented Design concepts (private variables and methods anyone?).  I decided to dub this simple class IMapper.</p>
<p><span id="more-21"></span></p>
<p>Via IMapper, one is able to add markers by supplying an address string or an array containing latitude and longitude coordinates.  One can also specify various options like a title or a body message for the info window.  My favorite option is the external option; mainly an HTML element can be passed when adding markers.  When a user clicks on that element, the map centers to the respected marker and the info window is shown.</p>
<p>My goal was to create a simple, lightweight, re-usable JavaScript library to help manage some common tasks associated with using Google Map&#8217;s API within a web application.  I believe I accomplished just that!  If you are interested in using my code you can find it <a title="IMapper JavaScript Library" href="http://www.mjcblog.net/imapper-library/" target="_self">here</a> along with a simple demo and tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mjcblog.net/2008/12/my-experience-with-google-maps-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy Thanksgiving!</title>
		<link>http://www.mjcblog.net/2008/11/happy-thanksgiving/</link>
		<comments>http://www.mjcblog.net/2008/11/happy-thanksgiving/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 21:01:53 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[General Banter]]></category>

		<guid isPermaLink="false">http://www.mjcblog.net/?p=23</guid>
		<description><![CDATA[Happy Thanksgiving to whomever may read this. Enjoy the holiday and of course, the turkey!
I promise within the next few days I will start to post more on my blog. I have just been so busy with term projects and my internship, it&#8217;s difficult to find a free moment.  So stay tuned everyone&#8230;
]]></description>
			<content:encoded><![CDATA[<p>Happy Thanksgiving to whomever may read this. Enjoy the holiday and of course, the turkey!</p>
<p>I promise within the next few days I will start to post more on my blog. I have just been so busy with term projects and my internship, it&#8217;s difficult to find a free moment.  So stay tuned everyone&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mjcblog.net/2008/11/happy-thanksgiving/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome to MJCBlog.net!</title>
		<link>http://www.mjcblog.net/2008/11/welcome-to-mjcblognet/</link>
		<comments>http://www.mjcblog.net/2008/11/welcome-to-mjcblognet/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 00:00:09 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[General Banter]]></category>

		<guid isPermaLink="false">http://www.mjcblog.net/?p=8</guid>
		<description><![CDATA[Well after much delay I finally finished up my layout and theme.  It is partially based on the Elegance theme designed by &#8216;PowerTheme&#8217;.  So a lot of credit belongs to PowerTheme.  By no means did I take any shortcuts though, my theme is designed from scratch, just some of the images and styles are from [...]]]></description>
			<content:encoded><![CDATA[<p>Well after much delay I finally finished up my layout and theme.  It is partially based on the <a title="Elegance theme" href="http://www.powertheme.com/themes/elegance/" target="_blank">Elegance theme</a> designed by &#8216;PowerTheme&#8217;.  So a lot of credit belongs to PowerTheme.  By no means did I take any shortcuts though, my theme is designed from scratch, just some of the images and styles are from the Elegance theme.</p>
<p>All in all, I am extremely happy with how everything came out.  I hope my readers (do I have any yet?) enjoy my blog and all my rants.  Check back frequently because I do have a lot to say!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mjcblog.net/2008/11/welcome-to-mjcblognet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
