tag:blogger.com,1999:blog-344743832024-03-05T04:55:09.052+00:00A Fading TanProgrammers should get out more.Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comBlogger22125tag:blogger.com,1999:blog-34474383.post-69587924525868744322011-12-06T19:38:00.001+00:002011-12-06T19:51:06.653+00:00Right, blow this, I'm off...This will be A Fading Tan's last post on Blogger. Basically I've had it. Blogger is shit.<br />
<br />
I've been keeping the blog here — and letting enthusiasm whither — for the worst of all possible reasons: a single post had decent SEO standing.<br />
<br />
<internal dialogue=""></internal><br />
— I think that means a single post was any good.<br />
— Too harsh. A couple of other posts did help people.<br />
<br />
<br />
Anyhow, I can't be wasting energy on a platform I'm not interested in. I'm moving to a simple weblog generator called <a href="http://pelican.readthedocs.org/en/2.7.2/index.html">Pelican</a>. I will be <a href="https://github.com/carltongibson/pelican">contributing on GitHub</a>.<br />
<br />
A Fading Tan's animus will continue on <a href="http://noumenal.co.uk/">noumenal.co.uk</a>. In the meantime there's <a href="http://twitter.com/carltongibson">Twitter</a>.Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-1324429146727183742011-12-01T15:51:00.001+00:002011-12-01T16:01:26.775+00:00Metaphorically, this is me:<br />
<br />
<div class="youtube5container" style="height: 315px; width: 420px;">
<div class="youtube5player youtube5waiting" style="background-attachment: initial; background-clip: initial; background-color: black; background-image: url(https://i4.ytimg.com/vi/7nS_aR8XX_U/hqdefault.jpg); background-origin: initial; background-position: 50% 50%; background-repeat: no-repeat no-repeat; background-size: 100%; height: 315px; width: 420px;">
<video height="315" preload="none" src="http://o-o.preferred.mad01s04.v22.lscache4.c.youtube.com/videoplayback?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Csource%2Cratebypass%2Ccp&fexp=904540%2C913100%2C913601&itag=18&ip=87.0.0.0&signature=8F1AC4DE7C1345CBDE470FB3B3113A95B8A186DE.CBFDFD66BE3D82DC951803C6450F78A9438ED7BA&sver=3&ratebypass=yes&source=youtube&expire=1322775498&key=yt1&ipbits=8&cp=U0hRR1dSU19OUkNOMV9PTFdFOmpFam1xbkVSX0lh&id=ee74bf691f175ff5" width="420"></video><br />
<div class="youtube5top-overlay">
</div>
<div class="youtube5bottom-overlay">
</div>
<div class="youtube5info">
<div class="youtube5use-original youtube5show-on-waiting">
↵ Use original player</div>
<div class="youtube5title youtube5show-on-waiting">
<a href="https://www.youtube.com/watch?v=7nS_aR8XX_U">Worlds biggest wave ever surfed</a></div>
<div class="youtube5author youtube5show-on-waiting">
By <a href="https://www.youtube.com/user/queensarah123">queensarah123</a></div>
<div class="youtube5formats">
<div class="youtube5from">
YouTube</div>
<ul>
<li class="youtube5current-format"><a href="http://o-o.preferred.mad01s04.v22.lscache4.c.youtube.com/videoplayback?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Csource%2Cratebypass%2Ccp&fexp=904540%2C913100%2C913601&itag=18&ip=87.0.0.0&signature=8F1AC4DE7C1345CBDE470FB3B3113A95B8A186DE.CBFDFD66BE3D82DC951803C6450F78A9438ED7BA&sver=3&ratebypass=yes&source=youtube&expire=1322775498&key=yt1&ipbits=8&cp=U0hRR1dSU19OUkNOMV9PTFdFOmpFam1xbkVSX0lh&id=ee74bf691f175ff5">360p</a></li>
<li><a href="http://o-o.preferred.mad01s04.v2.lscache2.c.youtube.com/videoplayback?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Csource%2Calgorithm%2Cburst%2Cfactor%2Ccp&fexp=904540%2C913100%2C913601&algorithm=throttle-factor&itag=5&ip=87.0.0.0&burst=40&sver=3&signature=BA4EA475F513AE6DBAF4262C6B8613DCC93FE91B.1EDDB85BCCC84FBEB2D35568B2C9E209B956F793&source=youtube&expire=1322775498&key=yt1&ipbits=8&factor=1.25&cp=U0hRR1dSU19OUkNOMV9PTFdFOmpFam1xbkVSX0lh&id=ee74bf691f175ff5">240p FLV</a></li>
</ul>
</div>
<div class="youtube5replay">
← Replay</div>
<div class="youtube5close-overlay">
X</div>
</div>
<div class="youtube5info-button">
i</div>
</div>
</div>
<br />
If you're a software developer, then it's you too.<br />
<br />
Technology moves forward like a giant wave. There is so much to learn that we must paddle like crazy (or get a tow!) just to get on the wave. Then we must work like crazy to <b>stay</b> on it.<br />
<br />
With luck we won't fall off.<br />
<br />
<br />
[UPDATE: Hmmm. The YouTube Embed doesn't seem to be working. Not sure why they put it there if it's not going to do anything. Anyhow, the video is only short if you've got 2 minutes whilst your build runs.]Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-14833732572187762622011-08-15T19:46:00.004+01:002011-08-15T20:28:47.189+01:00Okay, finally done it<p>Despite the sparsity of posts, I've had this blog since the Dark Ages. It had a really old template that I'd hacked around so much that I couldn't upgrade it, to use all of Blogger's great new features.</p>
<p>It also looked shit. Pro tip: don't edit a Douglas Bowman template, just use it.</p>
<p>Anyway, I finally chucked away the old edits and started afresh.</p>Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-34797268950156357322011-04-07T08:14:00.001+01:002011-04-07T08:14:04.351+01:00Cloning Beanstalk Repositories<p>I use Beanstalk for private git (and svn) hosting. I must say it's great, but I always forget to use the SSH Config name rather than the full hostname when trying to clone repositories for the first time. </p>
<p>Note to self: it's...</p>
<pre> $ git clone git@beanstalk:/repo.git
</pre>
!Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-33592099883006390392011-01-04T14:54:00.001+00:002011-08-16T08:42:34.879+01:00A Totally Barebones Guide to Getting Started with Git on a Mac<p><strong>Disclaimer</strong>: This is a type first and work it out later guide created specifically to allow me to get collaborators started quickly. If you actually need to know about Git, <a href="http://git-scm.com/documentation">check out the documentation</a>! (You could do worse than Travis Swicegood's book, <a href="http://www.amazon.co.uk/gp/product/1934356158?ie=UTF8&tag=noumenal-21&linkCode=as2&camp=1634&creative=19450&creativeASIN=1934356158">Pragmatic Version Control Using Git</a>.)</p><h4>Preamble</h4><p>Git is a version control system. (It's software.) It allows you to track the history of the project you're working on. In essence you store each and every change made to any of the project components. With this you are able to recreate the state that the project was in at any point in its development. It's easier to use than it sounds.</p><p>Using SOME kind of version control is vital. Absolutely guaranteed, you will repeatedly need to undo some balls-up or other, and without version control you are pretty much stymied. Using version control also aides in collaboration, our current endeavour.</p><p>Bottom line: always use version control.</p><p>At Noumenal we primarily use Git. The (main) other versions control systems you'll hear about are Mercurial and Subversion. (There are others.) It doesn't really matter which you use. Git and Mercurial are newfangled "distributed" version control systems. This doesn't matter either.</p><h4>Installing & Configuring Git</h4><p>First visit the <a href="http://code.google.com/p/git-osx-installer/" target="_blank">OS X installer downloads page on Google Code</a>. Click the "Download the packages here" link right below the Git logo.</p><p>Assuming you're running Snow Leopard, OS X 10.6 or greater, you'll need the .dmg file with the <code>x86_64</code> in the name. (This is the 64 bit version for the Intel processor based Macs, which yours is.) Versions change but the latest as I write is <code>git-1.7.3.3-x86_64-leopard.dmg</code>. Download this. Run the installer.</p><p>Now you'll need to open the Terminal application. (Welcome to my world.) Click on Spotlight (or hit command-space) and type 'terminal' to bring up the application. (It lives in <code>/Applications/Utilities</code> if you're concerned.) Once it comes up you can check that everything went to plan:</p><pre>
$ <strong>git --version</strong>
git version 1.7.3.3
</pre><p>The '$' is your prompt. This is configurable so it might be different. [What is the default bash prompt on OS X?] You type the suff in bold, exactly as is. You get the output below.</p><p>As a final step you just need to tell Git who you are and what your email address is. We're also going to set one other flag as you may not come this way again for a while:</p><pre>
$ <strong>git config --global user.name "Carlton Gibson"</strong>
$ <strong>git config --global user.email "support@noumenal.co.uk"</strong>
$ <strong>git config --global color.ui "auto"</strong></pre><p>Obviously put your own details in here.</p><p>One initially disturbing thing with the UNIX command line is that successful commands very often have no output. This is a virtue but it can take some getting used to. So how do we know our configuration commands worked?<?p><pre>
$ <strong>git config --global --list</strong>
user.name=Carlton Gibson
user.email=support@noumenal.co.uk
color.ui=auto
</pre><p>You're done.</p>Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-35785537492805373402010-12-21T09:13:00.001+00:002010-12-21T09:13:42.433+00:00Installing PIL on the Mac<p>Just a quick note, to remind myself mainly.</p><p>Installing the Python Image Library (PIL) on a Mac requires libjpeg if it’s going to be of any use.</p><p>So, assuming you’re using Homebrew and Pip…</p><pre><code>$ brew install libjpeg
$ pip install PIL
</code></pre><p>Simples.</p>
Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-2482661294553282332010-10-14T16:14:00.001+01:002010-10-14T16:14:12.341+01:00jQuery Clippings for BBEdit updated to version 1.4.3<p>A little ahead of the gun, I’ve updated the <a href="http://noumenal.co.uk/bbedit/jquery-clippings">jQuery Clippings for BBEdit</a> to version 1.4.3, which <em>should</em> be out this weekend.</p><p>These cover the full API for the latest jQuery version (1.4.3) matching all function signature variations and dollar shortcuts.</p><p>Grab them from: <a href="http://noumenal.co.uk/bbedit/jquery-clippings">http://noumenal.co.uk/bbedit/jquery-clippings</a>.</p><p>Enjoy.</p>
Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-57530397737689848552010-10-01T14:41:00.001+01:002010-10-01T14:43:19.067+01:00Web Design in the Autumn of 2010<p>I’m excited about the latest crop of web browser—the diverse mobile ones in particular—and HTML5 and CSS3, and the other <em>new</em> techs that go with them. </p><p>I’ve been avoiding the work of a <em>designer</em> for a while now…</p><p>When I first discovered HTML—which must have been about 2003/2004—the standards movement was young and fresh. To give you an idea, the <a href="http://www.csszengarden.com/">CSS Zen Garden</a> was the hot pin-up of the moment. Before I heard the message I’d gone through a book on using Dreamweaver MX which was all tables and spacer-gifs. You can imagine, CSS was, for the beginner, clear and simple; both powerful and obvious. Progress was fast.</p><p>But of course, after that first flush, CSS didn’t quite live up to its promise. The path beyond those early successes soon led into a landscape of image heavy—and Flash heavy—delicate—and brittle—designs. (That was just the reality of professional web design.) </p><p>The need to engage with these techniques has always put me off. There have always been more rewarding, to my mind purer, pursuits in the realm of the <em>developer</em>. (This is of course a long-winded excuse for never pushing my skills here beyond the basic.) But I think this may be the case no longer. </p><p>As I see it, beyond the subjective feeling that I’ve finally got some sort of grasp on all the other stuff, the reasons for this change in circumstance are two: </p><ol><li><p>The technology has moved on such that the (aforementioned) new bunch eliminate the need for most of the distasteful <em>extras</em>.</p></li><li><p>The rapid rise of the mobile web has (finally, thank God) made it socially acceptable to adopt—<strong>in practice</strong>—the policy of reserving nothing more for users of outdated versions of Internet Explorer than The Finger.</p></li></ol><p>I’ve been far too busy for it to be true to say that, this is what I’ve been waiting for. These are interesting times indeed.</p>
Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-87007697807906895462010-06-25T13:31:00.001+01:002010-06-25T13:32:47.144+01:00Format string is not a string literal (potentially insecure)<p>I love compilers.</p>
<p>Here I am busily working away; I throw in a cheeky <code>NSLog()</code> to see where I've got to:</p>
<pre><code>NSLog([myObject stringRepresentation]);
</code></pre>
<p>Hang on! A compiler warning:</p>
<blockquote>
<p>Format string is not a string literal (potentially insecure)</p>
</blockquote>
<p>What's this about?</p>
<p>A bit of Google (via this <a href="http://www.idevgames.com/forum/showthread.php?t=18183">forum post</a>)
led me to a <a href="http://en.wikipedia.org/wiki/Format%5Fstring%5Fvulnerabilities">Wikipedia article on the <em>Format string attack</em></a>. It turns out that an attacker might use <code>printf</code> style format specifiers to do all sorts of nasty to my heap/stack.</p>
<p>The correct usage is this:</p>
<pre><code>NSLog(@"%@", [myObject stringRepresentation]);
</code></pre>
<p>No more warning. We can sleep at night.</p>
Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-70103620889933187332010-03-30T09:09:00.001+01:002010-03-30T09:09:07.541+01:00Someone Needs to Take Econ 101<p>"Douglas A. McIntyre says that because iPad demand is higher than expected, Apple may have to cut prices. <a href="http://en.wikipedia.org/wiki/Supply_and_demand">Uh…</a>" (John Gruber)</p>
<p>(Via <a href="http://daringfireball.net/linked/2010/03/29/econ101">Daring Fireball</a>.)</p>Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-26780944914250148812010-03-16T10:02:00.001+00:002010-03-16T10:23:38.450+00:00jQuery Clippings for BBEditOn Friday I uploaded a set of <a href="http://noumenal.co.uk/bbedit/jquery-clippings">jQuery Clippings for BBEdit</a>.
These cover the full API for the latest jQuery version (1.4.2) matching all function signature variations and dollar shortcuts.
Grab them from: <a href="http://noumenal.co.uk/bbedit/jquery-clippings">http://noumenal.co.uk/bbedit/jquery-clippings</a>.
Enjoy.Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-22295072546272629492010-03-12T09:36:00.001+00:002010-03-12T09:38:58.938+00:00Rob Foster on the Elimination of File Systems as a User-Accessible Part<p>I saw this:</p>
<p><a href="http://nimbledesign.com/post/441423115/the-path-of-most-resistance">Rob Foster on the Elimination of File Systems as a User-Accessible Part</a>: “<p>Rob Foster, observing how family and friends use their Macs:</p>
<blockquote>
<p>Because they can now actually <em>use</em> their computers instead of
simply restarting them, I’m able to better see <em>how</em> they use
them. And the one commonality I’ve seen is that no one knows how
to use the file system.</p>
<p>Unfortunately for the average person, the file system is so
complex that everything outside of the desktop and the documents
folder appears to be a vast labyrinth which most likely hides
booby traps and minotaurs.</p>
</blockquote>
</p>
<p>(Via <a href="http://daringfireball.net/linked/2010/03/11/foster">Daring Fireball</a>.)</p>
<p>The same experience seems to apply in ever wider circles too:</p>
<ul>
<li>Beyond the Desktop, there’s everything outside the Home folder.</li>
<li>Beyond that there’s all the UNIXy bits that OS X nicely hides from us (dot-files, <code>/etc</code>, <code>/usr</code>, <code>/bin</code> etc.)</li>
<li>Leaving the Mac there’s Linux’s whole <code>/proc</code> file system.</li>
<li>And so on.</li>
</ul>
<p>Each time there’s the same, “What’s going on here?” — which, if you are ever to get past the Desktop, is quickly followed by a deep breath and a rummage.</p>
<p>Of course there’s the whole Windows thing, which is a different kettle of fish but, does the ultimate answer lie in building your own <a href="http://www.linuxfromscratch.org/">Linux From Scratch</a>, or is it “<a href="http://en.wikipedia.org/wiki/Turtles_all_the_way_down">Turtles all the way down</a>”?</p>
Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-3449037161107350312009-11-05T15:35:00.001+00:002009-11-05T15:36:17.353+00:00Zend Framework Ctags for BBEdit<p>BBEdit version 9.3 was released yesterday. Many changes but, it includes extensively revised support for PHP.</p>
<p>Best of all specially formatted Ctags files can now be used to provide function signature auto-complete, similar to that from clippings.</p>
<p>As such I've knocked up a <a href="http://noumenal.co.uk/resources/downloads">version for Zend Framework, which can grab it from the downloads page</a>.</p>
<p>As it says there, this is a one afternoon, first draft so make sure you subscribe to the RSS for updates. Let me know if you have any issues. </p>
<p>(Know problems are a lack of reference back to source file and line number, but I'll get that fixed asap.)</p>
<p>Enjoy.</p>
Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-70750086174041055782009-10-21T20:26:00.001+01:002009-11-05T15:27:35.925+00:00Frequent Bugs<p>Supposedly keeping a log of bugs helps you identify the most common ones. At the moment mine is forgetting to save my nib file before building my application.</p>
<p>("Why isn't this working?")</p>Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-15523383075126300882009-09-15T12:10:00.001+01:002009-09-15T12:10:29.874+01:00BBEdit Zend Framework Clippings Updated<p>I’ve just uploaded the latest version of the Zend Framwork Clipping set for BBEdit. As usual you can grab this from the <a href="http://noumenal.co.uk/resources/downloads">downloads page</a>.</p>
<h4>Changes in this release</h4>
<ol>
<li><p>Added the class to the clipping name to disambiguate duplicate method names. (Picture <code>__construct</code> 1000 times.)</p>
<p>Since BBEdit doesn’t allow whitespace in autocomplete suggestions, I’ve used a double-star <code>**</code> as the divider between method and class name. This I hope is clear enough visually, but please let me know what you think.</p></li>
<li><p>Added parameter and return type hints to the clippings in line with the conventions of Ted’s original PHP clippings. (The return value is selected upon clipping insertion so a quick delete will get rid of it; its purpose is currently just as an <em>aide memoir</em> but I hope to leverage it further later.)</p></li>
</ol>
<p>Barring any major issues, this will be the final <em>Beta</em> of the BBEdit Zend Framework Clippings. They are just missing clippings for the <code>Zend_Search_Lucene</code> and <code>Zend_Soap</code> namespaces, which require <em>ad hoc</em> work-arounds. After that they will follow the Zend Framework release schedule.</p>
Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-75664882427789180692009-08-20T14:28:00.001+01:002009-09-15T12:12:01.658+01:00Beta 1 of Zend Framework Clippings for BBEdit Released<p><strong>Update:</strong> the <a href="http://blog.noumenal.co.uk/2009/09/bbedit-zend-framework-clippings-updated.html">BBEdit Zend Framework Clippings have been updated</a>.</p>
<p>We've just uploaded the first beta of our new Zend Framework Clipping set for
BBEdit. </p>
<p>You can grab it from the <a href="http://noumenal.co.uk/resources/downloads">downloads page</a>. </p>
<p>The set currently covers 99%+ of the Zend Framework's methods, but we're
aiming for 100%. After that we'll be following Zend Framework releases. (<a href="http://eepurl.com/b43Q">Updates via the newsletter</a>.)</p>
<p>As per usual, bugs via the <a href="http://noumenal.co.uk/contact">contact
page</a>, questions/suggestions welcome on the <a href="https://noumenal.fogbugz.com/default.asp?noumenal">discussion board</a>.</p>
Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-72220564294049664772009-08-14T14:53:00.001+01:002012-02-13T15:33:00.074+00:00Using Zend Framework's FlashMessenger Action HelperWe often want to provide users feedback from their actions. Zend Framework
includes the FlashMessenger Action Helper for this purpose. <br />
A gentle trickle of questions appear on the Zend Framework mailing lists
concerning the exact usage of the FlashMessenger, so I'm going to go over the
details here. Hopefully we'll get all those Zend Framework FlashMessenger
questions answered.<br />
We will also introduce the Noumenal PHP Library's FlashMessenger View Helper.
This encapsulates retrieving flash messages and adds the option to send
different <em>levels</em> of message (e.g. "notice", "warning", "error").<br />
The Noumenal
PHP Library is available on <a href="https://github.com/carltongibson/Noumenal-PHP-Library">GitHub</a>.<br /><br />
<h4>
Overview of the FlashMessenger</h4>
Zend Framework's FlashMessenger Action Helper is meant to allow immediate
feedback on the status of a user's actions: "Your profile was updated", "Your
message was sent", "Your junk mail has been deleted".<br />
Here's an example of the sort of thing from Google's Gmail:<br />
<img alt="Example of a FlashMessenger
style message from Google's Gmail" src="http://noumenal.co.uk/img/blog/gmail_flashmessage.png" title="A
FlashMessenger style update in Google's Gmail" /><br />
Basic usage of the FlashMessenger couldn't be simpler. In your action
controller, you set messages via the <code>addMessage()</code> method:<br />
<pre><code>$flashMessenger = $this->_helper->FlashMessenger;
$flashMessenger->addMessage('We did something in the last request');
</code></pre>
or via its proxy, the FlashMessenger's <code>direct()</code>:<br />
<pre><code>$this->_helper->FlashMessenger('Message stored until needed');
</code></pre>
(<a href="http://framework.zend.com/manual/en/zend.controller.actionhelpers.html">
Action helpers can each define their own <code>direct()</code> as a short cut to their core
functionality</a>.)<br />
Under normal circumstances you'd collect any messages when you want to display
them:<br />
<pre><code>//Collect array of messages for display.
$aMessages = $this->_helper->FlashMessenger->getMessages();
</code></pre>
And that is all there is to it. Your user performs some action, e.g. sending
their message; you redirect them somewhere sensible and let them know it was
successful.<br />
Note, however, the "Under normal circumstances". There are a couple of <em>wiggles</em>
that can catch you out. We'll go over these as way of introduction to the
Noumenal PHP Library's FlashMessenger View Helper, which handles these.<br />
<h4>
Messages are stored until the FlashMessenger is next instantiated</h4>
The FlashMessenger stores its messages in a Zend_Session namespace. The data in
that namespace is collected each time the FlashMessenger is instantiated (i.e.
in the constructor). The data in the namespace is also cleared (via <code>unset()</code>)
at the same time. This can cause problems for people when they wish to add an
extra action in between setting the messages and retrieving them. If on the
extra request they accidently instantiate the FlashMessenger whilst not wanting
to collect the messages then they find that they are not there when they do want
them later.<br />
The rule here is simple. Contrary to the <a href="http://framework.zend.com/manual/en/zend.controller.actionhelpers.html#zend.controller.actionhelpers.flashmessenger">bad example in the
documentation</a>, which assigns the FlashMessenger to an instance variable in
the controller's <code>init()</code>, <strong>do not get a reference to the FlashMessenger until
you actually need it</strong>.<br />
<h4>
There's also a getCurrentMessages() Method</h4>
Sometimes we want to send users a message not for the next request but for the
current one. The obvious example of this is a failed form validation. Here we
output the form with error messages and ask the user to resubmit. Zend_Form has
Decorators specifically for displaying form and element level errors, but beyond
this it's good on the consistency front to send a message via the normal
messaging channel to let the users know that there was a problem.<br />
Calling the regular <code>getMessages()</code> method here won't work. This only returns
messages which were stored in the appropriate Zend<em>Session namespace when the
FlashMessenger was instantiated. Since any messages added this request were not
in the Zend</em>Session namespace at that time (because the FlashMessenger was
instantiated <em>in order</em> to add the messages) they won't be returned by
<code>getMessages()</code>.<br />
For just this use-case, the FlashMessenger also provides a
<code>getCurrentMessages()</code> method (and a related family of <em>current</em> methods) which
returns those messages set on the current request.<br />
<h4>
The Noumenal PHP Library's FlashMessenger View Helper</h4>
The FlashMessenger View Helper encapsulates the message retrieval side of our interactions with the Zend Framework's FlashMessenger Action Helper. It checks for messages from both previous requests and the current request, so it satisfies our use-case from above. It also interprets key-value pairs, rather than a simple strings, passed to the FlashMessenger as specifying a message-level.<br />
<h5>
Setting up the View Helper</h5>
The first thing to do is to add the call to echo the FlashMessenger View Helper to your layout script, say above the main content:<br />
<pre><code><html>
<head></head>
<body>
<div id="hd">
<!-- Header -->
</div>
<div id="bd">
<div>
<!-- Main Content -->
<?php echo $this->flashMessenger(); ?>
<?php echo $this->layout()->content; ?>
</div>
<div>
<!-- Sidebar -->
</div>
</div>
<div id="ft">
<!-- Footer -->
</div>
</body>
</html>
</code></pre>
Since the layout script is rendered so late in the dispatch process, putting the call the the FlashMessenger View Helper here eliminates most of the risk that you'll accidently instantiate the FlashMessenger Action Helper when you don't
mean to. (Of course this is still possible but if you're going out of your way to instantiate it then we can assume that you'll know to handle any messages that still need to be displayed.)<br />
<h5>
Adding Messages (with levels) to the FlashMessenger</h5>
Adding messages to the FlashMessenger proceeds via the HelperBroker unchanged. Add simple string messages as you normally would:<br />
<pre><code>$this->_helper->FlashMessenger('Your message was sent.');
</code></pre>
If you want to specify a message-level pass a key-value pair instead:<br />
<pre><code>$this->_helper->FlashMessenger(
array('error' => 'There was a problem with your form submission.')
);
</code></pre>
By default, the FlashMessenger View Helper will render the message within a <code>p</code> tag with a class attribute of the message-level key.<br />
<h5>
Advanced Options to the FlashMessenger View Helper</h5>
You can specify the default message-level by passing a string value as the first parameter to <code>flashMessenger()</code>. The default message-level is <code>'warning'</code>. To change this to <code>'notice'</code>, in your layout do:<br />
<pre><code><?php echo $this->flashMessenger('notice'); ?>
</code></pre>
This applies to simple string messages only. If key-value pairs are passed to the FlashMessenger, any message-level key will override the default value set here.<br />
Finally, you can override the default message template by passing a format specifier string (suitable for the <code>printf</code> family of functions) as the second parameter. The default template is <code><p class="%s">%s</p></code> (where the message-level and message fill the respective placeholders).<br />
As an example, if you regularly expected multiple flash messages, you could render messages as an unordered list by doing this in your layout:<br />
<pre><code><ul>
<?php echo $this->flashMessenger('notice', '<li class="%s">%s</li>');?>
</ul>
</code></pre>
Here we have also set the default message-level to <code>'notice'</code>.<br />
The FlashMessenger View Helper is part of the Noumenal
PHP Library and is available on <a href="https://github.com/carltongibson/Noumenal-PHP-Library">GitHub</a>.Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-75259298477383681452009-08-14T13:03:00.001+01:002009-08-20T14:23:07.602+01:00Introducing the Noumenal PHP Library<p>We just added the first version of the Noumenal PHP Library to the <a
href="http://noumenal.co.uk/resources/downloads">downloads page</a>.</p>
<p>This is a collection of PHP classes built on top of <a
href="http://framework.zend.com/">Zend Framework</a>. The Zend Framework team
aim for an 80% solution. The Noumenal PHP Library is the next 10%. </p>
<p>It's released under a new BSD licence.</p>
<p>At the moment there's not much in the Noumenal PHP Library, just a
FlashMessenger View Helper to begin with. We've got a big backlog of code to
include but it takes time to get our private code <em>massaged</em> for an
open-source release. </p>
<p>Download a copy, try it out and <strong>keep up to date</strong> via the <a
href="http://eepurl.com/b43Q">newsletter</a>.</p>
<p>Bugs via the <a href="http://noumenal.co.uk/contact">contact page</a>,
questions welcome on the <a
href="https://noumenal.fogbugz.com/default.asp?noumenal">discussion
board</a>.</p>
Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-85084127169892096812009-08-08T11:14:00.001+01:002009-08-08T11:20:56.745+01:00Towards a One-Step Build (part1)<p>Number 2 on the Joel Test is “Can you make a build in one step?” At Noumenal the answer to this (on this date, but not for much longer) is still “No”.</p>
<p>The necessary <em>explanation</em> that accompanies all such “No” answers is, in this case, “we’ve been building small-to-medium web applications that didn’t force us into automated builds, and we didn’t know any better”.</p>
<p>Well now we’re building enterprise grade multi-platform, multi-language, high-availability, n-tier architecture, distributed applications, integrated via asynchronous messaging services and exposing open-standards web service APIs. <strong>We damn-well need a one-step build now</strong>.</p>
<p>In moving from here to there, step 1 is easy: <strong>Write down exactly what you do for each of the steps of your current build</strong>.</p>
<p>That’s it. Nothing more to it.</p>
<p>Each of the steps are themselves really easy. (They must be otherwise you’d already have another way of doing it.) Scripting each step individually will be easy too — <strong>once you know what they are</strong>. All that then will remain is a script to run each of the mini-scripts in order.</p>
<p>Sounds simple doesn’t it.</p>
Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-77458464935138158532009-07-07T09:25:00.001+01:002009-07-07T09:27:12.329+01:0012 on The Joel Test<p>I started Noumenal 3 and a half years ago now. In that time I've learnt to program and written some software, some of which has actually been good. My greatest achievement by far is that, one year after the birth of my first child, I'm still business. (Just before his birth, I'd guess, not many thought that likely.)</p>
<p>Starting out, just surviving was always going to be a lot harder than my natural arrogance would allow: I was a philosophy PhD and despite my focus on the more technical areas, philosophy is the archetypal <em>liberal art</em> and <a href="http://www.joelonsoftware.com/articles/CoderToDeveloper.html">liberal arts majors don't know anything about developing software</a>. Thankfully for me I knew nothing of this.</p>
<p>
More thankfully though, I'm stubborn, as much as that may <a href="http://www.economist.com/sciencetechnology/displaystory.cfm?story_id=13899022">not be good for my mental health</a>. I have learnt the hard way about the need for specifications and testing and iterative development, and all the rest of it.
</p><p>
As much of an achievement as still being in business is, it is but a platform for success rather than success itself. (My long term goals were slightly more ambitious than merely not going bankrupt.) As such I've decide to apply the famous <a href="http://www.joelonsoftware.com/articles/fog0000000043.html">Joel Test</a>, 12 yes or no questions to help you determine how good your software development process is.
</p>
<p>
For those of you who may not be familiar, the 12 points of The Joel Test are:
<ol>
<li>Do you use source control?
</li><li>Can you make a build in one step?
</li><li>Do you make daily builds?
</li><li>Do you have a bug database?
</li><li>Do you fix bugs before writing new code?
</li><li>Do you have an up-to-date schedule?
</li><li>Do you have a spec?
</li><li>Do programmers have quiet working conditions?
</li><li>Do you use the best tools money can buy?
</li><li>Do you have testers?
</li><li>Do new candidates write code during their interview?
</li><li>Do you do hallway usability testing? </li>
</ol>
(I'll be discussing these in reference to their application at Noumenal in future posts but you can read Joel's <a href="http://www.joelonsoftware.com/articles/fog0000000043.html">original discussion</a> for more details now.)
</p><p>
A quick count says I'm currently running at 4 (which could pretty easily be bumped to 6) but 4 (or even 6) isn't good enough. As Joel says, <q>companies like Microsoft run at 12 full-time</q>.
</p>
<p>
Goals should be SMART: specific, measurable, achievable, realistic and time-boxed. Here's my goal: I will be at 12 on The Joel Test by 6th July 2010, the day my boy is two.</p>Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-88931725987052108792009-06-12T14:11:00.004+01:002009-06-12T14:17:54.353+01:00Noumenal Web Site (Re)developmentAfter much time, and many delays, the Noumenal web site is finally beginning the process of taking shape.
We at least now have a sitemap for the forthcoming v1.0:
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcd8-L6zzJy5EtfqRZDPvPVRYIZL3pQZzoa8pn2Jjj5o3C4EjXdP9JOFPYGIR9elBXBapwPw-B_ZmTG237NjBXmi7MUKXiiQJPut2cNyVzUOK55RMAlkb7srz4Yf7GT7hGu-9v/s1600-h/Noumenal+Site+Map.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 254px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcd8-L6zzJy5EtfqRZDPvPVRYIZL3pQZzoa8pn2Jjj5o3C4EjXdP9JOFPYGIR9elBXBapwPw-B_ZmTG237NjBXmi7MUKXiiQJPut2cNyVzUOK55RMAlkb7srz4Yf7GT7hGu-9v/s320/Noumenal+Site+Map.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5346428538888717746" /></a>
(Generated using <a href="http://writemaps.com/">http://writemaps.com/</a>.)Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.comtag:blogger.com,1999:blog-34474383.post-49145981768152275862009-05-15T11:14:00.001+01:002009-05-15T11:17:01.373+01:00Pure Demonstratives and Logically Proper Names<p>My ten month old hasn’t yet grasped pointing: “Look over
there”, arm outstretched, hand clenched, index finger extended; he looks
at the finger rather than anything else. </p>
<p>Observing this brings to mind remarks of Wittgenstein’s to the effect
that even our most basic demonstratives are already embedded within what we
might model as a representational schema: </p>
<blockquote>
<p>Are “there” and “this” also taught
ostensively?—Imagine how one might perhaps teach their use. One will
point to places and things—-but in this case the pointing occurs in the
<em>use</em> of the words too and not merely in learning the use. [P.I. 9]</p>
</blockquote>
<p>I’ve always taken this kind of remark (i.e. it <strong>and</strong>
many others like it) as telling against the possibility of a pure demonstrative,
of a spoken “<em>This</em>” or of a “<em>That</em>”
which successfully picks out an otherwise unknown something, without in so doing
imposing preconceptions upon it.</p>
<p>From the logical point of view they would tell against the possibility of a
purely designative occurrence of a <em>name</em>—one which in a
subject-predicate sentence of the form “S is P” would allow
<strong>all</strong> of the intensional content to reside with the predication.
</p>
<p>Here, rehearsing Russell, we might draw the distinction between
<em>names</em> as they commonly appear, which may be laden with
predicative content—Ivan the Terrible, say—and <em>logically proper
names</em> which, being purely designative, may not. </p>
<p>With this stipulation in place, note that whilst we all agree that names as
they commonly appear are not logically proper names so defined, the
claim at stake is the much stronger one that names howsoever they appear are
<strong>never</strong> logically proper names. That is, that there are
<strong>no such things</strong> as logically proper names. (This would not be
worth remarking if the contrary were not, still, so commonly held.)</p>Carlton Gibsonhttp://www.blogger.com/profile/13617389803402457692noreply@blogger.com