<?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>davinci’s notebook &#187; &#9733;grads.net</title>
	<atom:link href="http://stargrads.net/blogs/davinci/category/gradsnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://stargrads.net/blogs/davinci</link>
	<description>everything is an experiment</description>
	<lastBuildDate>Mon, 21 Mar 2011 18:31:14 +0000</lastBuildDate>
	<language>fa</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Why Computer Scientists Should Adopt Open Notebook Science</title>
		<link>http://stargrads.net/blogs/davinci/2010/10/why-computer-scientists-should-adopt-open-notebook-science/</link>
		<comments>http://stargrads.net/blogs/davinci/2010/10/why-computer-scientists-should-adopt-open-notebook-science/#comments</comments>
		<pubDate>Sun, 24 Oct 2010 03:01:17 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[★grads.net]]></category>
		<category><![CDATA[academic writings]]></category>
		<category><![CDATA[open notebook science]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=2981</guid>
		<description><![CDATA[
I wrote this essay using MediaWiki (formerly at the address <a href="http://stargrads.net/wiki">http://stargrads.net/wiki</a>) as a proof-of-concept to see if I can write an essay or a paper online. Since I&#8217;m removing MediaWiki from this web site, I have copied its contents below. What is &#8220;Open Notebook Science&#8221;? The term &#8220;open notebook science&#8221; was first coined by Jean-Claude [...]
]]></description>
			<content:encoded><![CDATA[<p>I wrote this essay using MediaWiki (formerly at the address <a href="http://stargrads.net/wiki">http://stargrads.net/wiki</a>) as a proof-of-concept to see if I can write an essay or a paper online.  Since I&#8217;m removing MediaWiki from this web site, I have copied its contents below<span id="more-2981"></span>.</p>
<hr />
<h1>What is &ldquo;Open Notebook Science&rdquo;?</h1>
<p><!--adsensestart-->The term &ldquo;open notebook science&rdquo; was first coined by Jean-Claude Bradley in a blog post<sup><a class='footnote' id='note-2981-1' href='#footnote-2981-B06'>[1]</a></sup> to clarify and distinguish between several related concepts in the open access movement in science.  Bradley defines the term to mean that</p>
<blockquote><p>there is a URL to a laboratory notebook&hellip; that is freely available and indexed on common search engines. It does not necessarily have to look like a paper notebook but it is essential that all of the information available to the researchers to make their conclusions is equally available to the rest of the world. Basically, no insider information.</p></blockquote>
<p>Open notebook science is thus analogous to open source software, but applies to <em>all types of data</em> and not just <em>source code</em>.  It is also distinct from but related to open access <em>publication</em>, which denotes the public availability of preprints of journal articles.  Bradley coined the term in order to properly describe the philosophy behind the UsefulChem<sup><a class='footnote' id='note-2981-2' href='#footnote-2981-UsefulChem'>[2]</a></sup> project.  </p>
<p>The principle behind open notebook science is that <em>anyone</em> can access the primary research record of a project, including preliminary results of experiments, and even raw data as it is gathered.  By this definition, open source software projects in computer science, such as those found on SourceForge<sup><a class='footnote' id='note-2981-3' href='#footnote-2981-SourceForge'>[3]</a></sup>, are also open notebook science projects if the &ldquo;notebooks&rdquo; are taken to mean not just the source code but also the web pages, documentation, forums, and other materials associated with these projects.  </p>
<p>For the purposes of open notebook science, a &ldquo;notebook&rdquo; is thus quite broadly defined: it might be anything from scribbles which appear to be random gibberish to outsiders to somewhat polished half-baked thoughts.  However, it should be noted that traditional notebooks are probably similarly broad in their diversity.</p>
<p>For computer science theorists, an open notebook might consist of a research diary where one records one&rsquo;s thoughts on open problems and questions which one is working on. </p>
<p>I believe that computer scientists should lead the charge to adopt open notebook science, and in this essay I will explain why I hold this belief.</p>
<h1>Examples of Open Notebook Science Projects</h1>
<p>Perhaps the best way to illustrate the concept of open notebook science is by way of example.  Many of the large and well-known open notebook science projects are in chemistry (cheminformatics) and biology (bioinformatics), disciplines in which it is typical to generate and work with large amounts of data.  This data may be costly to produce in terms of money and/or time, and there may be a great deal of redundancy and reduplication between the efforts of different laboratories or research groups.  Two examples of large open notebook science projects are OpenWetWare<sup><a class='footnote' id='note-2981-4' href='#footnote-2981-OpenWetWare'>[4]</a></sup> and UsefulChem<sup><a class='footnote' id='note-2981-5' href='#footnote-2981-UsefulChem'>[5]</a></sup>.</p>
<p>The goals of the OpenWetWare project are to &ldquo;support open sharing of research, education, publication, and discussion in biological sciences and engineering&rdquo;, according to their mission statement<sup><a class='footnote' id='note-2981-6' href='#footnote-2981-OpenWetWare_mission_statement'>[6]</a></sup>.  To this end, their web site provides blogs and wikis to users and research groups.  The wikis are specialised for certain tasks, such as <a href="http://www.openwetware.org/wiki/Help:Notebook">lab notebooks</a> and <a href="http://www.openwetware.org/wiki/Help:Hosting_courses">hosted courses</a>. </p>
<p>The UsefulChem project is an open notebook science project in chemistry originated by the Bradley Laboratory at Drexel University.  It is hosted on <a href="http://www.wikispaces.com/">Wikispaces</a>, a web site that allows users to set up free wikis, and has an associated blog<sup><a class='footnote' id='note-2981-7' href='#footnote-2981-UsefulChem_blog'>[7]</a></sup> hosted on <a href="http://www.blogger.com/">Blogger.com</a>, another free service.  The UsefulChem project illustrates how researchers in fields outside of computer science are using readily available tools to create their open notebook science projects.</p>
<p>I was unable to locate any open notebook science projects of a similar focus and scope for physics and computer science.  As note above, projects to develop open source software, hosted on publicly accessible code repositories such as SourceForge<sup><a class='footnote' id='note-2981-8' href='#footnote-2981-SourceForge'>[8]</a></sup> or Google Code<sup><a class='footnote' id='note-2981-9' href='#footnote-2981-GoogleCode'>[9]</a></sup>, might be considered examples of open notebook science projects if all documentation and other materials related to the projects are also accessible to the public.  And the physics community is actually an early adopter of open access publishing, with its embrace of the arXiv<sup><a class='footnote' id='note-2981-10' href='#footnote-2981-arXiv'>[10]</a></sup> repository of electronic preprints (or e-prints) in 1991.  </p>
<p>The quantum computing community in particular has <em>two</em> wikis, Quantiki<sup><a class='footnote' id='note-2981-11' href='#footnote-2981-Quantiki'>[11]</a></sup> and Qwiki<sup><a class='footnote' id='note-2981-12' href='#footnote-2981-Qwiki'>[12]</a></sup>.  However, these wikis are intended to be references for researchers rather than notebooks for recording ongoing research.</p>
<p>Many individual researchers keep openly accessible notebooks, or have blogs on which they discuss their research semi-regularly.  These are far too numerous to list, but there are a number of portals such as BlogScholar<sup><a class='footnote' id='note-2981-13' href='#footnote-2981-BlogScholar'>[13]</a></sup> in which research-related blogs are organised by category.  </p>
<p>For researchers outside of computer science, technologies such as blogs and wikis are only tools to assist in their research.  For computer scientists, however, these technologies and their impact on society are in and of themselves objects of study.  It is therefore a little disappointing that open notebook science is not more widely practised in the computer science community.  </p>
<h1>Advantages of Open Notebook Science</h1>
<p>The movement towards openness in science is based on the belief that sharing and cooperation leads to swifter progress than hoarding and competition.  </p>
<p>Even leaving aside for the moment the advantages of openness, there are many benefits to using the latest note and record keeping technologies, such as wikis and blogs, whether or not they are made public.  These include advantages common to all derivatives of digital text formats, such as the legibility of typed text as opposed to handwriting, the ability to copy, share, search, and archive notes, and the portability and extensibility of the notes unconstrained by the limitations of physical notebooks (or loose sheets of paper), which may be difficult to carry around and may be misplaced.  </p>
<p>Technologies such as blogs and wikis also perform the role of versioning software, keeping a timestamped history of all edits, arbitrating between conflicting ones, and maintaining a record of all contributions and their contributors.  Furthermore, these technologies also offer advanced search and organisational capabilities, such as the labeling of notes with tags, the arrangement of notes into a hierarchy of categories, and the inclusion of semantics through metadata.  These search and record keeping capabilities would be very useful to scientists when the time comes to write grants and progress reports.  </p>
<p>The use of digital media also means that notes may be dynamic and interactive.  For example, instead of writing a mathematical formula, a digital notebook might contain a form for evaluating that formula with different inputs.  A more trivial example of interactivity is that digital notebooks allow the reader to go back and forth between the main body of a text and a footnote<sup><a class='footnote' id='note-2981-14' href='#footnote-2981-footnote'>[14]</a></sup>, or between different pages or even different documents, very quickly, by clicking with a mouse or using keyboard shortcuts instead of fumbling with physical sheets of paper.</p>
<p>Making a notebook public brings several benefits in addition to the above.  The sharing of notes is made much easier if one can simply pass around a URL (or DOI) instead of copies.  An open notebook is available &ldquo;everywhere&rdquo; (limited by Internet access, which is ubiquitous at all research institutions anyway), and the notebook cannot be misplaced.  </p>
<p>Many of the advantages of open source software also apply, mutatis mutandis, to open notebook science as well.  An open notebook potentially has &ldquo;many eyeballs&rdquo; on it, allowing researchers other than the main investigators to submit &ldquo;patches&rdquo;, i.e., contribute slight tweaks or even major suggestions.  This facilitates scientific discovery and creates more opportunities for better scientific conversations.</p>
<p>Considering the large number of open scientific problems and the diverse backgrounds of scientists, there are bound to be many instances in which the solutions to problems are known to or can be easily produced by researchers other than those who are actively examining them.  Conversely, there may be discoveries which do not appear important in one field but which can bring about significant progress in another.  Open notebooks allow minor questions or serendipitous discoveries to be made publicly known without having to attach them to a paper primarily about another more major (and possibly not very related) result.  This is, in fact, what is already happening in several blogs maintained by scientists<sup><a class='footnote' id='note-2981-15' href='#footnote-2981-annoying_questions'>[15]</a></sup>.  </p>
<p>The open availability of &ldquo;insider information&rdquo; such as data, ideas, and detailed experimental procedures or proofs of theorems which have been condensed in published journal papers for brevity, allow these to be verified and increases the accountability of scientists and the transparency of science.</p>
<p>By performing their work in the open, it becomes possible for scientists to more efficiently allocate their resources, contributing their expertise where it is needed and summoning the expertise of others when that is required.  The scientific community as a whole benefits from this openness.  Keeping an open notebook also helps the individual scientist, because it increases his or her visibility in the major search engines.</p>
<p>There are benefits to the general public as well.  The public accessibility of notebooks which are research diaries serves as a kind of real-time science journalism.  This gives the public a closer look at the actual lives of scientists (which one hopes would dispel negative stereotypes), and helps to acquaint new researchers with what the life of scientists are actually like.  The low cost of entry of starting a blog or a wiki might also serve to get young scientists, such as ambitious high school students, involved in the research process early.</p>
<h1>Credit, Plagiarism, and Other Issues</h1>
<p>The concept of open notebook science is not without its problems.  The primary concern seems to be the issue of priority, or, in the common parlance, &ldquo;getting scooped&rdquo;.  </p>
<p>Science has changed considerably since the days when scientists such as Galileo Galilei or Robert Hooke would encrypt their findings as Latin anagrams to establish their claim while concealing the actual contents of their discovery to give them a head start on research over their rivals.  The history of science is filled with rancorous debates over who first came up with certain ideas, or whether an idea should be attributed to an originator who subsequently did very little with it or to someone who later developed and expanded on it.  </p>
<p>Given the principle of &ldquo;no insider information&rdquo;, a scientist might be understandably concerned about intellectual property theft.  There are, essentially, two ways to address the issue: social and legal.</p>
<p>As some commentators<sup><a class='footnote' id='note-2981-16' href='#footnote-2981-French_chef'>[16]</a></sup> have observed, there are already social norms in place which heavily discourage plagiarism and lack of proper attribution by scientists and scholars.  This may be called the &ldquo;French chef&rdquo; approach to protecting intellectual property, after a study by Fauchart and von Hippel<sup><a class='footnote' id='note-2981-17' href='#footnote-2981-FH06'>[17]</a></sup> who showed that the contents of recipes among accomplished French chefs are protected by a system of implicit social norms, rather than by law.  Such a &ldquo;norms-based&rdquo; intellectual property system may deter would-be plagiarists and people who do not give proper credit.  More public information about when each scientist came up with or worked on a particular idea should in theory decrease disputes about priority rather than increase them.  When scientific conversations are timestamped, viewable to the public, and indexed and cached by multiple search engines and crawlers, it would be extraordinarily difficult to have honest disputes over the history of events related to a claim of priority.  Social norms among scientists should encourage offers of collaboration and discourage &ldquo;scooping&rdquo;.</p>
<p>When norms-based deterrents against intellectual property theft are insufficient, there is always recourse to law-based systems.  Creative Commons<sup><a class='footnote' id='note-2981-18' href='#footnote-2981-CreativeCommons'>[18]</a></sup>, for example, provides a number of legal tools for sharing intellectual property, including various free licenses with different stipulations<sup><a class='footnote' id='note-2981-19' href='#footnote-2981-CreativeCommons_license'>[19]</a></sup> which may be attached to creative works.  </p>
<p>An open notebook science web site or project may choose a license based on its specific needs and legal requirements.  Most open notebook science web sites have licenses that allow sharing and distribution conditioned only on <a href="http://creativecommons.org/licenses/by/3.0/">attribution</a>.  Others add a <a href="http://creativecommons.org/licenses/by-sa/3.0/">&ldquo;share alike&rdquo; clause</a>, which allows derivative works conditioned on these being under the same, similar, or compatible license.  There are also licenses which <a href="http://creativecommons.org/licenses/by-nd/3.0/">forbid derivative works</a>, <a href="http://creativecommons.org/licenses/by-nc/3.0/">commercial usage</a>, or <a href="http://creativecommons.org/licenses/by-nc-nd/3.0/">both</a>.</p>
<p>Some proposed solutions to the problem of intellectual property theft with open notebooks are technical rather than social or legal in nature, such as <a href="http://scienceblogs.com/pontiff/2008/06/pseudo_open_notebook_science.php">restricting information to registered users or introducing a delay in the notebook</a>.  However, such solutions violate the spirit of &ldquo;no insider information&rdquo;, and the result could not be properly called open notebook science.</p>
<p>There are several other intellectual property issues related to open notebook science, such as what constitutes prior publication for peer-reviewed journals, and premature disclosure for the purposes of obtaining patents.  Many journals, however, already accept papers which have previously appeared as preprints in repositories such as the arXiv<sup><a class='footnote' id='note-2981-20' href='#footnote-2981-arXiv'>[20]</a></sup>.  However, patent law has yet to catch up to many recent developments in technology.</p>
<p>The release of large amounts of data which have not undergone careful review raises a number of problems in trust and credibility.  If a set of data is posted publicly before it is thoroughly checked, it may contain errors which may be propagated.  However, as the open source movement shows, for active projects, bugs are usually caught and fixed quickly.  Furthermore, it is not clear that reviewers of published papers necessarily check the data used to support the arguments of the papers they review very thoroughly (although, in principle, they should).</p>
<p>The use of data from open notebooks, then, imposes a duty upon the user to be vigilant and to take on some aspects of the role of reviewer.  This, however, should be the case anyway, even with peer-reviewed published data.  The recent Merck/Elsevier fake journals scandal<sup><a class='footnote' id='note-2981-21' href='#footnote-2981-Merck_scandal'>[21]</a></sup> amply illustrates the point that even an established publisher of scientific journals should not be naïvely trusted. </p>
<p>Other criticisms of open notebook science deal with the user experience, whether from the point of view of a producer or a consumer of open notebooks.  On the one hand, a scientist&rsquo;s notekeeping style may consist of what may appear to others to be random scribbles, and keeping an open notebook would force him to clean up his spontaneous output and restrain his creativity.  On the other hand, most of a scientist&rsquo;s notes may not be very meaningful to others.  But not all open notebooks are meant to be read as research diaries.  Rather, search and organisational tools should allow relevant information to be found even in a sea of irrelevancies.</p>
<p>Finally, another criticism of open notebooks is their stability, or the ability to reference their data.  But this is a problem that is not unique to open notebooks, and applies to all electronically published information.  Solutions include stable URLs or DOIs, or the use of an archival service such as WebCite<sup><a class='footnote' id='note-2981-22' href='#footnote-2981-WebCite'>[22]</a></sup>.</p>
<h1>Proposed Process</h1>
<p>I believe that computer scientists should adopt open notebook science not only for the benefits discussed above, but because it is a subject that is <em>inherently</em> a part of computer science.  Computer scientists, <em>as computer scientists</em>, have a duty to explore technologies for archiving and communicating information as well as their social and legal implications.  </p>
<p>I can&#8217;t very well advocate computer scientists to make their notebooks publicly accessible without doing so myself.  This is why I created the <a href="http://stargrads.net/">&#9733;grads.net</a> web site (read as &ldquo;star grads dot net&rdquo;), as a platform in which to experiment with various aspects of open notebook science.</p>
<p>Currently, the web site consists of four software packages:</p>
<ul>
<li><a href="http://www.mediawiki.org/">MediaWiki</a> for taking notes and writing papers,
</li>
<li><a href="http://wordpress.org/">WordPress</a> for keeping a research diary,
</li>
<li><a href="http://bbpress.org/">bbPress</a> for collaborative discussions, and
</li>
<li><a href="http://http//wikindx.sourceforge.net/">Wikindx</a> for bibliography management.
</li>
</ul>
<p>The software packages are integrated with one another, to the extent that this is possible to my knowledge at the moment.  For example, it is possible to generate citations using the bibliography management system in both the wikis and the blogs.  Furthermore, through the use of the <a href="http://www.math.union.edu/~dpvc/jsMath/">jsMath</a> package, it is possible to typeset mathematical equations using the widely known TeX syntax throughout the web site.  </p>
<p>The intention is to use the blog to keep a diary of research activities, such as meetings or talks that I attend, or ideas that I have.  These ideas may then be discussed in the blog comments, or if there is serious interest, in the forums.  When an idea gets developed enough, a wiki page will be started for it.  Some of these wiki pages may then evolve into papers, such as <a href="http://stargrads.net/blogs/davinci/2010/10/why-computer-scientists-should-adopt-open-notebook-science">the one you are currently reading</a>.  Since this is an experiment, the roles of these tools may change over time.</p>
<p>One of the goals of the web site is to experiment with collaborative paper-writing.  Currently, papers are written by passing around the document source through e-mail along with an indication of who is in possession of a virtual &ldquo;token&rdquo;.  When a paper is sufficiently mature, a draft may be passed around to other researchers for comments.  There is in principle no reason why the draft should not be publicly available at every stage for outside comments or suggestions.  Wikipedia<sup><a class='footnote' id='note-2981-23' href='#footnote-2981-Wikipedia'>[23]</a></sup> has shown that this sort of collaborative process can result in documents of reasonably good quality.  </p>
<p>As the history<sup><a class='footnote' id='note-2981-24' href='#footnote-2981-history'>[24]</a></sup> of this paper shows, it began with a list of headings for the sections that I planned to write.  The sections were then filled with rough notes, which were subsequently expanded into this paper.</p>
<p>Papers written in this fashion have not passed peer review, and thus should be treated like preprints on the arXiv or blog posts.  Ideally, however, if enough experts participate in the commenting process, such a paper should have been reviewed quite thoroughly.  This distributed evaluation process may be called &#8220;soft&#8221; peer review, as opposed to the traditional &#8220;hard&#8221; peer review.</p>
<p>At the moment, I am the only user on this web site capable of editing wiki pages, and hence of authoring papers.  But the idea is that multiple authors can work on a paper, and contributors may be elevated to the status of co-author if they make significant contributions.</p>
<p>The contents of the &#9733;grads.net wiki are under a Creative Commons <a href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Attribution-Noncommercial-No Derivative Works</a> license.  The &ldquo;No Derivative Works&rdquo; clause may seem a little restrictive, but as the license notes, any of its conditions &ldquo;can be waived if you get permission from the copyright holder&rdquo;.  The purpose of this clause is to protect the contents of paper drafts until they are finished.  Drafts should have the same <em>social</em> protection and status as if they had been written using more traditional means, that is, they should not be cited or used without the authors&#8217; explicit permission.</p>
<p>(I will write out a more comprehensive <a href="http://stargrads.net/wiki/%E2%98%85grads.net:Copyrights">copyright policy</a> for each section of the web site when I get around to it.)</p>
<p>This paper is still a draft<sup><a class='footnote' id='note-2981-25' href='#footnote-2981-draft'>[25]</a></sup>, and I invite your comments and suggestions, which I will take into consideration in revising it.  There is an acknowledgements section at the end of this paper for listing contributors.  The goal is to submit this paper somewhere for &ldquo;official&rdquo; publication after it is sufficiently polished<sup><a class='footnote' id='note-2981-26' href='#footnote-2981-again'>[26]</a></sup>.</p>
<h1>For Further Reading</h1>
<p>The Wikipedia <a href="http://en.wikipedia.org/wiki/Open_notebook_science">article on Open Notebook Science</a> actually isn&#8217;t bad and discusses many of the same points.</p>
<h1>Acknowledgements</h1>
<p>The author would like to thank <a href="http://www.razaghpour.org/">Mina Razaghpour</a> for her suggestions.<!--adsensestop--></p>
<h1>Bibliography</h1>
<p><references /></p>
<img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=2981&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://stargrads.net/blogs/davinci/2008/09/open-notebook-science/' rel='bookmark' title='Open notebook science'>Open notebook science</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/06/an-essay-on-open-notebook-science/' rel='bookmark' title='An essay on open notebook science'>An essay on open notebook science</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/04/overcoming-my-writers-block-part-5-writing-about-open-notebook-science-in-high-school/' rel='bookmark' title='Overcoming my writer&#8217;s block, part 5: writing about open notebook science in high school'>Overcoming my writer&#8217;s block, part 5: writing about open notebook science in high school</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2010/10/why-computer-scientists-should-adopt-open-notebook-science/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Old Help:Setup wiki</title>
		<link>http://stargrads.net/blogs/davinci/2010/10/old-helpsetup-wiki/</link>
		<comments>http://stargrads.net/blogs/davinci/2010/10/old-helpsetup-wiki/#comments</comments>
		<pubDate>Sun, 24 Oct 2010 02:25:10 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[★grads.net]]></category>
		<category><![CDATA[programming and technical issues]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=2962</guid>
		<description><![CDATA[
I've copied the contents of the old Help:Setup wiki into this post, because I'm getting rid of the MediaWiki installation.
]]></description>
			<content:encoded><![CDATA[<p>The content of this post used to live at <a href="http://stargrads.net/wiki/Help:Setup">http://stargrads.net/wiki/Help:Setup</a>, and described how I had set up the software for this web site.  I am archiving the contents of that page here for the reasons described below.  It probably won&#8217;t interest anyone except for nerds<span id="more-2962"></span>.  </p>
<p><!--adsensestart-->I had <a href="http://stargrads.net/blogs/davinci/2008/10/why-my-own-website/">originally intended</a>  to use <a href="http://www.mediawiki.org/">MediaWiki</a> to help me get out my writer&#8217;s block by using it to <a href="http://stargrads.net/blogs/davinci/2008/10/writing-my-phd-research-proposal-live/">write my Ph.D. proposal live and online</a>.  However, since I have <a href="http://stargrads.net/blogs/davinci/2009/06/my-depression-in-waterloo-part-13-dropping-out/">dropped out</a> of the Ph.D. program, I haven&#8217;t really gone back to look at it.  It turns out that MediaWiki is a magnet for spam, and I simply don&#8217;t have the time to revert edits when some bot inserts spam links into the wikis.  </p>
<p>Another problem is that I had used WordPress<sup>&mu;</sup> to give myself the flexibility of creating more than one blog on this web site.  Since then, WordPress<sup>&mu;</sup> has been merged into WordPress, so much of what is below is no longer relevant or necessary.</p>
<hr />
<p>This is a record of everything I did to set up the software for <a href="http://stargrads.net/">stargrads.net</a>, in case I need to install everything again, or to fix something that broke after an upgrade.</p>
<p>For help on how to <em>use</em> the software, see <a href="http://en.wikipedia.org/wiki/Help:Contents">Help:Contents</a>.</p>
<h1>Blogs (<a href="http://mu.wordpress.org/">WordPress<sup>&mu;</sup></a>)</h1>
<p>I am using the <a href="http://getk2.com/">K2</a> theme for WordPress.  This theme is designed so that the template files do not usually need to be edited.  Most of my customisation is done through a stylesheet and using K2&#8242;s provided hooks.  However, I did make three modifications to the template code in &#8220;theloop.php&#8221;:</p>
<ul>
<li>I moved the permalink from the post title to just after it, and had it displayed as &#8220;[permalink]&#8220;.
</li>
<li>I added a link to a post&#8217;s comments after each post.
</li>
<li>I changed the code for the &#8220;Continue reading&#8221; link so that it expands/collapses the post using AJAX.
</li>
</ul>
<p>The stargrads.net banner and the loader for jsMath are included through &#8220;functions.php&#8221; by adding hooks for &#8220;template_body_top&#8221;.</p>
<p>One slight change to &#8220;header.php&#8221;: on line 52, I changed the string &#8221; at &#8221; to &#8221; @ &#8221; (this makes post titles show up as &#8220;post title @ davinci&#8217;s notebook&#8221; on the individual post pages).</p>
<p>Another change to &#8220;header.php&#8221;: I added links in the header to the RSS and Atom feeds of the comments.</p>
<h2>The Continue Reading Link</h2>
<p>The &#8220;Continue reading&#8221; link (which is normally displayed when WordPress encounters the &lt;!&#8211;more&#8211;&gt; tag) was changed so that it would display ellipses, followed by a new paragraph, before the link to the full post. This behaviour is overridden by the Ajaxified Expand Post NOW Plugin, for which see below.</p>
<p>The original code in &#8220;theloop.php&#8221; was:</p>
<p><code>&lt;?php the_content(sprintf(__('Continue reading \'%s\&lt;em&gt;, 'k2_domain'), the_title(&lt;/em&gt;, '', false))); ?&gt;</code></p>
<p>This was changed to:</p>
<p><code>&lt;?php the_content(sprintf(__(&#039;&#8230;&lt;/p&gt;
&lt;p&gt;&amp;raquo; [Continue reading &lt;span class=&quot;small-entry-title&quot;&gt;%s&lt;/span&gt;]', 'k2_domain'), the_title(&lt;em&gt;, &lt;/em&gt;, false))); ?&gt;</code></p>
<h2>The Ajaxified Expand Post NOW Plugin</h2>
<p>In addition to the above, I activated the <a href="http://blog.chweng.idv.tw/wordpress/ajaxified-expand-post-now/">Ajaxified Expand Post NOW</a> plugin.  Note that this essentially overwrites the above changes.  I made a number of customisations and modifications to the plugin:</p>
<ul>
<li><code>\$aepnLoadingMsg = '&#8230; &amp;raquo; [Fetching data &lt;img src=&quot;http://stargrads.net/blogs/wp-content/themes/k2/images/spinner.gif&quot; align=&quot;absmiddle&quot; /&gt;]';</code>,
</li>
<li><code>\$postLess = 'Collapse post';</code>, and
</li>
<li><code>\$postMore = 'Expand post';</code>.
</li>
</ul>
<p>I also replaced the line <code>\$content=preg_replace(...)</code> and the following line with:<br />
<code>\$content=preg_replace('/&lt;a&gt;(.*)/', (\$postLinkPrefix.'&lt;span&gt;&#8230; &amp;raquo; [&lt;a href=&quot;'.get_permalink().'#more-\$2&quot;&gt;'.\$postMore.'&lt;/a&gt;]&lt;/span&gt;&lt;span class=&quot;viewBox&quot;&gt;&lt;/span&gt;&lt;span&gt;&amp;laquo; [&lt;a href=&quot;'.get_permalink().'#more-\$2&quot;&gt;'.\$postLess.'&lt;/a&gt;]&lt;/span&gt;'.\$postLinkPostfix.' [&lt;a href=&quot;'.get_permalink().'&quot;&gt;Permalink&lt;/a&gt;]'), \$content);</code></p>
<p>In the &#8220;getPost&#8221; function, I added the lines:</p>
<ul>
<li><code>global $post;</code>
</li>
<li><code>\$post-&gt;ID = $id;</code>
</li>
</ul>
<p>These were required to allow the footnotes plugin to create its anchors properly.</p>
<p>In the same function, I replaced the lines beginning <code>\$content=explode(...)</code> with:</p>
<p><code>\$content=explode(\$token,apply_filters('the_content',\$post_content),2); if (count(\$content)==2) { echo \$content[1]; }</code></p>
<p>This was needed so that plugins can apply filters to both parts of a text separated by the &lt;!&#8211;more&#8211;&gt; tag.</p>
<p>Finally, in the line <code>gE('viewBox-'+postID).style.display = 'block';</code>, I changed <code>block</code> to <code>inline</code>.</p>
<p>The above changes allow the post to be collapsed in the middle of a paragraph (or of a sentence, even).</p>
<p>There&#8217;s a slight bug in the integration of the The Ajaxified Expand Post NOW Plugin with jsMath.  Currently, mathematical formulas after the &lt;!&#8211;more&#8211;&gt; tag do not get processed.  To get around this, in posts where formulas appear after the &lt;!&#8211;more&#8211;&gt; tag but not before, an empty equation needs to be inserted before the tag to force jsMath to load.  Furthermore, the plugin code needs to be edited to add these lines to the end of the &#8220;fetchDone&#8221; function:</p>
<p><code>jsMath.ConvertTeX('viewBox-'+postID);&lt;br /&gt;
jsMath.Process('viewBox-'+postID); </code></p>
<p>Come to think of it, there&#8217;s probably nothing I can do about this.  The reason is that if there are any error messages (jsMath is missing fonts, and so on), they have to be displayed at the top of the site.  There&#8217;s no way this can happen if jsMath is loaded dynamically through Ajax when a post is expanded.</p>
<h2>OpenID</h2>
<p><s>The OpenID plugin has a bug which prevents trackbacks and pingbacks from working.  See <a href="http://wordpress.org/support/topic/263012">here</a> for the fix.</s>  This is fixed in the latest version.</p>
<h2>WP-Syntax (GeSHi)</h2>
<p>The <a href="http://wordpress.org/extend/plugins/wp-syntax/">WP-Syntax</a> plugin needs to escape special characters.  See <a href="http://blog.felho.hu/escaping-problem-with-wp-syntax-wordpress-plugin.html">here</a> for the fix.</p>
<p>Move geshi to the common subdirectory, since it&#8217;s also used by MediaWiki.  Change the line <code>include_once(&quot;geshi/geshi.php&quot;)</code> to <code>include_once(getenv(&quot;DOCUMENT_ROOT&quot;) . &quot;/common/geshi/geshi.php&quot;)</code>.</p>
<h2>WP-reCAPTCHA</h2>
<p>After setting the tab index in the options, the &#8220;comments.php&#8221; file has to be edited to change the tab index of the &#8220;Submit&#8221; button, so that the reCAPTCHA appears between the comment and the submit button.  </p>
<h2>Subscribe to Comments</h2>
<p>The Subscribe to Comments plug-in likewise needs to be edited so that its checkbox appears just before the reCAPTCHA.  The &#8220;comments.php&#8221; file needs to be edited to allow users to subscribe to comments even if they haven&#8217;t commented, by adding a call to <code>show_subscription_checkbox()</code>.  I&#8217;ve also edited the plugin to insert some tab index information.</p>
<p>The plugin needs to be edited in a number of places to make it compatible with WordPress<sup>&mu;</sup>, especially its concept of <a href="http://codex.wordpress.org/Roles_and_Capabilities">roles and capabilities</a>.  In particular, references to <code>current_user_can('manage_options')</code> should be changed to <code>current_user_can('publish_posts')</code> (to enable editors and blog posters who are not administrators to manage subscriptions).  Also, SQL queries to <code>SELECT</code> comments need to have <code>AND comment_type = ''</code> added, so that pingbacks and trackbacks are ignored.</p>
<p>A minor cosmetic change: the &#8220;Return to the page you were viewing&#8221; link was changed so that it goes to the &#8220;#respond&#8221; anchor on that page.</p>
<h2>Yet Another Related Posts Plugin</h2>
<p>There&#8217;s a bug in version 3.0.13 of YARPP which adds slashes in front of quotation marks for several options on the options page.  See <a href="http://wordpress.org/support/topic/315560">here</a>.</p>
<h2>Sociable</h2>
<p>The Sociable, YARPP, and AEPN plugins interact with each other in a bad way.  Sociable and YARPP work together in single posts.  However, when they are used together with AEPN, inside an expanded post (say, on the front page) the Sociable plugin interferes with the YARPP plugin so that the latter displays the <em>wrong</em> list of related posts.</p>
<p>I don&#8217;t know how to fix this, except to turn off the option to &#8220;Automatically display related posts&#8221;, and then adding a call to <code>related_posts()</code> to the K2 hook <code>template_entry_foot</code>.</p>
<h2>K2 Rolling Archives</h2>
<p>In the &#8220;themes/k2/js/k2.functions.js&#8221; file, change the &#8220;smartPosition&#8221; function to the following:</p>
<p>/* Fix the position of an element when it is about to be scrolled off-screen */<br />
function smartPosition(obj) {</p>
<pre>
       if ( jQuery.browser.msie &amp;&amp; parseInt(jQuery.browser.version, 10) = jQuery(obj).offset().top) {
                       jQuery('body').addClass('smartposition');
                       rollingarchives.style.left = '' + (345 - document.documentElement.scrollLeft) + 'px';
               } else {
                       jQuery('body').removeClass('smartposition');
                       rollingarchives.style.left = '0px';
               }
       });
</pre>
<p>};</p>
<p>The value of 345 was determined experimentally.  There&#8217;s probably a better (cleaner) way to do this!</p>
<h2>Kses hack</h2>
<p>The tags &#8220;ref&#8221;, &#8220;references&#8221;, and &#8220;wikindx&#8221; had to be allowed through a so-called &#8220;kses hack&#8221;, so that footnotes and citations would work.</p>
<p>I had to edit the &#8220;wp-includes/kses.php&#8221; file to include &#8220;market&#8221; as an allowed protocol, to allow links to Android Market.</p>
<h2>Incompatible plugins</h2>
<p>Some plugins written for WordPress may be incompatible with WordPress<sup>&mu;</sup>.  In some cases, it may be impossible to update the plugin&#8217;s options.  A hack to get around this is to comment out any &#8220;check_admin_referer&#8221; lines in the plugin, change the options, and then uncomment those lines.</p>
<h1>Wiki (<a href="http://www.mediawiki.org">MediaWiki</a>)</h1>
<p>Major changes to the skin, obviously.  The original settings for the sidebar were:</p>
<ul>
<li>SEARCH
</li>
<li>navigation
<ul>
<li>mainpage|mainpage-description
</li>
<li>portal-url|portal
</li>
<li>currentevents-url|currentevents
</li>
<li>recentchanges-url|recentchanges
</li>
<li>randompage-url|randompage
</li>
<li>helppage|help
</li>
</ul>
</li>
<li>TOOLBOX
</li>
<li>LANGUAGES
</li>
</ul>
<p>Note that to edit the sidebar, just edit the special wiki page <a href="http://stargrads.net/wiki/MediaWiki:Sidebar">MediaWiki:Sidebar</a>.</p>
<p>The CSS for the site is found at <a href="http://stargrads.net/wiki/MediaWiki:Common.css">MediaWiki:Common.css</a>.</p>
<h1>Forums (<a href="http://bbpress.org/">bbPress</a>)</h1>
<p>In the &#8220;header.php&#8221; file, add the line &#8220;<code></code>&#8221; to load jsMath.</p>
<h1>Bibliography (<a href="http://wikindx.sourceforge.net/"><span style="font-variant: small-caps">Wikindx</span></a>)</h1>
<p>To write the name of the software, use &#8220;<code>&lt;span style=&quot;font-variant: small-caps;&quot;&gt;Wikindx&lt;/span&gt;</code>&#8220;, which shows up as<br />
<span style="font-variant: small-caps">Wikindx</span>.</p>
<h1>Calendar (<a href="http://www.k5n.us/webcalendar.php">WebCalendar</a>)</h1>
<p>These pertain to WebCalendar 1.20.</p>
<p>There&#8217;s a bug that prevents WebCalendar from display pages with untimed events if using PHP 5.2.8 and up.  Typically the web server returns a zero-sized reply.  See <a href="http://sourceforge.net/forum/forum.php?thread_id=2725065&amp;forum_id=11587">this post</a> for the fix.</p>
<p>There&#8217;s another bug that prevents user/group selection pages from displaying with the error &#8220;Program Error: No Form Specified&#8221;.  See <a href="http://sourceforge.net/forum/message.php?msg_id=5801794">here</a> for the fix.</p>
<h1>Equations (<a href="http://www.math.union.edu/~dpvc/jsMath/">jsMath</a>)</h1>
<p>The following code was inserted into the header files of the templates for this web site:<br />
<code>&lt;script type=&quot;text/javascript&quot; src=&quot;http://&lt;em&gt;path.to&lt;/em&gt;/jsMath/easy/load.js&quot;&gt;&lt;/script&gt;</code></p>
<p>To get equations to display correctly in {{sc|W|IKINDX}}, curly brackets have to be escaped correctly.  Replace each &#8220;{&#8221; with &#8220;{{}&#8221; and each &#8220;}&#8221; with &#8220;{}}&#8221;.</p>
<p>When updating, don&#8217;t forget to save the customised macros and the installed fonts.</p>
<p>See above for a slight bug with the Ajaxified Expand Post NOW Plugin in regards to jsMath.</p>
<h1>Web Analytics (<a href="http://piwik.org/">piwik</a>)</h1>
<p>When upgrading piwik, pay special attention to the config and tmp subdirectories, especially their permission settings.</p>
<p>There are plugins available for <a href="http://piwik.org/blog/2008/06/new-plugin-wordpress-piwik-integration/">WordPress</a> and <a href="http://piwik.org/blog/2008/06/new-plugin-mediawiki-piwik-integration/">MediaWiki</a>, but for now, the piwik code is just going into the template. <!--adsensestop--></p>
<p>&#8211; davinci</p>
<img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=2962&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://stargrads.net/blogs/davinci/2009/09/wikindx-macro-plug-in-for-wordpress/' rel='bookmark' title='Wikindx macro plug-in for WordPress'>Wikindx macro plug-in for WordPress</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/08/using-the-ajaxified-expand-post-now-plugin-with-rob-millers-footnotes-plugin/' rel='bookmark' title='Using the Ajaxified Expand Post Now plug-in with Rob Miller&#8217;s Footnotes plug-in'>Using the Ajaxified Expand Post Now plug-in with Rob Miller&#8217;s Footnotes plug-in</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/06/using-jsmath-with-wordpress-bbpress-and-wikindx/' rel='bookmark' title='Using jsMath with WordPress, bbPress, and Wikindx'>Using jsMath with WordPress, bbPress, and Wikindx</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2010/10/old-helpsetup-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing cruft and re-organisation</title>
		<link>http://stargrads.net/blogs/davinci/2010/10/removing-cruft-and-re-organisation/</link>
		<comments>http://stargrads.net/blogs/davinci/2010/10/removing-cruft-and-re-organisation/#comments</comments>
		<pubDate>Sat, 23 Oct 2010 19:54:05 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[★grads.net]]></category>
		<category><![CDATA[clean-up]]></category>
		<category><![CDATA[re-organisation]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=2945</guid>
		<description><![CDATA[
I'm cleaning up this web site this weekend.  Expect lots of things to be broken.
]]></description>
			<content:encoded><![CDATA[<p>When I first made this web site, I didn&#8217;t know what it was going to be about.  I threw together a lot of tools that I wanted to experiment with.  Most of these became unused after some time, and are just taking up space and bandwidth.</p>
<p>I have a much better idea now of where this web site is headed.  Therefore, I&#8217;m going to be doing some trimming and re-organising this weekend.  It should be much more sleek and focused afterwards.  In the mean time, many things will probably be broken.</p>
<p>&#8211; davinci 12184</p>
<img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=2945&type=feed" alt="" /><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2010/10/removing-cruft-and-re-organisation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing the site&#8217;s appearance in Internet Explorer</title>
		<link>http://stargrads.net/blogs/davinci/2009/09/fixing-the-sites-appearance-in-internet-explorer/</link>
		<comments>http://stargrads.net/blogs/davinci/2009/09/fixing-the-sites-appearance-in-internet-explorer/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 20:17:58 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[★grads.net]]></category>
		<category><![CDATA[programming and technical issues]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=2085</guid>
		<description><![CDATA[
I spent several hours today getting this web site looking in Internet Explorer somewhat like what it looks like on other browsers.
]]></description>
			<content:encoded><![CDATA[<p>I just spent the day in the library, where I used Internet Explorer on a public terminal.  I knew that IE did not render CSS properly, but until I tried to use this web site for several hours in IE, I had no idea how bad things were.  I&#8217;ve hacked the CSS so that it displays reasonably well in IE now.  I hope this didn&#8217;t mess things up for other browsers.  Grr<span id="more-2085"></span>&#8230;</p>
<p>This graphic, which I found while searching for solutions to IE-related CSS issues, basically sums it up:<br />
<a href="http://www.flickr.com/photos/pauls/172883694/" title="Time Breakdown of Modern Web Design, on Flickr"><img src="http://farm1.static.flickr.com/60/172883694_4f72df1a70.jpg" width="500" height="375" alt="Time Breakdown of Modern Web Design" /></a><br />
The original image is from <a href="http://churchof.poisonedminds.com/d/20060621.html">The Church of Poisoned Minds</a>.</p>
<p>&#8211; davinci 11788</p>
<img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=2085&type=feed" alt="" /><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2009/09/fixing-the-sites-appearance-in-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wikindx macro plug-in for WordPress</title>
		<link>http://stargrads.net/blogs/davinci/2009/09/wikindx-macro-plug-in-for-wordpress/</link>
		<comments>http://stargrads.net/blogs/davinci/2009/09/wikindx-macro-plug-in-for-wordpress/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 16:20:11 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[★grads.net]]></category>
		<category><![CDATA[programming and technical issues]]></category>
		<category><![CDATA[Footnotes]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plug-in]]></category>
		<category><![CDATA[plug-ins]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[regular expression]]></category>
		<category><![CDATA[regular expressions]]></category>
		<category><![CDATA[Rob Miller]]></category>
		<category><![CDATA[WIKINDX]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=1860</guid>
		<description><![CDATA[
A small plug-in for WordPress, which adds a macro for inserting bibliography information from WIKINDX.
]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://stargrads.net/blogs/davinci/2009/06/using-jsmath-with-wordpress-bbpress-and-wikindx/">this previous post</a>, I had actually made use of a small plug-in I had written for <a href="http://wordpress.org/">WordPress</a>, which creates a macro for pulling bibliographical information from <a href="http://wikindx.sourceforge.net/"><span style="font-variant: small-caps">Wikindx</span></a>, which I use to manage my <a href="http://stargrads.net/bibliography/">bibliography</a>.</p>
<p>The plug-in is rather simple, but since a web search turned up nothing similar (which is kind of surprising), and someone might find it useful, I thought I&#8217;d post it here<span id="more-1860"></span>.</p>
<p>Here is the code for &#8220;wikindx.php&#8221;:</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
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>?php
<span style="color: #666666; font-style: italic;">/* 
Plugin Name: Wikindx
Plugin URL: http://stargrads.net/blogs/davinci/2009/09/wikindx-macro-plug-in-for-wordpress
Description: Adds a macro to WordPress to insert bibliography information from Wikindx.
Author: D. L. Yonge-Mallo
Version: 1.0
Author URI: http://stargrads.net/blogs/davinci/
*/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> parse_wikindx<span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$WikindxPath</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://path.to/wikindx/&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #990000;">preg_match_all</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#&amp;lt;wikindx( resource=&quot;([ \w]+)&quot;)?(&amp;gt;(.*)&amp;lt;/wikindx&amp;gt;| ?/&amp;gt;)#Usi'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wikindxs</span><span style="color: #339933;">,</span> PREG_SET_ORDER<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wikindxs</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$wikindxs</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$wikindx</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wikindx</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;ERROR: WIKINDX MISSING RESOURCE ARGUMENT&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$resourceId</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wikindx</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">{$WikindxPath}</span>cmsprint.php?action=getResource&amp;amp;id=<span style="color: #006699; font-weight: bold;">{$resourceId}</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">unserialize</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">base64_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$resourceId</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; ([<span style="color: #006699; font-weight: bold;">{$WikindxPath}</span>index.php?action=resourceView&amp;amp;id=<span style="color: #006699; font-weight: bold;">{$resourceId}</span> details])&quot;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;ERROR: WIKINDX RESOURCE &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$resourceId</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; NOT FOUND&quot;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wikindx</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$output</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</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: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'parse_wikindx'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
?<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Replace &ldquo;<a href="http://path.to/wikindx/">http://path.to/wikindx/</a>&rdquo; in the above with the URL to your installation of <span style="font-variant: small-caps">Wikindx</span>, obviously.  For example, mine is &ldquo;<a href="http://stargrads.net/bibliography/">http://stargrads.net/bibliography/</a>&rdquo;.</p>
<p>Put the file into the &#8220;plugins&#8221; directory on WordPress, or if you are using <a href="http://mu.wordpress.org/">WordPress<sup>&mu;</sup></a>, then into its &#8220;mu-plugins&#8221; directory.</p>
<p>The plug-in creates a new macro &#8220;wikindx&#8221; with one parameter &#8220;resource&#8221;, which can be used inside WordPress posts like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>wikindx resource<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;68&quot;</span> <span style="color: #339933;">/&amp;</span>gt<span style="color: #339933;">;</span></pre></div></div>

<p>Replace &#8220;68&#8243; in the example with the resource ID of the bibliography entry whose information you want.  (This ID can be found in the URL of the resource&#8217;s page on <span style="font-variant: small-caps">Wikindx</span>.)  The result is that the macro is replaced by the bibliographical information for that resource.  For the above example, this would be:</p>
<blockquote><p>R. Cleve, D. Gavinsky, and D. L. Yonge-Mallo, “Quantum Algorithms for Evaluating Min-Max Trees,” in <em>Proc. TQC 2008</em>, Tokyo, Japan, 2008, (<a href="http://stargrads.net/bibliography/index.php?action=resourceView&#038;id=68">details</a>)</p></blockquote>
<p>This plug-in can be used to good effect with <a href="http://robm.me.uk/projects/plugins/wordpress/footnotes">Rob Miller&#8217;s Footnotes plug-in for WordPress</a>, like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>ref name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;CGMSY08&quot;</span><span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;&amp;</span>lt<span style="color: #339933;">;</span>wikindx resource<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;206&quot;</span> <span style="color: #339933;">/&amp;</span>gt<span style="color: #339933;">;&amp;</span>lt<span style="color: #339933;">;/</span>ref<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span></pre></div></div>

<p>The result<sup><a class='footnote' id='note-1860-1' href='#footnote-1860-CGMSY08'>[1]</a></sup> can be seen in the footnote below.</p>
<p>&#8211; davinci 11780</p>
<hr />
<p><b>Update (Sept. 15, 2009):</b> I&#8217;ve added the plug-in to the <a href="http://wordpress.org/extend/plugins/wikindx-macro-plug-in-for-wordpress/">WordPress Plugin Directory</a>.</p>
<img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=1860&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://stargrads.net/blogs/davinci/2009/08/using-the-ajaxified-expand-post-now-plugin-with-rob-millers-footnotes-plugin/' rel='bookmark' title='Using the Ajaxified Expand Post Now plug-in with Rob Miller&#8217;s Footnotes plug-in'>Using the Ajaxified Expand Post Now plug-in with Rob Miller&#8217;s Footnotes plug-in</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/09/annotate-with-jarnal-plug-in-module-for-wikindx/' rel='bookmark' title='Annotate With Jarnal Plug-In Module for Wikindx'>Annotate With Jarnal Plug-In Module for Wikindx</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/06/using-jsmath-with-wordpress-bbpress-and-wikindx/' rel='bookmark' title='Using jsMath with WordPress, bbPress, and Wikindx'>Using jsMath with WordPress, bbPress, and Wikindx</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2009/09/wikindx-macro-plug-in-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using the Ajaxified Expand Post Now plug-in with Rob Miller&#8217;s Footnotes plug-in</title>
		<link>http://stargrads.net/blogs/davinci/2009/08/using-the-ajaxified-expand-post-now-plugin-with-rob-millers-footnotes-plugin/</link>
		<comments>http://stargrads.net/blogs/davinci/2009/08/using-the-ajaxified-expand-post-now-plugin-with-rob-millers-footnotes-plugin/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 04:38:27 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[★grads.net]]></category>
		<category><![CDATA[programming and technical issues]]></category>
		<category><![CDATA[AEPN]]></category>
		<category><![CDATA[Ajaxified Expand Post NOW]]></category>
		<category><![CDATA[Footnotes]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[mashup]]></category>
		<category><![CDATA[plug-ins]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[Rob Miller]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=1077</guid>
		<description><![CDATA[
A technical post on how to use the Ajaxified Expand Post NOW plug-in and Rob Miller's Footnotes plug-in for WordPress together.
]]></description>
			<content:encoded><![CDATA[<p>This is a little technical post for anyone who is interested in using the Ajaxified Expand Post NOW plug-in<sup><a class='footnote' id='note-1077-1' href='#footnote-1077-aepn'>[1]</a></sup> and Rob Miller&#8217;s Footnotes plug-in<sup><a class='footnote' id='note-1077-2' href='#footnote-1077-footnotes'>[2]</a></sup> together.  On <a href="http://stargrads.net">this</a> website, I&#8217;m running AEPN version 0.7 beta 7, Footnotes version 1.2.1, and WordPress<sup>&mu;</sup> version 2.8.2, which are the latest versions as of this writing.  </p>
<p>The AEPN plug-in truncates a post and appends an<span id="more-1077"></span> &#8220;[Expand post]&#8221; button, whenever it is displayed other than on a single page by itself.  Clicking on the button fetches and displays the rest of the post.  The Footnotes plug-in should be self-explanatory.</p>
<p>The problem with using these two plug-ins together is that if any citations are made before the fold (i.e., the <code>&lt;!--more--&gt;</code> tag), the corresponding footnotes will appear at the bottom of the (collapsed) post.  When the post is subsequently expanded, those footnotes will appear again at the end of the expansion, so that they are displayed twice.</p>
<p>The fix for this is rather simple.  In the &#8220;footnotes.php&#8221; file, surround the final if-else block with a test to see if a single post is being displayed.  If so, execute the block as before.  Otherwise, return the post&#8217;s content without the accompanying footer.  The code should look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> is_single<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>	
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&amp;lt;references /&amp;gt;'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$footer</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">else</span>
        <span style="color: #b1b100;">return</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&amp;lt;references /&amp;gt;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$footer</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>When the AEPN plug-in fetches a post to expand it, it is treated as a single post, and so the footnotes will show up correctly &#8212; once, at the bottom of the expansion.</p>
<p>In the &#8220;ajaxified-expand-post-now.php&#8221; file, add the following lines to the top of the &#8220;getPost&#8221; function:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$post</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>ID <span style="color: #339933;">=</span> <span style="color: #000088;">$id</span><span style="color: #339933;">;</span></pre></div></div>

<p>This is needed so that the names for the footnote anchors in the expanded portion of the post are generated correctly.  Citations made before the fold will link to the post&#8217;s single page, whereas citations made after it<sup><a class='footnote' id='note-1077-3' href='#footnote-1077-example'>[3]</a></sup> will link to the footnotes section at the bottom of the expansion, on the current page.</p>
<p>Finally, it may be necessary to use a so-called &#8220;<a href="http://mu.wordpress.org/forums/tags/kses">kses</a> hack&#8221; to prevent the &#8220;ref&#8221; and &#8220;references&#8221; tags needed by the Footnotes plug-in from being stripped by WordPress<sup>&mu;</sup>.  How to do this is beyond the scope of this post.</p>
<p>See also <a href="http://stargrads.net/blogs/davinci/2009/06/using-jsmath-with-wordpress-bbpress-and-wikindx/">this previous post</a> for an example of how the Footnotes plug-in can be used with the <a href="http://wikindx.sourceforge.net/"><span style="font-variant: small-caps">Wikindx</span></a> bibliographical management system to create a bibliographical citation. </p>
<p>&#8211; davinci</p>
<img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=1077&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://stargrads.net/blogs/davinci/2009/09/wikindx-macro-plug-in-for-wordpress/' rel='bookmark' title='Wikindx macro plug-in for WordPress'>Wikindx macro plug-in for WordPress</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/09/annotate-with-jarnal-plug-in-module-for-wikindx/' rel='bookmark' title='Annotate With Jarnal Plug-In Module for Wikindx'>Annotate With Jarnal Plug-In Module for Wikindx</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2009/08/using-the-ajaxified-expand-post-now-plugin-with-rob-millers-footnotes-plugin/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Using jsMath with WordPress, bbPress, and Wikindx</title>
		<link>http://stargrads.net/blogs/davinci/2009/06/using-jsmath-with-wordpress-bbpress-and-wikindx/</link>
		<comments>http://stargrads.net/blogs/davinci/2009/06/using-jsmath-with-wordpress-bbpress-and-wikindx/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 18:27:57 +0000</pubDate>
		<dc:creator>davinci</dc:creator>
				<category><![CDATA[★grads.net]]></category>
		<category><![CDATA[programming and technical issues]]></category>
		<category><![CDATA[bbPress]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[jsMath]]></category>
		<category><![CDATA[mashup]]></category>
		<category><![CDATA[WIKINDX]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://stargrads.net/blogs/davinci/?p=867</guid>
		<description><![CDATA[
This post describes how to integrate jsMath with WordPress, bbPress, and Wikindx.
]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s really no special trick to using <a href="http://www.math.union.edu/~dpvc/jsMath/">jsMath</a> with <a href="http://wordpress.org/">WordPress</a>, <a href="http://bbpress.org/">bbPress</a>, or <a href="http://wikindx.sourceforge.net/"><span style="font-variant: small-caps">Wikindx</span></a> &#8212; just follow the <a href="http://www.math.union.edu/~dpvc/jsMath/authors/installation.html">installation instructions</a>.</p>
<p>Essentially, you just need to add the following code in the header of your web site (where &ldquo;<em>path.to</em>&rdquo; should be replaced with the URL to your installation of jsMath):</p>
<blockquote><p>&lt;script type=&quot;text/javascript&quot; src=&quot;http://<em>path.to</em>/jsMath/easy/load.js&quot;&gt;&lt;/script&gt;</p></blockquote>
<p>For <a href="http://stargrads.net"><em>this</em> web site</a>, the above line was added to the headers of each of the template files of the component software packages.  </p>
<p>One <em>minor</em> trick to getting jsMath to work with <span style="font-variant: small-caps">Wikindx</span> is that all special characters have to be escaped properly\(\)<span id="more-867"></span>.  For example, to get the title of Mario Szegedy&#8217;s paper<sup><a class='footnote' id='note-867-1' href='#footnote-867-S04'>[1]</a></sup> on quantum walks to display correctly, as seen <a href="http://stargrads.net/bibliography/index.php?action=resourceView&amp;id=194">here</a>, I had to enter the title as:</p>
<blockquote><p>Spectra of Quantized Walks and a \$\sqrt{{}\delta\epsilon{}}\$-Rule</p></blockquote>
<p>That is, where the LaTeX math syntax requires a left curly bracket, you enter &#8220;{{}&#8221;, and where it requires a right curly bracket, you enter &#8220;{}}&#8221;.  The title then appears as in the footnote below.</p>
<p>I have created a <a href="http://stargrads.net/wiki/Help:Setup">setup help page</a> on the wiki to record details such as these.  Also, see <a href="http://stargrads.net/forums/topic.php?id=3">this forum post</a> for some macros defined for use on this site.</p>
<p>&#8211; davinci</p>
<img src="http://stargrads.net/blogs/davinci/?ak_action=api_record_view&id=867&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://stargrads.net/blogs/davinci/2009/09/wikindx-macro-plug-in-for-wordpress/' rel='bookmark' title='Wikindx macro plug-in for WordPress'>Wikindx macro plug-in for WordPress</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/08/using-the-ajaxified-expand-post-now-plugin-with-rob-millers-footnotes-plugin/' rel='bookmark' title='Using the Ajaxified Expand Post Now plug-in with Rob Miller&#8217;s Footnotes plug-in'>Using the Ajaxified Expand Post Now plug-in with Rob Miller&#8217;s Footnotes plug-in</a></li>
<li><a href='http://stargrads.net/blogs/davinci/2009/09/annotate-with-jarnal-plug-in-module-for-wikindx/' rel='bookmark' title='Annotate With Jarnal Plug-In Module for Wikindx'>Annotate With Jarnal Plug-In Module for Wikindx</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stargrads.net/blogs/davinci/2009/06/using-jsmath-with-wordpress-bbpress-and-wikindx/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

