<?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"
	>

<channel>
	<title>Techmale</title>
	<atom:link href="http://techmale.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://techmale.com</link>
	<description>Byting the hand that feeds you...</description>
	<pubDate>Wed, 28 Jan 2009 17:19:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Banned Characters in Cookies in Tomcat</title>
		<link>http://techmale.com/2009/01/28/banned-characters-in-cookies-in-tomcat/</link>
		<comments>http://techmale.com/2009/01/28/banned-characters-in-cookies-in-tomcat/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 17:19:16 +0000</pubDate>
		<dc:creator>Techmale</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[RFC]]></category>

		<guid isPermaLink="false">http://techmale.com/2009/01/28/banned-characters-in-cookies-in-tomcat/</guid>
		<description><![CDATA[I was recently asked to look into why we had a problem with &#8220;[]&#8221; (square brackets) that were being passed to us as part of an affiliate id, eg: &#8220;SF_1234_[345]&#8220;.
It seems we were saving the value to a cookie. This works fine if you check the cookie values in the browser. However, when we tried [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently asked to look into why we had a problem with &#8220;[]&#8221; (square brackets) that were being passed to us as part of an affiliate id, eg: &#8220;SF_1234_[345]&#8220;.</p>
<p>It seems we were saving the value to a cookie. This works fine if you check the cookie values in the browser. However, when we tried to pull the value in Tomcat, it got truncated to &#8220;SF_1234_&#8221;</p>
<p>After some painfull research&#8230; I finally found a page on the Tomcat buglist that <a title="Tomcat cookie banned characters" href="http://mail-archives.apache.org/mod_mbox/tomcat-dev/200406.mbox/%3C20040610192654.576.qmail@nagoya.betaversion.org%3E" target="_blank">clarifies the issue</a>, and breaks down the RFCs to manageable information.</p>
<p>The upshot it quite simple.</p>
<p>The following characters should never be used in an unquoted cookie value.</p>
<p><strong><em>()&lt;&gt;@,;:\\\&#8221;/[]?={} \t</em></strong></p>
<p>While they will work on some systems, anything that implements the RFC properly will break. As happened to us with Tomcat.</p>
]]></content:encoded>
			<wfw:commentRss>http://techmale.com/2009/01/28/banned-characters-in-cookies-in-tomcat/feed/</wfw:commentRss>
		</item>
		<item>
		<title>LHC: Large Hadron Collider: What could we discover&#8230;?</title>
		<link>http://techmale.com/2008/09/10/lhc-large-hadron-collider-what-could-we-discover/</link>
		<comments>http://techmale.com/2008/09/10/lhc-large-hadron-collider-what-could-we-discover/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 12:00:47 +0000</pubDate>
		<dc:creator>Techmale</dc:creator>
		
		<category><![CDATA[Physics]]></category>

		<category><![CDATA[Temporal Mechanics]]></category>

		<category><![CDATA[Thinking]]></category>

		<guid isPermaLink="false">http://techmale.com/2008/09/10/lhc-large-hadron-collider-what-could-we-discover/</guid>
		<description><![CDATA[I am eagerly waiting for the first results to come out of the LHC, and the next, and then the ones after that&#8230;
The possibilities for advancing theoretical physics through experimentation are remarkably rare, so an event of this magnitude should be followed with interest. Whatever the results, physics is about to undergo a huge leap [...]]]></description>
			<content:encoded><![CDATA[<p>I am eagerly waiting for the first results to come out of the LHC, and the next, and then the ones after that&#8230;</p>
<p>The possibilities for advancing theoretical physics through experimentation are remarkably rare, so an event of this magnitude should be followed with interest. Whatever the results, physics is about to undergo a huge leap forward.</p>
<p>As long as we are still around to see it&#8230; {Joke}</p>
<p>However, I have a question regarding the nature of Time&amp;Space that seems to have been ignored, as it is most difficult to find an answer. Either that or I am being an idiot&#8230; :-&gt;</p>
<p><strong><span style="text-decoration: underline;">What Happens to Time when there is no matter?</span></strong></p>
<p>We understand that the presence of Energy/Matter causes gravity and the curvature of SpaceTime. In fact with enough energy/matter density we get a gravity well of such density that it is effectively infinite, i.e.: a black hole.</p>
<p>It should also be noted that gravity and time are linked. As gravity becomes bigger, time dilates and each period of time lengthens.</p>
<p>Until we reach the theoretical point: that a person (who survived) falling into the event horizon of a black hole would experience such extreme time dilation that they would be able to watch the end of the universe.</p>
<p>This seems to be the normal point of interest, and everyone stops there.</p>
<p>However, my question relates to the opposite.</p>
<p><span style="text-decoration: underline;"><strong>The opposite of everything?</strong></span></p>
<p>Before the Big Bang, when there was no matter or energy, there was nothing to curve SpaceTime.</p>
<p>What happens to time in this situation?<br />
What is the shape of the curve?</p>
<p>As far as I can see there are two probably answers.</p>
<p>1. It is a simple curve, and time tends towards a fixed point</p>
<p><img src="http://techmale.com/wp-content/uploads/simple-curve.gif" alt="simple curve" width="220" height="256" /></p>
<p>2. It is a TAN like curve, where time tends towards infinite values.</p>
<p><img src="http://techmale.com/wp-content/uploads/tan-curve.gif" alt="tan curve" width="500" height="484" /></p>
<p>For some reason I rather like the 2nd answer, but I have been unable to find anything that would suggest this is the case.</p>
<p>It is an interesting theory, as given my assumption that Curve2 is correct: then all time before the Big Bang, i.e.: before the existence of energy/matter, would be contracted into an infinitely short period. At least from a theoretical observers point of view.</p>
<p>In effect the opposite of a a back hole, the opposite of a gravitational singularity with time dilation.</p>
<p>So my question is:<br />
<strong>In the TOTAL absence of energy/matter, does time becomes a singularity.</strong></p>
<p><strong><span style="text-decoration: underline;">Request for comment</span></strong></p>
<p>I have been looking for an answer to this question for a few years. Can you help? Do you know anyone who has already considered or answered this?</p>
<p>Please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://techmale.com/2008/09/10/lhc-large-hadron-collider-what-could-we-discover/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Speed Testing Chrome for List Processing</title>
		<link>http://techmale.com/2008/09/08/speed-testing-chrome-for-list-processing/</link>
		<comments>http://techmale.com/2008/09/08/speed-testing-chrome-for-list-processing/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 11:39:01 +0000</pubDate>
		<dc:creator>Techmale</dc:creator>
		
		<category><![CDATA[FireFox]]></category>

		<category><![CDATA[JSTR]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[Performance]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://techmale.com/2008/09/08/speed-testing-chrome-for-list-processing/</guid>
		<description><![CDATA[What are we testing?
As Rich Internet Application development progresses, more and more developers are moving towards the functional programming capabilities of JavaScript.
First Order Functions, Closures, Macros and Lists are becoming a mainstream method of development.
When you can tell the computer how to do it, rather that listing what it needs to do, it becomes much [...]]]></description>
			<content:encoded><![CDATA[<p><strong><span style="text-decoration: underline;">What are we testing?</span></strong></p>
<p>As Rich Internet Application development progresses, more and more developers are moving towards the functional programming capabilities of JavaScript.</p>
<p>First Order Functions, Closures, Macros and Lists are becoming a mainstream method of development.</p>
<p>When you can tell the computer how to do it, rather that listing what it needs to do, it becomes much easier to write a program and needs a lot less code.</p>
<p>Think recipe instead of precise instructions.</p>
<p>So how does Chrome compare to the other browsers when doing this?</p>
<p><strong><span style="text-decoration: underline;">What did we test?</span></strong></p>
<p>I used <a title="JavaScript Tester for Code Performance Evalution" href="http://jstr.technicalmagic.co.uk" target="_blank">JSTR</a> to create a re-usable test of basic Functional programming.</p>
<p>The test creates a list(array) from a DOM collection, runs a filter on the list to identify the required elements, then performs an action on those elements remaining.</p>
<p><a title="JSTR List Processing Test" href="http://jstr.technicalmagic.co.uk/?jstr_List_Processing_Test=KHtuYW1lOiJMaXN0IFByb2Nlc3NpbmcgVGVzdCIsIGRlc2M6IlB1dCB5b3VyIGRlc2NyaXB0aW9uIGhlcmUiLCBsb29wczoiMTAwMCIsIGl0ZXJhdGU6IjEwIiwgdGVzdHM6W3tuYW1lOiJET00gZWxlbWVudCByZWdleCIsIHNldHVwOiJUTS5SRUdFWCA9IHtcbiAgICAgICAgcHJvdG9jb2w6IG5ldyBSZWdFeHAoXCJeW146XSs6Ly9cIiksXG4gICAgICAgIGN1cnJlbnRIb3N0OiBuZXcgU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V3IFJlZ0V4cChcImNvbnNvbGVFbnRyeVwiKSwgXCJpZFwiLCBmYWxzZSkpO1xuXG5hcnJheTIuZm9yRWFjaChmdW5jdGlvbihlbCxpbmQsYXJyKXtcbiAgZWwuc3R5bGUuYmFja2dyb3VuZENvbG9yID0gXCJZRUxMT1dcIjtcbn0pO1xuXG4iLCBpbmM6dHJ1ZX1dLCB2ZXJzaW9uOjF9KQ==" target="_blank">Follow this LINK to run the test for yourself</a>.<br />
Paste the link into another browser to test it on different systems.</p>
<p>The test is pretty basic, but it provide a nice demonstration of the capabilites of Chrome.</p>
<p><strong><span style="text-decoration: underline;">So how did they do?</span></strong></p>
<p>Testing 1000 loops on a windows XP machine with 2Gb ram:<br />
Testing used 10 repetitions for averaging.</p>
<p><img src="http://techmale.com/wp-content/uploads/browser-lisp-times-1.gif" alt="browser lisp times" width="483" height="291" /></p>
<p><strong><span style="text-decoration: underline;">Conclusions</span></strong></p>
<p>It looks like the more modern browsers (FF3, Chrome, Safari) are now concentrating a great deal on Javascript performance. A very good piece of news for anyone developing Rich Internet Applications.</p>
<p>I must admit I was surprised by the performance of Safari on WindowsXP but it is nice to get surprises like this.</p>
<p>I had expected Chrome to out perform everything else and was a little disappointed to see otherwise. However, it is definetely a top notch Javascript system and I look forward to watching it develop.</p>
<p>This test does raise the issue that older versions of any browser will have significant differences in run-time speed for your application.</p>
<p>It looks like we will soon be back to the days of specifying a minumim compatible browser version, and the list will be quite short.</p>
<p><strong><span style="text-decoration: underline;">Request for Comments</span></strong></p>
<p>If you have a different operating system or browser&#8230; can you please let me know how it performs in this test?</p>
<ol>
<li>Use the link above to launch JSTR, pre-loaded with the test..</li>
<li>Clear the Console</li>
<li>Press RUN</li>
</ol>
<p>If you can leave a comment with the output, I will add it to the data collected.</p>
]]></content:encoded>
			<wfw:commentRss>http://techmale.com/2008/09/08/speed-testing-chrome-for-list-processing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How fast are chrome plugins?</title>
		<link>http://techmale.com/2008/09/02/how-fast-are-chrome-plugins/</link>
		<comments>http://techmale.com/2008/09/02/how-fast-are-chrome-plugins/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 11:18:58 +0000</pubDate>
		<dc:creator>Techmale</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://techmale.com/?p=198</guid>
		<description><![CDATA[It just occured to me, that, as the V8 javascript engine compiles JavaScript to native code&#8230;
&#8230;any plugin written in JavaScript should run at native speeds&#8230;
Does anyone have any more information on this?
]]></description>
			<content:encoded><![CDATA[<p>It just occured to me, that, as the V8 javascript engine compiles JavaScript to native code&#8230;</p>
<p>&#8230;any plugin written in JavaScript should run at native speeds&#8230;</p>
<p>Does anyone have any more information on this?</p>
]]></content:encoded>
			<wfw:commentRss>http://techmale.com/2008/09/02/how-fast-are-chrome-plugins/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Performance Testing in JavaScript</title>
		<link>http://techmale.com/2008/08/16/performance-testing-in-javascript/</link>
		<comments>http://techmale.com/2008/08/16/performance-testing-in-javascript/#comments</comments>
		<pubDate>Sat, 16 Aug 2008 08:10:26 +0000</pubDate>
		<dc:creator>Techmale</dc:creator>
		
		<category><![CDATA[Analysis]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[Optimization]]></category>

		<category><![CDATA[Performance]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://techmale.com/2008/08/16/performance-testing-in-javascript/</guid>
		<description><![CDATA[Fast pages and quick load times are key factors to keeping visitors on your site.
If you make them wait, they will leave.
So the speed of your JavaScript applications is crucial.
Fortunately, it turns out that JavaScript applications are ripe for performance optimization.
This requires a strong testing framework&#8230; enter JSTR.
String Concatenation Performance
A simple example of the type [...]]]></description>
			<content:encoded><![CDATA[<p>Fast pages and quick load times are key factors to keeping visitors on your site.<br />
If you make them wait, they will leave.</p>
<p>So the speed of your JavaScript applications is crucial.</p>
<p>Fortunately, it turns out that JavaScript applications are ripe for performance optimization.</p>
<p>This requires a strong testing framework&#8230; enter <a title="Javascript performance testing tool" href="http://jstr.technicalmagic.co.uk" target="_blank">JSTR</a>.</p>
<p><strong><span style="text-decoration: underline;">String Concatenation Performance</span></strong></p>
<p>A simple example of the type of benefit available from performance testing can come from testing String concatenation.</p>
<p>Javascript allows the use of &#8220;+&#8221; to concatenate Strings, but it turns out to be rather inefficient if you are building a very big string, eg: dynamically building HTML from AJAX.</p>
<p>Instead, the use of a Array (wrapped to provide a StringBuffer object) provides a huge boost in performance.</p>
<div class="codecolorer-container javascript"><div class="codecolorer" style="font-family: monospace;"><span class="kw2">function</span> StringBuffer<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="kw1">this</span>.<span class="me1">buffer</span> = <span class="br0">&#91;</span><span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span><br />
<br />
StringBuffer.<span class="me1">prototype</span>.<span class="me1">append</span> = <span class="kw2">function</span> append<span class="br0">&#40;</span>string<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="kw1">this</span>.<span class="me1">buffer</span>.<span class="me1">push</span><span class="br0">&#40;</span>string<span class="br0">&#41;</span>;<br />
<span class="kw1">return</span> <span class="kw1">this</span>;<br />
<span class="br0">&#125;</span>;<br />
<br />
StringBuffer.<span class="me1">prototype</span>.<span class="me1">toString</span> = <span class="kw2">function</span> toString<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="kw1">return</span> <span class="kw1">this</span>.<span class="me1">buffer</span>.<span class="me1">join</span><span class="br0">&#40;</span><span class="st0">&quot;&quot;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span>;<br />
<br />
<span class="kw2">var</span> buf = <span class="kw2">new</span> StringBuffer<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
buf.<span class="me1">append</span><span class="br0">&#40;</span><span class="st0">&quot;this is being added&quot;</span><span class="br0">&#41;</span>;<br />
<span class="kw3">alert</span><span class="br0">&#40;</span>buf.<span class="me1">toString</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div></div>
<p>To test this against a normal concatenation:<br />
Copy the String below, and then paste it into the IMPORT function in <a title="Stringbuffer Performance testing in Javascript" href="http://jstr.technicalmagic.co.uk" target="_blank">JSTR</a>.</p>
<div class="codecolorer-container javascript" style="height:35px;"><div class="codecolorer" style="font-family: monospace;">jstr_StringBuffer=KHtuYW1lOiJTdHJpbmdCdWZmZXIiLCBkZXNjOiJUaGlzIHRlc3QgY29tcGFyZXMgdGhlIHNwZWVkIG9mIGJ1aWxkaW5nIGEgbGFyZ2Ugc3RyaW5nIGJ5IGNvbmNhdGVuYXRpbmcgc3RyaW5ncyBvciB1c2luZyBhIFN0cmluZ0J1ZmZlcihhIHdyYXBwZWQgYXJyYXkpLlxuQ29tcGFyZXMgYm90aCBsb25nIGFuZCBzaG9ydCBzdHJpbmcgYnVpbGRpbmcuXG4iLCBsb29wczoiMjAwMCIsIGl0ZXJhdGU6IjUiLCB0ZXN0czpbe25hbWU6InNob3J0U1RSIGNvbmNhdCIsIHNldHVwOiJhU3RyaW5nID0gXCJhZGRpbmcgXCI7XG5iU3RyaW5nID0gXCJTdGFydCBcIjsiLCBjb2RlOiJiU3RyaW5nICs9IGFTdHJpbmc7IiwgaW5jOnRydWV9LCB7bmFtZToibG9uZ1N0ciBjb25jYXQiLCBzZXR1cDoiY1N0cmluZyA9IFwiIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVkIGFkZGVk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HsgXG4gICB0aGlzLmJ1ZmZlci5wdXNoKHN0cmluZyk7IFxuICAgcmV0dXJuIHRoaXM7IFxuIH07IFxuXG4gU3RyaW5nQnVmZmVyLnByb3RvdHlwZS50b1N0cmluZyA9IGZ1bmN0aW9uIHRvU3RyaW5nKCkgeyBcbiAgIHJldHVybiB0aGlzLmJ1ZmZlci5qb2luKFwiXCIpOyBcbiB9OyBcblxuYnVmID0gbmV3IFN0cmluZ0J1ZmZlcigpO1xuYnVmLmFwcGVuZChmU3RyaW5nKTsiLCBjb2RlOiIgYnVmLmFwcGVuZChlU3RyaW5nKTtcblxuIiwgaW5jOnRydWV9LCB7bmFtZToibG9uZ1N0ciBTdHJpbmdCdWZmZXIiLCBzZXR1cDoiXG5oU3RyaW5nID0gXCJTdGFydCBcIjtcblxuYnVmMiA9IG5ldyBTdHJpbmdCdWZmZXIoKTtcbmJ1ZjIuYXBwZW5kKGhTdHJpbmcpOyIsIGNvZGU6ImJ1Zi5hcHBlbmQoY1N0cmluZyk7XG5cbiIsIGluYzp0cnVlfV0sIHZlcnNpb246MX0p</div></div>
<p>Just to give you an idea&#8230;<br />
StringBuffer is just faster for short strings<br />
and about 50 times faster for long strings&#8230;!</p>
<p>My thanks to <a title="Javascript String Concatenation" href="http://www.softwaresecretweapons.com/jspwiki/javascriptstringconcatenation" target="_blank">Pavel Simakov</a> for this.</p>
]]></content:encoded>
			<wfw:commentRss>http://techmale.com/2008/08/16/performance-testing-in-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A &#8216;foolish&#8217; new tool for Javascript</title>
		<link>http://techmale.com/2008/08/14/a-foolish-new-tool-for-javascript/</link>
		<comments>http://techmale.com/2008/08/14/a-foolish-new-tool-for-javascript/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 12:02:01 +0000</pubDate>
		<dc:creator>Techmale</dc:creator>
		
		<category><![CDATA[Analysis]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://techmale.com/?p=177</guid>
		<description><![CDATA[I have been dying to shout about this&#8230;
instead I have been waiting very patiently&#8230;
BUT now it is time to SHOUT!
JSTR(Jester) is out of the box!
JSTR is the first &#8216;Browser based&#8217; (ie:Cross-browser ):

Testing
Benchmarking
Optimization

tool for javascript.
With both import &#38; export of Test-Sets, as well as auto-generated URLs, JSTR lets you easily share your code with everyone else, [...]]]></description>
			<content:encoded><![CDATA[<p>I have been dying to shout about this&#8230;</p>
<p>instead I have been waiting very patiently&#8230;</p>
<p>BUT now it is time to SHOUT!</p>
<p><a title="The funny man of Javascript" href="http://jstr.technicalmagic.co.uk/" target="_blank"><strong>JSTR(Jester) is out of the box!</strong></a></p>
<p>JSTR is the first &#8216;Browser based&#8217; (ie:Cross-browser ):</p>
<ul>
<li>Testing</li>
<li>Benchmarking</li>
<li>Optimization</li>
</ul>
<p>tool for javascript.</p>
<p>With both import &amp; export of Test-Sets, as well as auto-generated URLs, JSTR lets you easily share your code with everyone else, so they can try it for themselves.</p>
<p>Now, when you write about your new discovery, put a link to the test-set in your blog and let everyone else actually try it.</p>
<p><a title="The new testing tool for javascript" href="http://jstr.technicalmagic.co.uk/" target="_blank">Find out about the new funny man for JavaScript</a>.</p>
<p><a title="Introduction Video to JSTR" href="http://www.technicalmagic.co.uk/index.php/Blog/JSTR/Introducing-JSTR.html" target="_blank">Watch the video to learn more</a></p>
]]></content:encoded>
			<wfw:commentRss>http://techmale.com/2008/08/14/a-foolish-new-tool-for-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fixing an error building my first carbide.c++ project</title>
		<link>http://techmale.com/2008/08/11/fixing-an-error-building-my-first-carbidec-project/</link>
		<comments>http://techmale.com/2008/08/11/fixing-an-error-building-my-first-carbidec-project/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 22:45:40 +0000</pubDate>
		<dc:creator>Techmale</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://techmale.com/2008/08/11/fixing-an-error-building-my-first-carbidec-project/</guid>
		<description><![CDATA[
I installed the Carbide.C++ IDE today, followed the tutorial instructions but got an error when I went to build the project.
Error: &#8220;bldmake returned with exit value = 2&#8243;
A little digging later and I found the solution&#8230;
Open a CMD prompt to the group folder of my project and run:
&#8220;bldmake bldfiles&#8221;
It told me that bldmake.pl was unable [...]]]></description>
			<content:encoded><![CDATA[<p>
I installed the Carbide.C++ IDE today, followed the tutorial instructions but got an error when I went to build the project.</p>
<p>Error: &#8220;bldmake returned with exit value = 2&#8243;</p>
<p>A little digging later and I found the solution&#8230;</p>
<p>Open a CMD prompt to the group folder of my project and run:</p>
<p>&#8220;bldmake bldfiles&#8221;</p>
<p>It told me that bldmake.pl was unable to be run&#8230;</p>
<p>Even though I have perl installed.</p>
<p>So now I know I have a problem with my perl install.</p>
<p>The simple fix was installing ActivePerl as originally suggested.</p>
<p>Now it works.</p>
]]></content:encoded>
			<wfw:commentRss>http://techmale.com/2008/08/11/fixing-an-error-building-my-first-carbidec-project/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Secure your phpinfo from the bad people</title>
		<link>http://techmale.com/2008/08/11/secure-your-phpinfo-from-the-bad-people/</link>
		<comments>http://techmale.com/2008/08/11/secure-your-phpinfo-from-the-bad-people/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 15:07:00 +0000</pubDate>
		<dc:creator>Techmale</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://techmale.com/?p=153</guid>
		<description><![CDATA[I use the phpinfo() function a great deal, for basic information to advanced server administration checking, so I like to have it running on all my hosts.
Unfortunately this is a great hole in my security, as this information is a gold mine for the hackers out there.
I could simply remove the file when I am [...]]]></description>
			<content:encoded><![CDATA[<p>I use the phpinfo() function a great deal, for basic information to advanced server administration checking, so I like to have it running on all my hosts.</p>
<p>Unfortunately this is a great hole in my security, as this information is a gold mine for the hackers out there.</p>
<p>I could simply remove the file when I am finished, or obfuscate the filename to make it difficult to find. But both of these would rather destroy the ease and simplicity I am looking for.</p>
<p>So, I decided to sort this out today.</p>
<p>The solution I am using is simple. Basic HTTP Auth.</p>
<p>Just enough to deter any would be hackers, as no-one can see how complicated my security is behind this shield. And, this should work on all PHP servers.</p>
<p>Here is the code.</p>
<div class="codecolorer-container php"><div class="codecolorer" style="font-family: monospace;"><span class="kw2">function</span> authenticate<span class="br0">&#40;</span><span class="re0">$uid</span>,<span class="re0">$pw</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="kw1">if</span> <span class="br0">&#40;</span><br />
!<a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$_SERVER</span><span class="br0">&#91;</span><span class="st0">'PHP_AUTH_USER'</span><span class="br0">&#93;</span><span class="br0">&#41;</span> ||<br />
!<a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$_SERVER</span><span class="br0">&#91;</span><span class="st0">'PHP_AUTH_PW'</span><span class="br0">&#93;</span><span class="br0">&#41;</span> ||<br />
<span class="re0">$_SERVER</span><span class="br0">&#91;</span><span class="st0">'PHP_AUTH_USER'</span><span class="br0">&#93;</span> != <span class="re0">$uid</span> ||<br />
<span class="re0">$_SERVER</span><span class="br0">&#91;</span><span class="st0">'PHP_AUTH_PW'</span><span class="br0">&#93;</span> != <span class="re0">$pw</span><br />
<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
<a href="http://www.php.net/header"><span class="kw3">header</span></a><span class="br0">&#40;</span><span class="st0">'WWW-Authenticate: Basic realm=&quot;Security Check&quot;'</span><span class="br0">&#41;</span>;<br />
<a href="http://www.php.net/header"><span class="kw3">header</span></a><span class="br0">&#40;</span><span class="st0">'HTTP/1.0 401 Unauthorized'</span><span class="br0">&#41;</span>;<br />
<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;You must enter a valid login ID and password to access this resource<span class="es0">\n</span>&quot;</span>;<br />
<a href="http://www.php.net/exit"><span class="kw3">exit</span></a>;<br />
<span class="br0">&#125;</span><br />
<span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$pw</span> == <span class="st0">&quot;password&quot;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;You must change the 'password' before you can have access to this...&quot;</span>;<br />
<a href="http://www.php.net/exit"><span class="kw3">exit</span></a>;<br />
<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><br />
authenticate<span class="br0">&#40;</span><span class="st0">&quot;admin&quot;</span>,<span class="st0">&quot;password&quot;</span><span class="br0">&#41;</span>;<br />
<a href="http://www.php.net/phpinfo"><span class="kw3">phpinfo</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div></div>
<p>And a <a title="Secure phpinfo using Basic HTTP Auth" href="http://www.techmale.com/demo/info.zip">zipped version</a>.</p>
<p>If you have a standard file with phpinfo() in it&#8230;<br />
I <strong>highly suggest</strong> you start using this.</p>
]]></content:encoded>
			<wfw:commentRss>http://techmale.com/2008/08/11/secure-your-phpinfo-from-the-bad-people/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Timing is everything</title>
		<link>http://techmale.com/2008/07/19/timestamp-and-timing-in-javascript/</link>
		<comments>http://techmale.com/2008/07/19/timestamp-and-timing-in-javascript/#comments</comments>
		<pubDate>Sat, 19 Jul 2008 16:09:00 +0000</pubDate>
		<dc:creator>Techmale</dc:creator>
		
		<category><![CDATA[Analysis]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[Optimization]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://techmale.com/2008/07/19/timestamp-and-timing-in-javascript/</guid>
		<description><![CDATA[Here for your delight.
A simple way to track timing in Javascript.
// TIMESTAMP Function
function timestamp&#40;&#41;&#123;return &#40;new Date&#40;&#41;&#41;.valueOf&#40;&#41;;&#125;

// TIMER Function, wraps timing arround function call
function timer&#40;f&#41;&#123;
&#160; var t1 = timestamp&#40;&#41;;
&#160; for&#40;var i = 0; i &#38;lt; 1000; i++&#41;&#123;
&#160; &#160; f&#40;&#41;;
&#160; &#125;
&#160; var t2 = timestamp&#40;&#41;;
&#160; return t2-t1;
&#125;

// The function to test
var testFunc = function&#40;&#41;&#123;
&#160; var v = [...]]]></description>
			<content:encoded><![CDATA[<p>Here for your delight.</p>
<p>A simple way to track timing in Javascript.</p>
<div class="codecolorer-container php"><div class="codecolorer" style="font-family: monospace;"><span class="co1">// TIMESTAMP Function</span><br />
<span class="kw2">function</span> timestamp<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><span class="kw1">return</span> <span class="br0">&#40;</span><span class="kw2">new</span> <a href="http://www.php.net/date"><span class="kw3">Date</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>.valueOf<span class="br0">&#40;</span><span class="br0">&#41;</span>;<span class="br0">&#125;</span><br />
<br />
<span class="co1">// TIMER Function, wraps timing arround function call</span><br />
<span class="kw2">function</span> timer<span class="br0">&#40;</span>f<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; <span class="kw2">var</span> t1 = timestamp<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; <span class="kw1">for</span><span class="br0">&#40;</span><span class="kw2">var</span> i = <span class="nu0">0</span>; i &amp;lt; <span class="nu0">1000</span>; i++<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; f<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; <span class="br0">&#125;</span><br />
&nbsp; <span class="kw2">var</span> t2 = timestamp<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; <span class="kw1">return</span> t2-t1;<br />
<span class="br0">&#125;</span><br />
<br />
<span class="co1">// The function to test</span><br />
<span class="kw2">var</span> testFunc = <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; <span class="kw2">var</span> v = <span class="br0">&#40;</span>window<span class="br0">&#91;</span><span class="st0">&quot;DoYouBelieveInSpeedReading&quot;</span><span class="br0">&#93;</span><span class="br0">&#41;</span>?<span class="kw2">true</span>,<span class="kw2">false</span>;<br />
<span class="br0">&#125;</span><br />
<span class="co1">// Now call the timer</span><br />
alert<span class="br0">&#40;</span><span class="st0">&quot;time taken=&quot;</span>+<span class="br0">&#40;</span>timer<span class="br0">&#40;</span>testFunc<span class="br0">&#41;</span>/<span class="nu0">1000</span><span class="br0">&#41;</span> + <span class="st0">&quot; seconds&quot;</span> <span class="br0">&#41;</span>;</div></div>
<p>The core is converting a date object into milliseconds: <strong>date.getValueOf()</strong>. This will give you a Long of the number of millseconds since 1970.</p>
<p>so <strong>var t1 = timestamp();</strong> will store the start time.</p>
<p>Then do the thing you want to test&#8230; I would suggest a very large number of times&#8230; I needed to make it 100,000 for the Regex below.</p>
<p>and <strong>var t2 = timestamp();</strong> becomes the end time.</p>
<p>Now <strong>totalTimeTaken = t2 -t1;</strong> in millseconds.</p>
<p>Finally <strong>time = totalTimeTaken/1000;</strong> to get the number of seconds that the function took.</p>
<p>I wrapped it all up in a function timer&#8230;</p>
<p>which can be called by <strong><br />
alert(&#8221;time taken=&#8221;+timer(myFunc)/1000);</strong></p>
<p>I recently used this to test String matching functions, to find that <strong>indexOf</strong> is blisteringly fast, followed closely by <strong>pattern.test</strong>, and then way behind that <strong>String.match</strong> .</p>
<p><span style="text-decoration: underline;">For 100,000 repetitions:</span><br />
String.match: <strong>1300ms</strong><br />
pattern.test: <strong>360ms</strong><br />
String.indexOf: <strong>180ms</strong></p>
<p>So the moral of todays story is&#8230;</p>
<ul>
<li>
<div>use indexOf if you can</div>
</li>
<li>
<div>pattern.test if you must have REGEX or more than one match</div>
</li>
<li>
<div>and <strong>AVOID</strong> String.match if you can</div>
</li>
</ul>
<p>Just remember that premature optimization is a bad thing&#8230;</p>
<p>Happy Testing&#8230;!</p>
]]></content:encoded>
			<wfw:commentRss>http://techmale.com/2008/07/19/timestamp-and-timing-in-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Setting an Exclusion Cookie for Google Analytics with a Bookmarklet</title>
		<link>http://techmale.com/2008/07/18/setting-an-exclusion-cookie-for-google-analytics-with-a-bookmarklet/</link>
		<comments>http://techmale.com/2008/07/18/setting-an-exclusion-cookie-for-google-analytics-with-a-bookmarklet/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 18:52:23 +0000</pubDate>
		<dc:creator>Techmale</dc:creator>
		
		<category><![CDATA[Analytics]]></category>

		<category><![CDATA[Bookmarklet]]></category>

		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://techmale.com/?p=123</guid>
		<description><![CDATA[I have been doing a lot of work on my reading software website recently. This has played havoc with my Google Analytics reports.
So I set about looking for a way to block my own hits from the results. Having done a good search for up to date techniques, it seems that a cookie and a [...]]]></description>
			<content:encoded><![CDATA[<p>I have been doing a lot of work on my <a title="speed reading software that helps you read faster instantly" href="http://www.reallyeasyreader.com" target="_blank">reading software</a> website recently. This has played havoc with my Google Analytics reports.</p>
<p>So I set about looking for a way to block my own hits from the results. Having done a good search for up to date techniques, it seems that a cookie and a filter in analytics are still the current standard.</p>
<p>I came across loads of articles explaining all this, but none were really clear, so I thought I might cover the subject again. Partly for those who follow after me, and partly so I never need to research this again.</p>
<p>So for posterity here’s how to go about it.</p>
<p><strong><u>Creating the Exclude Filter</u></strong></p>
<p>I have written a seperate post on how to add an Exclusion Filter to Analytics in 10 easy steps with loads of screenshots.</p>
<p><strong><span style="TEXT-DECORATION: underline"><a title="How to add an Exclusion Filter to Analytics in 10 steps" href="http://techmale.com/2008/07/18/10-easy-steps-to-add-an-exclusion-filter-in-google-analytics/">How to add an Exclusion Filter to Analytics in 10 steps</a></span></strong></p>
<p>&nbsp;</p>
<p><strong><span style="TEXT-DECORATION: underline">Creating the Cookie</span></strong></p>
<p>Rather than go down the route of having to install something onto my website, I decided to create a BookMarkLet to generate the exclusion cookie.</p>
<p>This means I can use it for any site, it is quick and simple to use and most importantly there is no need to install anything on the website itself.</p>
<p>Another benefit is that I can get anyone working on or reviewing my site to use it as well, without too much trouble. All in all, a win-win solution to the problem.</p>
<p><strong><em><u>Get the BookMarkLet: Drag this link to your browser bar (add it to your bookmarks)</u></em></strong><br />
<a title="Drag this to your bookmark bar" href="javascript:(function(){var ut=window['urchinTracker'];var ga=window['pageTracker'];var ua=void 0;if((ut===ua)&amp;&amp;(ga===ua)){alert('No Analytics Loaded');}else{var v=prompt('Enter name for Analytics Exclusion Cookie.','ignoreMyHits');if(v){var sys='';if(ut!==ua){urchinTracker();__utmSetVar(v);sys+=' urchin';}if(ga!==ua){pageTracker._setVar(v);sys+=' GA';}alert('Cookie ['+v+'] is now set for '+sys+'.\n\n...::Take Note::...\nYou must run this every time you clear your cookies.\n\nRemember to set up an exclude filter for ['+v+'] in analytics.\nPut ['+v+'] into the filter pattern.\n\nFor more info, visit: www.techmale.com');}}})();">GA IgnoreMyHits</a></p>
<p>Then to put the cookie in place:</p>
<ul>
<li>Go to the site you want to stop recording hits on</li>
<li>Click on the bookmarklet(above) you have stored
<ul>
<li>let it add the exclusion cookie to your browser.</li>
</ul>
</li>
</ul>
<p><strong>First</strong> : choose you exclusion cookie name&#8230;</p>
<p><img height="145" alt="alert1" src="http://techmale.com/wp-content/uploads/alert1.gif" width="326" /></p>
<p><strong>Then</strong>: Make sure it all worked. It will recognise your analytics install and tell you which one it detected.</p>
<p><img height="202" alt="alert2" src="http://techmale.com/wp-content/uploads/alert2.gif" width="404" /></p>
<p>&nbsp;</p>
<p>If, like me, you use differant browsers for testing, make sure you do this with all of your browser,s rather than just your main one. This will ensure that your analytics results are totally accurate.</p>
<p>The only thing you must ensure is that you use the same name for both the cookie and the exclusion filter in analytics.</p>
<p>&nbsp;</p>
<p>So there you go a nice quick simple solution for clearing up your Analytics results.</p>
<p>I would like to thank, <a href="http://www.epikone.com/blog/2006/07/11/count-me-out/">Justin Cutroni</a> , as his blog was the first clear explanation I encountered.</p>
<p>&nbsp;</p>
<p><strong><u>A shameless plug..</u></strong></p>
<p>Bring the benefits of over 15 years experience in internet technologies, from programming through to usability &amp; design, persuasive copy-writing and site speed optimizations.<br />
Check out my consulting company, <a title="Simple Site Science from Technical Magic" href="http://www.technicalmagic.co.uk" target="_blank">Technical Magic</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://techmale.com/2008/07/18/setting-an-exclusion-cookie-for-google-analytics-with-a-bookmarklet/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
