<?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>~Revo Fora~</title>
	<atom:link href="http://thekidd.ca/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://thekidd.ca/blog</link>
	<description>Life, School, Programming, and Whatever Random Thoughts Cross My Mind...</description>
	<lastBuildDate>Thu, 24 Dec 2009 15:07:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Fixing Frequent Crashes in Railroads (and other poorly memory managed games)</title>
		<link>http://thekidd.ca/blog/2009/12/fixing-frequent-crashes-in-railroads-and-other-poorly-memory-managed-games/</link>
		<comments>http://thekidd.ca/blog/2009/12/fixing-frequent-crashes-in-railroads-and-other-poorly-memory-managed-games/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 13:58:36 +0000</pubDate>
		<dc:creator>Zander Kidd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[railroads]]></category>

		<guid isPermaLink="false">http://thekidd.ca/blog/?p=64</guid>
		<description><![CDATA[Sid Meier&#8217;s Railroads crashes on Windows Vista/7 fairly frequently. This turns out to be due to the fact that Railroads and many other games targeted to XP share a 2GB RAM portion with the OS (simplified description but good enough). In other words Railroads gets 2 minus the amount Windows is using as RAM. This [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="Railroads" src="http://upload.wikimedia.org/wikipedia/en/thumb/e/ee/Railroadsboxshot.jpg/256px-Railroadsboxshot.jpg" alt="" width="179" height="256" />Sid Meier&#8217;s Railroads crashes on Windows Vista/7 fairly frequently. This turns out to be due to the fact that Railroads and many other games targeted to XP share a 2GB RAM portion with the OS (simplified description but good enough). In other words Railroads gets 2 minus the amount Windows is using as RAM. This doesn&#8217;t leave much RAM available and the higher detail you&#8217;re playing the game in the quicker that RAM gets used up causing the game to crash.</p>
<p>There is an updated patch available that seems might fix the issue but I&#8217;m unaware how to get the patch installer to recognize my Steam installed copy.</p>
<p>So as an alternative it&#8217;s possible to make the game aware that your computer does actually have more RAM available by modifying the programs executable file:</p>
<ol>
<li>First I&#8217;d recommend making a back up of the RailRoads.exe just in case.</li>
<li>Now <a href="http://thekidd.ca/files/editbin.exe">download editbin.exe</a> (if you&#8217;re afraid I stuck a virus in my copy of the file then you can find this same file at Microsoft&#8217;s website. I believe it&#8217;s included with Visual Studio)</li>
<li>Go to the start menu and click Run..</li>
<li>Type <em>&lt;path to editbin&gt;\editbin.exe /LARGEADDRESSAWARE &lt;path to RailRoads&gt;/RailRoads.exe</em><br />
ex. <em>C:\editbin.exe /LARGEADDRESSAWARE &#8220;C:\Program Files (x86)\Steam\steamapps\common\sid meier&#8217;s railroads\RailRoads.exe&#8221;</em></li>
<li>That&#8217;s it! <img src='http://thekidd.ca/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://thekidd.ca/blog/2009/12/fixing-frequent-crashes-in-railroads-and-other-poorly-memory-managed-games/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dell E153FPT Vista/7 Drivers</title>
		<link>http://thekidd.ca/blog/2009/06/dell-e153fpt-vista7-drivers/</link>
		<comments>http://thekidd.ca/blog/2009/06/dell-e153fpt-vista7-drivers/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 21:22:32 +0000</pubDate>
		<dc:creator>Zander Kidd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[drivers]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[touchscreen]]></category>

		<guid isPermaLink="false">http://thekidd.ca/blog/2009/06/dell-e153fpt-vista7-drivers/</guid>
		<description><![CDATA[Just in case anyone still uses this old Dell touchscreen monitor and can&#8217;t seem to find the drivers..because Dell doesn&#8217;t support the screen anymore and the company responsible for the touch pad has changed it&#8217;s company name from MicroTouch to 3M Touch Systems. Anyway, the new drivers from 3M Touch Systems works fine with the [...]]]></description>
			<content:encoded><![CDATA[<p>Just in case anyone still uses this old Dell touchscreen monitor and can&#8217;t seem to find the drivers..because Dell doesn&#8217;t support the screen anymore and the company responsible for the touch pad has changed it&#8217;s company name from MicroTouch to 3M Touch Systems.</p>
<p>Anyway, the new drivers from 3M Touch Systems works fine with the Dell E153FPT still so just download the driver <a href="http://solutions.3m.com/wps/portal/3M/en_US/3MTouchSystems/TS/CustomerSupport/TouchDrivers/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thekidd.ca/blog/2009/06/dell-e153fpt-vista7-drivers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Barchart.com iGoogle Gadget</title>
		<link>http://thekidd.ca/blog/2009/06/barchartcom-igoogle-gadget/</link>
		<comments>http://thekidd.ca/blog/2009/06/barchartcom-igoogle-gadget/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 18:01:55 +0000</pubDate>
		<dc:creator>Zander Kidd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[barchart]]></category>
		<category><![CDATA[igoogle gadget]]></category>
		<category><![CDATA[stocks]]></category>

		<guid isPermaLink="false">http://thekidd.ca/blog/?p=55</guid>
		<description><![CDATA[Just made up a quick helper gadget for newer people to stocks. It just gives the barchart.com overall opinion of each stock you enter and serves as a nice quick overview of which stocks to sell, or a check of whether you should buy it. Obviously it isn&#8217;t something to go on by itself, but [...]]]></description>
			<content:encoded><![CDATA[<p>Just made up a quick helper gadget for newer people to stocks. It just gives the barchart.com overall opinion of each stock you enter and serves as a nice quick overview of which stocks to sell, or a check of whether you should buy it.</p>
<p>Obviously it isn&#8217;t something to go on by itself, but I&#8217;m sure someone will find it useful in combination with their other stock tools.</p>
<p><img class="alignnone size-full wp-image-56" title="Barchart" src="http://thekidd.ca/blog/wp-content/uploads/2009/06/barchart.png" alt="Barchart" width="285" height="282" /></p>
<p><a href="http://fusion.google.com/add?source=atgs&amp;moduleurl=http%3A//thekidd.ca/igoogle/barchart.xml">Add Gadget</a></p>
<p>After adding it just click the down arrow, go into settings, and add a comma separated list of your stocks.</p>
]]></content:encoded>
			<wfw:commentRss>http://thekidd.ca/blog/2009/06/barchartcom-igoogle-gadget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rogers APN Configuration for Android Phones</title>
		<link>http://thekidd.ca/blog/2009/05/rogers-apn-configuration-for-android-phones/</link>
		<comments>http://thekidd.ca/blog/2009/05/rogers-apn-configuration-for-android-phones/#comments</comments>
		<pubDate>Sat, 23 May 2009 04:13:45 +0000</pubDate>
		<dc:creator>Zander Kidd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[rogers]]></category>

		<guid isPermaLink="false">http://thekidd.ca/blog/?p=44</guid>
		<description><![CDATA[Getting the T-Mobile G1 or any Android phone to work on the Rogers network isn&#8217;t too difficult. When you first start the phone and you&#8217;re at the Touch the Android screen just press the menu button and go into the APN settings. Remove any existing APN configurations that aren&#8217;t related to your carrier. Then add [...]]]></description>
			<content:encoded><![CDATA[<p>Getting the T-Mobile G1 or any Android phone to work on the Rogers network isn&#8217;t too difficult. When you first start the phone and you&#8217;re at the <em>Touch the Android</em> screen just press the menu button and go into the APN settings. Remove any existing APN configurations that aren&#8217;t related to your carrier. Then add the following two new ones.</p>
<p>
<b>For Internet Access/Texting</b></p>
<dl>
<dt>Name</dt>
<dd>Rogers</dd>
<dt>APN</dt>
<dd>internet.com</dd>
<dt>Username</dt>
<dd>wapuser1</dd>
<dt>Password</dt>
<dd>wap</dd>
<dt>MCC</dt>
<dd>302 (should already be filled in)</dd>
<dt>MNC</dt>
<dd>either 720 or 72 depending on your SIM card (should already be filled in)</dd>
</dl>
<p>
Leave all other settings blank.</p>
<p>
<b>For Media Messaging (Picture/Video)</b></p>
<dl>
<dt>Name</dt>
<dd>Rogers MMS</dd>
<dt>APN</dt>
<dd>media.com</dd>
<dt>Username</dt>
<dd>media</dd>
<dt>Password</dt>
<dd>mda01</dd>
<dt>Server</dt>
<dd>172.25.0.107</dd>
<dt>MMSC</dt>
<dd>http://mms.gprs.rogers.com</dd>
<dt>MMS Proxy</dt>
<dd>10.128.1.69</dd>
<dt>MMS Port</dt>
<dd>80</dd>
<dt>MCC</dt>
<dd>302 (should already be filled in)</dd>
<dt>MNC</dt>
<dd>either 720 or 72 depending on your SIM card (should already be filled in)</dd>
<dt>APN Type</dt>
<dd>mms</dd>
</dl>
<p>
Leave all other settings blank.</p>
<p>Simple as that <img src='http://thekidd.ca/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Hope you like your new phone!</p>
]]></content:encoded>
			<wfw:commentRss>http://thekidd.ca/blog/2009/05/rogers-apn-configuration-for-android-phones/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Scribbles &#8211; Playing with SVG &amp; Greasemonkey</title>
		<link>http://thekidd.ca/blog/2009/05/scribbles-playing-with-svg-greasemonkey/</link>
		<comments>http://thekidd.ca/blog/2009/05/scribbles-playing-with-svg-greasemonkey/#comments</comments>
		<pubDate>Sat, 23 May 2009 00:28:26 +0000</pubDate>
		<dc:creator>Zander Kidd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[svg]]></category>

		<guid isPermaLink="false">http://thekidd.ca/blog/?p=16</guid>
		<description><![CDATA[Keith Wood has an excellent jQuery plugin for interacting with an SVG canvas which can be found here. I&#8217;m using it in a research project I&#8217;m working on currently and will talk about in a later post. For now though the fact that my project involves Greasemonkey, tracking the mouse cursor, and dynamically displaying visual [...]]]></description>
			<content:encoded><![CDATA[<p>Keith Wood has an excellent jQuery plugin for interacting with an SVG canvas which can be found <a href='http://keith-wood.name/svg.html'>here</a>. I&#8217;m using it in a research project I&#8217;m working on currently and will talk about in a later post.</p>
<p>For now though the fact that my project involves Greasemonkey, tracking the mouse cursor, and dynamically displaying visual feedback has led to a nice unintended combination of being able to draw all over webpages with the cursor <img src='http://thekidd.ca/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><b>1. Load jQuery and SVG</b></p>
<p>The first thing you&#8217;ll need is to make Greasemonkey load jQuery. Now the usual way to do this on your own webpage would be to include <code>&lt;script style="text/javascript" src="&lt;url to jquery.js file>" /></code>. This is the same way you&#8217;ll be loading the script with Greasemonkey, essentially you make Greasemonkey add a script line to the pages header.</p>
<p>
<code>
<pre>
var GM_JQ = document.createElement('script');
GM_JQ.src = 'http://jquery.com/src/jquery-latest.js';
GM_JQ.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(GM_JQ);
</pre>
<p></code>
</p>
<p><b>2. Wait for it to load</b></p>
<p>Your going to be loading jQuery and SVG from a different server and it may be quick anyway but it won&#8217;t be instantaneous so you don&#8217;t want to try and run the rest of the jQuery dependent part of the script until jQuery has fully loaded.</p>
<p>
<code>
<pre>
function loading() {
   if(typeof unsafeWindow.jQuery == 'undefined'
        || unsafeWindow.jQuery.svg == 'undefined') {
		window.setTimeout(loading,100);
	} else {
		$ = unsafeWindow.jQuery; startPlugin();
	}
}
loading();
</pre>
<p></code><br />
This will loop and wait until the jQuery variable isn&#8217;t undefined anymore (ie. it&#8217;s loaded), and then afterwords assign it to &#8216;$&#8217; just like you&#8217;re used to, and start the drawing goodness.
</p>
<p><b>3. Activate SVG and listen for mouse events</b></p>
<p>
Ok, everythings almost ready to run. Next your going to need a transparent div covering the entire webpage that the SVG canvas can then attach to and draw on.
</p>
<p>
<code>
<pre>
$("body").prepend("&lt;div id='svg' style='z-index: 999;
        position: absolute; width:100%; height:" +
        document.height + "px'>&lt;/div>");
$("div#svg").svg();
window.svg = $("div#svg").svg('get');
</pre>
<p></code>
</p>
<p>
Also your going to need assign functions to listen for when the mouse is pressed and released and disable the ability to click on anything on the page so your not accidentally clicking a link and leaving the page as you try to draw.
</p>
<p>
<code>
<pre>
$("body").bind("click", function(e) { return false; });
$("body").bind("mousedown", startingDrawing);
$("body").bind("mouseup", endingDrawing);
</pre>
<p></code>
</p>
<p><b>4. Drawing <img src='http://thekidd.ca/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </b></p>
<p>
Simple enough now. When the mouse is pressed start the mousemove listener and draw a line from the previous mouse position to the next one, and then turn back off the mousemove listener when the mouse button is released.
</p>
<p>
<code>
<pre>
window.oldX;
window.oldY;
window.startingDrawing = function(event) {
	window.oldX = event.pageX;
	window.oldY = event.pageY;
	$(document).bind("mousemove", mouseMoving);
    return false;
}

window.mouseMoving = function(event) {
	window.svg.line(null, window.oldX, window.oldY,
               event.pageX, event.pageY,
               {'stroke': window.STROKE_COLOR,
               'stroke-width': window.STROKE_WIDTH});
	window.oldX = event.pageX;
	window.oldY = event.pageY;
}

window.endingDrawing = function(event) {
	$(document).unbind('mousemove', mouseMoving);
}
</pre>
<p></code>
</p>
<p>
The full script with all the other little details like support for enabling and disabling the script with a keyboard shortcut is available <a href='http://thekidd.ca/greasemonkey/scribbles/index.html'>here</a>. The download page also works as a live demo and runs an alternate way not involving Greasemonkey so you can test how the script would work without needing to download it and Greasemonkey.</p>
]]></content:encoded>
			<wfw:commentRss>http://thekidd.ca/blog/2009/05/scribbles-playing-with-svg-greasemonkey/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bypassing UOIT Restrictions</title>
		<link>http://thekidd.ca/blog/2009/05/bypassing-uoit-restrictions/</link>
		<comments>http://thekidd.ca/blog/2009/05/bypassing-uoit-restrictions/#comments</comments>
		<pubDate>Sat, 23 May 2009 00:06:03 +0000</pubDate>
		<dc:creator>Zander Kidd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[uoit]]></category>

		<guid isPermaLink="false">http://thekidd.ca/blog/?p=7</guid>
		<description><![CDATA[Printing from your own Laptop (or reconfiguring your broken Thinkpad) I have one of the school laptops but it&#8217;s been configured wrong for printing since I got it in September. Not wanting to go to IT (and have them try to reformat it). I&#8217;ve been using the Library computers anytime I need to print something [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Printing from your own Laptop (or reconfiguring your broken Thinkpad)</strong></p>
<p>I have one of the school laptops but it&#8217;s been configured wrong for printing since I got it in September. Not wanting to go to IT (and have them try to reformat it). I&#8217;ve been using the Library computers anytime I need to print something and needless to say it&#8217;s a pain. So a big thanks to <a href="http://chrisjf.blogspot.com/2008/10/printing-to-uoit-printers-from-non.html">Chris</a> for finding out how to fix the printer setup.</p>
<ol>
<li>Start Menu -&gt; Run</li>
<li>Type in: \\osfp01.oncampus.local</li>
<li>A prompt will ask for your:<br />
Username: oncampus\&lt;Your Student ID&gt;<br />
Password: &lt;your password for logging onto the school computers&gt;</li>
<li>After this a list of all the printers will popup. Simply double-click whatever printer(s) you want to install.</li>
</ol>
<p>Note that the first three steps will need to be repeated each time you restart your computer.</p>
<p><strong>Accessing MyCampus Email through IMAP</strong></p>
<p>I know none of you ever check MyCampus because your forgetful, it&#8217;s to much work etc. So here&#8217;s the settings to have your MyCampus mail be readable in Thunderbird or whichever email client you happen to use.</p>
<p>Protocol: IMAP<br />
Server: itsosims02.mycampus.ca<br />
Port: 143, no SSL<br />
Username: Your Student ID<br />
Password: your original MyCampus password (most likely your birthday in the format MMDDYY)</p>
<p><strong>Accessing the BIOS on T61p&#8217;s</strong></p>
<p>Password: br82gt</p>
]]></content:encoded>
			<wfw:commentRss>http://thekidd.ca/blog/2009/05/bypassing-uoit-restrictions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Java Optimizing Switch Statements</title>
		<link>http://thekidd.ca/blog/2009/05/java-optimizing-switch-statements/</link>
		<comments>http://thekidd.ca/blog/2009/05/java-optimizing-switch-statements/#comments</comments>
		<pubDate>Sat, 23 May 2009 00:02:27 +0000</pubDate>
		<dc:creator>Zander Kidd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://thekidd.ca/blog/?p=3</guid>
		<description><![CDATA[The Java compiler has two different ways it can compile your switch statements. Fast &#8211; tableswitch switch(num) { case 1: func2(); case 2: funct2(); case 3: funct3(); } If it sees that your case values are all close to each other then it optimizes it such that either: The value does not lie within the [...]]]></description>
			<content:encoded><![CDATA[<p>The Java compiler has two different ways it can compile your switch statements.</p>
<p><strong>Fast &#8211; tableswitch</strong></p>
<p><code>switch(num) {<br />
case 1: func2();<br />
case 2: funct2();<br />
case 3: funct3();<br />
}</code></p>
<p>If it sees that your case values are all close to each other then it optimizes it such that either:</p>
<ul>
<li>The value does not lie within the range: jump to default</li>
<li>The value is within the range: calculate correct offset and directly jump to it</li>
</ul>
<p>This always takes O(1) time since the value does not need to be compared to every possible case; or any of the cases for that mater.</p>
<p><strong>Slow &#8211; lookupswitch</strong><br />
<code><br />
switch(num) {<br />
case 1: funct1();<br />
case 42: funct2();<br />
case 9001: funct3();<br />
}<br />
</code><br />
If your values aren&#8217;t close to each other then the compiler compiles the switch into a similar manner as an if statement and each value is compared to the cases one after another until the result is found.</p>
<p>This takes O(n) time since a switch that goes to default will have had to compare itself with every single case.</p>
<p><strong>Forcing a compile to tableswitch</strong></p>
<p>So tableswitch is obviously better when you&#8217;ve got many cases in your switch but that doesn&#8217;t mean the Java compiler will always use it.</p>
<p>If you want to check which was the compiler compiled it run:</p>
<p>javap &lt;class file&gt; &gt; out.txt</p>
<p>and search out.txt for tableswitch or lookupswitch.</p>
<p>If it used lookupswitch where you think tableswitch would be better then you have two options:</p>
<ul>
<li>Add extra empty cases into the switch to make the compiler think the cases are all in a close range, note that you don&#8217;t have to add every case. The Java compiler automatically adds missing empty cases and uses tableswitch if just most values within the range are being used</li>
<li>Split the switch statement into multiple switch statements so each group of statements fall within a range</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://thekidd.ca/blog/2009/05/java-optimizing-switch-statements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
