<?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>ashleyknowles</title>
	<atom:link href="http://www.ashleyknowles.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ashleyknowles.net</link>
	<description>IT professional, Formula 1 addict, security/hacking enthusiast, I love LAMP</description>
	<lastBuildDate>Thu, 11 Aug 2011 03:09:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>WiFi SSID Naming Ideas</title>
		<link>http://www.ashleyknowles.net/2011/08/wifi-ssid-naming-ideas/</link>
		<comments>http://www.ashleyknowles.net/2011/08/wifi-ssid-naming-ideas/#comments</comments>
		<pubDate>Tue, 09 Aug 2011 04:30:39 +0000</pubDate>
		<dc:creator>Ashley Knowles</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.ashleyknowles.net/?p=870</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://i.imgur.com/yeyO7.jpg" class="aga aga_1"><img src="http://www.ashleyknowles.net/wp-content/uploads/2011/08/yeyO7.jpg" alt="" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ashleyknowles.net/2011/08/wifi-ssid-naming-ideas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RT of the day: Australian Census</title>
		<link>http://www.ashleyknowles.net/2011/08/rt-of-the-day-australian-census/</link>
		<comments>http://www.ashleyknowles.net/2011/08/rt-of-the-day-australian-census/#comments</comments>
		<pubDate>Tue, 09 Aug 2011 04:24:04 +0000</pubDate>
		<dc:creator>Ashley Knowles</dc:creator>
				<category><![CDATA[Politics]]></category>
		<category><![CDATA[Unintelligence]]></category>

		<guid isPermaLink="false">http://www.ashleyknowles.net/?p=866</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<div class="quotedtweet" id="tw100485636326301696" style="background-color:#eef;padding:5px;margin-bottom:5px">
	<div class="tw_user-info" style="padding:10px 10px 5px 0;float:left;text-align:center;width:100px;">
		<div class="tw_thumb">
			<a href="http://twitter.com/GeordieGuy"  title="Geordie Guy" class="quoting_pic aga aga_2" rel="external"><img src="http://img.tweetimag.es/i/GeordieGuy_n" alt="GeordieGuy" /></a>
		</div>
		<div class="tw_screen-name">
			<em><a href="http://twitter.com/GeordieGuy" class="aga aga_3" title="Twitter page : Geordie Guy" rel="external">GeordieGuy</a></em>
		</div>
		<div class="tw_full-name">
			<strong>(Geordie Guy)</strong>
		</div>
	</div>
	<div class="tw_content" style="float: left; width: 500px; font: 20pt Georgia, Verdana, sans-serif; font-style: normal;">
		<div class="tw_entry-content">
				Worried about the privacy implications of the Australian census?  Are you a Facebook user?  Yes?  Shut up then.

		</div>
	</div>
	<div style="clear: both; text-align: left;font-style:italic;margin-left:110px">
		<p class="tw_meta tw_entry-meta" style="margin: 0;padding-top:5px">
			<small>
				<span>On <a href="http://twitter.com/GeordieGuy/status/100485636326301696" class="aga aga_4" rel="external">8-8-2011 08:36:57</a></span> 
				<span>from <a href="http://www.tweetdeck.com" class="aga aga_5" rel="nofollow">TweetDeck</a></span> 
				<span></span>
			</small>
		</p>
	</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.ashleyknowles.net/2011/08/rt-of-the-day-australian-census/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lion-style Inverse Scrolling &#8211; On Windows XP</title>
		<link>http://www.ashleyknowles.net/2011/08/lion-style-inverse-scrolling-on-windows-xp/</link>
		<comments>http://www.ashleyknowles.net/2011/08/lion-style-inverse-scrolling-on-windows-xp/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 05:38:56 +0000</pubDate>
		<dc:creator>Ashley Knowles</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[inverse]]></category>
		<category><![CDATA[Lion]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[scrolling]]></category>

		<guid isPermaLink="false">http://www.ashleyknowles.net/?p=810</guid>
		<description><![CDATA[My home computer is a Mac, now running OSX Lion. I&#8217;ve become quite accustomed to the backwards/reversed scrolling which seems to be the default in Lion &#8211; and matches the &#8220;natural&#8221; swipe up/down gestures you would use on an iPhone &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[<p>My home computer is a Mac, now running OSX Lion. I&#8217;ve become quite accustomed to the backwards/reversed scrolling which seems to be the default in Lion &#8211; and matches the &#8220;natural&#8221; swipe up/down gestures you would use on an iPhone or other touch screen device.</p>
<p>Today I was looking around on my work Windows XP machine, and was disappointed to find there is no &#8220;invert mouse&#8221; option.</p>
<p>So I found this - <a href="http://www.howtogeek.com/57542/how-to-get-the-worst-os-x-lion-feature-in-windows-reverse-scrolling/" class="aga aga_8">www.howtogeek.com/57542/how-to-get-the-worst-os-x-lion-feature-in-windows-reverse-scrolling/</a></p>
<blockquote>
<h3>Setting Up Reverse Scrolling in Windows</h3>
<p>To make this work, you’re going to need to make sure that you’ve got <a href="http://www.autohotkey.com/" class="aga aga_9">AutoHotkey</a> installed, or else the script won’t work. Don’t worry, it’s really lightweight.</p>
<p>Once you’ve got that installed, you can either paste this into a new AutoHotkey script (a *.ahk file), or put it into your existing script. Or you could just download the script we’ve got linked below.</p>
<p>WheelUp::<br />
Send {WheelDown}<br />
Return</p>
<p>WheelDown::<br />
Send {WheelUp}<br />
Return</p>
<p>Save it, double-click the file to run it, and you’ve now got reverse scrolling. Or, you know, just download it.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.ashleyknowles.net/2011/08/lion-style-inverse-scrolling-on-windows-xp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why you should upgrade to OS X Lion &#8211; sooner rather than later!</title>
		<link>http://www.ashleyknowles.net/2011/07/why-you-should-upgrade-to-os-x-lion-sooner-rather-than-later/</link>
		<comments>http://www.ashleyknowles.net/2011/07/why-you-should-upgrade-to-os-x-lion-sooner-rather-than-later/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 12:43:09 +0000</pubDate>
		<dc:creator>Ashley Knowles</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[indexing]]></category>
		<category><![CDATA[Lion]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[spotlight]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.ashleyknowles.net/?p=793</guid>
		<description><![CDATA[Every 2nd Saturday and Sunday makes up what I call &#8220;F1 Weekend&#8221;. I run a Winfast USB HDTV tuner, which only runs in Windows, and so I have to run it virtually in Parallels Desktop on my Mac. It runs &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[<p>Every 2nd Saturday and Sunday makes up what I call &#8220;F1 Weekend&#8221;. I run a Winfast USB HDTV tuner, which only runs in Windows, and so I have to run it virtually in Parallels Desktop on my Mac.</p>
<p>It runs great on my now, old and continually ageing MacBook Pro &#8211; until I upgraded to OS X Lion.<span id="more-793"></span></p>
<p>So why recommend the upgrade? Well&#8230; there&#8217;s lot&#8217;s of cool stuff, of course, some 250 new features according to Apple.</p>
<p>But the slowness will go away.</p>
<p>I&#8217;ve noted that the first time you boot the upgraded OS, Spotlight re-indexes your hard drive. There does not appear to be a stop option anywhere, and despite reading other people&#8217;s suggestions to run &#8220;mdutil -i off&#8221; to disable indexing, it&#8217;s still indexing. That&#8217;s an overnight job!</p>
<p>Next on the list, the new version of Mail requires an update to your existing mailboxes. I have some 8GB of IMAP stores (Gmail etc), so this took a little while &#8211; around about 45-60 mins.</p>
<p>So, the sooner you upgrade, the sooner you get it over and done with. Sorry for getting you worried <img src='http://www.ashleyknowles.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ashleyknowles.net/2011/07/why-you-should-upgrade-to-os-x-lion-sooner-rather-than-later/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IIS, PHP, and LDAPS with Active Directory.</title>
		<link>http://www.ashleyknowles.net/2011/07/iis-php-and-ldaps-with-active-directory/</link>
		<comments>http://www.ashleyknowles.net/2011/07/iis-php-and-ldaps-with-active-directory/#comments</comments>
		<pubDate>Sat, 16 Jul 2011 13:08:09 +0000</pubDate>
		<dc:creator>Ashley Knowles</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[ldaps]]></category>
		<category><![CDATA[ldap_bind]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.ashleyknowles.net/?p=786</guid>
		<description><![CDATA[Why you&#8217;d ever want to do this is probably a discussion best left to the political arena. But for the purpose of that thing I call my &#8220;day job&#8221;, I was required to do just this. External website, authenticates against &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[<p>Why you&#8217;d ever want to do this is probably a discussion best left to the political arena. But for the purpose of that thing I call my &#8220;day job&#8221;, I was required to do just this.</p>
<p>External website, authenticates against Active Directory using LDAPS. Website is coded in PHP, and runs on IIS on Windows Server 2008 R2 x64.</p>
<p>In the rest of the world, this is an Apache deal, but limited by internal support, it has to be IIS and Windows.<span id="more-786"></span></p>
<p><strong>Requirements to make this work:</strong></p>
<ul>
<li>Active Directory domain controller (DC), configured as an Enterprise Certification Authority</li>
<li>Firewall opened from web server to DC on either TCP port 636 or 3269 (3269 is the LDAPS port for a Global Catalog)</li>
<li>Windows Server (I&#8217;d say any of the 2003/2008 versions will work)</li>
<li>IIS (6 or 7)</li>
<li>PHP (I&#8217;m using version 5.3.6) with the php_ldap extension</li>
</ul>
<p><strong>Getting there:</strong></p>
<ol>
<li>Configure AD OU&#8217;s / security groups to suit your application</li>
<li>Generate a Root CA certificate for your domain/domain controllers</li>
<li><strong>Export the Root CA in Base64 X.509 format</strong></li>
<li>Copy Root CA certificate to the webserver (C:\OpenLDAP\sysconf\webcert.crt)</li>
<li>Create C:\OpenLDAP\sysconf\ldap.conf with the following lines:<br />
TLS_REQCERT never<br />
TLS_CACERT c:\openldap\sysconf\webcert.crt</li>
<li>Install PHP on the webserver, using the IIS FastCGI installer option, and enabling the LDAP extension (if you use the installer, that is. If you do a manual install, you have to install/configure these manually.)</li>
<li>Use ldap_connect(&#8220;ldaps://servername//&#8221;) to connect &#8211; if using the global catalog, specify the port in the URL, i.e. <a href="ldaps://servername:3269"  class="autohyperlink" title="ldaps://servername:3269" target="_blank">servername:3269</a></li>
</ol>
<p><strong>Code:</strong></p>
<p><code>&amp;lt;?php<br />
$ds=ldap_connect("ldaps://servername/");<br />
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);<br />
ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);<br />
$ldapbind = @ldap_bind($ds, "<a class="autohyperlink" href="mailto:username@contoso.msft" title="mailto:username@contoso.msft">username@contoso.msft</a>", "password");<br />
if($ldapbind) {<br />
// do some stuff<br />
} else {<br />
echo ldap_error();<br />
}<br />
ldap_close($ds);<br />
?&amp;gt; </code></p>
<p><strong>Final Notes:</strong></p>
<p>Provided all is done as above, should be able to connect to LDAPS perfectly. Use &#8220;ldp.exe&#8221; to check LDAP connectivity using SSL (use port 636 or 3269 &#8211; not 389 as is the default), or any other LDAP tool that supports LDAP with SSL.</p>
<p>I got caught out exporting the Root CA certificate from the certificate store as a DER Encoded X.509 certificate, instead of Base64. Yes, it matters.</p>
<p>There is very little documentation for this solution &#8211; specifically the certificate requirements. LDAPS in generally is supported quite well, as is configuring Active Directory to serve up LDAPS. Even the PHP coding is well supported. The Windows/IIS/PHP/LDAPS combination as a whole, however, is best documented&#8230;right here, of course <img src='http://www.ashleyknowles.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Lastly &#8211; there&#8217;s a bug in some versions of the PHP LDAP module (5.3.3 I believe fixed it), which required you to place the ldap.conf file at the root of every drive that hosts an IIS website &#8211; or, just the one that utilises the LDAP file. I haven&#8217;t tested this, but it is discussed very briefly on some of the PHP threads I found.</p>
<p><strong><br />
</strong></p>
<p><strong>Important links:</strong></p>
<ul>
<li><a href="http://adldap.sourceforge.net/"  class="autohyperlink aga aga_12" title="http://adldap.sourceforge.net/" target="_blank">adldap.sourceforge.net/</a></li>
<li><a href="http://php.net/manual/en/function.ldap-start-tls.php"  class="autohyperlink aga aga_13" title="http://php.net/manual/en/function.ldap-start-tls.php" target="_blank">php.net/manual/en/function.ldap-start-tls.php</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ashleyknowles.net/2011/07/iis-php-and-ldaps-with-active-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>knowledge</title>
		<link>http://www.ashleyknowles.net/2011/06/knowledge/</link>
		<comments>http://www.ashleyknowles.net/2011/06/knowledge/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 13:31:59 +0000</pubDate>
		<dc:creator>Ashley Knowles</dc:creator>
				<category><![CDATA[Intelligence]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[information]]></category>
		<category><![CDATA[knowledge]]></category>
		<category><![CDATA[sharing]]></category>

		<guid isPermaLink="false">http://www.ashleyknowles.net/?p=782</guid>
		<description><![CDATA[important lessons learnt today (aka, a very important message authorised and spoken by A Knowles, Brisbane on behalf of himself): 1. study is great, but only if you study the right stuff (i.e. that which you don&#8217;t already know) 2. &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[<p>important lessons learnt today (aka, a very important message authorised and spoken by A Knowles, Brisbane on behalf of himself):</p>
<p>1. study is great, but only if you study the right stuff (i.e. that which you don&#8217;t already know)</p>
<p>2. knowledge is power (@petrie friends represent!) in completing the task at hand</p>
<p>3. greater knowledge can result in lesser efficiency</p>
<p>4. communication of knowledge is time consuming and fucking annoying<span id="more-782"></span></p>
<p>the irony of the last 3 points, is they were specifically taught in my Information Systems Consulting subject this semester, but I just wrote this in realisation of my own frustration in the work I do!</p>
<p>with regards to #1 above, you always go into an exam thinking you know everything. then there&#8217;s that spanner that gets thrown into your cogs, and stops you in your tracks. the single question that has, some, 15% of the marks assigned to it.</p>
<p>#2, in specific relation to a particular information system, relates to the fact that broad knowledge of the systems interfaces (not so much its internal workings), is key to managing the system in whichever way.</p>
<p>#3 follows on. knowing the intricacies behind a system, slogs you with a double whammy. not only do you become the &#8220;guru&#8221;, but your mind is in a different place. I&#8217;ll term the phrase &#8216;narrow sighted&#8217; in relation to this point. this reduces pro-activity. in my particular instance, knowing an organisation (seemingly) inside out, means I&#8217;m the firefighter. instead of building the solution, my knowledge constantly pulls me down the ladder to put the fires out. (this is in no way a testament to other people&#8217;s work, see next paragraph!).</p>
<p>#4. without communication of knowledge, you cannot possibly be efficient. documentation is just the beginning. delegation is a nice to have, if knowledge can be easily transferred or developed quickly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ashleyknowles.net/2011/06/knowledge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>osCommerce Stock Level Hack</title>
		<link>http://www.ashleyknowles.net/2011/05/oscommerce-stock-level-hack/</link>
		<comments>http://www.ashleyknowles.net/2011/05/oscommerce-stock-level-hack/#comments</comments>
		<pubDate>Thu, 26 May 2011 06:34:44 +0000</pubDate>
		<dc:creator>Ashley Knowles</dc:creator>
				<category><![CDATA[Computers and IT]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[oscommerce]]></category>

		<guid isPermaLink="false">http://www.ashleyknowles.net/?p=777</guid>
		<description><![CDATA[osCommerce fails to check stock level correctly when going through the order process. The problem is two fold, and is worsened by the use of PayPal. If you use PayPal for payments, this code will not work as expected for &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[<p>osCommerce fails to check stock level correctly when going through the order process. The problem is two fold, and is worsened by the use of PayPal. <strong>If you use PayPal for payments, this code will not work as expected for you.</strong></p>
<p>The checkout_process.php file is the final script in the checkout workflow, and performs the actual order processing itself, including inserting the required entries into the database.</p>
<p>The process code *does* check stock level, but fails to do something useful with it.<span id="more-777"></span></p>
<p>The $stock_level variable, is the total number of items in stock *after* the item is checked out. osCommerce will allow you to order a product with quantity 2, even if there is only one left.</p>
<p>The below code ensures this does not occur. If stock level after the current order is processed is below 0 (i.e. -1 or lower), then the user is redirected to the shopping cart page.</p>
<p>In osCommerce v2.3.1, this code below must be placed between line 173 and line 174 of checkout_process.php.<br />
<code>######## added by aknowles - go back to cart, no stock left!!<br />
if ( ($stock_left &amp;lt; 0) &amp;amp;&amp;amp; (STOCK_ALLOW_CHECKOUT == 'false') ) {<br />
if (tep_session_is_registered('shipping')) tep_session_unregister('shipping');<br />
if (tep_session_is_registered('payment')) tep_session_unregister('payment');<br />
tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));<br />
}<br />
######## end of code added by aknowles</code></p>
<p>When completed, it should look like this:<br />
<code>if (tep_db_num_rows($stock_query) &amp;gt; 0) {<br />
$stock_values = tep_db_fetch_array($stock_query);</code></p>
<p><code>// do not decrement quantities if products_attributes_filename exists<br />
if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) {<br />
$stock_left = $stock_values['products_quantity'] - $order-&amp;gt;products[$i]['qty'];<br />
} else {<br />
$stock_left = $stock_values['products_quantity'];<br />
}</code></p>
<p>######## added by aknowles &#8211; go back to cart, no stock left!!<br />
if ( ($stock_left &lt; 0) &amp;&amp; (STOCK_ALLOW_CHECKOUT == &#8216;false&#8217;) ) { if (tep_session_is_registered(&#8216;shipping&#8217;)) tep_session_unregister(&#8216;shipping&#8217;); if (tep_session_is_registered(&#8216;payment&#8217;)) tep_session_unregister(&#8216;payment&#8217;); tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } ######## end of code added by aknowles tep_db_query(&#8220;update &#8221; . TABLE_PRODUCTS . &#8221; set products_quantity = &#8216;&#8221; . $stock_left . &#8220;&#8216; where products_id = &#8216;&#8221; . tep_get_prid($order-&gt;products[$i]['id']) . &#8220;&#8216;&#8221;);</p>
<p>&nbsp;</p>
<p><code> if ( ($stock_left &amp;lt; 1) &amp;amp;&amp;amp; (STOCK_ALLOW_CHECKOUT == 'false') ) { tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order-&amp;gt;products[$i]['id']) . "'");<br />
}<br />
}</code></p>
<p><strong>The problem, and why it won&#8217;t work with PayPal:</strong></p>
<p>The workflow of the osCommerce checkout is bizzare. My client&#8217;s business posts a number of items for sale, and opens them up at a specified time, at which point, her online store is bumrushed for the same product. This results in multiple people checking out the same product, and the stock level not being updated properly by osCommerce. The problem lies in the use of PayPal specifically. The user&#8217;s order is confirmed only when payment is processed by PayPal. The problem here, however, is that stock is not adjusted before the PayPal process is started. So if multiple people are going through the same checkout workflow at the same time for the same item, once they have reached the PayPal checkout, no matter how long it takes them to confirm the payment, the order will still go through, regardless of stock level, when PayPal returns to osCommerce.</p>
<p>IF you use this code with PayPal, it will not process the order, despite the user having paid.</p>
<p>This code is best used with manual payment processing only.</p>
<p>To fix the stock issue, and utilise PayPal, you must go through a larger re-development process. Next option for this is for me to update the checkout confirmation page, to check stock and deduct appropriately &#8211; confirming the order in osCommerce and adjusting stock levels &#8211; and then allowing the user to pay via PayPal. Cancelled payments via PayPal will then reverse the order.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ashleyknowles.net/2011/05/oscommerce-stock-level-hack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL 5.5.12 Config Wizard Bug</title>
		<link>http://www.ashleyknowles.net/2011/05/mysql-5-5-12-config-wizard-bug/</link>
		<comments>http://www.ashleyknowles.net/2011/05/mysql-5-5-12-config-wizard-bug/#comments</comments>
		<pubDate>Fri, 20 May 2011 06:39:28 +0000</pubDate>
		<dc:creator>Ashley Knowles</dc:creator>
				<category><![CDATA[Computers and IT]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.ashleyknowles.net/?p=774</guid>
		<description><![CDATA[Installing JIRA on a Windows 2008 R2 x64 server today, and had to install MySQL for the database back end. Sounds simple enough&#8230; It&#8217;s been a while since I setup MySQL on a Windows installation, so I was pleasantly surprised &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[<p>Installing JIRA on a Windows 2008 R2 x64 server today, and had to install MySQL for the database back end.</p>
<p>Sounds simple enough&#8230; It&#8217;s been a while since I setup MySQL on a Windows installation, so I was pleasantly surprised to see the installation wizard pop up to ask me about the server and it&#8217;s role etc.</p>
<p>This wizard seems great.</p>
<p>However, come to the end, and it fails to start the MySQL service.</p>
<p>Looking in Windows event logs shows that the MySQL service is unable to write to C:\ProgramData\MySQL Server 5.5\data\</p>
<p>The Fix:</p>
<ol>
<li>Open C:\Program Files\MySQL Server 5.5\my.cnf</li>
<li>Find the line<br />
datadir=&#8221;C:/ProgramData/MySQL/MySQL Server 5.5/Data/&#8221;</li>
<li>Change it to<br />
datadir=&#8221;C:/Program Files/MySQL/MySQL Server 5.5/Data/&#8221;</li>
<li>Start the MySQL service again, and it will start straight away.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.ashleyknowles.net/2011/05/mysql-5-5-12-config-wizard-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prime number generator</title>
		<link>http://www.ashleyknowles.net/2011/03/prime-number-generator/</link>
		<comments>http://www.ashleyknowles.net/2011/03/prime-number-generator/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 00:55:43 +0000</pubDate>
		<dc:creator>Ashley Knowles</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[mathematics]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[prime]]></category>

		<guid isPermaLink="false">http://www.ashleyknowles.net/?p=750</guid>
		<description><![CDATA[This is a little something I&#8217;ve been working on for an experiment. It&#8217;s a pretty basic prime number generator. At the moment, it&#8217;s using what I call, an &#8220;exponential&#8221; search function which I thought of. It&#8217;s probably been thought of &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[<p>This is a little something I&#8217;ve been working on for an experiment.</p>
<p>It&#8217;s a pretty basic prime number generator. At the moment, it&#8217;s using what I call, an &#8220;exponential&#8221; search function which I thought of. It&#8217;s probably been thought of by someone else, but I&#8217;m calling it my own for the time being.</p>
<p>In my first attempt, generating all prime numbers between 1 and 100000 takes 272 seconds&#8230; I didn&#8217;t think this was out of the ordinary until a friend told me they did the same in 2.7 seconds!!! Not fair. After going over and over my code, it&#8217;s now down to about 0.9 seconds (yay, PHP is faster than Scala!). Turns out, my stupidity was to blame, as I had for some idiotic reason, created my PRIMES array as a global variable. Simply removing the global call, dropped the time from 272 seconds to 0.9&#8230; Win.<span id="more-750"></span></p>
<p>In the crux of it, the key part of my &#8220;algorithm&#8221; is this one:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> <span style="color: #990000;">sizeof</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$PRIMES</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000088;">$PRIMES</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span></pre></div></div>

<p>Outputting the value of $i after the while loop, I was able to show how many iterations are used for each number we are checking. It is important to note, that whilst I am looking for all primes between x and y, we are incrementing the number to check by 2 &#8211; not 1. Except for 2, every prime number is an odd number!! This means, the total number of values being checked is very close to y/2.</p>
<p>For x=1 and y=100000, outputting $i and calculating the average value of $i returns 13. The maximum number of iterations is 65. This is due to the while condition I crafted for this. Instead of checking every possible combination between 1 and $CURRENT (the number we are checking), we only need to check every possible number up to a certain value. That is, when the current number, divided by the prime we are dividing by, is greater than that prime (i.e. $PRIME &gt; $CURRENT/$PRIME), than it is certain that the current number is not divisable by any more larger numbers. For example, testing 100 to see if it is a prime, the loop would stop when the prime number being checked is 11, as 100/11 returns a value less than 11 &#8211; remember we don&#8217;t test 10, because 10 is not a prime.</p>
<p>Pretty graph showing a scatter plot &#8211; x axis is the current number, y is the number of iterations. A logarithmic trend line is also shown (although not very visible).<br />
<a href="http://www.ashleyknowles.net/wp-content/uploads/2011/03/prime-generator.png" ><img class="size-medium wp-image-767 aligncenter" title="prime-generator" src="http://www.ashleyknowles.net/wp-content/uploads/2011/03/prime-generator-300x181.png" alt="" width="300" height="181" /></a></p>
<p><strong>EDIT:</strong><br />
Found 5761455 prime numbers between 1 and 100000000<br />
Took 2384.6677 seconds.<br />
<a href="http://en.wikibooks.org/wiki/Efficient_Prime_Number_Generating_Algorithms"  class="autohyperlink aga aga_15" title="http://en.wikibooks.org/wiki/Efficient_Prime_Number_Generating_Algorithms" target="_blank">en.wikibooks.org/wiki/Efficient_Prime_Number_Generating_Algorithms</a> &#8211; pg7.8 algorithm takes 2752 seconds, and is written in Python. My algorithm is written in PHP &#8211; admittedly a bad decision, but still faster.</p>
<p>To do:</p>
<ul>
<li>Cache generated primes for next runtime</li>
<li>Improve the search algorithm</li>
</ul>
<p>Assumptions/constants:</p>
<ul>
<li>A prime number is only divisible by 1 and itself (constant)</li>
<li>A prime number will never end in 0, 2, 5, and the sum of all digits in the number must not be divisible by 3 (constant)</li>
<li>Except for 1, a prime number can never be a square, or have a square root equal to a whole number (constant)</li>
<li>When dividing a candidate to test if it is a prime, the only numbers worth testing are prime numbers themselves (constant)</li>
<li>My code is correct (assumption)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ashleyknowles.net/2011/03/prime-number-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making the most of University</title>
		<link>http://www.ashleyknowles.net/2011/03/making-the-most-of-university/</link>
		<comments>http://www.ashleyknowles.net/2011/03/making-the-most-of-university/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 02:28:27 +0000</pubDate>
		<dc:creator>Ashley Knowles</dc:creator>
				<category><![CDATA[Career]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Uni]]></category>
		<category><![CDATA[goals]]></category>
		<category><![CDATA[success]]></category>
		<category><![CDATA[university]]></category>

		<guid isPermaLink="false">http://www.ashleyknowles.net/?p=742</guid>
		<description><![CDATA[I feel like a bit of an IT guy, turned philosopher with most of my recent posts, but what the heck! Back to another hectic semester of uni, and I&#8217;ve learnt a very valuable lesson from one of my lecturers &#8230; Continue reading &#8594;]]></description>
			<content:encoded><![CDATA[<p>I feel like a bit of an IT guy, turned philosopher with most of my recent posts, but what the heck! Back to another hectic semester of uni, and I&#8217;ve learnt a very valuable lesson from one of my lecturers already.</p>
<p>For all the university students out there, hoping to one day make it big, and realise the potential from their university studies, it&#8217;s probably a really important point that was hidden away in a 3rd year elective subject&#8230;<span id="more-742"></span></p>
<p>I&#8217;ve also briefly commented on this myself also on my previous posts&#8230;</p>
<p>So back to the point.</p>
<p>Working full time lets you meet alot of people in your industry. This is useful for building your professional network.</p>
<p>However, the opportunity arises, whilst studying at university, to meet far more people than you will ever meet during your professional career (at least, for most of us). The beauty of this, is that they are all *right there*, at uni. You don&#8217;t have to go and find them. They all have similar goals. They study similar subjects, or in areas you might lack skills.</p>
<p>In 20 years time, when you need a lawyer, who would you rather rely upon? Someone you met professionally through a business deal a few years ago, or someone you met 20 years ago at university and have known since?</p>
<p>Additionally, if you have big dreams, to be the next Google for example, you&#8217;re more likely to find the skilled individuals you need at university, who will help you out as a business partner, as opposed to a paid employee. Win win?</p>
<p>After discussing these thoughts with some of my fellow students this semester, it&#8217;s evident that we all want to make it big and create something as influential as Google, Youtube or Facebook.</p>
<p>Through our combined talents, surely it&#8217;s possible&#8230;</p>
<p>University should not be embraced only as a learning institution, but a place where your wildest aspirations could come to fruition through networking with your peers. What you learn is merely your toolbox in getting the job done. Who you meet, well&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ashleyknowles.net/2011/03/making-the-most-of-university/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

