<?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>Mickinator</title>
	<atom:link href="http://www.mickinator.com/wordpress/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.mickinator.com/wordpress</link>
	<description>Recursion: noun, see: recursion</description>
	<lastBuildDate>Sun, 09 Aug 2009 01:03:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Lol</title>
		<link>http://www.mickinator.com/wordpress/?p=104</link>
		<comments>http://www.mickinator.com/wordpress/?p=104#comments</comments>
		<pubDate>Sun, 09 Aug 2009 01:02:35 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mickinator.com/wordpress/?p=104</guid>
		<description><![CDATA[http://www.youtube.com/watch?v=kqRMO4Dfppo
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.youtube.com/watch?v=kqRMO4Dfppo">http://www.youtube.com/watch?v=kqRMO4Dfppo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mickinator.com/wordpress/?feed=rss2&amp;p=104</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plans</title>
		<link>http://www.mickinator.com/wordpress/?p=101</link>
		<comments>http://www.mickinator.com/wordpress/?p=101#comments</comments>
		<pubDate>Wed, 29 Apr 2009 21:00:13 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Haskell File Manager]]></category>
		<category><![CDATA[GHC]]></category>
		<category><![CDATA[Gtk2hs]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[System.Gnome.VFS]]></category>

		<guid isPermaLink="false">http://www.mickinator.com/wordpress/?p=101</guid>
		<description><![CDATA[Here&#8217;s what I&#8217;m thinking of doing to keep my project interesting:

System.Gnome.VFS.VolumeMonitor &#8211; To monitor mounts &#038; dismounts. Mounted locations would be shown above where the directory tree is right now i.e. the directory tree &#8220;pane&#8221; would be halved in height, and mounts displayed in the freed space. Also maybe do something with System.Gnome.VFS.Drive.
Fix it so [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s what I&#8217;m thinking of doing to keep my project interesting:</p>
<ul>
<li><a href="http://www.haskell.org/gtk2hs/docs/current/System-Gnome-VFS-VolumeMonitor.html">System.Gnome.VFS.VolumeMonitor</a> &#8211; To monitor mounts &#038; dismounts. Mounted locations would be shown above where the directory tree is right now i.e. the directory tree &#8220;pane&#8221; would be halved in height, and mounts displayed in the freed space. Also maybe do something with <a href="http://www.haskell.org/gtk2hs/docs/current/System-Gnome-VFS-Drive.html">System.Gnome.VFS.Drive</a>.</li>
<li>Fix it so that it handles symlinks properly. At the moment it just ignores symlinks, due to problems during the project and and a short development timeline.</li>
<li><a href="http://www.haskell.org/gtk2hs/docs/current/System-Gnome-VFS-FileInfo.html">System.Gnome.VFS.FileInfo</a> and <a href="http://www.haskell.org/gtk2hs/docs/current/System-Gnome-VFS-FileInfo.html">System.Gnome.VFS.Util</a> and <a href="http://www.haskell.org/gtk2hs/docs/current/System-Gnome-VFS-Ops.html">System.Gnome.VFS.Ops</a> to do somemore file stuff, display more information, and add a &#8220;Properties&#8221; pop-up selectable from the right-click menu.</li>
<li><a href="http://www.haskell.org/gtk2hs/docs/current/System-Gnome-VFS-Xfer.html">System.Gnome.VFS.Xfer</a> to complete copies and moves &#8211; I&#8217;ll have to see if I can transfer files etc.</li>
</ul>
<p>Sin é!</p>
<p>M</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mickinator.com/wordpress/?feed=rss2&amp;p=101</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Haskell FM released</title>
		<link>http://www.mickinator.com/wordpress/?p=96</link>
		<comments>http://www.mickinator.com/wordpress/?p=96#comments</comments>
		<pubDate>Sun, 26 Apr 2009 16:08:13 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Haskell File Manager]]></category>
		<category><![CDATA[GHC]]></category>
		<category><![CDATA[Gtk2hs]]></category>
		<category><![CDATA[Haskell]]></category>

		<guid isPermaLink="false">http://www.mickinator.com/wordpress/?p=96</guid>
		<description><![CDATA[Haskell File Manager has just been released  
It is hosted over at haskell.org, and can be obtained by doing the following command:

darcs get http://code.haskell.org/haskellfm

And can then be install by running the following commands:

runhaskell Setup configure
runhaskell Setup build
runhaskell Setup install

This project relies upon FileManip for searching, and as such you must have this installed.

cabal install [...]]]></description>
			<content:encoded><![CDATA[<p>Haskell File Manager has just been released <img src='http://www.mickinator.com/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>It is hosted over at haskell.org, and can be obtained by doing the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">darcs get http:<span style="color: #000000; font-weight: bold;">//</span>code.haskell.org<span style="color: #000000; font-weight: bold;">/</span>haskellfm</pre></div></div>

<p>And can then be install by running the following commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">runhaskell Setup configure
runhaskell Setup build
runhaskell Setup <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>This project relies upon <a href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/FileManip">FileManip</a> for searching, and as such you must have this installed.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">cabal <span style="color: #c20cb9; font-weight: bold;">install</span> FileManip</pre></div></div>

<p>Here is a screen shot of it running in Ubuntu:</p>
<p><a href="http://i39.tinypic.com/1hqse0.png"><img width=50% height=50% src="http://i39.tinypic.com/1hqse0.png" alt="Screenshot" /></a></p>
<p>M</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mickinator.com/wordpress/?feed=rss2&amp;p=96</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tomcat &amp; MySQL on OSX (10.5)</title>
		<link>http://www.mickinator.com/wordpress/?p=92</link>
		<comments>http://www.mickinator.com/wordpress/?p=92#comments</comments>
		<pubDate>Wed, 15 Apr 2009 21:01:48 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[osx]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Jakarta]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tomcat]]></category>

		<guid isPermaLink="false">http://www.mickinator.com/wordpress/?p=92</guid>
		<description><![CDATA[Hey all,
A different subject to normal. The anti-haskell: Javaish stuff!!
Well, I got a Mac recently and was trying to get a Tomcat server with MySQL integration going, and had a built of difficulty on the way!!
Note: For this tutorial I use the Bash terminal. To set your Mac to use Bash by default, as it [...]]]></description>
			<content:encoded><![CDATA[<p>Hey all,</p>
<p>A different subject to normal. The anti-haskell: Javaish stuff!!</p>
<p>Well, I got a Mac recently and was trying to get a Tomcat server with MySQL integration going, and had a built of difficulty on the way!!</p>
<p><b>Note:</b> For this tutorial I use the Bash terminal. To set your Mac to use Bash by default, as it uses Zsh by default, open a terminal, and then click:</p>
<p>Terminal->Preferences->Startup->Shell opens with: custom command</p>
<p>and make sure that the input box reads:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span></pre></div></div>

<p>I found this tutorial: <a href="http://www.benslade.com/projects/java/tomcat/InstallingJavaTomcatMySQLOnMacOSX/">Ben Slade&#8217;s tutorial</a>. This is a good starting point but I think it&#8217;s a bit out-dated. So my tutorial here is a modernised version of that.</p>
<p>Firstly, you have to have the Java JDK installed, to find out type this into a terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">javac <span style="color: #660033;">-version</span></pre></div></div>

<p>If you get an error message, then you don&#8217;t have it installed, so head over to the Apple Developer Center and get the latest XCode. That should install it for you. <img src='http://www.mickinator.com/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Next, go and get MySQL for OSX <a href="http://dev.mysql.com/downloads/mysql/6.0.html">here</a> and get the OSX version. This will download a disk image that will be mounted for you. In that double-click the .dmg file that starts with &#8220;mysql-&#8230;&#8230;&#8221;. This will install MySQL for you. Next double-click the MySQLStartupItem.pkg, and confirm the prompts. This will enable an auto-start of MySQL when you boot into OSX.</p>
<p>Now a bit of setup for MySQL:</p>
<p>Restart your terminal (so that it&#8217;s definately a bash terminal), and type the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bash_profile</pre></div></div>

<p>If that file doesn&#8217;t exist, thats fine. Just create it.</p>
<p>In the editor that opens up, type the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">PATH</span>=<span style="color: #007800;">$PATH</span>:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>bin</pre></div></div>

<p>This loads the MySQL command line utilities when you open a bash terminal.</p>
<p>Now would be a good time to reboot your Mac, just to make sure everything loads alright. After rebooting, you need to set user passwords for the root account. Open up a terminal and type the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysql <span style="color: #660033;">-u</span> root</pre></div></div>

<p>To remove anonymous logins now type the following:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">DELETE</span> <span style="color: #993333; font-weight: bold;">FROM</span> mysql<span style="color: #66cc66;">.</span>user <span style="color: #993333; font-weight: bold;">WHERE</span> User <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">' '</span>;
<span style="color: #993333; font-weight: bold;">FLUSH</span> PRIVILEGES;</pre></div></div>

<p>Now, find your computers names:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">DISTINCT</span><span style="color: #66cc66;">&#40;</span>Host<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> Host <span style="color: #993333; font-weight: bold;">FROM</span> mysql<span style="color: #66cc66;">.</span>user <span style="color: #993333; font-weight: bold;">WHERE</span> Host !<span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;localhost&quot;</span>;</pre></div></div>

<p>You should see something like:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
| Host                                       |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
| 127.0.0.1                               |<br />
| username&#8217;s-macbook.local   |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Now type:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SET</span> PASSWORD <span style="color: #993333; font-weight: bold;">FOR</span> <span style="color: #ff0000;">'root'</span>@<span style="color: #ff0000;">'localhost'</span> <span style="color: #66cc66;">=</span> PASSWORD<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'new_pass'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">SET</span> PASSWORD <span style="color: #993333; font-weight: bold;">FOR</span> <span style="color: #ff0000;">'root'</span>@<span style="color: #ff0000;">'username'</span>s<span style="color: #66cc66;">-</span>macbook<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">LOCAL</span><span style="color: #ff0000;">' = PASSWORD('</span>new_pass<span style="color: #ff0000;">');</span></pre></div></div>

<p>Where new_pass is your new password.</p>
<p>Now make a test login, exactly like below&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> javatest;
<span style="color: #993333; font-weight: bold;">GRANT</span> <span style="color: #993333; font-weight: bold;">ALL</span> <span style="color: #993333; font-weight: bold;">ON</span> javatest<span style="color: #66cc66;">.*</span> <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">'some_login'</span>@<span style="color: #ff0000;">'localhost'</span> <span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'some_password'</span>;
<span style="color: #993333; font-weight: bold;">FLUSH</span> PRIVILEGES;</pre></div></div>

<p>Where some_login is the username you will be using earlier and some_password is the password you will use to log some_login in.<br />
flush privileges;</p>
<p>Next, get <a href="http://jakarta.apache.org">Jakarta Tomcat</a> and download the latest stable release, for OSX. Download it to ~/. Next you need to copy the tar to your local directory. Do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> apache-tomcat-<span style="color: #000000; font-weight: bold;">&lt;</span>i<span style="color: #000000; font-weight: bold;">&gt;</span>version-number<span style="color: #000000; font-weight: bold;">&lt;/</span>i<span style="color: #000000; font-weight: bold;">&gt;</span>.tar.gz <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xf</span> apache-tomcat-<span style="color: #000000; font-weight: bold;">&lt;</span>i<span style="color: #000000; font-weight: bold;">&gt;</span>version-number<span style="color: #000000; font-weight: bold;">&lt;/</span>i<span style="color: #000000; font-weight: bold;">&gt;</span>.tar.gz
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> apache-tomcat-<span style="color: #000000; font-weight: bold;">&lt;</span>i<span style="color: #000000; font-weight: bold;">&gt;</span>version-number<span style="color: #000000; font-weight: bold;">&lt;/</span>i<span style="color: #000000; font-weight: bold;">&gt;</span>.tar.gz</pre></div></div>

<p>Now create a symlink for Tomcat for easy access:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> apache-tomcat-<span style="color: #000000; font-weight: bold;">&lt;</span>i<span style="color: #000000; font-weight: bold;">&gt;</span>version-number<span style="color: #000000; font-weight: bold;">&lt;/</span>i<span style="color: #000000; font-weight: bold;">&gt;</span> tomcat</pre></div></div>

<p>Now take ownership of the files:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> <span style="color: #007800;">$LOGNAME</span>: apache-tomcat-<span style="color: #000000; font-weight: bold;">&lt;</span>i<span style="color: #000000; font-weight: bold;">&gt;</span>version-number<span style="color: #000000; font-weight: bold;">&lt;/</span>i<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>Now set up the $CATALINA_HOME variable to point to the tomcat installation:</p>
<p><lang pre="bash">nano ~/.bash_profile</pre>
<p>And add the following line:</p>
<p><lang pre="bash">CATALINA_HOME=/usr/local/tomcat</pre>
<p>Now, create two scripts - one for starting the tomcat server and one for stopping it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">nano</span> ~<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>tomcat_start.sh</pre></div></div>

<p>And add the following to that:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #007800;">$CATALINA_HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>startup.sh</pre></div></div>

<p>Then:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> ~<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>tomcat_stop.sh</pre></div></div>

<p>And add the following to that:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #007800;">$CATALINA_HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>shutdown.sh</pre></div></div>

<p>Make the two scripts you just created executable:<br />
$ chmod u+x ~/bin/*_tomcat</p>
<p>And add the ~/bin directory to your $PATH variable:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bash_profile</pre></div></div>

<p>And add this to it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">PATH</span>=<span style="color: #007800;">$PATH</span>:<span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$LOGNAME</span><span style="color: #000000; font-weight: bold;">/</span>bin</pre></div></div>

<p>Now, you can use tomcat_start to start the server:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ tomcat_start</pre></div></div>

<p>Now load up Safari and go to http://localhost:8080 and you should see the tomcat default page.</p>
<p>Next, run your tomcat_stop script, and type the following into terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #007800;">$CATALINA_HOME</span><span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>tomcat-users.xml</pre></div></div>

<p>Add the following into the file:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;user</span> <span style="color: #000066;">username</span>=<span style="color: #ff0000;">&quot;myusername&quot;</span> <span style="color: #000066;">password</span>=<span style="color: #ff0000;">&quot;mypassword&quot;</span> <span style="color: #000066;">roles</span>=<span style="color: #ff0000;">&quot;tomcat,admin,manager&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>Now to sort out the connectivity between tomcat and SQL download the latest <a href="http://dev.mysql.com/downloads/connector/j/">ConnectorJ</a>. When that's downloaded, copy it into the java extensions directory:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> connectorJFileName <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Java<span style="color: #000000; font-weight: bold;">/</span>Extension</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.mickinator.com/wordpress/?feed=rss2&amp;p=92</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Demo done&#8230; work continues&#8230;</title>
		<link>http://www.mickinator.com/wordpress/?p=90</link>
		<comments>http://www.mickinator.com/wordpress/?p=90#comments</comments>
		<pubDate>Sat, 04 Apr 2009 15:06:50 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Haskell File Manager]]></category>
		<category><![CDATA[GHC]]></category>
		<category><![CDATA[Gtk2hs]]></category>
		<category><![CDATA[Haskell]]></category>

		<guid isPermaLink="false">http://www.mickinator.com/wordpress/?p=90</guid>
		<description><![CDATA[We&#8217;ll I got my project demo done and out of the way, thank god!
At the moment, I still have a few bits to do with it before I release it!
For now, I&#8217;m just gonna change to using the default Haskell libraries for working with files &#038; directories, as opposed to my own one using System.Cmd.
M
]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ll I got my project demo done and out of the way, thank god!</p>
<p>At the moment, I still have a few bits to do with it before I release it!</p>
<p>For now, I&#8217;m just gonna change to using the default Haskell libraries for working with files &#038; directories, as opposed to my own one using System.Cmd.</p>
<p>M</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mickinator.com/wordpress/?feed=rss2&amp;p=90</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Searching</title>
		<link>http://www.mickinator.com/wordpress/?p=87</link>
		<comments>http://www.mickinator.com/wordpress/?p=87#comments</comments>
		<pubDate>Sun, 22 Mar 2009 06:08:09 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[College]]></category>
		<category><![CDATA[Haskell File Manager]]></category>
		<category><![CDATA[GHC]]></category>
		<category><![CDATA[Gtk2hs]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Haskell Search]]></category>

		<guid isPermaLink="false">http://www.mickinator.com/wordpress/?p=87</guid>
		<description><![CDATA[I have search *kind of* fixed.
I&#8217;m using the FileManip from Hackage to do my Regex matching, it&#8217;s basically what I was doing already, but a LOT faster.  It&#8217;s functionality for finding matching directory/file names is blazing fast compared to my own functions. I also have the within files searching fixed, but that adds a [...]]]></description>
			<content:encoded><![CDATA[<p>I have search *kind of* fixed.</p>
<p>I&#8217;m using the <a href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/FileManip">FileManip</a> from <a href="//http://hackage.haskell.org/">Hackage</a> to do my Regex matching, it&#8217;s basically what I was doing already, but a LOT faster.  It&#8217;s functionality for finding matching directory/file names is blazing fast compared to my own functions. I also have the within files searching fixed, but that adds a big delay to getting the results. Here&#8217;s some code!</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="haskell" style="font-family:monospace;">checkFile <span style="color: #339933; font-weight: bold;">::</span> <span style="color: #cccc00; font-weight: bold;">String</span> <span style="color: #5d478b; font-style: italic;">-- ^ The expression to be searched for.</span>
          <span style="color: #339933; font-weight: bold;">-&gt;</span> FilePath <span style="color: #5d478b; font-style: italic;">-- ^ The path to the file to be checked.</span>
          <span style="color: #339933; font-weight: bold;">-&gt;</span> <span style="color: #cccc00; font-weight: bold;">IO</span> <span style="color: #cccc00; font-weight: bold;">Bool</span> <span style="color: #5d478b; font-style: italic;">-- ^ Whether or not the pattern is found.</span>
checkFile pattern file <span style="color: #339933; font-weight: bold;">=</span> withFile file ReadMode <span style="color: green;">&#40;</span> \h <span style="color: #339933; font-weight: bold;">-&gt;</span> <span style="color: #06c; font-weight: bold;">do</span>
      conts <span style="color: #339933; font-weight: bold;">&lt;-</span> hGetContents h
      <span style="font-weight: bold;">return</span> <span style="color: #339933; font-weight: bold;">$!</span><span style="color: green;">&#40;</span> <span style="font-weight: bold;">any</span> <span style="color: green;">&#40;</span> <span style="color: #339933; font-weight: bold;">~~</span> pattern <span style="color: green;">&#41;</span> <span style="color: green;">&#40;</span> <span style="font-weight: bold;">words</span> conts <span style="color: green;">&#41;</span> <span style="color: green;">&#41;</span> <span style="color: green;">&#41;</span>
&nbsp;
searchDirectoryFiles <span style="color: #339933; font-weight: bold;">::</span> FilePath <span style="color: #339933; font-weight: bold;">-&gt;</span> GlobPattern <span style="color: #339933; font-weight: bold;">-&gt;</span> <span style="color: #cccc00; font-weight: bold;">IO</span> <span style="color: green;">&#91;</span>FilePath<span style="color: green;">&#93;</span>
searchDirectoryFiles dir pattern <span style="color: #339933; font-weight: bold;">=</span> find <span style="color: green;">&#40;</span> always <span style="color: green;">&#41;</span> <span style="color: green;">&#40;</span> fileName <span style="color: #339933; font-weight: bold;">~~?</span> pattern <span style="color: green;">&#41;</span> dir <span style="color: #339933; font-weight: bold;">&gt;&gt;=</span> <span style="color: green;">&#40;</span>\d <span style="color: #339933; font-weight: bold;">-&gt;</span>
    recurseSearchFiles dir pattern <span style="color: #339933; font-weight: bold;">&gt;&gt;=</span> <span style="color: green;">&#40;</span>\c <span style="color: #339933; font-weight: bold;">-&gt;</span> <span style="font-weight: bold;">return</span> <span style="color: green;">&#40;</span> d <span style="color: #339933; font-weight: bold;">++</span> c<span style="color: green;">&#41;</span> <span style="color: green;">&#41;</span> <span style="color: green;">&#41;</span>
&nbsp;
recurseSearchFiles <span style="color: #339933; font-weight: bold;">::</span> FilePath <span style="color: #339933; font-weight: bold;">-&gt;</span> <span style="color: #cccc00; font-weight: bold;">String</span> <span style="color: #339933; font-weight: bold;">-&gt;</span> <span style="color: #cccc00; font-weight: bold;">IO</span> <span style="color: green;">&#91;</span>FilePath<span style="color: green;">&#93;</span>
recurseSearchFiles dir pattern <span style="color: #339933; font-weight: bold;">=</span> <span style="color: #06c; font-weight: bold;">do</span>
    conts <span style="color: #339933; font-weight: bold;">&lt;-</span> <span style="color: green;">&#40;</span> getDirectoryContents dir `Er<span style="color: #339933; font-weight: bold;">.</span><span style="font-weight: bold;">catch</span>` <span style="color: green;">&#40;</span>\<span style="color: #339933; font-weight: bold;">_</span> <span style="color: #339933; font-weight: bold;">-&gt;</span> <span style="font-weight: bold;">return</span> <span style="color: green;">&#40;</span><span style="color: green;">&#91;</span><span style="color: green;">&#93;</span><span style="color: green;">&#41;</span> <span style="color: green;">&#41;</span> <span style="color: green;">&#41;</span> <span style="color: #339933; font-weight: bold;">&gt;&gt;=</span> <span style="color: green;">&#40;</span>\c <span style="color: #339933; font-weight: bold;">-&gt;</span>
             filterLinks <span style="color: green;">&#40;</span> <span style="font-weight: bold;">map</span> <span style="color: green;">&#40;</span>\p <span style="color: #339933; font-weight: bold;">-&gt;</span> dir <span style="color: #339933; font-weight: bold;">++</span> <span style="background-color: #3cb371;">&quot;/&quot;</span> <span style="color: #339933; font-weight: bold;">++</span> p<span style="color: green;">&#41;</span> <span style="color: green;">&#40;</span> <span style="font-weight: bold;">filter</span> <span style="color: green;">&#40;</span> <span style="font-weight: bold;">not</span> <span style="color: #339933; font-weight: bold;">.</span> isPrefixOf <span style="background-color: #3cb371;">&quot;.&quot;</span> <span style="color: green;">&#41;</span> <span style="color: green;">&#40;</span> <span style="font-weight: bold;">filter</span> <span style="color: green;">&#40;</span> <span style="font-weight: bold;">not</span> <span style="color: #339933; font-weight: bold;">.</span> isSuffixOf <span style="background-color: #3cb371;">&quot;~&quot;</span> <span style="color: green;">&#41;</span> c <span style="color: green;">&#41;</span> <span style="color: green;">&#41;</span> <span style="color: green;">&#41;</span> <span style="color: green;">&#41;</span>
    dirs <span style="color: #339933; font-weight: bold;">&lt;-</span> filterM doesDirectoryExist conts
    files <span style="color: #339933; font-weight: bold;">&lt;-</span> filterM doesFileExist conts
    matches <span style="color: #339933; font-weight: bold;">&lt;-</span> filterM <span style="color: green;">&#40;</span> checkFile pattern <span style="color: green;">&#41;</span> files
    subR <span style="color: #339933; font-weight: bold;">&lt;-</span> forM dirs <span style="color: #339933; font-weight: bold;">$</span> \d <span style="color: #339933; font-weight: bold;">-&gt;</span> recurseSearchFiles d pattern
    <span style="font-weight: bold;">return</span> <span style="color: green;">&#40;</span> matches <span style="color: #339933; font-weight: bold;">++</span> <span style="color: green;">&#40;</span> <span style="font-weight: bold;">concat</span> subR <span style="color: green;">&#41;</span> <span style="color: green;">&#41;</span></pre></td></tr></table></div>

<p>Basically now how its done is: </p>
<ul>
<li> Using the FileManip functions, get all matching file &#038; directory names below the supplied directory.</li>
<li>Then, get the contents of a directory and filter the trash out of it. Split it into directories &#038; files. Use checkFile to filter out the files containing a String matching the pattern. Recurse into the subdirectories, and carry out these steps on those too.</li>
<li>Concat all these results together, and return them.</li>
</ul>
<p>M</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mickinator.com/wordpress/?feed=rss2&amp;p=87</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Update</title>
		<link>http://www.mickinator.com/wordpress/?p=85</link>
		<comments>http://www.mickinator.com/wordpress/?p=85#comments</comments>
		<pubDate>Sat, 21 Mar 2009 03:46:26 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Haskell File Manager]]></category>
		<category><![CDATA[GHC]]></category>
		<category><![CDATA[Haskell]]></category>

		<guid isPermaLink="false">http://www.mickinator.com/wordpress/?p=85</guid>
		<description><![CDATA[Just a brief update:
I have gotten the tree on the left to expand to the currently viewed directory on refresh. It was tricky enough to get my head around.
Code to follow, along with the code for drag &#8216;n&#8217; drop on the list store.
Now I have to:
Try to fix the search.
Try and make my retrieval methods [...]]]></description>
			<content:encoded><![CDATA[<p>Just a brief update:</p>
<p>I have gotten the tree on the left to expand to the currently viewed directory on refresh. It was tricky enough to get my head around.</p>
<p>Code to follow, along with the code for drag &#8216;n&#8217; drop on the list store.</p>
<p>Now I have to:</p>
<p>Try to fix the search.<br />
Try and make my retrieval methods more generic.<br />
Tidy up a few little pieces here and there.<br />
Add to the documentation.<br />
Maybe implement drag &#8216;n&#8217; drop into the tree on the left?!?</p>
<p>Do a User Manual.<br />
My presentation next week, then I can release it ( I think ).</p>
<p>I&#8217;ve already got webspace over at <a href="http://sourceforge.net">SourceForge</a>.</p>
<p><em>Aside: Found a nice <a href="http://leksah.org/index.html">Haskell IDE</a>, implemented in Haskell, using Gtk2HS.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mickinator.com/wordpress/?feed=rss2&amp;p=85</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>13/2</title>
		<link>http://www.mickinator.com/wordpress/?p=83</link>
		<comments>http://www.mickinator.com/wordpress/?p=83#comments</comments>
		<pubDate>Fri, 13 Mar 2009 12:37:57 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Haskell File Manager]]></category>

		<guid isPermaLink="false">http://www.mickinator.com/wordpress/?p=83</guid>
		<description><![CDATA[Been a few days since I posted here, I&#8217;m not doing much development at the moment, as I am working on my technical specification, and user guide. 
Still to be posted: Drag and drop source, I want to try to reduce this a bit more before it&#8217;s posted!
M
]]></description>
			<content:encoded><![CDATA[<p>Been a few days since I posted here, I&#8217;m not doing much development at the moment, as I am working on my technical specification, and user guide. </p>
<p>Still to be posted: Drag and drop source, I want to try to reduce this a bit more before it&#8217;s posted!</p>
<p>M</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mickinator.com/wordpress/?feed=rss2&amp;p=83</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drag And Drop</title>
		<link>http://www.mickinator.com/wordpress/?p=81</link>
		<comments>http://www.mickinator.com/wordpress/?p=81#comments</comments>
		<pubDate>Mon, 09 Mar 2009 15:06:52 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Haskell File Manager]]></category>
		<category><![CDATA[GHC]]></category>
		<category><![CDATA[Gtk2hs]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[ListStore]]></category>
		<category><![CDATA[listStoreDND]]></category>

		<guid isPermaLink="false">http://www.mickinator.com/wordpress/?p=81</guid>
		<description><![CDATA[I got Drag And Drop working with the File Manager now. To do it I had instead of a normal ListStore declare a ListStoreDND. When declaring a drag&#8217;n'drop listStoreDND, you have to defined you&#8217;re DND functionality there and then, which is quite annoying to be honest. An `onRowDrag` function would be a lot better, and [...]]]></description>
			<content:encoded><![CDATA[<p>I got Drag And Drop working with the File Manager now. To do it I had instead of a normal ListStore declare a ListStoreDND. When declaring a drag&#8217;n'drop listStoreDND, you have to defined you&#8217;re DND functionality there and then, which is quite annoying to be honest. An `onRowDrag` function would be a lot better, and in keeping with the rest of the library and how actions are done. Also, when you are doing a drag, you have to put data into a &#8220;selection&#8221; and in the library documentation I could see functions like &#8220;selectionSetText&#8221;, and &#8220;selectionGetText&#8221;, which looked like they&#8217;d be very useful to me. Denied. You can only put numbers into a selection, and there was one line about this somewhere near the bottom of the library documents. Why have a method like selectionSetText if you can&#8217;t set the text in the selection? Makes no sense at all. Regardless, what I do to get around this is: Feed a 0 or 1 into the selection depending on what store the row is being dragged from. Then feed the selected row&#8217;s index into it. The if the first number in the selection is 0, I know its from the directory store. So I just pop off the text at that index, and then the text from the dropping position, and then do a move with those. Happy days.</p>
<p>Will post code later when I tidy it up.</p>
<p>M</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mickinator.com/wordpress/?feed=rss2&amp;p=81</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Searching, Custom Files &amp; Right Clicking</title>
		<link>http://www.mickinator.com/wordpress/?p=79</link>
		<comments>http://www.mickinator.com/wordpress/?p=79#comments</comments>
		<pubDate>Sun, 08 Mar 2009 15:04:17 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Haskell File Manager]]></category>
		<category><![CDATA[ExitFailure]]></category>
		<category><![CDATA[ExitSuccess]]></category>
		<category><![CDATA[GHC]]></category>
		<category><![CDATA[Gtk2hs]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[ScrolledWindow]]></category>
		<category><![CDATA[System.FilePath]]></category>
		<category><![CDATA[xdg-open]]></category>

		<guid isPermaLink="false">http://www.mickinator.com/wordpress/?p=79</guid>
		<description><![CDATA[I have my search functions working again. The problem was that when Gtk was updated, and I updated my code to this I also changed how FilePath&#8217;s were passed around to the various methods. I did this to only pass around what was necessary, rather than the full paths, and I never reflected this within [...]]]></description>
			<content:encoded><![CDATA[<p>I have my search functions working again. The problem was that when Gtk was updated, and I updated my code to this I also changed how <a href="http://www.haskell.org/ghc/docs/6.6.1/html/libraries/filepath/System-FilePath-Posix.html">FilePath</a>&#8217;s were passed around to the various methods. I did this to only pass around what was necessary, rather than the full paths, and I never reflected this within my search code! Pretty stupid really, but an easy mistake to make. A mistake that also had a domino effect on the methods that search uses!! So when search was fixed, I had to go through the other methods and update those too!</p>
<p>I edited my openFile method so that, it tries to open the supplied file using &#8220;xdg-open&#8221;. If that is successful, it returns <a href="http://www.haskell.org/ghc/docs/6.2.2/html/libraries/base/GHC.IOBase.html#t%3AExitCode">ExitSuccess</a>, and the function exits. However, if it returns any other type of exit, i.e. <a href="http://www.haskell.org/ghc/docs/6.2.2/html/libraries/base/GHC.IOBase.html#t%3AExitCode">ExitFailure Int</a>, it searches a file containg extensions &#038; commands. It searches for the extension of the supplied file. If it&#8217;s found it asks the user for a command to run the file with, i.e. .hs files are opened in gedit. If the command that the user enters is successful, it then writes the extension command combo to the file for future use.</p>
<p>I finally figured out how to do a right-click menu, which is pretty good, the code is 90% identical to the file menu code. Originally, following the example I found, the action had to be added to the overall window, but I found that that didn&#8217;t work. It has to be added to the <a href="http://www.haskell.org/gtk2hs/docs/current/Graphics-UI-Gtk-Scrolling-ScrolledWindow.html">ScrolledWindow</a> that the user will be making selections from. This has a couple of benefits: Different menu&#8217;s for different parts of the screen.</p>
<p>I still have to try to:</p>
<ul>
<li>Implement Drag and Drop.</li>
<li>Expand tree to selected</li>
<li>Now that I have the right-click menu, try renaming within the scrolled window.</li>
</ul>
<p>M</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mickinator.com/wordpress/?feed=rss2&amp;p=79</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
