<?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>Tyler Clemons &#187; Programming</title>
	<atom:link href="http://www.tylerclemons.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tylerclemons.com</link>
	<description>tylerclemons.com</description>
	<lastBuildDate>Wed, 26 May 2010 18:39:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Weka, Ruby, Association Mining</title>
		<link>http://www.tylerclemons.com/weka-ruby-association-mining/</link>
		<comments>http://www.tylerclemons.com/weka-ruby-association-mining/#comments</comments>
		<pubDate>Sat, 15 May 2010 21:09:17 +0000</pubDate>
		<dc:creator>Tyler</dc:creator>
				<category><![CDATA[Data Mining]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Weka]]></category>
		<category><![CDATA[Association Mining]]></category>
		<category><![CDATA[rjb]]></category>

		<guid isPermaLink="false">http://www.tylerclemons.com/?p=282</guid>
		<description><![CDATA[Weka is a collection of machine learning tools used for data mining.  Weka is written in Java however it is possible to use Weka&#8217;s libraries inside Ruby.  To do this, we must install the Java, Rjb, and of course obtain the Weka source code.  In this example, I look at Associating Mining.

Refer to my previous [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Weka" href="http://www.cs.waikato.ac.nz/ml/weka/" target="_blank">Weka</a> is a collection of machine learning tools used for data mining.  Weka is written in Java however it is possible to use Weka&#8217;s libraries inside Ruby.  To do this, we must install the Java, Rjb, and of course obtain the Weka source code.  In this example, I look at Associating Mining.</p>
<p><span id="more-282"></span></p>
<p><img title="More..." src="http://tylershome.nfshost.com/home/public/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /><a title="Kmeans and setup" href="http://www.tylerclemons.com/weka-and-ruby/">Refer to my previous example for setup instructions.</a></p>
<p><img title="More..." src="http://tylershome.nfshost.com/home/public/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /><strong>Running Weka</strong></p>
<p>The following is an example of a frequent itemset finder.</p>
<div id="codebox" style="overflow: auto; "><code><br />
require <span style="color: #ffcc00;">'rjb'</span></code></p>
<div style="overflow: auto; "><code><span style="color: #ffcc00;"> </span></code><span style="color: #ff0000;">#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span><br />
<span style="color: #800080;">def </span>asscm()</div>
<p style="padding-left: 30px;"><span style="color: #ff0000;">#Load Java Jar</span><br />
dir =<span style="color: #ffcc00;"> &#8220;./weka.jar&#8221;</span><br />
<span style="color: #ff0000;">#Have Rjb load the jar file, and pass Java command line arguments</span><br />
<span style="color: #008000;">Rjb</span>::load(dir, jvmargs=[<span style="color: #ffcc00;">"-Xmx1000M"</span>])</p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">#make k-means classifier</span><br />
obj = <span style="color: #008000;">Rjb</span>::import(<span style="color: #ffcc00;">&#8220;weka.associations.Apriori&#8221;</span>)<br />
assc= obj.new</p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">#load the data</span> <span style="color: #ff0000;">using Ja<span style="color: #ff0000;">va</span></span><span style="color: #ff0000;"> and Weka</span><br />
weather_src = Rjb::import(<span style="color: #ffcc00;">&#8220;java.io.FileReader&#8221;</span>).new(<span style="color: #ffcc00;">&#8220;weather.nominal.arff&#8221;</span>)<br />
weather_data = Rjb::import(<span style="color: #ffcc00;">&#8220;weka.core.Instances&#8221;</span>).new(weather_src)</p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">#Find the frequent itemsets</span><br />
assc.setCar(true) <span style="color: #ff0000;">#mines for class association</span><br />
assc.setLowerBoundMinSupport(0.25) <span style="color: #ff0000;">#set minimum support</span><br />
assc.buildAssociations(weather_data)<br />
puts assc.toString</p>
<p><span style="color: #800080;">end</span></p>
<p><span style="color: #ff0000;">#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span><br />
asscm()</div>
<p>We first tell Rjb to load the specified classpath, for us it&#8217;s our Jar file.  I passed command line arguments that specify the amount of RAM to use.</p>
<p>Rjb::import loads specific classes.  These are relative to our classpath.</p>
<p>I call the constructor for the new classes by using the .new method from Ruby.  Afterward, I can use the new object like any other Ruby object.  The method names are as they are found in their Java source files.  For an explanation of data type conversions, <a title="Rjb explanation" href="http://rjb.rubyforge.org/">click here.</a></p>
<p>The dataset I used is different from the previous because we can&#8217;t use numerical values.  The dataset is found inside the data folder downloaded with weka.jar.</p>
<p>As I said before, this can be done in JRuby.  A great example can be found at this <a title="JRuby Example" href="http://rubyforscientificresearch.blogspot.com/2009/08/accessing-weka-from-jruby.html" target="_blank">great blog post</a>, which inspired my post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tylerclemons.com/weka-ruby-association-mining/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weka, Ruby, Decision Trees</title>
		<link>http://www.tylerclemons.com/weka-ruby-decision-trees/</link>
		<comments>http://www.tylerclemons.com/weka-ruby-decision-trees/#comments</comments>
		<pubDate>Sat, 15 May 2010 20:40:26 +0000</pubDate>
		<dc:creator>Tyler</dc:creator>
				<category><![CDATA[Data Mining]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Weka]]></category>
		<category><![CDATA[Decision Trees]]></category>
		<category><![CDATA[rjb]]></category>

		<guid isPermaLink="false">http://www.tylerclemons.com/?p=276</guid>
		<description><![CDATA[Weka is a collection of machine learning tools used for data mining.  Weka is written in Java however it is possible to use Weka&#8217;s libraries inside Ruby.  To do this, we must install the Java, Rjb, and of course obtain the Weka source code.  In this example, I look at Decision Trees.
Refer to my previous [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Weka" href="http://www.cs.waikato.ac.nz/ml/weka/" target="_blank">Weka</a> is a collection of machine learning tools used for data mining.  Weka is written in Java however it is possible to use Weka&#8217;s libraries inside Ruby.  To do this, we must install the Java, Rjb, and of course obtain the Weka source code.  In this example, I look at Decision Trees.</p>
<p><span id="more-276"></span><a title="Kmeans and setup" href="http://www.tylerclemons.com/weka-and-ruby/">Refer to my previous example for setup instructions.</a></p>
<p><img title="More..." src="http://tylershome.nfshost.com/home/public/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /><strong>Running Weka</strong></p>
<p>The following is an example of running a Decision Tree.</p>
<div id="codebox" style="overflow: auto; "><code><br />
require <span style="color: #ffcc00;">'rjb'</span></code></p>
<div style="overflow: auto; "><code><span style="color: #ffcc00;"> </span></code><span style="color: #ff0000;">#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span><br />
<span style="color: #800080;">def </span>dtree()</div>
<p style="padding-left: 30px;"><span style="color: #ff0000;">#Load Java Jar</span><br />
dir =<span style="color: #ffcc00;"> &#8220;./weka.jar&#8221;</span><br />
<span style="color: #ff0000;">#Have Rjb load the jar file, and pass Java command line arguments</span><br />
<span style="color: #008000;">Rjb</span>::load(dir, jvmargs=[<span style="color: #ffcc00;">"-Xmx1000M"</span>])</p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">#make k-means classifier</span><br />
obj = <span style="color: #008000;">Rjb</span>::import(<span style="color: #ffcc00;">&#8220;weka.classifiers.trees.J48&#8243;</span>)<br />
dtree = obj.new</p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">#load the data</span> <span style="color: #ff0000;">using Ja<span style="color: #ff0000;">va</span></span><span style="color: #ff0000;"> and Weka</span><br />
labor_src = Rjb::import(<span style="color: #ffcc00;">&#8220;java.io.FileReader&#8221;</span>).new(<span style="color: #ffcc00;">&#8220;labor.arff&#8221;</span>)<br />
labor_data = Rjb::import(<span style="color: #ffcc00;">&#8220;weka.core.Instances&#8221;</span>).new(labor_src)</p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">#set the class attribute, here it&#8217;s the last value, and then build the classifier</span><br />
labor_data.setClassIndex(labor_data.numAttributes() &#8211; 1)<br />
dtree.buildClassifier(labor_data)<br />
puts dtree.toString</p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">#examine the particular datapoints</span><br />
points = labor_data.numInstances<br />
points.times {|instance|</p>
<p style="padding-left: 60px;">theclass = dtree.classifyInstance(labor_data.instance(instance))<br />
point = labor_data.instance(instance).toString<br />
puts <span style="color: #ff6600;">&#8220;#{point} \t #{theclass}&#8221;</span></p>
<p style="padding-left: 30px;">}</p>
<p><span style="color: #800080;">end</span></p>
<p><span style="color: #ff0000;">#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span><br />
dtree()</div>
<p>We first tell Rjb to load the specified classpath, for us it&#8217;s our Jar file.  I passed command line arguments that specify the amount of RAM to use.</p>
<p>Rjb::import loads specific classes.  These are relative to our classpath.</p>
<p>I call the constructor for the new classes by using the .new method from Ruby.  Afterward, I can use the new object like any other Ruby object.  The method names are as they are found in their Java source files.  For an explanation of data type conversions, <a title="Rjb explanation" href="http://rjb.rubyforge.org/">click here.</a></p>
<p>The dataset is found inside the data folder downloaded with weka.jar.</p>
<p>As I said before, this can be done in JRuby.  A great example can be found at this <a title="JRuby Example" href="http://rubyforscientificresearch.blogspot.com/2009/08/accessing-weka-from-jruby.html" target="_blank">great blog post</a>, which inspired my post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tylerclemons.com/weka-ruby-decision-trees/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weka and Ruby</title>
		<link>http://www.tylerclemons.com/weka-and-ruby/</link>
		<comments>http://www.tylerclemons.com/weka-and-ruby/#comments</comments>
		<pubDate>Thu, 06 May 2010 17:21:15 +0000</pubDate>
		<dc:creator>Tyler</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Data Mining]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Weka]]></category>
		<category><![CDATA[rjb]]></category>
		<category><![CDATA[K-Means]]></category>

		<guid isPermaLink="false">http://www.tylerclemons.com/?p=256</guid>
		<description><![CDATA[Weka is a collection of machine learning tools used for data mining.  Weka is written in Java however it is possible to use Weka&#8217;s libraries inside Ruby.  To do this, we must install the Java, Rjb, and of course obtain the Weka source code.  One could use JRuby, but I wanted to try this method [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Weka" href="http://www.cs.waikato.ac.nz/ml/weka/" target="_blank">Weka</a> is a collection of machine learning tools used for data mining.  Weka is written in Java however it is possible to use Weka&#8217;s libraries inside Ruby.  To do this, we must install the Java, Rjb, and of course obtain the Weka source code.  One could use JRuby, but I wanted to try this method to eliminate the dependency with JRuby.</p>
<p><span id="more-256"></span><strong>Setup</strong></p>
<p>The first step is to install Java.  That&#8217;s very simple, just follow <a title="Java" href="http://java.sun.com/javase/downloads/index.jsp">this link</a> to download Java.  be sure to download the JDK.</p>
<p>Getting Rjb, which stands for Ruby Java Bridge, is a ruby-gem.  You can either install the gem using the command line:</p>
<div id="codebox" style="overflow: auto; "><code><br />
gem install rjb<br />
</code></div>
<p>or, we can download the gem from <a title="Rjb" href="http://rubyforge.org/frs/?group_id=2010&amp;release_id=6285">this link.</a> The readme inside the gem is very easy to follow.<a title="Rjb" href="http://rubyforge.org/frs/?group_id=2010&amp;release_id=6285"><br />
</a></p>
<p>The last step in setup is obtaining Weka.  On the download page of Weka, choose &#8220;<strong>Other platforms (Linux, etc.)</strong>&#8220;  Inside, we find a jar file called &#8220;weka.jar&#8221;  This is what we need to continue. <strong> </strong></p>
<p><strong>Running Weka</strong></p>
<p>The following is an example of running the SimpleKmeans classifier.</p>
<div id="codebox" style="overflow: auto; "><code><br />
require <span style="color: #ffcc00;">'rjb'</span></code></p>
<p><span style="color: #ff0000;">#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span><br />
<span style="color: #800080;">def </span>kmeans()</p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">#Load Java Jar</span><br />
dir =<span style="color: #ffcc00;"> &#8220;./weka.jar&#8221;</span><br />
<span style="color: #ff0000;">#Have Rjb load the jar file, and pass Java command line arguments</span><br />
<span style="color: #008000;">Rjb</span>::load(dir, jvmargs=[<span style="color: #ffcc00;">"-Xmx1000M"</span>])</p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">#make k-means classifier</span><br />
obj = <span style="color: #008000;">Rjb</span>::import(<span style="color: #ffcc00;">&#8220;weka.clusterers.SimpleKMeans&#8221;</span>)<br />
kmeans = obj.new</p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">#load the data</span> <span style="color: #ff0000;">using Ja<span style="color: #ff0000;">va</span></span><span style="color: #ff0000;"> and Weka</span><br />
labor_src = Rjb::import(<span style="color: #ffcc00;">&#8220;java.io.FileReader&#8221;</span>).new(<span style="color: #ffcc00;">&#8220;labor.arff&#8221;</span>)<br />
labor_data = Rjb::import(<span style="color: #ffcc00;">&#8220;weka.core.Instances&#8221;</span>).new(labor_src)</p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">#build the cluster and output the k-means data</span><br />
kmeans.buildClusterer(labor_data)<br />
puts kmeans.toString</p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">#examine the particular datapoints</span><br />
points = labor_data.numInstances<br />
points.times {|instance|</p>
<p style="padding-left: 60px;">cluster = kmeans.clusterInstance(labor_data.instance(instance))<br />
point = labor_data.instance(instance).toString<br />
puts <span style="color: #ff6600;">&#8220;#{point} \t #{cluster}&#8221;</span></p>
<p style="padding-left: 30px;">}</p>
<p><span style="color: #800080;">end</span></p>
<p><span style="color: #ff0000;">#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span><br />
kmeans()</div>
<p>This is a simple example of how to use K-means.  We first tell Rjb to load the specified classpath, for us it&#8217;s our Jar file.  I passed command line arguments that specify the amount of RAM to use.</p>
<p>Rjb::import loads specific classes.  These are relative to our classpath.</p>
<p>I call the constructor for the new classes by using the .new method from Ruby.  Afterward, I can use the new object like any other Ruby object.  The method names are as they are found in their Java source files.  For an explanation of data type conversions, <a title="Rjb explanation" href="http://rjb.rubyforge.org/">click here.</a></p>
<p>The dataset is found inside the data folder downloaded with weka.jar.</p>
<p>I will probably look at the other classifiers and post some more example.  As I said before, this can be done in JRuby.  A great example can be found at this <a title="JRuby Example" href="http://rubyforscientificresearch.blogspot.com/2009/08/accessing-weka-from-jruby.html" target="_blank">great blog post</a>, which inspired my post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tylerclemons.com/weka-and-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Adium Scripts (thats what she said)</title>
		<link>http://www.tylerclemons.com/creating-adium-scripts-thats-what-she-said/</link>
		<comments>http://www.tylerclemons.com/creating-adium-scripts-thats-what-she-said/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 00:37:38 +0000</pubDate>
		<dc:creator>Tyler</dc:creator>
				<category><![CDATA[Adium]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[thats what she said]]></category>

		<guid isPermaLink="false">http://www.tylerclemons.com/?p=234</guid>
		<description><![CDATA[I was talking to Ben and saw another opening for the classic and overused &#8220;That&#8217;s what she said&#8221; joke.  As I was typing it in, I realized I should just make it easier on myself and write a simple script to do it for me.  So I did.


Creating it is very simple. First, we need [...]]]></description>
			<content:encoded><![CDATA[<p>I was talking to Ben and saw another opening for the classic and overused &#8220;That&#8217;s what she said&#8221; joke.  As I was typing it in, I realized I should just make it easier on myself and write a simple script to do it for me.  So I did.</p>
<p><span id="more-234"></span></p>
<p><img title="More..." src="http://tylershome.nfshost.com/home/public/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /></p>
<p>Creating it is very simple. First, we need to setup a file structure.  Create a folder called <strong>whatshesaid.AdiumScripts</strong>.  Then right click(CTLR+click), and click &#8217;show package contents.&#8217;  Create a folder called <strong>Contents</strong>.  Inside Contents, create a folder called <strong>Resources</strong>.  The result:</p>
<p>-&gt;whatshesaid.AdiumScripts<br />
&#8211;&gt;Contents<br />
&#8212;-&gt;Resources</p>
<p>The next step is to create the actual script.  Enter the Resources folder.  Open up the Script Editor from the Applications folder.  If this is not installed, then just be prepared to save a file using the <em>.scpt</em> extension.  Create a function like this:</p>
<div id="codebox" style="overflow: auto; "><code><br />
<span style="color: #0000ff;">on</span> <span style="color: #008000;">substitute()</span><span style="padding-left: 10px;"><span style="color: #0000ff;"> </span></span><br />
<span style="padding-left: 10px;"><span style="color: #0000ff;">return</span> "thats what she said"</span><br />
<span style="color: #0000ff;">end</span> <span style="color: #008000;">substitute</span><br />
</code></div>
<p>The <em>on substitute() </em>function will be called every time the script is used.  Inside is an array of strings seperated by commas.   Now the question is, how do we use the script?</p>
<p>Go up one level back to the Contents folder.  Click <a href="http://www.tylerclemons.com/whatshesaid.zip">HERE</a> and drag the info.plist file into the directory.  If you changed any of the defaults, make the appropriate changes.</p>
<p>And that&#8217;s it.  Just click on the random.AdiumScripts icon and it should install.  Type<em> /she or %_she </em>in a chatbox to test the script. That&#8217;s the simplest way to do it. There are some other XML properties that can be added but aren&#8217;t necessary for personal use. If you plan on publishing on Adium&#8217;s website, be sure to add any and all public standards.</p>
<p>You can add more substitutions by creating more script files and more entries into the XML tree. You can also edit the triggers by changing <em>/she</em> to any character sequence.</p>
<p><span style="text-decoration: underline;"><span style="color: #ff0000;"><em>Your files will be installed in Library/Application Support/Adium 2.0/Scripts</em></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tylerclemons.com/creating-adium-scripts-thats-what-she-said/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Learning Python , C++ , and Data Structures</title>
		<link>http://www.tylerclemons.com/learning-python-and-c/</link>
		<comments>http://www.tylerclemons.com/learning-python-and-c/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 03:11:17 +0000</pubDate>
		<dc:creator>Tyler</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Data Structures]]></category>

		<guid isPermaLink="false">http://tylershome.nfshost.com/?p=134</guid>
		<description><![CDATA[Back in undergrad, the majority of our classes taught us sound software engineering principles using Python, C++, and sometimes Java.  The first two were used quite extensively.  The resource I used was invaluable to my success in mastering data structures, learning OOP, and granting me proper exposure to Python and C++.  Data Structures and Algorithms [...]]]></description>
			<content:encoded><![CDATA[<p>Back in undergrad, the majority of our classes taught us sound software engineering principles using Python, C++, and sometimes Java.  The first two were used quite extensively.  The resource I used was invaluable to my success in mastering data structures, learning OOP, and granting me proper exposure to Python and C++.  <span style="text-decoration: underline;">Data Structures and Algorithms Using Python and C++</span> is a great resource and I wanted to share it here.  I believe it is great for beginners of both Python and C++ and those entering a data structures course.  Click <a href="http://www.fbeedle.com/2335.html" target="_blank">HERE</a> to order a copy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tylerclemons.com/learning-python-and-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Exciting Changes to Ruby on Rails</title>
		<link>http://www.tylerclemons.com/exciting-changes-to-ruby-on-rails/</link>
		<comments>http://www.tylerclemons.com/exciting-changes-to-ruby-on-rails/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 19:36:40 +0000</pubDate>
		<dc:creator>Tyler</dc:creator>
				<category><![CDATA[MERB]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[WebTechs]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://tylershome.nfshost.com/?p=115</guid>
		<description><![CDATA[http://www.infoworld.com/article/09/01/12/02NF-ruby-on-rails-merb_1.html
Rails will add some new features and enhancements by merging with MERB.  Should be interesting.
]]></description>
			<content:encoded><![CDATA[<p><a title="Ruby on Rails and MERB" href="http://www.infoworld.com/article/09/01/12/02NF-ruby-on-rails-merb_1.html" target="_blank">http://www.infoworld.com/article/09/01/12/02NF-ruby-on-rails-merb_1.html</a></p>
<p>Rails will add some new features and enhancements by merging with MERB.  Should be interesting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tylerclemons.com/exciting-changes-to-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Adium Scripts (iTunes)</title>
		<link>http://www.tylerclemons.com/creating-adium-scripts-itunes/</link>
		<comments>http://www.tylerclemons.com/creating-adium-scripts-itunes/#comments</comments>
		<pubDate>Sun, 31 Aug 2008 01:09:26 +0000</pubDate>
		<dc:creator>Tyler</dc:creator>
				<category><![CDATA[Adium]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[iTunes]]></category>

		<guid isPermaLink="false">http://tylershome.nfshost.com/?p=41</guid>
		<description><![CDATA[I use Adium and iTunes frequently.  One of the cool things about the OS X environment is the integration between applications.  For instance, Adium contacts can be linked to Address Book accounts.  One of my personal favorites is the integration of Adium and iTunes.  Adium can display details of what is [...]]]></description>
			<content:encoded><![CDATA[<p>I use Adium and iTunes frequently.  One of the cool things about the OS X environment is the integration between applications.  For instance, Adium contacts can be linked to Address Book accounts.  One of my personal favorites is the integration of Adium and iTunes.  Adium can display details of what is currently playing on iTunes such as the name of the song and the artist.  The trick is customizing these messages so that they can be presented as suitable away or status messages.<br />
<span id="more-20"></span></p>
<p>The best way to learn these concepts is to open up one.  That is just what I did.  I found a script that formatted iTunes data.  I was not satisfied with all of its features so I modified it.  I left credit to the original authors in the modified script.</p>
<p>First, we need to create a file structure.  Create a folder called <strong>name.AdiumScripts</strong>.  name can be anything you like, just make sure you don&#8217;t forget it.  Then right click(CTLR+click), and click ’show package contents.’  Create a folder called <strong>Contents</strong>.  Inside Contents, create a folder called <strong>Resources</strong>.  The result:</p>
<p>-&gt;name.AdiumScripts<br />
–&gt;Contents<br />
—-&gt;Resources</p>
<p>Enter the contents folder. Click<span style="color: #888888;"> <a title="Info2" href="http://tylershome.nfshost.com/info2.zip" target="_blank">HERE</a></span> for the info.plist file that will direct Adium where to get your script.  Place it in the contents folder.</p>
<p>The following is how the file looks:</p>
<div id="codebox" style="overflow: auto; ">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;!DOCTYPE plist PUBLIC &#8220;-//Apple Computer//DTD PLIST 1.0//EN&#8221; &#8220;http://www.apple.com/DTDs/PropertyList-1.0.dtd&#8221;&gt;<br />
&lt;plist version=&#8221;1.0&#8243;&gt;<br />
&lt;dict&gt;<br />
<span style="padding-left: 10px;">&lt;key&gt;CFBundleDevelopmentRegion&lt;/key&gt;</span><br />
<span style="padding-left: 10px;">&lt;string&gt;English&lt;/string&gt;</span><br />
<span style="padding-left: 10px;">&lt;key&gt;CFBundleExecutable&lt;/key&gt;</span><br />
<span style="padding-left: 10px;">&lt;string&gt;Adium&lt;/string&gt;</span><br />
<span style="padding-left: 10px;">&lt;key&gt;CFBundleGetInfoString&lt;/key&gt;</span><br />
<span style="padding-left: 10px;">&lt;string&gt;Nameit&lt;/string&gt;</span><br />
<span style="padding-left: 10px;">&lt;key&gt;CFBundleIdentifier&lt;/key&gt;</span><br />
<span style="padding-left: 10px;">&lt;string&gt;com.adiumx.iTunes.scripts&lt;/string&gt;</span><br />
<span style="padding-left: 10px;">&lt;key&gt;CFBundleInfoDictionaryVersion&lt;/key&gt;</span><br />
<span style="padding-left: 10px;">&lt;string&gt;1.2&lt;/string&gt;</span><br />
<span style="padding-left: 10px;">&lt;key&gt;CFBundleName&lt;/key&gt;</span><br />
<span style="padding-left: 10px;">&lt;string&gt;<strong>name</strong>&lt;/string&gt;</span><br />
<span style="padding-left: 10px;">&lt;key&gt;CFBundlePackageType&lt;/key&gt;</span><br />
<span style="padding-left: 10px;">&lt;string&gt;AdIM&lt;/string&gt;</span><br />
<span style="padding-left: 10px;">&lt;key&gt;Scripts&lt;/key&gt;</span><br />
<span style="padding-left: 10px;">&lt;array&gt;</span><br />
<span style="padding-left: 20px;">&lt;dict&gt;</span><br />
<span style="padding-left: 30px;">&lt;key&gt;File&lt;/key&gt;</span><br />
<span style="padding-left: 30px;">&lt;string&gt;<span style="color: #ffff00;"><strong>name</strong></span>&lt;/string&gt;</span><br />
<span style="padding-left: 30px;">&lt;key&gt;Keyword&lt;/key&gt;</span><br />
<span style="padding-left: 30px;">&lt;string&gt;<strong>%<span style="color: #ffff00;">_name</span></strong>&lt;/string&gt;</span><br />
<span style="padding-left: 30px;">&lt;key&gt;Prefix Only&lt;/key&gt;</span><br />
<span style="padding-left: 30px;">&lt;false/&gt;</span><br />
<span style="padding-left: 30px;">&lt;key&gt;Requires User Interaction&lt;/key&gt;</span><br />
<span style="padding-left: 30px;">&lt;false/&gt;</span><br />
<span style="padding-left: 30px;">&lt;key&gt;Title&lt;/key&gt;</span><br />
<span style="padding-left: 30px;">&lt;string&gt;Message iTunes data&lt;/string&gt;</span><br />
<span style="padding-left: 20px;">&lt;/dict&gt;</span><br />
<span style="padding-left: 10px;">&lt;/array&gt;</span><br />
<span style="padding-left: 10px;">&lt;key&gt;Set&lt;/key&gt;</span><br />
<span style="padding-left: 10px;">&lt;string&gt;<span style="color: #ffff00;"><strong>Nameit</strong></span>&lt;/string&gt;</span><br />
&lt;/dict&gt;<br />
&lt;/plist&gt;</div>
<p><span style="color: #ffff00;"><strong>name</strong></span> corresponds to the name of your project from earlier.  Under &lt;key&gt;File&lt;/key&gt;, we specify the <span style="color: #ffff00;"><strong>name </strong></span>of the script file that will be called each time <span style="color: #ffff00;"><strong>%_name</strong></span> is called.  Of course, you can change any of these.  It is also possible to create more callable scripts by copying and pasting.</p>
<p>Now enter the <em>Resources</em> folder.  Create a file called <span style="color: #ffff00;"><strong>name</strong></span>, or whatever you may have changed <strong><span style="color: #ffff00;">name</span> </strong>to, with the file extension <em>.scpt.</em> You can either use your favorite text editor or the Script Editor.  This is where we will create our actual script that displays the data.</p>
<p>The following script has the following sample output:</p>
<p>Reading and listening to You Are The Pan<br />
By John Williams<br />
From Hook (Original Motion Picture Soundtrack).</p>
<p>The first line is shows my default action combined with the current song name.  The next lines are the artist, and the album.  If iTunes is not active, whether it is paused or not open, the default action will appear.  In the above example, the default action is Reading.  The modified script can be found by clicking <a title="Sample script" href="http://tylershome.nfshost.com/name.scpt">HERE.</a></p>
<p>The code is pretty simple to follow so I won&#8217;t go into details here.  It is very simple to add more formatting.  It is just a matter of copying and pasting.  The column names found in iTunes are pretty much the same as they are in AppleScript e.g. to access the genre of a track, just use the variable genre.  Adding more substitutions, that is adding more features like %_name, is as simple as expanding the XML tree and placing the new script files in the same directory.</p>
<p>Like always, if you plan on creating a published add-on, be sure to adhere to any current standards.  And that&#8217;s it.  Just click on name.AdiumScripts to install.<br />
<em><span style="text-decoration: underline;"><span style="color: #ff0000;"><br />
Your files will be installed in Library/Application Support/Adium 2.0/Scripts</span></span></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tylerclemons.com/creating-adium-scripts-itunes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating Adium Scripts (Emoticons)</title>
		<link>http://www.tylerclemons.com/creating-adium-scripts-emoticons/</link>
		<comments>http://www.tylerclemons.com/creating-adium-scripts-emoticons/#comments</comments>
		<pubDate>Sat, 30 Aug 2008 14:41:53 +0000</pubDate>
		<dc:creator>Tyler</dc:creator>
				<category><![CDATA[Adium]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Emoticons]]></category>

		<guid isPermaLink="false">http://tylershome.nfshost.com/?p=40</guid>
		<description><![CDATA[So much fun open source applications are.  Adium allows tons of customization.  The best part is that it does not take an extensive knowledge of Objective-C, Adium&#8217;s primary language, to customize some if it&#8217;s features.  One customizable feature is the emoticon set.  Emoticons, Emotion Icons, are the combination of characters that resemble faces.  In some [...]]]></description>
			<content:encoded><![CDATA[<p>So much fun open source applications are.  Adium allows tons of customization.  The best part is that it does not take an extensive knowledge of Objective-C, Adium&#8217;s primary language, to customize some if it&#8217;s features.  One customizable feature is the emoticon set.  Emoticons, Emotion Icons, are the combination of characters that resemble faces.  In some web browsers and most chat programs, such as Firefox and Adium, emoticons are automatically translated into pictures.  But there are so many emoticons that some clients do not include every combination.  Good thing we can create our own.</p>
<p><span id="more-19"></span></p>
<p>In this example, we are only going to create one new emoticon.  The process can be duplicated easily by copying and pasting.  To start, create a folder called Name.adiumemoticonset.  The name doesn&#8217;t really matter as long as you remember it later.  Right click(CTLR+click) on your new folder, it should be a smiley face, and click &#8216;Show Package Contents.&#8217; Open up the Property List Editor to create a .plist file. Name this file Emoticons.plist.</p>
<p>Click <a title="Emoticon.plist" href="http://tylershome.nfshost.com/Emoticons.plist.zip" target="_blank">HERE</a> for a shell of the .plist file.</p>
<p>That is all there is too customizing your own Adium &#8220;smiley set&#8221;.  Yourpic.png is the element that controls which picture is called when the proper emoticon appears.  In this case, the emoticon &#58;&#41;  , most know it as <img src='http://tylershome.nfshost.com/home/public/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   ,	 will cause Yourpic.png to show up.  You can assign any number of emoticons to a particular picture by adding more nodes under Equivalents.  Just copy and paste for more elements.</p>
<p>Yourpic.png, and any other .pngs, are stored in the same directory as Emoticons.plist.  All of them are stored in the main directory of the package.  Most .png files are around (19-21)x(19-21).  You don&#8217;t have to conform to the size limits but you might not want large files crowding your chat window.  Also note, the emoticons only appear on your end, so whomever you are talking with will only see their representation of &#58;&#41; and not Yourpic.png.</p>
<p><em><span style="text-decoration: underline;"><span style="color: #ff0000;">Your files will be installed in Library/Application Support/Adium 2.0/Emoticons</span></span></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tylerclemons.com/creating-adium-scripts-emoticons/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Creating Adium Scripts (Random Text)</title>
		<link>http://www.tylerclemons.com/creating-adium-scripts-random-text/</link>
		<comments>http://www.tylerclemons.com/creating-adium-scripts-random-text/#comments</comments>
		<pubDate>Sat, 30 Aug 2008 01:16:43 +0000</pubDate>
		<dc:creator>Tyler</dc:creator>
				<category><![CDATA[Adium]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://tylershome.nfshost.com/?p=38</guid>
		<description><![CDATA[Adium is a free mesenger client for the Mac OS X.  It allows users to connect to multiple chat services, such as AIM and ICQ, at once.  It is open source, which means users are allowed to tinker with it as they see fit.  With this extensibility, it becomes possible to type something like &#8220;/random&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Adium" href="http://www.adiumx.com/" target="_blank">Adium</a> is a free mesenger client for the Mac OS X.  It allows users to connect to multiple chat services, such as AIM and ICQ, at once.  It is open source, which means users are allowed to tinker with it as they see fit.  With this extensibility, it becomes possible to type something like <em>&#8220;/random&#8221; </em>and generate a random message.  I decided to take a quick look at what goes on under the hood and decided to give a go at creating some easy scripts.</p>
<p><span id="more-18"></span></p>
<p>One of the easiest ways to learn how to create an Adium script is to open up an exisiting script and look at how it works.  Easy enough.  First, we need to setup a file structure.  Create a folder called <strong>random.AdiumScripts</strong>.  Then right click(CTLR+click), and click &#8217;show package contents.&#8217;  Create a folder called <strong>Contents</strong>.  Inside Contents, create a folder called <strong>Resources</strong>.  The result:</p>
<p>-&gt;random.AdiumScripts<br />
&#8211;&gt;Contents<br />
&#8212;-&gt;Resources</p>
<p>The next step is to create the actual script.  Enter the Resources folder.  Open up the Script Editor from the Applications folder.  If this is not installed, then just be prepared to save a file using the <em>.scpt</em> extension.  Create a function like this:</p>
<div id="codebox" style="overflow: auto; "><code><br />
<span style="color: #0000ff;">on</span> <span style="color: #008000;">substitute()</span><br />
<span style="padding-left: 10px;"><span style="color: #0000ff;">set</span> <span style="color: #ff0000;">usethis</span> <span style="color: #0000ff;">to some</span> <span style="color: #000080;">item</span> <span style="color: #0000ff;">of </span>{"A","B, "C"}</span><br />
<span style="padding-left: 10px;"><span style="color: #0000ff;">return</span> "Random Line :   " &amp; <span style="color: #ff0000;">usethis</span></span><br />
<span style="color: #0000ff;">end</span> <span style="color: #008000;">substitute</span><br />
</code></div>
<p>The <em>on substitute() </em>function will be called every time the script is used.  Inside is an array of strings seperated by commas.  usethis is assigned to some random string inside the array and returned to Adium.  Now the question is, how do we use the script?</p>
<p>Go up one level back to the Contents folder.  Click <a title="Info.plist" href="http://tylershome.nfshost.com/info.plist.zip" target="_blank">HERE</a> and drag the info.plist file into the directory.  If you changed any of the defaults, make the appropriate changes.</p>
<p>And that&#8217;s it.  Just click on the random.AdiumScripts icon and it should install.  Type<em> /random</em> in a chatbox to test the script.  That&#8217;s the simplest way to do it.  There are some other XML properties that can be added but aren&#8217;t necessary for personal use.  If you plan on publishing on Adium&#8217;s website, be sure to add any and all public standards.</p>
<p>You can add more substitutions by creating more script files and more entries into the XML tree.  You can also edit the triggers by changing <em>/random</em> to any character sequence.</p>
<p><span style="text-decoration: underline;"><span style="color: #ff0000;"><em>Your files will be installed in Library/Application Support/Adium 2.0/Scripts</em></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tylerclemons.com/creating-adium-scripts-random-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iTunes Scripting with Python</title>
		<link>http://www.tylerclemons.com/itunes-scripting-with-python/</link>
		<comments>http://www.tylerclemons.com/itunes-scripting-with-python/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 23:48:08 +0000</pubDate>
		<dc:creator>Tyler</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[appscript]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://tylershome.nfshost.com/?p=37</guid>
		<description><![CDATA[I ran across scripting for the Mac OSX awhile ago.  I finally decided to take a look at it when I decided to play around with Adium&#8217;s open source code.  The most dominant prescene I observed was Applescript.  Applescript is nice and all, but Python is nicer.  Scripting OSX applications with [...]]]></description>
			<content:encoded><![CDATA[<p>I ran across scripting for the Mac OSX awhile ago.  I finally decided to take a look at it when I decided to play around with Adium&#8217;s open source code.  The most dominant prescene I observed was Applescript.  Applescript is nice and all, but Python is nicer.  Scripting OSX applications with Python has been around for a bit.  Using the easy to install <a title="appscript" href="http://appscript.sourceforge.net/" target="_blank">appscript</a>, scripting can be leveraged by the power of Python and Ruby.</p>
<p><span id="more-17"></span></p>
<p>One of my favorite applications on my Mac is iTunes, so its no surprise this is the first application I turned to for testing.  To start, import the proper library:</p>
<div id="codebox" style="overflow: auto; "><code><span style="color: #ff6600;">from</span> appscript <span style="color: #ff6600;">import </span>*</code></div>
<p>Afterward, we can create a handle to iTunes and tell it to play:</p>
<div id="codebox" style="overflow: auto; "><code>itunes = app(<span style="color: #ff0000;">'itunes'</span>)<br />
itunes.play()</code></div>
<p>Running the above lines will open up the application called iTunes and execute the action play.  It will play the current track and specific tracks can be passed as an argument.  The action .stop() will stop iTunes.  Of course, we can do so much more with appscript.  For instance, we can create a playlist that only plays a specific album.  I wrote a script that does just that.</p>
<p>The script can be found <a title="iTunes Script" href="http://tylershome.nfshost.com/iTunesPlist.zip">HERE</a> in a zipped file.</p>
<p>It is documented and should be easy to follow.  One more thing, it is also possible to assign values to each track as if they were normal data objects.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tylerclemons.com/itunes-scripting-with-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
