<?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>Jonathon Bolster &#187; code</title>
	<atom:link href="http://www.bolsterweb.com/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bolsterweb.com</link>
	<description>Programming, drawing, random, life.</description>
	<lastBuildDate>Mon, 03 Oct 2011 17:30:56 +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>Finding and dropping a constraint using a table and column name</title>
		<link>http://www.bolsterweb.com/2011/10/finding-and-dropping-a-constraint-using-a-table-and-column-name/</link>
		<comments>http://www.bolsterweb.com/2011/10/finding-and-dropping-a-constraint-using-a-table-and-column-name/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 17:30:56 +0000</pubDate>
		<dc:creator>Jonathon Bolster</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.bolsterweb.com/?p=324</guid>
		<description><![CDATA[I had a bit of a problem in work. I had to write some SQL to drop a uniqueness constraint on a column but was unsure of the constraint name (since it was auto generated with a GUID on the end). Looking at the MSDN &#8216;Alter table&#8217; documentation, it seems that you need the constraint [...]]]></description>
			<content:encoded><![CDATA[<p>I had a bit of a problem in work. I had to write some SQL to drop a uniqueness constraint on a column but was unsure of the constraint name (since it was auto generated with a GUID on the end). Looking at the <a href="http://msdn.microsoft.com/en-us/library/aa275462(v=sql.80).aspx" title="Alter Table documentation on MSDN" onclick="pageTracker._trackPageview('/outgoing/msdn.microsoft.com/en-us/library/aa275462_v=sql.80_.aspx?referer=');">MSDN &#8216;Alter table&#8217; documentation</a>, it seems that you need the constraint name to drop it (please correct me if I&#8217;m wrong). I knew the table and the column names, so this is what I needed to work with.</p>
<p>So here&#8217;s what I came up with and this did the job:</p>
<pre class="brush: sql; title: ; notranslate">
            DECLARE @constraintName VARCHAR(50)

            select @constraintName = CONSTRAINT_NAME
            from INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE
            WHERE TABLE_NAME = '[YOUR_TABLENAME]' AND COLUMN_NAME = '[YOUR_COLUMNNAME]'

            IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[YOUR_TABLENAME]') AND name = @constraintName)
                EXEC('ALTER TABLE [YOUR_TABLENAME] DROP CONSTRAINT ' + @constraintName)
</pre>
<p>This worked for me since I know that the column will only have one constraint. Presumable the CONSTRAINT_COLUMN_USAGE will return multiple rows if there are multiple constraints. I also did the EXEC to get past the limitation that the DROP CONSTRAINT call doesn&#8217;t accept a variable.</p>
<p>If anyone has any comments/improvements on the above, I&#8217;d appreciate if you let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bolsterweb.com/2011/10/finding-and-dropping-a-constraint-using-a-table-and-column-name/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How clean is your window (object)?</title>
		<link>http://www.bolsterweb.com/2011/10/how-clean-is-your-window-object/</link>
		<comments>http://www.bolsterweb.com/2011/10/how-clean-is-your-window-object/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 17:30:32 +0000</pubDate>
		<dc:creator>Jonathon Bolster</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.bolsterweb.com/?p=316</guid>
		<description><![CDATA[I recently wanted to see how polluted the global namespace of our web application was. By that, I mean I wanted to see how many unnecessary objects we were assigning to the window object. To do this, I wanted to compare against a clean window object. A quick look on Google and I found this [...]]]></description>
			<content:encoded><![CDATA[<p>I recently wanted to see how polluted the global namespace of our web application was. By that, I mean I wanted to see how many unnecessary objects we were assigning to the window object.</p>
<p>To do this, I wanted to compare against a clean window object. A quick look on Google and I found this article: <a href="http://darcyclarke.me/development/getting-a-clean-document-or-window-object-in-javascript/" title="Getting a clean document or window Object in JavaScript" onclick="pageTracker._trackPageview('/outgoing/darcyclarke.me/development/getting-a-clean-document-or-window-object-in-javascript/?referer=');">Getting a clean document or window Object in JavaScript</a>. The basic idea is that you create a new iframe element, and you can use the contentWindow property of that to give you a nice clean window object. As the author states, you might want to do this to prevent the remapping of native methods but I just want it for a quick (i.e. hacky) way to see what objects have being put into my own &#8216;clean&#8217; window.</p>
<p>What I do is create the iframe to get my clean window. Set up an object to copy across the objects from the main window object, then remove any that appear in the clean window.</p>
<p>Here it is in glorious, unminified code:</p>
<pre class="brush: jscript; title: ; notranslate">
(function(window){
	var keys = {},
	cleanWindow,
	iframe = document.createElement(&quot;iframe&quot;);

	iframe.style.display =&quot;none&quot;;
	iframe = document.body.appendChild(iframe);

	cleanWindow = iframe.contentWindow;
	document.body.removeChild(iframe);

	for(var keyName in window){
		keys[keyName] = window[keyName];
	}

	for(var keyName in cleanWindow) {
		delete keys[keyName]
	}

	return keys;
}(window))
</pre>
<p>And here&#8217;s a version that I&#8217;ve minified down:</p>
<pre class="brush: jscript; title: ; notranslate">
(function($){var k={},w,d=document,b=d.body,i=d.createElement(&quot;iframe&quot;);i.style.display=&quot;none&quot;;i=b.appendChild(i);w=i.contentWindow;b.removeChild(i);for(var s in $){k[s]=$[s]}for(var s in w){delete k[s]}return k}(window))
</pre>
<p>This is written as <a href="http://stackoverflow.com/questions/592396/what-is-the-purpose-of-a-self-executing-function-in-javascript" title="What is the purpose of a self executing function in javascript? on StackOverflow" onclick="pageTracker._trackPageview('/outgoing/stackoverflow.com/questions/592396/what-is-the-purpose-of-a-self-executing-function-in-javascript?referer=');">self executing JavaScript</a> and will return an object containing the objects that we worked out were added to the window.</p>
<p>Note: This is a very quick and dirty piece of code. Mostly it was an experiment for myself, to use the &#8216;clean window&#8217; object. It won&#8217;t tell you if a native window property was changed or anything, it only compares the keys. Just remember that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bolsterweb.com/2011/10/how-clean-is-your-window-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript &#8211; e.preventDefault() is NOT return false</title>
		<link>http://www.bolsterweb.com/2011/01/javascript-e-preventdefault-is-not-return-false/</link>
		<comments>http://www.bolsterweb.com/2011/01/javascript-e-preventdefault-is-not-return-false/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 11:57:18 +0000</pubDate>
		<dc:creator>Jonathon Bolster</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.bolsterweb.com/?p=194</guid>
		<description><![CDATA[I&#8217;ve seen a lot of people use return false in place of e.preventDefault. This is usually when dealing with setting the click event on a hyperlink. I can only think that this comes from the original JavaScript snippets of running code on a click by setting onclick="alert('hi'); return false". This is wrong Well &#8211; it [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve seen a lot of people use <code>return false</code> in place of <code>e.preventDefault</code>. This is usually when dealing with setting the click event on a hyperlink. I can only think that this comes from the original JavaScript snippets of running code on a click by setting <code>onclick="alert('hi'); return false"</code>.</p>
<p><strong>This is wrong</strong></p>
<p>Well &#8211; it might be wrong. It all depends on your application. As long as you know the differences in them, you should be fine:</p>
<ul>
<li><strong>e.preventDefault</strong>: this (aptly) prevents the default event from happening. In the case of a hyperlink that you want to assign JavaScript to, this will stop the link from going to the location of the link</li>
<li><strong>e.stopPropagation</strong>: this stops the event from bubbling up. If you click on something that had a click event then using this will stop the event bubbling up and any click event that the parent containers might have.</li>
<li><strong>return false</strong>: this is the same as calling both of the methods above.</li>
</ul>
<p>I&#8217;ve done two examples for this:</p>
<ol>
<li><a href="http://jsfiddle.net/jonathon/XTY5c/" onclick="pageTracker._trackPageview('/outgoing/jsfiddle.net/jonathon/XTY5c/?referer=');">Showing the difference in e.preventDefault() and return false</a>: This example works on the click event and shows that preventDefault and return false are actually different.
</li>
<li><a href="http://jsfiddle.net/jonathon/JLMaR/" onclick="pageTracker._trackPageview('/outgoing/jsfiddle.net/jonathon/JLMaR/?referer=');">Example of e.stopPropagation</a>: This example shows a practical example of when you&#8217;d want to stop an event bubbling up. It uses event handlers on the mouseover event to show this.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.bolsterweb.com/2011/01/javascript-e-preventdefault-is-not-return-false/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Shortcut for JavaScript timestamp</title>
		<link>http://www.bolsterweb.com/2010/11/shortcut-for-javascript-timestamp/</link>
		<comments>http://www.bolsterweb.com/2010/11/shortcut-for-javascript-timestamp/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 11:28:25 +0000</pubDate>
		<dc:creator>Jonathon Bolster</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.bolsterweb.com/?p=179</guid>
		<description><![CDATA[JavaScript&#8217;s Date object provides a function for getting the milliseconds from the UNIX epoch &#8211; getTime(): However, there is a handy shortcut that gets the same thing: It makes me wonder if the +new shortcut can work for any other JavaScript object but I haven&#8217;t had a chance to look yet. Update: Apparently it&#8217;s just [...]]]></description>
			<content:encoded><![CDATA[<p>JavaScript&#8217;s Date object provides a function for getting the milliseconds from the UNIX epoch &#8211; <a href="http://www.w3schools.com/jsref/jsref_getTime.asp" onclick="pageTracker._trackPageview('/outgoing/www.w3schools.com/jsref/jsref_getTime.asp?referer=');">getTime()</a>:</p>
<pre class="brush: jscript; title: ; notranslate">
var timeStamp = new Date().getTime();
</pre>
<p>However, there is a handy shortcut that gets the same thing:</p>
<pre class="brush: jscript; title: ; notranslate">
var timeStamp = +new Date();
</pre>
<p>It makes me wonder if the <code>+new</code> shortcut can work for any other JavaScript object but I haven&#8217;t had a chance to look yet.</p>
<p><strong>Update</strong>: Apparently it&#8217;s just the unary operator (<a href="http://xkr.us/articles/javascript/unary-add/" onclick="pageTracker._trackPageview('/outgoing/xkr.us/articles/javascript/unary-add/?referer=');">http://xkr.us/articles/javascript/unary-add/</a>). From the article:</p>
<blockquote><p>The unary + operator, when used on types other than string, will internally attempt to call valueOf() or toString() (in that order) and then attempt to convert the result to a number. Thusly, the unary + operator can successfully convert many of the native JS types with certain restrictions.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.bolsterweb.com/2010/11/shortcut-for-javascript-timestamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Indexed IEnumerable extension</title>
		<link>http://www.bolsterweb.com/2010/10/indexed-ienumerable-extension/</link>
		<comments>http://www.bolsterweb.com/2010/10/indexed-ienumerable-extension/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 17:40:43 +0000</pubDate>
		<dc:creator>Jonathon Bolster</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[extension]]></category>

		<guid isPermaLink="false">http://www.bolsterweb.com/?p=173</guid>
		<description><![CDATA[The original intention for this was to clean up some code which was calling a Select to get an Index value so that basic zebra striping of rows could be done. It return an IndexedType generic class of type T which has properties for the original object and the index value of it. And the [...]]]></description>
			<content:encoded><![CDATA[<p>The original intention for this was to clean up some code which was calling a <code>Select</code> to get an Index value so that basic zebra striping of rows could be done. It return an <code>IndexedType</code> generic class of type <code>T</code> which has properties for the original object and the index value of it.</p>
<pre class="brush: csharp; title: ; notranslate">
public static IEnumerable&lt;IndexedType&lt;T&gt;&gt; Index&lt;T&gt;(this IEnumerable&lt;T&gt; source)
{
	return source.Select((x, i) =&gt; new IndexedType&lt;T&gt;() { Item = x, Index = i });
}
</pre>
<p>And the class returned:</p>
<pre class="brush: csharp; title: ; notranslate">
public class IndexedType&lt;T&gt;
{
	public T Item { get; set; }
	public int Index { get; set; }
}
</pre>
<p>This could be extended to include values like if the index value is even, N-Indexed values, etc but I leave that up to the imagination of the programmer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bolsterweb.com/2010/10/indexed-ienumerable-extension/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Getting a list of numbers between two values</title>
		<link>http://www.bolsterweb.com/2010/05/getting-a-list-of-numbers-between-two-values/</link>
		<comments>http://www.bolsterweb.com/2010/05/getting-a-list-of-numbers-between-two-values/#comments</comments>
		<pubDate>Sat, 15 May 2010 13:19:50 +0000</pubDate>
		<dc:creator>Jonathon Bolster</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[extension]]></category>

		<guid isPermaLink="false">http://www.bolsterweb.com/?p=132</guid>
		<description><![CDATA[This is yet another extension. I don&#8217;t like Enumerable.Range() for the sole reason you have to give a start index and a count. So I made up my own. This is an extension for an integer type and will allow you to specify two values that you want a range for This will also allow [...]]]></description>
			<content:encoded><![CDATA[<p>This is yet another extension.</p>
<p>I don&#8217;t like Enumerable.Range() for the sole reason you have to give a start index and a count. So I made up my own. This is an extension for an integer type and will allow you to specify two values that you want a range for</p>
<pre class="brush: csharp; title: ; notranslate">
public static IEnumerable&lt;int&gt; RangeTo(this int startValue, int endValue, int step)
{
	return (endValue &lt; startValue) ?
		Enumerable.Range(endValue, startValue - endValue + 1).Reverse() :
		Enumerable.Range(startValue, endValue - startValue + 1);
}
</pre>
<p>This will also allow for reverse lists &#8211; see how to use it below:</p>
<pre class="brush: csharp; title: ; notranslate">
1.RangeTo(10);  // {1,2,3,4,5,6,7,8,9,10}
5.RangeTo(10);  // {5,6,7,8,9,10}
10.RangeTo(5);  // {10,9,8,7,6,5}
3.RangeTo(3);   // {3}

int x = 15;
int y = 17;
x.RangeTo(10);  // {15,14,13,12,11,10}
y.RangeTo(x);  // {17,16,15}
x.RangeTo(y);  // {15,16,17}
13.RangeTo(x); // {13,14,15}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.bolsterweb.com/2010/05/getting-a-list-of-numbers-between-two-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random sort on IEnumerable object</title>
		<link>http://www.bolsterweb.com/2010/05/random-sort-on-ienumerable-object/</link>
		<comments>http://www.bolsterweb.com/2010/05/random-sort-on-ienumerable-object/#comments</comments>
		<pubDate>Sat, 15 May 2010 12:25:14 +0000</pubDate>
		<dc:creator>Jonathon Bolster</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[linq]]></category>

		<guid isPermaLink="false">http://www.bolsterweb.com/?p=93</guid>
		<description><![CDATA[Quick extension on an IEnumerable object to return the collection in a random order: For example, to return a random set of 5 items from the collection: If anyone knows of a better way, let me know]]></description>
			<content:encoded><![CDATA[<p>Quick extension on an IEnumerable object to return the collection in a random order:</p>
<pre class="brush: csharp; title: ; notranslate">
public static IEnumerable&lt;T&gt; Random&lt;T&gt;(this IEnumerable&lt;T&gt; source)
{
	return source.OrderBy(x =&gt; Guid.NewGuid());
}
</pre>
<p>For example, to return a random set of 5 items from the collection:</p>
<pre class="brush: csharp; title: ; notranslate">
var randomSet = myEnumerable.Random().Take(5);
</pre>
<p>If anyone knows of a better way, let me know <img src='http://www.bolsterweb.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bolsterweb.com/2010/05/random-sort-on-ienumerable-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Photo Rotator 0.5 now in the App Store</title>
		<link>http://www.bolsterweb.com/2009/04/photo-rotator-0-5-now-in-the-app-store/</link>
		<comments>http://www.bolsterweb.com/2009/04/photo-rotator-0-5-now-in-the-app-store/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 08:22:00 +0000</pubDate>
		<dc:creator>Jonathon Bolster</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[appstore]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[photography]]></category>
		<category><![CDATA[utilities]]></category>

		<guid isPermaLink="false">http://jobolster.wordpress.com/2009/04/24/photo-rotator-0-5-now-in-the-app-store/</guid>
		<description><![CDATA[Hurrah! My very first App Store application has been released today. That is the Photo Rotator. It&#8217;s a very small program with one purpose only, and that&#8217;s to rotate photos! Open the application, choose a picture, press a few buttons and the new photo is rotated. Why do it? Well, I received a message containing [...]]]></description>
			<content:encoded><![CDATA[<p>Hurrah!<br />
My very first App Store application has been released today. That is the<strong> Photo Rotator</strong>.</p>
<p>It&#8217;s a very small program with one purpose only, and that&#8217;s to rotate photos! Open the application, choose a picture, press a few buttons and the new photo is rotated.</p>
<p>Why do it? Well, I received a message containing a photo I wanted to set as my background. Problem was that the photo had the wrong orientation, so it would only show up sideways. I looked on the app store for similar programs and found some &#8211; but they charged for it!</p>
<p>It&#8217;s an incredibly simple program with a feature that should have been built in which is why I made one and it&#8217;s free. No charge, ever. Although, if you really like it then please feel free to donate by pressing the button at the side of this page (thank you).</p>
<p><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=312647083&amp;mt=8" onclick="pageTracker._trackPageview('/outgoing/phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=312647083_amp_mt=8&amp;referer=');">Download Photo Rotator from the App Store</a></p>
<p>If you have any questions, bugs, comments then please email ipod@bolsterweb.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bolsterweb.com/2009/04/photo-rotator-0-5-now-in-the-app-store/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RTSJ, the marble sorter and MaRTE OS</title>
		<link>http://www.bolsterweb.com/2009/02/rtsj-the-marble-sorter-and-marte-os/</link>
		<comments>http://www.bolsterweb.com/2009/02/rtsj-the-marble-sorter-and-marte-os/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 23:32:00 +0000</pubDate>
		<dc:creator>Jonathon Bolster</dc:creator>
				<category><![CDATA[University]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[jrate]]></category>
		<category><![CDATA[marteos]]></category>
		<category><![CDATA[masters project]]></category>

		<guid isPermaLink="false">http://jobolster.wordpress.com/2009/02/26/rtsj-the-marble-sorter-and-marte-os/</guid>
		<description><![CDATA[I figure that I may as well give a brief spec of my project for myself and anyone else that may care. The project I am doing is basically checking if the RTS module in the CS department should be teaching RTSJ rather than what is currently taught, Ada. This module is taught with a [...]]]></description>
			<content:encoded><![CDATA[<p>I figure that I may as well give a brief spec of my project for myself and anyone else that may care. The project I am doing is basically checking if the <a href="http://www-course.cs.york.ac.uk/rts" onclick="pageTracker._trackPageview('/outgoing/www-course.cs.york.ac.uk/rts?referer=');">RTS module</a> in the CS department should be teaching RTSJ rather than what is currently taught, Ada. This module is taught with a practical element that involves the students creating a system in Ada that runs a marble sorter which is connected to a barebones x86 machine. The Ada code is compiled and then linked with the <a href="http://marte.unican.es/" onclick="pageTracker._trackPageview('/outgoing/marte.unican.es/?referer=');">MarteOS</a> system so that the entire file is the operating system and run code in one.</p>
<p>So the project I&#8217;ve been working on is to update the <a href="http://jrate.sourceforge.net/" onclick="pageTracker._trackPageview('/outgoing/jrate.sourceforge.net/?referer=');">jRate</a> compiler with the <a href="http://www-users.cs.york.ac.uk/%7Eosantos/jrate_marteos/jrate_marteos.html" onclick="pageTracker._trackPageview('/outgoing/www-users.cs.york.ac.uk/_7Eosantos/jrate_marteos/jrate_marteos.html?referer=');">MarteOS patch</a> so that the marble sorting element of the course can be taught using RTSJ. The only thing that the patch seems to do is provide scripts for linking in MarteOS as well as providing the thread scheduler.</p>
<p>The basic elements such as handling and dealing with the interrupt model all need to be implemented, as well as accessing the device registers to be able to control the marble sorter (which is connected via a serial and parallel cable).</p>
<p>Any post about this will have the tag &#8216;masters project&#8217; added to it and, although some of this has already been done, I want to write about it for my own self and if anyone is working on a similar thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bolsterweb.com/2009/02/rtsj-the-marble-sorter-and-marte-os/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fon Bookmarklet</title>
		<link>http://www.bolsterweb.com/2008/09/fon-bookmarklet/</link>
		<comments>http://www.bolsterweb.com/2008/09/fon-bookmarklet/#comments</comments>
		<pubDate>Mon, 15 Sep 2008 21:33:00 +0000</pubDate>
		<dc:creator>Jonathon Bolster</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://jobolster.wordpress.com/2008/09/15/fon-bookmarklet/</guid>
		<description><![CDATA[I&#8217;m about to go on a short holiday around Europe. I&#8217;ve my Fon router plugged in, ready to get the benefits of free internet on my iPod Touch whilst away. Typed a quick &#8216;fon bookmarklet&#8217; search into google and only found a youtube video of some chinese person showing his working (but not actually giving [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m about to go on a short holiday around Europe. I&#8217;ve my Fon router plugged in, ready to get the benefits of free internet on my iPod Touch whilst away. Typed a quick &#8216;fon bookmarklet&#8217; search into google and only found a youtube video of some chinese person showing his working (but not actually giving the code)</p>
<p>So here&#8217;s mine. It&#8217;s simple, but it works:<br />
<code>javascript: document.getElementById('login_email').value='EMAIL_ADDRESS'; document.getElementById('login_password').value='PASSWORD'; document.getElementById('login_email').parentElement.submit()</code></p>
<p>And here&#8217;s it in link form for clicking and dragging to the bookmarks toolbar:<br />
<a href="javascript:document.getElementById('login_email').value='EMAIL_ADDRESS';document.getElementById('login_password').value='PASSWORD';document.getElementById('login_email').parentElement.submit()">Fon Login</a></p>
<p>My own link has obfuscation on the password just so that it&#8217;s not blatantly obvious in the link (maybe I&#8217;ll do some obfuscation code eventually), but changing those details would work for the &#8216;Fon Login&#8217; page that loads up when connecting to a FON_AP wifi point. It works in Safari, at least. The &#8216;parentElement&#8217; is null in Firefox but since this is for an iPod Touch, I don&#8217;t really mind. If anyone knows why it&#8217;s null then just let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bolsterweb.com/2008/09/fon-bookmarklet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

