<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>declarative &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/declarative/</link>
	<description>Feed of posts on WordPress.com tagged "declarative"</description>
	<pubDate>Sun, 20 Jul 2008 06:17:03 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Functional programming - coming to a compiler near you soon?]]></title>
<link>http://successfulsoftware.wordpress.com/?p=328</link>
<pubDate>Mon, 07 Apr 2008 11:54:20 +0000</pubDate>
<dc:creator>Andy Brice</dc:creator>
<guid>http://successfulsoftware.wordpress.com/?p=328</guid>
<description><![CDATA[We can classify programming languages into a simple taxonomy:

Commercial programmers have overwhelm]]></description>
<content:encoded><![CDATA[<p>We can classify programming languages into a simple taxonomy:</p>
<p style="text-align:center;"><img class="aligncenter size-full wp-image-330" src="http://successfulsoftware.wordpress.com/files/2008/04/functional-programming-taxonomy.png" alt="" /></p>
<p>Commercial programmers have overwhelmingly developed software using imperative languages, with a strong shift from procedural languages to object oriented languages over time. While declarative style programming has had some successes (most notably SQL), functional programming (FP) has been traditionally seen as a play-thing for academics.</p>
<p>FP is defined in <a href="http://en.wikipedia.org/wiki/Functional_programming" target="_blank">Wikipedia</a> as:</p>
<blockquote><p>A programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data.</p></blockquote>
<p>Whereas an imperative language allows you to specify a sequence of actions ('do this, do that'), a functional language is written in terms of functions that transform data from one form to another. There is no explicit flow of control in a functional language.</p>
<p>In an imperative language variables generally refer to an address in memory, the contents of which can change (i.e. is 'mutable'). For example the rather unmathematical looking "x=x+1" is a valid expression. In FP there are no mutable variables and no state.</p>
<p>In an imperative language a function can return different values for the same input, either because of stored state (e.g. global or static variables) or because it is interfacing with an external device (e.g. a file, database, network or system clock). But a pure functional language always returns the same value from a function given the same input. This 'referential integrity' means an FP function call has no 'side-effects' and consequently can't interface with external devices. In other words it can't actually do anything useful - it can't even display the result of a computation to your VDU. The standard joke is that you only know a pure functional program is running because your CPU gets warmer.</p>
<p>The functional language <a href="http://en.wikipedia.org/wiki/Haskell_%28programming_language%29" target="_blank">Haskell</a> works around the side-effects issue by allowing some functions to access external devices in a controlled way through 'monads'. These 'impure' functions can call 'pure' functions, but can never be called by them. This clearly separates out the pure parts of the program (without side-effects) from the impure ones (with side-effects). This means that it is possible to get many of the advantages of FP and still perform useful tasks.</p>
<p>FP is much closer to mathematics than imperative programming. This means that some types of problems (particularly algorithmic ones) can be expressed much more elegantly and easily as functional programs. The fact that a function has no side effects also means that it's structure is much easier to analyse automatically. Consequently there is greater potential for a computer to optimise a functional program than an imperative program. For example in FP:</p>
<p style="text-align:center;">y = f(x) + f(x);</p>
<p>Can always be rewritten as:</p>
<p style="text-align:center;">z = f(x);</p>
<p style="text-align:center;">y = 2 * z;</p>
<p>Saving a function call. This is more difficult to do in an imperative language, because you need to show that second call to f(x) won't return a different value to the first.</p>
<p>Functional programs are also inherently much easier to parallelise, due to the lack of side-effects.    We can let the FP interpreter/compiler take care of parallelism. No need to worry about threads, locks, critical sections, mutexes and deadlocks. This could be very useful as processors get ever more cores. However imperative languages, with their flow of control and mutable variables, map more easily than functional languages onto the machine instruction of current (<a href="http://en.wikipedia.org/wiki/Von_Neumann_architecture" target="_blank">von Neumann architecture</a>) computer. Consequently writing efficient FP interpreters and compilers is hard and still a work in progress.</p>
<p>Elements of FP are steadily making their way into mainstream commercial software:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Erlang_%28programming_language%29" target="_blank">Erlang </a>is being used in commercial systems, including telecoms switching systems.</li>
<li>Microsoft Research has implemented <a href="http://en.wikipedia.org/wiki/F_Sharp_%28programming_language%29" target="_blank">F#</a>, a .Net language that includes FP elements based on ML.</li>
<li>Work is underway to add elements of FP to version 2.0 of the <a href="http://en.wikipedia.org/wiki/D_programming_language" target="_blank">D programming language</a>.</li>
<li>Google's <a href="http://en.wikipedia.org/wiki/Map_reduce" target="_blank">MapReduce</a> is based on ideas from FP.</li>
<li>The <a href="http://en.wikipedia.org/wiki/Mathematica" target="_blank">Mathematica</a> programming language has support for FP.</li>
<li>The <a href="http://en.wikipedia.org/wiki/K_programming_language" target="_blank">K programming language</a> is used in financial applications.</li>
<li>The Perl 6 compiler is being written in <a href="http://en.wikipedia.org/wiki/Haskell_%28programming_language%29" target="_blank">Haskell</a>. &#60;insert your own sarcastic comment here&#62;.</li>
</ul>
<p>I recently attended <a href="http://successfulsoftware.net/2008/03/27/accu-2008/" target="_blank">ACCU 2008</a> which had a whole stream of talks on FP. All the FP talks I attended were packed out. That is quite something given that the audience is primarily hardcore C++ programmers. There seemed to be quite a consensus in these talks that:</p>
<ul>
<li>FP is starting to move out of academia and into commercial use.</li>
<li>FP is more suitable than imperative style programming for <em>some </em>classes of problem.</li>
<li>FP is not going to replace imperative programming. The bulk of commercial development will still be done in an imperative style, but with FP mixed in where appropriate.</li>
<li>Hybrid languages that mix OO and FP will become more common.</li>
</ul>
<p>I don't see Haskell replacing C++ any time soon. But I can definitely see the benefits of using FP to tackle some types of problems.</p>
<p>Further reading:</p>
<p><a href="http://en.wikipedia.org/wiki/Functional_programming" target="_blank">The Functional programming reference in Wikipedia</a></p>
<p><em>This article is based loosely on notes I made at ACCU 2008 from attending the following talks:</em></p>
<ul>
<li><em>"Caging the Effects Monster: the next decade's big challenge", Simon Peyton-Jones</em></li>
<li><em>"Functional Programming Matters", Russel Winder</em></li>
<li><em>"Grafting Functional Support on Top of an Imperative Language", Andrei Alexandrescu</em></li>
</ul>
<p><em>Any mistakes are almost certainly mine.</em></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Artificial Intelligence – Knowledge Representation - issues, predicate logic, rules]]></title>
<link>http://myreaders.wordpress.com/?p=153</link>
<pubDate>Thu, 03 Apr 2008 11:21:32 +0000</pubDate>
<dc:creator>myreaders</dc:creator>
<guid>http://myreaders.wordpress.com/?p=153</guid>
<description><![CDATA[Artificial Intelligence – Knowledge Representation - issues, predicate logic, rules  , April 03,]]></description>
<content:encoded><![CDATA[<p><font face="Verdana"><b><i><span style="font-size:11pt;color:navy;line-height:150%;"><a href="http://myreaders.wordpress.com/files/2008/04/ai-knowledge-representation-issues-predicate-logic-rules.pdf" title="Artificial Intelligence – Knowledge Representation - issues, predicate logic, rules">Artificial Intelligence – Knowledge Representation - issues, predicate logic, rules</a> </span></i></b><b><i><span style="font-size:10pt;color:navy;line-height:150%;"><span> </span></span></i></b><b><i><span style="font-size:11pt;color:navy;line-height:150%;">, </span></i></b><b><i><span style="font-size:10pt;color:navy;line-height:150%;">April 03, 2008 , posted</span></i></b><b><i><span style="font-size:10pt;color:navy;line-height:150%;"> <span>by  <u><a href="http://myreaders.wordpress.com/"><span style="color:navy;">myreaders</span></a></u> ,  <a href="http://myreaders.wordpress.com/"><span style="color:navy;">http://myreaders.wordpress.com/</span></a> ,   <a href="http://r/"><span style="color:navy;">R</span></a> C Chakraborty</span></span></i></b><b><i><span style="font-size:10pt;color:navy;line-height:150%;">.</span></i></b><span style="font-size:10pt;color:navy;line-height:150%;"> <span style="font-size:10pt;color:red;font-family:Verdana;"><strong><em>Click – Title to view Slides [pdf] </em></strong></span> Courseware, Lectures - 8, (8 hrs), Slides - 79, Topics: </span><b><span style="font-size:10pt;color:navy;line-height:150%;">Knowledge Representation </span></b><span style="font-size:10pt;color:navy;line-height:150%;">Introduction </span><span style="font-size:10pt;color:navy;line-height:150%;">– KR model, </span><span style="font-size:10pt;color:navy;line-height:150%;">typology, relationship, </span><span style="font-size:10pt;color:navy;line-height:150%;">framework,</span><span style="font-size:10pt;color:navy;line-height:150%;"> mapping, forward &#38; backward representation, system requirements; KR schemes - relational, inheritable, inferential, declarative, procedural; KR issues - attributes, relationship, granularity. </span><b><span style="font-size:10pt;color:navy;line-height:150%;">KR Using Predicate Logic - </span></b><span style="font-size:10pt;color:navy;line-height:150%;">Logic representation,<span>  </span>Propositional logic -<span>   </span>statements, variables, symbols, connective, truth value, contingencies, tautologies, contradictions,<span>  </span>antecedent,<span>  </span>consequent, argument;<span>  </span>Predicate logic - expressions,<span>  </span></span><span style="font-size:10pt;color:navy;line-height:150%;"><span> </span>quantifiers</span><span style="font-size:10pt;color:navy;line-height:150%;">, formula; Representing “IsA” and “Instance” relationships, computable functions and predicates;<span>  </span>Resolution. </span><b><span style="font-size:10pt;color:navy;line-height:150%;">KR Using Rules - </span></b><span style="font-size:10pt;color:navy;line-height:150%;">Types of Rules - declarative, procedural, meta rules; Procedural verses declarative knowledge &#38; language;<span>  </span>Logic programming – characteristics, Statement, language, syntax &#38; terminology,<span>  </span>simple &#38;<span>  </span>structured data objects, Program Components - clause,<span>  </span>predicate, sentence, subject; Programming paradigms - models of computation, imperative model, functional model, logic model; Forward &#38; backward reasoning - chaining, conflict resolution;<span>  </span>Control knowledge.</span></font><b><span style="font-size:10pt;color:navy;font-family:Verdana;">Reference.</span></b><span style="font-size:11pt;color:navy;font-family:Verdana;"> </span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Fitting in with a shoe horn.....]]></title>
<link>http://anointedvessel.wordpress.com/?p=18</link>
<pubDate>Tue, 04 Mar 2008 20:49:08 +0000</pubDate>
<dc:creator>anointedvessel</dc:creator>
<guid>http://anointedvessel.wordpress.com/?p=18</guid>
<description><![CDATA[Have you ever had your eyes on them shoes that you just had to have but they were too small? You had]]></description>
<content:encoded><![CDATA[<p>Have you ever had your eyes on them shoes that you just had to have but they were too small? You had to break out the shoe horn to put them on and as soon as you got in the car you had to pull them off only to<a href="http://anointedvessel.files.wordpress.com/2008/04/everystockphoto_139556_tn.jpg"><img class="alignright size-medium wp-image-124" style="float:right;" src="http://anointedvessel.wordpress.com/files/2008/04/everystockphoto_139556_tn.jpg" alt="" width="110" height="82" /></a> <a href="http://anointedvessel.files.wordpress.com/2008/04/lonodn_walk_barbican_1211908_tn.jpg"><img class="alignleft size-medium wp-image-121" style="float:left;" src="http://anointedvessel.wordpress.com/files/2008/04/lonodn_walk_barbican_1211908_tn.jpg" alt="" width="109" height="88" /></a>cram your dogs back in them to take that dreaded walk on coals of fire to find your seat in a pew.  Who were you trying to impress God? He wasn't looking at your feet....  He was studying your heart and intentions and wondering when you were going to ever join his club, his click.  Brother Phil has been crying loud and sparing none over at <a title="Brother Phil" href="http://exbglounion.wordpress.com/">http://exbglounion.wordpress.com/</a>.  The church is now turning into a club in some places a zoo in others and some places you actually have a "Church Mafia" in affect complete with a Don ordering the summary execution of saints by cutting off communication and fellowship with them or by handicapping local ministries by conquering and dividing congregations.  I have to quote my brother from<a href="http://anointedvessel.files.wordpress.com/2008/04/catapillar_worm_butterfly_249423_tn.jpg"><img class="alignright size-medium wp-image-122" style="float:right;" src="http://anointedvessel.wordpress.com/files/2008/04/catapillar_worm_butterfly_249423_tn.jpg" alt="" width="109" height="82" /></a> TBCP eanthonypreston when he said, "these days you got church pillars and church caterpillars" I believe these Church Mafia families are demonically blinded and driven by Satan to do their dirty work. They usually have a few Jezebels around who are incredibly influential (I will post some info on Jezebel spirits later) usually immature saints that are still on milk are easily influenced by these families.  They galvanize on a ridiculous issue usually about the pastor or someone in his family or close circle of friends or ministerial staff.  After a week or two the membership begins to dwindle and the pastor and staff wonder what has happened while the "Church Mafia" family either sit smiling like Jack-O-Lanterns in their seats, or either decide to move to another church to repeat their offenses and the baby saints that go crawling behind them become the "caterpillars" never going from the pupa stage into the chrysalis to finally develop wings to fly as a butterfly.  It is the Devil's plan for these saint's to never grow out of spiritual infancy. This is unique to this generation I believe, partly due to the times that we are living in and the corruption in the upper echelons of the ministry that has gone unchecked for far too long. More serious is there are reports that churches have begun to take on a Fraternity and Sorority type atmosphere and in the midwest it has been said that several Baptist churches <a href="http://anointedvessel.files.wordpress.com/2008/04/object_closeup_sign_266257_tn.jpg"><img class="alignleft size-medium wp-image-123" style="float:left;" src="http://anointedvessel.wordpress.com/files/2008/04/object_closeup_sign_266257_tn.jpg" alt="" width="109" height="86" /></a>have been threatened by the Masonic lodges by strong arm tactics, forcing pastors to change their style of preaching and what they are allowed to say and threatening to pull signifigant funding away by removing large swaths of members who are loyal to their cause with the flick of a wrist (yes they do use sign language and code).  This is witchcraft saints and God is not pleased and I believe soon we will see perpetrators of this mess start dropping dead right in the pews so pastors go ahead and brush up on your Eulogy skills the day is coming.  My brother's Phil and Minister Hatcher and Sister Gail Grey all saw the need to step out of the trap of the Black Greek Letter Organization that has not just saturated the Historically black colleges and university's but now it is in the black churches as well.  Now you have web pages dedicated to Pan Hellenic Preachers,  that's right,  these are preachers who have pledged their allegiance to a false god and to the one true God.  That is where the shoe horn comes in again,  there isn't enough room for two.  "God said thou shall have no other god's before me".  That was not a suggestion it was a commandment.  A declarative statement with a period behind it.  You can't serve two masters and these pastor's are sending their sheep over a cliff,  this is suicide for the saints in short order.  I will not stand idly by and do nothing as long as their is breath in my body I will speak against that which is against the foundational teachings of Christianity,  if I lose a few friends that's fine.  I don't need to pledge to fit in.  I am already a part of the    ORIGINAL GREEK LETTERS  AND THAT IS THE ALPHA AND THE OMEGA THE GREAT I AM  I don't need to go on line or be hazed,  he already took the beating and the mockery and paid the price for me to be and eternal member of the best club around and that is the <strong>Body of Christ!!!</strong></p>
<p>All writings you see on <strong>"Anointed Vessel's Weblog"</strong> are the intellectual property of <em><strong>Yours Truly</strong></em> and are licensed under a <a href="http://creativecommons.org/licenses/by-nc-nd/3.0/us/">Creative Commons Attribution-Noncommercial-No derivative Works 3.0 United States License</a></p>
<p><a href="http://http//creativecommons.org/licenses/by-nc-nd/3.0/us/"><img src="http://mymcci.wordpress.com/files/2008/03/somerights20.thumbnail.png" alt="somerights20.png" /></a></p>
<p>I believe in giving credit where credit is due,  the term <a title="NY Times Article" href="http://query.nytimes.com/gst/fullpage.html?res=9906E1DE143BF931A15755C0A9659C8B63">"Church Mafia" </a>originally(as far as I can tell), can be traced to a June 22, 2003 NY Times article written by Daniel J. Wakin.  In this article, Wakin explains the comparison,  to the mob as a  byproduct of  numerous sexual abuse scandals in the Roman Catholic church.  The term underwent a metamorphosis of a sort,  when <a title="Church Mafia blog" href="http://realchristianity.wordpress.com/2008/01/04/the-church-mafia-spiritual-abuse-in-our-churches/">Pastor Jay Cameron of Urban Change Ministries produced a stage play by the name of "Church Mafia" </a>which exposed the near occult behavior of control that is being found in a lot of churches today. This particular blog <strong>"Fitting in with a shoe horn"</strong>, paints "Church Mafia's" in somewhat of a different light, by discussing the "Church Mafia" that sits in the pews.  These "Pew Mafia's" exist as rogue groups that seek to destroy the fabric of well established churches through "divide and conquer tactics".  Thanks again <a href="http://realchristianity.wordpress.com/2008/01/04/the-church-mafia-spiritual-abuse-in-our-churches/">Alan Higgins</a> for the Blog on "Church Mafia's!"</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[erlang WAAAASSSSAAAAAA...!!!]]></title>
<link>http://asocialstudies.wordpress.com/2007/04/12/erlang-waaaassssaaaaaa/</link>
<pubDate>Thu, 12 Apr 2007 23:22:57 +0000</pubDate>
<dc:creator>asocialstudies</dc:creator>
<guid>http://asocialstudies.wordpress.com/2007/04/12/erlang-waaaassssaaaaaa/</guid>
<description><![CDATA[AKA The Larch:

via http://jaortega.wordpress.com/2007/04/11/erlang-now/
and now for something compl]]></description>
<content:encoded><![CDATA[<p>AKA The Larch:</p>
<p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/uKfKtXYLG78'></param><param name='wmode' value='transparent'></param><embed src='http://www.youtube.com/v/uKfKtXYLG78&rel=0' type='application/x-shockwave-flash' wmode='transparent' width='425' height='350'></embed></object></span></p>
<p>via <a href="http://jaortega.wordpress.com/2007/04/11/erlang-now/">http://jaortega.wordpress.com/2007/04/11/erlang-now/</a></p>
<p>and now for something completely different:</p>
<p><img src='http://asocialstudies.files.wordpress.com/2007/04/keeley-hazell-boobs-google.jpg' alt='keeley-hazell-boobs-google.jpg' /></p>
<p>g( . )( . )gle is watching you...</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Reference Reification]]></title>
<link>http://xosfaere.wordpress.com/?p=60</link>
<pubDate>Sun, 20 Apr 2008 15:04:04 +0000</pubDate>
<dc:creator>xosfaere</dc:creator>
<guid>http://xosfaere.wordpress.com/?p=60</guid>
<description><![CDATA[The web is based on addresses called URIs (short for Uniform Resource Identifiers; and soon Internat]]></description>
<content:encoded><![CDATA[<p>The web is based on addresses called URIs (short for Uniform Resource Identifiers; and soon Internationalized Resource Identifiers (URIs)). These are the links that weave the web we all traverse daily.</p>
<p>But these URIs are not atomic, they are merely treated as such in their syntactic expression. They are what is popularly known as a microformat.</p>
<p>So what is a microformat anyway?</p>
<p>A microformat is a relative term in that thing that has a format is not a microformat in and of itself, but once that format becomes injected into an atom of another format, it becomes a microformat. That is, once a format uses other formats inside itself, we can begin to talk about microformats.</p>
<p>The canonical example for this is XML and URIs.</p>
<blockquote><p>&#60;Person email="mailto:bent@example.com"/&#62;</p></blockquote>
<p>As we see here, the email attribute contains structured information, but the structure is not expressed using structured XML, instead it is simply concatenated inside an attribute.</p>
<p>This means essentially that what we are doing is to inject a domain-specific language, in its own syntax, within a domain-neutral container format - XML. It would be possible to actually abandon the concrete URI syntax and encode the abstract URI syntax into the XML Information Set datamodel directly!</p>
<p>This would have the consequence that the email property in our above example wil have to be reformulated as an element instead; something like</p>
<blockquote><p>&#60;Person&#62;<br />
&#60;email&#62;<br />
&#60;URI&#62;<br />
&#60;scheme&#62;mailto&#60;/scheme&#62;<br />
.....<br />
&#60;/URI&#62;<br />
&#60;/email&#62;<br />
&#60;/Person&#62;</p></blockquote>
<p>It is worth noticing how the compact concrete URI syntax makes the markup shorter and perhaps easier to read, but it also means we loose one of the benefits of XML - its ability to encode information genercally using structured markup so we can more easily parse the content.</p>
<p>It is clear to me that the reason XML is not used in a more structured way and we have all the microformat mess is simply because XML is a human-readable verbose format. If it were to become more verbose, it would become less readable - to humans.</p>
<p>The upcomming Infoset encoding, the Efficient XML Interchange format (EXI) may change this game and move us away from the microformat game because it will then be able to create a compact <strong>and</strong> uniformly structured encoding of URIs inside the other data.</p>
<p>Now the URI may not be the ideal example of this, but as a very used identifier string (which is useful of course) and as a structured value as well, it does have some usefulness as an example in this regard.</p>
<p>The SVG path attribute is a better example. As machines are supposed to generate SVG, we should not care about human-readability - if we want readability we create interactive visualizations of the data (text or a drawing).</p>
<p>The Resource Description Framework (RDF) from the W3C has a concept which is somewhat related to this concept of unification: <strong>Reification</strong>.</p>
<p>In RDF one can create statements about statements. Normally a statement is the quintessential "primitive" of RDF, but what if you want to say something about a statement; you can choose to express the statement via other statements, thereby reifying it.</p>
<p>I'm not saying reification and unification as shown here is always the right thing to do, but I think the world should move more away from microformats and towards unified abstract data models. If the URI is parsed into XML Information Items, then the job of the URI constructor is trivial.</p>
<p>As an identfier a URI may still be valuable in its canonical concrete form, but software could also create this concrete form from the structured form if necessary. It's more cumbersome the other way around.</p>
<p>Should you want to create an XML or RDFS/OWL datamodel for URIs, here's the concrete syntax for them, expressed in Backus-Naur form.</p>
<p><a title="Appendix A. Collected ABNF for URI" href="http://tools.ietf.org/html/rfc3986">Appendix A. Collected ABNF for URI</a></p>
<blockquote><p>URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]</p>
<p>hier-part     = "//" authority path-abempty<br />
/ path-absolute<br />
/ path-rootless<br />
/ path-empty</p>
<p>URI-reference = URI / relative-ref</p>
<p>absolute-URI  = scheme ":" hier-part [ "?" query ]</p>
<p>relative-ref  = relative-part [ "?" query ] [ "#" fragment ]</p>
<p>relative-part = "//" authority path-abempty<br />
/ path-absolute<br />
/ path-noscheme<br />
/ path-empty</p>
<p>scheme        = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )</p>
<p>authority     = [ userinfo "@" ] host [ ":" port ]<br />
userinfo      = *( unreserved / pct-encoded / sub-delims / ":" )<br />
host          = IP-literal / IPv4address / reg-name<br />
port          = *DIGIT</p>
<p>IP-literal    = "[" ( IPv6address / IPvFuture  ) "]"</p>
<p>IPvFuture     = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )</p>
<p>IPv6address   =                            6( h16 ":" ) ls32<br />
/                       "::" 5( h16 ":" ) ls32<br />
/ [               h16 ] "::" 4( h16 ":" ) ls32<br />
/ [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32<br />
/ [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32<br />
/ [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32<br />
/ [ *4( h16 ":" ) h16 ] "::"              ls32<br />
/ [ *5( h16 ":" ) h16 ] "::"              h16<br />
/ [ *6( h16 ":" ) h16 ] "::"</p>
<p>h16           = 1*4HEXDIG<br />
ls32          = ( h16 ":" h16 ) / IPv4address<br />
IPv4address   = dec-octet "." dec-octet "." dec-octet "." dec-octet</p>
<p>dec-octet     = DIGIT                 ; 0-9<br />
/ %x31-39 DIGIT         ; 10-99<br />
/ "1" 2DIGIT            ; 100-199<br />
/ "2" %x30-34 DIGIT     ; 200-249<br />
/ "25" %x30-35          ; 250-255</p>
<p>reg-name      = *( unreserved / pct-encoded / sub-delims )</p>
<p>path          = path-abempty    ; begins with "/" or is empty<br />
/ path-absolute   ; begins with "/" but not "//"<br />
/ path-noscheme   ; begins with a non-colon segment<br />
/ path-rootless   ; begins with a segment<br />
/ path-empty      ; zero characters</p>
<p>path-abempty  = *( "/" segment )<br />
path-absolute = "/" [ segment-nz *( "/" segment ) ]<br />
path-noscheme = segment-nz-nc *( "/" segment )<br />
path-rootless = segment-nz *( "/" segment )<br />
path-empty    = 0</p>
<p>segment       = *pchar<br />
segment-nz    = 1*pchar<br />
segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" )<br />
; non-zero-length segment without any colon ":"</p>
<p>pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"</p>
<p>query         = *( pchar / "/" / "?" )</p>
<p>fragment      = *( pchar / "/" / "?" )</p>
<p>pct-encoded   = "%" HEXDIG HEXDIG</p>
<p>unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"<br />
reserved      = gen-delims / sub-delims<br />
gen-delims    = ":" / "/" / "?" / "#" / "[" / "]" / "@"<br />
sub-delims    = "!" / "$" / "&#38;" / "'" / "(" / ")"<br />
/ "*" / "+" / "," / ";" / "="</p></blockquote>
<p>See also</p>
<ul>
<li><a href="http://xosfaere.wordpress.com/2008/04/12/towards-useful-names/">Towards Useful Names</a></li>
<li><a href="http://xosfaere.wordpress.com/2007/10/21/knowledge-representation-series-1/">Knowledge Representation Series - 1</a></li>
</ul>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Twine This!]]></title>
<link>http://xosfaere.wordpress.com/?p=58</link>
<pubDate>Wed, 16 Apr 2008 18:54:30 +0000</pubDate>
<dc:creator>xosfaere</dc:creator>
<guid>http://xosfaere.wordpress.com/?p=58</guid>
<description><![CDATA[Twine is a place to create and organize information. In its simplest interpretation it is a bookmark]]></description>
<content:encoded><![CDATA[<p>Twine is a place to create and organize information. In its simplest interpretation it is a bookmarking tool.</p>
<p>It allows one to create new items of certain types: links, books, documents, videos, contacts, etc. But it is also more than that. In the extreme it can subsume blogs, homepages, wikis and to some extent search engines.</p>
<p>As opposed to a regular bookmark a twine item has a type and semantics associated with it.</p>
<p>I have some suggestions for improving Twine further, though</p>
<ol>
<li>A twine item type; thus twines can become sets of elements from other twines (unions)</li>
<li>A twine item type designer; establish an item type ecosystem; with subtype reuse - create exponential growth (but constrain and sanity-check using rules)</li>
<li>A twine item type visual designer; create a visual template for an item type</li>
<li>A distinction between "my twines", "my collaborative twines" and "other twines"; menus or submenus for each, making navigation easier; and the twinelet must take this distinction into account</li>
<li>A set of twine maps; visualizations of twine; heat maps (activity), geo maps (earth), topic maps (hot topics), taxonomies, etc; create mapping dimensions that slice twine in various ways of interest</li>
<li>A set of twine layouts; twine is a bit boring in its layout; create new views that allow one to display twines and items in grid layout</li>
<li>A blog item type</li>
<li>A mass bookmark import option and twine distribution based on analysis (see 11)</li>
<li>A set of dynamic layouts - use RIA technology (see 6,10)</li>
<li>A thin desktop application (Adobe AIR) - drag n drop, etc; intertwine twine with the personal computer/desktop; RIA applications respond faster and look better (drive in users in the millions)</li>
<li>A natural language parsing and indexing of items (Powerset secret sauce)</li>
<li>A broader focus on user-interaction; how might users interact and communicate</li>
<li>A statistics view; let users track how their items are growing and spreading</li>
<li>A roadmap or at least some public information about where twine is going for us beta chasers</li>
<li>A twine connection item type (do we have that?)</li>
<li>A geographical and temporal map of items (with type selection) and time slicing and motion (requires "RIA" technology); users as well (see 15)</li>
</ol>
<p>Invest heavily in at least some of these goals; and do not forget the user-experience - make the users time to find and browse information a key metric for success.</p>
<p>There. Some of my thoughts on what Twine lacks to be truly compelling. There are more ideas, but they'll come...</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Towards Useful Names]]></title>
<link>http://xosfaere.wordpress.com/?p=56</link>
<pubDate>Sat, 12 Apr 2008 02:34:08 +0000</pubDate>
<dc:creator>xosfaere</dc:creator>
<guid>http://xosfaere.wordpress.com/?p=56</guid>
<description><![CDATA[The Internet is in flux. Protocols emerge and die. Information emerges and vanishes.  In this world]]></description>
<content:encoded><![CDATA[<p>The Internet is in flux. Protocols emerge and die. Information emerges and vanishes.  In this world of change, how can  we say anything about anything in any useful way, if we cannot relate to  representations that can be trusted over time?</p>
<p>There are many protocols for finding and identifying things in the world. HTTP, FTP, P2P, etc. The principle way of identifying things on the Internet is by using Uniform Resource Identifiers (URI) or Internationalized Resource Identifiers (IRI). These have schemes defined, typically for various representation access protocols such as HTTP, FTP and such. There are also representation independent schemes such as the URN subspace of URIs.</p>
<p>The URN subspace can be used to express things detached from a particular access protocol. For example one might say</p>
<blockquote><p>urn:isbn:&#60;my book isbn number&#62;<br />
urn:ssn:&#60;my social security number&#62;</p></blockquote>
<p>The two above URI/URN schemes can be used to find information regardless of protocol.</p>
<p>A more precise way to find information is to uniquely name the information representation. This is what hash functions do. They map between some sequence of bits and some hash code of lesser length but with sufficient length to reasonably ensure uniqueness in the real world.</p>
<p>Peer to Peer (P2P) networks use hash codes to uniquely name representations as it would otherwise be near impossible to create a coherent representation by downloading from multiple sources at once, simply because each file (and each part of the file) could be named arbitrarily. What data does "my book name" refer to? What if two books are called the same? Sure, we could use ISBN's, but they are bound to books and so not generic.</p>
<p>By coupling URIs and hash codes, we can uniquely identify data.</p>
<blockquote><p>urn:sha1:&#60;my hash code for my file&#62;</p></blockquote>
<p>Hash codes can also be used to conceil information by obscuring the real identity of it to anyone other than the owner. For example</p>
<blockquote><p>urn:[field:ssn],[sha1:&#60;hash of ssn&#62;]<br />
urn:[field:password],[sha1:&#60;hash of password&#62;]</p></blockquote>
<p>The benefit?</p>
<p>Apart of obscurement, it also has the natural benefit of relative uniqueness and compression, as the name is shorter than the bits it represents. It may be seen as lossy compression for the purpose of naming - we can compress any data to the point where we mostly can't reverse engineer the data, but we can reasonably trust the uniqueness of the name with respect to the data it identifies.</p>
<p>This is a crucial benefit for the Semantic Web. It  enables one to say things about other data, without binding oneself to a particular access protocol or mechanism and yet future search engines can use hash codes to find any data on any namespace it knows of, including ones invented in the future.</p>
<p>In other words: it's future proof. - To a point.</p>
<p>The precise hashing mechanism may change over time, but the benefit of hashing is that one can still identify the hashing mechanism via name.</p>
<p>One might even use a hash code to refer to the implementation used to hash</p>
<blockquote><p>urn:data:{class:sha1},{implementation:hash:&#60;hash&#62;},{identification:hash:a&#60;hash&#62;}</p></blockquote>
<p>The hash code of the implementation would be hashed using the implementation itself of course! The only problem here is that the exact identity of this implementation is dependent on the implementation itself - to some extent.</p>
<p>I'm somewhat disguisted by names such as</p>
<blockquote><p>http://www.w3.org/1999/02/22-rdf-syntax-ns#type</p></blockquote>
<p>The idea of this HTTP URI is that it can be used to fetch the definition of this term via the protocol used to express the name of the term. That's beneficial of course. But it also ties the name to the current HTTP protocol. It's only disguisting in retrospect and not completely so.</p>
<blockquote><p>urn:sha1:&#60;hash&#62;</p></blockquote>
<p>Then for each protocol, a search engine should be used to look up the protocol specific address of that data - or indeed even the latest cached representation.</p>
<p>A potential problem, is of course that the expression of the meaning of the term itself, is dependent on some representation language such as RDF/XML. But this is to be expected and hopefully RDF/XML (or better: RDF/EXI (or better still: A triple variant of RDF expressed in EXI)) will long outlive RDF/XML.</p>
<p>Of course old names can be mapped to new names via semantics. So one can say</p>
<blockquote><p>&#60;urn:data:sha1:&#60;hash&#62;&#62; &#60;same-as/hash-of&#62; &#60;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&#62;</p></blockquote>
<p>Search engines of the future may also be used to find and transcode information - even to transparently map the old web to the new web so it's possible to switch from HTTP to some other protocol more or less seamlessly (ahemn).</p>
<p>So for future proofing data names, there can be only one: Use hash codes, but there are ways to deal with oldschool names.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Unbox This! - Don Box On Code &amp; Data]]></title>
<link>http://xosfaere.wordpress.com/2008/03/23/unbox-this-don-box-on-code-data/</link>
<pubDate>Sun, 23 Mar 2008 22:49:00 +0000</pubDate>
<dc:creator>xosfaere</dc:creator>
<guid>http://xosfaere.wordpress.com/2008/03/23/unbox-this-don-box-on-code-data/</guid>
<description><![CDATA[Don Box (with Chris Anderson as a sidekick) had an interesting (if vague) talk on Lang.Net 2008. In ]]></description>
<content:encoded><![CDATA[<p>Don Box (with Chris Anderson as a sidekick) had an interesting (if vague) talk on Lang.Net 2008. In the talk Don Box shows a historical perspective on code vs data and how modelling has been used over time.</p>
<p>Lang.Net Conference 2008<br />
<a href="http://langnetsymposium.com/talks.asp">3-07 - Modeling and Languages - Don Box</a></p>
<p>The talk is about representation independence (oxymoron?), declarative forms and abstractions. It has a historic point of view, showing how abstraction and modelling has been applied over time.</p>
<p>But he is careful not to really talk about anything concrete with respect to what Microsoft is doing now. The talk is done in a slideshow driven by a domain-specific XAML for slideshows which is then transformed into a WPF model that is easy on the eyes.</p>
<p>That in and of itself is nothing special. It is common to encode data in XML, transform it with XSLT into HTML plus CSS etc.</p>
<p>To me the talk has a certain "Intentional" smell to it. I'm guessing we may finally see Microsoft move towards a model where we have domain-specific representations, domain-specific presentations and domain-specific input models.</p>
<p>The "two beers" test (as Don calls it) is not passed because the slideshow is encoded in a CLR specific XML dialect (XAML). If there was a DSL editor for it, it would be, not to say idiotproof, but domain-proof, and with all noise absent.</p>
<p>I wonder if "Avalon" (WPF) could play a role as a code presentation model and interaction model in the future. But it wouldn't be the first time we'd see a new framework being invented.</p>
<p>Don also talks about search. That leads more towards a type-aware filesystem which again leads me to think of WinFS. It's time may still come. Maybe in an even more sophisticated semantic form based on semantic web principles and technologies.</p>
<p>The <strong><span style="color:#ff6600;">paradigm</span></strong> for the presentation.</p>
<blockquote><p>models<br />
presentations<br />
representations<br />
interactions<br />
filesystems<br />
searches</p></blockquote>
<p>concept: [<span style="color:#ff99ff;"><strong>m</strong><strong>odel</strong></span>]; domain-specific expressions.</p>
<p>concept: [<strong><span style="color:#ff99ff;">representation</span></strong>]; text, markup, schemas, etc.</p>
<p>concept: [<strong><span style="color:#ff99ff;">presentation</span></strong>]; "sensual" representations (see, hear, etc)</p>
<p>concept: [<span style="color:#ff99ff;"><strong>i</strong><strong>nteraction</strong></span>]; I/O - put information into the model and get it out of the model - "via" the presentation layer</p>
<p>concept: [<strong><span style="color:#ff99ff;">filesystem</span></strong>]; A type-aware filesystem; files are not atomic, files are type instances.</p>
<p>concept: [<strong><span style="color:#ff99ff;">search</span></strong>]; A type-aware filesystem is very searchable</p>
<p>In simple terms I believe Microsoft is working on Intentional programming things with domain-specific models and domain-specific code representation, visualization and editing.</p>
<p>That's what I hope, at least... It'll also tie in very nicely with Microsofts framework and tool investments.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[MooTools template engine (a new approach)]]></title>
<link>http://zealdev.wordpress.com/?p=7</link>
<pubDate>Fri, 22 Feb 2008 16:32:20 +0000</pubDate>
<dc:creator>Zeal_</dc:creator>
<guid>http://zealdev.wordpress.com/?p=7</guid>
<description><![CDATA[tmpl.jsThis is a template engine I created for MooTools v1.11. I am using this in a recent project o]]></description>
<content:encoded><![CDATA[<p><a title="tmpl.js" href="http://zealdev.wordpress.com/files/2008/02/tmpljs.doc">tmpl.js</a>This is a template engine I created for MooTools v1.11. I am using this in a recent project or two and it seems to be a rather handy little beast.</p>
<h2>What does it do?</h2>
<p>It takes a set of template elements, contained in the DOM tree of the current document decorated with <strong>marker classes</strong>, and expands it with some data.</p>
<p>The data is given as a combination of Javascript <strong>objects</strong> and <strong>arrays</strong>. An object's <strong>key</strong> selects the DOM <strong>Element</strong> for which the corresponding <strong>value</strong> supplies the data.</p>
<p>An <strong>array</strong> value means the selected elements should be repeated and expanded using the elements of the array.</p>
<h2>How does it work?</h2>
<p>The <strong>data</strong> object is processed recursively. If an associative array is found, the first element of the template with the <strong>marker class</strong> given as the <strong>key</strong> of the association is selected and both the template and the data are processed deeper from there.</p>
<p>If the <strong>value</strong> of the association is an <strong>array</strong>, the elements selected by the <strong>key</strong> is repeated and filled with the elements of the array recursively.</p>
<p>Whenever a primitive value (ie, a number, or a string) is found, the currently selected element's text is set accordingly, and recursion stops.</p>
<p>Examine the following example.</p>
<p>[sourcecode language="html"]</p>
<div style="display:none" id="testTemplate">
<table border="1">
<tr class="header">
<th class="columnName" />
        </tr>
<tr class="data">
<td class="item" />
        </tr>
<tr class="data alt">
<td class="item" />
        </tr>
</table>
</div>
<div id="testTarget"></div>
<p>[/sourcecode]</p>
<p>Here we have a HTML template described under the div 'template'. We intend to place an expanded version of it into 'testTarget'. See how it is done.</p>
<p>[sourcecode language='jscript']<br />
        var data = {<br />
            'columnName': ['Name', 'Price', 'Qty'],</p>
<p>            'data': [<br />
                {'item': ['1. Apple', 125, 0.5]},<br />
                {'item': ['2. Banana', 210, 0.4]},<br />
                {'item': ['3. Cat', 300, 0.2]},<br />
                {'item': ['4. Dog', 200, 3]}<br />
            ]<br />
        };</p>
<p>        expandTemplate('testTemplate', 'testTarget', data);[/sourcecode]</p>
<p>Let's se what we have here.</p>
<ul>
<li>the 'columnName' array is there to instruct the engine to repeat the &#60;th class="columnName" /&#62; three times and set them up so they say 'Name', 'Price' and 'Qty'.</li>
<li>the 'data' array says we need four copies of the &#60;tr class="data"&#62;...&#60;/tr&#62; and everything contained within</li>
<li>each of the 'item' arrays says we need 3 instances of &#60;td class="item" /&#62; in each &#60;tr class="data"&#62; -s, and they should be filled with whatever is in the arrays.</li>
</ul>
<p>The resulting HTML looks like this:</p>
<p>[sourcecode language="html"]</p>
<table border="1">
<tr class="header">
<th class="columnName">Name</th>
<th class="columnName">Price</th>
<th class="columnName">Qty</th>
</tr>
<tr class="data">
<td class="item">1. Apple</td>
<td class="item">125</td>
<td class="item">0.5</td>
</tr>
<tr class="data alt">
<td class="item">2. Banana</td>
<td class="item">210</td>
<td class="item">0.4</td>
</tr>
<tr class="data">
<td class="item">3. Cat</td>
<td class="item">300</td>
<td class="item">0.2</td>
</tr>
<tr class="data alt">
<td class="item">4. Dog</td>
<td class="item">200</td>
<td class="item">3</td>
</tr>
</table>
<p>[/sourcecode]</p>
<p>Note that there are multiple <strong>tr</strong>s having the marker class <strong>data</strong>. These are repeated in alternating succession, and this is the preferred way to expand table templates with that cool <strong>zebra look</strong>. ;)</p>
<h2>AJAX</h2>
<p>Yeah,  Ajax is supported in a rather trivial manner. We have the shortcut method <strong>tmpl</strong>, which performs an <strong>Ajax request</strong>, interprets the resulting text as the <strong>Json</strong> representation of a data object, and expands the given template using it. It even fires the <strong>onComplete</strong> event afterwards!</p>
<p>E.g. the template</p>
<p>[sourcecode language="html"]</p>
<div id="template">
<div class="title"></div>
<ul>
<li class="item" />
<li class="item alt" />
    </ul>
</div>
<div id="target"></div>
<p>[/sourcecode]</p>
<p>And the js:</p>
<p>[sourcecode language="jscript"]<br />
tmpl('template', 'target', 'primes.php', {<br />
    data: {<br />
        from:2,<br />
        to:20<br />
    }<br />
});[/sourcecode]</p>
<p>Imagine we have a primes.php that returns the primes between '<strong>from</strong>' and '<strong>to</strong>' as a Json object that looks like this:</p>
<p>[sourcecode language="jscript"]<br />
{<br />
    title:"List of some primes",<br />
    item:[2,3,5,7,11,13,17,19]<br />
}[/sourcecode]</p>
<p>Then we have the following result:</p>
<p>[sourcecode language="html"]</p>
<div id="template">
<div class="title">List of some primes</div>
<ul>
<li class="item">2</li>
<li class="item alt">3</li>
<li class="item">5</li>
<li class="item alt">7</li>
<li class="item">11</li>
<li class="item alt">13</li>
<li class="item">17</li>
<li class="item alt">19</li>
</ul>
</div>
<p>[/sourcecode]</p>
<p>There you have it, a zebra colored list of primes. Just as advertised.</p>
<h2>Known limitations</h2>
<p>Plain old data is processed using <strong>Element.setText</strong>, and that means no attributes can be set currently. Take the following example.</p>
<p>[sourcecode language="html"]</p>
<div id="template">
    <img class="image" />
</div>
<p>[/sourcecode]</p>
<p>It would be nice if the src, alt and title attributes of the img -s could be expanded like this:</p>
<p>[sourcecode language="html"]</p>
<div id="target">
    <img class="image" alt="Me jumping" title="I was jumping happily" src="me_jump.jpg" /><br />
    <img class="image" alt="Me sitting" title="I fell on my a**" src="me_ass.jpg" /><br />
    <img class="image" alt="Me standing up" title="Then I tried to stand up" src="me_fall_again.jpg" />
</div>
<p>[/sourcecode]</p>
<p>But there is no way for such a thing right now. I have yet to figure out a solution. Comments are indeed welcome :)</p>
<h2>Summary</h2>
<ul>
<li>as far as I know, the engine described above takes a rather novel approach, and one that meets my needs better than anything I have seen in this field to date</li>
<li>first of all, there is no custom language with ifs and fors and whatnot. This also implies there is need for a costly parser for a tiny sublanguage. Besides, in my opinion a template is no place for any <strong>control logic</strong>. Or <strong>any logic</strong> for that matter. It is far too late to process the data when it finally comes to template expansion!</li>
<li>the 'language' describing the template is highly <strong>declarative.</strong> Again, I don't think a template language is for them <strong>imperative</strong> language constructs.</li>
<li>I have yet to come up with a way to set attributes in a template. Something like having data objects like <em>{'src':'image.jpg', 'alt':'An image...', 'styles': {'height':'150px', 'border':'1px solid black'}}</em> and calling <strong>Element.setProperties</strong> on them might do the trick, dunno... :/</li>
<li>There should be events before and after a leaf of the template is expanded, providing some means to prevent further expansion and there should be an event after expansion is complete.</li>
<li> Stay tuned for a PHP and an ASP.NET version ;)</li>
</ul>
<h2>Obtaining</h2>
<p>Download from here, change extension to js:  <a title="tmpl.js" href="http://zealdev.wordpress.com/files/2008/02/tmpljs.doc">tmpl.js</a></p>
]]></content:encoded>
</item>

</channel>
</rss>
