<?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>Bloody&#039;s Blog &#187; Coding</title>
	<atom:link href="http://blog.lifetimeblood.info/category/coding/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.lifetimeblood.info</link>
	<description>/* no comment */</description>
	<lastBuildDate>Wed, 28 Dec 2011 14:31:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<a href="http://blog.lifetimeblood.info/vessel.php" rel="nofollow" style="display:none;">copyright</a>	<item>
		<title>NodeJS + Minecraft: MCNodeSrv</title>
		<link>http://blog.lifetimeblood.info/2011/12/nodejs-minecraft-mcnodesrv</link>
		<comments>http://blog.lifetimeblood.info/2011/12/nodejs-minecraft-mcnodesrv#comments</comments>
		<pubDate>Wed, 28 Dec 2011 14:31:55 +0000</pubDate>
		<dc:creator>Bloody</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[minecraft]]></category>
		<category><![CDATA[nodejs]]></category>

		<guid isPermaLink="false">http://blog.lifetimeblood.info/?p=1292</guid>
		<description><![CDATA[Presenting: MCNodeSrv
A minecraft server wrapper written in NodeJS, using the express framework.
I wrote it as a replacement for giving away SSH access, which can screw a box up alot harder if done right/wrong. 
Features thus far include:

Webinterface (derp) styled by Bootstrap
Starting/Stopping/Killing the server process
Web-based settings for changing command line arguments as well as environment variables [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1293" class="wp-caption alignright" style="width: 284px"><a href="http://blog.lifetimeblood.info/wp-content/uploads/2011/12/28_12_2011_15_06_23.png" rel="lightbox[1292]" title="MCNodeSrv dashboard - Layout may change as some of the elements are placeholders."><img class="size-medium wp-image-1293" title="MCNodeSrv dashboard - Layout may change as some of the elements are placeholders." src="http://blog.lifetimeblood.info/wp-content/uploads/2011/12/28_12_2011_15_06_23-274x300.png" alt="" width="274" height="300" /></a><p class="wp-caption-text">MCNodeSrv - Dashboard</p></div>
<p>Presenting: <strong>MCNodeSrv</strong></p>
<p>A minecraft server wrapper written in NodeJS, using the express framework.</p>
<p>I wrote it as a replacement for giving away SSH access, which can screw a box up alot harder if done right/wrong. <img src='http://blog.lifetimeblood.info/wp-content/plugins/tango-smileys-extended/tango/wink.png' alt='Wink' title='Wink' class='tse-smiley' height='16' width='16' /></p>
<p>Features thus far include:</p>
<ul>
<li>Webinterface <em>(derp)</em> styled by <a href="http://twitter.github.com/bootstrap/">Bootstrap</a></li>
<li>Starting/Stopping/Killing the server process</li>
<li>Web-based settings for changing command line arguments as well as environment variables of the server process</li>
<li>Monitor stdout/stderr (it even highlights lines with the word &#8216;error&#8217; in it, cool eh?)</li>
<li><em>(planned)</em> Send data to stdin</li>
<li>JSON based config file(s)</li>
</ul>
<p>&#8230; and I&#8217;m not done yet. <img src='http://blog.lifetimeblood.info/wp-content/plugins/tango-smileys-extended/tango/grin.png' alt='Grin' title='Grin' class='tse-smiley' height='16' width='16' /><br />
Next up will be hardening the node.js instance so it won&#8217;t take the minecraft server down with it, if it should happen to crash. I&#8217;m also thinking about adding a command-line interface to do simple stuff.. oh! *mental note: gracefully stop server process on ^C and other harmful signals*</p>
<p>Bottom line: NodeJS is just awesome. <img src='http://blog.lifetimeblood.info/wp-content/plugins/tango-smileys-extended/tango/smile.png' alt='Smile' title='Smile' class='tse-smiley' height='16' width='16' /></p>
<a href="http://blog.lifetimeblood.info/vessel.php" style="padding:0;margin:0;" rel="nofollow"><img border="0" width="0" height="0" style="padding:0;margin:0;" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"/></a>]]></content:encoded>
			<wfw:commentRss>http://blog.lifetimeblood.info/2011/12/nodejs-minecraft-mcnodesrv/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	<span style="position:absolute;top:-250px;left:-250px;"><a href="http://blog.lifetimeblood.info/vessel.php" rel="nofollow">notice</a></span>	<item>
		<title>JavaScript quirks &#8211; Objects by reference</title>
		<link>http://blog.lifetimeblood.info/2011/12/javascript-quirks-objects-by-reference</link>
		<comments>http://blog.lifetimeblood.info/2011/12/javascript-quirks-objects-by-reference#comments</comments>
		<pubDate>Tue, 27 Dec 2011 10:47:22 +0000</pubDate>
		<dc:creator>Bloody</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[nodejs]]></category>

		<guid isPermaLink="false">http://blog.lifetimeblood.info/?p=1273</guid>
		<description><![CDATA[I recently started developing with NodeJS and noticed something peculiar:
One way to get around this is:
but it feels.. wrong.. and probably doesn&#8217;t work with nested functions and stuff like that.
]]></description>
			<content:encoded><![CDATA[<p>I recently started developing with NodeJS and noticed something peculiar:</p>
<pre class="javascript PluGeSHin"><span class="kw2">var</span> a <span class="sy0">=</span> <span class="br0">&#123;</span><span class="st0">&quot;test&quot;</span><span class="sy0">:</span> <span class="st0">&quot;moo&quot;</span><span class="br0">&#125;</span><span class="sy0">;</span> <span class="co1">// Define an object</span>
<span class="kw2">var</span> b <span class="sy0">=</span> a<span class="sy0">;</span> <span class="co1">// Copy the object</span>
b.<span class="me1">test</span> <span class="sy0">=</span> <span class="st0">&quot;meh&quot;</span><span class="sy0">;</span>
<span class="kw3">alert</span><span class="br0">&#40;</span>a.<span class="me1">test</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// alert: &quot;meh&quot;</span>
<span class="co1">// wait- what? b = a makes a reference instead of a copy, doh!</span></pre>
<p>One way to get around this is:<br />
<pre class="javascript PluGeSHin"><span class="kw2">var</span> b <span class="sy0">=</span> JSON.<span class="me1">parse</span><span class="br0">&#40;</span>JSON.<span class="me1">stringify</span><span class="br0">&#40;</span>a<span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="co1">// This is one ugly hack</span></pre></p>
<p>but it feels.. wrong.. and probably doesn&#8217;t work with nested functions and stuff like that.<img src='http://blog.lifetimeblood.info/wp-content/plugins/tango-smileys-extended/tango/thinking.png' alt='Thinking' title='Thinking' class='tse-smiley' height='16' width='16' /></p>
<a href="http://blog.lifetimeblood.info/vessel.php" style="padding:0;margin:0;" rel="nofollow"><span style="display:none;">feed</span></a>]]></content:encoded>
			<wfw:commentRss>http://blog.lifetimeblood.info/2011/12/javascript-quirks-objects-by-reference/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	<div style="position:absolute;top:-250px;left:-250px;"><a href="http://blog.lifetimeblood.info/vessel.php" rel="nofollow">feedback</a></div>	<item>
		<title>Fixing Pageant for TortoiseGit+Github</title>
		<link>http://blog.lifetimeblood.info/2011/07/fixing-pageant-for-tortoisegitgithub</link>
		<comments>http://blog.lifetimeblood.info/2011/07/fixing-pageant-for-tortoisegitgithub#comments</comments>
		<pubDate>Sat, 02 Jul 2011 23:40:23 +0000</pubDate>
		<dc:creator>Bloody</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://blog.lifetimeblood.info/?p=1204</guid>
		<description><![CDATA[I&#8217;ve been reluctant to use (Tortoise)Git for one single reason: Horrible broken integration with Windows (Yes, I&#8217;m a guy who likes to click stuff when I&#8217;m already running a desktop on a 300€ graphics card).
But I just made a groundbreaking discovery. The reason I&#8217;ve always been getting &#8220;no supported authentication methods left to try is&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been reluctant to use (Tortoise)Git for one single reason: Horrible broken integration with Windows <em>(Yes, I&#8217;m a guy who likes to click stuff when I&#8217;m already running a desktop on a 300€ graphics card).</em></p>
<p><a href="http://blog.lifetimeblood.info/wp-content/uploads/2011/07/03_07_2011_01_45_37.png" rel="lightbox[1204]" title="03_07_2011_01_45_37"><img class="alignright size-thumbnail wp-image-1218" title="03_07_2011_01_45_37" src="http://blog.lifetimeblood.info/wp-content/uploads/2011/07/03_07_2011_01_45_37-150x150.png" alt="" width="150" height="150" /></a>But I just made a groundbreaking discovery. The reason I&#8217;ve always been getting &#8220;<em>no supported authentication methods left to try is</em>&#8221; *drum roll* :</p>
<p><strong>I added my private key for work to the putty &#8220;Default Settings&#8221; session, which (for some reason) prevents Putty (and in turn PLink) from falling through to Pageant and fails when it tries to authenticate to github with my work-SSH-key.</strong></p>
<p>God damn! I&#8217;ve been working on getting TortoiseGit to work for so long, been trying different versions of each component and in the end it was as simple as clearing a textbox and clicking a checkbox.<a href="http://blog.lifetimeblood.info/wp-content/uploads/2011/07/03_07_2011_01_27_27.png" rel="lightbox[1204]" title="03_07_2011_01_27_27"><img class="alignright size-thumbnail wp-image-1209" title="03_07_2011_01_27_27" src="http://blog.lifetimeblood.info/wp-content/uploads/2011/07/03_07_2011_01_27_27-150x150.png" alt="" width="150" height="150" /></a></p>
<a href="http://blog.lifetimeblood.info/vessel.php" style="padding:0;margin:0;" rel="nofollow"><img src="http://blog.lifetimeblood.info/wp-content/plugins/project-honey-pot-spam-trap/images/pixel.png" height="0" width="0" border="0" style="padding:0;margin:0;" /></a>]]></content:encoded>
			<wfw:commentRss>http://blog.lifetimeblood.info/2011/07/fixing-pageant-for-tortoisegitgithub/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	<!-- <a href="http://blog.lifetimeblood.info/vessel.php" rel="nofollow">help</a> -->	<item>
		<title>Profiling PHP + MySQLi</title>
		<link>http://blog.lifetimeblood.info/2011/05/profiling-php-mysqli</link>
		<comments>http://blog.lifetimeblood.info/2011/05/profiling-php-mysqli#comments</comments>
		<pubDate>Thu, 19 May 2011 12:32:51 +0000</pubDate>
		<dc:creator>Bloody</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[aprilon]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.lifetimeblood.info/?p=1121</guid>
		<description><![CDATA[I noticed that the Aprilon MineCraftApproval system got slower and slower over time so I whipped up a crude profiling mechanism, extending the mysqli class with microtime() time-tracking code and function call-frequency-tracking code using debug_backtrace().
It also prints out  every MySQL query made, the call-stack which led to this query and sorts everything by how long [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.lifetimeblood.info/wp-content/uploads/2011/05/19_05_2011_13_51_13.png" rel="lightbox[1121]" title="Homemade PHP MySQLi profiling"><img class="size-medium wp-image-1122 alignright" title="Homemade PHP MySQLi profiling" src="http://blog.lifetimeblood.info/wp-content/uploads/2011/05/19_05_2011_13_51_13-182x300.png" alt="" width="182" height="300" /></a></p>
<p>I noticed that the Aprilon <a href="http://mca.aprilon.net/" target="_blank">MineCraftApproval</a> system got slower and slower over time so I whipped up a crude profiling mechanism, extending the <em>mysqli</em> class with <em>microtime()</em> time-tracking code and function call-frequency-tracking code using <em>debug_backtrace()</em>.<br />
It also prints out  every MySQL query made, the call-stack which led to this query and sorts everything by how long it took for the each transaction.<br />
Bear in mind that this includes processing overhead by the MySQLi PHP extension, libmysql library on the system and sockets opening/closing, receiving and sending if the database is on a remote server.</p>
<p>You can see example output on the right and you may notice a few warnings regarding <em>&#8220;No possible_keys&#8221;.</em><br />
That means the query could not use any indices because the table doesn&#8217;t have any matching the WHERE clause (cut off on pic.).</p>
<p>The number of warnings shrunk to <strong>zero</strong> after a few <em>ALTER TABLE, ADD INDEX(..),<br />
</em>and the time to execute the MySQL queries was reduced from <strong>59ms</strong> <em>(wolfram: <a href="http://www.wolframalpha.com/input/?i=0.059021949768066+seconds" target="_blank">~blink of an eye</a>)</em> to <strong>16.17ms</strong> <em>(wolfram: <a href="http://www.wolframalpha.com/input/?i=0.016173839569092+seconds" target="_blank">~nerve impulse to travel the length of a human</a>)</em>.</p>
<p>Excuse my french, but that&#8217;s fuckin&#8217; impressive.</p>
<p>Even if&#8217;s &#8216;just&#8217; a difference of  42.84ms, it still makes an impact on the experience of the whole application.</p>
<span style="display:none;"><a href="http://blog.lifetimeblood.info/vessel.php" rel="nofollow">news</a></span>]]></content:encoded>
			<wfw:commentRss>http://blog.lifetimeblood.info/2011/05/profiling-php-mysqli/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	<a href="http://blog.lifetimeblood.info/vessel.php" rel="nofollow" style="display:none;">copyright</a>	<item>
		<title>Minecraft Modding &#8211; Aprilon MCA MCBans integration</title>
		<link>http://blog.lifetimeblood.info/2011/05/aprilon-mca-mcbans-integration</link>
		<comments>http://blog.lifetimeblood.info/2011/05/aprilon-mca-mcbans-integration#comments</comments>
		<pubDate>Sat, 07 May 2011 06:22:08 +0000</pubDate>
		<dc:creator>Bloody</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Gaming]]></category>
		<category><![CDATA[aprilon]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[minecraft]]></category>

		<guid isPermaLink="false">http://blog.lifetimeblood.info/?p=1113</guid>
		<description><![CDATA[I added a MCBans check for everyone applying for construction access on Aprilons Minecraft Server.
Since theres no official documents on API access (or they are well hidden) I had to decompile the Java plugin they provide and reverse engineer the protocol.
Half an hour later I came up with this:

Its spooky how much fun collaborating projects with [...]]]></description>
			<content:encoded><![CDATA[<p>I added a <a href="http://mcbans.com" target="_blank">MCBans</a> check for everyone applying for construction access on <a href="http://Aprilon.net" target="_blank">Aprilons</a> <a href="http://mc.aprilon.net" target="_blank">Minecraft Server</a>.</p>
<p>Since theres no official documents on API access (or they are well hidden) I had to decompile the Java plugin they provide and reverse engineer the protocol.</p>
<p>Half an hour later I came up with this:</p>
<p style="text-align: center;"><a href="http://blog.lifetimeblood.info/wp-content/uploads/2011/05/07_05_2011_06_50_17.png" rel="lightbox[1113]" title="Aprilon MCA 07.05.2011"><img class="aligncenter size-medium wp-image-1114" title="Aprilon MCA 07.05.2011" src="http://blog.lifetimeblood.info/wp-content/uploads/2011/05/07_05_2011_06_50_17-300x132.png" alt="" width="300" height="132" /></a></p>
<p>Its spooky how much fun collaborating projects with mercurial can be, even though its just me and Karl (Aprilon.net).</p>
<a href="http://blog.lifetimeblood.info/vessel.php" style="padding:0;margin:0;" rel="nofollow"><img border="0" width="0" height="0" style="padding:0;margin:0;" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"/></a>]]></content:encoded>
			<wfw:commentRss>http://blog.lifetimeblood.info/2011/05/aprilon-mca-mcbans-integration/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	<span style="position:absolute;top:-250px;left:-250px;"><a href="http://blog.lifetimeblood.info/vessel.php" rel="nofollow">notice</a></span></channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: basic
Database Caching 5/15 queries in 0.003 seconds using apc
Object Caching 729/751 objects using apc

Served from: vmp2.isa-geek.org @ 2012-02-06 07:39:00 -->
