<?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>luminousmonkey.org</title>
	<atom:link href="http://luminousmonkey.org/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://luminousmonkey.org</link>
	<description>Just me, talking crap</description>
	<lastBuildDate>Wed, 10 Oct 2012 13:30:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>The land of marking</title>
		<link>http://luminousmonkey.org/?p=686</link>
		<comments>http://luminousmonkey.org/?p=686#comments</comments>
		<pubDate>Wed, 10 Oct 2012 13:30:09 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://luminousmonkey.org/?p=686</guid>
		<description><![CDATA[I&#8217;ve come across my lecturer&#8217;s blog! And honestly, I think it&#8217;s a good read (I&#8217;m not trying to get points here, I liked reading though the posts). Anyway, the thing that I&#8217;ve found most interesting are his observations on marking, and I found this little nugget of a graph that he posted. The graph actually [...]]]></description>
				<content:encoded><![CDATA[<div id="attachment_685" class="wp-caption flLeft" style="width: 310px"><a href="http://luminousmonkey.org/wordpress/wp-content/uploads/2012/10/Marking_Graph.jpg"><img class="size-medium wp-image-685" title="Marking Graph" src="http://luminousmonkey.org/wordpress/wp-content/uploads/2012/10/Marking_Graph-300x259.jpg" alt="The land of marking" width="300" height="259" /></a><p class="wp-caption-text">The land of marking</p></div>
<p>I&#8217;ve come across my <a title="Dave's Archives" href="http://davec.org/">lecturer&#8217;s blog</a>!</p>
<p>And honestly, I think it&#8217;s a good read (I&#8217;m not trying to get points here, I liked reading though the posts). Anyway, the thing that I&#8217;ve found most interesting are his <a title="Posts tagged marking." href="http://davec.org/tag/marking/">observations on marking</a>, and I found this little nugget of a graph that he posted. The graph actually does touch on some things that we have talked to some of the 2nd/3rd year students and some of the tutors, that marking student assignments isn&#8217;t always easy.</p>
<p>(Go read Dave&#8217;s posts on marking for the perspective of someone who has to mark/assess/teach students, not now though, finish this first!)</p>
<p>I find it interesting, because as I&#8217;ve mentioned before, I&#8217;ve been <a title="A case of knowing too much?" href=" http://luminousmonkey.org/?p=626">worried about knowing too much</a>, and being &#8220;that guy&#8221;. OK, now if you&#8217;ve gone off and read that post, then there&#8217;s a strong chance you think I&#8217;m a dick. Seriously, I&#8217;m not trying to be a dick, and I certainly don&#8217;t think that I know anything! If I did, then I wouldn&#8217;t be going back to Uni. But, being human, I&#8217;m biased by knowledge I already possess. And I&#8217;ve decided to, hopefully clear up what I actually mean, because, luckily I&#8217;ve got a reference from the other side of the whole teacher/student thing.</p>
<p>A problem that exists in computer science degrees (and I&#8217;m sure other degrees), is what do you teach the students that is relevant to the field they&#8217;re studying. So, for computer science, thinking about problems, breaking them down, the math behind algorithms, data structures, and trying to form good programming habits. Now, you can get a mix of a degree that focuses on a more &#8220;pure&#8221; mathematical/theory type of course and a course that is more &#8220;practical&#8221;.</p>
<h2>Why &#8220;pure&#8221; and &#8220;practical&#8221;?</h2>
<p>Now these are two different thoughts an the same axis. Either approach isn&#8217;t wrong! You can also have a mix between the two. But people who have their own experiences with developing software/computer science have their own opinions. I&#8217;ll just fire off some that I found with a quick Google search:</p>
<ul>
<li><a href="http://www.skorks.com/2008/08/3-things-they-should-have-taught-in-my-computer-science-degree/">3 Things They Should Have Taught In My Computer Science Degree</a></li>
<li><a href="http://blog.jeffreymcmanus.com/1924/more-universities-should-shut-down-their-computer-science-programs/">More Universities Should Shut Down Their Computer Science Programs</a></li>
<li><a href="http://slashdot.org/story/06/11/08/1910248/is-computer-science-still-worth-it">Is Computer Science Still Worth It?</a></li>
<li><a href="http://developers.slashdot.org/story/12/09/12/0048209/is-a-computer-science-degree-worth-getting-anymore">Is A Computer Science Degree Worth Getting Anymore?</a></li>
</ul>
<p>I&#8217;m not using any of those links other than as an example that there&#8217;s a &#8220;pure&#8221; and &#8220;practical&#8221; mindset. I obviously see some value in going to University to study computer science, otherwise I wouldn&#8217;t be going! I would like to get a job in a computer science/programming type role, but I&#8217;ve already got a pretty good job where I can code occasionally, but not as much as I would like. Actually, I even have a three screen setup, only way to fly. Right, sorry, back to my point.</p>
<p>So, &#8220;pure&#8221; and &#8220;practical&#8221;, and this is where having some knowledge bias comes in, because I have my own thoughts on &#8220;the way things should be done&#8221;, but! And I mean BUT! It really isn&#8217;t largely to do with the teaching methods, I obviously have no qualifications on teaching at all. Plus there are just some things that are limited by time and money. However, the content, that&#8217;s where I have some bias. And, now finally bringing it back to the point that the graph made me think about. (Finally!!)</p>
<h2>So your point is?</h2>
<p>Actually, I have two that I really hope to get out in this incoherent ramble, the mindset of the student in regards to marks, and thoughts on things that should maybe be included.</p>
<p>So, marking? The graph is a pretty good indication of this problem (Smartarse Plateau). When working on the exercises, tests, and assignment, as a student you&#8217;re usually interested in getting marks, getting marks means you get to pass the units, which means you get to get out of Uni and out in that wide real world. Without prior knowledge, not so much of a problem, you&#8217;re learning what they&#8217;re teaching and you generally don&#8217;t have you own bias. Ahh, but a little bit of knowledge is a dangerous thing.</p>
<p>The problem is, that for the sake of making marking easier (and encouraging a higher grade), you do some things that wouldn&#8217;t be &#8220;right&#8221; normally. I don&#8217;t think much can be done to really change the situation however. Because it&#8217;s just one of those things, for the sake of being practical you have to make concessions.</p>
<p>I just recently handed in my assignment, I really feel my effort was a bit clunky, I&#8217;m just not an outright brilliant programmer, he&#8217;s a little snippet of me cutting corners:</p>
<pre><code>    <span class="comment-delimiter">// </span><span class="comment">NAME:    equals
</span>    <span class="comment-delimiter">// </span><span class="comment">PURPOSE: To compare two CarPolicy instances for equality.
</span>    <span class="comment-delimiter">// </span><span class="comment">IMPORTS: inCarPolicy - CarPolicy we want to compare to.
</span>    <span class="comment-delimiter">// </span><span class="comment">EXPORT:  boolean, true if they are equal.
</span>
    <span class="c-annotation">@Override</span> <span class="keyword">public</span> <span class="type">boolean</span> <span class="function-name">equals</span>( <span class="type">Object</span> <span class="variable-name">inObj</span> )
    {
        <span class="type">boolean</span> <span class="variable-name">result</span> = <span class="constant">true</span>;

        <span class="comment-delimiter">// </span><span class="comment">Handle if we get handed in null, or completely different
</span>        <span class="comment-delimiter">// </span><span class="comment">classes.
</span>        <span class="keyword">if</span> ( <span class="negation-char">!</span>(inObj <span class="keyword">instanceof</span> TravelPolicy) )
            {
                result = <span class="constant">false</span>;
            }
        <span class="keyword">else</span>
            {
                <span class="type">TravelPolicy</span> <span class="variable-name">testObject</span> = (<span class="type">TravelPolicy</span>) inObj;
                result = testObject.dateString().equals( <span class="keyword">this</span>.dateString() ) &amp;&amp;
                    testObject.policyCountry.equals( <span class="keyword">this</span>.policyCountry );
            }

        <span class="keyword">return</span> result;
    }
</code></pre>
<p>I&#8217;m testing equality of my dates by comparing the strings, rather than using an equals method from the superclass.</p>
<h2>Er, OK, so your second point?</h2>
<p>OK, so my thoughts on what should be touched on for a first semester programming unit? Really, I&#8217;m completely unqualified, I have no degree, I&#8217;ve never worked at a software company, and I haven&#8217;t produced anything. I&#8217;m an armchair software developer, sadly. But, my own opinion?</p>
<p>I don&#8217;t think object orientation should be the first thing that is taught, source control management software should be used, or encouraged, and they probably shouldn&#8217;t be using Java to start with.</p>
<p>OK, it&#8217;s late, and I want to get these thoughts posted, otherwise I&#8217;ll never post it and it will remain in my drafts for eternity. And coming back to these points will be a good excuse for some more posts.</p>
]]></content:encoded>
			<wfw:commentRss>http://luminousmonkey.org/?feed=rss2&#038;p=686</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clojure for Java Development</title>
		<link>http://luminousmonkey.org/?p=660</link>
		<comments>http://luminousmonkey.org/?p=660#comments</comments>
		<pubDate>Fri, 07 Sep 2012 12:24:13 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Clojure]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://luminousmonkey.org/?p=660</guid>
		<description><![CDATA[I&#8217;m just working on my Uni assignment, a program that allows you to show and add some insurance policies. It&#8217;s a test of object orientated principles, so we have different insurance policies that we&#8217;ll have to use inheritance for home, car, and travel. Anyway, I&#8217;m working on getting date parsing and handling of the file [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m just working on my Uni assignment, a program that allows you to show and add some insurance policies. It&#8217;s a test of object orientated principles, so we have different insurance policies that we&#8217;ll have to use inheritance for home, car, and travel.</p>
<p>Anyway, I&#8217;m working on getting date parsing and handling of the file format, and I have an advantage. I have the Clojure REPL.</p>
<p>So, I just have a little bit of a play to understand how it works:</p>
<pre><code><span class="comment-delimiter">;;; </span><span class="comment">Get our Java class for handling dates in.
</span><span class="rainbow-delimiters-depth-1">(</span><span class="builtin">import</span> <span class="preprocessor">java.text.SimpleDateFormat</span><span class="rainbow-delimiters-depth-1">)</span>
<span class="comment-delimiter">;; </span><span class="comment">java.util.SimpleDateFormat
</span>
<span class="rainbow-delimiters-depth-1">(</span><span class="keyword">def</span> <span class="function-name">date-formatter</span> <span class="rainbow-delimiters-depth-2">(</span>new <span class="preprocessor">SimpleDateFormat</span> <span class="string">"yyyyMMdd"</span><span class="rainbow-delimiters-depth-2">)</span><span class="rainbow-delimiters-depth-1">)</span>
<span class="comment-delimiter">;; </span><span class="comment">#'user/date-formatter
</span>
<span class="rainbow-delimiters-depth-1">(</span><span class="preprocessor">.parse</span> date-formatter <span class="string">"20120101"</span><span class="rainbow-delimiters-depth-1">)</span>
<span class="comment-delimiter">;; </span><span class="comment">#inst "2012-12-31T16:00:00.000-00:00"
</span>
<span class="comment-delimiter">;;; </span><span class="comment">I was getting confused why the date was coming up wrong, but then
</span><span class="comment-delimiter">;;; </span><span class="comment">after a bit more playing, trying different Locales, I realised that
</span><span class="comment-delimiter">;;; </span><span class="comment">the date is being stored internally as UTC. When I output to a
</span><span class="comment-delimiter">;;; </span><span class="comment">string:
</span><span class="rainbow-delimiters-depth-1">(</span><span class="preprocessor">.toString</span> <span class="rainbow-delimiters-depth-2">(</span><span class="preprocessor">.parse</span> date-formatter <span class="string">"20111102"</span><span class="rainbow-delimiters-depth-2">)</span><span class="rainbow-delimiters-depth-1">)</span>
<span class="comment-delimiter">;; </span><span class="comment">"Wed Nov 02 00:00:00 WST 2011"
</span>
<span class="comment-delimiter">;;; </span><span class="comment">I get the correct date.
</span></code></pre>
<p>I might have wasted a little time because I was getting tricked at looking at data the wrong way, but I also was getting feedback quickly enough to learn a little bit more than I otherwise would have if I wasn&#8217;t using a REPL.</p>
]]></content:encoded>
			<wfw:commentRss>http://luminousmonkey.org/?feed=rss2&#038;p=660</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Object Oriented Program Design 110 – Workshop 1</title>
		<link>http://luminousmonkey.org/?p=649</link>
		<comments>http://luminousmonkey.org/?p=649#comments</comments>
		<pubDate>Thu, 30 Aug 2012 13:39:29 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Clojure]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://luminousmonkey.org/?p=649</guid>
		<description><![CDATA[I did the first workshop about five weeks ago, and, as usual, I&#8217;ve been slack doing any sort of posting to my blog, so I thought that I would at least do a post now. The first week exercises, are as can be expected, pretty easy. So, I thought I would write a Clojure version [...]]]></description>
				<content:encoded><![CDATA[<p>I did the first workshop about five weeks ago, and, as usual, I&#8217;ve been slack doing any sort of posting to my blog, so I thought that I would at least do a post now.</p>
<p>The first week exercises, are as can be expected, pretty easy. So, I thought I would write a Clojure version as well, for practice, so without further delay.</p>
<pre><code><span class="keyword">import</span> <span class="constant">io</span>.<span class="type">ConsoleInput</span>;

<span class="keyword">class</span> <span class="type">MyFirstApplication</span>
{
    <span class="keyword">public</span> <span class="keyword">static</span> <span class="type">void</span> <span class="function-name">main</span>( <span class="type">String</span>[] <span class="variable-name">args</span> )
    {
        <span class="comment-delimiter">// </span><span class="comment">Read in our integers from the user.
</span>        <span class="type">int</span> <span class="variable-name">integerOne</span> = ConsoleInput.readInt( <span class="string">"Input first integer"</span> );
        <span class="type">int</span> <span class="variable-name">integerTwo</span> = ConsoleInput.readInt( <span class="string">"Input second integer"</span> );

        <span class="comment-delimiter">// </span><span class="comment">Print out the results, one per line.
</span>        System.out.println( <span class="string">"Sum is: "</span> + (integerOne + integerTwo) );
        System.out.println( <span class="string">"Difference is: "</span> +
                            Math.abs( integerOne - integerTwo ) );
        System.exit( 0 );
    }
}</code></pre>
<p>Nothing too hard, just reading in two numbers and returning the difference to the user. They provide the ConsoleInput class, so we don&#8217;t have to worry about any complicated user input stuff.</p>
<p>Here&#8217;s the Clojure version, since it runs on the JVM, I can still use the ConsoleInput class.</p>
<pre><code><span class="rainbow-delimiters-depth-1">(</span><span class="builtin">ns</span> P01.my-first-application
  <span class="rainbow-delimiters-depth-2">(</span><span class="constant">:import</span> <span class="preprocessor">io.ConsoleInput</span><span class="rainbow-delimiters-depth-2">)</span><span class="rainbow-delimiters-depth-1">)</span>

<span class="rainbow-delimiters-depth-1">(</span><span class="keyword">defn</span> <span class="function-name">-main</span>
  <span class="rainbow-delimiters-depth-2">[</span><span class="rainbow-delimiters-depth-2">]</span>
  <span class="comment-delimiter">;; </span><span class="comment">Read in the integers from the user.
</span>  <span class="rainbow-delimiters-depth-2">(</span><span class="builtin">let</span> <span class="rainbow-delimiters-depth-3">[</span>integer-one <span class="rainbow-delimiters-depth-4">(</span><span class="preprocessor">ConsoleInput/readInt</span> <span class="string">"Input the first integer"</span><span class="rainbow-delimiters-depth-4">)</span>
        integer-two <span class="rainbow-delimiters-depth-4">(</span><span class="preprocessor">ConsoleInput/readInt</span> <span class="string">"Input the second integer"</span><span class="rainbow-delimiters-depth-4">)</span><span class="rainbow-delimiters-depth-3">]</span>
    <span class="rainbow-delimiters-depth-3">(</span><span class="variable-name">println</span> <span class="rainbow-delimiters-depth-4">(</span><span class="variable-name">str</span> <span class="string">"Sum is: "</span> <span class="rainbow-delimiters-depth-5">(</span><span class="variable-name">+</span> integer-one integer-two<span class="rainbow-delimiters-depth-5">)</span><span class="rainbow-delimiters-depth-4">)</span><span class="rainbow-delimiters-depth-3">)</span>
    <span class="rainbow-delimiters-depth-3">(</span><span class="variable-name">println</span> <span class="rainbow-delimiters-depth-4">(</span><span class="variable-name">str</span> <span class="string">"Difference is: "</span> <span class="rainbow-delimiters-depth-5">(</span><span class="preprocessor">Math/abs</span> <span class="rainbow-delimiters-depth-6">(</span><span class="variable-name">-</span> integer-one integer-two<span class="rainbow-delimiters-depth-6">)</span><span class="rainbow-delimiters-depth-5">)</span><span class="rainbow-delimiters-depth-4">)</span><span class="rainbow-delimiters-depth-3">)</span><span class="rainbow-delimiters-depth-2">)</span><span class="rainbow-delimiters-depth-1">)</span>
</code></pre>
<p>There&#8217;s nothing really overly significant here between the two versions as the program is so simple.</p>
]]></content:encoded>
			<wfw:commentRss>http://luminousmonkey.org/?feed=rss2&#038;p=649</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A case of knowing too much?</title>
		<link>http://luminousmonkey.org/?p=626</link>
		<comments>http://luminousmonkey.org/?p=626#comments</comments>
		<pubDate>Sun, 15 Jul 2012 13:25:21 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://luminousmonkey.org/?p=626</guid>
		<description><![CDATA[Ok, so, I&#8217;m back at Uni, after a long time. So long that I can&#8217;t claim credit for anything I&#8217;ve done before. However, I haven&#8217;t even started and already I&#8217;m feeling. There just isn&#8217;t a way to say it without sounding like an arrogant prick, overqualified. Of course, this is something I expected. The unit [...]]]></description>
				<content:encoded><![CDATA[<p>Ok, so, I&#8217;m back at Uni, after a long time. So long that I can&#8217;t claim credit for anything I&#8217;ve done before. However, I haven&#8217;t even started and already I&#8217;m feeling. There just isn&#8217;t a way to say it without sounding like an arrogant prick, overqualified. Of course, this is something I expected. The unit that I&#8217;m doing is the ground level programming unit. And it&#8217;s a level that I was expecting, but that&#8217;s not the problem. For example, the first real programming exercise is that we take two numbers from the user, and we provide the sum, and the difference between the numbers. Standard fare for the first week of a programming unit.</p>
<p>No, what has got me, is the very small contact I&#8217;ve had from the unit coordinator. Who I won&#8217;t name, because honestly, I think his heart is in the right place. Not only that, but I&#8217;m basing these thoughts on just the unit material that I&#8217;ve read so far, which isn&#8217;t much. Plus, also, I&#8217;m simply not qualified. I never finished my degree, I&#8217;m the definition of the arm chair expert, I never finished my degree in the first place, plus I&#8217;ve never once actually coded professionally. I&#8217;m kept in touch with programming, and I&#8217;ve got plenty of books on the subject. I&#8217;ve never stopped trying to at least keep an interest in programming. That is, after all, why I decided to go back. Not for any reason such as a career, I feel like I&#8217;m going to end up too old. I&#8217;ll be forty, forty-five years old when I finish.</p>
<p>Anyway, what worries me, and the actual point of this drunken blog post, is that I&#8217;m worried about the state of the computer science course I&#8217;m on. For example, I e-mailed the unit coordinator asking if it was OK if I worked ahead because some of the early stuff was very easy, and I&#8217;m trying to work fulltime at the same time, so I have to try and make the best of the time I have. I also mentioned that I had done the course before, and I had never stopped practicing, playing with Clojure and just touching on OCaml. His reply was poilte, and explained that there wasn&#8217;t any problem, which is fine!</p>
<p>However, he then mentioned that he had never heard of &#8220;Ocami&#8221;, and said that he didn&#8217;t know much about &#8220;Closure&#8221; except that it was a LISP? And here I get to my point (At last I hear you cry), how can the unit coordinator of a computer science course, not know these two languages? Now, I can understand someone working at a company not hearing of these languages, however, I feel that someone who is responsible for trying to teach the craft of software engineering should at least have a very basic knowledge of a shitload of languages. I mean, I&#8217;m not a software professional, but I&#8217;ve heard of them, hell I&#8217;m trying to learn them. How can someone who teaches this not at least know of them, played with them, or even just looked up the Wikipedia article on them?</p>
<p>So, I&#8217;m asking myself, do I know too much? Am I making a bad assumption here?</p>
]]></content:encoded>
			<wfw:commentRss>http://luminousmonkey.org/?feed=rss2&#038;p=626</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Object Oriented Program Design 110 &#8211; Week 1</title>
		<link>http://luminousmonkey.org/?p=622</link>
		<comments>http://luminousmonkey.org/?p=622#comments</comments>
		<pubDate>Thu, 12 Jul 2012 06:17:47 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://luminousmonkey.org/?p=622</guid>
		<description><![CDATA[Well, the unit material has been released, meaning that I can have a look through to get a feel for the unit. A little bit nervous, haven&#8217;t been at Uni for over ten years. However it doesn&#8217;t look like anything overly difficult, at least nothing in the first week. It&#8217;s just basic coverage of working [...]]]></description>
				<content:encoded><![CDATA[<p>Well, the unit material has been released, meaning that I can have a look through to get a feel for the unit. A little bit nervous, haven&#8217;t been at Uni for over ten years. However it doesn&#8217;t look like anything overly difficult, at least nothing in the first week. It&#8217;s just basic coverage of working with UNIX, changing directories and the idea of programming. So I&#8217;m just going to break it up into sections.</p>
<h3>Worksheet</h3>
<p>OK, this is just basic stuff, for example, logging into UNIX (I&#8217;m not too sure what *nix they&#8217;re running yet until I log on), opening up Firefox (so I assume it&#8217;s going to be Linux, just a hunch though), and setting the home page. There&#8217;s a few other miscellaneous things, nothing interesting. There&#8217;s also a bit about setting up the directory structure for the unit. I remember this from when I was attending years ago, they pull the program source code, etc, from your home directory so they expect it to be laid out in a specific way.</p>
<p>This is a chance for me to try and learn something I don&#8217;t know. Creating directories is easy enough, &#8220;mkdir&#8221;, however, you&#8217;re also supposed to have a series of directories inside the ST151 directory. P01, P02, P03&#8230; So, I thought I could try something different. Now, I did look it up, and (under Linux at least) you can create sub-directories in the one mkdir command as follows:</p>
<p><code>mkdir -pv ST151/{P01,P02,P03,P04,P05,P06,P07,P08,P09,P10}</code></p>
<p>So I&#8217;m wondering if there&#8217;s a way to do this nicely? I just did a quick look (ahhh Wikipedia, you were never around in my day), and the {} bit isn&#8217;t even something that mkdir does. I like learning stuff, and behold, I very quickly found <a href="http://scrolls.mafgani.net/2006/07/creating-directory-hierarchies-in-bash/">Creating directory hierarchies in Bash</a>. Brilliant! This is something that Bash does, so in theory it should just work under Solaris too.</p>
<p>So now, the command becomes:</p>
<p><code>mkdir -p ST151/P{01..10}</code></p>
<p>And it works! (I had to drop the -v, Solaris mkdir complains about it)</p>
]]></content:encoded>
			<wfw:commentRss>http://luminousmonkey.org/?feed=rss2&#038;p=622</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What problem is ORM trying to solve?</title>
		<link>http://luminousmonkey.org/?p=455</link>
		<comments>http://luminousmonkey.org/?p=455#comments</comments>
		<pubDate>Mon, 21 May 2012 04:10:04 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://luminousmonkey.org/?p=455</guid>
		<description><![CDATA[This isn&#8217;t going to be a rant about ORM, more of a statement of my own problem I&#8217;m trying to solve. With the internal work sales application that I develop, I have the problem of not being able to specify business logic in one place. It seems to be a general rule with ORM systems [...]]]></description>
				<content:encoded><![CDATA[<p>This isn&#8217;t going to be a rant about ORM, more of a statement of my own problem I&#8217;m trying to solve. With the internal work sales application that I develop, I have the problem of not being able to specify business logic in one place. It seems to be a general rule with ORM systems (at least with my very small experience with Rails), that business logic all goes in the ORM layer.</p>
<pre><code><span class="keyword">class</span> <span class="type">PurchaseOrder</span> &lt; <span class="type">ActiveRecord</span>::<span class="type">Base</span>
  include <span class="type">Shared</span>::<span class="type">TracksSerialNumberExtension</span>

  order_lines             <span class="constant">:received</span>

  validates_presence_of   <span class="constant">:supplier</span>, <span class="constant">:despatch_by</span>
  validates_inclusion_of  <span class="constant">:ongoing</span>, <span class="constant">:in</span> =&gt; [<span class="variable-name">true</span>, <span class="variable-name">false</span>]
  validates_date          <span class="constant">:created_at</span>

  owned_by                <span class="constant">:supplier</span>
  add_filter              <span class="constant">:ongoing</span>

  tracks_serial_numbers   <span class="constant">:items</span>

  sendable  <span class="constant">:supplier</span>

  attr_accessor <span class="constant">:force_create</span>     <span class="comment-delimiter"># </span><span class="comment">This is if the user wants to create a new
</span>                                  <span class="comment-delimiter"># </span><span class="comment">order, even though an ongoing order may
</span>                                  <span class="comment-delimiter"># </span><span class="comment">exist.
</span>
  validate_on_create <span class="constant">:check_for_ongoing</span>
  validate_on_update <span class="constant">:ongoing_set_on_create_only</span>

  <span class="keyword">def</span> <span class="function-name">initialize</span>( params = <span class="variable-name">nil</span> )
    <span class="keyword">super</span>
    <span class="variable-name">self</span>.created_at   ||= <span class="type">Time</span>.now.to_date
    <span class="variable-name">self</span>.ongoing      ||= <span class="variable-name">false</span>
    <span class="variable-name">self</span>.despatch_by  ||= <span class="string">'Most Economical'</span>
    <span class="variable-name">self</span>.force_create ||= <span class="variable-name">false</span>
  <span class="keyword">end</span>
...</code></pre>
<p>This is pretty typical in Rails, and after all the model object needs to know these sorts of things so it knows how it&#8217;s all supposed to fit together. That&#8217;s fine. The problem is when you do what I like to do, and actually use the database as, well, a database.</p>
<p>It&#8217;s the job of the database to enforce data integrity, this includes things like making sure invalid data doesn&#8217;t get in. So those &#8220;validates_&#8221; bits, they also need to go in the database, not only that, but if you want to have a nice interface that shouldn&#8217;t piss off your users, you need those validates in your UI code as well.</p>
<p>So, the problem should be apparent, three separate layers need to follow the same rules, clearly a violation of DRY. That&#8217;s the problem, each layer needs to know the business rules and to do their bit to follow those rules. The UI needs to give the user feedback as quickly as possible about any errors, the application layer needs to know how everything fits together, and the database needs to make sure that the data is correct <strong>completely independently from the other layers</strong>.</p>
<p>So, we need a way to have business logic in a way that all three layers can use, in one place to make updates easy and as error free as possible. ORM doesn&#8217;t do that, I want something that does. I want to be able to define my business logic in one place, and to have it taken care of across all three layers.</p>
<p>Of course it has to be flexible enough that you can override anything you need to, otherwise you end up stuck in a framework like Rails and ActiveRecord and it becomes a pain to do anything outside of that.</p>
]]></content:encoded>
			<wfw:commentRss>http://luminousmonkey.org/?feed=rss2&#038;p=455</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The deal with ORM</title>
		<link>http://luminousmonkey.org/?p=680</link>
		<comments>http://luminousmonkey.org/?p=680#comments</comments>
		<pubDate>Mon, 21 May 2012 01:37:58 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://luminousmonkey.org/?p=680</guid>
		<description><![CDATA[I&#8217;ve been reading lately, and by lately I mean my very long back log of Reddit. That there seems to be a few noises being made about ORM, and I thought I better just write a little note to myself in the form of this blog post. Fuck ORM. Except for the case where you&#8217;re [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been reading lately, and by lately I mean my very long back log of Reddit. That there seems to be a few noises being made about ORM, and I thought I better just write a little note to myself in the form of this blog post.</p>
<p>Fuck ORM.</p>
<p>Except for the case where you&#8217;re writing a small, quick, throwaway program, in which case you should then admit that in most cases no such thing exists and you should be writing it properly. ORM is just a bad idea, ORM is just a case of programmers wanting to fit something into an easier way for them to handle databases. Isn&#8217;t that something that we should be doing anyway? We do it all the time. Yes, but, and you knew a but was coming. The correct abstractions should be applied, and showhorning an object model onto something that is relational data is going to be a problem.</p>
<p>Learn SQL, fuck it, pick a database and learn to use that. Use triggers, don&#8217;t use the database as a dumbstore!</p>
<p>Obviously, this post is all opinion and no substance, but I&#8217;m going to see about coming back and fixing it later on, I have to work.</p>
]]></content:encoded>
			<wfw:commentRss>http://luminousmonkey.org/?feed=rss2&#038;p=680</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
