<?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>de Paul Warren &#187; programming</title>
	<atom:link href="http://paulwarren.ca/archived/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://paulwarren.ca</link>
	<description>Inside your Head</description>
	<lastBuildDate>Sat, 06 Mar 2010 22:11:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Override-able callback functions</title>
		<link>http://paulwarren.ca/archived/override-able-callback-functions/</link>
		<comments>http://paulwarren.ca/archived/override-able-callback-functions/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 05:20:16 +0000</pubDate>
		<dc:creator>Foobar</dc:creator>
				<category><![CDATA[Programming & code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://paulwarren.net/?p=145</guid>
		<description><![CDATA[So I ran into another issue the other day. I needed to create a function that could be overwritten, then have any reference to the original point to the new one&#8230; without redoing everything again&#8230; For example: funk = function() { alert(&#039;original&#039;); } caller = funk; funk = function() { alert(&#039;new&#039;); } // this will [...]]]></description>
			<content:encoded><![CDATA[<p>So I ran into another issue the other day. I needed to create a function that could be overwritten, then have any reference to the original point to the new one&#8230; without redoing everything again&#8230; For example:</p>
<pre>
<pre class="brush: javascript">
funk = function() { alert(&#039;original&#039;); }

caller = funk;

funk = function() { alert(&#039;new&#039;); }

// this will alert &#039;original&#039;... Not &#039;new&#039;;
caller();
</pre>
</pre>
<p>But what if I want to be able to override functions and have those such as &#8220;caller&#8221; mentioned above, to point to the new function. Such an example would be where the function could be overridden based on what modules are loaded and what are not. But the original function will always be referenced. There is a solution though. It takes a little bit more plus my code below. But it is possible now.</p>
<p>By using <a href="http://paulwarren.ca/wp-content/uploads/2009/12/funcStorage.js">funcStorage.js</a>, you can use this code for appending functions, or referencing functions by name instead of their location in memory. Essentially you can run the caller() function and have it execute whatever happens to be associated with that at the time, not what it was when it was originally assigned.</p>
<p>Lets attempt something that&#8217;s not just pseudo code. Our issue is we want to reload a custom made file directory. The easiest way is to do a <em>window.location.reload();</em> call. Lets set that as our <em>reloadFileList() = function() { window.location.reload(); }</em>. But we want to use a fancy AJAX solution. In this case we want to just override the function as the AJAX solution is much better. We can&#8217;t just go <em>reloadFileList = ajaxReload;</em> because any function that already references reloadFileList will point to the original window.reload one.</p>
<p>Now let me be clear here:</p>
<pre>
<pre class="brush: javascript">
// I do not mean this.
element.onclick = function() { reloadFileList(); }

// I DO mean this!
element.onclick = reloadFileList;
</pre>
</pre>
<p>So the only way before was to go back to all the previous references used for reloadFileList and reassign it the new function. But now with the code I posted, you can do the following.</p>
<pre>
<pre class="brush: javascript">
// You can specify what function the onclick uses
// before it&#039;s even created.
element.onclick = funcStorage.call(&#039;reloadFileList&#039;);

funcStorage.create(&#039;reloadFileList&#039;, function() { window.location.reload(); });

// Later on, or in another file...
funcStorage.create(&#039;reloadFileList&#039;, function() {
   fileList = getFileList_viaAJAX(&#039;url/here&#039;);
   for( k in fileList) {
      // perform actions
   }
});
</pre>
</pre>
<p>So without redefining the element.onclick, it now uses the new Ajax style instead of the window.reload.</p>
<p>For me, the primary reason is for letting the site function even if the file didn&#8217;t download properly, I had a bug in one of my js files, or the user aborted while it was getting another file. I would like the site to still work, even if not completely as intended&#8230; essentially graceful degradation or a fault-tolerant system.</p>
<p>There&#8217;s more than just this, the class also allows for extending functions instead of just overriding them. If you use the extend method instead of the create, whatever is already defined as the function you want, it will get appended with the section argument.</p>
<pre>
<pre class="brush: javascript">
// You don&#039;t need to initialize anything.
// Any call, create, or extend will create the necessary
// elements before they are used.
funcStorage.extend(&#039;reloadFileList&#039;, function() { // ajax style reload });

// now lets put tooltips with thumbnails on the various files...
funcStorage.extend(&#039;reloadFileList&#039;, function() {
   // the down side is you have to treat each extension as if
   // it&#039;s its own environment and doesn&#039;t have access to the variables
   // from the previous extensions.
   $(elements).each( function() {
      // assign a tooltip with picture inside.
   });
});
</pre>
</pre>
<p>This will then run both functions sequentially. After doing the Ajax call, it will do the tooltip generation.</p>
<p>Hopefully someone else finds this useful.</p>
<p>Again, it&#8217;s: <a href="../wp-content/uploads/2009/12/funcStorage.js">funcStorage.js</a></p>
]]></content:encoded>
			<wfw:commentRss>http://paulwarren.ca/archived/override-able-callback-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hermes Retires</title>
		<link>http://paulwarren.ca/archived/hermes-retires/</link>
		<comments>http://paulwarren.ca/archived/hermes-retires/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 12:43:24 +0000</pubDate>
		<dc:creator>Foobar</dc:creator>
				<category><![CDATA[The Business Element]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[quitting]]></category>

		<guid isPermaLink="false">http://paulwarren.net/?p=29</guid>
		<description><![CDATA[Today I mourn the loss of Hermes, also known as &#8220;MyGuarded.name,&#8221; as it has been retired. The maintenance and time required to keep it working and move it around has gotten to me. I can&#8217;t keep it up any longer. There are just too many things I want to accomplish and maintaining an aging email [...]]]></description>
			<content:encoded><![CDATA[<p>Today I mourn the loss of Hermes, also known as &#8220;MyGuarded.name,&#8221; as it has been retired. The maintenance and time required to keep it working and move it around has gotten to me. I can&#8217;t keep it up any longer. There are just too many things I want to accomplish and maintaining an aging email system isn&#8217;t one of them.</p>
<p><em><strong>History</strong>: I set it up, primarily, because I was getting too much spam and the one good anti-spam provider was inconsistently online. I then spent a good 1 month recreating the type of service I got there, but with much more reliability. I called it &#8220;Hermes&#8221; after the Greek god. &#8220;Messenger of the gods&#8221; seemed quite appropriate for this email system. Anyway, there were issues here and there, nothing I couldn&#8217;t fix. It has served me well and while I did still get a lot of spam, all of it went to the junk folder and not once did i get a piece of spam in my inbox. It was very effective at what it did. </em></p>
<p>And then it came time to move Hermes.</p>
<p><em><strong>Side story:</strong> For those who noticed, I haven&#8217;t posted in almost a year. That was partially because I tried moving my website over to another server for a while now. I just couldn&#8217;t get the mail thing sorted out and until I switched over and retired Hermes, I was hesitant (or maybe it was procrastination) to post anything. </em></p>
<p>The setup was pretty specific and it started to become more than what it was worth to move it. I don&#8217;t have the time to maintain it anymore like I used to. I have about a gazillion ideas I want to get finished, many personal projects, spent time with friends and family&#8230; and well Hermes got the raw end of the deal. I figired it was time to hang up the gloves and convert to something with a little less maintenance.</p>
<p>It is time for a moment of silence on my part as I remember the times with Hermes. (Yes I&#8217;m aware it sounds like herpes.)</p>
]]></content:encoded>
			<wfw:commentRss>http://paulwarren.ca/archived/hermes-retires/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I can&#8217;t do this.</title>
		<link>http://paulwarren.ca/archived/i-cant-do-this/</link>
		<comments>http://paulwarren.ca/archived/i-cant-do-this/#comments</comments>
		<pubDate>Sat, 29 Sep 2007 03:50:41 +0000</pubDate>
		<dc:creator>antihero</dc:creator>
				<category><![CDATA[Life Thoughts]]></category>
		<category><![CDATA[Perspicacious, circumspective and sagacious]]></category>
		<category><![CDATA[frustration]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://paulwarren.net/?p=23</guid>
		<description><![CDATA[My father has always been annoyed when I used the word &#8220;can&#8217;t,&#8221; or rather, the contraction. I guess he saw that as a sign I was giving up. I don&#8217;t quite remember as at that moment, I would usually tune out and roll my eyes. I was very negative then. Much has changed since those [...]]]></description>
			<content:encoded><![CDATA[<p>My father has always been annoyed when I used the word &#8220;can&#8217;t,&#8221; or rather, the contraction. I guess he saw that as a sign I was giving up. I don&#8217;t quite remember as at that moment, I would usually tune out and roll my eyes. I was very negative then.</p>
<p>Much has changed since those times and I have picked up a much more positive attitude. It&#8217;s been so long that I&#8217;ve been like this now that only during times of true, painful stress will my negative side come out. But I&#8217;ve begun to notice that the phrase &#8220;I can&#8217;t&#8221; is once again entering my vocabulary. It seems in a different way this time.</p>
<p>As a Christian, I notice my failings a lot and it&#8217;s always when I try and truck it alone. But it&#8217;s not always my personal walk that I notice this. Since January of 2007, I have worked on a game called iKonquest.  It&#8217;s gone through many stages but it has not caught on to the public. Reason being was for, in my view, my greatest failing. I don&#8217;t sell. I can&#8217;t sell. I won&#8217;t sell. This also includes marketing.</p>
<p>As the project itself has begun to grow, my eyes were opened to see that I could no longer do this as a one man show. Even if I were to finish the code. Nobody would play it, primarily because they won&#8217;t know it exists. Now that I have a few volunteers on board, things will get exciting. This will definitely be a great learning experience. One that I&#8217;m now ready to take on.</p>
<p>While &#8220;I can&#8217;t do this&#8221; is somewhat accurate, a more appropriate phrase would be: &#8220;I can&#8217;t do this alone.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://paulwarren.ca/archived/i-cant-do-this/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Two ads &amp; a side order of patience.</title>
		<link>http://paulwarren.ca/archived/two-ads-a-side-order-of-patience/</link>
		<comments>http://paulwarren.ca/archived/two-ads-a-side-order-of-patience/#comments</comments>
		<pubDate>Thu, 10 May 2007 01:47:59 +0000</pubDate>
		<dc:creator>antihero</dc:creator>
				<category><![CDATA[Life Thoughts]]></category>
		<category><![CDATA[The Business Element]]></category>
		<category><![CDATA[ikonquest]]></category>
		<category><![CDATA[patience]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://paulwarren.net/wordpress/?p=9</guid>
		<description><![CDATA[And so the stage I dread the most. Advertisement. I know it&#8217;s a vital step in any success, but I&#8217;m not good at it and dread doing it myself. Recently I have finished making a game I have been developing for about 4 months. The first month was steady work where the latter three months [...]]]></description>
			<content:encoded><![CDATA[<p class="blogbody"><img style="margin: 10px; float: right;" src="http://paulwarren.net/images/blog/smallscreeny.png" alt="" /> And so the stage I dread the most. Advertisement. I know it&#8217;s a vital step in any success, but I&#8217;m not good at it and dread doing it myself. Recently I have finished making a game I have been developing for about 4 months. The first month was steady work where the latter three months were on and off development. The game itself is a strategy game based off of two open source games. It is most similar to the popular Risk games and their variations, with a few noticeable differences.</p>
<p>The game is now ready for the public to play. But there&#8217;s one small detail, in order to attract players, I need players. It&#8217;s the catch 22. So what I need to do is find some way of having people join but also be patient in the early community life of the game. Do I spend some money to setup advertisements on other websites? Do I offer prizes for the Nth player to join&#8230;</p>
<p>I guess I have to do some sort of advertising, but I want to do what is best for the site. I don&#8217;t want to attract hundreds of people right away, to only have them leave and never come back because it was the wrong crowd. But I also don&#8217;t want to wait 10 years for the game to gain light and catch on either. So I&#8217;m off to do some advertising I guess. But if you haven&#8217;t seen any of my ads, head on to <a href="http://www.ikonquest.com/">www.ikonquest.com</a>. Feedback, suggestions, complaints or general comments are welcomed.</p>
]]></content:encoded>
			<wfw:commentRss>http://paulwarren.ca/archived/two-ads-a-side-order-of-patience/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitchy Eyes</title>
		<link>http://paulwarren.ca/archived/twitchy-eyes/</link>
		<comments>http://paulwarren.ca/archived/twitchy-eyes/#comments</comments>
		<pubDate>Thu, 10 May 2007 01:47:46 +0000</pubDate>
		<dc:creator>antihero</dc:creator>
				<category><![CDATA[Flailing Arms and Frustrations]]></category>
		<category><![CDATA[Life Thoughts]]></category>
		<category><![CDATA[anger]]></category>
		<category><![CDATA[frustration]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://paulwarren.net/wordpress/?p=8</guid>
		<description><![CDATA[My eye is beginning to twitch faster now. I&#8217;ve suffered about a year&#8217;s worth of inadequate web hosting service. The server is up, the server is down. MySQL won&#8217;t work or is broken. Tech Support is responsive 50% of the time. As of this article, the email server is not responding. I was about to [...]]]></description>
			<content:encoded><![CDATA[<p style="border: 1px solid #191919; margin: 10px; float: left"><img style="margin: 5px" src="http://paulwarren.net/images/blog/evilbert.jpg" alt="" /></p>
<p>My eye is beginning to twitch faster now. I&#8217;ve suffered about a year&#8217;s worth of inadequate web hosting service. The server is up, the server is down. MySQL won&#8217;t work or is broken. Tech Support is responsive 50% of the time. As of this article, the email server is not responding. I was about to make another Support Ticket but guess what&#8230; the ticket database was down!! Jeez!</p>
<p>It hasn&#8217;t always been like this. I&#8217;ve used their service for about 5 years or more. When I first signed up it was great. For several years everything was fine. Then I noticed that things started to crap out. So being a loyal customer, I simply just switched servers and everything was fine again. But I&#8217;ve been neededing to do that (jumping servers) almost twice a year lately to keep ahead of the servers going to hell.</p>
<p>Why not move? Well I&#8217;m poor. I can&#8217;t afford large service charges and the other reasonable ones don&#8217;t offer the needed services this one does. It DID work at some point. So it&#8217;s not like I had troubles from the start and should have known to switch early on. And when the problems started, I was thinking of just waiting out the problem and it will pass. But in order to move servers to a different provider, I need to be certain of a few things. #1. They must support the version of PHP I want. Too low and I&#8217;m not using them. I can&#8217;t downgrade all my code to suit them&#8230; even with the risk that they won&#8217;t be good either. MySQL needs to be high enough too. They can&#8217;t be anal about their transfer limits or speeds. I won&#8217;t sign up with someone who&#8217;s just going to charge me a huge number or cancel my services or automatically upgrade me in the case of one of my sites having a spike of popularity. I&#8217;d rather be warned first so I can prepare to respond. I need appropriate access to the files. None of this CPanel crap.</p>
<p>So the only solution I can think of currently is either finding someone who can fit my requirements, or possibly strike a deal with dedicated hosting if I provide the actual server. I&#8217;m willing to buy a server if it means my monthly cost is low.</p>
<p>This is really beginning to peeve me though. I&#8217;m struggling to develop a few applications, yet I find myself fighting with the stability of the servers more than my own code.</p>
]]></content:encoded>
			<wfw:commentRss>http://paulwarren.ca/archived/twitchy-eyes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Three Paths</title>
		<link>http://paulwarren.ca/archived/three-paths/</link>
		<comments>http://paulwarren.ca/archived/three-paths/#comments</comments>
		<pubDate>Thu, 10 May 2007 01:45:55 +0000</pubDate>
		<dc:creator>antihero</dc:creator>
				<category><![CDATA[Life Thoughts]]></category>
		<category><![CDATA[The Business Element]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[future]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://paulwarren.net/wordpress/?p=5</guid>
		<description><![CDATA[My Authoring Path I attempted to create a few novels. Made a few that were 50 to 100 pages but Wooah were they bad. I was a young teenager then, what can you expect? I also didn&#8217;t have the knack for original ideas yet. Well some were my own but it was clear where I [...]]]></description>
			<content:encoded><![CDATA[<p><img style="margin: 10px; float: right;" src="http://paulwarren.net/images/blog/commodore.png" alt="" /></p>
<p class="blogbody"><span style="font-size: large;"><strong>My Authoring Path</strong></span><br />
I attempted to create a few novels. Made a few that were 50 to 100 pages but <strong>Wooah</strong> were they bad. I was a young teenager then, what can you expect?</p>
<p>I also didn&#8217;t have the knack for original ideas yet. Well some were my own but it was clear where I had drawn my inspiration from. Never completely satisfied, and a good thing too, I continued to rewrite and record notes for other ideas and stories. It seemed that my originality started to bloom where my ability to stay on task and create one solid story had faded.</p>
<p>I now had thousands of little notes all organized into several large binders that were all unique. I could finally say I had true unique and original ideas for stories. But nothing solid as even one written chapter. My goals for writing had also changed. No longer had I written for expressing and exercising my creativity, I now had the desire to create true literary pieces. While I didn&#8217;t expect my stories would be a reading requirement in schools, I wanted the possibility to be there.</p>
<p>My second goal was to create something truly science fiction. Something the community would accept as worthy of the category. Any idea too close to those of &#8220;Star Wars&#8221; or &#8220;Star Trek&#8221; and my works would get shunned and called <em>not <strong>true</strong></em> science fiction. So I collected many Science Fiction magazines and a few classic novels to study for science fiction is truly about. That when the reader opens the book, they know it&#8217;s sci-fi.</p>
<p>Now I don&#8217;t have anything completed yet, but I&#8217;m working for the first time on my first draft. The whole series has been picked at and adjusted to become more realistic and believable. The draft will be my first, but seeing as I&#8217;m currently on another path, I don&#8217;t have much time to work on it.</p>
<p><span style="font-size: large;"><strong>The Development Path</strong></span><br />
Shortly before I entered college, I didn&#8217;t even have a computer. Not that I could afford one at that. I learned how to program on paper. While everyone in the class was writing poor code and just hoping things ran, I had to be sure it ran as I had even less time to develop than they did.</p>
<p>I fiddled around with modding games, not that it went anywhere at the time. Didn&#8217;t make anything either, I just took a look at the code but moved on to something a little easier. It was around this time that I started to program with perl and PHP. After a year of perl programming in college, I moved on to PHP and have done most of my development in that since.</p>
<p>I have three projects made with PHP. These, I consider my best work. The latest which is also a game, I have posted here, <a style="color: #188fc9; font-weight: bold;" href="http://www.greatgamesexperiment.com/game/ikonquest">iKonquest</a>.</p>
<p>My other two are an advanced webmail script by the name of <a style="color: #555555;" href="http://www.tdrnetwork.net/products/hermes">Hermes</a> which is currently used at <a style="color: #555555;" href="http://myguarded.name/">myguarded.name</a>. It specializes in a not-so-unique anti-spam method of whitelists. Eventually I will invest some time to setup Domain Keys for further security, but the biggest few solutions involve the participation of other services.</p>
<p>My last project is called <a style="color: #555555;" href="http://www.tdrnetwork.net/products/themis">Themis</a> which is the user management script run by both previous projects.</p>
<p>After I finish <a style="color: #188fc9; font-weight: bold;" href="http://www.greatgamesexperiment.com/game/ikonquest">iKonquest</a>, my next path will be</p>
<p><span style="font-size: large;"><strong>Business Development Path</strong></span><br />
Starting and running my own business. I don&#8217;t know why, but I&#8217;ve found myself too modest for my own good. I always understate my abilities but find I can&#8217;t shake myself from doing this. With the passion I have for the gaming industry, I won&#8217;t let it keep me down. If I can&#8217;t get a job as a developer, I&#8217;ll make my own.</p>
<p>While the company is unregistered, it&#8217;s name will remain top secret. But until then, I will be developing games on my own under my own name. I&#8217;m quite sure running this company for the first bit will take up at least a third of my time.</p>
<p>Designs are already coming together for a game similar to that of <a style="color: #188fc9; font-weight: bold;" href="http://www.greatgamesexperiment.com/game/dk2">Dungeon Keeper 2</a> and <a style="color: #188fc9; font-weight: bold;" href="http://www.greatgamesexperiment.com/game/EvilGenuis">Evil Genius</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://paulwarren.ca/archived/three-paths/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
