
<?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>Steven Mark Ford&#039;s Blog</title>
	<atom:link href="http://www.stevenmarkford.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stevenmarkford.com</link>
	<description>Christianity, Programming, Health and Science - Sharing Ideas, Experiences and Solutions to a Busy World</description>
	<lastBuildDate>Sun, 20 May 2012 15:07:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>The Intended Default Emotion</title>
		<link>http://www.stevenmarkford.com/the-intended-default-emotion/</link>
		<comments>http://www.stevenmarkford.com/the-intended-default-emotion/#comments</comments>
		<pubDate>Sun, 20 May 2012 15:07:30 +0000</pubDate>
		<dc:creator>stevenmarkford</dc:creator>
				<category><![CDATA[Christianity]]></category>

		<guid isPermaLink="false">http://www.stevenmarkford.com/?p=583</guid>
		<description><![CDATA[What is your default emotion/state of mind? Maybe emptiness, sadness or even despair? Have we strayed far from the intended, default state of mind? There is a verse in the Bible which reads &#8220;Rejoice evermore.&#8221; The word &#8220;Rejoice&#8221; here is translated from the word in the original texts, &#8220;χαίρω&#8221;, pronounced &#8220;chairō&#8221;. Now this Greek word [...]]]></description>
			<content:encoded><![CDATA[<p>What is your default emotion/state of mind? Maybe emptiness, sadness or even despair? Have we strayed far from the intended, default state of mind? </p>
<p>There is a verse in the Bible which reads &#8220;Rejoice evermore.&#8221; The word &#8220;Rejoice&#8221; here is translated from the word in the original texts, &#8220;χαίρω&#8221;, pronounced &#8220;chairō&#8221;. Now this Greek word is interesting, it is the expression of an emotion of great joy, happiness and excitement. To give you a clear picture of what kind of emotion this is, imagine this: You are in a desert asleep and thirsty trying to find your way home. You have a dream of a sheep leading you to a great lake of water. When you awake there is a sheep, not far off, walking away from you. You are amazed by the sheer improbability of the situation and so decided to follow the sheep because of what happened in your dream. The sheep leads you to the top of a hill and looking down you see a lake of water as it was in your dream! It is at this point you would have felt the emotion spoken of here &#8220;rejoice&#8221;/&#8221;chairō&#8221;. It is the same emotion used to describe what the three Magian (wise men) experienced when they saw the star they had predicted would lead them to Jesus.</p>
<p>Obviously we cannot always &#8220;chairō&#8221;. Ecc 3:4  &#8220;A time to weep, and a time to laugh; a time to mourn, and a time to dance;&#8221; but it is the intended default emotion.</p>
<p>The two shortest verses in the Bible are &#8220;Rejoice evermore.&#8221; which is tie with the verse &#8220;Jesus Wept&#8221;. These verses are so different almost polar-opposite yet so highly related! You could almost join the two together into once sentence:<br />
&#8220;Jesus wept for you so rejoice evermore for Him!&#8221;. </p>
<p><strong>References</strong><br />
<a href="http://www.blueletterbible.org/lang/lexicon/lexicon.cfm?strongs=G5463">http://www.blueletterbible.org/lang/lexicon/lexicon.cfm?strongs=G5463</a><br />
<a href="http://www.blueletterbible.org/lang/lexicon/lexicon.cfm?strongs=G5463">http://www.blueletterbible.org/lang/lexicon/lexicon.cfm?strongs=G3842</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenmarkford.com/the-intended-default-emotion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculating Mean Quadratic Weighted Kappa</title>
		<link>http://www.stevenmarkford.com/calculating-mean-quadratic-weighted-kappa/</link>
		<comments>http://www.stevenmarkford.com/calculating-mean-quadratic-weighted-kappa/#comments</comments>
		<pubDate>Tue, 01 May 2012 11:10:20 +0000</pubDate>
		<dc:creator>stevenmarkford</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Science]]></category>

		<guid isPermaLink="false">http://www.stevenmarkford.com/?p=564</guid>
		<description><![CDATA[Introduction Mean quadratic weighted kappa is useful for measuring the agreement between a set of raters/scorers (e.g. judges scores) as it excludes random-agreement (an example of random agreement is if you had two raters/scores scoring something randomly they would still, over a large data set, have some sort of random agreement between each others scores). [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>Mean quadratic weighted kappa is useful for measuring the agreement between a set of raters/scorers (e.g. judges scores) as it excludes random-agreement (an example of random agreement is if you had two raters/scores scoring something randomly they would still, over a large data set, have some sort of random agreement between each others scores). The value of kappa is between -1 and 1 where -1 is complete disagreement, 0 is random agreement and 1 is complete agreement.</p>
<h2>Calculation</h2>
<h3>Definitions</h3>
<p>1. Let the possible scores/ratings range from s1 to sN e.g. s1=3, s2=4, s3=5 (there are 3 possible scores here 3,4 or 5)<br />
2. Let j1 and j2 be the set set of scores allocated by each judge/scorer e.g. j1=(3,3,5), j2=(5,5,5) (judge-1 scored 3, then 3, then 5, and, judge 2 scored all fives)</p>
<h3>Step 1 &#8211; Calculate the agreement matrix</h3>
<p>The dimensions of this matrix are equal to the number of possible ratings, where the one dimension corresponds to judge 1 and the other corresponds to judge 2. Each element in the matrix is calculated by counting the number of times  that combination of scores was given. e.g. Let A be the agreement matrix<br />
Let<br />
s1=3, s2=4, s3=5<br />
j1=(3,4,5,4), j2=(5,4,5,4)</p>
<p>Then A is calculated to be:</p>
<table>
<tr>
<td>0</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>0</td>
<td>2</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>1</td>
</tr>
</table>
<h3>Step 2 &#8211; Calculate the score histogram for each rater</h3>
<p>The score histogram is calculated for each rater. It is a vector where each component contains the number of times that judge scored the given score, that is, there is a component for each possible score.<br />
e.g.  Let H1,H2 be the score histograms for judge 1 and 2 respectively<br />
Let<br />
s1=3, s2=4, s3=5<br />
j1=(3,4,5,4), j2=(5,4,5,4)</p>
<p>Then H1 is:<br />
(1,2,1)<br />
H2 is:<br />
(0,2,2)</p>
<h3>Step 3 &#8211; Calculate Mean Quadratic Weighted Kappa</h3>
<p>For each possible score combination from each rater (e.g. (3,3),(3,4),(3,5),(4,3)&#8230;(i,j)). So if N is the number of possible scores and T is the number of scores made by each judge then we sum over each i,j combination of scores:<br />
Kappa = 1 &#8211; SUMi,j of (((i-j)^2)*A[i,j]/((N-1)^2)*T^2))/((((i-j)^2)*(H1[i]*H2[j]))/((N-1)^2)*T^2)</p>
<p>A numeric calculation of the above equation for cappa in pseudo code would be:</p>
<pre class="c-sharp" name="code">
for(int i = 0 ; i < N; i++)
{
  for(int j = 0 ; j < N; j++)
  {
    expected_count = ((H[i]*H[j]) / T);
    weight = ((i-j)^2) / ((N-1)^2);
    numerator += (weight*A[i,j]) / T;
    denominator += (weight*expected_count) / T;
  }
}
kappa = 1.0 - (numerator / denominator);
</pre>
<p>Example:</p>
<p>If two judges had to place 6 scores where the scores ranged from 4 to 6 and the scores were as follows:<br />
j1 = (4,4,5,6,5,6)<br />
j2 = (5,4,6,5,4,5)</p>
<p>Then:<br />
A = </p>
<table>
<tr>
<td>1</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>0</td>
<td>2</td>
<td>0</td>
</tr>
</table>
<p>H1 = (2,2,2)</p>
<p>H2 = (2,3,1)</p>
<p>T = 6</p>
<p>N = 3</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenmarkford.com/calculating-mean-quadratic-weighted-kappa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random Bible Verse &#8211; Online Tool Version 2</title>
		<link>http://www.stevenmarkford.com/random-bible-verse-version-2/</link>
		<comments>http://www.stevenmarkford.com/random-bible-verse-version-2/#comments</comments>
		<pubDate>Sun, 15 Apr 2012 10:17:06 +0000</pubDate>
		<dc:creator>stevenmarkford</dc:creator>
				<category><![CDATA[Christianity]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.stevenmarkford.com/?p=557</guid>
		<description><![CDATA[var books=['Genesis','Exodus','Leviticus','Numbers','Deuteronomy','Joshua','Judges','Ruth','1 Samuel','2 Samuel','1 Kings','2 Kings','1 Chronicles','2 Chronicles','Ezra','Nehemiah','Esther','Job','Psalms','Proverbs','Ecclesiastes','Song of Solomon','Isaiah','Jeremiah','Lamentations','Ezekiel','Daniel','Hosea','Joel','Amos','Obadiah','Jonah','Micah','Nahum','Habakkuk','Zephaniah','Haggai','Zechariah','Malachi','Matthew','Mark','Luke','John','Acts','Romans','1 Corinthians','2 Corinthians','Galatians','Ephesians','Philippians','Colossians','1 Thessalonians','2 Thessalonians','1 Timothy','2 Timothy','Titus','Philemon','Hebrews','James','1 Peter','2 Peter','1 John','2 John','3 John','Jude','Revelation']; var chapters = {Genesis: 50, Exodus: 40, Leviticus: 27, Numbers: 36,Deuteronomy: 34,Joshua: 24,Judges: 21,Ruth: 4,"1 Samuel": 31,"2 Samuel": 24,"1 Kings": 22,"2 Kings": 25,"1 Chronicles": 29,"2 Chronicles": 36,Ezra: 10,Nehemiah: 13,Esther: 10,Job: 42,Psalms: 150,Proverbs: 31,Ecclesiastes: 12,"Song [...]]]></description>
			<content:encoded><![CDATA[<link href='http://fonts.googleapis.com/css?family=Enriqueta' rel='stylesheet' type='text/css'>
<script type="text/javascript">
var books=['Genesis','Exodus','Leviticus','Numbers','Deuteronomy','Joshua','Judges','Ruth','1 Samuel','2 Samuel','1 Kings','2 Kings','1 Chronicles','2 Chronicles','Ezra','Nehemiah','Esther','Job','Psalms','Proverbs','Ecclesiastes','Song of Solomon','Isaiah','Jeremiah','Lamentations','Ezekiel','Daniel','Hosea','Joel','Amos','Obadiah','Jonah','Micah','Nahum','Habakkuk','Zephaniah','Haggai','Zechariah','Malachi','Matthew','Mark','Luke','John','Acts','Romans','1 Corinthians','2 Corinthians','Galatians','Ephesians','Philippians','Colossians','1 Thessalonians','2 Thessalonians','1 Timothy','2 Timothy','Titus','Philemon','Hebrews','James','1 Peter','2 Peter','1 John','2 John','3 John','Jude','Revelation'];
var chapters = {Genesis: 50, Exodus: 40, Leviticus: 27, Numbers: 36,Deuteronomy: 34,Joshua: 24,Judges: 21,Ruth: 4,"1 Samuel": 31,"2 Samuel": 24,"1 Kings": 22,"2 Kings": 25,"1 Chronicles": 29,"2 Chronicles": 36,Ezra: 10,Nehemiah: 13,Esther: 10,Job: 42,Psalms: 150,Proverbs: 31,Ecclesiastes: 12,"Song of Solomon": 8,Isaiah: 66,Jeremiah: 52,Lamentations: 5,Ezekiel: 48,Daniel: 12,Hosea: 14,Joel: 3,Amos: 9,Obadiah: 1,"Jonah": 4,Micah: 7,Nahum: 3,Habakkuk: 3,Zephaniah: 3,Haggai: 2,Zechariah: 14,Malachi: 4,Matthew: 28,Mark: 16,Luke: 24,John: 21,Acts: 28,Romans: 16,"1 Corinthians": 16,"2 Corinthians": 13,Galatians: 6,Ephesians: 6,Philippians: 4,Colossians: 4,"1 Thessalonians": 5,"2 Thessalonians": 3,"1 Timothy": 6,"2 Timothy": 4,Titus: 3,Philemon: 1,Hebrews: 13,James: 5,"1 Peter": 5,"2 Peter": 3,"1 John": 5,"2 John": 1,"3 John": 1,Jude: 1, Revelation: 22};
var verses = {'Genesis':[31,25,24,26,32,22,24,22,29,32,32,20,18,24,21,16,27,33,38,18,34,24,20,67,34,35,46,22,35,43,54,33,20,31,29,43,36,30,23,23,57,38,34,34,28,34,31,22,33,26],'Exodus':[22,25,22,31,23,30,29,28,35,29,10,51,22,31,27,36,16,27,25,26,37,30,33,18,40,37,21,43,46,38,18,35,23,35,35,38,29,31,43,38],'Leviticus':[17,16,17,35,26,23,38,36,24,20,47,8,59,57,33,34,16,30,37,27,24,33,44,23,55,46,34],'Numbers':[54,34,51,49,31,27,89,26,23,36,35,16,33,45,41,35,28,32,22,29,35,41,30,25,19,65,23,31,39,17,54,42,56,29,34,13],'Deuteronomy':[46,37,29,49,33,25,26,20,29,22,32,31,19,29,23,22,20,22,21,20,23,29,26,22,19,19,26,69,28,20,30,52,29,12],'Joshua':[18,24,17,24,15,27,26,35,27,43,23,24,33,15,63,10,18,28,51,9,45,34,16,33],'Judges':[36,23,31,24,31,40,25,35,57,18,40,15,25,20,20,31,13,31,30,48,25],'Ruth':[22,23,18,22],'1 Samuel':[28,36,21,22,12,21,17,22,27,27,15,25,23,52,35,23,58,30,24,42,16,23,28,23,43,25,12,25,11,31,13],'2 Samuel':[27,32,39,12,25,23,29,18,13,19,27,31,39,33,37,23,29,32,44,26,22,51,39,25],'1 Kings':[53,46,28,20,32,38,51,66,28,29,43,33,34,31,34,34,24,46,21,43,29,54],'2 Kings':[18,25,27,44,27,33,20,29,37,36,20,22,25,29,38,20,41,37,37,21,26,20,37,20,30],'1 Chronicles':[54,55,24,43,41,66,40,40,44,14,47,41,14,17,29,43,27,17,19,8,30,19,32,31,31,32,34,21,30],'2 Chronicles':[18,17,17,22,14,42,22,18,31,19,23,16,23,14,19,14,19,34,11,37,20,12,21,27,28,23,9,27,36,27,21,33,25,33,26,23],'Ezra':[11,70,13,24,17,22,28,36,15,44],'Nehemiah':[11,20,38,17,19,19,72,18,37,40,36,47,31],'Esther':[22,23,15,17,14,14,10,17,32,3,17,8,30,16,24,10],'Job':[22,13,26,21,27,30,21,22,35,22,20,25,28,22,35,22,16,21,29,29,34,30,17,25,6,14,21,28,25,31,40,22,33,37,16,33,24,41,30,32,26,17],'Psalms':[6,11,9,9,13,11,18,10,21,18,7,9,6,7,5,11,15,51,15,10,14,32,6,10,22,11,14,9,11,13,25,11,22,23,28,13,40,23,14,18,14,12,5,27,18,12,10,15,21,23,21,11,7,9,24,14,12,12,18,14,9,13,12,11,14,20,8,36,37,6,24,20,28,23,11,13,21,72,13,20,17,8,19,13,14,17,7,19,53,17,16,16,5,23,11,13,12,9,9,5,8,29,22,35,45,48,43,14,31,7,10,10,9,8,18,19,2,29,176,7,8,9,4,8,5,6,5,6,8,8,3,18,3,3,21,26,9,8,24,14,10,8,12,15,21,10,20,14,9,6],'Proverbs':[33,22,35,27,23,35,27,36,18,32,31,28,25,35,33,33,28,24,29,30,31,29,35,34,28,28,27,28,27,33,31],'Ecclesiastes':[18,26,22,17,19,12,29,17,18,20,10,14],'Song of Solomon':[17,17,11,16,16,12,14,14],'Isaiah':[31,22,26,6,30,13,25,23,20,34,16,6,22,32,9,14,14,7,25,6,17,25,18,23,12,21,13,29,24,33,9,20,24,17,10,22,38,22,8,31,29,25,28,28,25,13,15,22,26,11,23,15,12,17,13,12,21,14,21,22,11,12,19,11,25,24],'Jeremiah':[19,37,25,31,31,30,34,23,25,25,23,17,27,22,21,21,27,23,15,18,14,30,40,10,38,24,22,17,32,24,40,44,26,22,19,32,21,28,18,16,18,22,13,30,5,28,7,47,39,46,64,34],'Lamentations':[22,22,66,22,22],'Ezekiel':[28,10,27,17,17,14,27,18,11,22,25,28,23,23,8,63,24,32,14,44,37,31,49,27,17,21,36,26,21,26,18,32,33,31,15,38,28,23,29,49,26,20,27,31,25,24,23,35],'Daniel':[21,49,100,34,30,29,28,27,27,21,45,13,64,42],'Hosea':[9,25,5,19,15,11,16,14,17,15,11,15,15,10],'Joel':[20,27,5,21],'Amos':[15,16,15,13,27,14,17,14,15],'Obadiah':[21],'Jonah':[16,11,10,11],'Micah':[16,13,12,14,14,16,20],'Nahum':[14,14,19],'Habakkuk':[17,20,19],'Zephaniah':[18,15,20],'Haggai':[15,23],'Zechariah':[17,17,10,14,11,15,14,23,17,12,17,14,9,21],'Malachi':[14,17,24],'Matthew':[25,23,17,25,48,34,29,34,38,42,30,50,58,36,39,28,27,35,30,34,46,46,39,51,46,75,66,20],'Mark':[45,28,35,41,43,56,37,38,50,52,33,44,37,72,47,20],'Luke':[80,52,38,44,39,49,50,56,62,42,54,59,35,35,32,31,37,43,48,47,38,71,56,53],'John':[51,25,36,54,47,71,53,59,41,42,57,50,38,31,27,33,26,40,42,31,25],'Acts':[26,47,26,37,42,15,60,40,43,48,30,25,52,28,41,40,34,28,40,38,40,30,35,27,27,32,44,31],'Romans':[32,29,31,25,21,23,25,39,33,21,36,21,14,23,33,27],'1 Corinthians':[31,16,23,21,13,20,40,13,27,33,34,31,13,40,58,24],'2 Corinthians':[24,17,18,18,21,18,16,24,15,18,33,21,13],'Galatians':[24,21,29,31,26,18],'Ephesians':[23,22,21,32,33,24],'Philippians':[30,30,21,23],'Colossians':[29,23,25,18],'1 Thessalonians':[10,20,13,18,28],'2 Thessalonians':[12,17,18],'1 Timothy':[20,15,16,16,25,21],'2 Timothy':[18,26,17,22],'Titus':[16,15,15],'Philemon':[25],'Hebrews':[14,18,19,16,14,20,28,13,28,39,40,29,25],'James':[27,26,18,17,20],'1 Peter':[25,25,22,19,14],'2 Peter':[21,22,18],'1 John':[10,29,24,21,21],'2 John':[13],'3 John':[15],'Jude':[25],'Revelation':[20,29,22,11,14,17,17,13,21,11,19,17,18,20,8,21,18,24,21,15,27,21]};
<!--
var book;
var numChapterForSelectedBook;
var chapter;
var numVersesForSelectedBookChapter;
var verse;
function GRBV(){
jQuery('#bibleVerseContainerAfter').hide();
jQuery('#bibleVerseContainerPrev').hide();
jQuery('#bvo').hide();
jQuery('#bibleVerseContainer').hide();
var s = document.getElementById('randomVerseContainer');
var po = document.createElement('iframe');
book = books[Math.floor(Math.random()*books.length)];
numChapterForSelectedBook = chapters[book];
chapter = Math.floor(Math.random()*numChapterForSelectedBook) + 1;
numVersesForSelectedBookChapter = verses[book][chapter - 1];
verse = Math.floor(Math.random()*numVersesForSelectedBookChapter) + 1;
LOAD_VERSE(book,chapter,verse,'#bibleVerseContainer','#rbv-ajax-loader',true);
};
function LOAD_VERSE(bookSelected,chapterSelected,verseSelected,destContainer,ajaxLoader,hideOptions)
{
jQuery(ajaxLoader).show();
var passageValue = bookSelected + ' ' + chapterSelected+ ':' + verseSelected;
var baseURL = 'http://labs.bible.org/api/';
var finalPassageURL = baseURL + '?passage=' + passageValue + '&#038;type=json&#038;callback=?';
jQuery.getJSON(baseURL + '?callback=?',{passage:passageValue, type:"json"},function(dataArray)
{
var data = dataArray[0];
var response = '<b>' + data.bookname + ' ' + data.chapter + ':' + data.verse + '</b>    ' + data.text.replace(/<a.*a>/,' ');
jQuery(destContainer).html(response);
jQuery(ajaxLoader).hide();
jQuery(destContainer).show();
if(hideOptions){jQuery('#bvo').show();}
});
}
function GRBV_CONTEXT(){
var previousVerse = verse -1;
var nextVerse = verse + 1;
if(previousVerse  > 0)
{
   LOAD_VERSE(book,chapter,previousVerse,'#bibleVerseContainerPrev','#rbv-ajax-loader');
}
if(nextVerse <= numVersesForSelectedBookChapter)
{
  LOAD_VERSE(book,chapter,nextVerse,'#bibleVerseContainerAfter','#rbv-ajax-loader-after');
}
jQuery('#bvo').hide();
}
//-->
</script></p>
<p>Sometimes there is nothing better than reading a random Bible verse. It was King David who once said &#8220;We may throw the dice, but the LORD determines how they fall.&#8221; &#8211; Proverbs 16:33. </p>
<p>
So, I decided to post this little random Bible verse utility:
</p>
<p>Click here to get a new random verse: <a href="javascript:void(0);" onclick="GRBV();"> Get Random Verse</a></p>
<div style="min-height:125px;color:#323232;font-family: 'Enriqueta', serif;font-size:14px;vertical-align:middle;">
<div id="bibleVerseContainerPrev" style="vertical-align:middle;display:none;"></div>
<p><img id="rbv-ajax-loader" src="http://dl.dropbox.com/u/14932149/StevenMarkFord.com/Pics/ajax-loader.gif" alt="Loading" style="display:none;padding-left:215px;" /></p>
<div id="bibleVerseContainer" style="vertical-align:middle;display:none;"></div>
<p><img id="rbv-ajax-loader-after" src="http://dl.dropbox.com/u/14932149/StevenMarkFord.com/Pics/ajax-loader.gif" alt="Loading" style="display:none;padding-left:215px;" /></p>
<div id="bibleVerseContainerAfter" style="vertical-align:middle;display:none;"></div>
<p><span id="bvo" style="display:none;"><br />
Verse Options: <a href="javascript:void(0);" onclick="GRBV_CONTEXT();">Get Surrounding Verses</a><br />
</span>
</div>
<p>I achieved this with the <a href="http://labs.bible.org">http://labs.bible.org</a> API. In Revision 2 here I used jQuery.getJSON, also added spinners and ability to load surrounding verses.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenmarkford.com/random-bible-verse-version-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android &#8211; Activity has leaked ServiceConnection that was originally bound here</title>
		<link>http://www.stevenmarkford.com/android-activity-has-leaked-serviceconnection-that-was-originally-bound-here/</link>
		<comments>http://www.stevenmarkford.com/android-activity-has-leaked-serviceconnection-that-was-originally-bound-here/#comments</comments>
		<pubDate>Sat, 14 Apr 2012 22:16:31 +0000</pubDate>
		<dc:creator>stevenmarkford</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.stevenmarkford.com/?p=554</guid>
		<description><![CDATA[Problem Android activity gives the error &#8220;Activity has leaked ServiceConnection that was originally bound here&#8221; when exiting. Cause When working with a bound service one sets up a connection to the service from the client activity by binding the ServiceConnection class by calling &#8220;bindService(intent, mConnection, Context.BIND_AUTO_CREATE);&#8221; when the service starts. The error is caused when [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
Android activity gives the error &#8220;Activity has leaked ServiceConnection that was originally bound here&#8221; when exiting.</p>
<p><strong>Cause</strong><br />
When working with a bound service one sets up a connection to the service from the client activity by binding the ServiceConnection class by calling<br />
&#8220;bindService(intent, mConnection, Context.BIND_AUTO_CREATE);&#8221; when the service starts. The error is caused when this Service Connection is not UnBound when the activity ends</p>
<p><strong>Solution</strong><br />
Either in OnStop or OnDestroy depending on whether or not you used OnStart or OnCreate respectively unbind the ServiceConnection by calling:<br />
unbindService(mConnection);</p>
<p><strong>References</strong><br />
<a href="http://developer.android.com/guide/topics/fundamentals/bound-services.html">http://developer.android.com/guide/topics/fundamentals/bound-services.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenmarkford.com/android-activity-has-leaked-serviceconnection-that-was-originally-bound-here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android &#8211; Failed to install .apk on device : timeout Eclipse Error</title>
		<link>http://www.stevenmarkford.com/android-failed-to-install-apk-on-device-timeout-eclipse-error/</link>
		<comments>http://www.stevenmarkford.com/android-failed-to-install-apk-on-device-timeout-eclipse-error/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 20:52:29 +0000</pubDate>
		<dc:creator>stevenmarkford</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Problem-Cause-Solution]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.stevenmarkford.com/?p=549</guid>
		<description><![CDATA[Problem Eclipse console shows the error &#8220;Failed to install *.apk on device &#8216;*&#8217;: timeout&#8221; Cause The time taken to install the apk via the adb tool exceeded the adb default connection timeout value. If this only happens on occasion this may be because your processor is currently being heavily used by another process (check task [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
Eclipse console shows the error &#8220;Failed to install *.apk on device &#8216;*&#8217;: timeout&#8221;</p>
<p><strong>Cause</strong><br />
The time taken to install the apk via the adb tool exceeded the adb default connection timeout value. If this only happens on occasion this may be because your processor is currently being heavily used by another process (check task manager/proc list).</p>
<p><strong>Solution</strong><br />
Either:<br />
1. reduce your processor&#8217;s usage and re-try<br />
2. increase the connection timeout value in eclipse windows->preferences->android->ddms see &#8220;ADB connection time out (ms)&#8221; this is in milliseconds as per description so maybe try increasing it to 1 minute i.e. 60000</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenmarkford.com/android-failed-to-install-apk-on-device-timeout-eclipse-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gnuplot Command Line Shell Example</title>
		<link>http://www.stevenmarkford.com/gnuplot-command-line-shell-example/</link>
		<comments>http://www.stevenmarkford.com/gnuplot-command-line-shell-example/#comments</comments>
		<pubDate>Sat, 24 Mar 2012 21:05:54 +0000</pubDate>
		<dc:creator>stevenmarkford</dc:creator>
				<category><![CDATA[Science]]></category>

		<guid isPermaLink="false">http://www.stevenmarkford.com/?p=540</guid>
		<description><![CDATA[Just a quick example of how to plot from cmd/shell using Gnuplot (my favourite plotting tool): gnuplot -p -e "plot 'test.txt'" -p to keep the gnuplot window open once the command has run -e to specify that a gnuplot command follows (in the example above we plotting a data file test.txt&#8221;) References: You can download [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick example of how to plot from cmd/shell using Gnuplot (my favourite plotting tool):</p>
<pre name="code" class="c-sharp">
gnuplot -p -e "plot 'test.txt'"
</pre>
<ul>
<li>-p to keep the gnuplot window open once the command has run</li>
<li>-e to specify that a gnuplot command follows (in the example above we plotting a data file test.txt&#8221;)</li>
</ul>
<p><strong>References:</strong><br />
You can download gnuplot for free from here:<a href="http://www.gnuplot.info/">http://www.gnuplot.info/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenmarkford.com/gnuplot-command-line-shell-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android &#8211; sharing debug.keystore in Eclipse</title>
		<link>http://www.stevenmarkford.com/android-sharing-debug-keystore-eclipse/</link>
		<comments>http://www.stevenmarkford.com/android-sharing-debug-keystore-eclipse/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 11:25:09 +0000</pubDate>
		<dc:creator>stevenmarkford</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.stevenmarkford.com/?p=534</guid>
		<description><![CDATA[If you find you frequently debugging an Android application on multiple computers then it can save time to share a single debug.keystore across those computers. If you don&#8217;t have a shared a debug.keystore you will get the error eclipse console error &#8220;Re-installation failed due to different application signatures.&#8221; (for more details see my post http://www.stevenmarkford.com/solution-to-reinstallation-failed-due-to-different-application-signatures-when-debugging-in-eclipse/) [...]]]></description>
			<content:encoded><![CDATA[<p>If you find you frequently debugging an Android application on multiple computers then it can save time to share a single debug.keystore across those computers.</p>
<p>If you don&#8217;t have a shared a debug.keystore you will get the error eclipse console error &#8220;Re-installation failed due to different application signatures.&#8221; (for more details see my post <a href="http://www.stevenmarkford.com/solution-to-reinstallation-failed-due-to-different-application-signatures-when-debugging-in-eclipse/">http://www.stevenmarkford.com/solution-to-reinstallation-failed-due-to-different-application-signatures-when-debugging-in-eclipse/</a>)</p>
<p><strong>Solution</strong><br />
Copy the default debug.keystore from the one machine to the other machine/s into a known location.<br />
To get the location of the default debug.keystore:<br />
1. Open Eclipse click window->preferences<br />
2. Go to android->build the location in the &#8220;Default debug keystore textbox&#8221; (see image below)<br />
(Tip: I share a single instance of debug.keystore via dropbox see <a href="https://www.dropbox.com/">https://www.dropbox.com/</a>)<br />
3. Once you have shared/copied the debug.keystore onto the various computers update the eclipse setting &#8220;Custom debug keystore&#8221; to point to this debug.keystore  (see image below)</p>
<p><img src="http://dl.dropbox.com/u/14932149/StevenMarkFord.com/Pics/android-sharing-debug-keystore-eclipse-01.png" alt="android-sharing-debug-keystore-eclipse-01" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenmarkford.com/android-sharing-debug-keystore-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Refresh Eclipse Intellisense</title>
		<link>http://www.stevenmarkford.com/refresh-eclipse-intellisense/</link>
		<comments>http://www.stevenmarkford.com/refresh-eclipse-intellisense/#comments</comments>
		<pubDate>Thu, 15 Mar 2012 11:44:06 +0000</pubDate>
		<dc:creator>stevenmarkford</dc:creator>
				<category><![CDATA[Christianity]]></category>

		<guid isPermaLink="false">http://www.stevenmarkford.com/?p=531</guid>
		<description><![CDATA[Say for example you update some code in a referenced project the intellisense will not automatically update for that project. To manually refresh the intellisense: 1. Click Project->Clean&#8230; 2. Select the project you wish to refresh the intellisense for and click &#8220;ok&#8221;]]></description>
			<content:encoded><![CDATA[<p>Say for example you update some code in a referenced project the intellisense will not automatically update for that project. </p>
<p>To manually refresh the intellisense:<br />
1. Click Project->Clean&#8230;<br />
2. Select the project you wish to refresh the intellisense for and click &#8220;ok&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenmarkford.com/refresh-eclipse-intellisense/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android &#8211; Sharing Java Project Code Package in Eclipse</title>
		<link>http://www.stevenmarkford.com/android-sharing-java-project-code-package-in-eclipse/</link>
		<comments>http://www.stevenmarkford.com/android-sharing-java-project-code-package-in-eclipse/#comments</comments>
		<pubDate>Tue, 13 Mar 2012 21:42:47 +0000</pubDate>
		<dc:creator>stevenmarkford</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.stevenmarkford.com/?p=527</guid>
		<description><![CDATA[This example demonstrates how to share a project&#8217;s code across multiple Android projects (that is how to share a libraries code). Step 1: Mark the shared project as a library 1. In the Eclipse Project Explorer, right click on the project you wish to share. 2. Click on Properties 3. In the Android section tick [...]]]></description>
			<content:encoded><![CDATA[<p>This example demonstrates how to share a project&#8217;s code across multiple Android projects (that is how to share a libraries code).</p>
<p><strong>Step 1: Mark the shared project as a library</strong><br />
1. In the Eclipse Project Explorer, right click on the project you wish to share.<br />
2. Click on Properties<br />
3. In the Android section tick &#8220;IsLibrary&#8221; see pic below:<br />
<img src="http://dl.dropbox.com/u/14932149/StevenMarkFord.com/Pics/android_sharing_prj_in_eclipse_01.png" alt="android_sharing_prj_in_eclipse_01" /><br />
4. Click Apply then Ok.</p>
<p><strong>Step 2: Reference the library project in another project</strong><br />
1. In the Eclipse Project Explorer, right click on the project you wish to share.<br />
2. Click on Properties<br />
3. In the Android section under &#8220;Library&#8221; click &#8220;Add&#8221; and select the Project that was marked as a library from step 1 and click ok.  see pic below:<br />
<img src="http://dl.dropbox.com/u/14932149/StevenMarkFord.com/Pics/android_sharing_prj_in_eclipse_02.png" alt="android_sharing_prj_in_eclipse_02" /><br />
4. Click Apply then Ok.</p>
<p>The project now has access to the classes from the library project.</p>
<p>This is the preferred way to reference shared code in Android.<br />
<strong>References</strong><br />
<a href="http://developer.android.com/guide/developing/projects/index.html">http://developer.android.com/guide/developing/projects/index.html</a><br />
<a href="http://developer.android.com/guide/developing/projects/projects-eclipse.html">http://developer.android.com/guide/developing/projects/projects-eclipse.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenmarkford.com/android-sharing-java-project-code-package-in-eclipse/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Android &#8211; HTML Webview Button Call Java Activity Method</title>
		<link>http://www.stevenmarkford.com/android-html-webview-button-call-java-activity-method/</link>
		<comments>http://www.stevenmarkford.com/android-html-webview-button-call-java-activity-method/#comments</comments>
		<pubDate>Mon, 12 Mar 2012 19:52:18 +0000</pubDate>
		<dc:creator>stevenmarkford</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.stevenmarkford.com/?p=510</guid>
		<description><![CDATA[To call a method which is in your activity from a standard HTML button is actually very easy. Assuming you have the following html file in your project assets\web\index.html: &#60;html&#62; &#60;head&#62; &#60;script type="text/javascript"&#62; function ClientSideMethod(message){ var x=document.getElementById("te");    x.innerHTML = message; } &#60;/script&#62; &#60;/head&#62; &#60;body&#62; &#60;div id="te"&#62;&#60;/div&#62; &#60;button onClick="ClientSideMethod('client side method called')"&#62; Call Javascript Method [...]]]></description>
			<content:encoded><![CDATA[<p>To call a method which is in your activity from a standard HTML button is actually very easy. </p>
<p>Assuming you have the following html file in your project assets\web\index.html:</p>
<pre class="xml" name="code">
&lt;html&gt;
&lt;head&gt;
	&lt;script type="text/javascript"&gt;
		function ClientSideMethod(message){
			var x=document.getElementById("te");
  				x.innerHTML = message;
		}
	&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;div id="te"&gt;&lt;/div&gt;
	&lt;button onClick="ClientSideMethod('client side method called')"&gt; Call Javascript Method &lt;/button&gt;
	&lt;button onClick="activity.TestMethod();"&gt;Call Java Activity Method&lt;/button&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>And your activity needs to be implemented as follows:</p>
<pre class="c-sharp" name="code">
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;

public class WebViewActivity extends Activity {

	private WebView webView;

        // the method to call from the html button click
	public void TestMethod()
	{
          webView.loadUrl("javascript:ClientSideMethod('activity method called');");
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);

	    this.webView = new WebView(this);

            // requires javascript
	    this.webView.getSettings().setJavaScriptEnabled(true); 

             // set the html view to load
	    this.webView.loadUrl("file:///android_asset/web/index.html"); 

             // make this activity accessible to javascript
	    this.webView.addJavascriptInterface(this, "activity");

	    setContentView(this.webView);
	}
}
</pre>
<p><strong>References:</strong><br />
<a href="http://developer.android.com/reference/android/webkit/WebView.html">http://developer.android.com/reference/android/webkit/WebView.html</a><br />
<a href="http://mobile.tutsplus.com/tutorials/mobile-web-apps/build-a-contacts-application-with-jquery-mobile-the-android-sdk-part-1/">http://mobile.tutsplus.com/tutorials/mobile-web-apps/build-a-contacts-application-with-jquery-mobile-the-android-sdk-part-1/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenmarkford.com/android-html-webview-button-call-java-activity-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

