On ReSiSt-cms

As always, most things are not straight forward. Take for instance ReSiSt-cms – the title of this post. The product was coming along quite nicely until a screenshot was required for the Windows look and feel at which point disaster struck!

In coding land if you want to have a paragraph (or some words strung together in a loose format) we call this a String. And to define a String we enclose it in quotation marks – sounds fair enough, after all if you were going to quote someone you would enclose it in quotation marks1. So for example, once again quoting Shakespeare.

“Alas, poor Yorick! I knew him, Horatio 2

Nevertheless, the quotation stands – there is a starting quotation mark, and an ending quotation mark.

So, what happens in coding land when you need to put a double quotation mark in the actual String?.

As an example, if you were going to mention David Bowie’s “Space Oddity” within the String it would look like the following:

"Alas, poor Yorick! I knew him, Horatio 
was a lyric in David Bowie's "Space Oddity" album 3"

Notice how we require the use of one of the String markers within the actual String. How do we differentiate between the start or end of a String and using an actual quotation mark?

The answer is simple, although perhaps not obvious:

We escape the quotation mark.

What this means is that we put a back-slash character (‘\’) before the quotation mark to tell the computer that this is not the end of the String, but is just another part of the String.

So the above quote now becomes:

"Alas, poor Yorick! I knew him, Horatio 
was a lyric in David Bowie's \"Space Oddity\" album"

Now, the more observant of you out there may very well be asking:

“If we use the back-slash character (‘\’) to escape the quotation mark, how would we then put in a back-slash character (‘\’)?”

Mighty fine question, the answer is simple (The computer geeks who came up with this had the same thought decades ago):

We escape the back-slash?

So the above now becomes:

“If we use the back-slash character (‘\\’) to escape the quotation mark, how would we then put in a back-slash character (‘\\’)?”

There is quite a number of escaped characters that are available (called escape codes), these include:

  • Tab: \t
  • New line: \n
  • Carriage return: \r
  • Bell: \g

Where on earth is this going you may ask?

The reason why ReSiSt-cms worked so well on Mac OS X is because the URLs that you are used to looking at (i.e. http://www.synapticloop.com/blog/something/or/other) use forward-slashes ‘/’ as a kind of directory structure, which maps really nicely to the forward-slashes ‘/’ on the file system for Mac OS X (and in fact all *NIX variants).

So to map the ReSiSt-cms URL /about/faqs/help/ to the file system, it was as straight-forward as adding on the installation directory (in this case /Users/synapticloop/projects/resist-cms/content) to the URL leaving us with:

/Users/synapticloop/projects/resist-cms/content/about/faqs/help/

The file that lives in /Users/synapticloop/projects/resist-cms/content/about/faqs/help/ can then be parsed and sent to the browser.

However

On Windows

They use the ‘\’ character to delimit the file system, so just adding the installation directory to the URL now becomes problematic. For example:

C:\Documents and Settings\synapticloop\Desktop\resist-cms\content/about/faqs/help/

looks as though it has a carriage return in it (you remember the ‘\r’ character from above?)

So, ReSiSt-cms was over-hauled to allow for Windows machines to be able to properly read files, hence the late running ReSiSt-cms.

There is now a pre-release version in http://synapticloop.com/release/resist-cms/resist-cms.zip ready to go. (this is the version 2.0 release). You really should download it and give it a whirl.

Up Next

Never ones to stand still, version 2.5 and 3.0 are planned:

Version 2.5

Image/File galleries are the largest piece of missing functionality.

Version 3.0

Wiki style page creation on 404 page not found errors.

Footnotes:

  1. Sounds fair enough.
  2. It is Shakespeare after all, perhaps it should have been “To be or not to be, that is the question, whether ’tis nobler… and so on”
  3. This is not actually true, however it will suffice for the purposes of the piece.

Like my footnotes?
Want to add footnotes to your blog?
They can be added easily to your WordPress installation


Leave a Reply

You must be logged in to post a comment.