<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cyberborean Chronicles &#187; Essays</title>
	<atom:link href="http://blog.cyberborean.org/category/essays/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.cyberborean.org</link>
	<description>by Alex Alishevskikh</description>
	<lastBuildDate>Wed, 18 Jan 2012 07:52:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Dennis MacAlistair Ritchie</title>
		<link>http://blog.cyberborean.org/2011/10/14/dennis-macalistair-ritchie</link>
		<comments>http://blog.cyberborean.org/2011/10/14/dennis-macalistair-ritchie#comments</comments>
		<pubDate>Fri, 14 Oct 2011 20:42:05 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[Essays]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://blog.cyberborean.org/?p=875</guid>
		<description><![CDATA[I read the K&#38;R book when I was a kid and it was likely the most influencing reading I ever had on programming. At least, there were two stunning truths which, as I think, determined my life and profession: Programming is fun Programming is simple It was an astonishing &#8220;You can do that&#8221; idea: you [...]]]></description>
			<content:encoded><![CDATA[<p>I read the <a href="http://en.wikipedia.org/wiki/The_C_Programming_Language">K&amp;R book</a> when I was a kid and it was likely the most influencing reading I ever had on programming. At least, there were two stunning truths which, as I think, determined my life and profession:</p>
<p><span id="more-875"></span></p>
<ul>
<li><em>Programming is fun</em></li>
<li><em>Programming is simple</em></li>
</ul>
<p>It was an astonishing &#8220;<em>You can do that</em>&#8221; idea: you don&#8217;t have to be a mature, qualified engineer to start doing things with the computer right now. I still don&#8217;t know whether it&#8217;s a property of the C language itself, or of the book (in very good Russian translation); but even complex subjects, like pointers etc., were explained in an amusing way, intuitive for an average 13 y.o. schoolboy.</p>
<p>I don&#8217;t know another programming language specification that were such fundamental and detailed but simple and inspiring at the same time. I really owe to it in particular and to the C in general for I had not been lost in the jungles of something like BASIC (as it was suggested by the most of the &#8220;beginner&#8221; books of those days) and got a taste for a good language and for a fun of programming from the very beginning.</p>
<p>Unfortunately, I never remember Mr. Ritchie when I turn on my Linux (UNIX!) computer for doing my everyday work (those curly braces and all that stuff). And it&#8217;s sad.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2011/10/14/dennis-macalistair-ritchie/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>People-Concepts Networking</title>
		<link>http://blog.cyberborean.org/2009/04/07/people-concept-networking</link>
		<comments>http://blog.cyberborean.org/2009/04/07/people-concept-networking#comments</comments>
		<pubDate>Tue, 07 Apr 2009 15:55:59 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[Essays]]></category>
		<category><![CDATA[Laboranova]]></category>
		<category><![CDATA[PCN]]></category>
		<category><![CDATA[SCAN]]></category>
		<category><![CDATA[SCOT]]></category>
		<category><![CDATA[Semantic Web]]></category>
		<category><![CDATA[SIOC]]></category>
		<category><![CDATA[socialnetworks]]></category>
		<category><![CDATA[tagging]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://blog.cyberborean.org/?p=372</guid>
		<description><![CDATA[Today at University of Nottingham, we deployed an alpha of the People-Concept Networking platform prototype. It&#8217;s the alpha, so it doesn&#8217;t do a lot as yet and is released only for internal overview and testing of the basic infrastructure. It is however, an occasion to disclose what I am working at now, along with an [...]]]></description>
			<content:encoded><![CDATA[<p>Today at <a href="http://www.nottingham.ac.uk/business/index.html">University of Nottingham</a>, we deployed an alpha of the People-Concept Networking platform prototype. It&#8217;s the alpha, so it doesn&#8217;t do a lot as yet and is released only for internal overview and testing of the basic infrastructure. It is however, an occasion to disclose what I am working at now, along with an introduction to some PCN theory.</p>
<p><span id="more-372"></span><strong>Disclaimer:</strong> Like it says on the <a href="http://blog.cyberborean.org/author">author page</a>, I work for UoN and Laboranova project, but I cannot speak for it officially in this blog. These are my own views as a project insider and the other&#8217;s may differ.</p>
<h2>Back story</h2>
<div class="zemanta-img zemanta-action-dragged alignright">
<div>
<dl class="wp-caption alignright" style="width: 212px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/Image:Nottingham_University_Business_School.JPG"><img title="Nottingham University Business School, Jubilee..." src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/62/Nottingham_University_Business_School.JPG/202px-Nottingham_University_Business_School.JPG" alt="Nottingham University Business School, Jubilee..." height="152" width="202"></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Nottingham University Business School, Jubilee campus<br />
(via <a href="http://commons.wikipedia.org/wiki/Image:Nottingham_University_Business_School.JPG">Wikipedia</a>)</dd>
</dl>
</div>
</div>
<p>As far back as in early 2008, I&#8217;ve been introduced into PCN proposal and invited for collaboration on a R&amp;D for its prototype implementation. It was very interesting for me and we developed a vision and basic design principles of the PCN solution to start the prototype development at the beginning of 2009.</p>
<p>This work is <a href="http://laboranova.com/tools/profile-system">a part</a> of <a href="http://laboranova.com">Laboranova</a> — a large EU project aimed at new ways of collaboration between knowledge workers and sharing ideas and competencies. Apart from PCN, there are lots of other interesting thngs the project partners do there.</p>
<h2>PCN basics</h2>
<p>The idea is a social networking where the members were connected via shared areas of expertise. These areas are identified by the topics of interests, discovered at user&#8217;s content.</p>
<p>Like other social network services connect people via shared professional activities, schools, hobbies or music tastes, PCN approach employs the shared semantics of texts the people read or write. There is an optimistic assumption that such semantics, expressed as sets of the weighted keywords (or, tag clouds), may reflect an area of user&#8217;s expertise and constitute a  profile of his professional interests.</p>
<p>Multiple user profiles are aggregated to create expertise information and form a socio-semantic network of people and concepts. Comparing profiles of different users, we can evaluate a similarity of their expertises and thus, estimate their social distance in the network. We also can take a specific area of expertise to find who are the best experts relevant to it, and explore the related overlapping areas. With this network analysis, it is possible to generate a variety of individual recommendations to help people to discover new collaboration opportunities and areas of knowledge.</p>
<h2>The Platform</h2>
<p>There is a client-server architecture including a central PCN server and a number of clients connected to it. The PCN client software is installed locally and analyses content from different locations specified by its owner: file folders, webs, email, RSS, delicious accounts, SharePoint servers and so on.</p>
<p>A user can let the software extract the keywords from the content automatically, edit the results or choose to tag the content manually. Then he chooses what locations should be submitted to the server and assigns them to one or more named <em>contexts </em>which help to organize the concepts within the user profile. Document metadata and tagging information is uploaded to the server where an individual profile of tags is created and published. As a location is submitted to the server, it is monitored for changes to synchronize the profile with the actual state of the content (by sending incremental updates at a specified time interval).</p>
<h2>The Client</h2>
<p>The&nbsp; client part is based on <a href="http://scan.sf.net">SCAN</a>, so there is a zero barrier to start working with it for SCAN users. Actually, from a SCAN user perspective, there is no difference from usual everyday work — you can enjoy a full set of features one can find in native &#8220;offline&#8221; SCAN, but also use it for populating your public profile of interests at the PCN server.</p>
<p>Also, variety of location types and document formats are supported by the client thanks to the plugins from the <a href="http://scan.sourceforge.net/?page_id=6">SCAN repository</a>.</p>
<h2>The Ontology</h2>
<p>The server receives metadata about content resources as <a href="http://sioc-project.org/">SIOC</a> RDF, so in theory, it may work with any SIOC provider, apart from the default PCN client. The server augments resource metadata with relationships to the user profile, concepts and contexts, thus forming the quadripartite PCN ontology model:</p>
<div id="attachment_380" class="wp-caption aligncenter" style="width: 385px"><img class="size-full wp-image-380" title="pcnmodel" src="http://blog.cyberborean.org/wp-content/uploads/2009/04/pcnmodel.png" alt="PCN quadripartite model" height="296" width="375"><p class="wp-caption-text">PCN quadripartite model</p></div>
<p>To describe the PCN model, we adopted <a href="http://scot-project.org/scot/">SCOT</a> (Semantic Clouds Of Tags) ontology aimed at conceptualization of the structure and&nbsp; semantics of tagging data with strong focus on social interoperability. It is an extension and further development of the <a href="http://www.holygoat.co.uk/projects/tags/">Tag Ontology</a> project that describes the relationship between an agent, an arbitrary resource, and one or more tags.</p>
<p>The SCOT (Tag) ontology is based on a tripartite (User—Tag—Resource) model. These three core concepts are connected together via a central concept  of <em>Tagging</em> representing the tagging activity. Every <em>Tagging</em> instance can be considered as a result of a single tagging action defining a user who performed it, the tagged resource and what tags have been used. It also can carry auxiliary information about the action, such as the time of tagging.</p>
<p>For users and resources, SCOT relies upon concepts from SIOC — specifically, <em>sioc:User</em> and <em>sioc:Item</em> classes. For our PCN ontology, we extended the SCOT model with the notion of&nbsp; context by adding another class of entities and a property to relate them with the <em>Tagging</em> instances.</p>
<div id="attachment_383" class="wp-caption aligncenter" style="width: 382px"><img class="size-full wp-image-383" title="pcnmodel2" src="http://blog.cyberborean.org/wp-content/uploads/2009/04/pcnmodel2.png" alt="SCOT Tagging as a skeleton of PCN model" height="298" width="372"><p class="wp-caption-text">Extended SCOT Tagging as a skeleton of the PCN model</p></div>
<p>Using SCOT Tagging model, it is possible to avoid excessive verbosity in the PCN ontology, as the relationships between core PCN classes (the edges of the tetrahedron) are inferable from their relationships with the central <em>Tagging</em> class (the skeleton). In the diagram below, the implicit relations are shown as dashed.</p>
<div id="attachment_385" class="wp-caption aligncenter" style="width: 448px"><img class="size-full wp-image-385" title="pcnontology" src="http://blog.cyberborean.org/wp-content/uploads/2009/04/pcnontology.png" alt="PCN Ontology" height="337" width="438"><p class="wp-caption-text">PCN Ontology</p></div>
<p>An interesting possibilities comes from the fact that the <em>scot:Tag</em> is actually a subclass of the <a href="http://www.w3.org/TR/swbp-skos-core-guide">SKOS</a> <em>Concept</em>, so all kinds of SKOS reasonings about the concepts are possible in the future. Moreover, <a href="http://moat-project.org/ontology">MOAT</a> features incorporated in SCOT open a way to integrate the tag descriptions with the <a href="http://linkeddata.org/">Linked Data web</a>.</p>
<h2>The API</h2>
<p>The client talks to the server via a simple RESTful API for adding and modifying the users metadata. As said above, the metadata is described with SIOC, so it is theoretically possible to use that API and integrate the PCN server with any system which can provide SIOC metadata about the content.</p>
<p>An endpoint for SPARQL queries is planned also.</p>
<h2>For more information:</h2>
<ul>
<li><a href="http://laboranova.com/tools/profile-system">An early description of the work package</a> (Laboranova Profile System) on Laboranova web-site.</li>
<li><span class="extiw">Marc Pallot et al, &#8220;</span><a class="extiw" title="bscw:d169898/050622_PA_A11_Future_Workplaces_towards_the_Collaborative_Web.pdf" href="http://www.ami-communities.net/bscw/bscw.cgi/d169898/050622%20PA%20A11%20Future%20Workplaces%20towards%20the%20Collaborative%20Web.pdf">Future Workplaces, towards the &#8216;Collaborative&#8217; Web</a>&#8220;</li>
<li>Peter Mika, &#8220;<a href="http://portal.acm.org/citation.cfm?id=1229195">Ontologies are us : A unified model of social networks and semantics</a>&#8220;</li>
<li><span class="taggedlink">Hak-Lae Kim et al, &#8220;</span><a class="taggedlink" rel="nofollow" href="http://scot-project.org/pubs/kim_ReviewAlignmentTag.pdf">Review and Alignment of Tag Ontologies for Semantically-Linked Data in Collaborative Tagging Spaces</a><span class="taggedlink">&#8220;</span><span class="taggedlink"> , &#8220;</span><a class="taggedlink" rel="nofollow" href="http://scot-project.org/pubs/Kim_TagOnt.pdf">The State of the Art in Tag Ontologies: A Semantic Model for Tagging and Folksonomies</a><span class="taggedlink">&#8220;</span></li>
<li><a href="http://scot-project.org/scot/">SCOT</a></li>
<li><a href="http://sioc-project.org/">SIOC</a></li>
</ul>
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/c4cb9714-6625-40ef-8cdc-174171e7b3a5/" title="Reblog this post [with Zemanta]"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=c4cb9714-6625-40ef-8cdc-174171e7b3a5" alt="Reblog this post [with Zemanta]"></a><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2009/04/07/people-concept-networking/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More automation</title>
		<link>http://blog.cyberborean.org/2008/01/23/more-automation</link>
		<comments>http://blog.cyberborean.org/2008/01/23/more-automation#comments</comments>
		<pubDate>Wed, 23 Jan 2008 00:07:32 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[Essays]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[Information Retrieval]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[SCAN]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[tagging]]></category>

		<guid isPermaLink="false">http://cyberborean.wordpress.com/2008/01/23/more-automation/</guid>
		<description><![CDATA[I&#8217;m thinking about new feature for SCAN — some conditional actions to be executed individually or in a batch on selected documents. It would be useful for automation of metadata setting, or for defining custom autotagging rules. An idea is borrowed from e-mail clients, where the similar feature exists for decades as the user-defined filters [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m thinking about new feature for <a href="http://scan.sf.net">SCAN</a> — some conditional actions to be executed individually or in a batch on selected documents. It would be useful for automation of metadata setting, or for defining custom autotagging rules.</p>
<p><span id="more-200"></span></p>
<p>An idea is borrowed from e-mail clients, where the similar feature exists for decades as the user-defined <a href="http://en.wikipedia.org/wiki/E-mail_filtering">filters</a> for processing the messages. This is how it looks in KMail:</p>
<p><img src="http://cyberborean.org/blog/wp-content/uploads/2008/01/kmail-filters.png" alt="kmail-filters.png" /></p>
<p>In general, a filter checks if a document matches to specific criteria (a rule) and does some action if yes. For instance, if a condition &#8220;text contains &#8216;viagra&#8217; or &#8216;cialis&#8217;&#8221; is true, then some action (&#8220;move to spam&#8221; or &#8220;send assassins to the author&#8221;) would be executed. What is especially good is that it&#8217;s old, popular and intuitive user experience.</p>
<p>In a content aggregator like SCAN, this concept may allow a user to define custom automation rules to set document metadata properties. For instance,</p>
<p><code>IF (url starts with "http://cyberborean.wordpress.com") SET author = "me"</code></p>
<p>Another using I have in my mind is to empower an &#8220;artificial intelligence&#8221; of autotagging with a human intelligence, by user-defined tagging rules:</p>
<p><code>IF (text contains "latte") ADD TAG "coffee"</code></p>
<p>I only doubt about terminology — &#8220;filter&#8221; might be confusing, as it is already used in SCAN vocabulary (URI filters to include/exclude some documents by their URI pattern). Any ideas?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2008/01/23/more-automation/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tagging &#8220;The Lord of the Rings&#8221;</title>
		<link>http://blog.cyberborean.org/2007/09/18/tagging-the-lord-of-the-rings</link>
		<comments>http://blog.cyberborean.org/2007/09/18/tagging-the-lord-of-the-rings#comments</comments>
		<pubDate>Tue, 18 Sep 2007 07:42:40 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[Essays]]></category>
		<category><![CDATA[Information Retrieval]]></category>
		<category><![CDATA[SCAN]]></category>
		<category><![CDATA[tagging]]></category>
		<category><![CDATA[tolkien]]></category>

		<guid isPermaLink="false">http://cyberborean.wordpress.com/2007/09/18/tagging-the-lord-of-the-rings/</guid>
		<description><![CDATA[There are results of experiment with using SCAN for text analysis and autotagging J.R.R. Tolkien&#8217;s &#8220;The Lord of the Rings&#8221; book. Process: Canonical LotR corpus consists of 62 chapters (arranged into six books), author&#8217;s foreword, Prologue and 6 appendices (A-F) &#8211; thus, 70 items. This documents collection (as OpenDocument files) has been indexed and autotagged [...]]]></description>
			<content:encoded><![CDATA[<p>There are results of experiment with using <a href="http://scan.sourceforge.net">SCAN</a> for text analysis and autotagging J.R.R. Tolkien&#8217;s &#8220;The Lord of the Rings&#8221; book.<br />
<span id="more-181"></span><br />
Process:<br />
Canonical LotR corpus consists of 62 chapters (arranged into six books), author&#8217;s foreword, Prologue and 6 appendices (A-F) &#8211; thus, 70 items. This documents collection (as OpenDocument files) has been indexed and autotagged with <a href="http://scan.sourceforge.net">SCAN 1.0</a>. SCAN autotagging has been set to use 10 tags per each document and maximal tags specifity (because of relatively small collection size). Additionally, each of six books has been tagged separately.</p>
<p>&#8220;Foreword&#8221;<br />
<em>chapters corrected edition experience glimpses information process readers reference story</em></p>
<p>&#8220;Prologue&#8221;<br />
<em>bilbo book copy families history hobbits shire smials thain westmarch</em></p>
<h3>Book I</h3>
<p><em>baggins bilbo bree butterbur frodo goldberry ponies sam strider tom</em></p>
<ol>
<li>&#8220;A Long-expected Party&#8221;<br />
<em>bag baggins bagginses bilbo birthday fireworks joke lobelia presents sackville</em></li>
<li>&#8220;The Shadow of the Past&#8221;<br />
<em>bilbo birthday déagol frodo gandalf gollum grandmother hated ring ted</em></li>
<li>&#8220;Three is Company&#8221;<br />
<em>bag frodo gildor lane lobelia pippin sackville sam sir sold</em></li>
<li>&#8220;A Short Cut to Mushrooms&#8221;<br />
<em>dogs farm farmer ferry frodo lane maggot mushrooms pippin waggon</em></li>
<li>&#8220;A Conspiracy Unmasked&#8221;<br />
<em>bath brandy brandybucks bucklanders fatty ferry fredegar frodo maggot merry</em></li>
<li>&#8220;The Old Forest&#8221;<br />
<em>bonfire forest hedge lilies merry path ponies tom willow withywindle</em></li>
<li>&#8220;In the House of Tom Bombadil&#8221;<br />
<em>barrows bombadil candle chimney creak derry goldberry tom wights willow</em></li>
<li>&#8220;Fog on the Barrow-Downs&#8221;<br />
<em>barrow bombadil fog goldberry hoy jogging lumpkin ponies tom wight</em></li>
<li>&#8220;At the Sign of The Prancing Pony&#8221;<br />
<em>barliman bree butterbur comer cow frodo inn landlord nob underhill</em></li>
<li>&#8220;Strider&#8221;<br />
<em>baggins bree butterbur ferny frodo landlord letter nob strider underhill</em></li>
<li>&#8220;A Knife in the Dark&#8221;<br />
<em>beren bob bree dell ferny galad gil strider tinúviel weathertop</em></li>
<li>&#8220;Flight to the Ford&#8221;<br />
<em>bone boot ford frodo glorfindel horse strider troll trolls weathertop</em></li>
</ol>
<h3>Book II</h3>
<p><em>aragorn boats boromir elrond frodo gandalf gimli haldir legolas sam</em></p>
<ol>
<li>&#8220;Many Meetings&#8221;<br />
<em>bilbo dúnadan elrond flood frodo glorfindel glóin mortals rivendell strider</em></li>
<li>&#8220;The Council of Elrond&#8221;<br />
<em>boromir elrond erestor galad gil glóin isildur radagast ring saruman</em></li>
<li>&#8220;The Ring Goes South&#8221;<br />
<em>aragorn bill boromir caradhras drift elrond frodo gandalf redhorn snow</em></li>
<li>&#8220;A Journey in the Dark&#8221;<br />
<em>bill boromir doors durin gandalf gimli howls mines moria wolves</em></li>
<li>&#8220;The Bridge of Khazad-dum&#8221;<br />
<em>balin balrog beats boromir chamber doom door drum hall mazarbul</em></li>
<li>&#8220;Lothlórien&#8221;<br />
<em>flet frodo galadhrim gimli haldir ladder legolas lothlórien nimrodel silverlode</em></li>
<li>&#8220;The Mirror of Galadriel&#8221;<br />
<em>basin celeborn frodo galadhrim galadriel haldir lady magic mirror pedestal</em></li>
<li>&#8220;Farewell to Lórien&#8221;<br />
<em>boat boats boromir cakes celeborn galadhrim galadriel gimli lady lórien</em></li>
<li>&#8220;The Great River&#8221;<br />
<em>aragorn boat boats frodo gebir log paddle paddles rapids sarn</em></li>
<li>&#8220;The Breaking of the Fellowship&#8221;<br />
<em>amon aragorn boromir brandir frodo hen lawn lhaw sam tol</em></li>
</ol>
<h3>Book III</h3>
<p><em>aragorn ents gimli isengard legolas saruman théoden treebeard uglúk éomer</em></p>
<ol>
<li>&#8220;The Departure of Boromir&#8221;<br />
<em>aragorn boat boromir galen gimli gulls legolas orcs rauros tire</em></li>
<li>&#8220;The Riders of Rohan&#8221;<br />
<em>aragorn downs entwash fangorn gimli horses legolas orcs trail éomer</em></li>
<li>&#8220;The Uruk-Hai&#8221;<br />
<em>ankles grishnákh isengarders knoll lugbúrz merry orcs pippin uglúk wrists</em></li>
<li>&#8220;Treebeard&#8221;<br />
<em>ent entish ents entwives hasty hoom isengard rowan treebeard trees</em></li>
<li>&#8220;The White Rider&#8221;<br />
<em>aragorn fangorn gandalf gimli haft legolas man old saruman treebeard</em></li>
<li>&#8220;The King of the Golden Hall&#8221;<br />
<em>aragorn gandalf gríma hall háma neighed théoden wormtongue éomer éowyn</em></li>
<li>&#8220;Helm&#8217;s Deep&#8221;<br />
<em>aragorn coomb deeping dike erkenbrand gamling helm hornburg westfold éomer</em></li>
<li>&#8220;The Road to Isengard&#8221;<br />
<em>caverns caves fords gandalf gimli isen isengard legolas saruman théoden</em></li>
<li>&#8220;Flotsam and Jetsam&#8221;<br />
<em>barrels ent ents gimli huorns isengard pipe quickbeam saruman treebeard</em></li>
<li>&#8220;The Voice of Saruman&#8221;<br />
<em>dismissed ents gandalf injuries orthanc rail saruman spell théoden treebeard</em></li>
<li>&#8220;The Palantír&#8221;<br />
<em>ball bracken gandalf globe orthanc palantíri pippin saruman shadowfax wizard</em></li>
</ol>
<h3>Book IV</h3>
<p><em>faramir frodo gollum nice precious rope sam shagrat shelob sméagol</em></p>
<ol>
<li>&#8220;The Taming of Sméagol&#8221;<br />
<em>cliff fix frodo gollum knot precious rope sam sméagol yess</em></li>
<li>&#8220;The Passage of the Marshes&#8221;<br />
<em>fish frodo gollum gully marshes mires nice precious sam sméagol</em></li>
<li>&#8220;The Black Gate is Closed&#8221;<br />
<em>frodo gollum helps lithui master nice oliphaunt oliphaunts sam sméagol</em></li>
<li>&#8220;Of Herbs and Stewed Rabbit&#8221;<br />
<em>coney fern gollum herbs mablung pans rabbits sam sméagol taters</em></li>
<li>&#8220;The Window on the West&#8221;<br />
<em>arts blindfold boromir damrod faramir frodo isildur mablung men mithrandir</em></li>
<li>&#8220;The Forbidden Pool&#8221;<br />
<em>anborn faramir fish fissh frodo gollum precious protection sly sméagol</em></li>
<li>&#8220;Journey to the Cross-roads&#8221;<br />
<em>brewing decent faramir frodo glare gollum mould sam staves thorns</em></li>
<li>&#8220;The Stairs of Cirith Ungol&#8221;<br />
<em>dad frodo gollum morgul sam sméagol sneaking stairway wink wraith</em></li>
<li>&#8220;Shelob&#8221;<br />
<em>frodo glass gollum lair phial sam shelob sméagol stench tunnel</em></li>
<li>&#8220;The Choices of Master Samwise&#8221;<br />
<em>cords frodo gorbag lads ladyship lugbúrz sam shagrat shelob tunnel</em></li>
</ol>
<h3>Book V</h3>
<p><em>aragorn beregond city denethor faramir ghân men pippin éomer éowyn</em></p>
<ol>
<li>&#8220;Minas Tirith&#8221;<br />
<em>beregond bergil citadel city denethor forlong ingold mithrandir pippin street</em></li>
<li>&#8220;The Passing of the Grey Company&#8221;<br />
<em>aragorn burg elladan erech gimli halbarad king legolas ride théoden</em></li>
<li>&#8220;The Muster of Rohan&#8221;<br />
<em>dwimorberg edoras harrowdale hirgon king merry ride théoden éomer éowyn</em></li>
<li>&#8220;The Siege of Gondor&#8221;<br />
<em>beregond citadel city denethor faramir gandalf garrison pelennor pippin retreat</em></li>
<li>&#8220;The Ride of the Rohirrim&#8221;<br />
<em>buri dernhelm elfhelm ghân men stonewain théoden wild éomer éored</em></li>
<li>&#8220;The Battle of the Pelennor Fields&#8221;<br />
<em>dernhelm harlond king knights mûmakil snowmane southrons théoden éomer éowyn</em></li>
<li>&#8220;The Pyre of Denethor&#8221;<br />
<em>beregond bier burn city denethor faramir gandalf healing oil thou</em></li>
<li>&#8220;The Houses of Healing&#8221;<br />
<em>aragorn athelas bergil faramir healing imrahil ioreth sick éomer éowyn</em></li>
<li>&#8220;The Last Debate&#8221;<br />
<em>aragorn gimli gulls imrahil lamedon lebennin legolas pelargir ships thousands</em></li>
<li>&#8220;The Black Gate Opens&#8221;<br />
<em>army captains heralds imrahil lieutenant messenger morannon sauron terms thou</em></li>
</ol>
<h3>Book VI</h3>
<p><em>cotton faramir frodo lotho rosie ruffians sam shagrat sharkey éowyn</em></p>
<ol>
<li>&#8220;The Tower of Cirith Ungol&#8221;<br />
<em>court frodo gorbag ladder orc sam shagrat shelob snaga turret</em></li>
<li>&#8220;The Land of Shadow&#8221;<br />
<em>frodo isenmouthe morgai orc range sam shagrat spur tracker whip</em></li>
<li>&#8220;Mount Doom&#8221;<br />
<em>cone frodo gaping gollum load masster mountain sam sammath tearing</em></li>
<li>&#8220;The Field of Cormallen&#8221;<br />
<em>captains eagles frodo gwaihir isle knights merriment praise pure sam</em></li>
<li>&#8220;The Steward and the King&#8221;<br />
<em>aragorn city faramir healer healing ioreth king lady warden éowyn</em></li>
<li>&#8220;Many Partings&#8221;<br />
<em>arwen beggar celeborn hoom orthanc théoden treebeard wain éomer éowyn</em></li>
<li>&#8220;Homeward Bound&#8221;<br />
<em>barliman bill bree butterbur deadmen ferny gandalf nob pony troubles</em></li>
<li>&#8220;The Scouring of the Shire&#8221;<br />
<em>cotton farmer hob lotho ruffians sharkey sheds shirriff shirriffs village</em></li>
<li>&#8220;The Grey Havens&#8221;<br />
<em>bywater cotton deputy elanor frodo married mayor rosie ruffians sam</em></li>
</ol>
<h3>Appendices</h3>
<ul>
<li>A. &#8220;Annals of the kings and rulers&#8221;<br />
<em>arthedain arvedui eldacar eärnil gondor king náin tar thráin witch</em></li>
<li>B. &#8220;The Tale of Years&#8221;<br />
<em>begins birth guldur king meets reaches samwise sauron sets thranduil</em></li>
<li>C. &#8220;Family Trees&#8221;<br />
<em>addition appendix birth blanco family guests names party recorded recounted</em></li>
<li>D. &#8220;Shire Calendar&#8221;<br />
<em>calendar corresponded eldar lithe months names quenya reckoning week yule</em></li>
<li>E. &#8220;Writing and spelling&#8221;<br />
<em>english languages letters pronounced quenya represented represents series sindarin vowel</em></li>
<li>F. &#8220;The languages and peoples of the Third Age&#8221;<br />
<em>english languages letters pronounced quenya represented represents series sindarin vowel</em></li>
</ul>
<h3>Resulting Tags Cloud</h3>
<p><a href='http://cyberborean.org/blog/wp-content/uploads/2007/09/lotrtags.png' title='lotrtags.png'><img src='http://cyberborean.org/blog/wp-content/uploads/2007/09/lotrtags.png' alt='lotrtags.png' /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2007/09/18/tagging-the-lord-of-the-rings/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>URL&#8217;s in Java: Another pitfall</title>
		<link>http://blog.cyberborean.org/2007/08/22/urls-in-java-another-pitfall</link>
		<comments>http://blog.cyberborean.org/2007/08/22/urls-in-java-another-pitfall#comments</comments>
		<pubDate>Wed, 22 Aug 2007 12:58:52 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[Essays]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://cyberborean.wordpress.com/2007/08/22/urls-in-java-another-pitfall/</guid>
		<description><![CDATA[If ClassLoader Delegation, though esoteric and counterintuitive, is an example of some design, there are some things in Java that are confusing and just poorly designed at once. When testing my new Java application, I noticed strange freezing sometimes. It happened irregularly and the program did nothing serious at that time &#8211; no complex calculations, [...]]]></description>
			<content:encoded><![CDATA[<p><em>If <a href="http://cyberborean.wordpress.com/2007/07/04/custom-classloaders-the-black-art-of-java/">ClassLoader Delegation</a>, though esoteric and counterintuitive, is an example of some design, there are some things in Java that are  confusing and just poorly designed at once.</em></p>
<p><span id="more-174"></span></p>
<p>When testing my new Java application, I noticed strange freezing sometimes. It happened irregularly and the program did nothing serious at that time &#8211; no complex calculations, no heavy data transfers, etc. Nevertheless, I noticed that those freezings where related to my internet connection glitches &#8211; unfortunately, it occasionally happens here. But my program didn&#8217;t do anything with internet at those moments!</p>
<p>I did some profiling and found the bottleneck &#8211; to my surprise, it was <code>get()</code> method of a <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/HashMap.html"><code>HashMap</code></a> instance. Sometimes it took about 20 seconds only for just checking if an object exists in the map. I was shocked. HashMaps! I used it for ages and was sure they are reasonably fast kind of collections.</p>
<p>One way or another, I found the problem. The point was that I used <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URL.html"><code>java.net.URL</code></a> instances as the HashMap keys. <code>URL</code> objects in Java, in comparison with simple strings, are convenient as they store URLs as the sets of separate fields (protocol, host, path etc), guarantee URL well-formedness and enable to create a connection with a single <code>connect()</code> method.</p>
<p>But its implementation is horrible. As it <a href="http://kickjava.com/src/java/net/URL.java.htm">turned out</a>, two generic object methods &#8211; <code>equals()</code> and <code>hashCode()</code> needed for internet connection and domain name resolving just to check equality of two URLs or to compute object&#8217;s hash code.</p>
<blockquote><p>Two URL objects are equal if they have the same protocol, reference equivalent hosts, have the same port number on the host, and the same file and fragment of the file.</p>
<p>Two hosts are considered equivalent if both host names can be resolved into the same IP addresses; else if either host name can&#8217;t be resolved, the host names must be equal without regard to case; or both host names equal to null.</p>
<p>Since hosts comparison requires name resolution, this operation is a blocking operation.</p>
<p>(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URL.html"><code>java.net.URL</code> javadoc</a>)</p></blockquote>
<p>I have no idea what were the reasons to do that, but it is bad. Simply bad. Such common operations as equality test (and hash code computation) should rely on an object data only. Making it dependent on external unreliable resources is dangerous. Also, those operations must be fast as possible, because they are called frequently (often inside the loops). When the time of their execution is equal to the connection time-out, your program simply don&#8217;t work.</p>
<p>Even if there were some reasons for that, it works wrong.</p>
<blockquote><p>Note: The defined behavior for equals is known to be inconsistent with virtual hosting in HTTP.</p>
<p>(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URL.html">Ibid.</a>)</p></blockquote>
<p>Sure. For instance, URLs of all WordPress blogs are equal from point of view of <code>java.net.URL</code>, as long as all of them are resolved to the same IP address. And a whole lot of other web-sites, unless they are hosted on the dedicated servers.</p>
<p>URLs are just the text strings with known syntax. They should work offline, no matter they are &#8220;http:&#8221; or &#8220;file:&#8221;. They don&#8217;t need to be resolved to the IP addresses, unless a referenced resource is requested.</p>
<p>Do not use <code>java.net.URL</code>. Store URLs as simple String objects. If you need to keep URLs structured and well-formed, you can use <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URI.html"><code>java.net.URI</code></a> class instead, but the strings are faster anyway. You always can parse a string into <code>java.net.URI</code> object when it is needed. You can parse it into <code>java.net.URL</code> as well, but.. better don&#8217;t do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2007/08/22/urls-in-java-another-pitfall/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Custom ClassLoaders: The Black Art of Java</title>
		<link>http://blog.cyberborean.org/2007/07/04/custom-classloaders-the-black-art-of-java</link>
		<comments>http://blog.cyberborean.org/2007/07/04/custom-classloaders-the-black-art-of-java#comments</comments>
		<pubDate>Wed, 04 Jul 2007 07:19:12 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[Essays]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://cyberborean.wordpress.com/2007/07/04/custom-classloaders-the-black-art-of-java/</guid>
		<description><![CDATA[Java is great platform for component development but there are some odd and counterintuitive things on the way. One of these hidden pitfalls waiting for a developer who is going to replace default system ClassLoader with a custom one. A common case when you might have an idea of using a custom ClassLoader is to [...]]]></description>
			<content:encoded><![CDATA[<p><em>Java is great platform for component development but there are some odd and counterintuitive things on the way. One of these hidden pitfalls waiting for a developer who is going to replace default system ClassLoader with a custom one.</em></p>
<p><span id="more-172"></span></p>
<p>A common case when you might have an idea of using a custom ClassLoader is to avoid the classpath issues using <code><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLClassLoader.html">URLClassLoader</a></code> for loading classes instead of the default one. Classpath is a list of locations (JAR-files or directories) where default ClassLoader is looking for the classes to load. Declaring Classpath explicitly (either with <code>CLASSPATH</code> environment variable, or as a command-line argument of Java virtual machine) is tedious and error-prone job and it works only in the case of monolithic, statically-linked applications with known set of libraries.</p>
<p>But imagine a complex component-based system with a number of replaceable modules (plug-ins). It is obvious that classpath for that system should be built automatically to reflect the configuration changes before each running. It is often  done with system-specific startup scripts which analyzes the modules configuration and generates an appropriate classpath before starting the application. However, this method has its own drawbacks &#8211; especially in the case of poor Microsoft systems as their rudimentary command interpreter makes this task hardly possible. And this is a way system-dependent, of course.</p>
<p><code>URLClassLoader</code>, from a distant point of view, looks like an elegant, simple and &#8220;100%-pure-java&#8221; solution for the classpath headache. It is instantiated with an array of locations (URL&#8217;s) so each class loaded with that ClassLoader will use this array as a classpath. An advantage is that the classpath can be generated on the fly, automatically by an application itself.</p>
<p>So, let&#8217;s see how it works. Imagine we have an application with main executable class <code>Foo</code> (in package <code>com.example.foo</code>) and a lot of other classes in different locations. We will develop an invocation wrapper for loading <code>Foo</code> using URLClassLoader with an array of locations, generated automatically:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/*
 * FooInvoker.java
 */</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.example.foo</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.URL</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.URLClassLoader</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.lang.reflect.Method</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.lang.reflect.Modifier</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> FooInvoker <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">String</span> FOO_CLASS_NAME <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;com.example.foo.Foo&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">URL</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> classpathURLs <span style="color: #339933;">=</span> getClasspathURLs<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">ClassLoader</span> loader <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">URLClassLoader</span><span style="color: #009900;">&#40;</span>classpathURLs<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">Class</span> fooClass <span style="color: #339933;">=</span> loader.<span style="color: #006633;">loadClass</span><span style="color: #009900;">&#40;</span>FOO_CLASS_NAME<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #003399;">Method</span> main <span style="color: #339933;">=</span> fooClass.<span style="color: #006633;">getMethod</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;main&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000000; font-weight: bold;">Class</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span>.<span style="color: #000000; font-weight: bold;">class</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">int</span> modifiers <span style="color: #339933;">=</span> main.<span style="color: #006633;">getModifiers</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Modifier</span>.<span style="color: #006633;">isPublic</span><span style="color: #009900;">&#40;</span>modifiers<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #003399;">Modifier</span>.<span style="color: #006633;">isStatic</span><span style="color: #009900;">&#40;</span>modifiers<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                main.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">null</span>, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #666666; font-style: italic;">// In this example, we assume Foo.main() takes no</span>
                <span style="color: #666666; font-style: italic;">// command-line arguments</span>
            <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">NoSuchMethodException</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003399;">System</span>.<span style="color: #006633;">err</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Error running class &quot;</span> <span style="color: #339933;">+</span> FOO_CLASS_NAME
                    <span style="color: #339933;">+</span> e.<span style="color: #006633;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">URL</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> getClasspathURLs<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">URL</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> urls <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">URL</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">// Here we're looking for all project-related libraries</span>
        <span style="color: #666666; font-style: italic;">// and constructing the classpath array</span>
        <span style="color: #666666; font-style: italic;">// ...</span>
        <span style="color: #000000; font-weight: bold;">return</span> urls<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Run it (assuming <code>Foo</code> and <code>FooInvoker</code> are packaged both into <code>foo.jar</code> file, which is the core library of our app):</p>
<pre>$ java -classpath ./foo.jar com.example.foo.FooInvoker</pre>
<p>Alas! Everything located outside the <code>foo.jar</code> (that is, the classpath set in JVM arguments) is failed to load. For instance, if <code>Foo</code> uses class <code>Bar</code> in it&#8217;s own <code>bar.jar</code> library, <code>Foo</code> will throw <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ClassNotFoundException.html"><code>ClassNotFoundException</code> </a> despite of the fact that <code>bar.jar</code> has been passed to <code>URLClassLoader</code> argument. It seems we have no progress at all &#8211; all classes are loaded from default JVM classpath as with the system ClassLoader.</p>
<p>Let&#8217;s do some debugging. Add this to <code>Foo.main()</code> code to see which ClassLoader loads <code>Foo</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Foo is loaded with: &quot;</span> <span style="color: #339933;">+</span>
                           Foo.<span style="color: #000000; font-weight: bold;">class</span>.<span style="color: #006633;">getClassLoader</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getClass</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Instead of &#8220;<code>java.net.URLClassLoader</code>&#8221; in output (as we hoped), we will see:</p>
<pre><code>Foo is loaded with: sun.misc.Launcher$AppClassLoader</code></pre>
<p>This is the default system ClassLoader. We really have no progress &#8211; it seems our <code>URLClassLoader</code> simply does not come into play. Our code is right but it doesn&#8217;t work. Is it a Java bug? Should we give up? Or report to Sun?</p>
<p>Wait a minute. The problem is not in code but in how Java VM executes it. Let&#8217;s try a trick: change <code>FooInvoker.getClasspathURLs()</code> algorythm to include <code>foo.jar</code> path in the resulted array (to be passed to <code>URLClassLoader</code> among other locations) and compile <code>FooInvoker</code> as a separate class file (not inside the <code>foo.jar</code>). Then run it (no classpath is declared!):</p>
<pre><code>$ java com.example.foo.FooInvoker
...
Foo is loaded with: java.net.URLClassLoader
</code></pre>
<p>Voila! Our <code>URLClassLoader</code> has been used to load <code>Foo</code> as well as other classes, including those from locations in our dynamic classpath. It works! So what is happened?</p>
<p>In this case we found ourselves in one of the dark and odd Java territories ruled by the Masters of The Black Java Art (also known as the Heavy Java Geeks) who believe the programs should not behave as their author expects, but following the mysterious Rules instead. One of those Rules is called &#8220;ClassLoader Delegation Model&#8221; and it <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ClassLoader.html">reads</a>:</p>
<blockquote><p> The ClassLoader class uses a delegation model to search for classes and resources. Each instance of ClassLoader has an associated parent class loader. When requested to find a class or resource, a ClassLoader instance will delegate the search for the class or resource to its parent class loader before attempting to find the class or resource itself.</p></blockquote>
<p>A parent of <code>URLClassLoader</code> is the default system ClassLoader (as we used single-argument constructor). When we tried to load <code>Foo</code> with an instance of <code>URLClassLoader</code>, it asked the parent if  the latter could load <code>Foo</code>. As <code>Foo</code> was in the default classpath, the system ClassLoader, of course, could. By this way, it took a position of a default ClassLoader in a chain of subsequent class invocations and left our <code>URLClassLoader</code> out of business.</p>
<p>When we moved <code>Foo</code> and everything out the default classpath, the system ClassLoader was not able to load anything (except <code>FooInvoker</code> itself). So, it had no chance to took precedence over our custom ClassLoader.</p>
<p>Well, if you like rules, there is another one:</p>
<p><strong>If you use custom ClassLoader, do not give the system one a chance to come into play.</strong></p>
<p>Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2007/07/04/custom-classloaders-the-black-art-of-java/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>What do the tags mean from IR perspective?</title>
		<link>http://blog.cyberborean.org/2007/06/04/what-do-the-tags-mean-from-ir-perspective</link>
		<comments>http://blog.cyberborean.org/2007/06/04/what-do-the-tags-mean-from-ir-perspective#comments</comments>
		<pubDate>Mon, 04 Jun 2007 08:49:25 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[Essays]]></category>
		<category><![CDATA[Information Retrieval]]></category>
		<category><![CDATA[tagging]]></category>
		<category><![CDATA[tfidf]]></category>

		<guid isPermaLink="false">http://cyberborean.wordpress.com/2007/06/04/what-do-the-tags-mean-from-ir-perspective/</guid>
		<description><![CDATA[I&#8217;m trying to define the popular concept of &#8220;tags&#8221; in terms of the Information Retrieval and to find an appropriate algorithmic strategy for to automate the processes of choosing the tags for text documents. The tags are a handy intuitive concept for labeling and describing the pieces of information. They are usually assigned informally, and [...]]]></description>
			<content:encoded><![CDATA[<p><em>I&#8217;m trying to define the popular concept of &#8220;tags&#8221; in terms of the Information Retrieval and to find an appropriate algorithmic strategy for to automate the processes of choosing the tags for text documents.</em></p>
<p><span id="more-169"></span>The tags are a handy intuitive concept for labeling and describing the pieces of information. They are usually assigned informally, and as for any matter of  &#8220;a common sense&#8221;, it is difficult to find their formal definition. It is even more difficult to reproduce and algorithmize the mental processes of tag choosing.</p>
<p>To avoid that fruitless work, I will consider some IR approaches which may be used for evaluation the document terms as the possible tag candidates. For to make that evaluation possible, two important purposes of the tags may be identified:</p>
<ul>
<li><strong>Differentiation<br />
</strong>To name a thing means to separate it from others. So, a good tag should identify a document by showing its unique feature &#8211; how the document differs from other documents in a corpus.</li>
<li><strong>Unification</strong><br />
A tag should also identify a semantic group to which the document belongs.</li>
</ul>
<p>These two key properties seem totally different and even mutually opposite and discordant. Nevertheless, they are both important and <em>the best</em> tags perhaps integrates both properties in a dialectical way. Brief analysis of human-assigned tags on popular social web-services confirmed that assumption.</p>
<h3>Traditional keyword extraction: TFIDF</h3>
<p>The first strategy of autotagging is based on a popular term weighting technique, proposed by classical IR discipline. This technique is called shortly as <a href="http://en.wikipedia.org/wiki/TFIDF">TFIDF</a> and this abbreviation reflects the basic formula for calculating a measure of relevance (or, &#8220;weight&#8221;) of a specific term in a given document: <em>Term Frequency x Inverted Document Frequency</em>.<br />
Though there is a number of variations of this formula (differ in various normalization techniques), the basic idea behind them is the same: weight of a term in a document is directly proportional to the number of times the term appears in the document (<em>Term Frequency, TF</em>) and inversely proportional to the total number of documents containing this term (<em>Document Frequency, DF</em>).</p>
<p>This weighting scheme allows to effectively filter out so-called &#8220;common words&#8221; (with high DF) as well as the rare terms and misspellings (with low TF and DF both). The terms with high TF and relatively low DF got highest &#8220;importance&#8221; ranks and can be considered as possible candidates to tags.</p>
<p>Thus, TFIDF-based document tagging strategy may be described as follows:</p>
<ol>
<li>Build a list of all unique terms of a given document (term vector)</li>
<li>Calculate TFIDF weight for each term in the list</li>
<li>Sort the terms by their TFIDF weights</li>
<li>Select <em>N</em> topmost terms, where <em>N</em> is a number of tags we want to assign for each document. We can also choose another method of tags number limitation, e.g. to select the terms above specified TFIDF threshold.</li>
</ol>
<h3> Improved autotagging strategies</h3>
<p>The problem with reviewed simple TFIDF-based analysis is that it conflicts with the second part of our definition of the tags purpose: <em>unification</em>. Reviewed approach is good when we need to know what terms make a document different from others, but it doesn&#8217;t help if we need to select the terms which connect the document with its counterparts.</p>
<p>With this technique, the &#8220;tags cloud&#8221; tends to grow proportionally to the number of indexed documents with minimization of the number of documents per single tag at the same time. In an ideal case, it leads to the situation when each tag corresponds to an unique document. Such level of granularity is not what we want if we are going to control our taxonomy size and care about grouping function of our tags. The tags which would contribute into documents unification and grouping are overlooked by that algorithm because their DF&#8217;s are higher than of those contributing into a document uniqueness. We could smooth that effect by reduction an influence of DF parameter, but it increases the risk of appearing the common words as the document tags. Obviously, tweaking the basic TFIDF formula is not a solution for this problem.</p>
<p>To implement better autotagging strategy (which would consider a documents grouping factor), we need to analyze a document together with its semantic context &#8211; that is a cluster of documents including an initial document plus the documents similar to it. TFIDF ranking algorithm applied to that cluster gives us the terms relevant to the whole group, while the common words are still effectively suppressed. There is a high probability that the documents inside the cluster are mutually similar to each other, thus this strategy tends to re-use the same tag set for semantically related documents, as possible.</p>
<p>An easy way to find the document similarities is to build the document term vector (as we did before) and to issue it (or its highest ranked part) to a search system. Some search engines implement &#8220;more-like-this&#8221; feature that works the same way. The better results may be achieved if the search system allows to set a &#8220;boost factor&#8221; for separate query terms, proportionally to their weights in the term vector. Then, we just select the search results (above specific threshold) as the documents similar to the given one.</p>
<p>The whole strategy may looks like:</p>
<ol>
<li>Find a set of documents, similar to a given document.</li>
<li>Build a <em>composite term vector</em> as an union of term vectors of the given document and its similarities.</li>
<li>Calculate TFIDF term weights against the composite term vector.</li>
<li>Sort the terms by their TFIDF weights</li>
<li>Select topmost terms as the document tags</li>
</ol>
<p>By tweaking the similarity thresholds and TFIDF normalizing (e.g. considering  similarity coefficients in TFIDF calculation), we can adjust the results to get &#8220;more specific&#8221; or &#8220;more general&#8221; set of the tags (differentiation/unification balance), depending on our goals.</p>
<p>Another improved autotagging strategy may be implemented as an adaptive technique where TFIDF evaluation takes into account whether a given term is already a tag or not. But this approach strictly depends on an initial tag set and likely, will require some manual tagging before it could be used in auto mode.</p>
<blockquote><p><em>P.S. If you found this article useful, please consider to participate in <a href="http://cyberborean.wordpress.com/2007/03/26/survey-how-do-you-find-your-documents/">this survey</a>. It will help the author in his further work on this subject. Thanks!</em></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2007/06/04/what-do-the-tags-mean-from-ir-perspective/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Survey: How do you find your documents?</title>
		<link>http://blog.cyberborean.org/2007/03/26/survey-how-do-you-find-your-documents</link>
		<comments>http://blog.cyberborean.org/2007/03/26/survey-how-do-you-find-your-documents#comments</comments>
		<pubDate>Mon, 26 Mar 2007 15:50:00 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[Essays]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[IA]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[survey]]></category>
		<category><![CDATA[tagging]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://cyberborean.wordpress.com/2007/03/26/survey-how-do-you-find-your-documents/</guid>
		<description><![CDATA[For my ongoing research, it would be helpful to gather some feedback from random people on their personal document management, navigation and information seeking preferences. Please send your answers to alexeya (at) gmail (dot) com or just attach a comment below. Thanks in advance! When you are looking for a document on your machine, the [...]]]></description>
			<content:encoded><![CDATA[<p>For my ongoing research, it would be helpful to gather some feedback from random people on their personal document management, navigation and information seeking preferences. Please send your answers to alexeya (at) gmail (dot) com or just attach a comment below. Thanks in advance!</p>
<p><span id="more-153"></span></p>
<ol>
<li><strong>When you are looking for a document on your machine, the following navigation hints are important (specify an order, e.g. &#8220;a, d, c, b&#8221;):</strong></li>
<p>a. File name<br />
b. File name and folder<br />
c. Date of creation/modification<br />
d. Document metadata properties<br />
e. Full-text search results</p>
<li><strong>Do you use document titles (or another semantic data) as the file names?</strong></li>
<p>a. Yes, always<br />
b. For important documents only<br />
c. Don&#8217;t care about the file names</p>
<li><strong>Do you keep a sort of semantic folder structure for storing your documents?</strong></li>
<p>a. Yes, and I keep all my documents in a single folders hierarchy, organized semantically<br />
b. Yes, but use the structure for important documents only<br />
c. Use random folder structures, depending on a context of my work<br />
d. Don&#8217;t care about where I&#8217;m saving my files</p>
<li><strong>Do you use document shortcuts (Windows) or symbolic links (*nix) for improving  navigation?</strong></li>
<p>a. Yes, often<br />
b. Rarely<br />
c. No</p>
<li><strong>How often do you use the system full-text search for finding a specific document?</strong></li>
<p>a. This is my everyday way of finding the documents<br />
b. Only when I need to find the document quickly<br />
c. Only when I gave up to find the document by other ways<br />
d. Only when I&#8217;m not sure the document on this topic exists<br />
e. Never use the search for this purpose</p>
<li><strong>Do you use &#8220;advanced search&#8221; capabilities?</strong></li>
<p>a. Yes, often<br />
b. Rarely<br />
c. No, basic search is enough</p>
<li><strong>Do you use the system &#8220;Recent documents&#8221; list?</strong></li>
<p>a. Yes, often<br />
b. Rarely<br />
c. No</p>
<li><strong>Do you enter the metadata (title, author, subject, keywords etc) in the &#8220;Document properties&#8221; dialog box of your text editor?</strong></li>
<p>a. Yes, always<br />
b. For important documents only<br />
c. Don&#8217;t care about it</p>
<li><strong>How do you mark an importance of a document?</strong></li>
<p>a. Place it into a special folder<br />
b. Place it on the desktop<br />
c. Bookmark it (place into the &#8220;Favorites&#8221;)<br />
d. Do nothing</p>
<li><strong>How many documents (in percentage against all documents on your machine) are used actively?</strong></li>
<li><strong>How do you handle outdated documents?</strong></li>
<p>a. Keep them in place<br />
b. Move to a special folder<br />
c. Move to backup media, then delete<br />
d. Delete them</p>
<li><strong>Which formats you use for the text documents </strong><strong>(specify in order of importance, e.g. &#8220;a, d, c, b&#8221;):</strong></li>
<p>a. MS Word<br />
b. OpenDocument<br />
c. PDF<br />
d. HTML<br />
e. XML or SGML (DocBook etc)<br />
f.  Plain text<br />
g. Other</p>
<li><strong>Do you save online documents on your local hard drive?</strong></li>
<p>a. Yes, often<br />
b. Save important or very large documents only<br />
c. Never</p>
<li><strong>Do you keep a sort of a personal electronic library?</strong></li>
<p>a. Yes<br />
b. No</p>
<li><strong>Do you use specialized software for photo albums or multimedia collections management?</strong></li>
<p>a. Yes<br />
b. No, standard system tools are enough</p>
<li><strong>How do you estimate efforts on supporting your local document collections?</strong></li>
<p>a. It is a burden, it takes a lot of my time and harms for my work<br />
b. It takes some time but it worths it<br />
c. It is not a problem with help of the modern desktops<br />
d. Do not see any problem</p>
<li><strong>Do you use <a href="http://del.icio.us">del.icio.us</a>?</strong></li>
<p>a. Yes, for every interesting stuff I meet on the Web<br />
b. Yes, for important links only<br />
c. Yes, for links I want to share with somebody else<br />
d. No</p>
<li><strong>How many tags are in your del.icio.us profile?</strong></li>
<li><strong>How many del.icio.us tags you usually assign per a single link (in average)?</strong></li>
<li><strong>When choosing the del.icio.us tags, you prefer</strong></li>
<p>a. Your own tags<br />
b. Other&#8217;s tags, suggested  by the service</p>
<li><strong>When choosing the del.icio.us tags, you prefer to</strong></li>
<p>a. Reuse the existing tags, as possible<br />
b. Create new tags</p>
<li><strong> Do you try to avoid tags synonymity?</strong></li>
<p>a. Yes<br />
b. No, I don&#8217;t care about synonyms</p>
<li><strong>Do you use tag bundles?</strong></li>
<p>a. Yes<br />
b. No</p>
<li><strong>Which factors are important for tags selection </strong><strong>(specify in order of importance, e.g. &#8220;a, d, c, b&#8221;)?</strong></li>
<p>a. My own subjective associations<br />
b. My vision of of the implicit topic semantics (tend to be objective)<br />
c. Explicit textual properties of the document (terms frequency, etc)<br />
d. Tags, assigned by other people</p>
<li><strong>The best synonym of  the&#8221;tag&#8221; is:</strong></li>
<p>a. Category<br />
b. Term<br />
c. Topic<br />
d. Keyword<br />
e. Label</p>
<li><strong>The purpose of the tags is:</strong></li>
<p>a. Distinction<br />
b. Unification</p>
<li><strong>A number of tags per document is a measure of:</strong></li>
<p>a. Document importance<br />
b. Information diversity<br />
c. Collection size<br />
d. Selection quality</p>
<li><strong>Would automatical tags generation be useful?</strong></li>
<p>a. Yes, and it could completely replace human brains in this area<br />
b. Yes, but it matters as a help for human brains only<br />
c. No, the tags should belong to humans</ol>
<p>Thank you!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2007/03/26/survey-how-do-you-find-your-documents/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Getting new mail onto the desktop</title>
		<link>http://blog.cyberborean.org/2006/09/12/getting-new-mail-onto-the-desktop</link>
		<comments>http://blog.cyberborean.org/2006/09/12/getting-new-mail-onto-the-desktop#comments</comments>
		<pubDate>Tue, 12 Sep 2006 15:24:56 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[Essays]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[PIM]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://cyberborean.wordpress.com/2006/09/12/getting-new-mail-onto-the-desktop/</guid>
		<description><![CDATA[I had nice last weekend gathering new harvest of apples, drinking fresh apple juice and playing with SuperKaramba widgets &#8211; a good opportunity to take a sort of &#8220;recreational programming&#8221;. Perhaps all modern KDE users know those nice resource eaters eye-candies which are living right on the desktop surface and displaying the clocks, calendars, weather [...]]]></description>
			<content:encoded><![CDATA[<p>I had nice last weekend gathering new harvest of apples, drinking fresh apple juice and playing with <a href="http://netdragon.sourceforge.net">SuperKaramba</a> widgets &#8211; a good opportunity to take a sort of &#8220;recreational programming&#8221;. Perhaps all modern KDE users know those nice <s>resource eaters</s> eye-candies which are living right on the desktop surface and displaying the clocks, calendars, weather forecasts, system monitors and so on.</p>
<p>Instead of developing some Yet Another Big Animated Clock, I decided to write something practical. What I&#8217;d like to have is a widget which would ask my e-mail client (<a href="http://kmail.kde.org">KMail</a>) for the headers of the latest unread messages to show them on the desktop.<br />
<span id="more-133"></span></p>
<p><img src="http://cyberborean.org/blog/wp-content/uploads/2006/09/skkmail.jpg" alt="skkmail.jpg" /></p>
<p>Two buttons in the top bar are for checking new mail from a server and for opening new message window. Clicking on the top bar somewhere else will open main KMail window.</p>
<p>SuperKaramba comes with a <a href="http://netdragon.sourceforge.net/api.html">Python API</a>, so everyone who is familiar with Pyton basics can write her own widget (aka &#8220;theme&#8221;) as a Python script. In my case, I wrote two scripts &#8211; one is for widget output and another as a simple KMail folder API wrapped around DCOP calls.</p>
<h3>Patching KMail</h3>
<p>There was a major problem &#8211; KMail DCOP interface had no a call to get unread message headers; only getting a number of them is possible. So I have had to dig into the KMail sourcecode (my current version is 1.9.4) for to add new function to FolderIFace interface (<code>folderIface.cpp</code>).</p>
<h4><code>kmail.diff:</code></h4>

<div class="wp_syntax"><div class="code"><pre class="diff" style="font-family:monospace;">diff kmail/folderIface.cpp kmail_patched/folderIface.cpp
<span style="color: #440088;">147a148,162</span>
<span style="color: #00b000;">&gt; QStringList</span>
<span style="color: #00b000;">&gt; FolderIface::unreadMessageHeaders<span style="">&#40;</span><span style="">&#41;</span></span>
<span style="color: #00b000;">&gt; <span style="">&#123;</span></span>
<span style="color: #00b000;">&gt;      QStringList msgs;</span>
<span style="color: #00b000;">&gt;      mFolder-&gt;open<span style="">&#40;</span><span style="">&#41;</span>;</span>
<span style="color: #00b000;">&gt;      for<span style="">&#40;</span> int i = <span style="">0</span>; i &amp;amp;lt; mFolder-&gt;count<span style="">&#40;</span><span style="">&#41;</span>; i++<span style="">&#41;</span> <span style="">&#123;</span></span>
<span style="color: #00b000;">&gt;          KMMsgBase *msg = mFolder-&gt;getMsgBase<span style="">&#40;</span>i<span style="">&#41;</span>;</span>
<span style="color: #00b000;">&gt; 	     if <span style="">&#40;</span>msg-&gt;isNew<span style="">&#40;</span><span style="">&#41;</span> || msg-&gt;isUnread<span style="">&#40;</span><span style="">&#41;</span><span style="">&#41;</span> <span style="">&#123;</span></span>
<span style="color: #00b000;">&gt; 	       msgs.append<span style="">&#40;</span>msg-&gt;fromStrip<span style="">&#40;</span><span style="">&#41;</span> + &quot;\\t&quot; + msg-&gt;subject<span style="">&#40;</span><span style="">&#41;</span> + &quot;\\t&quot; + msg-&gt;dateStr<span style="">&#40;</span><span style="">&#41;</span><span style="">&#41;</span>;</span>
<span style="color: #00b000;">&gt;          <span style="">&#125;</span></span>
<span style="color: #00b000;">&gt;      <span style="">&#125;</span></span>
<span style="color: #00b000;">&gt;      mFolder-&gt;close<span style="">&#40;</span><span style="">&#41;</span>;</span>
<span style="color: #00b000;">&gt;      return msgs;</span>
<span style="color: #00b000;">&gt; <span style="">&#125;</span></span>
<span style="color: #00b000;">&gt;</span>
diff kmail/folderIface.h kmail_patched/folderIface.h
<span style="color: #440088;">61c61,62</span>
<span style="color: #991111;">&lt;</span>
<span style="color: #888822;">---
<span style="color: #00b000;">&gt;     virtual QStringList unreadMessageHeaders<span style="">&#40;</span><span style="">&#41;</span>;</span></span>
<span style="color: #00b000;">&gt;</span></pre></div></div>

<p>After adding new function header to <code>folderIface.h</code> and rebuilding KMail, new DCOP call &#8220;<code>kmail FolderIface unreadMessageHeaders</code>&#8221; became available to get the list of message headers in format &#8220;From/Subject/Date&#8221; divided by tab characters (<code>\t</code>).</p>
<h3>Sourcecode</h3>
<h4><code>skkmail.py</code>:</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> karamba
<span style="color: #ff7700;font-weight:bold;">import</span> kmail
&nbsp;
text = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
images = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
clickAreas = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Define widget area width here (height is adjusted automatically)</span>
s_width = <span style="color: #ff4500;">350</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># If an actual height is above this value, a widget area will be clipped</span>
maxHeight = <span style="color: #ff4500;">600</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Margins inside a widget area</span>
s_x = <span style="color: #ff4500;">10</span>
s_y = <span style="color: #ff4500;">10</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> _update<span style="color: black;">&#40;</span>widget<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">global</span> text, images, clickAreas, s_width, s_x, s_y
    x_gap = <span style="color: #ff4500;">10</span>
    y_gap = <span style="color: #ff4500;">4</span>
&nbsp;
    s_height = <span style="color: #ff4500;">14</span>
    s_col1 = <span style="color: black;">&#40;</span>s_width-x_gap<span style="color: black;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #ff4500;">0.66</span>
    s_col2 = s_width
    s_col3 = <span style="color: black;">&#40;</span>s_width-x_gap-<span style="color: #ff4500;">16</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #ff4500;">0.33</span>
&nbsp;
    folderFont = <span style="color: #483d8b;">&quot;Franklin Gothic Medium&quot;</span>
    folderFontSize = <span style="color: #ff4500;">14</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">for</span> t <span style="color: #ff7700;font-weight:bold;">in</span> text:
        <span style="color: #ff7700;font-weight:bold;">try</span>:
          karamba.<span style="color: black;">deleteText</span><span style="color: black;">&#40;</span>widget, t<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">except</span>:
          <span style="color: #ff7700;font-weight:bold;">pass</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> images:
        <span style="color: #ff7700;font-weight:bold;">try</span>:
          karamba.<span style="color: black;">deleteImage</span><span style="color: black;">&#40;</span>widget, i<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">except</span>:
          <span style="color: #ff7700;font-weight:bold;">pass</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> c <span style="color: #ff7700;font-weight:bold;">in</span> clickAreas:
        <span style="color: #ff7700;font-weight:bold;">try</span>:
          karamba.<span style="color: black;">removeClickArea</span><span style="color: black;">&#40;</span>widget, c<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">except</span>:
          <span style="color: #ff7700;font-weight:bold;">pass</span>
    text = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
    images = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
    clickAreas = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
    folders = kmail.<span style="color: black;">getFolders</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    y = s_y + <span style="color: #ff4500;">25</span><span style="color: #66cc66;">;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> f <span style="color: #ff7700;font-weight:bold;">in</span> folders:
        msgs = f.<span style="color: black;">unreadMessages</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span>msgs<span style="color: black;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>:
            y0 = y
            t = karamba.<span style="color: black;">createText</span><span style="color: black;">&#40;</span>widget, s_x+<span style="color: #ff4500;">15</span>, y, s_width, s_height,
                f.<span style="color: black;">name</span>+<span style="color: #483d8b;">&quot; (&quot;</span>+<span style="color: #008000;">str</span><span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span>msgs<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>+<span style="color: #483d8b;">&quot;)&quot;</span><span style="color: black;">&#41;</span>
            karamba.<span style="color: black;">changeTextFont</span><span style="color: black;">&#40;</span>widget, t, folderFont<span style="color: black;">&#41;</span>
            karamba.<span style="color: black;">changeTextSize</span><span style="color: black;">&#40;</span>widget, t, folderFontSize<span style="color: black;">&#41;</span>
            text.<span style="color: black;">append</span><span style="color: black;">&#40;</span>t<span style="color: black;">&#41;</span>
            images.<span style="color: black;">append</span><span style="color: black;">&#40;</span>karamba.<span style="color: black;">createImage</span><span style="color: black;">&#40;</span>widget, s_x-<span style="color: #ff4500;">10</span>, y, <span style="color: #483d8b;">&quot;icons/folder.png&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
            y = y + s_height + y_gap<span style="color: #66cc66;">*</span><span style="color: #ff4500;">2</span> +<span style="color: #ff4500;">10</span>
            <span style="color: #ff7700;font-weight:bold;">for</span> m <span style="color: #ff7700;font-weight:bold;">in</span> msgs:
                t = karamba.<span style="color: black;">createText</span><span style="color: black;">&#40;</span>widget, s_x+<span style="color: #ff4500;">20</span>, y, s_col1, s_height, m<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
                text.<span style="color: black;">append</span><span style="color: black;">&#40;</span>t<span style="color: black;">&#41;</span>
                t = karamba.<span style="color: black;">createText</span><span style="color: black;">&#40;</span>widget, s_x, y+s_height, s_col2, s_height, m<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
                text.<span style="color: black;">append</span><span style="color: black;">&#40;</span>t<span style="color: black;">&#41;</span>
                t = karamba.<span style="color: black;">createText</span><span style="color: black;">&#40;</span>widget, s_x+<span style="color: #ff4500;">20</span>+s_col1+x_gap, y, s_col3, s_height, m<span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
                karamba.<span style="color: black;">setTextAlign</span><span style="color: black;">&#40;</span>widget, t, <span style="color: #483d8b;">&quot;RIGHT&quot;</span><span style="color: black;">&#41;</span>
                text.<span style="color: black;">append</span><span style="color: black;">&#40;</span>t<span style="color: black;">&#41;</span>
                images.<span style="color: black;">append</span><span style="color: black;">&#40;</span>karamba.<span style="color: black;">createImage</span><span style="color: black;">&#40;</span>widget, s_x, y, <span style="color: #483d8b;">&quot;icons/mail.png&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
                y = y + s_height<span style="color: #66cc66;">*</span><span style="color: #ff4500;">2</span> + y_gap<span style="color: #66cc66;">*</span><span style="color: #ff4500;">2</span>
            clickAreas.<span style="color: black;">append</span><span style="color: black;">&#40;</span>karamba.<span style="color: black;">createClickArea</span><span style="color: black;">&#40;</span>widget, s_x-<span style="color: #ff4500;">10</span>, y0, s_width, y-y0,
                <span style="color: #483d8b;">&quot;dcop kmail KMailIface selectFolder &quot;</span>+f.<span style="color: black;">path</span>+<span style="color: #483d8b;">&quot; &amp;&amp; kmail&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
            y = y + y_gap<span style="color: #66cc66;">*</span><span style="color: #ff4500;">2</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span>y <span style="color: #66cc66;">&lt;</span> maxHeight - <span style="color: #ff4500;">20</span><span style="color: black;">&#41;</span>:
        karamba.<span style="color: black;">resizeWidget</span><span style="color: black;">&#40;</span>widget, s_width+s_x<span style="color: #66cc66;">*</span><span style="color: #ff4500;">2</span>, y+<span style="color: #ff4500;">20</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#this is called when you widget is initialized</span>
<span style="color: #ff7700;font-weight:bold;">def</span> initWidget<span style="color: black;">&#40;</span>widget<span style="color: black;">&#41;</span>:
    bgImage = karamba.<span style="color: black;">createBackgroundImage</span><span style="color: black;">&#40;</span>widget, <span style="color: #ff4500;">0</span>, <span style="color: #ff4500;">5</span>, <span style="color: #483d8b;">&quot;icons/bg.png&quot;</span><span style="color: black;">&#41;</span>
    karamba.<span style="color: black;">resizeImage</span><span style="color: black;">&#40;</span>widget, bgImage, s_width+s_x<span style="color: #66cc66;">*</span><span style="color: #ff4500;">2</span>, <span style="color: #ff4500;">20</span><span style="color: black;">&#41;</span>
    logo = karamba.<span style="color: black;">createImage</span><span style="color: black;">&#40;</span>widget, <span style="color: #ff4500;">0</span>, <span style="color: #ff4500;">0</span>, <span style="color: #483d8b;">&quot;icons/kmail.png&quot;</span><span style="color: black;">&#41;</span>
    t = karamba.<span style="color: black;">createText</span><span style="color: black;">&#40;</span>widget, <span style="color: #ff4500;">35</span>, <span style="color: #ff4500;">5</span>, <span style="color: #ff4500;">100</span>, <span style="color: #ff4500;">20</span>, <span style="color: #483d8b;">&quot;new mail&quot;</span><span style="color: black;">&#41;</span>
    karamba.<span style="color: black;">changeTextFont</span><span style="color: black;">&#40;</span>widget, t, <span style="color: #483d8b;">&quot;Franklin Gothic Medium&quot;</span><span style="color: black;">&#41;</span>
    karamba.<span style="color: black;">changeTextSize</span><span style="color: black;">&#40;</span>widget, t, <span style="color: #ff4500;">16</span><span style="color: black;">&#41;</span>
    karamba.<span style="color: black;">createClickArea</span><span style="color: black;">&#40;</span>widget, <span style="color: #ff4500;">0</span>, <span style="color: #ff4500;">0</span>, <span style="color: #ff4500;">100</span>, <span style="color: #ff4500;">30</span>, <span style="color: #483d8b;">&quot;kmail&quot;</span><span style="color: black;">&#41;</span>
    karamba.<span style="color: black;">createImage</span><span style="color: black;">&#40;</span>widget, s_width+s_x<span style="color: #66cc66;">*</span><span style="color: #ff4500;">2</span>-<span style="color: #ff4500;">18</span>, <span style="color: #ff4500;">7</span>, <span style="color: #483d8b;">&quot;icons/mail_get.png&quot;</span><span style="color: black;">&#41;</span>
    karamba.<span style="color: black;">createClickArea</span><span style="color: black;">&#40;</span>widget, s_width+s_x<span style="color: #66cc66;">*</span><span style="color: #ff4500;">2</span>-<span style="color: #ff4500;">18</span>, <span style="color: #ff4500;">7</span>, <span style="color: #ff4500;">16</span>, <span style="color: #ff4500;">16</span>, <span style="color: #483d8b;">&quot;dcop kmail KMailIface checkMail&quot;</span><span style="color: black;">&#41;</span>
    karamba.<span style="color: black;">createImage</span><span style="color: black;">&#40;</span>widget, s_width+s_x<span style="color: #66cc66;">*</span><span style="color: #ff4500;">2</span>-<span style="color: #ff4500;">40</span>, <span style="color: #ff4500;">7</span>, <span style="color: #483d8b;">&quot;icons/mail_new.png&quot;</span><span style="color: black;">&#41;</span>
    karamba.<span style="color: black;">createClickArea</span><span style="color: black;">&#40;</span>widget, s_width+s_x<span style="color: #66cc66;">*</span><span style="color: #ff4500;">2</span>-<span style="color: #ff4500;">40</span>, <span style="color: #ff4500;">7</span>, <span style="color: #ff4500;">16</span>, <span style="color: #ff4500;">16</span>,
        <span style="color: #483d8b;">&quot;dcop kmail KMailIface openComposer '' '' '' '' '' ''&quot;</span><span style="color: black;">&#41;</span>
    _update<span style="color: black;">&#40;</span>widget<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#this is called everytime your widget is updated</span>
<span style="color: #808080; font-style: italic;">#the update inverval is specified in the .theme file</span>
<span style="color: #ff7700;font-weight:bold;">def</span> widgetUpdated<span style="color: black;">&#40;</span>widget<span style="color: black;">&#41;</span>:
    _update<span style="color: black;">&#40;</span>widget<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#This gets called everytime our widget is clicked.</span>
<span style="color: #808080; font-style: italic;"># Middle button click forces to check new mail</span>
<span style="color: #ff7700;font-weight:bold;">def</span> widgetClicked<span style="color: black;">&#40;</span>widget, x, y, button<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span>button == <span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>:
        kmail.<span style="color: black;">dcopCall</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;kmail KMailIface checkMail&quot;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<h4><code>kmail.py:</code></h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>, <span style="color: #dc143c;">subprocess</span>, <span style="color: #dc143c;">string</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> dcopCall<span style="color: black;">&#40;</span>call<span style="color: black;">&#41;</span>:
  <span style="color: #dc143c;">cmd</span> = <span style="color: #483d8b;">&quot;dcop &quot;</span>+call
  pipe = <span style="color: #dc143c;">subprocess</span>.<span style="color: black;">Popen</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">cmd</span>, shell=<span style="color: #008000;">True</span>, bufsize=<span style="color: #ff4500;">1024</span>, stdout=<span style="color: #dc143c;">subprocess</span>.<span style="color: black;">PIPE</span><span style="color: black;">&#41;</span>.<span style="color: black;">stdout</span>
  res = pipe.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
  pipe.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
  <span style="color: #ff7700;font-weight:bold;">return</span> res
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> Folder:
  path = <span style="color: #483d8b;">&quot;&quot;</span>
  name = <span style="color: #483d8b;">&quot;&quot;</span>
  unreadCount = <span style="color: #ff4500;">0</span>
  unreadMessages = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
&nbsp;
  <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, path<span style="color: black;">&#41;</span>:
    dcopCall<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;kmail KMailIface getFolder &quot;</span>+path<span style="color: black;">&#41;</span>
    <span style="color: #008000;">self</span>.<span style="color: black;">path</span> = path
    <span style="color: #008000;">self</span>.<span style="color: black;">unreadMessages</span> = <span style="color: #008000;">self</span>.<span style="color: black;">getUnreadMessages</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
  <span style="color: #ff7700;font-weight:bold;">def</span> getUnreadMessages<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
    r = dcopCall<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;kmail FolderIface unreadMessageHeaders&quot;</span><span style="color: black;">&#41;</span>
    ss = <span style="color: #dc143c;">string</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span>r, <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>n&quot;</span><span style="color: black;">&#41;</span>
    msg = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> s <span style="color: #ff7700;font-weight:bold;">in</span> ss:
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span>s<span style="color: black;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>:
            msg.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">string</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span>s, <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>t&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    unreadCount = <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>msg<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span>unreadCount <span style="color: #66cc66;">&gt;</span> <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>:
        <span style="color: #008000;">self</span>.<span style="color: black;">name</span> = <span style="color: #dc143c;">string</span>.<span style="color: black;">strip</span><span style="color: black;">&#40;</span>dcopCall<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;kmail FolderIface displayName&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    msg.<span style="color: black;">reverse</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> msg
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> getFolders<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    r = dcopCall<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;kmail KMailIface folderList&quot;</span><span style="color: black;">&#41;</span>
    folders = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> f <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">string</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span>r, <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>n&quot;</span><span style="color: black;">&#41;</span>:
        folders.<span style="color: black;">append</span><span style="color: black;">&#40;</span>Folder<span style="color: black;">&#40;</span>f<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> folders</pre></td></tr></table></div>

<h4><code>skkmail.theme:</code></h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># you can change initial widget position, area size and updatin interval (default = 1min)</span>
karamba x=<span style="color: #ff4500;">100</span> y=<span style="color: #ff4500;">100</span> w=<span style="color: #ff4500;">400</span> h=<span style="color: #ff4500;">200</span> interval=<span style="color: #ff4500;">60000</span>
defaultfont font=<span style="color: #483d8b;">&quot;Franklin Gothic Book&quot;</span> fontsize=<span style="color: #ff4500;">12</span> color=<span style="color: #ff4500;">230</span>,<span style="color: #ff4500;">230</span>,<span style="color: #ff4500;">230</span></pre></td></tr></table></div>

<p>All code above is <a href="http://www.gnu.org/licenses/gpl.html">GPL</a>&#8216;ed.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2006/09/12/getting-new-mail-onto-the-desktop/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>All you need is Drupal</title>
		<link>http://blog.cyberborean.org/2006/08/23/all-you-need-is-drupal</link>
		<comments>http://blog.cyberborean.org/2006/08/23/all-you-need-is-drupal#comments</comments>
		<pubDate>Wed, 23 Aug 2006 10:48:27 +0000</pubDate>
		<dc:creator>Alex Alishevskikh</dc:creator>
				<category><![CDATA[Essays]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[taxonomy]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">https://cyberborean.wordpress.com/2006/08/23/all-you-need-is-drupal/</guid>
		<description><![CDATA[It&#8217;s commonly called &#8220;CMS&#8221; but as deeper you&#8217;re digging into it, it&#8217;s getting clear that it is something greater than the &#8220;Content Management System&#8221;. Or perhaps, that the &#8220;Content Management&#8221; is something greater than we used to think. Actually, Drupal&#8217;s darned flexibility allows to do a lot of things which would need the application servers [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s commonly called &#8220;CMS&#8221; but as deeper you&#8217;re digging into it, it&#8217;s getting clear that it is something greater than the &#8220;Content Management System&#8221;. Or perhaps, that the &#8220;Content Management&#8221; is something greater than we used to think. Actually, Drupal&#8217;s darned flexibility allows to do a lot of things which would need the application servers and all that stuff. And in the simplest case, it will need no programming &#8211; you can build for instance, a simple database application (like a products directory etc) or even a light CRM/ERP for your intranet as just a specialized Drupal configuration.<br />
<span id="more-126"></span></p>
<p>There is a case study: our <a href="http://www.rusmeco.net">RUSMECO</a> project, among many other things, includes development of so-called &#8220;Brokerage Area&#8221; &#8211; an open-access database of the people, organizations, products and services which are related together by many ways. Our <a href="http://rusmeco.ru">main collaboration portal</a> is based on Drupal so it was obvious that reusing the same platform for BA development advantages in all senses. We have investigating which Drupal features might fit our solution &#8211; and found all what we needed.</p>
<h3>Flexinode</h3>
<p>All content objects in Drupal are treated as an abstraction of the &#8220;nodes&#8221;. There are various types of nodes (pages, stories, forum posts, blog posts etc) which differ by their fields and provided by the core or additional modules. But there is also a mechanism of creating new custom types of nodes (so-called &#8220;flexinode&#8221;) with arbitrary sets of the data fields. So, you can define your own structured data types right into the Drupal administrative interface without writing any PHP code and creating new database tables. The user interface (the forms)  for nodes will be built automatically and can be adjusted later (for instance, the fields order and grouping). These new types will be fully integrated into the core content framework &#8211; in fact, they will be the same content objects as the core types and all Drupal functions (the search, categorization, multilingual translation, workflow, access management and so on) will work with them.</p>
<p>In our case, we needed four content types: Member, Company, Product and Service profiles. It is only pity that the built-in system user profile <em>is not a node</em> (though it have a customizable set of the fields), so we left there only a bare minimum of fields (only username, email and password, in fact) and defined a separate Member profile (CV) node type for those who wants to tell more about herself.</p>
<h3>Taxonomies</h3>
<p>Taxonomies (or, controlled vocabularies) is a standard Drupal way for nodes classification and organization. They are the sets of categories or <em>terms</em> which can be organized hierarchically, related each other and grouped into the <em>vocabularies</em>. Depending on your IA, they can serve as traditional content sections, the &#8220;tags&#8221; or &#8220;labels&#8221; in faceted classification system or as thesauri of interrelated terms. The categories can be also related with the content types, so that the nodes of a specific type can be qualified as the members by specific categories only, or be included in a category by default.</p>
<p>Along with predefined categories, it is possible to define new ones (in selected vocabularies) on-the-fly, together with creation of new nodes. For instance, an user who is filling her product profile out, is able to create the new product category at one time.</p>
<h3>I18N</h3>
<p>Our solution had to be bilingual (en/ru) &#8211; it was a principal requirement. It concerns not only an interface, but also that it should be possible to create the translations of the nodes in alternate language. For instance, an user should be able to create two versions of a profile and when another user coming to see it, she would get a variant for her current language (selected in the top panel).</p>
<p>The features of Drupal i18n module enable to do so. What&#8217;s more, it is possible also for categories to be translated, so that the user sees all categories in her current language and when she is in a category, all nodes there are in that language too.</p>
<h3>Modules</h3>
<p>And after all, if you&#8217;re well sure Drupal lacks some functionality, you can remember your own PHP and SQL experience and write some code. For instance, you would be needed for a custom sophisticated query iinterface for your database. But you probably will not have to write a lot &#8211; as all infrastructural aspects (such as templating etc) are already implemented in <a href="http://api.drupal.org/">Drupal API</a>, you&#8217;ll need to implement only your specific functions.</p>
<p>The specific pieces of Drupal functionality are called &#8220;the modules&#8221;. In fact, the Drupal core is only the component framework and almost all its functions are implemented as the pluggable modules. So, to extend it with your custom functions there is no a better way than develop your own module. It&#8217;s pretty easy &#8211; a module is simply a PHP file containing the conventionally named functions (aka &#8220;hooks&#8221;). These functions may define what should be displayed in a module page, module blocks (in left and right columns), module settings page, how the module will be integrated into the navigation menus and configuration interface and so on.</p>
<p>For to start with modules development, consider to read <a href="http://drupal.org/node/17914">this tutorial</a>.</p>
<h3>Reading on subject</h3>
<ul>
<li><a href="http://drupal.org/handbook/is-drupal-right-for-you">Is Drupal right for you?</a></li>
<li><a href="http://drupal.org/node/20350">Rolling your own system vs. using Drupal</a></li>
<li><a href="http://drupal.org/node/49297" rel="nofollow">Drupal for Information Architects: an overview of configurability</a></li>
<li><a href="http://drupal.org/node/77487" rel="nofollow">The Road to Drupal Hell</a></li>
</ul>
<p>&#8230; more on the <a href="http://drupal.org/handbooks">Drupal site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyberborean.org/2006/08/23/all-you-need-is-drupal/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

