<?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>jak dot cx</title>
	<atom:link href="http://www.jak.cx/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jak.cx</link>
	<description>i figured i should put something here</description>
	<lastBuildDate>Thu, 12 Jan 2012 16:33:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Longest possible delay for a setTimeout</title>
		<link>http://www.jak.cx/2012/01/longest-possible-delay-for-a-settimeout/</link>
		<comments>http://www.jak.cx/2012/01/longest-possible-delay-for-a-settimeout/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 16:33:31 +0000</pubDate>
		<dc:creator>Jak</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[useless]]></category>

		<guid isPermaLink="false">http://www.jak.cx/?p=237</guid>
		<description><![CDATA[Now I don&#8217;t know for sure (and never will be unless someone wants to keep a browser open for 26 days), but a bit of cross-browser testing tells me 2147483647 is the maximum number supported across browsers. Even though you&#8217;re &#8230;<p class="read-more"><a href="http://www.jak.cx/2012/01/longest-possible-delay-for-a-settimeout/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Now I don&#8217;t know for sure (and never will be unless someone wants to keep a browser open for 26 days), but a bit of cross-browser testing tells me<strong> 2147483647</strong> is the maximum number supported across browsers.</p>
<p>Even though you&#8217;re definitely not interested, its probably because this is the upper limit on a 32-bit signed integer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jak.cx/2012/01/longest-possible-delay-for-a-settimeout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Office Communicator Custom Status Editor v1.5.3 Released!</title>
		<link>http://www.jak.cx/2011/05/office-communicator-custom-status-editor-v1-5-3-released/</link>
		<comments>http://www.jak.cx/2011/05/office-communicator-custom-status-editor-v1-5-3-released/#comments</comments>
		<pubDate>Tue, 10 May 2011 20:38:48 +0000</pubDate>
		<dc:creator>Jak</dc:creator>
				<category><![CDATA[My Projects]]></category>
		<category><![CDATA[appear offline]]></category>
		<category><![CDATA[custom presence]]></category>
		<category><![CDATA[custom status]]></category>
		<category><![CDATA[log conversation]]></category>
		<category><![CDATA[office communicator]]></category>
		<category><![CDATA[record conversation]]></category>

		<guid isPermaLink="false">http://www.jak.cx/?p=229</guid>
		<description><![CDATA[This releases address the issue where it would not run unless as an administrator. The problem is it modifies the system registry, and places files for communicator to find which require elevated privileges. If you had User Access Control (UAC) &#8230;<p class="read-more"><a href="http://www.jak.cx/2011/05/office-communicator-custom-status-editor-v1-5-3-released/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>This releases address the issue where it would not run unless as an administrator. The problem is it modifies the system registry, and places files for communicator to find which require elevated privileges.</p>
<p>If you had User Access Control (UAC) enabled on Vista or 7, the program wouldn&#8217;t work as expected. Now it&#8217;s fixed, so permission is requested properly.</p>
<p>Also, I threw together a portable version of <a title="Office Communicator Custom Status Editor" href="http://www.jak.cx/projects/office-communicator-custom-statuses/">Office Communicator Custom Status Editor</a> so an installer is no longer needed. This weighs in at less than 35kb.</p>
<p>Hope it helps another couple of thousand people have custom status or custom presences on Microsoft Office Communicator 2007 R2.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jak.cx/2011/05/office-communicator-custom-status-editor-v1-5-3-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Allowing user to &#8220;sudo&#8221; on CentOS 5.5</title>
		<link>http://www.jak.cx/2011/05/allowing-user-to-sudo-on-centos-5-5/</link>
		<comments>http://www.jak.cx/2011/05/allowing-user-to-sudo-on-centos-5-5/#comments</comments>
		<pubDate>Mon, 02 May 2011 14:41:37 +0000</pubDate>
		<dc:creator>Jak</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.jak.cx/?p=214</guid>
		<description><![CDATA[On Ubuntu, its really simple. # adduser jak sudo and you&#8217;re done! On CentOS, theres a couple more steps. As root, run # /usr/sbin/usermod -aG wheel jak then edit the /etc/sudoers file # nano /etc/sudoers go down and find this&#8230; &#8230;<p class="read-more"><a href="http://www.jak.cx/2011/05/allowing-user-to-sudo-on-centos-5-5/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>On Ubuntu, its really simple.</p>
<p># adduser jak sudo</p>
<p>and you&#8217;re done!</p>
<p>On CentOS, theres a couple more steps.<br />
As root, run</p>
<p># /usr/sbin/usermod -aG wheel jak</p>
<p>then edit the /etc/sudoers file</p>
<p># nano /etc/sudoers</p>
<p>go down and find this&#8230;</p>
<p>## Allows people in group wheel to run all commands<br />
# %wheel	ALL=(ALL)	ALL</p>
<p>and remove the hash in front of %wheel so it looks like&#8230;</p>
<p>## Allows people in group wheel to run all commands<br />
%wheel	ALL=(ALL)	ALL</p>
<p>Once that&#8217;s done, your user &#8220;jak&#8221; is part of the wheel group, who are allowed to use sudo. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.jak.cx/2011/05/allowing-user-to-sudo-on-centos-5-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pirates vs Ninjas</title>
		<link>http://www.jak.cx/2011/04/pirates-vs-ninjas/</link>
		<comments>http://www.jak.cx/2011/04/pirates-vs-ninjas/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 13:51:17 +0000</pubDate>
		<dc:creator>Jak</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jak.cx/2011/04/pirates-vs-ninjas/</guid>
		<description><![CDATA[Required in every final year project:]]></description>
			<content:encoded><![CDATA[<div class='posterous_autopost'>
<div class='p_embed p_image_embed'> <a href="http://posterous.com/getfile/files.posterous.com/jakcx/BjILHw4FiMxrSH46GU1JkbP5388IkVdVaMBptnfK7mt8DTA5E8dn7kXQEWfs/Screen_shot_2011-04-20_at_10.1.png"><img alt="Screen_shot_2011-04-20_at_10" height="266" src="http://posterous.com/getfile/files.posterous.com/jakcx/qSTMGdLkHlUdYt1smIjH0CNPjIN2zWc66TiaU8Hep0xopAnRf0hLZMXauLkO/Screen_shot_2011-04-20_at_10.1.png.scaled.500.jpg" width="500" /></a> </div>
</p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>Required in every final year project:</div>
</div>
<p />
<p /> </div>
</div>
</div>
</div>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.jak.cx/2011/04/pirates-vs-ninjas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check out this Mac app: Scroll Reverser</title>
		<link>http://www.jak.cx/2011/04/check-out-this-mac-app-scroll-reverser-2/</link>
		<comments>http://www.jak.cx/2011/04/check-out-this-mac-app-scroll-reverser-2/#comments</comments>
		<pubDate>Sun, 17 Apr 2011 09:49:01 +0000</pubDate>
		<dc:creator>Jak</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jak.cx/2011/04/check-out-this-mac-app-scroll-reverser-2/</guid>
		<description><![CDATA[Scroll Reverser for Mac, at http://pilotmoon.com/scrollreverser In preparing for Lion, I&#8217;ve decided to see how the reverse scrolling (i.e your fingers move the page and not the scrollbar) would pan out on my MacBook. For web pages, I took to &#8230;<p class="read-more"><a href="http://www.jak.cx/2011/04/check-out-this-mac-app-scroll-reverser-2/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<div class='posterous_autopost'>
<div>
<div>Scroll Reverser for Mac, at <a href="http://pilotmoon.com/scrollreverser">http://pilotmoon.com/scrollreverser</a>
<p /></div>
</p></div>
<div>In preparing for Lion, I&#8217;ve decided to see how the reverse scrolling (i.e your fingers move the page and not the scrollbar) would pan out on my MacBook. For web pages, I took to it immediately and it felt right straight away. As I went a little further, with documents and editing in TextMate, it also felt natural with only a couple of slip ups reverting to previous behaviour, especially when I was editing rather than just viewing. Indeed, when I really needed to get down to some serious editing, reverse scrolling had to be switched off it was such a distraction!</div>
<p />
<div>My issues became a lot worse when it came to Finder though. It didn&#8217;t &#8220;feel right&#8221; when I was scrolling the display of folders and documents, and I repeatedly kept following my instincts and found myself trying to scroll with the scrollbar. I wonder if this is because I don&#8217;t feel like I&#8217;m moving a document or piece of paper, or maybe, I&#8217;ve become used to reverse scrolling through the use of my iPhone &#8211; which especially make sense when I&#8217;m scrolling web pages, but the iPhone lacks any kind of file browser and I&#8217;ve never had to scroll through a similar interface. This also might explain my difficulties when editing documents &#8211; something I rarely ever do on an iPhone, as I&#8217;m just a consumer of media on that device rather than my MacBook Pro where I&#8217;m both consuming and creating.</div>
<p />
<div>In summary, the reverse scrolling, which will be default in OS X 10.7 Lion, is natural for web pages and for viewing documents but frustrating for Finder windows where, even if I&#8217;m using reverse scrolling fine everywhere else, it just doesn&#8217;t &#8220;feel right&#8221;.</div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.jak.cx/2011/04/check-out-this-mac-app-scroll-reverser-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best way to stop SQL Injection in PHP &#8211; Stack Overflow</title>
		<link>http://www.jak.cx/2011/04/best-way-to-stop-sql-injection-in-php-stack-overflow/</link>
		<comments>http://www.jak.cx/2011/04/best-way-to-stop-sql-injection-in-php-stack-overflow/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 16:22:59 +0000</pubDate>
		<dc:creator>Jak</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jak.cx/2011/04/best-way-to-stop-sql-injection-in-php-stack-overflow/</guid>
		<description><![CDATA[Use prepared statements. These are SQL statements that sent to and parsed by the database server separately from any parameters. If you use PDO you can work with prepared statements like this: $preparedStatement = $db-&#62;prepare('SELECT * FROM employees WHERE name &#8230;<p class="read-more"><a href="http://www.jak.cx/2011/04/best-way-to-stop-sql-injection-in-php-stack-overflow/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<div class='posterous_autopost'>
<div class="posterous_bookmarklet_entry">
<blockquote class="posterous_long_quote">
<p>Use prepared statements. These are SQL statements that sent to and parsed by the database server separately from any parameters.</p>
<p>If you use PDO you can work with prepared statements like this:</p>
<div class="CodeRay">
<div class="code">
<div class="CodeRay">
<div class="code">
<pre>$preparedStatement = $db-&gt;prepare('SELECT * FROM employees WHERE name = :name');$preparedStatement-&gt;execute(array(':name' =&gt; $name));$rows = $preparedStatement-&gt;fetchAll();</pre>
</div></div>
</p></div>
</p></div>
<p>(where <code>$db</code> is a PDO object, see <a href="http://php.net/manual/en/book.pdo.php" rel="nofollow">the PDO documentation</a>)</p>
<p>What happens is that the SQL statement you pass to <code>prepare</code> is parsed and compiled by the database server. By specifying parameters (either a <code>?</code> or a named parameter like <code>:name</code> in the example above) you tell the database engine where you want to filter on. Then when you call <code>execute</code> the prepared statement is combined with the parameter values you specify. </p>
<p>The important thing here is that the parameter values are combined with the compiled statement, not a SQL string. SQL injection works by tricking the script into including malicious strings when it creates SQL to send to the database. So by sending the actual SQL separately from the parameters you limit the risk of ending up with something you didn&#8217;t intend. Any parameters you send when using a prepared statement will just be treated as strings (although the database engine may do some optimization so parameters may end up as numbers too, of course). In the example above, if the <code>$name</code> variable contains <code>'Sarah'; DELETE * FROM employees</code> the result would simply be a search for the string &#8220;&#8216;Sarah&#8217;; DELETE * FROM employees&#8221;, and you will not end up with an empty table.</p>
<p>Another benefit with using prepared statements is that if you execute the same statement many times in the same session it will only be parsed and compiled once, giving you some speed gains.</p>
<p>Oh, and since you asked about how to do it for an insert, here&#8217;s an example:</p>
<div class="CodeRay">
<div class="code">
<div class="CodeRay">
<div class="code">
<pre>$preparedStatement = $db-&gt;prepare('INSERT INTO table (column) VALUES (:column)');$preparedStatement-&gt;execute(array(':column' =&gt; $unsafeValue));</pre>
</div></div>
</p></div>
</p></div>
</blockquote>
<div class="posterous_quote_citation">via <a href="http://stackoverflow.com/questions/60174/best-way-to-stop-sql-injection-in-php">stackoverflow.com</a></div>
</p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.jak.cx/2011/04/best-way-to-stop-sql-injection-in-php-stack-overflow/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Securing /tmp on CentOS 5.5 on a VPS</title>
		<link>http://www.jak.cx/2011/04/securing-tmp-on-centos-5-5-on-a-vps/</link>
		<comments>http://www.jak.cx/2011/04/securing-tmp-on-centos-5-5-on-a-vps/#comments</comments>
		<pubDate>Sat, 02 Apr 2011 22:04:11 +0000</pubDate>
		<dc:creator>Jak</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jak.cx/?p=212</guid>
		<description><![CDATA[Backup your fstab file cp /etc/fstab /etc/fstab.bak Creating tmpmnt partition file (Around 1Gb in size) cd /vardd if=/dev/zero of=tmpMnt bs=1024 count=1048576 Format the new partition mkfs.ext3 -j /var/tmpMnt Press Y when asked Making backup of old /tmp cp -Rp /tmp &#8230;<p class="read-more"><a href="http://www.jak.cx/2011/04/securing-tmp-on-centos-5-5-on-a-vps/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Backup your fstab file<br />
<code>cp /etc/fstab /etc/fstab.bak</code></p>
<p>Creating tmpmnt partition file (Around 1Gb in size)<br />
<code>cd /vardd if=/dev/zero of=tmpMnt bs=1024 count=1048576</code></p>
<p>Format the new partition<br />
<code>mkfs.ext3 -j /var/tmpMnt</code><br />
Press Y when asked</p>
<p>Making backup of old /tmp<br />
<code>cp -Rp /tmp /tmp_backup</code></p>
<p>Mount the tmp filesystem<br />
<code>mount -o loop,noexec,nosuid,rw /var/tmpMnt /tmp</code></p>
<p>Set the right permissions<br />
<code>chmod 0777 /tmp</code></p>
<p>Copy the files back to new tmp folder<br />
<code>cp -Rp /tmp_backup/* /tmp/</code></p>
<p>Adding new /tmp filesystem to fstab<br />
<code>echo "/var/tmpMnt /tmp ext3 loop,rw,noexec,nosuid,nodev 0 0" &gt;&gt; /etc/fstab</code></p>
<p>No need for 2 tmp filesystems, so we symlink /var/tmp to /tmp<br />
<code>rm -rf /var/tmp/ln -s /tmp/ /var/tmp</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jak.cx/2011/04/securing-tmp-on-centos-5-5-on-a-vps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transporting Pictures over ASP.NET Web Services</title>
		<link>http://www.jak.cx/2011/01/transporting-pictures-over-asp-net-web-services-2/</link>
		<comments>http://www.jak.cx/2011/01/transporting-pictures-over-asp-net-web-services-2/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 16:58:49 +0000</pubDate>
		<dc:creator>Jak</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jak.cx/2011/01/transporting-pictures-over-asp-net-web-services-2/</guid>
		<description><![CDATA[So you can send a lot of stuff over web services, mostly primitive types, but what if you want to send pictures? I&#8217;m not talking about sending the URL to a picture, but sending the actual image data over a &#8230;<p class="read-more"><a href="http://www.jak.cx/2011/01/transporting-pictures-over-asp-net-web-services-2/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="posterous_autopost">
<p>So you can send a lot of stuff over web services, mostly primitive types, but what if you want to send pictures?</p>
<p>I&#8217;m not talking about sending the URL to a picture, but sending the actual image data over a web service, so that the client can display it. It&#8217;s really very simple, but also a fun addition. On the Web Service side, you need to take the image and encode it into a primitive type that can be handled through SOAP. To do this, I load the image, then convert its contents into a Base64 encoded string. I can then send this string back to the client.</p>
<p>Example:</p>
<p>https://gist.github.com/796979</p>
<p>Very simple! Now on the client side, we simply reverse the process.</p>
<p>Here is a synchronous example, for a better asynchronous example, have a look at my Visual Studio solution. This example is for a Windows form application, with a PictureBox object.</p>
<p>https://gist.github.com/796985</p>
<p>If you encounter errors, regarding the max length of strings, simply update the properties: maxBufferSize maxRecievedMessageSize and maxStringContentLength in the app.config file, and set the value to which 2048000 should be big enough!</p>
<p>You can download a solution folder, with a fully working example here: <a href="http://www.jak.cx/downloads/PicturesOverWebServiceTest.zip">http://www.jak.cx/downloads/PicturesOverWebServiceTest.zip</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.jak.cx/2011/01/transporting-pictures-over-asp-net-web-services-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash course, week 3! A flying bee</title>
		<link>http://www.jak.cx/2011/01/flash-course-week-3-a-flying-bee/</link>
		<comments>http://www.jak.cx/2011/01/flash-course-week-3-a-flying-bee/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 17:52:34 +0000</pubDate>
		<dc:creator>Jak</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jak.cx/2011/01/flash-course-week-3-a-flying-bee/</guid>
		<description><![CDATA[(915 KB) Watch on posterous]]></description>
			<content:encoded><![CDATA[<div class='posterous_autopost'>
<p>(915 KB)<br/> <a href="http://stream.jak.cx/flash-course-week-3-a-flying-bee" style="color: #bc7134">Watch on posterous</a></p>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.jak.cx/2011/01/flash-course-week-3-a-flying-bee/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My University Flash Class&#8230; The Pig!</title>
		<link>http://www.jak.cx/2011/01/my-university-flash-class-the-pig/</link>
		<comments>http://www.jak.cx/2011/01/my-university-flash-class-the-pig/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 16:33:14 +0000</pubDate>
		<dc:creator>Jak</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jak.cx/2011/01/my-university-flash-class-the-pig/</guid>
		<description><![CDATA[(1214 KB) Watch on posterous]]></description>
			<content:encoded><![CDATA[<div class='posterous_autopost'>
<p>(1214 KB)<br/> <a href="http://stream.jak.cx/my-university-flash-class-the-pig" style="color: #bc7134">Watch on posterous</a></p>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.jak.cx/2011/01/my-university-flash-class-the-pig/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

