Welcome to TiddlyWiki created by Jeremy Ruston, Copyright © 2007 UnaMesa Association
DIY: A European Camping Guide
<html>
<iframe width="425" height="350" frameborder="no" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps/ms?ie=UTF8&hl=en&om=1&s=AARTsJo219nHTffJe8f2FUUe9K3gChNiOw&msa=0&msid=106995367328465302270.00043711fa726851dde32&ll=49.67047,7.946934&spn=4.978008,9.338379&z=6&output=embed"></iframe><br/><a href="http://maps.google.com/maps/ms?ie=UTF8&hl=en&om=1&msa=0&msid=106995367328465302270.00043711fa726851dde32&ll=49.67047,7.946934&spn=4.978008,9.338379&z=6&source=embed" style="color:#0000FF;text-align:left;font-size:small">View Larger Map</a>
</html>
Eindhoven to Bonn (172 km, around 2 hours, highway)
Bonn to Koblenz (84 km, castle road, camp)
Koblenz to Mainz (100 km, castle road, camp)
Mainz to Wurzburg (153 km, around 1.5 hours, highway)
!Germany
!!Rhine River
http://www.rollintl.com/roll/rhine.htm
[img[rhine|images/travel/rhine.gif]]
!!Romantic Road
http://www.romanticroad.com
[img[rr|images/travel/rrmap1152.gif]]
!!Seminar Grid Computing
<html><a href="http://www.liacs.nl/~hli/courses/grid2002/gc.html" target="_blank">2002</a></html> | <html><a href="http://www.liacs.nl/~hli/courses/grid2004/lucgrid.htm" target="_blank">2004</a></html> | <html><a href="http://www.liacs.nl/~hli/courses/grid2005/index.htm" target="_blank">2005</a></html> | <html><a href="http://www.liacs.nl/~hli/courses/grid2006/index.htm" target="_blank">2006</a></html>
!!Operating Systems
<html><a href="http://blackboard.leidenuniv.nl/webapps/portal/frameset.jsp" target="_blank">2005</a></html>
!!Network
<html><a href="http://www.liacs.nl/~hli/courses/network2004/html/index.html" target="_blank">2004</a></html>
/***
|''Name:''|CryptoFunctionsPlugin|
|''Description:''|Support for cryptographic functions|
***/
//{{{
if(!version.extensions.CryptoFunctionsPlugin) {
version.extensions.CryptoFunctionsPlugin = {installed:true};
//--
//-- Crypto functions and associated conversion routines
//--
// Crypto "namespace"
function Crypto() {}
// Convert a string to an array of big-endian 32-bit words
Crypto.strToBe32s = function(str)
{
var be = Array();
var len = Math.floor(str.length/4);
var i, j;
for(i=0, j=0; i<len; i++, j+=4) {
be[i] = ((str.charCodeAt(j)&0xff) << 24)|((str.charCodeAt(j+1)&0xff) << 16)|((str.charCodeAt(j+2)&0xff) << 8)|(str.charCodeAt(j+3)&0xff);
}
while (j<str.length) {
be[j>>2] |= (str.charCodeAt(j)&0xff)<<(24-(j*8)%32);
j++;
}
return be;
};
// Convert an array of big-endian 32-bit words to a string
Crypto.be32sToStr = function(be)
{
var str = "";
for(var i=0;i<be.length*32;i+=8)
str += String.fromCharCode((be[i>>5]>>>(24-i%32)) & 0xff);
return str;
};
// Convert an array of big-endian 32-bit words to a hex string
Crypto.be32sToHex = function(be)
{
var hex = "0123456789ABCDEF";
var str = "";
for(var i=0;i<be.length*4;i++)
str += hex.charAt((be[i>>2]>>((3-i%4)*8+4))&0xF) + hex.charAt((be[i>>2]>>((3-i%4)*8))&0xF);
return str;
};
// Return, in hex, the SHA-1 hash of a string
Crypto.hexSha1Str = function(str)
{
return Crypto.be32sToHex(Crypto.sha1Str(str));
};
// Return the SHA-1 hash of a string
Crypto.sha1Str = function(str)
{
return Crypto.sha1(Crypto.strToBe32s(str),str.length);
};
// Calculate the SHA-1 hash of an array of blen bytes of big-endian 32-bit words
Crypto.sha1 = function(x,blen)
{
// Add 32-bit integers, wrapping at 32 bits
add32 = function(a,b)
{
var lsw = (a&0xFFFF)+(b&0xFFFF);
var msw = (a>>16)+(b>>16)+(lsw>>16);
return (msw<<16)|(lsw&0xFFFF);
};
// Add five 32-bit integers, wrapping at 32 bits
add32x5 = function(a,b,c,d,e)
{
var lsw = (a&0xFFFF)+(b&0xFFFF)+(c&0xFFFF)+(d&0xFFFF)+(e&0xFFFF);
var msw = (a>>16)+(b>>16)+(c>>16)+(d>>16)+(e>>16)+(lsw>>16);
return (msw<<16)|(lsw&0xFFFF);
};
// Bitwise rotate left a 32-bit integer by 1 bit
rol32 = function(n)
{
return (n>>>31)|(n<<1);
};
var len = blen*8;
// Append padding so length in bits is 448 mod 512
x[len>>5] |= 0x80 << (24-len%32);
// Append length
x[((len+64>>9)<<4)+15] = len;
var w = Array(80);
var k1 = 0x5A827999;
var k2 = 0x6ED9EBA1;
var k3 = 0x8F1BBCDC;
var k4 = 0xCA62C1D6;
var h0 = 0x67452301;
var h1 = 0xEFCDAB89;
var h2 = 0x98BADCFE;
var h3 = 0x10325476;
var h4 = 0xC3D2E1F0;
for(var i=0;i<x.length;i+=16) {
var j,t;
var a = h0;
var b = h1;
var c = h2;
var d = h3;
var e = h4;
for(j = 0;j<16;j++) {
w[j] = x[i+j];
t = add32x5(e,(a>>>27)|(a<<5),d^(b&(c^d)),w[j],k1);
e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
}
for(j=16;j<20;j++) {
w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
t = add32x5(e,(a>>>27)|(a<<5),d^(b&(c^d)),w[j],k1);
e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
}
for(j=20;j<40;j++) {
w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
t = add32x5(e,(a>>>27)|(a<<5),b^c^d,w[j],k2);
e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
}
for(j=40;j<60;j++) {
w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
t = add32x5(e,(a>>>27)|(a<<5),(b&c)|(d&(b|c)),w[j],k3);
e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
}
for(j=60;j<80;j++) {
w[j] = rol32(w[j-3]^w[j-8]^w[j-14]^w[j-16]);
t = add32x5(e,(a>>>27)|(a<<5),b^c^d,w[j],k4);
e=d; d=c; c=(b>>>2)|(b<<30); b=a; a = t;
}
h0 = add32(h0,a);
h1 = add32(h1,b);
h2 = add32(h2,c);
h3 = add32(h3,d);
h4 = add32(h4,e);
}
return Array(h0,h1,h2,h3,h4);
};
}
//}}}
/***
|''Name:''|DeprecatedFunctionsPlugin|
|''Description:''|Support for deprecated functions removed from core|
***/
//{{{
if(!version.extensions.DeprecatedFunctionsPlugin) {
version.extensions.DeprecatedFunctionsPlugin = {installed:true};
//--
//-- Deprecated code
//--
// @Deprecated: Use createElementAndWikify and this.termRegExp instead
config.formatterHelpers.charFormatHelper = function(w)
{
w.subWikify(createTiddlyElement(w.output,this.element),this.terminator);
};
// @Deprecated: Use enclosedTextHelper and this.lookaheadRegExp instead
config.formatterHelpers.monospacedByLineHelper = function(w)
{
var lookaheadRegExp = new RegExp(this.lookahead,"mg");
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source);
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var text = lookaheadMatch[1];
if(config.browser.isIE)
text = text.replace(/\n/g,"\r");
createTiddlyElement(w.output,"pre",null,null,text);
w.nextMatch = lookaheadRegExp.lastIndex;
}
};
// @Deprecated: Use <br> or <br /> instead of <<br>>
config.macros.br = {};
config.macros.br.handler = function(place)
{
createTiddlyElement(place,"br");
};
// Find an entry in an array. Returns the array index or null
// @Deprecated: Use indexOf instead
Array.prototype.find = function(item)
{
var i = this.indexOf(item);
return i == -1 ? null : i;
};
// Load a tiddler from an HTML DIV. The caller should make sure to later call Tiddler.changed()
// @Deprecated: Use store.getLoader().internalizeTiddler instead
Tiddler.prototype.loadFromDiv = function(divRef,title)
{
return store.getLoader().internalizeTiddler(store,this,title,divRef);
};
// Format the text for storage in an HTML DIV
// @Deprecated Use store.getSaver().externalizeTiddler instead.
Tiddler.prototype.saveToDiv = function()
{
return store.getSaver().externalizeTiddler(store,this);
};
// @Deprecated: Use store.allTiddlersAsHtml() instead
function allTiddlersAsHtml()
{
return store.allTiddlersAsHtml();
}
// @Deprecated: Use refreshPageTemplate instead
function applyPageTemplate(title)
{
refreshPageTemplate(title);
}
// @Deprecated: Use story.displayTiddlers instead
function displayTiddlers(srcElement,titles,template,unused1,unused2,animate,unused3)
{
story.displayTiddlers(srcElement,titles,template,animate);
}
// @Deprecated: Use story.displayTiddler instead
function displayTiddler(srcElement,title,template,unused1,unused2,animate,unused3)
{
story.displayTiddler(srcElement,title,template,animate);
}
// @Deprecated: Use functions on right hand side directly instead
var createTiddlerPopup = Popup.create;
var scrollToTiddlerPopup = Popup.show;
var hideTiddlerPopup = Popup.remove;
// @Deprecated: Use right hand side directly instead
var regexpBackSlashEn = new RegExp("\\\\n","mg");
var regexpBackSlash = new RegExp("\\\\","mg");
var regexpBackSlashEss = new RegExp("\\\\s","mg");
var regexpNewLine = new RegExp("\n","mg");
var regexpCarriageReturn = new RegExp("\r","mg");
}
//}}}
// //''Name:'' EmailLink
// //''Version:'' <<getversion email>> (<<getversiondate email "DD MMM YYYY">>)
// //''Author:'' AlanHecht
// //''Type:'' [[Macro|Macros]]
// //''Description:'' email lets you list a "email" address without displaying it as readable text. This helps prevent your email address from being harvested by search engines and other web crawlers that read your page's contents. Using email, you type in the words "at" and "dot" instead of the punctuation symbols and add spaces inbetween words to disguise your address. However, email will display your email address in a web browser so that humans can read it. And email turns the address into a hyperlink that can be clicked to send you an instant email.
// //''Syntax:'' << {{{email yourname at yourdomain dot com "?optional parameters"}}} >>
// //Example 1: <<email sample at nowhere dot com>> (standard)
// //Example 2: <<email multiple dot sample at somewhere dot nowhere dot com>> (multiple dots)
// //Example 3: <<email sample at nowhere dot com "?subject=Submission&body=Type your message here.">> (with optional parameters)
// //''Directions:'' <<tiddler MacroDirections>>
// //''Notes:'' You can use the optional email parameters to stipulate a subject or message body for the message. Most (not all) email clients will use this information to construct the email message.
// //''Related Links:'' none
// //''Revision History:''
// // v0.1.0 (20 July 2005): initial release
// // v0.1.1 (22 July 2005): renamed the macro from "mailto" to "email" to further thwart email harvesters.
// // v0.1.2 (15 October 2005): added global replacement of "dots" thanks to a suggestion from Ralph Winter
// //''Code section:''
version.extensions.email = {major: 0, minor: 1, revision: 2, date: new Date("Oct 15, 2005")};
config.macros.email = {}
config.macros.email.handler = function(place,macroName,params)
{
var temp = params.join(" ");
data = temp.split("?");
var recipient = data[0];
recipient = recipient.replace(" at ","@").replace(" dot ",".","g");
recipient = recipient.replace(/\s/g,"");
var optional = data[1] ? "?" + data[1] : "";
var theLink = createExternalLink(place,"ma"+"il"+"to:"+recipient+optional);
theLink.appendChild(document.createTextNode(recipient))
}
<part HAG05>
*[[EnterpriseLiterature/HAG05]] J. Hagel and J. S. Brown. ''From push to pull - emerging models for mobilizing resources.'' working paper, johnhagel.com, 2005.
**Keywords: @@color(green):''here''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part CON05>
*[[EnterpriseLiterature/CON05]] R. Conniff. ''The limits of the alpha male.'' focus vol. IX/1, 200x.
**Keywords: @@color(green):''here''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part CHA05>
*[[EnterpriseLiterature/CHA05]] R. N. Charette. ''Why software fails.'' IEEE Spectrum, Sep, 2005.
**Keywords: @@color(green):''here''@@.
**Main Results: @@color(blue):here@@.
</part>
----
/***
|Name|GotoPlugin|
|Source|http://www.TiddlyTools.com/#GotoPlugin|
|Documentation|http://www.TiddlyTools.com/#GotoPluginInfo|
|Version|1.5.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|view any tiddler by entering it's title - displays list of possible matches|
''View a tiddler by typing its title and pressing //enter//.'' As you type, a list of possible matches is displayed. You can scroll-and-click (or use arrows+enter) to select/view a tiddler, or press //escape// to close the listbox to resume typing. When the listbox is ''//not//'' being displayed, press //escape// to clear the current text input and start over.
!!!!!Documentation
>see [[GotoPluginInfo]]
!!!!!Revisions
<<<
2008.02.17 [1.5.0] ENTER key always displays tiddler based on current input regardless of whether input matches any existing tiddler
|please see [[GotoPluginInfo]] for additional revision details|
2006.05.05 [0.0.0] started
<<<
!!!!!Code
***/
//{{{
version.extensions.gotoTiddler = {major: 1, minor: 5, revision: 0, date: new Date(200,2,17)};
// automatically tweak shadow SideBarOptions to add <<gotoTiddler>> macro above <<search>>
config.shadowTiddlers.SideBarOptions=config.shadowTiddlers.SideBarOptions.replace(/<<search>>/,"{{button{goto}}}\n<<gotoTiddler>><<search>>");
config.macros.gotoTiddler= {
handler:
function(place,macroName,params) {
var quiet=(params[0] && params[0]=="quiet"); if (quiet) params.shift();
var insert=(params[0] && params[0]=="insert"); if (insert) params.shift();
var instyle=params.shift(); if (!instyle) instyle="";
var liststyle=params.shift(); if (!liststyle) liststyle="";
var keyevent=window.event?"onkeydown":"onkeypress";
createTiddlyElement(place,"span").innerHTML
=this.html.replace(/%keyevent%/g,keyevent).replace(/%insert%/g,insert).replace(/%quiet%/g,quiet).replace(/%instyle%/g,instyle).replace(/%liststyle%/g,liststyle);
},
html:
'<form onsubmit="return false" style="display:inline;margin:0;padding:0">\
<input name=gotoTiddler type=text autocomplete="off" accesskey="G" style="%instyle%"\
title="enter a tiddler title"\
onclick="this.form.list.style.display=\'none\';"\
onfocus="this.select(); this.setAttribute(\'accesskey\',\'G\');"\
%keyevent%="return config.macros.gotoTiddler.inputEscKeyHandler(event,this,this.form.list);"\
onkeyup="return config.macros.gotoTiddler.inputKeyHandler(event,this,this.form.list,%quiet%,%insert%);">\
<select name=list style="%liststyle%;display:none;position:absolute"\
onchange="if (!this.selectedIndex) this.selectedIndex=1;"\
onblur="this.style.display=\'none\';"\
%keyevent%="return config.macros.gotoTiddler.selectKeyHandler(event,this,this.form.gotoTiddler,%insert%);"\
onclick="return config.macros.gotoTiddler.processItem(this.value,this.form.gotoTiddler,this,%insert%);">\
</select>\
</form>',
getItems:
function(val) {
if (!this.items.length || val.length<2) { // starting new search, refresh cached list of tiddlers/shadows/tags
this.items=new Array();
var tiddlers=store.getTiddlers("title","excludeLists");
for(var t=0; t<tiddlers.length; t++) this.items.push(tiddlers[t].title);
for (var t in config.shadowTiddlers) this.items.pushUnique(t);
var tags=store.getTags();
for(var t=0; t<tags.length; t++) this.items.pushUnique(tags[t][0]);
}
var found = [];
var match=val.toLowerCase();
for(var i=0; i<this.items.length; i++)
if (this.items[i].toLowerCase().indexOf(match)!=-1) found.push(this.items[i]);
return found;
},
items: [], // cached list of tiddlers/shadows/tags
getItemSuffix:
function(t) {
if (store.tiddlerExists(t)) return ""; // tiddler
if (store.isShadowTiddler(t)) return " (shadow)"; // shadow
return " (tag)"; // tag
},
keyProcessed:
function(ev) { // utility function: exits handler and prevents browser from processing the keystroke
ev.cancelBubble=true; // IE4+
try{event.keyCode=0;}catch(e){}; // IE5
if (window.event) ev.returnValue=false; // IE6
if (ev.preventDefault) ev.preventDefault(); // moz/opera/konqueror
if (ev.stopPropagation) ev.stopPropagation(); // all
return false;
},
inputEscKeyHandler:
function(event,here,list) {
var key=event.keyCode;
// escape... hide list (2nd esc=clears input)
if (key==27) {
if (list.style.display=="none")
here.value=here.defaultValue;
list.style.display="none";
return this.keyProcessed(event);
}
return true; // key bubbles up
},
inputKeyHandler:
function(event,here,list,quiet,insert) {
var key=event.keyCode;
// non-printing chars... bubble up, except: backspace=8, enter=13, space=32, down=40, delete=46
if (key<48) switch(key) { case 8: case 13: case 32: case 40: case 46: break; default: return true; }
// blank input... if down/enter... fall through (list all)... else, and hide list
if (!here.value.length && !(key==40 || key==13))
{ list.style.display="none"; return this.keyProcessed(event); }
// find matching items...
var found = this.getItems(here.value);
// non-blank input... enter key... show/create tiddler
if (key==13) return this.processItem(here.value,here,list,insert);
// make sure list is shown/hidden
list.style.display=(!quiet && found.length)?"block":"none";
// no matches, key bubbles up
if (!found.length) return true;
// down key... shows/moves to list...
if (key==40) { list.style.display="block"; list.focus(); }
// finally, if list is showing, fill it with found results...
if (list.style.display!="none") {
while (list.length > 0) list.options[0]=null; // clear list
found.sort(); // alpha by title
var hdr=this.listHeading.format([found.length,found.length==1?"":"s"]);
list.options[0]=new Option(hdr,"",false,false);
for (var t=0; t<found.length; t++) // fill list...
list.options[list.length]=new Option(found[t]+this.getItemSuffix(found[t]),found[t],false,false);
list.size=(found.length<this.listMaxSize?found.length:this.listMaxSize)+1; // resize list...
list.selectedIndex=(key==40 || key==13)?1:0;
}
return true; // key bubbles up
},
listMaxSize: 10,
listHeading: 'Found %0 matching title%1:',
selectKeyHandler:
function(event,list,editfield,insert) {
if (event.keyCode==27) // escape... hide list, move to edit field
{ editfield.focus(); list.style.display="none"; return this.keyProcessed(event); }
if (event.keyCode==13 && list.value.length) // enter... view selected item
{ this.processItem(list.value,editfield,list,insert); return this.keyProcessed(event); }
return true; // key bubbles up
},
processItem:
function(title,here,list,insert) {
if (!title.length) return; here.value=title; list.style.display='none';
if (insert) {
var tidElem=story.findContainingTiddler(here); if (!tidElem) { here.focus(); return false; }
var e=story.getTiddlerField(tidElem.getAttribute("tiddler"),"text");
if (!e||e.getAttribute("edit")!="text") return false;
var txt=prompt(this.askForText,title); if (!txt||!txt.length) { here.focus(); return false; }
e.focus(); // put focus on target field before setting selection
replaceSelection(e,"[["+txt+"|"+title+"]]"); // insert selected tiddler as a PrettyLink
}
else
story.displayTiddler(null,title); // show selected tiddler
return false;
},
askForText: "Enter the text to display for this link"
}
//}}}
/***
|Name|GotoPluginInfo|
|Source|http://www.TiddlyTools.com/#GotoPlugin|
|Documentation|http://www.TiddlyTools.com/#GotoPluginInfo|
|Version|1.5.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|documentation|
|Requires||
|Overrides||
|Description|Documentation for GotoPlugin|
''View a tiddler by typing its title and pressing //enter//.'' As you type, a list of possible matches is displayed. You can scroll-and-click (or use arrows+enter) to select/view a tiddler, or press //escape// to close the listbox to resume typing. When the listbox is ''//not//'' being displayed, press //escape// to clear the current text input and start over.
!!!!!Usage/Examples
<<<
| //IMPORTANT NOTE:// ''As of version 1.4.0 (2007.04.25),<br>to avoid conflict with javascript reserved keywords<br>the {{{<<goto>>}}} macro has been renamed to {{{<<gotoTiddler>>}}}'' |
syntax: {{{<<gotoTiddler quiet insert inputstyle liststyle>>}}}
All parameters are optional.
* ''quiet'' prevents //automatic// display of the list as each character is typed. To view the list when ''quiet'', use //down// or //enter//.
* ''insert'' causes the selected tiddler title to be inserted into the tiddler source currently being edited (use with EditTemplate)
* ''inputstyle'' and ''liststyle'' are CSS declarations that modify the default input and listbox styles. Note: styles containing spaces must be surrounded by ({{{"..."}}} or {{{'...'}}}) or ({{{[[...]]}}}).
{{{<<gotoTiddler>>}}}
<<gotoTiddler>>
{{{<<gotoTiddler quiet>>}}}
<<gotoTiddler quiet>>
{{{<<goto width:20em width:20em>>}}}
<<gotoTiddler width:20em width:20em>>
You can also invoke the macro with the "insert" keyword. When used in the [[EditTemplate]], like this:
{{{
<span macro="gotoTiddler insert"></span>
}}}
it allows you to type/select a tiddler title, and instantly insert a link to that title (e.g. {{{[[TiddlerName]]}}}) into the tiddler source being edited.
<<<
!!!!!Configuration
<<<
You can create a tiddler tagged with <<tag systemConfig>> to control the maximum height of the listbox of tiddlers/shadows/tags. //The default values are shown below://
//{{{
config.macros.gotoTiddler.listMaxSize=10;
//}}}
<<<
!!!!!Revisions
<<<
2008.02.17 [1.5.0] ENTER key always displays tiddler based on current input regardless of whether input matches any existing tiddler
2007.10.31 [1.4.3] removed extra trailing comma on last property of config.macros.gotoTiddler object. This fixes an error under InternetExplorer that was introduced 6 days ago... sure, I should have found it sooner, but... WHY DON'T PEOPLE TELL ME WHEN THINGS ARE BROKEN!!!!
2007.10.25 [1.4.2] added onclick handler for input field, so that clicking in field hides the listbox.
2007.10.25 [1.4.1] re-wrote getItems() to cache list of tiddlers/shadows/tags and use case-folded simple text match instead of regular expression to find matching tiddlers. This *vastly* reduces processing overhead between keystrokes, especially for documents with many (>1000) tiddlers. Also, removed local definition of replaceSelection(), now supported directly by the TW2.2+ core, as well as via backward-compatible plugin (see [[CoreTweaksArchive]]).
2007.04.25 [1.4.0] renamed macro from "goto" to "gotoTiddler". This was necessary to avoid a fatal syntax error in Opera (and other browsers) that require strict adherence to ECMAScript 1.5 standards which defines the identifier "goto" as "reserved for FUTURE USE"... *sigh*
2007.04.21 [1.3.2] in html definition, removed DIV around droplist (see 1.2.6 below). It created more layout problems then it solved. :-(
2007.04.01 [1.3.1] in processItem(), ensure that correct textarea field is found by checking for edit=="text" attribute
2007.03.30 [1.3.0] tweak SideBarOptions shadow to automatically add {{{<<goto>>}}} when using default sidebar content
2007.03.30 [1.2.6] in html definition, added DIV around droplist to fix IE problem where list appears next to input field instead of below it.
2007.03.28 [1.2.5] in processItem(), set focus to text area before setting selection (needed for IE to get correct selection 'range')
2007.03.28 [1.2.4] added prompt for 'pretty text' when inserting a link into tiddler content
2007.03.28 [1.2.3] added local copy of core replaceSelection() and modified for different replace logic
2007.03.27 [1.2.2] in processItem(), use story.getTiddlerField() to retrieve textarea control
2007.03.26 [1.2.1] in html, use either 'onkeydown' (IE) or 'onkeypress' (Moz) event to process <esc> key sooner, to prevent <esc> from 'bubbling up' to the tiddler (which will close the current editor).
2007.03.26 [1.2.0] added support for optional "insert" keyword param. When used in [[EditTemplate]], (e.g. {{{<span macro="goto insert"></span>}}}) it triggers alternative processing: instead of displaying the selected tiddler, that tiddler's title is inserted into a tiddler's textarea edit field surrounded by {{{[[...]]}}}.
2006.05.10 [1.1.2] when filling listbox, set selection to 'heading' item... auto-select first tiddler title when down/enter moves focus into listbox
2006.05.08 [1.1.1] added accesskey ("G") to input field html (also set when field gets focus). Also, inputKeyHandler() skips non-printing/non-editing keys.
2006.05.08 [1.1.0] added heading to listbox for better feedback (also avoids problems with 1-line droplist)
2006.05.07 [1.0.0] list matches against tiddlers/shadows/tags. input field auto-completion... 1st enter=complete matching input (or show list)... 2nd enter=view tiddler. optional "quiet" param controls when listbox appears.
2006.05.06 [0.5.0] added handling for enter (13), escape(27), and down(40) keys. Change 'ondblclick' to 'onclick' for list handler to view tiddlers (suggested by Florian Cauvin - prevents unintended trigger of tiddler editor). shadow titles inserted into list instead of appended to the end.
2006.05.05 [0.0.0] started
<<<
<<newDocument "label:Print" "prompt:print an HTML snapshot of this tiddler" nofilename print here>>
<script>
if (!window.story) window.story=window;
var title=story.findContainingTiddler(place).getAttribute("tiddler");
var t = encodeURIComponent(String.encodeTiddlyLink(title));
if(window.location.hash != t) window.location.hash = t;
</script>
<script>addthis_pub = 'huili';</script><html><a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s9.addthis.com/button1-share.gif" width="125" height="16" border="0" alt="" /></a></html><script src="http://s7.addthis.com/js/152/addthis_widget.js"></script>
!Workload Modeling in ~Large-Scale eScience Grids
''Hui Li''
v1.1, March 2008
Experimental performance evaluation studies require representative workloads to produce dependable results. This site is intended to present a comprehensive study on Grid workloads, and make the @@color(green):modeling software tools@@ available for @@color(red):large-scale eScience Grids with massive trivially-parallel batch jobs@@ ([[LCG - a production Grid in action|http://gridportal.hep.ph.ic.ac.uk/rtm/]]). For traces please refer to [[Grid Workload Archive|http://gwa.ewi.tudelft.nl/]].
----
@@Copyright notice@@:
All software that I developed and made available in this site is free software, unless otherwise stated, licensed under GPL (license) which gives you the rights to freely use, copy and modify the software under certain conditions. For third-party software and material please refer to the corresponding copyrights.
----
''Content''
1. Towards a better understanding of Grid workload dynamics
2. Modeling job arrivals
@@margin-left:2em;2.1 Interarrival time processes@@
@@margin-left:4em;2.1.1 ~MMPPs for short-/middle-range autocorrelations@@
@@margin-left:2em;2.2 Count/rate processes@@
@@margin-left:4em;2.2.1 Pseudo-periodicity - Matching Pursuit@@
@@margin-left:4em;2.2.2 Long Range Dependence (LRD) - Multifractal Wavelet Model(MWM)@@
@@margin-left:2em;2.3 A full model for Job Arrivals@@
@@margin-left:4em;2.3.1 Additive nature of rates@@
@@margin-left:4em;2.3.2 Conversion from rates to interarrivals@@
3. Modeling workload attributes
@@margin-left:2em;3.1 Multimodal distributions - Model Based Clustering@@
@@margin-left:2em;3.2 Generating correlations - A localized sampling algorithm with permutation@@
4. Performance evaluation of scheduling strategies via simulation
----
!!1. Towards a better understanding of Grid workload dynamics
Performance evaluation of scheduling studies requires representative workloads to produce dependable results. Real traces on production Grids are being collected and have not yet become widely available. Models for generating synthetic Grid workloads, on the other hand, are still emerging and subject to further research. Consequently a large number of literature on Grid scheduling studies either use traces available from parallel supercomputers (e.g. Parallel Workload Archive), or make simplified assumptions on workload characteristics (e.g. fixed-interval, bulk, or poisson job arrivals). However, it is shown that workload characteristics on eScience Grids are significantly different than those on conventional parallel supercomputers. It has been found that ''pseudo-periodicity'', ''long range dependence'', and ''the "bag-of-tasks" behavior'' with strong temporal locality are the main properties that characterize massive batch workloads. We believe that such workload patterns have important implications for scheduling in Grid environments. Therefore, it is important that representative models be developed to capture the salient workload properties for performance evaluation studies.
We refer to [Li, 08] for a comprehensive statistical analysis of a variety of workload traces. The following sections include descriptions of workload patterns and the corresponding models with software. Examples on how to use the models are given and sample synthetic traces are generated. The use of workload models in Grid simulation environments such as ~GridSim are also studied.
[Li, 08] H. Li. Workload Dynamics on Clusters and Grids. Journal of Supercomputing, 2008, to appear.
!!2. Modeling Job Arrivals
Job traffic can be described as a stochastic point process, which is defined as a mathematical construct that represents individual events as random points at times t_{n}. There are different representations of a point process. An interarrival time process I_{n} is a real-valued random sequence with I_{n} = t_{n} - t_{n-1}. The sequence of counts, or the count process, is formed by dividing the time axis into equally spaced contiguous intervals of T to produce a sequence of counts C_{k}(T), where C_{k}(T) = N((k+1)T) - N(kT) denotes the number of events in the k-th interval. This sequence forms a discrete-time random process of non-negative integers and it is another useful representation of a point process. A closely related measure is a normalized version of the sequence of counts, called the rate process R_{k}(T), where R_{k}(T) = C_{k}(T)/T.
In general, forming the sequence of counts loses information because the interarrival times between events within interval T are lost. Nevertheless, it preserves the correspondence between its discrete time axis and the absolute "real" time axis of the underlying point process. We can readily associate correlation in the process C_{k}(T) with the point process. The interarrival time process, on the other hand, contains all the information of the point process. However, it eliminates the direct correspondence between absolute time and the index number thus it only allows rough comparisons with correlations in the point process. Measures based on interarrival times are not able to reliably reveal the correlation structures of the underlying process and count based measures should be trusted instead when it comes to correlations [Lowen & Teich, 05].
[Lowen & Teich, 05] S. B. Lowen & M. C. Teich. ~Fractal-Based Point Processes. John Wiley & Sons, 2005.
!!!2.1 Interarrival time processes
!!!!2.1.1 ~MMPPs for short-/middle-range autocorrelations
A Markov modulated Poisson process (~MMPP) is an attractive model for short- and middle-range autocorrelations because it can be easily parameterized to produce dependence in the series and remains analytically tractable. ~MMPPs are used to generate SRD (short-range dependence) interarrival time processes, and the corresponding count processes show short dependence as well.
MMPP is a doubly stochastic Poisson process whose intensity is controlled by a finite state continuous-time Markov chain (CTMC). Equivalently, an MMPP process can be regarded as a Poisson process varying its arrival rate according to an m-state irreducible continuous time Markov chain. A natural problem which arises with the applications of ~MMPPs is how to estimate its parameters from the data trace. In [Ryden, 94] methods based on moment matching and maximum likelihood (MLE) are surveyed and it is proven that MLE methods are strongly consistent. In [Ryden, 96] an EM algorithm is proposed to compute the MLE estimates of the parameters of a m-state MMPP. Recently, [Roberts et al., 06] improved Ryden's EM algorithm and extended its applicability in two important aspects: firstly a scaling procedure is developed to circumvent the need for customized floating-point software, arising from the exponential increase of the likelihood function over time; secondly, evaluation of integrals of matrix exponentials is facilitated by a result of Van Loan, which achieves significant speedup. We implemented the improved version of Ryden's EM algorithm in Matlab.
''For parameter estimation of two-state ~MMPPs'': [[EM_MMPP_2.m|http://www.liacs.nl/~hli/gwm/mmpp/EM_MMPP_2.m]]
''For parameter estimation of r-state (r > 2) ~MMPPs'': [[EM_MMPP_r.m|http://www.liacs.nl/~hli/gwm/mmpp/EM_MMPP_r.m]]
''Example programs to simulate ~MMPPs'': [[gen_MMPP_2.m|http://www.liacs.nl/~hli/gwm/mmpp/gen_MMPP_2.m]] | [[gen_MMPP_3.m|http://www.liacs.nl/~hli/gwm/mmpp/gen_MMPP_3.m]] | [[gen_MMPP_4.m|http://www.liacs.nl/~hli/gwm/mmpp/gen_MMPP_4.m]]
[Li & Muskulus, 07] H. Li and M. Muskulus. Analysis and Modeling of Job Arrivals in a Production Grid. ACM Sigmetrics Performance Evaluation Review, 34(4), pp 59-70, 2007.
[Ryden, 94] T. Ryden. Parameter estimation for Markov modulated Poisson processes. Communications in Statistics - Stochastic Models, 10(4):795–829, 1994.
[Ryden, 96] T. Ryden. An EM algorithm for estimation in Markov-modulated Poisson processes. Comp. Stat. and Data Analysis, 21:431–447, 1996.
[Roberts et al., 06] W. J. J. Roberts, Y. Ephraim, and E. Dieguez. On Ryden’s EM algorithm for estimating MMPP’s. IEEE Sig. Proc. Let., 2006.
!!!2.2 Count/Rate Processes
Processes with strong correlation structures are analyzed and modeled using count/rate representations.
!!!!2.2.1 Modeling ~Pseudo-Periodicity with Matching Pursuit
From Fourier analysis it is known that periodicity shows up as peaks in the frequency domain. Real world data, however, seldom exhibits perfectly periodic behavior. In most situations pseudo-periodic signals are observed instead, potentially arising from various sources of noises and the time-varying nature of the generation scheme. Pseudo-periodicity job arrivals in Grids arises from automatic job submissions by users or agents, which is largely deterministic in nature. It can also be assumed that automated tasks need to be implemented to process such a huge amount of scientific data. Periodic behavior can also originate from testing and monitoring jobs which is indispensable for the continuous operation of the Grid.
Sinusoidal modeling has been widely used in modeling pseudo-periodic signals, especially in audio signal processing. The sinusoidal parameters can be estimated by methods such as spectral peak picking and analysis-by-synthesis. We focus on a particular analysis-by-synthesis method called matching pursuit. Introduced by [Mallat & Zhang, 93], matching pursuit is a greedy, iterative algorithm which searches a set of candidate functions for the element that best matches the signal and subtracts this function to form a residual signal to be approximated in the next iteration. It is natually suited for the analysis and synthesis of nonstationary signals with varying periodic/harmonic components across time. It can also be used to separate and extract periodic patterns from signals. We refer to [Li et al., 07-a] for details on applying matching pursuit in synthesizing job arrivals in Grids.
We make use of the core implementation in the Matching Pursuit ToolKit (MPTK) and adapt the code to analyze and synthesize job arrival processes.
[[gwm_mp.tar.gz|http://www.liacs.nl/~hli/gwm/mp/gwm_mp.tar.gz]] (A C++ library for matching pursuit, please read the copying note of MPTK before redistribution)
References:
[Li et al. 07-a] H. Li, R. Heusdens, M. Muskulus, L. Wolters. Analysis and Synthesis of Pseudo-Periodic Job Arrivals in Grids: A Matching Pursuit Approach. In proc. of 7th IEEE Intl. Sym. on Cluster Computing and the Grid (CCGrid07), Rio de Janeiro, Brazil, May 14-17, 2007, IEEE Computer Society Press.
[Mallat & Zhang, 93] S. G. Mallat and Z. Zhang. Matching pursuits with time-frequency dictionaries. IEEE Tran. Signal Processing, 41:3397–3415, 1993.
!!!!2.2.2 Modeling LRD and Multifractals with the Multifractal Wavelet Model
A process is long range dependent (LRD) if either its autocorrelation function (ACF) or power spectrum is power law dependent of lag k or frequency f, respectively. Frequency domain characterization of LRD leads to a class of so-called 1/f-like processes or 1/f noise. A LRD process has a single scaling exponent and it is referred as monofractal. If multiple scaling components are found within one process, or the scaling is time-depedent, the process is called multifractal. As an example the count process can exhibit "biscaling". The scaling concentrated at lower scales indicates the fractal nature of the sample path. The alignment at higher scales, on the other hand, resembles that of a stationary short range dependent (SRD) process.
We apply the Multifractal Wavelet Model (MWM) ([Riedi et al., 99]) for modeling LRD and multifractals. MWM is capable of generating stationary, positive, and multifractal processes with non-homogeneous scaling. A very attractive feature of wavelet-based analysis lies in the fact that the long range dependent, non-stationary original process turns into stationary, nearly uncorrelated or short range dependent wavelet coefficients. Through MWM the correlations and fractal behavior of the output process can be controlled by the wavelet energy decay of the data, which is essential to reproduce the scaling behavior of the original process. Structurally MWM is a binomial cascade [Evertsz & Mandelbrot, 92].
Matlab implementation of MWM is available from the DSP group at Rice University, which includes programs for estimation and simulation.
References:
[Li et al., 07-b] H. Li, M. Muskulus, Lex Wolters. Modeling Long Range Dependent and Fractal Job Traffic in Data-Intensive Grids. Technical Report TR No. 2007-03, Leiden Institute of Advanced Computer Science, April, 2007.
[Riedi et al., 99] R. H. Riedi, M. S. Crouse, V. J. Ribeiro, and R. G. Baraniuk. A multifractal wavelet model with application to network traffic. IEEE Transactions on Information Theory, 45(3):992–1019, April 1999.
[Evertsz & Mandelbrot, 92] C. J. G. Evertsz and B. B. Mandelbrot. Chaos and Fractals: New Frontiers in Science, Heinz-Otto Peitgen, Hartmut Jrgens and Dietmar Saupe, editors, chapter Multifractal Measures, pages 849–881. Springer, New York, 1992.
[Strang & Nguyen, 96] G. Strang and T. Nguyen. Wavelets and Filter Banks. Wellesley-Cambridge Press, 1996.
!!! 2.3 A Full Model for Job Arrivals
Now we will create a full model that is able to incorporate different patterns such as pseudo-periodicity and LRD. Firstly the additive nature of the rate processes are discussed, which makes the aggregation possible. Secondly, algorithms are proposed to convert rates to interarrivals to obtain a full description of the underlying point process.
!!!!2.3.1 Additive Nature of Rates
Given the same count interval T, the rate processes can be added together to create an aggregated rate process. This additive nature of rates is very attractive from a modeling perspective. It suggests that the whole arrival process can be divided into rate processes by Virtual Organizations (~VOs), users, or patterns, being modeled individually, and aggregated back to form a whole unified process. The VO or user names can be included in the synthetic traces, which is valuable for scheduling studies that take VO/user policies into account. The rate representation not only preserves the correlation structures of the underlying arrival process but also enables aggregation, which is not possible with interarrivals.
!!!!2.3.2 Conversion from Rates to Interarrivals
It is necessary to generate a point process in the form of interarrival times so that a full description can be obtained for modeling purposes. A simple method of transforming a rate function into interarrivals is the integrate-and-fire (InF) algorithm. The InF algorithm generates an event each time the integral of the rate mu(t) reaches a value of unity. It then resets the integrated value to zero whereupon the process begins anew, so the (k+1)st event can be obtained from
\begin{equation}
\int_{t_{k}}^{t_{k+1}} \mu (t) dt = 1.
\end{equation}
This is a direct conversion from a rate process to a point process therefore the stochastic and fractal nature is completely determined by the rate process.
A more sophisticated method derived from above is the so-called controlled-variability integrate-and-fire (CV-InF) algorithm. After generating the event t_{k+1} according to the equation above, the (k+1)st interarrival time (t_{k+1}-t_{k}) is multiplied by a Gaussian random variable with zero mean and variance sigma^{2}. Therefore t_{k+1} is now replaced by
\begin{equation}
t_{k+1} + \sigma (t_{k+1} - t_{k}) \mathcal{N}(0,1).
\end{equation}
CV-InF introduces a second source of randomness that can be specified and controlled via sigma, which is independent from the rate process. Within the limit sigma approaching 0 CV-InF turns into the standard integrate-and-fire (InF) algorithm. Within the limit sigma approaching infinity, on the other hand, it leads to a homogeneous Poisson process and none of the stochastic nature of the rate process will be preserved. As sigma increases from zero, the fractal characteristics of the rate process is progressively lost. A small sigma value (compared to the average interarrival time) is desirable if one want to preserve the fractal behavior of the rate process at the same time introduce certain randomness in the interarrival process.
Matlab implementation of the conversion algorithms are available: InF.m | CV_InF.m
References:
[Li et al., 07-b] H. Li, M. Muskulus, Lex Wolters. Modeling Long Range Dependent and Fractal Job Traffic in Data-Intensive Grids. Technical Report TR No. 2007-03, Leiden Institute of Advanced Computer Science, April, 2007.
!!3. Modeling Workload Attributes
Multimodality and strong correlations are characteristic properties of workload attributes such as run time and memory consumption in production Grids. we propose a new model for workload attributes that can potentially fit not only marginal properties but also second order statistics such as the autocorrelation function (ACF). The modeling process is formed by a two-stage approach: Firstly, a mixture of Gaussians model is used to fit the probability density function, whose parameters are estimated within a framework called model based clustering (MBC). The MBC framework can further cluster the data according to the Gaussian components, which serves as an indispensable part in the next stage. Secondly, a novel localized sampling algorithm is proposed to generate correlations in the synthetic data series. It is discovered that the number of repetitions of cluster labels obtained via MBC empirically follow a Zipf-like distribution. Sampling repeatedly from a certain cluster according to the Zipf law can create correlations in the series. Furthermore, a cluster permutation procedure is introduced so that the autocorrelations in the synthetic data can be controlled to match the real trace. Our approach is able to generalize to more than one dimension, which means multiple correlated workload attributes can be modeled simultaneously.
!!!3.1 Modeling Multimodal Distributions Using Model Based Clustering
Model based clustering (MBC), introduced by [Fraley & Raftery, 02], is a methodological framework that can be used not only for clustering but also for (multi)variate density estimation. The assumption is that data is generated by a mixture of probability distributions in which each component represents a different cluster. Mixtures of multivariate Gaussians are well studied and commonly used probability models. Partitions and Gaussian parameters are determined by combining agglomerative hierarchical clustering and the expectation-maximization (EM) algorithm for maximum likelihood. The number of components/clusters can be obtained by Bayesian model selection. After applying modeling based clustering on the trace data, the estimated parameters for the Gaussian mixture model is obtained and the data entries are assigned with cluster labels, which are used for generating correlations in the following algorithm.
!!!3.2 Generating Autocorrelations Using A Localized Sampling Algorithm with Permutation
Inspired by the locality principle, we propose a new localized sampling algorithm that is specifically designed to approximate the autocorrelation structures in real traces. Our definition for ``equivalent'' or ``similar'' jobs is based on data clustering, namely, jobs within one cluster are considered equivalent with respect to the attribute(s) used. The classification labels can be obtained via model based clustering in the first stage. One component of the mixture of Gaussians model corresponds to one cluster, which is fitted with a (multi)variate Gaussian distribution. The cluster labels form a series with values belonging to a discrete space (1, ..., G). It is found that the repetitions of cluster labels empirically resemble a Zipf-like distribution.
The sampling process starts with selecting one cluster according to its probability and sampling from the fitted Zipf distribution for the length of repetitions R. Then the fitted Gaussian distribution of the selected cluster is sampled repeatedly for R times.
The above localized sampling algorithm is able to generate correlations in the synthetic data but there is no freedom to control the generation process. It is desirable that the correlations can be controlled in a way that those present in the original data can be matched. We introduce a cluster permutation procedure to address this problem. The basic idea focuses on how the clusters are selected. Normally a cluster is selected according to its probability by random sampling. After a series of cluster labels have been generated, the procedure divides the series by a window size W and the labels within each window are arranged by their values. For example, a sequence [1, 3, 2, 1, 1, 3, 2, 3, 1, 2] turns into [1, 1, 1, 1, 3, 3, 3, 2, 2, 2] after permutation. The order of label appearances in the permutation process follows the order in the original process. The cluster permutation procedure intensifies localization by imposing order in cluster selection. Consequently correlations can be controlled via the window size W: a larger W leads to stronger correlations in the synthetic series. We refer to [Li et al., 07-c] for details about the algorithm.
Software for model based clustering is available as a R package - [[Model-Based Clustering Software|http://www.stat.washington.edu/mclust/]].
Matlab implementation of the localized sampling algorithm and the cluster permutation procedure, including utilities: [[Download|http://www.liacs.nl/~hli/gwm/lsp/lsp.tar.gz]] the package with examples.
References:
[Li et al., 07-c] H. Li, M. Muskulus, L. Wolters. Modeling Correlated Workloads by Combining Model Based Clustering and A Localized Sampling Algorithm. In proc. of 21st ACM International Conference on Supercomputing (ICS07), 2007.
[Fraley & Raftery, 02] C. Fraley and A. E. Raftery. Model-based clustering, discriminant analysis, and density estimation. Journal of the American Statistical Association, 97:611–631, 2002.
[Adamic] L. A. Adamic. Zipf, Power-laws, and Pareto - a ranking tutorial. [[link|http://www.hpl.hp.com/research/idl/papers/ranking/ranking.html]]
!!4. Performance Evaluation of Grid Scheduling Using Simulation
The practical use of workload models is demonstrated by simulation studies using GridSim. We quantify the performance impacts of workload autocorrelations in Grid scheduling. The results indicate that autocorrelations in workload attributes can cause performance degradation, in many situations this effect is huge.It is shown that the development of realistic workload models are necessary for dependable performance evaluation studies of scheduling strategies.
Further research includes how to improve scheduling under autocorrelations. In a two-level Grid scheduling scenario, long range dependence is not necessarily a bad situation. Temporal burstiness implies that the system have more idle periods or “holes” in the time line. This provides opportunities for resource peering or for the broker to do better load balancing at the Grid level.
References:
[Li et al., 07-d] Hui Li, Rajkumar Buyya. Model-Driven Simulation of Grid Scheduling Strategies. In proc. of 3rd IEEE Intl. Conf. on e-Science and Grid Computing (eScience07), 2007.
/***
|Name|InlineJavascriptPlugin|
|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|
|Documentation|http://www.TiddlyTools.com/#InlineJavascriptPluginInfo|
|Version|1.9.2|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Insert Javascript executable code directly into your tiddler content.|
''Call directly into TW core utility routines, define new functions, calculate values, add dynamically-generated TiddlyWiki-formatted output'' into tiddler content, or perform any other programmatic actions each time the tiddler is rendered.
!!!!!Documentation
>see [[InlineJavascriptPluginInfo]]
!!!!!Revisions
<<<
2008.03.03 [1.9.2] corrected declaration of wikifyPlainText() for 'TW 2.1.x compatibility fallback' (fixes Safari "parse error")
2008.02.23 [1.9.1] in onclick function, use string instead of array for 'bufferedHTML' attribute on link element (fixes IE errors)
2008.02.21 [1.9.0] 'onclick' scripts now allow returned text (or document.write() calls) to be wikified into a span that immediately follows the onclick link. Also, added default 'return false' handling if no return value provided (prevents HREF from being triggered -- return TRUE to allow HREF to be processed). Thanks to Xavier Verges for suggestion and preliminary code.
|please see [[InlineJavascriptPluginInfo]] for additional revision details|
2005.11.08 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.inlineJavascript= {major: 1, minor: 9, revision: 2, date: new Date(2008,3,3)};
config.formatters.push( {
name: "inlineJavascript",
match: "\\<script",
lookahead: "\\<script(?: src=\\\"((?:.|\\n)*?)\\\")?(?: label=\\\"((?:.|\\n)*?)\\\")?(?: title=\\\"((?:.|\\n)*?)\\\")?(?: key=\\\"((?:.|\\n)*?)\\\")?( show)?\\>((?:.|\\n)*?)\\</script\\>",
handler: function(w) {
var lookaheadRegExp = new RegExp(this.lookahead,"mg");
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var src=lookaheadMatch[1];
var label=lookaheadMatch[2];
var tip=lookaheadMatch[3];
var key=lookaheadMatch[4];
var show=lookaheadMatch[5];
var code=lookaheadMatch[6];
if (src) { // load a script library
// make script tag, set src, add to body to execute, then remove for cleanup
var script = document.createElement("script"); script.src = src;
document.body.appendChild(script); document.body.removeChild(script);
}
if (code) { // there is script code
if (show) // show inline script code in tiddler output
wikify("{{{\n"+lookaheadMatch[0]+"\n}}}\n",w.output);
if (label) { // create a link to an 'onclick' script
// add a link, define click handler, save code in link (pass 'place'), set link attributes
var link=createTiddlyElement(w.output,"a",null,"tiddlyLinkExisting",wikifyPlainText(label));
var fixup=code.replace(/document.write\s*\(/gi,'place.bufferedHTML+=(');
link.code="function _out(place){"+fixup+"\n};_out(this);"
link.tiddler=w.tiddler;
link.onclick=function(){
this.bufferedHTML="";
try{ var r=eval(this.code);
if(this.bufferedHTML.length || (typeof(r)==="string")&&r.length)
var s=this.parentNode.insertBefore(document.createElement("span"),this.nextSibling);
if(this.bufferedHTML.length)
s.innerHTML=this.bufferedHTML;
if((typeof(r)==="string")&&r.length) {
wikify(r,s,null,this.tiddler);
return false;
} else return r!==undefined?r:false;
} catch(e){alert(e.description||e.toString());return false;}
};
link.setAttribute("title",tip||"");
var URIcode='javascript:void(eval(decodeURIComponent(%22(function(){try{';
URIcode+=encodeURIComponent(encodeURIComponent(code.replace(/\n/g,' ')));
URIcode+='}catch(e){alert(e.description||e.toString())}})()%22)))';
link.setAttribute("href",URIcode);
link.style.cursor="pointer";
if (key) link.accessKey=key.substr(0,1); // single character only
}
else { // run inline script code
var fixup=code.replace(/document.write\s*\(/gi,'place.innerHTML+=(');
var code="function _out(place){"+fixup+"\n};_out(w.output);"
try { var out=eval(code); } catch(e) { out=e.description?e.description:e.toString(); }
if (out && out.length) wikify(out,w.output,w.highlightRegExp,w.tiddler);
}
}
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
}
}
} )
//}}}
// // Backward-compatibility for TW2.1.x and earlier
//{{{
if (typeof(wikifyPlainText)=="undefined") window.wikifyPlainText=function(text,limit,tiddler) {
if(limit > 0) text = text.substr(0,limit);
var wikifier = new Wikifier(text,formatter,null,tiddler);
return wikifier.wikifyPlain();
}
//}}}
/***
|Name|InlineJavascriptPluginInfo|
|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|
|Documentation|http://www.TiddlyTools.com/#InlineJavascriptPluginInfo|
|Version|1.9.2|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|documentation|
|Requires||
|Overrides||
|Description|Documentation for InlineJavascriptPlugin|
''Call directly into TW core utility routines, define new functions, calculate values, add dynamically-generated TiddlyWiki-formatted output'' into tiddler content, or perform any other programmatic actions each time the tiddler is rendered.
!!!!!Usage
<<<
This plugin adds wiki syntax for surrounding tiddler content with {{{<script>}}} and {{{</script>}}} markers, so that it can be recognized as embedded javascript code.
<script show>
/* javascript code goes here... */
</script>Every time the tiddler content is rendered, the javascript code is automatically evaluated, allowing you to invoke 'side-effect' processing and/or produce dynamically-generated content that is then inserted into the tiddler content, immediately following the script (see below). By including the optional ''show'' keyword as the final parameter in a {{{<script>}}} marker, the plugin will also include the script source code in the output that it displays in the tiddler. This is helpful when creating examples for documentation purposes (such as used in this tiddler!)
__''Deferred execution from an 'onClick' link''__
<script label="click here" title="mouseover tooltip text" key="X" show>
/* javascript code goes here... */
alert('you clicked on the link!');
</script>
By including a {{{label="..."}}} parameter in the initial {{{<script>}}} marker, the plugin will create a link to an 'onclick' script that will only be executed when that specific link is clicked, rather than running the script each time the tiddler is rendered. You may also include a {{{title="..."}}} parameter to specify the 'tooltip' text that will appear whenever the mouse is moved over the onClick link text, and a {{{key="X"}}} parameter to specify an //access key// (which must be a //single// letter or numeric digit only).
__''Loading scripts from external source files''__
<script src="URL" show>
/* optional javascript code goes here... */
</script>You can also load javascript directly from an external source URL, by including a src="..." parameter in the initial {{{<script>}}} marker (e.g., {{{<script src="demo.js"></script>}}}). This is particularly useful when incorporating third-party javascript libraries for use in custom extensions and plugins. The 'foreign' javascript code remains isolated in a separate file that can be easily replaced whenever an updated library file becomes available.
In addition to loading the javascript from the external file, you can also use this feature to invoke javascript code contained within the {{{<script>...</script>}}} markers. This code is invoked //after// the external script file has been processed, and can make immediate use of the functions and/or global variables defined by the external script file.
>Note: To ensure that your javascript functions are always available when needed, you should load the libraries from a tiddler that will be rendered as soon as your TiddlyWiki document is opened. For example, you could put your {{{<script src="..."></script>}}} syntax into a tiddler called LoadScripts, and then add {{{<<tiddler LoadScripts>>}}} in your MainMenu tiddler. Since the MainMenu is always rendered immediately upon opening your document, the library will always be loaded before any other tiddlers that rely upon the functions it defines. Loading an external javascript library does not produce any direct output in the tiddler, so these definitions should have no impact on the appearance of your MainMenu.
<<<
!!!!!Creating dynamic tiddler content and accessing the ~TiddlyWiki DOM
<<<
An important difference between TiddlyWiki inline scripting and conventional embedded javascript techniques for web pages is the method used to produce output that is dynamically inserted into the document: in a typical web document, you use the {{{document.write()}}} (or {{{document.writeln()}}}) function to output text sequences (often containing HTML tags) that are then rendered when the entire document is first loaded into the browser window.
However, in a ~TiddlyWiki document, tiddlers (and other DOM elements) are created, deleted, and rendered "on-the-fly", so writing directly to the global 'document' object does not produce the results you want (i.e., replacing the embedded script within the tiddler content), and instead will //completely replace the entire ~TiddlyWiki document in your browser window (which is clearly not a good thing!)//. In order to allow scripts to use {{{document.write()}}}, the plugin automatically converts and buffers all HTML output so it can be safely inserted into your tiddler content, immediately following the script.
''Note that {{{document.write()}}} can only be used to output "pure HTML" syntax. To produce //wiki-formatted// output, your script should instead return a text value containing the desired wiki-syntax content'', which will then be automatically rendered immediately following the script. If returning a text value is not sufficient for your needs, the plugin also provides an automatically-defined variable, 'place', that gives the script code ''direct access to the //containing DOM element//'' into which the tiddler output is being rendered. You can use this variable to ''perform direct DOM manipulations'' that can, for example:
* generate wiki-formatted output using {{{wikify("...content...",place)}}}
* vary the script's actions based upon the DOM element in which it is embedded
* access 'tiddler-relative' DOM information using {{{story.findContainingTiddler(place)}}}
>Note: ''When using an 'onclick' script, the 'place' element actually refers to the onclick //link text// itself, instead of the containing DOM element.'' This permits you to directly reference or modify the link text to reflect any 'stateful' conditions that might set by the script. To refer to the containing DOM element from within an 'onclick' script, you can use "place.parentNode" instead.
<<<
!!!!!Instant "bookmarklets"
<<<
You can also use an 'onclick' link to define a "bookmarklet": a small piece of javascript that can be ''invoked directly from the browser without having to be defined within the current document.'' This allows you to create 'stand-alone' commands that can be applied to virtually ANY TiddlyWiki document... even remotely-hosted documents that have been written by others!! To create a bookmarklet, simply define an 'onclick' script and then grab the resulting link text and drag-and-drop it onto your browser's toolbar (or right-click and use the 'bookmark this link' command to add it to the browser's menu).
>Note: When writing scripts intended for use as bookmarklets, due to the ~URI-encoding required by the browser, ''you cannot not use ANY double-quotes (") within the bookmarklet script code.'' In addition, all comments embedded in the bookmarklet script must ''use the fully-delimited {{{/* ... */}}} comment syntax,'' rather than the shorter {{{//}}} comment syntax. Most importantly, because bookmarklets are invoked directly from the browser interface and are not embedded within the TiddlyWiki document, there is NO containing DOM element surrounding the script. As a result, ''you cannot use a bookmarklet to generate dynamic output in your document,'' and using {{{document.write()}}} or returning wiki-syntax text or making reference to the 'place' DOM element is likely to produce a fatal error when the bookmarklet is invoked.
Please see [[InstantBookmarklets]] for many examples of 'onclick' scripts that can also be used as bookmarklets.
<<<
!!!!!Special reserved function name
<<<
The plugin 'wraps' all inline javascript code inside a function, {{{_out()}}}, so that any return value you provide can be correctly handled by the plugin and inserted into the tiddler. To avoid unpredictable results (and possibly fatal execution errors), this function should never be redefined or called from ''within'' your script code.
<<<
!!!!!Examples
<<<
simple dynamic output:
><script show>
document.write("The current date/time is: "+(new Date())+"<br>");
return "link to current user: [["+config.options.txtUserName+"]]\n";
</script>
dynamic output using 'place' to get size information for current tiddler:
><script show>
if (!window.story) window.story=window;
var title=story.findContainingTiddler(place).getAttribute("tiddler");
var size=store.getTiddlerText(title).length;
return title+" is using "+size+" bytes";
</script>
dynamic output from an 'onclick' script, using {{{document.write()}}} and/or {{{return "..."}}}
><script label="click here" show>
document.write("<br>The current date/time is: "+(new Date())+"<br>");
return "link to current user: [["+config.options.txtUserName+"]]\n";
</script>
creating an 'onclick' button/link that accesses the link text AND the containing tiddler:
><script label="click here" title="clicking this link will show an 'alert' box" key="H" show>
if (!window.story) window.story=window;
var txt=place.firstChild.data;
var tid=story.findContainingTiddler(place).getAttribute('tiddler');
alert('Hello World!\nlinktext='+txt+'\ntiddler='+tid);
</script>
dynamically setting onclick link text based on stateful information:
>{{block{
{{{
<script label="click here">
/* toggle "txtSomething" value */
var on=(config.txtSomething=="ON");
place.innerHTML=on?"enable":"disable";
config.txtSomething=on?"OFF":"ON";
return "\nThe current value is: "+config.txtSomething;
</script><script>
/* initialize onclick link text based on current "txtSomething" value */
var on=(config.txtSomething=="ON");
place.lastChild.previousSibling.innerHTML=on?"disable":"enable";
</script>
}}}
<script label="click here">
/* toggle "txtSomething" value */
var on=(config.txtSomething=="ON");
place.innerHTML=on?"enable":"disable";
config.txtSomething=on?"OFF":"ON";
return "\nThe current value is: "+config.txtSomething;
</script><script>
/* initialize onclick link text based on current "txtSomething" value */
var on=(config.txtSomething=="ON");
place.lastChild.innerHTML=on?"enable":"disable";
</script>
}}}
loading a script from a source url:
>http://www.TiddlyTools.com/demo.js contains:
>>{{{function inlineJavascriptDemo() { alert('Hello from demo.js!!') } }}}
>>{{{displayMessage('InlineJavascriptPlugin: demo.js has been loaded');}}}
>note: When using this example on your local system, you will need to download the external script file from the above URL and install it into the same directory as your document.
>
><script src="demo.js" show>
return "inlineJavascriptDemo() function has been defined"
</script>
><script label="click to invoke inlineJavascriptDemo()" key="D" show>
inlineJavascriptDemo();
</script>
<<<
!!!!!Revisions
<<<
2008.03.03 [1.9.2] corrected declaration of wikifyPlainText() for 'TW 2.1.x compatibility fallback' (fixes Safari "parse error")
2008.02.23 [1.9.1] in onclick function, use string instead of array for 'bufferedHTML' attribute on link element (fixes IE errors)
2008.02.21 [1.9.0] 'onclick' scripts now allow returned text (or document.write() calls) to be wikified into a span that immediately follows the onclick link. Also, added default 'return false' handling if no return value provided (prevents HREF from being triggered -- return TRUE to allow HREF to be processed). Thanks to Xavier Verges for suggestion and preliminary code.
2008.02.14 [1.8.1] added backward-compatibility for use of wikifyPlainText() in TW2.1.3 and earlier
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info tiddler
2007.12.28 [1.8.0] added support for key="X" syntax to specify custom access key definitions
2007.12.15 [1.7.0] autogenerate URI encoded HREF on links for onclick scripts. Drag links to browser toolbar to create bookmarklets. IMPORTANT NOTE: place is NOT defined when scripts are used as bookmarklets. In addition, double-quotes will cause syntax errors. Thanks to PaulReiber for debugging and brainstorming.
2007.11.26 [1.6.2] when converting "document.write()" function calls in inline code, allow whitespace between "write" and "(" so that "document.write ( foobar )" is properly converted.
2007.11.16 [1.6.1] when rendering "onclick scripts", pass label text through wikifyPlainText() to parse any embedded wiki-syntax to enable use of HTML entities or even TW macros to generate dynamic label text.
2007.02.19 [1.6.0] added support for title="..." to specify mouseover tooltip when using an onclick (label="...") script
2006.10.16 [1.5.2] add newline before closing '}' in 'function out_' wrapper. Fixes error caused when last line of script is a comment.
2006.06.01 [1.5.1] when calling wikify() on script return value, pass hightlightRegExp and tiddler params so macros that rely on these values can render properly
2006.04.19 [1.5.0] added 'show' parameter to force display of javascript source code in tiddler output
2006.01.05 [1.4.0] added support 'onclick' scripts. When label="..." param is present, a button/link is created using the indicated label text, and the script is only executed when the button/link is clicked. 'place' value is set to match the clicked button/link element.
2005.12.13 [1.3.1] when catching eval error in IE, e.description contains the error text, instead of e.toString(). Fixed error reporting so IE shows the correct response text. Based on a suggestion by UdoBorkowski
2005.11.09 [1.3.0] for 'inline' scripts (i.e., not scripts loaded with src="..."), automatically replace calls to 'document.write()' with 'place.innerHTML+=' so script output is directed into tiddler content. Based on a suggestion by BradleyMeck
2005.11.08 [1.2.0] handle loading of javascript from an external URL via src="..." syntax
2005.11.08 [1.1.0] pass 'place' param into scripts to provide direct DOM access
2005.11.08 [1.0.0] initial release
<<<
<html><a href="http://www.onelook.com" target="_blank">Onelook.com</a></html>
<html><a href="http://www.freetranslation.com" target="_blank">Freetranslation.com</a></html>
<html><a href="http://www.worldlingo.com" target="_blank">Worldlingo.com</a></html>
<html><a href="" target="_blank"></a></html>
Van Dale
/***
|''Name:''|LegacyStrikeThroughPlugin|
|''Description:''|Support for legacy (pre 2.1) strike through formatting|
|''Version:''|1.0.2|
|''Date:''|Jul 21, 2006|
|''Source:''|http://www.tiddlywiki.com/#LegacyStrikeThroughPlugin|
|''Author:''|MartinBudden (mjbudden (at) gmail (dot) com)|
|''License:''|[[BSD open source license]]|
|''CoreVersion:''|2.1.0|
***/
//{{{
// Ensure that the LegacyStrikeThrough Plugin is only installed once.
if(!version.extensions.LegacyStrikeThroughPlugin) {
version.extensions.LegacyStrikeThroughPlugin = {installed:true};
config.formatters.push(
{
name: "legacyStrikeByChar",
match: "==",
termRegExp: /(==)/mg,
element: "strike",
handler: config.formatterHelpers.createElementAndWikify
});
} //# end of "install only once"
//}}}
Aenean eros arcu, condimentum nec, dapibus ut, tincidunt sit amet, urna. Quisque viverra, eros sed imperdiet iaculis, est risus facilisis quam, id malesuada arcu nulla luctus urna. Nullam et est. Vestibulum velit sem, faucibus cursus, dapibus vestibulum, pellentesque et, urna. Donec luctus. Donec lectus. Aliquam eget eros facilisis tortor feugiat sollicitudin. Integer lobortis vulputate sapien. Sed iaculis erat ac nunc. Etiam eu enim. Mauris ipsum urna, rhoncus at, bibendum sit amet, euismod eget, dolor. Mauris fermentum quam vitae ligula. Vestibulum in libero feugiat justo dictum consectetuer. Vestibulum euismod purus eget elit. Nunc sed massa porta elit bibendum posuere. Nunc pulvinar justo sit amet odio. In sed est. Phasellus ornare elementum nulla. Nulla ipsum neque, cursus a, viverra a, imperdiet at, enim. Quisque facilisis, diam sed accumsan suscipit, odio arcu hendrerit dolor, quis aliquet massa nulla nec sem.
!heading 1
!!heading 2
!!!heading3
----
<<tag button>>
This is a link to a [[StyleSheet]] tiddler.
> This is a blockquote
> This is a blockquote
> This is a blockquote
|>|>| !This is a header |h
|column1|column2|column3|
|row2| row2 |row2|
|column1|column2|column3|
|row2| row2 |row2|
|column1|column2|column3|
|row2| row2 |row2|
[[]]
[[Welcome]]
[[Publications]]
[[PhD Thesis]]
[[Presentations]]
[[Software]]
[[TagCloud]]
<div align="center">
<a href="http://getfirefox.com/"
title="Get Firefox - The Browser, Reloaded."><img
src="http://www.mozilla.org/products/firefox/buttons/firefox_80x15.png"
width="80" height="15" border="0" alt="Get Firefox">
</a>
<a class="xc-badge-xhtmlvalidate" href="http://validator.w3.org/check?uri=referer" title="Validate XHTML 1.0 Strict"> <img src="http://images.linux.com/images/xhtml10.gif" alt="Validate XHTML 1.0 Strict" /> </a>
<a class="xc-badge-cssvalidate" href="http://jigsaw.w3.org/css-validator/validator?uri=http://huili.online.googlepages.com/index.html" title="Validate CSS"> <img src="http://images.linux.com/images/css.gif" alt="Validate CSS" /> </a>
<script type="text/javascript" language="javascript">
var sc_project=2188947;
var sc_invisible=0;
var sc_partition=5;
var sc_security="bb27b80c";
</script>
<script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><a href="http://www.statcounter.com/" target="_blank"><img src="http://c6.statcounter.com/counter.php?sc_project=2188947&java=0&security=bb27b80c&invisible=0" alt="free web site hit counter" border="0" align="right"></a>
</noscript>
</div>
<script src="http://huili.online.googlepages.com/flashobject.js"></script>
<script>
(document.write('<link rel="icon" href="http://huili.online.googlepages.com/myicon.ico" type="image/x-icon"/> <link rel="shortcut icon" href="http://huili.online.googlepages.com/myicon.ico" type="image/x-icon"/>'))
</script>
<part PAL04>
*[[MethodLiterature/PAL04]] G. A. Paleologo. ''~Price-at-Risk: A methodology for pricing utility computing services.'' IBM System Journal, v43(1), 2004.
**Keywords: @@color(green):''pricing model, uncertainty''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part ENG08>
*[[MethodLiterature/ENG08]] 5.5.3.2.2. ''[[Multiple responses: The desirability approach|http://www.itl.nist.gov/div898/handbook/pri/section5/pri5322.htm]].'' Engineering Statistics Handbook, retrieved 2008.
**Keywords: @@color(green):''desirability function, multi-objective, utility''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part BUT01>
*[[MethodLiterature/BUT01]] J. Butler et al. ''A Multiple Attribute Utility Theory Approach to Ranking and Selection.'' Management Science, v47(6), 2001.
**Keywords: @@color(green):''multi-attribute utility theory''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part BAU03>
*[[MethodLiterature/BAU03]] M. Baucells and R. Sarin. ''Group Decisions with Multiple Criteria.'' Management Science, v49(8), 2003.
**Keywords: @@color(green):''multi-criteria, group decisions''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part KIM00>
*[[MethodLiterature/KIM00]] K. Kim and D. Lin. ''Simultaneous Optimization of Mechanical Properties of Steel by Maximizing Exponential Desirability Functions.'' Applied Statistics, v49(3), 2000.
**Keywords: @@color(green):''desirability function, max-min''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part FLE03>
*[[MethodLiterature/FLE03]] M. Fleischer. ''The Measure of Pareto Optima: Applications to Multiobjective Metaheuristics.'' EMO'03, Springer, 2003.
**Keywords: @@color(green):''multi-objective optimization, hypervolume''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part BEU06>
*[[MethodLiterature/BEU06]] N. Beume et al. ''~SMS-EMOA: Multiobjective Selection Based on Dominated Hypervolume.'' Euro. J. Operation Research, Elsevier, 2006.
**Keywords: @@color(green):''multi-objective optimization, dominated hypervolume''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part GOV05>
*[[MethodLiterature/GOV05]] B. Govaerts. ''UNCERTAINTY PROPAGATION IN MULTIRESPONSE
OPTIMIZATION USING A DESIRABILITY INDEX.'' IAP Tech. Rep. 0556, UCL Belgium, 2005.
**Keywords: @@color(green):''multi-objective optimization, uncertainty, desirability index''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part JIN05>
*[[MethodLiterature/JIN05]] Y. Jin et al. ''Evolutionary Optimization in Uncertain Environments - A Survey.'' IEEE Trans. Evo. Comp., 2005.
**Keywords: @@color(green):''evolutionary algorithms, online optimization''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part BOS07>
*[[MethodLiterature/BOS07]] P. Bosman et al. ''Learning and Anticipation in Online Dynamic Optimization with Evolutionary Algorithms: The Stochastic Case.'' GECCO'07, ACM, 2007.
**Keywords: @@color(green):''evolutionary algorithms, online optimization, anticipation, strategy''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part KAE96>
*[[MethodLiterature/KAE96]] L. P. Kaelbling et al. ''Reinforcement Learning: A Survey.'' Journal of Artificial Intelligence Research 4, 237-285, 1996.
**Keywords: @@color(green):''learning, online optimization''@@.
**Main Results: @@color(blue):here@@.
</part>
----
|>|>|>|@@color:#999;margin-left:6px;tiddler@@ <<gotoTiddler width:11em>>|
|>|>|>|<<search>>|
|borderlessL0|k
----
<<closeAll>><<permaview>><<newTiddler>><<newJournal 'DD MMM YYYY'>><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel 'options »' 'Change TiddlyWiki advanced options'>>
/***
|Name|NestedSlidersPlugin|
|Source|http://www.TiddlyTools.com/#NestedSlidersPlugin|
|Documentation|http://www.TiddlyTools.com/#NestedSlidersPluginInfo|
|Version|2.3.5|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|show content in nest-able sliding/floating panels, without creating separate tiddlers for each panel's content|
This plugin adds new wiki syntax for embedding 'slider' panels directly into tiddler content.
!!!!!Documentation
>see [[NestedSlidersPluginInfo]]
!!!!!Configuration
<<<
Enable animation for slider panels
<<option chkFloatingSlidersAnimate>> allow sliders to animate when opening/closing
>(note: This setting is in //addition// to the general option for enabling/disabling animation effects:
><<option chkAnimate>> enable animations (entire document)
>For slider animation to occur, you must also allow animation in general.
Debugging messages for 'lazy sliders' deferred rendering:
<<option chkDebugLazySliderDefer>> show debugging alert when deferring slider rendering
<<option chkDebugLazySliderRender>> show debugging alert when deferred slider is actually rendered
<<<
!!!!!Revisions
<<<
2008.03.26 - 2.3.5 in document.onclick(), if click is in popup, don't dismiss transient panel (if any)
2008.01.08 - [*.*.*] plugin size reduction: documentation moved to ...Info tiddler
2007.12.28 - 2.3.4 added hijack for Animator.prototype.startAnimating(). Previously, the plugin code simply set the overflow to "visible" after animation. This code tweak corrects handling of elements that were styled with overflow=hidden/auto/scroll before animation by saving the overflow style and then restoring it after animation has completed.
|please see [[NestedSlidersPluginInfo]] for additional revision details|
2005.11.03 - 1.0.0 initial public release. Thanks to RodneyGomes, GeoffSlocock, and PaulPetterson for suggestions and experiments.
<<<
!!!!!Code
***/
//{{{
version.extensions.nestedSliders = {major: 2, minor: 3, revision: 5, date: new Date(2008,3,26)};
//}}}
//{{{
// options for deferred rendering of sliders that are not initially displayed
if (config.options.chkDebugLazySliderDefer==undefined) config.options.chkDebugLazySliderDefer=false;
if (config.options.chkDebugLazySliderRender==undefined) config.options.chkDebugLazySliderRender=false;
if (config.options.chkFloatingSlidersAnimate==undefined) config.options.chkFloatingSlidersAnimate=false;
// default styles for 'floating' class
setStylesheet(".floatingPanel { position:absolute; z-index:10; padding:0.5em; margin:0em; \
background-color:#eee; color:#000; border:1px solid #000; text-align:left; }","floatingPanelStylesheet");
//}}}
//{{{
config.formatters.push( {
name: "nestedSliders",
match: "\\n?\\+{3}",
terminator: "\\s*\\={3}\\n?",
lookahead: "\\n?\\+{3}(\\+)?(\\([^\\)]*\\))?(\\!*)?(\\^(?:[^\\^\\*\\[\\>]*\\^)?)?(\\*)?(?:\\{\\{([\\w]+[\\s\\w]*)\\{)?(\\[[^\\]]*\\])?(\\[[^\\]]*\\])?(?:\\}{3})?(\\#[^:]*\\:)?(\\>)?(\\.\\.\\.)?\\s*",
handler: function(w)
{
lookaheadRegExp = new RegExp(this.lookahead,"mg");
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart)
{
// var defopen=lookaheadMatch[1]
// var cookiename=lookaheadMatch[2]
// var header=lookaheadMatch[3]
// var panelwidth=lookaheadMatch[4]
// var transient=lookaheadMatch[5]
// var class=lookaheadMatch[6]
// var label=lookaheadMatch[7]
// var openlabel=lookaheadMatch[8]
// var panelID=lookaheadMatch[9]
// var blockquote=lookaheadMatch[10]
// var deferred=lookaheadMatch[11]
// location for rendering button and panel
var place=w.output;
// default to closed, no cookie, no accesskey, no alternate text/tip
var show="none"; var cookie=""; var key="";
var closedtext=">"; var closedtip="";
var openedtext="<"; var openedtip="";
// extra "+", default to open
if (lookaheadMatch[1]) show="block";
// cookie, use saved open/closed state
if (lookaheadMatch[2]) {
cookie=lookaheadMatch[2].trim().slice(1,-1);
cookie="chkSlider"+cookie;
if (config.options[cookie]==undefined)
{ config.options[cookie] = (show=="block") }
show=config.options[cookie]?"block":"none";
}
// parse label/tooltip/accesskey: [label=X|tooltip]
if (lookaheadMatch[7]) {
var parts=lookaheadMatch[7].trim().slice(1,-1).split("|");
closedtext=parts.shift();
if (closedtext.substr(closedtext.length-2,1)=="=")
{ key=closedtext.substr(closedtext.length-1,1); closedtext=closedtext.slice(0,-2); }
openedtext=closedtext;
if (parts.length) closedtip=openedtip=parts.join("|");
else { closedtip="show "+closedtext; openedtip="hide "+closedtext; }
}
// parse alternate label/tooltip: [label|tooltip]
if (lookaheadMatch[8]) {
var parts=lookaheadMatch[8].trim().slice(1,-1).split("|");
openedtext=parts.shift();
if (parts.length) openedtip=parts.join("|");
else openedtip="hide "+openedtext;
}
var title=show=='block'?openedtext:closedtext;
var tooltip=show=='block'?openedtip:closedtip;
// create the button
if (lookaheadMatch[3]) { // use "Hn" header format instead of button/link
var lvl=(lookaheadMatch[3].length>6)?6:lookaheadMatch[3].length;
var btn = createTiddlyElement(createTiddlyElement(place,"h"+lvl,null,null,null),"a",null,lookaheadMatch[6],title);
btn.onclick=onClickNestedSlider;
btn.setAttribute("href","javascript:;");
btn.setAttribute("title",tooltip);
}
else
var btn = createTiddlyButton(place,title,tooltip,onClickNestedSlider,lookaheadMatch[6]);
btn.innerHTML=title; // enables use of HTML entities in label
// set extra button attributes
btn.setAttribute("closedtext",closedtext);
btn.setAttribute("closedtip",closedtip);
btn.setAttribute("openedtext",openedtext);
btn.setAttribute("openedtip",openedtip);
btn.sliderCookie = cookie; // save the cookiename (if any) in the button object
btn.defOpen=lookaheadMatch[1]!=null; // save default open/closed state (boolean)
btn.keyparam=key; // save the access key letter ("" if none)
if (key.length) {
btn.setAttribute("accessKey",key); // init access key
btn.onfocus=function(){this.setAttribute("accessKey",this.keyparam);}; // **reclaim** access key on focus
}
btn.onmouseover=function(event) // mouseover on button aligns floater position with button
{ if (window.adjustSliderPos) window.adjustSliderPos(this.parentNode,this,this.sliderPanel); }
// create slider panel
var panelClass=lookaheadMatch[4]?"floatingPanel":"sliderPanel";
var panelID=lookaheadMatch[9]; if (panelID) panelID=panelID.slice(1,-1); // trim off delimiters
var panel=createTiddlyElement(place,"div",panelID,panelClass,null);
panel.button = btn; // so the slider panel know which button it belongs to
btn.sliderPanel=panel; // so the button knows which slider panel it belongs to
panel.defaultPanelWidth=(lookaheadMatch[4] && lookaheadMatch[4].length>2)?lookaheadMatch[4].slice(1,-1):"";
panel.setAttribute("transient",lookaheadMatch[5]=="*"?"true":"false");
panel.style.display = show;
panel.style.width=panel.defaultPanelWidth;
panel.onmouseover=function(event) // mouseover on panel aligns floater position with button
{ if (window.adjustSliderPos) window.adjustSliderPos(this.parentNode,this.button,this); }
// render slider (or defer until shown)
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
if ((show=="block")||!lookaheadMatch[11]) {
// render now if panel is supposed to be shown or NOT deferred rendering
w.subWikify(lookaheadMatch[10]?createTiddlyElement(panel,"blockquote"):panel,this.terminator);
// align floater position with button
if (window.adjustSliderPos) window.adjustSliderPos(place,btn,panel);
}
else {
var src = w.source.substr(w.nextMatch);
var endpos=findMatchingDelimiter(src,"+++","===");
panel.setAttribute("raw",src.substr(0,endpos));
panel.setAttribute("blockquote",lookaheadMatch[10]?"true":"false");
panel.setAttribute("rendered","false");
w.nextMatch += endpos+3;
if (w.source.substr(w.nextMatch,1)=="\n") w.nextMatch++;
if (config.options.chkDebugLazySliderDefer) alert("deferred '"+title+"':\n\n"+panel.getAttribute("raw"));
}
}
}
}
)
// TBD: ignore 'quoted' delimiters (e.g., "{{{+++foo===}}}" isn't really a slider)
function findMatchingDelimiter(src,starttext,endtext) {
var startpos = 0;
var endpos = src.indexOf(endtext);
// check for nested delimiters
while (src.substring(startpos,endpos-1).indexOf(starttext)!=-1) {
// count number of nested 'starts'
var startcount=0;
var temp = src.substring(startpos,endpos-1);
var pos=temp.indexOf(starttext);
while (pos!=-1) { startcount++; pos=temp.indexOf(starttext,pos+starttext.length); }
// set up to check for additional 'starts' after adjusting endpos
startpos=endpos+endtext.length;
// find endpos for corresponding number of matching 'ends'
while (startcount && endpos!=-1) {
endpos = src.indexOf(endtext,endpos+endtext.length);
startcount--;
}
}
return (endpos==-1)?src.length:endpos;
}
//}}}
//{{{
window.onClickNestedSlider=function(e)
{
if (!e) var e = window.event;
var theTarget = resolveTarget(e);
var theLabel = theTarget.firstChild.data;
var theSlider = theTarget.sliderPanel
var isOpen = theSlider.style.display!="none";
// toggle label
theTarget.innerHTML=isOpen?theTarget.getAttribute("closedText"):theTarget.getAttribute("openedText");
// toggle tooltip
theTarget.setAttribute("title",isOpen?theTarget.getAttribute("closedTip"):theTarget.getAttribute("openedTip"));
// deferred rendering (if needed)
if (theSlider.getAttribute("rendered")=="false") {
if (config.options.chkDebugLazySliderRender)
alert("rendering '"+theLabel+"':\n\n"+theSlider.getAttribute("raw"));
var place=theSlider;
if (theSlider.getAttribute("blockquote")=="true")
place=createTiddlyElement(place,"blockquote");
wikify(theSlider.getAttribute("raw"),place);
theSlider.setAttribute("rendered","true");
}
// show/hide the slider
if(config.options.chkAnimate && (!hasClass(theSlider,'floatingPanel') || config.options.chkFloatingSlidersAnimate))
anim.startAnimating(new Slider(theSlider,!isOpen,e.shiftKey || e.altKey,"none"));
else
theSlider.style.display = isOpen ? "none" : "block";
// reset to default width (might have been changed via plugin code)
theSlider.style.width=theSlider.defaultPanelWidth;
// align floater panel position with target button
if (!isOpen && window.adjustSliderPos) window.adjustSliderPos(theSlider.parentNode,theTarget,theSlider);
// if showing panel, set focus to first 'focus-able' element in panel
if (theSlider.style.display!="none") {
var ctrls=theSlider.getElementsByTagName("*");
for (var c=0; c<ctrls.length; c++) {
var t=ctrls[c].tagName.toLowerCase();
if ((t=="input" && ctrls[c].type!="hidden") || t=="textarea" || t=="select")
{ ctrls[c].focus(); break; }
}
}
var cookie=theTarget.sliderCookie;
if (cookie && cookie.length) {
config.options[cookie]=!isOpen;
if (config.options[cookie]!=theTarget.defOpen)
saveOptionCookie(cookie);
else { // remove cookie if slider is in default display state
var ex=new Date(); ex.setTime(ex.getTime()-1000);
document.cookie = cookie+"=novalue; path=/; expires="+ex.toGMTString();
}
}
// prevent SHIFT-CLICK from being processed by browser (opens blank window... yuck!)
// but allow plain click to bubble up to page background (to dismiss open popup, if any)
if (e.shiftKey) { e.cancelBubble=true; if (e.stopPropagation) e.stopPropagation(); }
return false;
}
//}}}
//{{{
// click in document background closes transient panels
document.nestedSliders_savedOnClick=document.onclick;
document.onclick=function(ev) { if (!ev) var ev=window.event; var target=resolveTarget(ev);
// call original click handler
if (document.nestedSliders_savedOnClick)
var retval=document.nestedSliders_savedOnClick.apply(this,arguments);
// if click was inside a popup... leave transient panels alone
var p=target; while (p) if (hasClass(p,"popup")) break; else p=p.parentNode; if (p) return retval;
// if click was inside transient panel (or something contained by a transient panel), leave it alone
var p=target; while (p)
if ((hasClass(p,"floatingPanel")||hasClass(p,"sliderPanel"))&&p.getAttribute("transient")=="true") break;
else p=p.parentNode;
if (p) return retval;
// otherwise, find and close all transient panels...
var all=document.all?document.all:document.getElementsByTagName("DIV");
for (var i=0; i<all.length; i++) {
// if it is not a transient panel, or the click was on the button that opened this panel, don't close it.
if (all[i].getAttribute("transient")!="true" || all[i].button==target) continue;
// otherwise, if the panel is currently visible, close it by clicking it's button
if (all[i].style.display!="none") window.onClickNestedSlider({target:all[i].button})
}
return retval;
};
//}}}
//{{{
// adjust floating panel position based on button position
if (window.adjustSliderPos==undefined) window.adjustSliderPos=function(place,btn,panel) {
if (hasClass(panel,"floatingPanel")) {
var left=0;
var top=btn.offsetHeight;
if (place.style.position!="relative") {
var left=findPosX(btn);
var top=findPosY(btn)+btn.offsetHeight;
var p=place; while (p && !hasClass(p,'floatingPanel')) p=p.parentNode;
if (p) { left-=findPosX(p); top-=findPosY(p); }
}
if (findPosX(btn)+panel.offsetWidth > getWindowWidth()) // adjust position to stay inside right window edge
left-=findPosX(btn)+panel.offsetWidth-getWindowWidth()+15; // add extra 15px 'fudge factor'
panel.style.left=left+"px"; panel.style.top=top+"px";
}
}
function getWindowWidth() {
if(document.width!=undefined)
return document.width; // moz (FF)
if(document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
return document.documentElement.clientWidth; // IE6
if(document.body && ( document.body.clientWidth || document.body.clientHeight ) )
return document.body.clientWidth; // IE4
if(window.innerWidth!=undefined)
return window.innerWidth; // IE - general
return 0; // unknown
}
//}}}
//{{{
// TW2.1 and earlier:
// hijack Slider animation handler 'stop' handler so overflow is visible after animation has completed
Slider.prototype.coreStop = Slider.prototype.stop;
Slider.prototype.stop = function()
{ this.coreStop.apply(this,arguments); this.element.style.overflow = "visible"; }
// TW2.2+
// hijack start/stop handlers so overflow style is saved and restored after animation has completed
if (version.major+.1*version.minor+.01*version.revision>=2.2) {
/**
Animator.prototype.core_startAnimating = Animator.prototype.startAnimating;
Animator.prototype.startAnimating = function() {
for(var t=0; t<arguments.length; t++)
arguments[t].element.save_overflow=arguments[t].element.style.overflow;
return this.core_startAnimating.apply(this,arguments);
};
**/
Morpher.prototype.coreStop = Morpher.prototype.stop;
Morpher.prototype.stop = function() {
this.coreStop.apply(this,arguments);
this.element.style.overflow = this.element.save_overflow||"visible";
};
}
//}}}
/***
|Name|NestedSlidersPluginInfo|
|Source|http://www.TiddlyTools.com/#NestedSlidersPlugin|
|Documentation|http://www.TiddlyTools.com/#NestedSlidersPluginInfo|
|Version|2.3.5|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|documentation|
|Requires||
|Overrides||
|Description|documentation for NestedSlidersPlugin|
This plugin adds new wiki syntax for embedding 'slider' panels directly into tiddler content.
!!!!!Usage
<<<
Use {{{+++}}} and {{{===}}} to delimit the slider content. You can also 'nest' these sliders as deep as you like (see complex nesting example below), so that expandable 'tree-like' hierarchical displays can be created. This is most useful when converting existing in-line text content to create in-line annotations, footnotes, context-sensitive help, or other subordinate information displays.
Additional optional syntax elements let you specify
*default to open
*cookiename
*heading level
*floater (with optional CSS width value)
*transient display (clicking elsewhere closes panel)
*custom class/label/tooltip/accesskey
*alternate label/tooltip (displayed when panel is open)
*panelID (for later use with {{{<<DOM>>}}} macro. See [[DOMTweaksPlugin]])
*automatic blockquote style on panel
*deferred rendering of panel content
The complete syntax, using all options, is:
//{{{
++++(cookiename)!!!!!^width^*{{class{[label=key|tooltip][altlabel|alttooltip]}}}#panelID:>...
content goes here
===
//}}}
where:
* {{{+++}}} (or {{{++++}}}) and {{{===}}}<br>marks the start and end of the slider definition, respectively. When the extra {{{+}}} is used, the slider will be open when initially displayed.
* {{{(cookiename)}}}<br>saves the slider opened/closed state, and restores this state whenever the slider is re-rendered.
* {{{!}}} through {{{!!!!!}}}<br>displays the slider label using a formatted headline (Hn) style instead of a button/link style
* {{{^width^}}} (or just {{{^}}})<br>makes the slider 'float' on top of other content rather than shifting that content downward. 'width' must be a valid CSS value (e.g., "30em", "180px", "50%", etc.). If omitted, the default width is "auto" (i.e., fit to content)
* {{{"*"}}} //(without the quotes)//<br>denotes "transient display": when a click occurs elsewhere in the document, the slider/floating panel will be automatically closed. This is useful for creating 'pulldown menus' that automatically go away after they are used. //Note: using SHIFT-click on a slider label will open/close that slider without triggering the automatic closing of any transient slider panels that are currently displayed, permitting ''temporary'' display of several transient panels at once.//
* """{{class{[label=key|tooltip][altlabel|alttooltip]}}}"""<br>uses label/tooltip/accesskey. """{{class{...}}}""", """=key""", """|tooltip""" and """[altlabel|alttooltip]""" are optional. 'class' is any valid CSS class name, used to style the slider label text. 'key' must be a ''single letter only''. altlabel/alttooltip specifiy alternative label/tooltip for use when slider/floating panel is displayed.
* {{{#panelID:}}}<br>defines a unique DOM element ID that is assigned to the panel element used to display the slider content. This ID can then be used later to reposition the panel using the {{{<<DOM move id>>}}} macro (see [[DOMTweaksPlugin]]), or to access/modify the panel element through use of {{{document.getElementById(...)}}}) javascript code in a plugin or inline script.
* {{{">"}}} //(without the quotes)//<br>automatically adds blockquote formatting to slider content
* {{{"..."}}} //(without the quotes)//<br>defers rendering of closed sliders until the first time they are opened. //Note: deferred rendering may produce unexpected results in some cases. Use with care.//
//Note: to make slider definitions easier to read and recognize when editing a tiddler, newlines immediately following the {{{+++}}} 'start slider' or preceding the {{{===}}} 'end slider' sequence are automatically supressed so that excess whitespace is eliminated from the output.//
<<<
!!!!!Examples
<<<
simple in-line slider:
{{{
+++
content
===
}}}
+++
content
===
----
use a custom label and tooltip:
{{{
+++[label|tooltip]
content
===
}}}
+++[label|tooltip]
content
===
----
content automatically blockquoted:
{{{
+++>
content
===
}}}
+++>
content
===
----
all options combined //(default open, cookie, heading, sized floater, transient, class, label/tooltip/key, blockquoted, deferred)//
{{{
++++(testcookie)!!!^30em^*{{big{[label=Z|click or press Alt-Z to open]}}}>...
content
===
}}}
++++(testcookie)!!!^30em^*{{big{[label=Z|click or press Alt-Z to open]}}}>...
content
===
----
complex nesting example:
{{{
+++[get info...=I|click for information or press Alt-I]
put some general information here,
plus a floating panel with more specific info:
+++^10em^[view details...|click for details]
put some detail here, which could in turn contain a transient panel,
perhaps with a +++^25em^*[glossary definition]explaining technical terms===
===
===
}}}
+++[get info...=I|click for information or press Alt-I]
put some general information here,
plus a floating panel with more specific info:
+++^10em^[view details...|click for details]
put some detail here, which could in turn contain a transient panel,
perhaps with a +++^25em^*[glossary definition]explaining technical terms===
===
===
<<<
!!!!!Revisions
<<<
2008.03.26 - 2.3.5 in document.onclick(), if click is in popup, don't dismiss transient panel (if any)
2008.01.08 - [*.*.*] plugin size reduction: documentation moved to ...Info tiddler
2007.12.28 - 2.3.4 added hijack for Animator.prototype.startAnimating(). Previously, the plugin code simply set the overflow to "visible" after animation. This code tweak corrects handling of elements that were styled with overflow=hidden/auto/scroll before animation by saving the overflow style and then restoring it after animation has completed.
2007.12.17 - 2.3.3 use hasClass() instead of direct comparison to test for "floatingPanel" class. Allows floating panels to have additional classes assigned to them (i.e., by AnimationEffectsPlugin).
2007.11.14 - 2.3.2 in onClickNestedSlider(), prevent SHIFT-click events from opening a new, empty browser window by setting "cancelBubble=true" and calling "stopPropagation()". Note: SHIFT-click is still processed as a normal click (i.e., it toggles the slider panel display). Also, using SHIFT-click will prevent 'transient' sliders from being automatically closed when another slider is opened, allowing you to *temporarily* display several transient sliders at once.
2007.07.26 - 2.3.1 in document.onclick(), propagate return value from hijacked core click handler to consume OR bubble up click as needed. Fixes "IE click disease", whereby nearly every mouse click causes a page transition.
2007.07.20 - 2.3.0 added syntax for setting panel ID (#panelID:). This allows individual slider panels to be repositioned within tiddler content simply by giving them a unique ID and then moving them to the desired location using the {{{<<DOM move id>>}}} macro.
2007.07.19 - 2.2.0 added syntax for alttext and alttip (button label and tooltip to be displayed when panel is open)
2007.07.14 - 2.1.2 corrected use of 'transient' attribute in IE to prevent (non-recursive) infinite loop
2007.07.12 - 2.1.0 replaced use of "*" for 'open/close on rollover' (which didn't work too well). "*" now indicates 'transient' panels that are automatically closed if a click occurs somewhere else in the document. This permits use of nested sliders to create nested "pulldown menus" that automatically disappear after interaction with them has been completed. Also, in onClickNestedSlider(), use "theTarget.sliderCookie", instead of "this.sliderCookie" to correct cookie state tracking when automatically dismissing transient panels.
2007.06.10 - 2.0.5 add check to ensure that window.adjustSliderPanel() is defined before calling it (prevents error on shutdown when mouse event handlers are still defined)
2007.05.31 - 2.0.4 add handling to invoke adjustSliderPanel() for onmouseover events on slider button and panel. This allows the panel position to be re-synced when the button position shifts due to changes in unrelated content above it on the page. (thanks to Harsha for bug report)
2007.03.30 - 2.0.3 added chkFloatingSlidersAnimate (default to FALSE), so that slider animation can be disabled independent of the overall document animation setting (avoids strange rendering and focus problems in floating panels)
2007.03.01 - 2.0.2 for TW2.2+, hijack Morpher.prototype.stop so that "overflow:hidden" can be reset to "overflow:visible" after animation ends
2007.03.01 - 2.0.1 in hijack for Slider.prototype.stop, use apply() to pass params to core function
2006.07.28 - 2.0.0 added custom class syntax around label/tip/key syntax: {{{{{classname{[label=key|tip]}}}}}}
2006.07.25 - 1.9.3 when parsing slider, save default open/closed state in button element, then in onClickNestedSlider(), if slider state matches saved default, instead of saving cookie, delete it. Significantly reduces the 'cookie overhead' when default slider states are used.
2006.06.29 - 1.9.2 in onClickNestedSlider(), when setting focus to first control, skip over type="hidden"
2006.06.22 - 1.9.1 added panel.defaultPanelWidth to save requested panel width, even after resizing has changed the style value
2006.05.11 - 1.9.0 added optional '^width^' syntax for floating sliders and '=key' syntax for setting an access key on a slider label
2006.05.09 - 1.8.0 in onClickNestedSlider(), when showing panel, set focus to first child input/textarea/select element
2006.04.24 - 1.7.8 in adjustSliderPos(), if floating panel is contained inside another floating panel, subtract offset of containing panel to find correct position
2006.02.16 - 1.7.7 corrected deferred rendering to account for use-case where show/hide state is tracked in a cookie
2006.02.15 - 1.7.6 in adjustSliderPos(), ensure that floating panel is positioned completely within the browser window (i.e., does not go beyond the right edge of the browser window)
2006.02.04 - 1.7.5 add 'var' to unintended global variable declarations to avoid FireFox 1.5.0.1 crash bug when assigning to globals
2006.01.18 - 1.7.4 only define adjustSliderPos() function if it has not already been provided by another plugin. This lets other plugins 'hijack' the function even when they are loaded first.
2006.01.16 - 1.7.3 added adjustSliderPos(place,btn,panel,panelClass) function to permit specialized logic for placement of floating panels. While it provides improved placement for many uses of floating panels, it exhibits a relative offset positioning error when used within *nested* floating panels. Short-term workaround is to only adjust the position for 'top-level' floaters.
2006.01.16 - 1.7.2 added button property to slider panel elements so that slider panel can tell which button it belongs to. Also, re-activated and corrected animation handling so that nested sliders aren't clipped by hijacking Slider.prototype.stop so that "overflow:hidden" can be reset to "overflow:visible" after animation ends
2006.01.14 - 1.7.1 added optional "^" syntax for floating panels. Defines new CSS class, ".floatingPanel", as an alternative for standard in-line ".sliderPanel" styles.
2006.01.14 - 1.7.0 added optional "*" syntax for rollover handling to show/hide slider without requiring a click (Based on a suggestion by tw4efl)
2006.01.03 - 1.6.2 When using optional "!" heading style, instead of creating a clickable "Hn" element, create an "A" element inside the "Hn" element. (allows click-through in SlideShowPlugin, which captures nearly all click events, except for hyperlinks)
2005.12.15 - 1.6.1 added optional "..." syntax to invoke deferred ('lazy') rendering for initially hidden sliders
removed checkbox option for 'global' application of lazy sliders
2005.11.25 - 1.6.0 added optional handling for 'lazy sliders' (deferred rendering for initially hidden sliders)
2005.11.21 - 1.5.1 revised regular expressions: if present, a single newline //preceding// and/or //following// a slider definition will be suppressed so start/end syntax can be place on separate lines in the tiddler 'source' for improved readability. Similarly, any whitespace (newlines, tabs, spaces, etc.) trailing the 'start slider' syntax or preceding the 'end slider' syntax is also suppressed.
2005.11.20 - 1.5.0 added (cookiename) syntax for optional tracking and restoring of slider open/close state
2005.11.11 - 1.4.0 added !!!!! syntax to render slider label as a header (Hn) style instead of a button/link style
2005.11.07 - 1.3.0 removed alternative syntax {{{(((}}} and {{{)))}}} (so they can be used by other formatting extensions) and simplified/improved regular expressions to trim multiple excess newlines
2005.11.05 - 1.2.1 changed name to NestedSlidersPlugin
2005.11.04 - 1.2.0 added alternative character-mode syntax {{{(((}}} and {{{)))}}}
tweaked "eat newlines" logic for line-mode {{{+++}}} and {{{===}}} syntax
2005.11.03 - 1.1.1 fixed toggling of default tooltips ("more..." and "less...") when a non-default button label is used. code cleanup, added documentation
2005.11.03 - 1.1.0 changed delimiter syntax from {{{(((}}} and {{{)))}}} to {{{+++}}} and {{{===}}}. changed name to EasySlidersPlugin
2005.11.03 - 1.0.0 initial public release
<<<
/***
|Name|NewDocumentPlugin|
|Source|http://www.TiddlyTools.com/#NewDocumentPlugin|
|Documentation|http://www.TiddlyTools.com/#NewDocumentPluginInfo|
|Version|1.7.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|create new TiddlyWiki documents and/or HTML snapshots from your existing document, with just one click|
Use the {{{<<newDocument>>}}} macro to place a "new document" link into your sidebar/mainmenu/any tiddler (wherever you like). Select this command to automatically create a "new.html" document containing a specific set of tagged tiddlers. Optional parameters let you specify an alternate path/filename for the new file, or different tags to match. You can also indicate "ask" for either parameter, which will trigger a prompt for input when the command is selected.
!!!!!Documentation
>see [[NewDocumentPluginInfo]]
!!!!!Revisions
<<<
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info tiddler
2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.03.30 [1.7.0] added support for "print" param as alternative for "snap". When "print" is used, the filename is ignored and ouput is directed to another browser tab/window, where the print dialog is then automatically triggered.
|please see [[NewDocumentPluginInfo]] for additional revision details|
2006.02.03 [1.0.0] Created.
<<<
!!!!!Code
***/
//{{{
version.extensions.newDocument = {major: 1, minor: 7, revision: 0, date: new Date(2007,3,30)};
config.macros.newDocument = {
newlabel: "new document",
newprompt: "Create a new TiddlyWiki 'starter' document",
newdefault: "new.html",
allparam: "all",
saveaslabel: "save as...",
saveasprompt: "Save current TiddlyWiki to a different file",
printparam: "print",
snapparam: "snap",
snaplabel: "create a snapshot",
snapprompt: "Create a 'snapshot' of the current TiddlyWiki display",
snapdefault: "snapshot.html",
snapID: "contentWrapper",
snapIDprompt: "Please enter a DOM element ID for the desired content",
snapIDerrmsg: "Unrecognized document element ID: '%0'",
askparam: "ask",
hereparam: "here",
labelparam: "label:",
promptparam: "prompt:",
fileprompt: "Please enter a filename",
filter: "includeNew",
filterprompt: "Match one or more tags:\n(space-separated, use [[...]] around tags containing spaces)",
filtererrmsg: "Error in tag filter '%0'",
snapmsg: "Document snapshot written to %1",
okmsg: "%0 tiddlers written to %1",
failmsg: "An error occurred while creating %0"
};
config.macros.newDocument.handler = function(place,macroName,params) {
var path=getLocalPath(document.location.href);
var slashpos=path.lastIndexOf("/"); if (slashpos==-1) slashpos=path.lastIndexOf("\\");
if (slashpos!=-1) path = path.substr(0,slashpos+1); // remove filename from path, leave the trailing slash
if (params[0] && params[0].substr(0,config.macros.newDocument.labelparam.length)==config.macros.newDocument.labelparam)
var label=params.shift().substr(config.macros.newDocument.labelparam.length)
if (params[0] && params[0].substr(0,config.macros.newDocument.promptparam.length)==config.macros.newDocument.promptparam)
var prompt=params.shift().substr(config.macros.newDocument.promptparam.length)
var filename=params.shift(); if (!filename) filename=config.macros.newDocument.newdefault;
if (params[0]==config.macros.newDocument.snapparam || params[0]==config.macros.newDocument.printparam) {
var printmode=(params[0]==config.macros.newDocument.printparam);
params.shift();
if (!label) var label=config.macros.newDocument.snaplabel;
if (!prompt) var prompt=config.macros.newDocument.snapprompt;
var defaultfile=config.macros.newDocument.snapdefault;
var snapID=config.macros.newDocument.snapID;// default to "contentWrapper"
if (params[0]) var snapID=params.shift(); // alternate DOM element for snapshot
}
if (params[0]==config.macros.newDocument.allparam) {
if (!label) var label=config.macros.newDocument.saveaslabel;
if (!prompt) var prompt=config.macros.newDocument.saveasprompt;
var defaultfile=getLocalPath(document.location.href);
var slashpos=defaultfile.lastIndexOf("/"); if (slashpos==-1) slashpos=defaultfile.lastIndexOf("\\");
if (slashpos!=-1) defaultfile=defaultfile.substr(slashpos+1); // get filename only
}
if (!prompt) var prompt=config.macros.newDocument.newprompt;
if (!label) var label=config.macros.newDocument.newlabel;
if (!defaultfile) var defaultfile=config.macros.newDocument.newdefault;
var btn=createTiddlyButton(place,label,prompt,onClickNewDocument);
btn.path=path;
btn.file=filename;
btn.defaultfile=defaultfile;
btn.snapID=snapID; // NULL unless snapshot is being taken
btn.printmode=printmode;
btn.filter=params.length?params:[config.macros.newDocument.filter];
}
// IE needs explicit global scoping for functions called by browser events
window.onClickNewDocument=function(e)
{
if (!e) var e = window.event; var btn=resolveTarget(e);
// assemble document content, write file, report result
var okmsg=config.macros.newDocument.okmsg;
var failmsg=config.macros.newDocument.failmsg;
var count=0;
var out="";
if (btn.snapID) { // HTML+CSS snapshot
var snapID=btn.snapID;
if (btn.snapID==config.macros.newDocument.askparam)
snapID=prompt(config.macros.newDocument.snapIDprompt,config.macros.newDocument.snapID);
if (btn.snapID==config.macros.newDocument.hereparam)
{ var here=story.findContainingTiddler(btn); if (here) snapID=here.id; }
if (!document.getElementById(snapID)) { // if specified element does not exist
if (snapID) // ID=null if prompt was cancelled by user
displayMessage(config.macros.newDocument.snapIDerrmsg.format([snapID]));
e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation(); return(false);
}
var styles=document.getElementsByTagName("style");
out+="<html>\n<head>\n<style>\n";
for(var i=0; i < styles.length; i++)
out +="/* stylesheet from tiddler:"+styles[i].getAttribute("id")+" */\n"+styles[i].innerHTML+"\n\n";
out+="</style>\n</head>\n<body>\n\n"+document.getElementById(snapID).innerHTML+"\n\n</body>\n</html>";
okmsg=config.macros.newDocument.snapmsg;
} else { // TW starter document
// get the TiddlyWiki core code source
var sourcefile=getLocalPath(document.location.href);
var source=loadFile(sourcefile);
if(source==null) { alert(config.messages.cantSaveError); return null; }
// reset existing HTML source markup
source=updateMarkupBlock(source,"PRE-HEAD");
source=updateMarkupBlock(source,"POST-HEAD");
source=updateMarkupBlock(source,"PRE-BODY");
source=updateMarkupBlock(source,"POST-BODY");
// find store area
var posOpeningDiv=source.indexOf(startSaveArea);
var posClosingDiv=source.lastIndexOf(endSaveArea);
if((posOpeningDiv==-1)||(posClosingDiv==-1)) { alert(config.messages.invalidFileError.format([sourcefile])); return; }
// get the matching tiddler divs
var match=btn.filter;
if (match[0]==config.macros.newDocument.askparam) { // ask user for tags
var newfilt=prompt(config.macros.newDocument.filterprompt,config.macros.newDocument.filter);
if (!newfilt) return; // cancelled by user
match=newfilt.readMacroParams();
}
var storeAreaDivs=[];
var tiddlers=store.getTiddlers('title');
for (var i=0; i<tiddlers.length; i++)
if (match[0]==config.macros.newDocument.allparam || (tiddlers[i].tags && tiddlers[i].tags.containsAny(match)) )
storeAreaDivs.push(store.getSaver().externalizeTiddler(store,tiddlers[i]));
out+=source.substr(0,posOpeningDiv+startSaveArea.length);
out+=convertUnicodeToUTF8(storeAreaDivs.join("\n"))+"\n\t\t";
out+=source.substr(posClosingDiv);
count=storeAreaDivs.length;
}
if (btn.printmode) {
var win=window.open("","_blank","");
win.document.open();
win.document.writeln(out);
win.document.close();
win.focus(); // bring to front
win.print(); // trigger print dialog
} else {
// get output path/filename
var filename=btn.file;
if (filename==config.macros.newDocument.askparam)
filename=promptForFilename(config.macros.newDocument.fileprompt,btn.path,btn.defaultfile);
if (!filename) return; // cancelled by user
// if specified file does not include a path, assemble fully qualified path and filename
var slashpos=filename.lastIndexOf("/"); if (slashpos==-1) slashpos=filename.lastIndexOf("\\");
if (slashpos==-1) filename=btn.path+filename;
var ok=saveFile(filename,out);
var msg=ok?okmsg.format([count,filename]):failmsg.format([filename]);
var link=ok?"file:///"+filename.replace(/\\/g,'/'):""; // change local path to link text
clearMessage(); displayMessage(msg,link);
}
e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation(); return(false);
}
//}}}
//{{{
function promptForFilename(msg,path,file)
{
if(window.Components) { // moz
try {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var nsIFilePicker = window.Components.interfaces.nsIFilePicker;
var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);
picker.init(window, msg, nsIFilePicker.modeSave);
var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
thispath.initWithPath(path);
picker.displayDirectory=thispath;
picker.defaultExtension='html';
picker.defaultString=file;
picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterText|nsIFilePicker.filterHTML);
if (picker.show()!=nsIFilePicker.returnCancel) var result=picker.file.persistentDescriptor;
}
catch(e) { alert('error during local file access: '+e.toString()) }
}
else { // IE
try { // XP only
var s = new ActiveXObject('UserAccounts.CommonDialog');
s.Filter='All files|*.*|Text files|*.txt|HTML files|*.htm;*.html|';
s.FilterIndex=3; // default to HTML files;
s.InitialDir=path;
s.FileName=file;
if (s.showOpen()) var result=s.FileName;
}
catch(e) { var result=prompt(msg,path+file); } // fallback for non-XP IE
}
return result;
}
//}}}
|Name|NewDocumentPluginInfo|
|Source|http://www.TiddlyTools.com/#NewDocumentPlugin|
|Documentation|http://www.TiddlyTools.com/#NewDocumentPluginInfo|
|Version|1.7.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|documentation|
|Requires||
|Overrides||
|Description|documentation for NewDocumentPlugin|
Use the {{{<<newDocument>>}}} macro to place a "new document" link into your sidebar/mainmenu/any tiddler (wherever you like). Select this command to automatically create a "new.html" document containing a specific set of tagged tiddlers. Optional parameters let you specify an alternate path/filename for the new file, or different tags to match. You can also indicate "ask" for either parameter, which will trigger a prompt for input when the command is selected.
!!!!!Usage
<<<
{{{<<newDocument label:text prompt:text filename tag tag tag...>>}}}
{{{<<newDocument label:text prompt:text filename all>>}}}
{{{<<newDocument label:text prompt:text filename snap ID>>}}}
{{{<<newDocument label:text prompt:text filename snap here>>}}}
{{{<<newDocument label:text prompt:text nofile print ID>>}}}
{{{<<newDocument label:text prompt:text nofile print here>>}}}
where:
* ''label:text'' defines //optional// alternative link text (replaces default "new document" display)
* ''prompt:text'' defines //optional// alternative tooltip text for 'mouseover' prompting (replaces default hard-coded tooltip text)
* ''filename'' is any local path-and-filename. If no parameters are provided, the default is to create the file "new.html" in the current directory. If a filename is provided without a path (i.e., there is no "/" in the input), then the current directory is also assumed. Otherwise, this parameter is expected to contain the complete path and filename needed to write the file to your local hard disk. If ''ask'' is used in place of the filename parameter then, when the command link is selected, a message box will be automatically displayed so you can select/enter the path and filename.
* ''tag tag tag...'' is a list of one or more space-separated tags (use quotes or {{{[[]]}}} around tags that contain spaces). The new document will include all tiddlers that match at least one of the tags in the list. The default is to include tiddlers tagged with <<tag includeNew>>. The special value ''all'' may be used to match every tiddler (even those without tags). If ''ask'' is used in place of the tags then, when the command link is selected, a message box will be automatically displayed so you can enter the desired tags at that time.
* When you use the keyword ''snap'' in place of the tags, you can generate a file containing the //rendered// CSS-and-HTML that is currently being displayed in browser. By default, the snapshop uses the 'contentWrapper' DOM element ID to automatically include all the TiddlyWiki elements, such as the sidebars and header, in addition to the center 'story' column containing the tiddler content.
* When you use the keyword ''print'' in place of the tags, a snapshot is generated, but the contents are not written to a file. Instead, they are displayed in a separate browser tab/window, and the print dialog for that tab/window is automatically invoked.
* You can limit the snapshot to capture only a portion of the rendered TiddlyWiki elements by specifiying an optional alternate DOM element ID, such as "displayArea" (the entire center 'story' column) or even just a single tiddler (e.g., "tidderMyTiddlerTitle", assuming that "MyTiddlerTitle" is currently displayed). Only the portions of the document that are contained //within// the specified DOM element will be transcribed to the resulting snapshot file. If ''ask'' is used in place of a DOM element ID, you will be prompted to enter the ID (default is "contentWrapper") when the snapshot is being taken. This allows you to easily enter the ID of any currently displayed tiddler to make quick snapshots of specific tiddlers. If ''here'' is used in place of a DOM element ID, the current tiddler id is used.
Note: as of version 1.4.0 of this plugin, support for selecting tiddlers by using tag *expressions* has been replaced with simpler, more efficient "containsAny()" logic. To create new ~TiddlyWiki documents that contain only those tiddlers selected with advanced AND/OR/NOT Boolean expressions, you can use the filtering features provided by the ExportTiddlersPlugin (see www.TiddlyTools.com/#ExportTiddlersPlugin).
<<<
!!!!!Examples:
<<<
{{{<<newDocument>>}}}
equivalent to {{{<<newDocument new.htm includeNew systemTiddlers>>}}}
creates default "new.html" containing tiddlers tagged with either<<tag includeNew>>or<<tag systemTiddlers>>
try it: <<newDocument>>
{{{<<newDocument empty.html systemTiddlers>>}}}
creates "empty.html" containing only tiddlers tagged with<<tag systemTiddlers>>
//(reproduces old-style (pre 2.0.2) empty file)//
try it: <<newDocument empty.html systemTiddlers>>
{{{<<newDocument "label:create Import/Export starter" ask importexport>>}}}
save importexport tiddlers to a new file, prompts for path/file
try it: <<newDocument "label:create Import/Export starter" ask importexport>>
{{{<<newDocument ask ask>>}}}
prompts for path/file, prompts for tags to match
try it: <<newDocument ask ask>>
{{{<<newDocument ask all>>}}}
save all current TiddlyWiki contents to a new file, prompts for path/file
try it: <<newDocument ask all>>
{{{<<newDocument ask snap>>}}}
generates snapshot of currently displayed document, prompts for path/file
try it: <<newDocument ask snap>>
{{{<<newDocument ask snap here>>}}}
generates snapshot of this tiddler ONLY, prompts for path/file
try it: <<newDocument ask snap here>>
{{{<<newDocument ask print here>>}}}
prints a snapshot of this tiddler ONLY
try it: <<newDocument nofile print here>>
<<<
!!!!!Revisions
<<<
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info tiddler
2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.03.30 [1.7.0] added support for "print" param as alternative for "snap". When "print" is used, the filename is ignored and ouput is directed to another browser tab/window, where the print dialog is then automatically triggered.
2007.03.30 [1.6.1] added support for "here" keyword for current tiddler elementID and "prompt:text" param for specifying tooltip text
2007.02.12 [1.6.0] in onClickNewDocument(), reset HTML source 'markup'
2006.10.23 [1.5.1] in onClickNewDocument(), get saved parameter value for snapID instead of using default "contentWrapper" (oops!)
2006.10.18 [1.5.0] new optional param for 'snap'... specify alternative DOM element ID (default is still "contentWrapper"). Based on a suggestion from Xavier Verges.
2006.08.03 [1.4.3] in promptForFilename(), for IE (WinXP only), added handling for UserAccounts.CommonDialog
2006.07.29 [1.4.2] in onClickNewDocument(), okmsg display is now linked to newly created file
2006.07.24 [1.4.1] in promptForFilename(), check for nsIFilePicker.returnCancel to allow nsIFilePicker.returnOK **OR** nsIFilePicker.returnReplace to be processed.
2006.05.23 [1.4.0] due to very poor performance, support for tag *expressions* has been removed, in favor of a simpler "containsAny()" scan for tags.
2006.04.09 [1.3.6] in onClickNewDocument, added call to convertUnicodeToUTF8() to better handle international characters.
2006.03.15 [1.3.5] added nsIFilePicker() handler for selecting filename in moz-based browsers. IE and other non-moz browsers still use simple prompt() dialog
2006.03.15 [1.3.0] added "label:text" param for custom link text. added special "all" filter parameter for "save as..." handling (writes all tiddlers to output file)
2006.03.09 [1.2.0] added special "snap" filter parameter to generate and write "snapshot" files containing static HTML+CSS for currently rendered document.
2006.02.24 [1.1.2] Fix incompatiblity with TW 2.0.5 by removing custom definition of getLocalPath() (which is now part of TW core)
2006.02.03 [1.1.1] concatentate 'extra' params so that tag expressions don't have to be quoted. moved all text to 'formatted' string definitions for easier translation.
2006.02.03 [1.1.0] added support for tag EXPRESSIONS. plus improved documentation and code cleanup
2006.02.03 [1.0.0] Created.
<<<
----
<html><strong>Contact Info</strong></html>
Dr. Hui Li
<<email hui.li at computer dot org>>
[[www.hui-li.net|http://www.hui-li.net]]
<html>
<a href="http://www.linkedin.com/in/huili" ><img src="http://www.linkedin.com/img/webpromo/btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="View Hui Li's profile on LinkedIn"></a>
</html>
Visit time: <script>document.write(new Date());</script>
----
!!!De Kampeermarkt - Eindhoven, NL
http://www.kampeermarkt.com
Address:
Lodewijkstraat 4, 5652 AC, Eindhoven
Tel: 040 25 133 92
!!!Perry Sport
http://www.perrysport.nl
!!!Hiking and Camping Tips
http://www.knowledgehound.com/topics/hikecamp.htm
http://www.lovetheoutdoors.com
<!--{{{-->
<div id='header' class='header'>
<div class='headerShadow'>
<!--<span class='searchBar' macro='search'></span>-->
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<!--<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>-->
</div>
</div>
<!-- horizontal MainMenu -->
<div id='topMenu' refresh='content' tiddler='SecondMenu'></div>
<!--original MainMenu menu-->
<div id='mainMenu'>
<span refresh='content' tiddler='MainMenu'></span>
<span id='noticeBoard' refresh='content' tiddler='NoticeBoard'></span>
</div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='MochaSideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<div id='contentFooter' refresh='content' tiddler='contentFooter'></div>
<!--}}}-->
/***
|<html><a name="Top"/></html>''Name:''|PartTiddlerPlugin|
|''Version:''|1.0.9 (2007-07-14)|
|''Source:''|http://tiddlywiki.abego-software.de/#PartTiddlerPlugin|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''Licence:''|[[BSD open source license]]|
|''CoreVersion:''|2.1.3|
|''Browser:''|Firefox 1.0.4+; InternetExplorer 6.0|
!Table of Content<html><a name="TOC"/></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Description',null, event)">Description, Syntax</a></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Applications',null, event)">Applications</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('LongTiddler',null, event)">Refering to Paragraphs of a Longer Tiddler</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Citation',null, event)">Citation Index</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('TableCells',null, event)">Creating "multi-line" Table Cells</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Tabs',null, event)">Creating Tabs</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Sliders',null, event)">Using Sliders</a></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Revisions',null, event)">Revision History</a></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Code',null, event)">Code</a></html>
!Description<html><a name="Description"/></html>
With the {{{<part aPartName> ... </part>}}} feature you can structure your tiddler text into separate (named) parts.
Each part can be referenced as a "normal" tiddler, using the "//tiddlerName//''/''//partName//" syntax (e.g. "About/Features"). E.g. you may create links to the parts (e.g. {{{[[Quotes/BAX95]]}}} or {{{[[Hobbies|AboutMe/Hobbies]]}}}), use it in {{{<<tiddler...>>}}} or {{{<<tabs...>>}}} macros etc.
''Syntax:''
|>|''<part'' //partName// [''hidden''] ''>'' //any tiddler content// ''</part>''|
|//partName//|The name of the part. You may reference a part tiddler with the combined tiddler name "//nameOfContainerTidder//''/''//partName//. <<br>>If you use a partName containing spaces you need to quote it (e.g. {{{"Major Overview"}}} or {{{[[Shortcut List]]}}}).|
|''hidden''|When defined the content of the part is not displayed in the container tiddler. But when the part is explicitly referenced (e.g. in a {{{<<tiddler...>>}}} macro or in a link) the part's content is displayed.|
|<html><i>any tiddler content</i></html>|<html>The content of the part.<br>A part can have any content that a "normal" tiddler may have, e.g. you may use all the formattings and macros defined.</html>|
|>|~~Syntax formatting: Keywords in ''bold'', optional parts in [...]. 'or' means that exactly one of the two alternatives must exist.~~|
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
!Applications<html><a name="Applications"/></html>
!!Refering to Paragraphs of a Longer Tiddler<html><a name="LongTiddler"/></html>
Assume you have written a long description in a tiddler and now you want to refer to the content of a certain paragraph in that tiddler (e.g. some definition.) Just wrap the text with a ''part'' block, give it a nice name, create a "pretty link" (like {{{[[Discussion Groups|Introduction/DiscussionGroups]]}}}) and you are done.
Notice this complements the approach to first writing a lot of small tiddlers and combine these tiddlers to one larger tiddler in a second step (e.g. using the {{{<<tiddler...>>}}} macro). Using the ''part'' feature you can first write a "classic" (longer) text that can be read "from top to bottom" and later "reuse" parts of this text for some more "non-linear" reading.
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
!!Citation Index<html><a name="Citation"/></html>
Create a tiddler "Citations" that contains your "citations".
Wrap every citation with a part and a proper name.
''Example''
{{{
<part BAX98>Baxter, Ira D. et al: //Clone Detection Using Abstract Syntax Trees.//
in //Proc. ICSM//, 1998.</part>
<part BEL02>Bellon, Stefan: //Vergleich von Techniken zur Erkennung duplizierten Quellcodes.//
Thesis, Uni Stuttgart, 2002.</part>
<part DUC99>Ducasse, Stéfane et al: //A Language Independent Approach for Detecting Duplicated Code.//
in //Proc. ICSM//, 1999.</part>
}}}
You may now "cite" them just by using a pretty link like {{{[[Citations/BAX98]]}}} or even more pretty, like this {{{[[BAX98|Citations/BAX98]]}}}.
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
!!Creating "multi-line" Table Cells<html><a name="TableCells"/></html>
You may have noticed that it is hard to create table cells with "multi-line" content. E.g. if you want to create a bullet list inside a table cell you cannot just write the bullet list
{{{
* Item 1
* Item 2
* Item 3
}}}
into a table cell (i.e. between the | ... | bars) because every bullet item must start in a new line but all cells of a table row must be in one line.
Using the ''part'' feature this problem can be solved. Just create a hidden part that contains the cells content and use a {{{<<tiddler >>}}} macro to include its content in the table's cell.
''Example''
{{{
|!Subject|!Items|
|subject1|<<tiddler ./Cell1>>|
|subject2|<<tiddler ./Cell2>>|
<part Cell1 hidden>
* Item 1
* Item 2
* Item 3
</part>
...
}}}
Notice that inside the {{{<<tiddler ...>>}}} macro you may refer to the "current tiddler" using the ".".
BTW: The same approach can be used to create bullet lists with items that contain more than one line.
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
!!Creating Tabs<html><a name="Tabs"/></html>
The build-in {{{<<tabs ...>>}}} macro requires that you defined an additional tiddler for every tab it displays. When you want to have "nested" tabs you need to define a tiddler for the "main tab" and one for every tab it contains. I.e. the definition of a set of tabs that is visually displayed at one place is distributed across multiple tiddlers.
With the ''part'' feature you can put the complete definition in one tiddler, making it easier to keep an overview and maintain the tab sets.
''Example''
The standard tabs at the sidebar are defined by the following eight tiddlers:
* SideBarTabs
* TabAll
* TabMore
* TabMoreMissing
* TabMoreOrphans
* TabMoreShadowed
* TabTags
* TabTimeline
Instead of these eight tiddlers one could define the following SideBarTabs tiddler that uses the ''part'' feature:
{{{
<<tabs txtMainTab
Timeline Timeline SideBarTabs/Timeline
All 'All tiddlers' SideBarTabs/All
Tags 'All tags' SideBarTabs/Tags
More 'More lists' SideBarTabs/More>>
<part Timeline hidden><<timeline>></part>
<part All hidden><<list all>></part>
<part Tags hidden><<allTags>></part>
<part More hidden><<tabs txtMoreTab
Missing 'Missing tiddlers' SideBarTabs/Missing
Orphans 'Orphaned tiddlers' SideBarTabs/Orphans
Shadowed 'Shadowed tiddlers' SideBarTabs/Shadowed>></part>
<part Missing hidden><<list missing>></part>
<part Orphans hidden><<list orphans>></part>
<part Shadowed hidden><<list shadowed>></part>
}}}
Notice that you can easily "overwrite" individual parts in separate tiddlers that have the full name of the part.
E.g. if you don't like the classic timeline tab but only want to see the 100 most recent tiddlers you could create a tiddler "~SideBarTabs/Timeline" with the following content:
{{{
<<forEachTiddler
sortBy 'tiddler.modified' descending
write '(index < 100) ? "* [["+tiddler.title+"]]\n":""'>>
}}}
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
!!Using Sliders<html><a name="Sliders"/></html>
Very similar to the build-in {{{<<tabs ...>>}}} macro (see above) the {{{<<slider ...>>}}} macro requires that you defined an additional tiddler that holds the content "to be slid". You can avoid creating this extra tiddler by using the ''part'' feature
''Example''
In a tiddler "About" we may use the slider to show some details that are documented in the tiddler's "Details" part.
{{{
...
<<slider chkAboutDetails About/Details details "Click here to see more details">>
<part Details hidden>
To give you a better overview ...
</part>
...
}}}
Notice that putting the content of the slider into the slider's tiddler also has an extra benefit: When you decide you need to edit the content of the slider you can just doubleclick the content, the tiddler opens for editing and you can directly start editing the content (in the part section). In the "old" approach you would doubleclick the tiddler, see that the slider is using tiddler X, have to look for the tiddler X and can finally open it for editing. So using the ''part'' approach results in a much short workflow.
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
!Revision history<html><a name="Revisions"/></html>
* v1.0.9 (2007-07-14)
** Bugfix: Error when using the SideBarTabs example and switching between "More" and "Shadow". Thanks to cmari for reporting the issue.
* v1.0.8 (2007-06-16)
** Speeding up display of tiddlers containing multiple pard definitions. Thanks to Paco Rivière for reporting the issue.
** Support "./partName" syntax inside <<tabs ...>> macro
* v1.0.7 (2007-03-07)
** Bugfix: <<tiddler "./partName">> does not always render correctly after a refresh (e.g. like it happens when using the "Include" plugin). Thanks to Morris Gray for reporting the bug.
* v1.0.6 (2006-11-07)
** Bugfix: cannot edit tiddler when UploadPlugin by Bidix is installed. Thanks to José Luis González Castro for reporting the bug.
* v1.0.5 (2006-03-02)
** Bugfix: Example with multi-line table cells does not work in IE6. Thanks to Paulo Soares for reporting the bug.
* v1.0.4 (2006-02-28)
** Bugfix: Shadow tiddlers cannot be edited (in TW 2.0.6). Thanks to Torsten Vanek for reporting the bug.
* v1.0.3 (2006-02-26)
** Adapt code to newly introduced Tiddler.prototype.isReadOnly() function (in TW 2.0.6). Thanks to Paulo Soares for reporting the problem.
* v1.0.2 (2006-02-05)
** Also allow other macros than the "tiddler" macro use the "." in the part reference (to refer to "this" tiddler)
* v1.0.1 (2006-01-27)
** Added Table of Content for plugin documentation. Thanks to RichCarrillo for suggesting.
** Bugfix: newReminder plugin does not work when PartTiddler is installed. Thanks to PauloSoares for reporting.
* v1.0.0 (2006-01-25)
** initial version
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
!Code<html><a name="Code"/></html>
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
***/
//{{{
//============================================================================
// PartTiddlerPlugin
// Ensure that the PartTiddler Plugin is only installed once.
//
if (!version.extensions.PartTiddlerPlugin) {
version.extensions.PartTiddlerPlugin = {
major: 1, minor: 0, revision: 9,
date: new Date(2007, 6, 14),
type: 'plugin',
source: "http://tiddlywiki.abego-software.de/#PartTiddlerPlugin"
};
if (!window.abego) window.abego = {};
if (version.major < 2) alertAndThrow("PartTiddlerPlugin requires TiddlyWiki 2.0 or newer.");
//============================================================================
// Common Helpers
// Looks for the next newline, starting at the index-th char of text.
//
// If there are only whitespaces between index and the newline
// the index behind the newline is returned,
// otherwise (or when no newline is found) index is returned.
//
var skipEmptyEndOfLine = function(text, index) {
var re = /(\n|[^\s])/g;
re.lastIndex = index;
var result = re.exec(text);
return (result && text.charAt(result.index) == '\n')
? result.index+1
: index;
}
//============================================================================
// Constants
var partEndOrStartTagRE = /(<\/part>)|(<part(?:\s+)((?:[^>])+)>)/mg;
var partEndTagREString = "<\\/part>";
var partEndTagString = "</part>";
//============================================================================
// Plugin Specific Helpers
// Parse the parameters inside a <part ...> tag and return the result.
//
// @return [may be null] {partName: ..., isHidden: ...}
//
var parseStartTagParams = function(paramText) {
var params = paramText.readMacroParams();
if (params.length == 0 || params[0].length == 0) return null;
var name = params[0];
var paramsIndex = 1;
var hidden = false;
if (paramsIndex < params.length) {
hidden = params[paramsIndex] == "hidden";
paramsIndex++;
}
return {
partName: name,
isHidden: hidden
};
}
// Returns the match to the next (end or start) part tag in the text,
// starting the search at startIndex.
//
// When no such tag is found null is returned, otherwise a "Match" is returned:
// [0]: full match
// [1]: matched "end" tag (or null when no end tag match)
// [2]: matched "start" tag (or null when no start tag match)
// [3]: content of start tag (or null if no start tag match)
//
var findNextPartEndOrStartTagMatch = function(text, startIndex) {
var re = new RegExp(partEndOrStartTagRE);
re.lastIndex = startIndex;
var match = re.exec(text);
return match;
}
//============================================================================
// Formatter
// Process the <part ...> ... </part> starting at (w.source, w.matchStart) for formatting.
//
// @return true if a complete part section (including the end tag) could be processed, false otherwise.
//
var handlePartSection = function(w) {
var tagMatch = findNextPartEndOrStartTagMatch(w.source, w.matchStart);
if (!tagMatch) return false;
if (tagMatch.index != w.matchStart || !tagMatch[2]) return false;
// Parse the start tag parameters
var arguments = parseStartTagParams(tagMatch[3]);
if (!arguments) return false;
// Continue processing
var startTagEndIndex = skipEmptyEndOfLine(w.source, tagMatch.index + tagMatch[0].length);
var endMatch = findNextPartEndOrStartTagMatch(w.source, startTagEndIndex);
if (endMatch && endMatch[1]) {
if (!arguments.isHidden) {
w.nextMatch = startTagEndIndex;
w.subWikify(w.output,partEndTagREString);
}
w.nextMatch = skipEmptyEndOfLine(w.source, endMatch.index + endMatch[0].length);
return true;
}
return false;
}
config.formatters.push( {
name: "part",
match: "<part\\s+[^>]+>",
handler: function(w) {
if (!handlePartSection(w)) {
w.outputText(w.output,w.matchStart,w.matchStart+w.matchLength);
}
}
} )
//============================================================================
// Extend "fetchTiddler" functionality to also recognize "part"s of tiddlers
// as tiddlers.
var currentParent = null; // used for the "." parent (e.g. in the "tiddler" macro)
// Return the match to the first <part ...> tag of the text that has the
// requrest partName.
//
// @return [may be null]
//
var findPartStartTagByName = function(text, partName) {
var i = 0;
while (true) {
var tagMatch = findNextPartEndOrStartTagMatch(text, i);
if (!tagMatch) return null;
if (tagMatch[2]) {
// Is start tag
// Check the name
var arguments = parseStartTagParams(tagMatch[3]);
if (arguments && arguments.partName == partName) {
return tagMatch;
}
}
i = tagMatch.index+tagMatch[0].length;
}
}
// Return the part "partName" of the given parentTiddler as a "readOnly" Tiddler
// object, using fullName as the Tiddler's title.
//
// All remaining properties of the new Tiddler (tags etc.) are inherited from
// the parentTiddler.
//
// @return [may be null]
//
var getPart = function(parentTiddler, partName, fullName) {
var text = parentTiddler.text;
var startTag = findPartStartTagByName(text, partName);
if (!startTag) return null;
var endIndexOfStartTag = skipEmptyEndOfLine(text, startTag.index+startTag[0].length);
var indexOfEndTag = text.indexOf(partEndTagString, endIndexOfStartTag);
if (indexOfEndTag >= 0) {
var partTiddlerText = text.substring(endIndexOfStartTag,indexOfEndTag);
var partTiddler = new Tiddler();
partTiddler.set(
fullName,
partTiddlerText,
parentTiddler.modifier,
parentTiddler.modified,
parentTiddler.tags,
parentTiddler.created);
partTiddler.abegoIsPartTiddler = true;
return partTiddler;
}
return null;
}
// Hijack the store.fetchTiddler to recognize the "part" addresses.
//
var hijackFetchTiddler = function() {
var oldFetchTiddler = store.fetchTiddler ;
store.fetchTiddler = function(title) {
var result = oldFetchTiddler.apply(this, arguments);
if (!result && title) {
var i = title.lastIndexOf('/');
if (i > 0) {
var parentName = title.substring(0, i);
var partName = title.substring(i+1);
var parent = (parentName == ".")
? store.resolveTiddler(currentParent)
: oldFetchTiddler.apply(this, [parentName]);
if (parent) {
return getPart(parent, partName, parent.title+"/"+partName);
}
}
}
return result;
};
};
// for debugging the plugin is not loaded through the systemConfig mechanism but via a script tag.
// At that point in the "store" is not yet defined. In that case hijackFetchTiddler through the restart function.
// Otherwise hijack now.
if (!store) {
var oldRestartFunc = restart;
window.restart = function() {
hijackFetchTiddler();
oldRestartFunc.apply(this,arguments);
};
} else
hijackFetchTiddler();
// The user must not edit a readOnly/partTiddler
//
config.commands.editTiddler.oldIsReadOnlyFunction = Tiddler.prototype.isReadOnly;
Tiddler.prototype.isReadOnly = function() {
// Tiddler.isReadOnly was introduced with TW 2.0.6.
// For older version we explicitly check the global readOnly flag
if (config.commands.editTiddler.oldIsReadOnlyFunction) {
if (config.commands.editTiddler.oldIsReadOnlyFunction.apply(this, arguments)) return true;
} else {
if (readOnly) return true;
}
return this.abegoIsPartTiddler;
}
config.commands.editTiddler.handler = function(event,src,title)
{
var t = store.getTiddler(title);
// Edit the tiddler if it either is not a tiddler (but a shadowTiddler)
// or the tiddler is not readOnly
if(!t || !t.abegoIsPartTiddler)
{
clearMessage();
story.displayTiddler(null,title,DEFAULT_EDIT_TEMPLATE);
story.focusTiddler(title,"text");
return false;
}
}
// To allow the "./partName" syntax in macros we need to hijack
// the invokeMacro to define the "currentParent" while it is running.
//
var oldInvokeMacro = window.invokeMacro;
function myInvokeMacro(place,macro,params,wikifier,tiddler) {
var oldCurrentParent = currentParent;
if (tiddler) currentParent = tiddler;
try {
oldInvokeMacro.apply(this, arguments);
} finally {
currentParent = oldCurrentParent;
}
}
window.invokeMacro = myInvokeMacro;
// To correctly support the "./partName" syntax while refreshing we need to hijack
// the config.refreshers.tiddlers to define the "currentParent" while it is running.
//
(function() {
var oldTiddlerRefresher= config.refreshers.tiddler;
config.refreshers.tiddler = function(e,changeList) {
var oldCurrentParent = currentParent;
try {
currentParent = e.getAttribute("tiddler");
return oldTiddlerRefresher.apply(this,arguments);
} finally {
currentParent = oldCurrentParent;
}
};
})();
// Support "./partName" syntax inside <<tabs ...>> macro
(function() {
var extendRelativeNames = function(e, title) {
var nodes = e.getElementsByTagName("a");
for(var i=0; i<nodes.length; i++) {
var node = nodes[i];
var s = node.getAttribute("content");
if (s && s.indexOf("./") == 0)
node.setAttribute("content",title+s.substr(1));
}
};
var oldHandler = config.macros.tabs.handler;
config.macros.tabs.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
var result = oldHandler.apply(this,arguments);
if (tiddler)
extendRelativeNames(place, tiddler.title);
return result;
};
})();
// Scroll the anchor anchorName in the viewer of the given tiddler visible.
// When no tiddler is defined use the tiddler of the target given event is used.
window.scrollAnchorVisible = function(anchorName, tiddler, evt) {
var tiddlerElem = null;
if (tiddler) {
tiddlerElem = document.getElementById(story.idPrefix + tiddler);
}
if (!tiddlerElem && evt) {
var target = resolveTarget(evt);
tiddlerElem = story.findContainingTiddler(target);
}
if (!tiddlerElem) return;
var children = tiddlerElem.getElementsByTagName("a");
for (var i = 0; i < children.length; i++) {
var child = children[i];
var name = child.getAttribute("name");
if (name == anchorName) {
var y = findPosY(child);
window.scrollTo(0,y);
return;
}
}
}
} // of "install only once"
//}}}
/***
<html><sub><a href="javascript:;" onclick="scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
!Licence and Copyright
Copyright (c) abego Software ~GmbH, 2006 ([[www.abego-software.de|http://www.abego-software.de]])
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
Neither the name of abego Software nor the names of its contributors may be
used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
<html><sub><a href="javascript:;" onclick="scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
***/
<<newDocument "label:Print" "prompt:print an HTML snapshot of this tiddler" nofilename print here>>
<script>addthis_pub = 'huili';</script><html><a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s9.addthis.com/button1-share.gif" width="125" height="16" border="0" alt="" /></a></html><script src="http://s7.addthis.com/js/152/addthis_widget.js"></script>
!!Overview
Not aiming at provide an exhaustive list of work in the literature, we review a broad range of representative methodologies and techniques for performance predictions on computer systems. The first category of techniques is to build application models and machine profiles and combine them to estimate running times of applications~\cite{cao02performance,carrington03performance,taylor02using}. This approach requires direct knowledge of the internal design of the application and the machine architecture. Consequently there is no proven mechanism for predicting run times from the application and machine profiling data over a wide range of algorithms and architectures. Nevertheless, highly accurate predictions can be achieved by this method for the targeted applications and machines since detailed information is analyzed and incorporated. Combinations of analytic methods with statistical approaches are also proposed by leveraging the advantages of both methods while trying to overcome some of their limitations~\cite{bac05invest,iverson99statistical}.
The second category of techniques focuses on deriving predictions from historical observations. On time-sharing Unix machines and networks, the commonly-used performance metrics are CPU load~\cite{dinda00resource,yang03homeostatic} and network bandwidth~\cite{qiao04empirical,wolski99network}. Predictions of there metrics provide very useful information for scheduling distributed applications in such environments. CPU load or network traffic is typically sampled with a certain frequency to form a time series of data. Naturally time series models are well studied and applied for predictions~\cite{dinda00resource}. The strong autocorrelations in such series suggest that the methodology based on historical modeling will most likely work in practice~\cite{qiao04empirical}. It is also shown that the relationship between the host load and the execution time is almost linear therefore the estimates for run times can be easily obtained~\cite{dinda00resource}. Toolkits including sensors and predictors have been developed and are widely used in various application scenarios~\cite{dinda00resource,wolski99network}.
On space-shared parallel supercomputers and clusters, on the other hand, historical data takes the form of accounting logs or workload traces. The data objects (or "jobs"), consists of multiple attributes (or "features") such as user name, number of processors and run time. Database technologies are introduced in storage and management of performance data and a number of tools have been developed~\cite{huck05perfexplorer,karavanic05integrating,prodan04zenturio,taylor03prophesy}, some of which include data mining functionalities and prediction capabilities. However, the main focus of these research results is on the efficient design of systems leveraging databases for the performance analysis and diagnosis of parallel applications rather than performance predictions.
Two main performance metrics on space-shared resources are reviewed here, namely, //application run time// and //queue wait time//. A related metric is called //data transfer time//, which is important for scheduling in a data Grid and regression techniques are investigated for preditions~\cite{vazhkudai03using}. An early effort to predict application run times on space-shared environments is to make "templates" of job attributes to identify "similar" jobs in the historical data and apply statistical methods such as mean and linear regression to generate predictions~\cite{gibbons97historical}. In this research the "optimal" template(s) are predefined manually by expert information. An automated technique can generalize better and potentially achieve better prediction results. It is in~\cite{smith98predicting} that greedy search and genetic algorithms (GA) are empirically studied for automatic template definition. The objective function is to minimize the average prediction error and it is shown that GA is a preferable method. Techniques based on Instance Based Learning (IBL) have also been investigated for application run time predictions~\cite{kapadia99predictive}. IBL, or local learning techniques, use historical data near the query point to build a local model for approximation. A proper distance metric has to be defined to measure the "nearness" between data instances. In fact the IBL algorithm is a generalization of the template approach, in which distances are simplified to binary values (belong or not belong to a specific category).
Job queue wait time on a space-shared machine is generally more complicated and difficult to predict, involving various factors such as job attributes, the scheduling system, and the resource state (other running and queuing jobs). In~\cite{downey97predicting} the log-uniform distribution is used to fit the job life cycles, based on which the prediction of the queue wait time can be readily obtained by assuming first-come-first-serve (FCFS) scheduling. A recent publication~\cite{brevik06predicting} studies the queue wait time on a batch queue as a random variable and proposes a binomial method batch predictor (BMBP), which is a quantile-based method capable of generating bounds of queuing delays. Non-statistical methods are mostly based on simulations of schedulers. In~\cite{smith99using} scheduling algorithms like FCFS and backfilling are simulated for queue wait time predictions, where application run times are estimated using the "template" approach~\cite{smith98predicting}. In~\cite{li04predicting} simulation is used to predict queue wait times for a policy-driven scheduler so that the ~QoS for difference groups and users can be reflected. Although good prediction accuracy can be achieved, several major drawbacks exist for the simulation approach. Firstly, the simulation process can be very slow hence it cannot meet the requirement of real-time scheduling. Secondly, it cannot be generalized broadly since there are different types of local scheduling systems deployed on different resources in a heterogeneous environment. Some sites have schedulers with combinations of basic scheduling algorithms, and most sites enforce highly localized rules and policies.
We address the problem of performance prediction in a more general background, which is {\em knowledge discovery and learning from data}~\cite{hastie03elements}. From this perspective, the problem can be redefined as how efficiently the knowledge about local resource policies can be discovered from the performance data and what kind of metrics are potentially useful for interesting parties such as users and schedulers. This view not only incorporates commonly-used metrics such as applications run time and queue wait time, but also enables new metrics such as //effective capacity// to be introduced and evaluated. To work with multidimensional workload data with multiple attributes, a framework is needed within which metrics can be flexibly introduced and different machine learning techniques can be exploited. Local learning~\cite{atkeson97locally,loader04smoothing} provides such a framework. The keyword here is "localization". Just like "zooming in" data by specifying more attributes in a template approach, local learning finds similar patterns on-demand and builds a model locally based on these patterns. In complex situations with dynamically changing states and many possible configurations, this methodology has its advantages compared to global models. We refer to the following paper for the details of the algorithm design and performance.
[Li07] Hui Li. Machine Learning for Performance Predictions on ~Space-Shared Computing Environments. International Transactions on Systems Science and Applications, V3(3), pp 257-268, 2007.
!!PDM - a Performance Data Miner
PDM is a Java-based toolkit for mining the performance data in distributed computing environments such as Grids. Its goal is to extract useful information which can be used to improve performance and manage the system itself.
[[PDM design|http://www.liacs.nl/~hli/pdm/pdm.jpg]] in an UML class diagram.
The current release of PDM is 1.0beta. It is targeted for research and evaluation studies. No deployment and online prediction mode is supported at the moment. Download [[pdm_1.0_beta.tar.gz|http://www.liacs.nl/~hli/pdm/pdm_1.0_beta.tar.gz]]
<<newDocument "label:Print" "prompt:print an HTML snapshot of this tiddler" nofilename print here>>
<script>addthis_pub = 'huili';</script><html><a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s9.addthis.com/button1-share.gif" width="125" height="16" border="0" alt="" /></a></html><script src="http://s7.addthis.com/js/152/addthis_widget.js"></script>
<script>
if (!window.story) window.story=window;
var title=story.findContainingTiddler(place).getAttribute("tiddler");
var t = encodeURIComponent(String.encodeTiddlyLink(title));
if(window.location.hash != t) window.location.hash = t;
</script>
[[Workload Characterization, Modeling, and Prediction in Grid Computing|http://www.liacs.nl/~hli/doc/thesis.pdf]]
Hui Li
Thesis Universiteit Leiden
ISBN: 978-90-9022674-3
!!Motivation
Experimental performance studies on computer systems, including Grids, require deep understanding
of the workload characteristics. In many challenges in Grid scheduling and performance evaluation, there are two of particular interest. Firstly, the design and development of effective scheduling strategies for Grids are mostly done via simulations. And simulation of scheduling algorithms requires representative workloads to produce dependable results. It is shown that getting the workloads right makes a big difference in terms of performance evaluation results. Secondly, Grid-level resource brokers do not have
control over the computing resources. Instead, the scheduling decisions are made based on the information available about the resources. It becomes crucial that this information is of high quality, especially concerning the dynamic state of a resource. Effective and efficient predictions of important performance metrics on the resources are needed for good decisions at the Grid level.
Naturally workloads play a central role in addressing the two challenges presented above. There are two levels of workload data collected in production Grids which are under investigation. One is the accounting logs from the local batch system on the cluster and the other draws from a global monitoring service which collects job information at the Grid level. After some preprocessing the workload formats are similar at both levels. Workload contains job objects, and jobs have multiple attributes such as name, user, submission time, run time, and so on. The question is how well we understand the data and what we can do about it. Corresponding to the two challenges the research arises from two important and closely-related topics, namely, workload modeling and performance prediction. Workload modeling aims at building mathematical models to generate synthetic workloads, which can be used in performance evaluation of scheduling strategies. The model should statistically resemble the original real workload data therefore marginal statistics and second-order properties such as autocorrelation and scaling are important matching criteria. Performance prediction, on the other hand, is to apply statistical learning techniques on historical workload data for providing real-time forecast of performance metrics. From this perspective prediction accuracy as well as speed should be considered to evaluate candidate techniques. Although the goals and approaches differ considerably, both modeling and prediction rely heavily on the representative workload data and methodologies from statistics and machine learning.
!!Main Contributions
1. //A comprehensive workload characterization is carried out for clusters and Grids, with emphasis on the correlation structures and the scaling behavior.//
To the author’s best knowledge this is the first statistical study on real production workloads at the cluster, Grid, and Virtual Organization level. A deep understanding of the dynamics of data-intensive Grid jobs is obtained. This leads to the identification of several important workload patterns, including pseudo-periodicity, long range dependence, and the "bag-of-tasks" behavior with strong temporal locality. These salient properties are not present in parallel workloads on conventional supercomputers. By studying the different representations of point processes it is shown that statistical measures based on interarrivals are of limited usefulness when it comes to autocorrelations and count based measures should be trusted instead.
2. //Workload models are developed to reproduce the important statistical properties, especially the temporal correlations.//
Firstly, pseudo-periodic job arrivals are successfully analyzed and modeled via matching pursuit. Secondly long range dependence is modeled by the Multifractal Wavelet Model (MWM) and a full arrival model is derived. Thirdly, a new model is developed for job attributes that can not only fit the distribution but also generate comparable autocorrelations. The locality in the real workload data can be well preserved. By combining these models realistic synthetic workloads can be generated for performance evaluation studies. A majority of previous research results on parallel workloads, on the other hand, focus mainly on marginal distributions and first order statistics while correlations and second order properties receive far less attention. This research shows that temporal burstiness (autocorrelation) is equally important compared to amplitude burstiness (heavy tails) from a modeling perspective.
3. //Performance impacts of workload correlations are quantified via simulations.//
The results indicate that autocorrelations in workloads result in worse system performance, both at the local and the Grid level. The performance degradation can be up to several orders of magnitude under long range dependence. It is shown that realistic workload modeling is indeed necessary to enable dependable performance evaluation studies. This research presents a first attempt in quantifying the impacts of temporal correlations for both arrivals and run times in a Grid environment. As is shown later, temporal burstiness results in worse performance at the cluster level. However, it is not necessarily a bad situation for Grid-level schedulers since the non-bursty periods can be exploited for better load balancing at the Grid level. This points out an interesting research direction of scheduling under autocorrelations.
4. //A local learning framework is proposed for performance predictions on space-shared computing environments and a set of techniques are developed for improving prediction accuracy and performance.//
Local learning techniques have been studied for application run time predictions. In this research new measures such as resource state similarity are introduced to enable predictions for queue wait times using the same technique. Under the local learning framework new performance metrics such as effective capacity are defined and qualitatively evaluated. A set of improvements for predictions are proposed and quantitatively evaluated, all leading to better and faster predictions. These include a genetic algorithm and adaptive tuning for parameter optimization, and a ~M-Tree structure for efficient nearest neighbor search.
[[The Complete Thesis in PDF format|http://www.liacs.nl/~hli/doc/thesis.pdf]]
/***
|Name|Plugin: jsMath|
|Created by|BobMcElrath|
|Email|my first name at my last name dot org|
|Location|http://bob.mcelrath.org/tiddlyjsmath.html|
|Version|1.5.1|
|Requires|[[TiddlyWiki|http://www.tiddlywiki.com]] ≥ 2.0.3, [[jsMath|http://www.math.union.edu/~dpvc/jsMath/]] ≥ 3.0|
!Description
LaTeX is the world standard for specifying, typesetting, and communicating mathematics among scientists, engineers, and mathematicians. For more information about LaTeX itself, visit the [[LaTeX Project|http://www.latex-project.org/]]. This plugin typesets math using [[jsMath|http://www.math.union.edu/~dpvc/jsMath/]], which is an implementation of the TeX math rules and typesetting in javascript, for your browser. Notice the small button in the lower right corner which opens its control panel.
!Installation
In addition to this plugin, you must also [[install jsMath|http://www.math.union.edu/~dpvc/jsMath/download/jsMath.html]] on the same server as your TiddlyWiki html file. If you're using TiddlyWiki without a web server, then the jsMath directory must be placed in the same location as the TiddlyWiki html file.
I also recommend modifying your StyleSheet use serif fonts that are slightly larger than normal, so that the math matches surrounding text, and \\small fonts are not unreadable (as in exponents and subscripts).
{{{
.viewer {
line-height: 125%;
font-family: serif;
font-size: 12pt;
}
}}}
If you had used a previous version of [[Plugin: jsMath]], it is no longer necessary to edit the main tiddlywiki.html file to add the jsMath <script> tag. [[Plugin: jsMath]] now uses ajax to load jsMath.
!History
* 11-Nov-05, version 1.0, Initial release
* 22-Jan-06, version 1.1, updated for ~TW2.0, tested with jsMath 3.1, editing tiddlywiki.html by hand is no longer necessary.
* 24-Jan-06, version 1.2, fixes for Safari, Konqueror
* 27-Jan-06, version 1.3, improved error handling, detect if ajax was already defined (used by ZiddlyWiki)
* 12-Jul-06, version 1.4, fixed problem with not finding image fonts
* 26-Feb-07, version 1.5, fixed problem with Mozilla "unterminated character class".
* 27-Feb-07, version 1.5.1, Runs compatibly with TW 2.1.0+, by Bram Chen
!Examples
|!Source|!Output|h
|{{{The variable $x$ is real.}}}|The variable $x$ is real.|
|{{{The variable \(y\) is complex.}}}|The variable \(y\) is complex.|
|{{{This \[\int_a^b x = \frac{1}{2}(b^2-a^2)\] is an easy integral.}}}|This \[\int_a^b x = \frac{1}{2}(b^2-a^2)\] is an easy integral.|
|{{{This $$\int_a^b \sin x = -(\cos b - \cos a)$$ is another easy integral.}}}|This $$\int_a^b \sin x = -(\cos b - \cos a)$$ is another easy integral.|
|{{{Block formatted equations may also use the 'equation' environment \begin{equation} \int \tan x = -\ln \cos x \end{equation} }}}|Block formatted equations may also use the 'equation' environment \begin{equation} \int \tan x = -\ln \cos x \end{equation}|
|{{{Equation arrays are also supported \begin{eqnarray} a &=& b \\ c &=& d \end{eqnarray} }}}|Equation arrays are also supported \begin{eqnarray} a &=& b \\ c &=& d \end{eqnarray} |
|{{{I spent \$7.38 on lunch.}}}|I spent \$7.38 on lunch.|
|{{{I had to insert a backslash (\\) into my document}}}|I had to insert a backslash (\\) into my document|
!Code
***/
//{{{
// AJAX code adapted from http://timmorgan.org/mini
// This is already loaded by ziddlywiki...
if(typeof(window["ajax"]) == "undefined") {
ajax = {
x: function(){try{return new ActiveXObject('Msxml2.XMLHTTP')}catch(e){try{return new ActiveXObject('Microsoft.XMLHTTP')}catch(e){return new XMLHttpRequest()}}},
gets: function(url){var x=ajax.x();x.open('GET',url,false);x.send(null);return x.responseText}
}
}
// Load jsMath
jsMath = {
Setup: {inited: 1}, // don't run jsMath.Setup.Body() yet
Autoload: {root: new String(document.location).replace(/[^\/]*$/,'jsMath/')} // URL to jsMath directory, change if necessary
};
var jsMathstr;
try {
jsMathstr = ajax.gets(jsMath.Autoload.root+"jsMath.js");
} catch(e) {
alert("jsMath was not found: you must place the 'jsMath' directory in the same place as this file. "
+"The error was:\n"+e.name+": "+e.message);
throw(e); // abort eval
}
try {
window.eval(jsMathstr);
} catch(e) {
alert("jsMath failed to load. The error was:\n"+e.name + ": " + e.message + " on line " + e.lineNumber);
}
jsMath.Setup.inited=0; // allow jsMath.Setup.Body() to run again
// Define wikifers for latex
config.formatterHelpers.mathFormatHelper = function(w) {
var e = document.createElement(this.element);
e.className = this.className;
var endRegExp = new RegExp(this.terminator, "mg");
endRegExp.lastIndex = w.matchStart+w.matchLength;
var matched = endRegExp.exec(w.source);
if(matched) {
var txt = w.source.substr(w.matchStart+w.matchLength,
matched.index-w.matchStart-w.matchLength);
if(this.keepdelim) {
txt = w.source.substr(w.matchStart, matched.index+matched[0].length-w.matchStart);
}
e.appendChild(document.createTextNode(txt));
w.output.appendChild(e);
w.nextMatch = endRegExp.lastIndex;
}
}
config.formatters.push({
name: "displayMath1",
match: "\\\$\\\$",
terminator: "\\\$\\\$\\n?", // 2.0 compatability
termRegExp: "\\\$\\\$\\n?",
element: "div",
className: "math",
handler: config.formatterHelpers.mathFormatHelper
});
config.formatters.push({
name: "inlineMath1",
match: "\\\$",
terminator: "\\\$", // 2.0 compatability
termRegExp: "\\\$",
element: "span",
className: "math",
handler: config.formatterHelpers.mathFormatHelper
});
var backslashformatters = new Array(0);
backslashformatters.push({
name: "inlineMath2",
match: "\\\\\\\(",
terminator: "\\\\\\\)", // 2.0 compatability
termRegExp: "\\\\\\\)",
element: "span",
className: "math",
handler: config.formatterHelpers.mathFormatHelper
});
backslashformatters.push({
name: "displayMath2",
match: "\\\\\\\[",
terminator: "\\\\\\\]\\n?", // 2.0 compatability
termRegExp: "\\\\\\\]\\n?",
element: "div",
className: "math",
handler: config.formatterHelpers.mathFormatHelper
});
backslashformatters.push({
name: "displayMath3",
match: "\\\\begin\\{equation\\}",
terminator: "\\\\end\\{equation\\}\\n?", // 2.0 compatability
termRegExp: "\\\\end\\{equation\\}\\n?",
element: "div",
className: "math",
handler: config.formatterHelpers.mathFormatHelper
});
// These can be nested. e.g. \begin{equation} \begin{array}{ccc} \begin{array}{ccc} ...
backslashformatters.push({
name: "displayMath4",
match: "\\\\begin\\{eqnarray\\}",
terminator: "\\\\end\\{eqnarray\\}\\n?", // 2.0 compatability
termRegExp: "\\\\end\\{eqnarray\\}\\n?",
element: "div",
className: "math",
keepdelim: true,
handler: config.formatterHelpers.mathFormatHelper
});
// The escape must come between backslash formatters and regular ones.
// So any latex-like \commands must be added to the beginning of
// backslashformatters here.
backslashformatters.push({
name: "escape",
match: "\\\\.",
handler: function(w) {
w.output.appendChild(document.createTextNode(w.source.substr(w.matchStart+1,1)));
w.nextMatch = w.matchStart+2;
}
});
config.formatters=backslashformatters.concat(config.formatters);
window.wikify = function(source,output,highlightRegExp,tiddler)
{
if(source && source != "") {
if(version.major == 2 && version.minor > 0) {
var wikifier = new Wikifier(source,getParser(tiddler),highlightRegExp,tiddler);
wikifier.subWikifyUnterm(output);
} else {
var wikifier = new Wikifier(source,formatter,highlightRegExp,tiddler);
wikifier.subWikify(output,null);
}
jsMath.ProcessBeforeShowing();
}
}
//}}}
<script>addthis_pub = 'huili';</script><html><a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s9.addthis.com/button1-share.gif" width="125" height="16" border="0" alt="" /></a></html><script src="http://s7.addthis.com/js/152/addthis_widget.js"></script>
<script>
if (!window.story) window.story=window;
var title=story.findContainingTiddler(place).getAttribute("tiddler");
var t = encodeURIComponent(String.encodeTiddlyLink(title));
if(window.location.hash != t) window.location.hash = t;
</script>
<html>
<li>
<p>Modeling Correlated Workloads by Combining Model Based Clustering and A Localized Sampling Algorithm.<br />
ICS'07, Seattle, USA, Jun 16, 2007.</p>
</li>
<li>
<p>Analysis and Synthesis of Pseudo-Periodic Job Arrivals in Grids: A Matching Pursuit Approach.<br />
CCGrid'07, Rio de Janeiro, Brazil, May 15, 2007.</p>
</li>
<li>
<p><a href="http://www.dsse.monash.edu.au/">Performance Evaluation Meets Statistical Learning in Grid Computing Environments</a>.<br />
Invited talk in Centre for Distributed Systems and Software Engineering (DSSE), Monash University, Apr 13, 2007.</p>
</li>
<li>
<p>Towards A Better Understanding of Workload Dynamics on Data-Intensive Clusters and Grids.<br />
IPDPS'07, Long Beach, CA, USA, Mar 27, 2007. </p>
</li>
<li>
<p><a href="http://www.liacs.nl/%7Ehli/doc/eScience06.ppt">Job Failure Analysis and Its Implications in a Large-scale Production Grid</a>. <br />
eScience'06, Amsterdam, The Netherlands, Dec 5, 2006.</p>
</li>
<li>
<p><a href="http://www.liacs.nl/%7Ehli/doc/jsspp06.ppt">Modeling Job Arrivals in a Data-Intensive Grid</a>. <br />
JSSPP, Saint-Malo, France, Jun 26, 2006. </p>
</li>
<li>
<p><a href="http://www.liacs.nl/%7Ehli/doc/ccgrid06.rar">Improving a Local Learning Technique for Queue Wait Time Predictions</a>. <br />
IEEE CCGrid'06, Singapore, May 17, 2006. </p>
</li>
<li>
<p><a href="http://www.liacs.nl/%7Ehli/doc/ICT_Biz_Talk_Mar_1st_2006.ppt">Service Oriented Grid Architecture</a>. <br />
Invited talk in Grid Computing, ICT in Business Colloquium, LIACS, Leiden, March 1st, 2006. </p>
</li>
<li>
<p><a href="http://www.liacs.nl/%7Ehli/doc/grid05.ppt">Efficient Response Time Predictions by Exploiting Application and Resource State Similarities</a>. <br />
<em>IEEE/ACM Grid'05</em>, Seattle, WA, USA, Nov 14, 2005.</p>
</li>
<li>
<p><a href="http://www.liacs.nl/%7Ehli/doc/gnarp05.ppt">Collaborative Campus Grid - Practices and Experiences in Leiden University Campus Grid (LUCGrid)</a>. <em><br />
12th ASCI Computing Workshop (GNARP)</em>, Garderen, The Netherlands, February 5, 2005.</p>
</li>
<li>
<p><a href="http://www.liacs.nl/%7Ehli/doc/jsspp-10.pdf">Workload Characteristics of a Multi-cluster Supercomputer</a>. <br />
JSSPP, New York, USA, June 13, 2004.</p>
</li>
<li>
<p><a href="http://www.liacs.nl/%7Ehli/doc/ccgrid04.ppt">Predicting Job Start Times on Clusters</a>. <br />
CCGrid2004, Chicago, USA, April 21, 2004.</p>
</li>
<li>
<p><a href="http://www.liacs.nl/%7Ehli/doc/gnarp_workload.ppt">Workloads, Performance, and Runtime Predictions in the Grid</a>. <br />
<em>11th ASCI Computing Workshop (GNARP)</em>, Renesse, The Netherlands, March, 2004.</p>
</li>
<li>
<p> Notes on <a href="http://www.liacs.nl/%7Ehli/doc/gs_discuss.ppt">Grid Security</a>, <a href="http://www.liacs.nl/%7Ehli/doc/is.ppt">Information Services</a>. <br />
NIKHEF, Dec 2, 2003.</p>
</li>
<li>
<p><a href="http://www.liacs.nl/%7Ehli/doc/optimization.ppt">Code Optimization Using Z-Polyhedron</a>. <br />
CSERC group meeting, March 28, 2002. </p>
</li>
</html>
[[Selected Publications]]
!!!Service Computing
<html><strong>Hui Li</strong></html>, G. Casale, T. Ellahi. ~SLA-Driven Planning and Optimization of Enterprise Applications. In proceedings of <html><em>1st joint ACM WOSP/SIPEW Intl. Conference on Performance Engineering</em></html>, San Jose, USA, Jan 2010, to appear.
<html><strong>Hui Li</strong></html> and Daniel Scheibli. On Cost Modeling of Hosted OLTP Applications. In proceedings of <html><em>1st Intl. Conference on Cloud Computing</em></html>, Munich, Germany, Oct 2009.
<html><strong>Hui Li</strong></html>, W. Theilmann, J. Happe. <html><a href="http://digbib.ubka.uni-karlsruhe.de/volltexte/documents/889999" target="_blank">SLA Translation in Multi-Layered Service-Oriented Architectures: Status and Challenges</a></html>. <html><em>Univ. Karlsruhe Tech. Report IB 2009-8</em></html>, under review.
Jens Happe, <html><strong>Hui Li</strong></html>, and Wolfgang Theilmann. ~Black-Box Performance Models: Prediction based on Observation. In proceedings of <html><em>1st International Workshop on the Quality of Service-Oriented Software Systems (QUASOSS)</em></html>, Amsterdam, Jan 2009.
!!!Scheduling and Resource Management
<html><strong>Hui Li</strong></html>. Realistic Workload Modeling and Its Performance Impacts in Large Scale eScience Grids. <html><em>IEEE Transactions on Parallel and Distributed Systems</em></html>, in print, 2009.
A. v.d. Kuijl, M. Emmerich, <html><strong>Hui Li</strong></html>. A Robust ~Multi-Objective Resource Allocation Scheme Incorporating Uncertainty and Service Level Differentiation. Invited in a special issue of <html><em>Concurrency and Computation: Practice & Experience</em></html>, Wiley, 2009.
A. v.d. Kuijl, M. Emmerich, <html><strong>Hui Li</strong></html>. A New ~Multi-Objective Optimization Scheme for Grid Resource Allocation. In proceedings of <html><em>ACM/IFIP/USENIX Middleware Conference, 6th Workshop on Middleware for Grid Computing</em></html>, Dec 1-5 2008, Leuven Belgium, ACM Press.
!!!Performance Evaluation
<html><strong>Hui Li</strong></html>, Rajkumar Buyya. <html><a href="http://dx.doi.org/10.1016/j.future.2008.09.012" target="_blank">Model-Based Simulation and Performance Evaluation of Grid Scheduling Strategies</a></html>. Invited in a special issue of <html><em>Future Generation Computer Systems 25, pp. 460-465</em></html>, Elsevier, 2009.
<html><strong>Hui Li</strong></html>, Rajkumar Buyya. <html><a href="http://www.liacs.nl/~hli/doc/li07simulation.pdf" target="_blank">Model-Driven Simulation of Grid Scheduling Strategies</a></html>. In proceedings of <html><em>3rd IEEE International Conference on e-Science and Grid Computing (eScience07)</em></html>. Bangalore, India, Dec 10 - 13, 2007, IEEE CS Press (<html><span class="style2">Best Paper Award</span></html>).
<html><strong>Hui Li</strong></html>. <html><a href="http://www.liacs.nl/~hli/doc/li07long.pdf" target="_blank">Long Range Dependent Job Arrival Process and Its Implications in Grid Environments</a></html>. In proceedings of <html><em>MetroGrid Workshop, 1st International Conference on Networks for Grid Applications (GridNets07)</em></html>, Lyon, France, October 17-19, 2007, ACM Press.
!!!Grid Workload Modeling
<html><strong>Hui Li</strong></html>, Michael Muskulus, Lex Wolters. <html><a href="http://www.liacs.nl/~hli/doc/li07modelLocalMBC.pdf" target="_blank">Modeling Correlated Workloads by Combining Model Based Clustering and A Localized Sampling Algorithm</a></html>. In Proceedings of <html><em>21st ACM International Conference on Supercomputing (ICS07)</em></html>, Seattle, USA, June 16-20, 2007, ACM Press.
<html><strong>Hui Li</strong></html>, Michael Muskulus, Lex Wolters. A Novel Algorithm for Generating Correlated Workload Attributes. In proceedings of <html><em>13th Annual Conference of the Advance School for Computing and Imaging (ASCI)</em></html>, Heijen, the Netherlands, June 13-15, 2007.
<html><strong>Hui Li</strong></html>, Michael Muskulus, Lex Wolters. <html><a href="http://www.liacs.nl/~hli/doc/li07_fractalLRD.pdf" target="_blank">Modeling Long Range Dependent and Fractal Job Traffic in Data-Intensive Grids</a></html>. Technical Report TR No. 2007-03, Leiden Institute of Advanced Computer Science, April, 2007.
<html><strong>Hui Li</strong></html>, Richard Heusdens, Michael Muskulus, Lex Wolters. <html><a href="http://www.liacs.nl/~hli/doc/pseudo_periodic.pdf" target="_blank">Analysis and Synthesis of Pseudo-Periodic Job Arrivals in Grids: A Matching Pursuit Approach</a></html>. In proceedings of <html><em>7th IEEE International Symposium on Cluster Computing and the Grid (CCGrid07)</em></html>, Rio de Janeiro, Brazil, May 14-17, 2007, IEEE Computer Society Press.
<html><strong>Hui Li</strong></html> and Michael Muskulus. <html><a href="http://www.liacs.nl/~hli/doc/per06.pdf" target="_blank">Analysis and Modeling of Job Arrivals in a Production Grid</a></html>. <html><em>ACM Sigmetrics Performance Evaluation Review</em></html>, 34(4), pp 59-70, March 2007.
<html><strong>Hui Li</strong></html>, Michael Muskulus, Lex Wolters. <html><a href="http://www.liacs.nl/~hli/doc/jobarrivals06.pdf" target="_blank">Modeling Job Arrivals in a Data-Intensive Grid</a></html>. In proceedings of <html><em>12th International Workshop on Job Scheduling Strategies for Parallel Processing (JSSPP)</em></html>, Saint Malo, France, Jun, 2006, Selected and revised papers, LNCS 4376 pp 210-231, Springer.
!!!Workload Analysis and Characterization
<html><strong>Hui Li</strong></html>. <html><a href="http://www.liacs.nl/~hli/doc/wldynamics.pdf">Workload Dynamics on Clusters and Grids</a></html>. <html><em>Journal of Supercomputing</em></html>, V 47(1), pp 1-20, Springer, 2009.
A. Iosup, <html><strong>Hui Li</strong></html>, Mathieu Jan, Shanny Anoep, C. Dumitrescu, Lex Wolters, and Dick Epema. <html><a href="http://www.pds.ewi.tudelft.nl/~iosup/GWA_FGCS.pdf" target="_blank">The Grid Workloads Archive</a></html>. <html><em>Future Generation Computer Systems</em></html>, Elsevier, accepted.
<html><strong>Hui Li</strong></html>, Lex Wolters. <html><a href="http://www.liacs.nl/~hli/doc/li_ipdps07.pdf" target="_blank">Towards A Better Understanding of Workload Dynamics on Data-intensive Clusters and Grids</a></html>. In proceedings of <html><em>21st IEEE International Parallel and Distributed Processing Symposium (IPDPS)</em></html>, Long Beach, California, USA, March 26 - 30, 2007, IEEE Computer Society Press.
<html><strong>Hui Li</strong></html>, David Groep, Lex Wolters, Jeff Templon. <html><a href="http://www.liacs.nl/~hli/doc/failure_analysis06.pdf" target="_blank">Job Failure Analysis and Its Implications in a Large-scale Production Grid</a></html>. In proceedings of <html><em>2nd IEEE International Conference on e-Science and Grid Computing (eScience06)</em></html>, Amsterdam, The Netherlands, Dec 4 - 6, 2006. IEEE Computer Society Press.
A. Iosup, C. Dumitrescu, D. Epema, <html><strong>Hui Li</strong></html>, and L. Wolters. <html><a href="http://www.liacs.nl/~hli/doc/PDS-2006-003.pdf" target="_blank">How Are Real Grids Used? The Analysis of Four Grid Traces and Its Implications</a></html>. In proceedings of <html><em>7th IEEE/ACM International Conference on Grid Computing (Grid2006)</em></html>, Barcelona, Spain, Sep 28-29, 2006, IEEE Computer Society Press.
<html><strong>Hui Li</strong></html>, David Groep, Lex Wolters. <html><a href="http://www.liacs.nl/~hli/doc/workload_jsspp.pdf" target="_blank">Workload Characteristics of a Multi-cluster Supercomputer</a></html>. In proceedings of <html><em>10th International Workshop on Job Scheduling Strategies for Parallel Processing (JSSPP)</em></html>, New York, 2004. Selected and revised papers, LNCS 3277, pp 176-193, Springer, 2005.
<html><strong>Hui Li</strong></html>, David Groep, and Lex Wolters. <html><a href="http://www.liacs.nl/~hli/doc/workload_das2_asci.pdf" target="_blank">Workload Characteristics of the DAS-2 Supercomputer</a></html>. In proceedings of <html><em>10th Annual Conference of the Advance School for Computing and Imaging (ASCI)</em></html>, Ouddrop, the Netherlands, June, 2004.
!!!Performance Predictions
<html><strong>Hui Li</strong></html>. <html><a href="http://www.liacs.nl/~hli/doc/li07machine.pdf" target="_blank">Machine Learning for Performance Predictions on Space-Shared Computing Environments</a></html>. <html><em>International Transactions on Systems Science and Applications</em></html>, V3(3), pp 257-268, ISSN 1751-1461, invited paper.
<html><strong>Hui Li</strong></html>, David Groep, Lex Wolters. <html><a href="http://www.liacs.nl/~hli/doc/mpmsg_revised.pdf" target="_blank">Mining Performance Data for Metascheduling Decision Support in the Grid</a></html>. <html><em>Future Generation Computer Systems</em></html> 23, pp 92-99, Elsevier, 2007.
<html><strong>Hui Li</strong></html> and Lex Wolters. <html><a href="http://www.liacs.nl/~hli/doc/li06invest.pdf" target="_blank">An Investigation of Grid Performance Predictions through Statistical Learning</a></html>. In proceedings of <html><em>1st Workshop on Tackling Computer System Problems with Machine Learning Techniques (SysML)</em></html>, in conjunction with ACM Sigmetrcs, Saint-Malo, France, 2006.
<html><strong>Hui Li</strong></html>, Juan Chen, Ying Tao, David Groep, and Lex Wolters. <html><a href="http://www.liacs.nl/~hli/doc/li06improving.pdf" target="_blank">Improving a Local Learning Technique for Queue Wait Time Predictions</a></html>. In proceedings of <html><em>6th IEEE International Symposium on Cluster Computing and the Grid (CCGrid'06)</em></html>, Singapore, May, 2006, IEEE Computer Society Press.
<html><strong>Hui Li</strong></html>, David Groep, Lex Wolters. <html><a href="http://www.liacs.nl/~hli/doc/rtprss.pdf" target="_blank">Efficient Response Time Predictions by Exploiting Application and Resource State Similarities</a></html>. In proceedings of <html><em>6th IEEE/ACM International Workshop on Grid Computing (Grid2005)</em></html>, in conjunction with SC'05, Seattle, Washington, USA, 2005, IEEE Computer Society Press.
<html><strong>Hui Li</strong></html>, David Groep, Lex Wolters. <html><a href="http://www.liacs.nl/~hli/doc/evalRunTime.pdf" target="_blank">An Evaluation of Learning and Heuristic Techniques for Application Run Time Predictions</a></html>. In proceedings of <html><em>11th Annual Conference of the Advance School for Computing and Imaging (ASCI)</em></html>, Heijen, the Netherlands, June, 2005.
<html><strong>Hui Li</strong></html>, David Groep, Jeff Templon, and Lex Wolters. <html><a href="http://www.liacs.nl/~hli/doc/stp.pdf" target="_blank">Predicting Job Start Times on Clusters</a></html>. In proceedings of <html><em>4th IEEE/ACM International Symposium on Cluster Computing and the Grid (CCGrid2004)</em></html>, Chicago, Illinois, USA, April, 2004, IEEE Computer Society Press.
!!!General
<html><strong>Hui Li</strong></html>. <html><a href="http://www.liacs.nl/~hli/doc/tcscDocSym07.pdf" target="_blank">Performance Evaluation in Grid Computing: A Modeling and Prediction Perspective</a></html>. In proceedings of <html><em>1st IEEE TCSC Doctoral Symposium</em></html>, in conjunction with ~CCGrid07, Rio de Janeiro, Brazil, May 2007, IEEE Computer Society Press.
!!!Technical Reports
<html><strong>Hui Li</strong></html>. <html><a href="http://www.liacs.nl/~hli/doc/thesis.pdf" target="_blank">Workload Characterization, Modeling and Prediction in Grid Computing</a></html>. ~PhD Thesis, LIACS, Leiden University, 2007.
<html><strong>Hui Li</strong></html>. Predicting Job Start Times on Clusters. ~MSc Thesis, LIACS, Leiden University, 2003.
<html><strong>Hui Li</strong></html>. <html><a href="http://www.liacs.nl/~hli/doc/optimization.pdf" target="_blank">Code Optimization Using Z-Polyhedron in the Compaan Toolchain</a></html>. CSERC Report, LIACS, Leiden University, March 28, 2002.
/***
|Name|SearchOptionsPlugin|
|Source|http://www.TiddlyTools.com/#SearchOptionsPlugin|
|Documentation|http://www.TiddlyTools.com/#SearchOptionsPluginInfo|
|Version|2.6.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.search, TiddlyWiki.prototype.search, config.macros.search.onKeyPress|
|Description|extend core search function with additional user-configurable options|
Extend core search function with additional user-configurable options including generating a ''list of matching tiddlers'' instead of immediately displaying all matches.
!!!!!Documentation
>see [[SearchOptionsPluginInfo]]
!!!!!Configuration
<<<
<<option chkSearchTitles>> Search in titles
<<option chkSearchText>> Search in tiddler text
<<option chkSearchTags>> Search in tags
<<option chkSearchFields>> Search in data fields
<<option chkSearchShadows>> Search shadow tiddlers
<<option chkSearchTitlesFirst>> Show title matches first
<<option chkSearchByDate>> Sort matching tiddlers by date
<<option chkSearchList>> Show list of matches in [[SearchResults]]
<<option chkSearchIncremental>> Incremental (key-by-key) searching
<<<
!!!!!Revisions
<<<
2007.02.17 [2.6.1] added redefinition of config.macros.search.onKeyPress() to restore check to bypass key-by-key searching (i.e., when chkSearchIncremental==false), which had been unintentionally removed with v2.6.0
|please see [[SearchOptionsPluginInfo]] for additional revision details|
2005.10.18 [1.0.0] Initial Release
<<<
!!!!!Code
***/
//{{{
version.extensions.searchOptions = {major: 2, minor: 6, revision: 1, date: new Date(2007,2,17)};
if (config.options.chkSearchTitles===undefined) config.options.chkSearchTitles=true;
if (config.options.chkSearchText===undefined) config.options.chkSearchText=true;
if (config.options.chkSearchTags===undefined) config.options.chkSearchTags=true;
if (config.options.chkSearchFields===undefined) config.options.chkSearchFields=true;
if (config.options.chkSearchTitlesFirst===undefined) config.options.chkSearchTitlesFirst=false;
if (config.options.chkSearchList===undefined) config.options.chkSearchList=false;
if (config.options.chkSearchByDate===undefined) config.options.chkSearchByDate=false;
if (config.options.chkSearchIncremental===undefined) config.options.chkSearchIncremental=true;
if (config.options.chkSearchShadows===undefined) config.options.chkSearchShadows=false;
if (config.optionsDesc) {
config.optionsDesc.chkSearchTitles="Search in tiddler titles";
config.optionsDesc.chkSearchText="Search in tiddler text";
config.optionsDesc.chkSearchTags="Search in tiddler tags";
config.optionsDesc.chkSearchFields="Search in tiddler data fields";
config.optionsDesc.chkSearchShadows="Search in shadow tiddlers";
config.optionsDesc.chkSearchTitlesFirst="Search results show title matches first";
config.optionsDesc.chkSearchList="Search results show list of matching tiddlers";
config.optionsDesc.chkSearchByDate="Search results sorted by modification date ";
config.optionsDesc.chkSearchIncremental="Incremental searching";
} else {
config.shadowTiddlers.AdvancedOptions += "\n<<option chkSearchTitles>> Search in tiddler titles"
+"\n<<option chkSearchText>> Search in tiddler text"
+"\n<<option chkSearchTags>> Search in tiddler tags"
+"\n<<option chkSearchFields>> Search in tiddler data fields"
+"\n<<option chkSearchShadows>> Search in shadow tiddlers"
+"\n<<option chkSearchTitlesFirst>> Search results show title matches first"
+"\n<<option chkSearchList>> Search results show list of matching tiddlers"
+"\n<<option chkSearchByDate>> Search results sorted by modification date"
+"\n<<option chkSearchIncremental>> Incremental searching";
}
if (config.macros.search.reportTitle==undefined)
config.macros.search.reportTitle="SearchResults";
config.macros.search.onKeyPress = function(e)
{
if(!e) var e = window.event;
switch(e.keyCode)
{
case 13: // Ctrl-Enter
case 10: // Ctrl-Enter on IE PC
config.macros.search.doSearch(this);
break;
case 27: // Escape
this.value = "";
clearMessage();
break;
}
if (config.options.chkSearchIncremental) {
if(this.value.length > 2)
{
if(this.value != this.getAttribute("lastSearchText"))
{
if(config.macros.search.timeout)
clearTimeout(config.macros.search.timeout);
var txt = this;
config.macros.search.timeout = setTimeout(function() {config.macros.search.doSearch(txt);},500);
}
}
else
{
if(config.macros.search.timeout)
clearTimeout(config.macros.search.timeout);
}
}
}
//}}}
//{{{
Story.prototype.search = function(text,useCaseSensitive,useRegExp)
{
highlightHack = new RegExp(useRegExp ? text : text.escapeRegExp(),useCaseSensitive ? "mg" : "img");
var matches = store.search(highlightHack,config.options.chkSearchByDate?"modified":"title","excludeSearch");
if (config.options.chkSearchByDate) matches=matches.reverse(); // most recent changes first
var q = useRegExp ? "/" : "'";
clearMessage();
if (!matches.length) {
if (config.options.chkSearchList) discardSearchResults();
displayMessage(config.macros.search.failureMsg.format([q+text+q]));
} else {
if (config.options.chkSearchList)
reportSearchResults(text,matches);
else {
var titles = []; for(var t=0; t<matches.length; t++) titles.push(matches[t].title);
this.closeAllTiddlers(); story.displayTiddlers(null,titles);
displayMessage(config.macros.search.successMsg.format([matches.length, q+text+q]));
}
}
highlightHack = null;
}
TiddlyWiki.prototype.search = function(searchRegExp,sortField,excludeTag)
{
var candidates = this.reverseLookup("tags",excludeTag,false,sortField);
// scan for matching titles first...
var results = [];
if (config.options.chkSearchTitles) {
for(var t=0; t<candidates.length; t++)
if(candidates[t].title.search(searchRegExp)!=-1)
results.push(candidates[t]);
if (config.options.chkSearchShadows)
for (var t in config.shadowTiddlers)
if ((t.search(searchRegExp)!=-1) && !store.tiddlerExists(t))
results.push((new Tiddler()).assign(t,config.shadowTiddlers[t]));
}
// then scan for matching text, tags, or field data
for(var t=0; t<candidates.length; t++) {
if (config.options.chkSearchText && candidates[t].text.search(searchRegExp)!=-1)
results.pushUnique(candidates[t]);
if (config.options.chkSearchTags && candidates[t].tags.join(" ").search(searchRegExp)!=-1)
results.pushUnique(candidates[t]);
if (config.options.chkSearchFields && store.forEachField!=undefined) // requires TW2.1 or above
store.forEachField(candidates[t],
function(tid,field,val) { if (val.search(searchRegExp)!=-1) results.pushUnique(candidates[t]); },
true); // extended fields only
}
// then check for matching text in shadows
if (config.options.chkSearchShadows)
for (var t in config.shadowTiddlers)
if ((config.shadowTiddlers[t].search(searchRegExp)!=-1) && !store.tiddlerExists(t))
results.pushUnique((new Tiddler()).assign(t,config.shadowTiddlers[t]));
// if not 'titles first', or sorting by modification date, re-sort results to so titles, text, tag and field matches are mixed together
if(!sortField) sortField = "title";
var bySortField=function (a,b) {if(a[sortField] == b[sortField]) return(0); else return (a[sortField] < b[sortField]) ? -1 : +1; }
if (!config.options.chkSearchTitlesFirst || config.options.chkSearchByDate) results.sort(bySortField);
return results;
}
// REPORT GENERATOR
if (!window.reportSearchResults) window.reportSearchResults=function(text,matches)
{
var title=config.macros.search.reportTitle
var q = config.options.chkRegExpSearch ? "/" : "'";
var body="\n";
// summary: nn tiddlers found matching '...', options used
body+="''"+config.macros.search.successMsg.format([matches.length,q+"{{{"+text+"}}}"+q])+"''\n";
body+="^^//searched in:// ";
body+=(config.options.chkSearchTitles?"''titles'' ":"");
body+=(config.options.chkSearchText?"''text'' ":"");
body+=(config.options.chkSearchTags?"''tags'' ":"");
body+=(config.options.chkSearchFields?"''fields'' ":"");
body+=(config.options.chkSearchShadows?"''shadows'' ":"");
if (config.options.chkCaseSensitiveSearch||config.options.chkRegExpSearch) {
body+=" //with options:// ";
body+=(config.options.chkCaseSensitiveSearch?"''case sensitive'' ":"");
body+=(config.options.chkRegExpSearch?"''text patterns'' ":"");
}
body+="^^";
// numbered list of links to matching tiddlers
body+="\n<<<";
for(var t=0;t<matches.length;t++) {
var date=config.options.chkSearchByDate?(matches[t].modified.formatString('YYYY.0MM.0DD 0hh:0mm')+" "):"";
body+="\n# "+date+"[["+matches[t].title+"]]";
}
body+="\n<<<\n";
// open all matches button
body+="<html><input type=\"button\" href=\"javascript:;\" ";
body+="onclick=\"story.displayTiddlers(null,["
for(var t=0;t<matches.length;t++)
body+="'"+matches[t].title.replace(/\'/mg,"\\'")+"'"+((t<matches.length-1)?", ":"");
body+="],1);\" ";
body+="accesskey=\"O\" ";
body+="value=\"open all matching tiddlers\"></html> ";
// discard search results button
body+="<html><input type=\"button\" href=\"javascript:;\" ";
body+="onclick=\"story.closeTiddler('"+title+"'); store.deleteTiddler('"+title+"'); store.notify('"+title+"',true);\" ";
body+="value=\"discard "+title+"\"></html>";
// search again
body+="\n\n----\n";
body+="<<search \""+text+"\">>\n";
body+="<<option chkSearchTitles>>titles ";
body+="<<option chkSearchText>>text ";
body+="<<option chkSearchTags>>tags";
body+="<<option chkSearchFields>>fields";
body+="<<option chkSearchShadows>>shadows";
body+="<<option chkCaseSensitiveSearch>>case-sensitive ";
body+="<<option chkRegExpSearch>>text patterns";
body+="<<option chkSearchByDate>>sort by date";
// create/update the tiddler
var tiddler=store.getTiddler(title); if (!tiddler) tiddler=new Tiddler();
tiddler.set(title,body,config.options.txtUserName,(new Date()),"excludeLists excludeSearch temporary");
store.addTiddler(tiddler); story.closeTiddler(title);
// use alternate "search again" label in <<search>> macro
var oldprompt=config.macros.search.label;
config.macros.search.label="search again";
// render/refresh tiddler
story.displayTiddler(null,title,1);
store.notify(title,true);
// restore standard search label
config.macros.search.label=oldprompt;
}
if (!window.discardSearchResults) window.discardSearchResults=function()
{
// remove the tiddler
story.closeTiddler(config.macros.search.reportTitle);
store.deleteTiddler(config.macros.search.reportTitle);
}
//}}}
/***
|Name|SearchOptionsPluginInfo|
|Source|http://www.TiddlyTools.com/#SearchOptionsPlugin|
|Documentation|http://www.TiddlyTools.com/#SearchOptionsPluginInfo|
|Version|2.6.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|documentation|
|Requires||
|Overrides||
|Description|Documentation for SearchOptionsPlugin|
Extend core search function with additional user-configurable options including generating a ''list of matching tiddler'' instead of immediately displaying all matches.
!!!!!Configuration
<<<
<<option chkSearchTitles>> Search in titles
<<option chkSearchText>> Search in tiddler text
<<option chkSearchTags>> Search in tags
<<option chkSearchFields>> Search in data fields
<<option chkSearchShadows>> Search shadow tiddlers
<<option chkSearchTitlesFirst>> Show title matches first
<<option chkSearchByDate>> Sort matching tiddlers by date
<<option chkSearchList>> Show list of matches in [[SearchResults]]
<<option chkSearchIncremental>> Incremental (key-by-key) searching
<<<
!!!!!Revisions
<<<
2007.02.17 [2.6.1] added redefinition of config.macros.search.onKeyPress() to restore check to bypass key-by-key searching (i.e., when chkSearchIncremental==false), which had been unintentionally removed with v2.6.0
2007.02.13 [2.6.0] remove redefinition of config.macros.search.handler since core now includes handling for ENTER key.
2007.02.08 [2.5.1] include 'temporary' tag when creating SearchResults (for use with TemporaryTiddlersPlugin)
2007.01.29 [2.5.0] added support for "sort results by date". Default is to sort alphabetically (standard). When sorted by dates, most recent changes are shown first
2006.10.10 [2.4.0] added support for "search in tiddler data" (tiddler.fields) Default is to search extended data.
2006.04.06 [2.3.0] added support for "search in shadow tiddlers". Default is *not* to search in the shadows (i.e. standard TW behavior). Note: if a shadow tiddler has a 'real' counterpart, only the real tiddler is searched, since the shadow is inaccessible for viewing/editing.
2006.02.03 [2.2.1] rewrite timeout clearing code and blank search text handling to match 2.0.4 core release changes. note that core no longer permits "blank=all" searches, so neither does this plugin. To search for all, use "." with text patterns enabled.
2006.02.02 [2.2.0] in search.handler(), KeyHandler() function clears 'left over' timeout when search input is < 3 chars. Prevents searching on shorter text when shortened by rapid backspaces (<500msec)
2006.02.01 [2.1.9] in Story.prototype.search(), correct inverted logic for using/not using regular expressions when searching
also, blank search text now presents "No search text. Continue anyway?" confirm() message box, so search on blank can still be processed if desired by user.
2006.02.01 [2.1.8] in doSearch(), added alert/return if search text is blank
2006.01.20 [2.1.7] fixed setting of config.macros.search.reportTitle so that Tweaks can override it.
2006.01.19 [2.1.6] improved SearchResults formatting, added a "search again" form to the report (based on a suggestion from MorrisGray)
define results report title using config.macros.search.reportTitle instead of hard-coding the tiddler title
2006.01.18 [2.1.5] Created separate functions for reportSearchResults(text,matches) and discardSearchResults(), so that other developers can create alternative report generators.
2006.01.17 [2.1.4] Use regExp.search() instead of regExp.test() to scan for matches. Correctd the problem where only half the matching tiddlers (the odd-numbered ones) were being reported.
2006.01.15 [2.1.3] Added information (date/time, username, search options used) to SearchResults output
2006.01.10 [2.1.2] use displayTiddlers() to render matched tiddlers. This lets you display multiple matching tiddlers, even if SinglePageModePlugin is enabled.
2006.01.08 [2.1.1] corrected invalid variable reference, "txt.value" to "text" in story.search()
2006.01.08 [2.1.0] re-write to match new store.search(), store.search.handler() and story.search() functions.
2005.12.30 [2.0.0] Upgraded to TW2.0. When rendering SearchResults tiddler, closeTiddler() first to ensure display is refreshed.
2005.12.26 [1.4.0] added option to search for matching text in tiddler tags
2005.12.21 [1.3.7] use \\ to 'escape' single quotes in tiddler titles when generating "Open all matching tiddlers" link. Also, added access key: "O", to trigger "open all" link. Based on a suggestion by UdoBorkowski.
2005.12.18 [1.3.6] call displayMessage() AFTER showing matching tiddlers so message is not cleared too soon
2005.12.17 [1.3.5] if no matches found, just display message and delete any existing SearchResults tiddler.
2005.12.17 [1.3.4] use {/%%/{/%%/{ and }/%%/}/%%/} to 'escape' display text in SearchResults tiddler to ensure that formatting contained in search string is not rendered. Based on a suggestion by UdoBorkowski.
2005.12.14 [1.3.3] tag SearchResults tiddler with 'excludeSearch' so it won't list itself in subsequent searches. Based on a suggestion by UdoBorkowski.
2005.12.14 [1.3.2] added "open all matching tiddlers..." link to search results output. Based on a suggestion by UdoBorkowski.
2005.12.10 [1.3.1] added "discard search results" link to end of search list tiddler output for quick self-removal of 'SearchResults' tiddler.
2005.12.01 [1.3.0] added chkSearchIncremental to enable/disable 'incremental' searching (i.e., search after each keystroke) (default is ENABLED).
added handling for Enter key so it can be used to start a search. Based on a suggestion by LyallPearce
2005.11.25 [1.2.1] renamed from SearchTitleOrTextPlugin to SearchOptionsPlugin
2005.11.25 [1.2.0] added chkSearchList option. Based on a suggestion by RodneyGomes
2005.10.19 [1.1.0] added chkSearchTitlesFirst option. Based on a suggestion by ChristianHauck
2005.10.18 [1.0.0] Initial Release. Based on a suggestion by LyallPearce.
<<<
<html><a href="http://www.liacs.nl/~hli/doc/wldynamics.pdf">Workload Dynamics on Clusters and Grids</a></html>, Journal of Supercomputing, short version in IEEE IPDPS'07.
<html><a href="http://www.liacs.nl/~hli/doc/li07simulation.pdf" target="_blank">Model-Driven Simulation of Grid Scheduling Strategies</a></html>. IEEE eScience'07 (''Best Paper Award'').
<html><a href="http://www.liacs.nl/~hli/doc/li07modelLocalMBC.pdf" target="_blank">Modeling Correlated Workloads by Combining Model Based Clustering and A Localized Sampling Algorithm</a></html>, ACM ICS'07.
<html><a href="http://www.liacs.nl/~hli/doc/per06.pdf" target="_blank">Analysis and Modeling of Job Arrivals in a Production Grid</a></html>. ACM Sigmetrics Performance Evaluation Review, 34(4), pp 59-70, 2007.
<html><a href="http://www.liacs.nl/~hli/doc/li07machine.pdf" target="_blank">Machine Learning for Performance Predictions on Space-Shared Computing Environments</a></html>. International Transactions on Systems Science and Applications, V3(3), pp 257-268, 2007, invited paper.
<html><a href="http://www.liacs.nl/~hli/doc/rtprss.pdf" target="_blank">Efficient Response Time Predictions by Exploiting Application and Resource State Similarities</a></html>. IEEE/ACM Grid'05.
<html><a href="http://www.liacs.nl/~hli/doc/workload_jsspp.pdf" target="_blank">Workload Characteristics of a Multi-cluster Supercomputer</a></html>. ~JSSPP-10, selected and revised papers, LNCS 3277, pp 176-193, Springer, 2005.
[[Full list of publications|Publications]]
<part MAR05>
*[[ServiceLiterature/MAR05]] Axel Martens. ''Analyzing Web Service Based Business Processes.'' FASE'05, Springer, 2005.
**Keywords: @@color(green):''Petri nets''@@.
**Main Results:@@color(blue):here@@.
</part>
----
<part HUH05>
*[[ServiceLiterature/HUH05]] M. Huhns, M. Singh. ''Service-oriented computing: key concepts and principles.'' IEEE Internet Computing, 2005.
**Keywords: @@color(green):''SOC and SOA general concepts''@@.
**Main Results:@@color(blue):here@@.
</part>
----
<part DEV02>
*[[ServiceLiterature/DEV02]] IBM developworks. ''Understanding quality of service for Web services''. 2002. http://www.ibm.com/developerworks/library/ws-quality.html
**Keywords:@@color(green):''non-functional properties, ~QoS, monitoring''@@.
**Main Results:@@color(blue):here@@.
</part>
----
<part BLA07>
*[[ServiceLiterature/BLA07]] M.B. Blake and D.J. Cummings. ''Workflow Composition of Service Level Agreements.'' IEEE Intl. Conf. Service Computing (SCC), 2007.
**Keywords:@@color(green):''workflows, ~QoS attributes, SLA''@@.
**Main Results:@@color(blue):here@@.
</part>
----
<part RAO05>
*[[ServiceLiterature/RAO05]] Jinghai Rao and Xiaomeng Su. ''A Survey of Automated Web Service Composition Methods''. Semantic Web Services and Web Process Composition, LNCS, 2005.
**Keywords:@@color(green):''automated composition, cross-enterprise workflow, AI planning''@@.
**Main Results:@@color(blue):here@@.
</part>
----
<part ZEN04>
*[[ServiceLiterature/ZEN04]] L. Zeng et al. ''~QoS-aware middleware for Web services composition''. IEEE Trans. Software Engineering, 2004.
**Keywords:@@color(green):''service composition, DAG, ~QoS, utility function, linear programming''@@.
**Main Results:@@color(blue):here@@.
</part>
----
<part CAR04>
*[[ServiceLiterature/CAR04]] J. Cardoso et al. ''Modeling Quality of Service for Workflows and Web Service Processes''. J. Web Semantics. 2004.
**Keywords:@@color(green):''~QoS, non-functional attributes, prediction, workflows, SLA''@@.
**Main Results:@@color(blue):here@@.
</part>
----
<part AND06>
*[[ServiceLiterature/AND06]] M. Andrews et al. ''Measuring human satisfaction in data networks''. IEEE Infocom, 2006.
**Keywords:@@color(green):''user-perceived ~QoS, dataMOS, user-centric measurement''@@.
**Main Results:@@color(blue):here@@.
</part>
----
<part ITU05>
*[[ServiceLiterature/ITU05]] ~ITU-T recommendation G.1030. ''Estimating end-to-end performance in IP networks for data applications''. 2005.
**Keywords:@@color(green):''MOS definition''@@.
**Main Results:@@color(blue):here@@.
</part>
----
<<search>><<closeAll>><<permaview>><<newTiddler>><<newJournal 'DD MMM YYYY'>><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel 'options »' 'Change TiddlyWiki advanced options'>>
<<tabs txtMainTab Timeline Timeline TabTimeline All 'All tiddlers' TabAll Tags 'All tags' TabTags More 'More lists' TabMore>>
/***
|Name|SinglePageModePlugin|
|Source|http://www.TiddlyTools.com/#SinglePageModePlugin|
|Documentation|http://www.TiddlyTools.com/#SinglePageModePluginInfo|
|Version|2.8.2|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.displayTiddler(), Story.prototype.displayTiddlers()|
|Description|Show tiddlers one at a time with automatic permalink, or always open tiddlers at top/bottom of page.|
This plugin allows you to configure TiddlyWiki to navigate more like a traditional multipage web site with only one tiddler displayed at a time.
!!!!!Documentation
>see [[SinglePageModePluginInfo]]
!!!!!Configuration
<<<
<<option chkSinglePageMode>> Display one tiddler at a time
><<option chkSinglePageKeepFoldedTiddlers>> Don't auto-close folded tiddlers
><<option chkSinglePagePermalink>> Automatically permalink current tiddler
<<option chkTopOfPageMode>> Always open tiddlers at the top of the page
<<option chkBottomOfPageMode>> Always open tiddlers at the bottom of the page
<<option chkSinglePageAutoScroll>> Automatically scroll tiddler into view (if needed)
Notes:
* The "display one tiddler at a time" option can also be //temporarily// set/reset by including a 'paramifier' in the document URL: {{{#SPM:true}}} or {{{#SPM:false}}}.
* If more than one display mode is selected, 'one at a time' display takes precedence over both 'top' and 'bottom' settings, and if 'one at a time' setting is not used, 'top of page' takes precedence over 'bottom of page'.
* When using Apple's Safari browser, automatically setting the permalink causes an error and is disabled.
<<<
!!!!!Revisions
<<<
2008.03.14 [2.8.2] in displayTiddler(), if editing specified tiddler, just move it to top/bottom of story *without* re-rendering (prevents discard of partial edits).
| Please see [[SinglePageModePluginInfo]] for previous revision details |
2005.08.15 [1.0.0] Initial Release. Support for BACK/FORWARD buttons adapted from code developed by Clint Checketts.
<<<
!!!!!Code
***/
//{{{
version.extensions.SinglePageMode= {major: 2, minor: 8, revision: 2, date: new Date(2008,3,14)};
//}}}
//{{{
config.paramifiers.SPM = { onstart: function(v) {
config.options.chkSinglePageMode=eval(v);
if (config.options.chkSinglePageMode && config.options.chkSinglePagePermalink && !config.browser.isSafari) {
config.lastURL = window.location.hash;
if (!config.SPMTimer) config.SPMTimer=window.setInterval(function() {checkLastURL();},1000);
}
} };
//}}}
//{{{
if (config.options.chkSinglePageMode==undefined) config.options.chkSinglePageMode=false;
if (config.options.chkSinglePageKeepFoldedTiddlers==undefined) config.options.chkSinglePageKeepFoldedTiddlers=true;
if (config.options.chkSinglePagePermalink==undefined) config.options.chkSinglePagePermalink=true;
if (config.options.chkTopOfPageMode==undefined) config.options.chkTopOfPageMode=false;
if (config.options.chkBottomOfPageMode==undefined) config.options.chkBottomOfPageMode=false;
if (config.options.chkSinglePageAutoScroll==undefined) config.options.chkSinglePageAutoScroll=true;
if (config.optionsDesc) {
config.optionsDesc.chkSinglePageMode="Display one tiddler at a time";
config.optionsDesc.chkSinglePageKeepFoldedTiddlers="Don't auto-close folded tiddlers";
config.optionsDesc.chkSinglePagePermalink="Automatically permalink current tiddler";
config.optionsDesc.chkSinglePageAutoScroll="Automatically scroll tiddler into view (if needed)";
config.optionsDesc.chkTopOfPageMode="Always open tiddlers at the top of the page";
config.optionsDesc.chkBottomOfPageMode="Always open tiddlers at the bottom of the page";
} else {
config.shadowTiddlers.AdvancedOptions += "\
\n<<option chkSinglePageMode>> Display one tiddler at a time \
\n<<option chkSinglePageKeepFoldedTiddlers>> Don't auto-close folded tiddlers \
\n<<option chkSinglePagePermalink>> Automatically permalink current tiddler \
\n<<option chkSinglePageAutoScroll>> Automatically scroll tiddler into view (if needed) \
\n<<option chkTopOfPageMode>> Always open tiddlers at the top of the page \
\n<<option chkBottomOfPageMode>> Always open tiddlers at the bottom of the page";
}
//}}}
//{{{
config.SPMTimer = 0;
config.lastURL = window.location.hash;
function checkLastURL()
{
if (!config.options.chkSinglePageMode)
{ window.clearInterval(config.SPMTimer); config.SPMTimer=0; return; }
if (config.lastURL == window.location.hash) return; // no change in hash
var tids=convertUTF8ToUnicode(decodeURIComponent(window.location.hash.substr(1))).readBracketedList();
if (tids.length==1) // permalink (single tiddler in URL)
story.displayTiddler(null,tids[0]);
else { // restore permaview or default view
config.lastURL = window.location.hash;
if (!tids.length) tids=store.getTiddlerText("DefaultTiddlers").readBracketedList();
story.closeAllTiddlers();
story.displayTiddlers(null,tids);
}
}
if (Story.prototype.SPM_coreDisplayTiddler==undefined)
Story.prototype.SPM_coreDisplayTiddler=Story.prototype.displayTiddler;
Story.prototype.displayTiddler = function(srcElement,title,template,animate,slowly)
{
var opt=config.options;
if (opt.chkSinglePageMode) {
// close all tiddlers except current tiddler, tiddlers being edited, and tiddlers that are folded (optional)
story.forEachTiddler(function(tid,elem) {
if ( tid==title
|| elem.getAttribute("dirty")=="true"
|| (opt.chkSinglePageKeepFoldedTiddlers && elem.getAttribute("folded")=="true"))
return;
story.closeTiddler(tid);
});
}
else if (opt.chkTopOfPageMode)
arguments[0]=null;
else if (opt.chkBottomOfPageMode)
arguments[0]="bottom";
if (opt.chkSinglePageMode && opt.chkSinglePagePermalink && !config.browser.isSafari) {
window.location.hash = encodeURIComponent(convertUnicodeToUTF8(String.encodeTiddlyLink(title)));
config.lastURL = window.location.hash;
document.title = wikifyPlain("SiteTitle") + " - " + title;
if (!config.SPMTimer) config.SPMTimer=window.setInterval(function() {checkLastURL();},1000);
}
var tiddlerElem=document.getElementById(story.idPrefix+title); // ==null unless tiddler is already display
if (tiddlerElem && tiddlerElem.getAttribute("dirty")=="true") { // editing... move tiddler without re-rendering
var isTopTiddler=(tiddlerElem.previousSibling==null);
if (!isTopTiddler && (opt.chkSinglePageMode || opt.chkTopOfPageMode))
tiddlerElem.parentNode.insertBefore(tiddlerElem,tiddlerElem.parentNode.firstChild);
else if (opt.chkBottomOfPageMode)
tiddlerElem.parentNode.insertBefore(tiddlerElem,null);
else this.SPM_coreDisplayTiddler.apply(this,arguments); // let CORE render tiddler
} else
this.SPM_coreDisplayTiddler.apply(this,arguments); // let CORE render tiddler
var tiddlerElem=document.getElementById(story.idPrefix+title);
if (tiddlerElem&&opt.chkSinglePageAutoScroll) {
var yPos=ensureVisible(tiddlerElem); // scroll to top of tiddler
var isTopTiddler=(tiddlerElem.previousSibling==null);
if (opt.chkSinglePageMode||opt.chkTopOfPageMode||isTopTiddler)
yPos=0; // scroll to top of page instead of top of tiddler
if (opt.chkAnimate) // defer scroll until 200ms after animation completes
setTimeout("window.scrollTo(0,"+yPos+")",config.animDuration+200);
else
window.scrollTo(0,yPos); // scroll immediately
}
}
if (Story.prototype.SPM_coreDisplayTiddlers==undefined)
Story.prototype.SPM_coreDisplayTiddlers=Story.prototype.displayTiddlers;
Story.prototype.displayTiddlers = function() {
// suspend single-page mode (and/or top/bottom display options) when showing multiple tiddlers
var opt=config.options;
var saveSPM=opt.chkSinglePageMode; opt.chkSinglePageMode=false;
var saveTPM=opt.chkTopOfPageMode; opt.chkTopOfPageMode=false;
var saveBPM=opt.chkBottomOfPageMode; opt.chkBottomOfPageMode=false;
this.SPM_coreDisplayTiddlers.apply(this,arguments);
opt.chkBottomOfPageMode=saveBPM;
opt.chkTopOfPageMode=saveTPM;
opt.chkSinglePageMode=saveSPM;
}
//}}}
/***
|Name|SinglePageModePluginInfo|
|Source|http://www.TiddlyTools.com/#SinglePageModePlugin|
|Documentation|http://www.TiddlyTools.com/#SinglePageModePluginInfo|
|Version|2.8.2|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|documentation|
|Requires||
|Overrides||
|Description|Documentation for SinglePageModePlugin|
Normally, as you click on the links in TiddlyWiki, more and more tiddlers are displayed on the page. The order of this tiddler display depends upon when and where you have clicked. Some people like this non-linear method of reading the document, while others have reported that when many tiddlers have been opened, it can get somewhat confusing. SinglePageModePlugin allows you to configure TiddlyWiki to navigate more like a traditional multipage web site with only one item displayed at a time.
!!!!!Usage
<<<
When the plugin is enabled, only one tiddler will be displayed at a time and the browser window's titlebar is updated to include the current tiddler title. The browser's location URL is also updated with a 'permalink' for the current tiddler so that it is easier to create a browser 'bookmark' for the current tiddler. Alternatively, even when displaying multiple tiddlers //is// permitted, you can still reduce the potential for confusion by forcing tiddlers to always open at the top (or bottom) of the page instead of being displayed following the tiddler containing the link that was clicked.
<<<
!!!!!Configuration
<<<
When installed, this plugin automatically adds checkboxes in the AdvancedOptions tiddler so you can enable/disable the plugin behavior. However, if you have customized your AdvancedOptions, you may need to //manually add these checkboxes to your customized tiddler.// For convenience, these checkboxes are also included here:
<<option chkSinglePageMode>> Display one tiddler at a time
><<option chkSinglePageKeepFoldedTiddlers>> Don't auto-close folded tiddlers
><<option chkSinglePagePermalink>> Automatically permalink current tiddler
<<option chkTopOfPageMode>> Always open tiddlers at the top of the page
<<option chkBottomOfPageMode>> Always open tiddlers at the bottom of the page
<<option chkSinglePageAutoScroll>> Automatically scroll tiddler into view (if needed)
Notes:
* {{block{
The "display one tiddler at a time" option can also be //temporarily// set/reset by including a 'paramifier' in the document URL: {{{#SPM:true}}} or {{{#SPM:false}}}. You can also use {{{SPM:expression}}}, where 'expression' is any javascript statement that evaluates to true or false. This allows you to create hard-coded links in other documents that can selectively enable/disable the use of this option based on various programmatic conditions, such as the current username. For example, using
{{{#SPM:config.options.txtUserName!="SomeName"}}}
enables 'one tiddler at a time' display for all users //other than// "~SomeName")}}}
* If more than one display mode is selected, 'one at a time' display takes precedence over both 'top' and 'bottom' settings, and if 'one at a time' setting is not used, 'top of page' takes precedence over 'bottom of page'.
* When using Apple's Safari browser, automatically setting the permalink causes an error and is disabled.
<<<
!!!!!Revisions
<<<
2008.03.14 [2.8.2] in displayTiddler(), if editing specified tiddler, just move it to top/bottom of story *without* re-rendering (prevents discard of partial edits).
2008.03.06 [2.8.1] in paramifier handler, start 'checkURL' timer if chkSinglePageMode is enabled
2008.03.06 [2.8.0] added option, {{{config.options.chkSinglePageKeepFoldedTiddlers}}}, so folded tiddlers won't be closed when using single-page mode. Also, in checkURL(), if hash is a ''permaview'' (e.g., "#foo bar baz"), then display multiple tiddlers rather than attempting to display "foo bar baz" as a single tiddler
2008.03.05 [2.7.0] added support for "SPM:" URL paramifier
2008.03.01 [2.6.0] in hijack of displayTiddler(), added 'title' argument to closeAllTiddlers() so that target tiddler isn't closed-and-reopened if it was already displayed. Also, added config.options.chkSinglePageAutoScrolloption to bypass automatic 'scroll into view' logic (note: core still does it's own ensureVisible() handling)
2007.12.22 [2.5.3] in checkLastURL(), use decodeURIComponent() instead of decodeURI so that tiddler titles with commas (and/or other punctuation) are correctly handled.
2007.10.26 [2.5.2] documentation cleanup
2007.10.08 [2.5.1] in displayTiddler(), when using single-page or top-of-page mode, scrollTo(0,0) to ensure that page header is in view.
2007.09.13 [2.5.0] for TPM/BPM modes, don't force tiddler to redisplay if already shown. Allows transition between view/edit or collapsed/view templates, without repositioning displayed tiddler.
2007.09.12 [2.4.0] added option to disable automatic permalink feature. Also, Safari is now excluded from permalinking action to avoid bug where tiddlers don't display after hash is updated.
2007.03.03 [2.3.1] fix typo when adding BPM option to AdvancedOptions (prevented checkbox from appearing)
2007.03.03 [2.3.0] added support for BottomOfPageMode (BPM) based on request from DaveGarbutt
2007.02.06 [2.2.3] in Story.prototype.displayTiddler(), use convertUnicodeToUTF8() for correct I18N string handling when creating URL hash string from tiddler title (based on bug report from BidiX)
2007.01.08 [2.2.2] use apply() to invoke hijacked core functions
2006.07.04 [2.2.1] in hijack for displayTiddlers(), suspend TPM as well as SPM so that DefaultTiddlers displays in the correct order.
2006.06.01 [2.2.0] added chkTopOfPageMode (TPM) handling
2006.02.04 [2.1.1] moved global variable declarations to config.* to avoid FireFox 1.5.0.1 crash bug when assigning to globals
2005.12.27 [2.1.0] hijack displayTiddlers() so that SPM can be suspended during startup while displaying the DefaultTiddlers (or #hash list). Also, corrected initialization for undefined SPM flag to "false", so default behavior is to display multiple tiddlers
2005.12.27 [2.0.0] Update for TW2.0
2005.11.24 [1.1.2] When the back and forward buttons are used, the page now changes to match the URL. Based on code added by Clint Checketts
2005.10.14 [1.1.1] permalink creation now calls encodeTiddlyLink() to handle tiddler titles with spaces in them
2005.10.14 [1.1.0] added automatic setting of window title and location bar ('auto-permalink'). feature suggestion by David Dickens.
2005.10.09 [1.0.1] combined documentation and code in a single tiddler
2005.08.15 [1.0.0] Initial Release
<<<
<script>addthis_pub = 'huili';</script><html><a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s9.addthis.com/button1-share.gif" width="125" height="16" border="0" alt="" /></a></html><script src="http://s7.addthis.com/js/152/addthis_widget.js"></script>
<script>
if (!window.story) window.story=window;
var title=story.findContainingTiddler(place).getAttribute("tiddler");
var t = encodeURIComponent(String.encodeTiddlyLink(title));
if(window.location.hash != t) window.location.hash = t;
</script>
[[Performance Predictions]]
PDM (Performance Data Miner) is a Java-based toolkit for mining performance data in distributed computing environments and Grids. It is developed to extract useful information from the data which can be used to improve performance or manage the system itself.
[[Grid Workload Modeling]]
GWM (Grid Workload Modeling) is a collection of Matlab/c/c++ programs for workload modeling in Grid computing environments. It includes tools for estimating and simulating ~MMPPs, pseudo-periodicity, and long range dependence for job arrival processes. It also contains implementations for simulating data series (e.g. job run time) that exhibit multi-modality and different correlation structures.
/***
|''Name:''|SparklinePlugin|
|''Description:''|Sparklines macro|
***/
//{{{
if(!version.extensions.SparklinePlugin) {
version.extensions.SparklinePlugin = {installed:true};
//--
//-- Sparklines
//--
config.macros.sparkline = {};
config.macros.sparkline.handler = function(place,macroName,params)
{
var data = [];
var min = 0;
var max = 0;
var v;
for(var t=0; t<params.length; t++) {
v = parseInt(params[t]);
if(v < min)
min = v;
if(v > max)
max = v;
data.push(v);
}
if(data.length < 1)
return;
var box = createTiddlyElement(place,"span",null,"sparkline",String.fromCharCode(160));
box.title = data.join(",");
var w = box.offsetWidth;
var h = box.offsetHeight;
box.style.paddingRight = (data.length * 2 - w) + "px";
box.style.position = "relative";
for(var d=0; d<data.length; d++) {
var tick = document.createElement("img");
tick.border = 0;
tick.className = "sparktick";
tick.style.position = "absolute";
tick.src = "data:image/gif,GIF89a%01%00%01%00%91%FF%00%FF%FF%FF%00%00%00%C0%C0%C0%00%00%00!%F9%04%01%00%00%02%00%2C%00%00%00%00%01%00%01%00%40%02%02T%01%00%3B";
tick.style.left = d*2 + "px";
tick.style.width = "2px";
v = Math.floor(((data[d] - min)/(max-min)) * h);
tick.style.top = (h-v) + "px";
tick.style.height = v + "px";
box.appendChild(tick);
}
};
}
//}}}
/*{{{*/
/*Modified Mocha TiddlyWiki Theme*/
/*Version 1.0*/
/*Design and CSS originally by Anthonyy, ported to TiddlyWiki by Saq Imtiaz. Customized by Hui Li, 2008.*/
/*}}}*/
/*{{{*/
#contentWrapper{
margin-top: 0px;
margin-right:auto;
margin-left:auto;
/*font-family: Verdana, Arial, Tahoma, Sans-Serif;*/
font-family: Lucida Grande, Tahoma, Arial, Helvetica, sans-serif; /*Lucida Grande for the Macs, Tahoma for the PCs */
font-size: 12px;
width: 1016px;
line-height: 1.6em;
color: #555;
background: #fff;
}
/* Self-defined styles */
#GoogleAdsense_box {
font-size: .9em;
}
.externalLink {text-decoration:none;}
#flashcontentSmall {
height: 30em;
}
#flashcontent {
height: 60em;
}
#flashcontentLarge {
height: 90em;
}
#topMenu {
background: #eee;
font-size: 1.1em;
border-top: 1px solid #999999;
border-bottom: 1px solid #999999;
border-left: 1px solid #999999;
border-right: 1px solid #999999;
/*-moz-border-radius: 0.4em;*/
}
#topMenu .button, #topMenu .tiddlyLink, #topMenu a { color: #003399; margin-left: 0.25em; margin-right: 0.25em; padding-left: 1em; padding-right: 1em; font-size: 1em; border: none;}
#topMenu .button:hover, #topMenu .tiddlyLink:hover {
color: #fff;
background: #003399;
border: none;
}
/* green */
.style1 {color: #009900;}
/* red */
.style2 {color: #990000;}
.textleft {
text-align: left;
}
.textright {
text-align: right;
}
.textcenter {
text-align: center;
}
.textjustify {
text-align: justify;
}
.imgfloatleft {
float: left;
}
.imgfloatright {
float: right;
}
.imgfloatcenter {
float: center;
}
.twocolumns { display:block; -moz-column-count:2; -moz-column-gap:1em; -moz-column-width:50%;}
.threecolumns { display:block; -moz-column-count:3; -moz-column-gap:1em; -moz-column-width:33%}
.fourcolumns { display:block; -moz-column-count:4; -moz-column-gap:1em; -moz-column-width:25%}
/* End Self-defined styles */
.header {
background: #fff;
padding-top: 0px;
clear: both;
}
.headerShadow { padding: 2em 0em 1em 0em; }
.siteTitle {
font-family: Georgia, "Times New Roman", Times, serif;
font-weight: bold;
font-style: italic;
font-size: 32px;
color: #3B3B3B;
margin-left: 3px;
background-color: #FFF;
}
.siteTitle a{color:#3B3B3B; border-bottom:1px dotted #3B3B3B;}
.siteSubtitle {
font-size: 1.0em;
margin-left: 2em;
margin-top: .3em;
color: #999999;
display: block;
}
#mainMenu {
position:relative;
float:left;
margin-bottom:0em;
display:inline;
text-align:left;
padding: 0.7em 2em 0em 0em;
width:11.5em;
font-size:1em;
}
#sidebar{
position:relative;
float:right;
margin-bottom:1em;
padding: 0.7em 0em 0em 0em;
display:inline;
font-size: 0.9em;
}
#tiddlersBar {position:relative;float:center;}
#tiddlersBar .button {border:0;}
#tiddlersBar .tab {margin: 0 0 0 0;padding: 1px 2px 1px 2px;}
#tiddlersBar .tabUnselected .tabButton, .tabSelected .tabButton {padding : 0 2px 0 2px; margin: 0 0 0 4px;}
#displayArea {
position:relative;
float:center;
/*margin: 0em 0em 1em 0em;*/
margin: 0em 16em 0em 13em;
/*width:53.2em;*/
}
.tagClear {clear:none;}
#contentFooter {font-size:.9em;background:#555; color:#eee; clear: both; padding: 0.5em 1em;}
#contentFooter a {
color: #BFB6B3;
border-bottom: 1px dotted #BFB6B3;
}
#contentFooter a:hover {
color: #FFFFFF;
background-color:#575352;
}
a,#sidebarOptions .sliderPanel a{
color:#003399;
text-decoration: none;
}
a:hover,#sidebarOptions .sliderPanel a:hover {
color:#003399;
background-color: #F5F5F5;
}
.viewer .button, .editorFooter .button{
color: #666;
border: 1px solid #003399;
}
.viewer .button:hover,
.editorFooter .button:hover{
color: #fff;
background: #003399;
border-color: #003399;
}
.viewer .button:active, .viewer .highlight,.editorFooter .button:active, .editorFooter .highlight{color:#fff; background:#575352;border-color:#575352;}
#mainMenu a {
display: block;
padding: 5px;
border-bottom: 1px solid #CCC;
}
#mainMenu a:link, #navlist a:visited {
color:#003399;
text-decoration: none;
}
#mainMenu a:hover {
background: #000000 url(arrow.gif) 96% 50% no-repeat;
background-color: #F5F5F5;
color:#003399;
}
#mainMenu a:hover, #mainMenu a:active, #mainMenu .highlight, #mainMenu .marked {
background: #000000 url(arrow.gif) 96% 50% no-repeat;
background-color: #F5F5F5;
color:#003399;
}
#mainMenu span {position:relative;}
#mainMenu br {display:none;}
#sidebarOptions a {
color:#999;
text-decoration: none;
border:1px solid #fff;
}
#sidebarOptions a:hover {
color:#4F4B45;
background-color: #F5F5F5;
border:1px solid #fff;
}
#sidebarOptions {line-height:1.4em;}
.tiddler {
padding-bottom: 30px;
border-bottom: 1px solid #DDDDDD;
}
.title {color:#666; font-variant: small-caps;}
.subtitle, .subtitle a { color: #999999; font-size: 1.0em;margin:0.2em;}
.shadow .title{color:#999;}
.selected .toolbar a {color:#999999;}
.selected .toolbar a:hover {color:#4F4B45; background:transparent;border:1px solid #fff;}
.toolbar .button:hover, .toolbar .highlight, .toolbar .marked, .toolbar a.button:active{color:#4F4B45; background:transparent;border:1px solid #fff;}
.listLink,#sidebarTabs .tabContents {line-height:1.5em;}
.listTitle {color:#888;}
#sidebarTabs .tabContents {background:#fff;}
#sidebarTabs .tabContents .tiddlyLink, #sidebarTabs .tabContents .button{color:#999;}
#sidebarTabs .tabContents .tiddlyLink:hover,#sidebarTabs .tabContents .button:hover{color:#4F4B45;background:#fff}
#sidebarTabs .tabContents .button:hover, #sidebarTabs .tabContents .highlight, #sidebarTabs .tabContents .marked, #sidebarTabs .tabContents a.button:active{color:#4F4B45;background:#fff}
.tabSelected{color:#fff; background:#999;}
.tabUnselected {
background: #ccc;
}
.tabSelected, .tabSelected:hover {
color: #fff;
background: #999;
border: solid 1px #999;
padding-bottom:1px;
}
.tabUnselected {
color: #999;
background: #eee;
border: solid 1px #ccc;
padding-bottom:1px;
}
#sidebarTabs .tabUnselected { border-bottom: none;padding-bottom:3px;}
#sidebarTabs .tabSelected{padding-bottom:3px;}
#sidebarTabs .tabUnselected:hover { border-bottom: none;padding-bottom:3px;color:#4F4B45}
#sidebarOptions .sliderPanel {
background: #fff; border:none;
font-size: .9em;
}
#sidebarOptions .sliderPanel a {font-weight:normal;}
#sidebarOptions .sliderPanel input {border:1px solid #999;}
.viewer blockquote {
border-left: 3px solid #999;
}
.viewer table {
border: 2px solid [[ColorPalette::TertiaryDark]];
}
.viewer th, thead td {
background: #eee;
border: 1px solid #eee;
color: #fff;
}
.viewer pre {
border: 1px solid #eee;
background: #eee;
}
.viewer code {
color: #2F2A29;
}
.viewer hr {
border-top: dashed 1px #eee;
}
.editor input {
border: 1px solid #eee;
}
.editor textarea {
border: 1px solid #eee;
}
.popup {
background: #eee;
border: 1px solid [[ColorPalette::TertiaryDark]];
}
.popup li.disabled {
color: #000;
}
.popup li a, .popup li a:visited {
color: #575352;
border: none;
}
.popup li a:hover {
background: #003399;
color: #fff;
border: none;
}
.tagging, .tagged {
border: 1px solid #eee;
background-color: #F7F7F7;
}
.selected .tagging, .selected .tagged {
background-color: #eee;
border: 1px solid #BFBAB3;
}
.tagging .listTitle, .tagged .listTitle {
color: #bbb;
}
.selected .tagging .listTitle, .selected .tagged .listTitle {
color: #4F4B45;
}
.tagging .button, .tagged .button {
color:#aaa;
}
.selected .tagging .button, .selected .tagged .button {
color:#4F4B45;
}
/*.highlight, .marked {background:transparent; color:#111; border:none; text-decoration:underline;}*/
.tagging .button:hover, .tagged .button:hover, .tagging .button:active, .tagged .button:active {
border: none; background:transparent; text-decoration:underline; color:#000;
}
h1,h2,h3,h4,h5 { color: #666; background: transparent; padding-bottom:2px; font-family: Arial, Helvetica, sans-serif; }
h1 {font-size:18px;}
h2 {font-size:16px;}
h3 {font-size: 14px;}
#messageArea {
border: 4px solid #999;
background: #f5f5f5;
color: #999;
font-size:90%;
}
#messageArea a:hover { background:#f5f5f5;}
#messageArea .button{
color: #666;
border: 1px solid #CC6714;
}
#messageArea .button:hover {
color: #fff;
background: #999;
border-color: #999;
}
* html .viewer pre {
margin-left: 0em;
}
* html .editor textarea, * html .editor input {
width: 98%;
}
.searchBar {float:right;font-size: 1.0em;}
.searchBar .button {color:#999;display:block;border:none;}
.searchBar .button:hover {border:none;color:#4F4B45;}
.searchBar input {
background-color: #FFF;
color: #999999;
border: 1px solid #CCC;
margin-right:3px;
}
#sidebarOptions .button:active, #sidebarOptions .highlight {background:#F5F5F5;}
*html #contentFooter { padding:0.25em 1em 0.5em 1em;}
#noticeBoard {font-size: 0.9em; color:#999; position:relative;display:block;background:#fff; clear: both; margin-right:0em; margin-top:25px; padding:5px;}
#mainMenu #noticeBoard a,#mainMenu #noticeBoard .tiddlyLink {display:inline;border:none;padding:5px 2px;color:#003399}
#noticeBoard a:hover {border:none;}
#noticeBoard br {display:inline;}
#mainMenu #noticeBoard .button{
color: #666;
border: none;
}
#mainMenu #noticeBoard .button:hover{
color: #fff;
background: #003399;
border-color: #003399;
}
/*.searchbar {position:relative; width:14em;}*/
/*.searchbar .button{margin:0; width:14em;}*/
#header {display:inline-block;}
/*}}}*/
<part CHA01>
*[[SystemLiterature/CHA01]] Jeff Chase et al. ''Managing Energy and Server Resources in Hosting Centers.'' SOSP'01, ACM, 2001.
**Keywords: @@color(green):''data centers, utility function, system management''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part BEN05>
*[[SystemLiterature/BEN05]] M. Bennani and D. Menasce. ''Resource Allocation for Autonomic Data Centers using Analytic Performance Models.'' ICAC'05, IEEE, 2005.
**Keywords: @@color(green):''data centers, utility function, performance modeling, prediction''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part SHI06>
*[[SystemLiterature/SHI06]] P. Shivam et al. ''Active and Accelerated Learning of Cost Models for Optimizing Scientific Applications.'' VLDB'06, ACM, 2006.
**Keywords: @@color(green):''prediction, modeling, ~QoS, scientific apps''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part YEO04>
*[[SystemLiterature/YEO04]] C.Y.Yeo and R. Buyya. ''A Taxonomy of Market-based Resource Management Systems for Utility-driven Cluster Computing.'' Softw. Pract. Exper., 2004.
**Keywords: @@color(green):''survey, utility, cluster computing, resource management''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part ARD07>
*[[SystemLiterature/ARD07]] D. Ardagna. ''SLA Based Resource Allocation Policies in Autonomic Environments.'' J. Para. Dist. Comp., 2007.
**Keywords: @@color(green):''multi-tier hosting center, utility function, SLA optimization, ~QoS, load balancing''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part CHE03>
*[[SystemLiterature/CHE03]] L. Cherkasova. ''Measuring and Characterizing ~End-to-End Internet Service Performance''. ACM Trans. Internet Tech., 2003.
**Keywords: @@color(green):''passive monitoring on server side, end-to-end service performance''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part GRA03>
*[[SystemLiterature/GRA03]] J. Gray. ''Distributed Computing Economics.'' MSR Tech. Rep., 2003.
**Keywords: @@color(green):''computing, web services, economics''@@.
**Main Results: @@color(blue):when does it make sense to move computation from one place to another?@@
</part>
----
<part DEC07>
*[[SystemLiterature/DEC07]] G. ~DeCandia et al. ''Dynamo: Amazon's Highly Available Key-value Store''. SOSP'07, ACM, 2007.
**Keywords: @@color(green):''availability, failure, system design, mass hosting center, SLA 99.9%''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part BOU06>
*[[SystemLiterature/BOU06]] S. Bouchenak et al. ''Autonomic Management of Clustered Applications.'' IEEE Cluster'06, 2006.
**Keywords: @@color(green):''fractal component model, control, operation management, middleware, Jade''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part REN03>
*[[SystemLiterature/REN03]] R. v. Renesse et al. ''Astrolabe: a robust and scalable technology for distributed system monitoring, management, and data mining.'' ACM TOCS, 2003.
**Keywords: @@color(green):''self-organization, distributed systems, monitoring, management''@@.
**Main Results: @@color(blue):here@@.
</part>
----
<part KIC07>
*[[SystemLiterature/KIC07]] E. Kiciman et al. ''Ajaxscope: a platform for remotely monitoring the client-side behavior of web 2.0 applications.'' ACM SOSP, 2007.
**Keywords: @@color(green):''Ajax, on-the-fly Javascript instrumentation, client-side behavior monitoring''@@.
**Main Results: @@color(blue):here@@.
</part>
----
|>|bgcolor(#8af):@@color(#000080):''2 tiddlers found matching /{{{workflow}}}/''@@|bgcolor(#8af): @@color(#A00000): SearchHelp@@ |
|>|>|bgcolor(#E3FFE3):<<search>> <<option chkSearchTitles>> Titles <<option chkSearchText>> Text <<option chkSearchTags>>Tags <<option chkHoldSearches>> Hold |
| |bgcolor(#8af): @@color(#000080):sort by: ''Titles''@@ |bgcolor(#8af): @@color(#000080): ''Size'' (bytes)@@ |bgcolor(#8af): @@color(#000080): ''Tags''@@ |h
| 1|[[PartTiddlerPlugin]]| 22885|@@systemConfig,excludeLists@@|
| 2|[[ServiceLiterature]]| 2690|@@Service@@|
!!!<<gradient horiz #fc3 #fff>> TWHelpSearchDoc^^<<tiddler CloseThisOpen with: ThirdPartyPlugins '« back'>>|<<toolbar editTiddler>>» ^^>>
''Now you can have the same search as used on TW Help.''
* Get this plugin here TwHelpSearchPlugin or here:
* http://twhelp.tiddlyspot.com/#TwHelpSearchPlugin
Optionally you can put this+++[search box]<<tiddler SearchBox>>===in SideBarOptions as seen on TW Help.+++[see the code]
{{{
|>|>|>|<<search>> |
|>|>| look for in |>|
| <<option chkSearchTitles>> | <<option chkSearchText>> | <<option chkSearchTags>> | <<option chkHoldSearches>> |
| titles | text | tags | hold |
}}}
===
----
''A Plugin Tweak for:'' SearchOptionsPlugin
!!!<<gradient horiz #abf #fff>> Description>>
<<<
The TwHelpSearchPlugin defines an alternative format for the ~SearchResults tiddler that is generated by the SearchOptionsPlugin . It presents the search results in tabular form numbering the rows and showing the tiddler title, the size in bytes, and the tags. It is ready to be used with the [[SortableGridPlugin|http://solo.dc3.com/tw/#SortableGridPlugin]] (check versions) so any column can be sorted; such as size in ascending or descending order.
<<<
!!!<<gradient horiz #abf #fff>>Installation>>
If you have already installed SearchOptionsPlugin then your AdvancedOptions will have already been modified by that plugin to include the following: +++[see the code for this]
{{{
<<option chkSearchTitles>> Search tiddler titles
<<option chkSearchText>> Search tiddler text
<<option chkSearchTags>> Search in tiddler tags
<<option chkSearchTitlesFirst>> Show title matches first
<<option chkSearchList>> Show list of matching tiddlers
}}}
===
<<<
<<option chkSearchTitles>> Search tiddler titles
<<option chkSearchText>> Search tiddler text
<<option chkSearchTags>> Search in tiddler tags
<<option chkSearchTitlesFirst>> Show title matches first
<<option chkSearchList>> Show list of matching tiddlers^^[1]^^
<<<
^^[1]^^@@color:#C06;(This option is critical in preventing normal ~TiddlyWiki search method.)@@
TwHelpSearchPlugin requires an additional insertion into AdvancedOptions for the option of holding the search results and appending any number of additional searches. +++[see the code for this]
{{{
<<option chkHoldSearches>> Hold search results
}}}
===
<<<
<<option chkHoldSearches>> Hold search results
<<<
TwHelpSearchPlugin will attempt to add this to AdvancedOptions upon installation.
|bgcolor:#FCF;''NOTE:'' If either plugin fails to install their options; add them manually by pasting the code for them into AdvancedOptions.|
!!!End
<<tagCloud>>
/%<<tagCloud systemConfig systemTiddlers>> exclude tags%/
<<tagGrid "System Service Methodology Enterprise Notebook MindMap Personal TiddlyWiki" exclude:tags all exclude:tags startcolor endcolor open colorall sortrows sortcolumns>>
/***
''Plugin:'' Tag Cloud Macro
''Author:'' Clint Checketts
''Source URL:''
!Usage
<<tagCloud>>
!Code
***/
//{{{
version.extensions.tagCloud = {major: 1, minor: 0 , revision: 0, date: new Date(2006,2,04)};
//Created by Clint Checketts, contributions by Jonny Leroy and Eric Shulman
config.macros.tagCloud = {
noTags: "No tag cloud created because there are no tags.",
tooltip: "%1 tiddlers tagged with '%0'"
};
config.macros.tagCloud.handler = function(place,macroName,params) {
var tagCloudWrapper = createTiddlyElement(place,"div",null,"tagCloud",null);
var tags = store.getTags();
for (var t=0; t<tags.length; t++) {
for (var p=0;p<params.length; p++) if (tags[t][0] == params[p]) tags[t][0] = "";
}
if(tags.length == 0)
createTiddlyElement(tagCloudWrapper,"span",null,null,this.noTags);
//Findout the maximum number of tags
var mostTags = 0;
for (var t=0; t<tags.length; t++) if (tags[t][0].length > 0){
if (tags[t][1] > mostTags) mostTags = tags[t][1];
}
//divide the mostTags into 4 segments for the 4 different tagCloud sizes
var tagSegment = mostTags / 4;
for (var t=0; t<tags.length; t++) if (tags[t][0].length > 0){
var tagCloudElement = createTiddlyElement(tagCloudWrapper,"span",null,null,null);
tagCloudWrapper.appendChild(document.createTextNode(" "));
var theTag = createTiddlyButton(tagCloudElement,tags[t][0],this.tooltip.format(tags[t]),onClickTag,"tagCloudtag tagCloud" + (Math.round(tags[t][1]/tagSegment)+1));
theTag.setAttribute("tag",tags[t][0]);
}
};
setStylesheet(".tagCloud span{height: 1.8em;margin: 3px;}.tagCloud1{font-size: 1.2em;}.tagCloud2{font-size: 1.4em;}.tagCloud3{font-size: 1.6em;}.tagCloud4{font-size: 1.8em;}.tagCloud5{font-size: 1.8em;font-weight: bold;}","tagCloudsStyles");
//}}}
/***
|Name|TagGridPlugin|
|Source|http://www.TiddlyTools.com/#TagGridPlugin|
|Documentation|http://www.TiddlyTools.com/#TagGridPluginInfo|
|Version|1.6.5|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Generate a cross-referenced grid of tiddlers, based on tag values|
!!!!!Documentation
>see [[TagGridPluginInfo]]
!!!!!Revisions
<<<
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info tiddler
2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.07.24 [1.6.5] corrected handling for @TiddlerName with excluded tags, so that excluded tags are not actually removed from the @TiddlerName source tiddler.
|please see [[TagGridPluginInfo]] for additional revision details|
2006.10.05 [1.0.0] initial release (converted from prototype inline script)
<<<
!!!!!Code
***/
//{{{
version.extensions.tagGrid= {major: 1, minor: 6, revision: 5, date: new Date(2007,7,24)};
config.macros.tagGrid= {
verbose:false, // display debugging/performance feedback messages
warn:true, // display workload warning message before rendering
threshold:300000, // workload warning threshold (workload=# of comparisons to perform)
handler:
function(place,macroName,params) {
// get columns
var columntags=params.shift(); var cols=[];
if ((!columntags)||(columntags=="all")) // no param (or "all") - use all tags
{ var all=store.getTags(); for (i=0;i<all.length;i++) cols.push(all[i][0]); }
else if (columntags.substr(0,1)=="+") // get tag list from tiddler content
{ var t=store.getTiddlerText(columntags.substr(1)); if (t&&t.length) cols=t.readBracketedList(); }
else if (columntags.substr(0,1)=="@") // get tag list from tiddler tags
{ var t=store.getTiddler(columntags.substr(1)); if (t&&t.tags) for (i=0;i<t.tags.length;i++) cols.push(t.tags[i]); }
else if (columntags.substr(0,1)=="=") // get names of "tagtiddlers" tagged with meta-tag
{ var t=store.getTaggedTiddlers(columntags.substr(1)); for (i=0;i<t.length;i++) cols.push(t[i].title); }
else cols=columntags.readBracketedList();
if (!cols.length) { wikify("~TagGrid: no columns to display\n",place); return; }
// exclude specific column tags
if (params[0]&¶ms[0].substr(0,8)=="exclude:") {
var ex=params.shift().substr(8).readBracketedList();
for (x=0; x<ex.length; x++) {
var i=cols.indexOf(ex[x]);
if (i!=-1) cols.splice(i,1); // remove excluded tags
}
}
// get rows
var rowtags=params.shift(); var rows=[];
if ((!rowtags)||(rowtags=="all")) // no param (or "all") - use all tags
{ var all=store.getTags(); for (i=0;i<all.length;i++) rows.push(all[i][0]); }
else if (rowtags.substr(0,1)=="+") // get tag list from tiddler content
{ var t=store.getTiddlerText(rowtags.substr(1)); if (t&&t.length) rows=t.readBracketedList(); }
else if (rowtags.substr(0,1)=="@") // get tag list from tiddler tags
{ var t=store.getTiddler(rowtags.substr(1)); if (t&&t.tags) for (i=0;i<t.tags.length;i++) rows.push(t.tags[i]); }
else if (rowtags.substr(0,1)=="=") // get names of "tagtiddlers" tagged with meta-tag
{ var t=store.getTaggedTiddlers(rowtags.substr(1)); for (i=0;i<t.length;i++) rows.push(t[i].title); }
else rows=rowtags.readBracketedList();
if (!rows.length) { wikify("~TagGrid: no rows to display\n",place); return; }
// exclude specific row tags
if (params[0]&¶ms[0].substr(0,8)=="exclude:") {
var ex=params.shift().substr(8).readBracketedList();
for (x=0; x<ex.length; x++) {
var i=rows.indexOf(ex[x]);
if (i!=-1) rows.splice(i,1); // remove excluded tags
}
}
// get optional flag keywords and/or color gradient endpoints
var defOpen=false;
var colorAll=false;
var sortRows=false;
var sortColumns=false;
var showInline=false;
var p=params.shift();
while (p) {
switch (p.toUpperCase()) {
case "OPEN":
defOpen=true; break;
case "COLORALL":
colorAll=true; break;
case "SORTROWS":
sortRows=true; break;
case "SORTCOLUMNS":
sortColumns=true; break;
case "INLINE":
showInline=true; break;
default:
if (startcolor==undefined) var startcolor=p;
else if (endcolor==undefined) var endcolor=p;
else alert("unexpected parameter: '"+p+"'");
break;
}
p=params.shift();
}
// get the tiddlers
var tiddlers=store.getTiddlers("modified","excludeLists");
// show "workload warning"... get permission to proceed...
if (this.warn) {
var workload=rows.length*cols.length*tiddlers.length;
var warning="Cross-indexing %0 tiddlers in %1 row%3 by %2 column%4...\n(up to %5 comparisons MAY be needed)\n\n";
warning+="This may take a while. It is OK to proceed?";
warning=warning.format([tiddlers.length,rows.length,cols.length,rows.length!=1?"s":"",cols.length!=1?"s":"",workload]);
if (workload>this.threshold&&!confirm(warning)) { wikify("~TagGrid: display cancelled by user\n",place); return; }
}
// sort row and column tags in decending order, by frequency of use
if (sortRows||sortColumns) {
var tags=store.getTags(); var tagcount={}; for (i=0; i<tags.length; i++) tagcount[tags[i][0]]=tags[i][1];
if (sortRows) rows.sort(function(a,b){return (!tagcount[a]||tagcount[a]<tagcount[b])?+1:(tagcount[a]==tagcount[b]?0:-1);});
if (sortColumns) cols.sort(function(a,b){return (!tagcount[a]||tagcount[a]<tagcount[b])?+1:(tagcount[a]==tagcount[b]?0:-1);});
}
// cross-index tiddlers by tags, building lists of tiddler titles into grid[i][j] (sparse array)
var time1=new Date();
var grid=new Array();
var max=0; // track maximum cross-index value
for (var t=0;t<tiddlers.length;t++) { // for each tiddler
for (var i=0;i<tiddlers[t].tags.length;i++) { // for each tag in tiddler
var row=rows.indexOf(tiddlers[t].tags[i]); if (row==-1) continue; // this tag not in rows
if (!grid[row]) grid[row]=new Array(); // create row as needed
for (var j=0;j<tiddlers[t].tags.length;j++) { // for each tag in tiddler
var col=cols.indexOf(tiddlers[t].tags[j]); if (col==-1) continue; // this tag not in columns
if (!grid[row][col]) grid[row][col]=new Array(); // create cell
grid[row][col].push("[["+tiddlers[t].title+"]]"); // add tiddler title to cell
if (max<grid[row][col].length) max=grid[row][col].length; // check for new maximum
}
}
}
// compute gradient color map
if (startcolor && endcolor) {
var digits="0123456789ABCDEF";
function hexToDec(s) // 2-digit conversion
{ return digits.indexOf(s.substr(0,1).toUpperCase())*16+digits.indexOf(s.substr(1,1).toUpperCase()); }
function decToHex(d) // 2-digit conversion
{ return digits.substr(Math.floor(d/16),1)+digits.substr(d%16,1); }
var steps=max;
var startR=hexToDec(startcolor.substr(0,2));
var startG=hexToDec(startcolor.substr(2,2));
var startB=hexToDec(startcolor.substr(4,2));
var endR=hexToDec(endcolor.substr(0,2));
var endG=hexToDec(endcolor.substr(2,2));
var endB=hexToDec(endcolor.substr(4,2));
var rangeR=endR-startR;
var rangeG=endG-startG;
var rangeB=endB-startB;
var stepR=rangeR/steps; if (stepR>0) stepR=Math.floor(stepR); else stepR=Math.ceil(stepR);
var stepG=rangeG/steps; if (stepG>0) stepG=Math.floor(stepG); else stepG=Math.ceil(stepG);
var stepB=rangeB/steps; if (stepB>0) stepB=Math.floor(stepB); else stepB=Math.ceil(stepB);
var colors=[];
colors[0]=startcolor;
for (var i=1; i<steps; i++)
colors[i]=decToHex(startR+stepR*i)+decToHex(startG+stepG*i)+decToHex(startB+stepB*i);
colors[steps-1]=endcolor; // fixup for roundoff error
}
// generate HTML table containing popups (and optional inline links)
var time2=new Date();
var out="<html><table cellpadding='0' cellspacing='0' style='border:0;border-collapse:collapse'>";
// column headings
out+="<tr style='border:0;'><td style='text-align:right;border:0'>";
out+="<a href='' style='font-size:80%;'";
out+=" title='show all column headings'";
out+=" onclick='return config.macros.tagGrid.toggleAllColumns(this,event,"+defOpen+")'>"+(defOpen?"<<<":">>>")+"</a>";
out+="</td>";
for (var i=0;i<cols.length;i++) {
out+="<td style='text-align:center;cursor:pointer;border:0;padding-left:2px;padding-right:2px' ";
out+=" title='show/hide column heading' ";
out+=" onclick='return config.macros.tagGrid.toggleColumn(this,event)'>";
out+="<a href='' title='open tag tiddler'";
if (!defOpen) out+=" style='display:none' ";
out+=" onclick='story.displayTiddler(this,\""+cols[i]+"\");return false'>"+cols[i]+"</a>";
out+="</td>";
}
out+="</tr>";
for (var i=0;i<rows.length;i++) {
// row heading
var rowlink="<a href='' onclick='story.displayTiddler(this,\""+rows[i]+"\");return false'>"+rows[i]+"</a>";
out +="<tr style='border:0'>";
out +="<td style='text-align:right;border:0;padding-right:2px'>"+rowlink+"</td>";
for (var j=0;j<cols.length;j++) {
var content="";
var bgcolor="transparent"; // default empty cell background
if (colors && colorAll) bgcolor="#"+colors[0]; // empty cell background uses startcolor
var bordercolor=""; // default border color (inherits current CSS value)
if (colors) bordercolor="#"+colors[Math.floor(colors.length/2-1)]; // border uses mid-tone color
var linkstyle=""; // use default unless background color is very light or very dark
var cross=(grid[i]&&grid[i][j])?grid[i][j]:null;
var hdr=rows[i]+(rows[i]!=cols[j]?(" + "+cols[j]):"");
if (cross) {
// cross-tagged list of tiddlers (in a popup)
var label="<b>"+cross.length+"</b>";
var tip=hdr;
var list=cross.sort().join(' ').replace(/'/g,"\\'").replace(/"/g,'"');
var handler="return config.macros.tagGrid.popup(this,event,\'"+rows[i]+"\',\'"+cols[j]+"\',\'"+list+"\')";
if (colors) {
var c=colors[cross.length-1];
bgcolor="#"+c;
linkstyle="style='color:#000000 !important'";
// invert link color if background is very light
if (c.substr(0,2)<"60" || c.substr(2,2)<"60" || c.substr(4,2)<"60")
linkstyle="style='color:#FFFFFF !important'";
}
} else {
var label=" - ";
var tip="create a new tiddler tagged with: "+hdr;
var list="";
var handler="var title=config.macros.newTiddler.title;";
handler+="story.displayTiddler(this,title,DEFAULT_EDIT_TEMPLATE);";
handler+="story.setTiddlerTag(title,\'"+rows[i]+"\',+1);";
handler+="story.setTiddlerTag(title,\'"+cols[j]+"\',+1);";
handler+="story.focusTiddler(title,\'text\');return(false);";
}
if (!showInline || !cross)
content+='<a href="javascript:;" '+linkstyle+' onclick="'+handler+'" title="'+tip+'">'+label+'</a>';
if (showInline && cross) {
content+="<div "+linkstyle+"><span style='white-space:nowrap'>";
content+=hdr+" ("+label+")";
content+="</span></div><hr>";
// list tiddler links inline in table cell
for (t=0; t<cross.length; t++) {
var title=cross[t].replace(/\[\[/g,'').replace(/\]\]/g,'');
var handler="story.displayTiddler(null,'"+title+"');return false;"
var tid=store.getTiddler(title);
var author=tid.modifier;
var date=tid.modified.toLocaleString();
var tip=config.messages.tiddlerLinkTooltip.format([title,author,date]);
if (t>0) content+="<br>";
content+='<a href="javascript:;" '+linkstyle+' onclick="'+handler+'" title="'+tip+'">'+title+'</a>';
}
content+="<hr>";
handler="var tids=\'"+list+"\'.readBracketedList();story.displayTiddlers(this,tids); return(false);"
tip="display all tiddlers tagged with: "+hdr;
content+='<a href="javascript:;" '+linkstyle+' onclick="'+handler+'" title="'+tip+'">open all...</a><br>';
handler="var title=config.macros.newTiddler.title;";
handler+="story.displayTiddler(this,title,DEFAULT_EDIT_TEMPLATE);";
handler+="story.setTiddlerTag(title,\'"+rows[i]+"\',+1);";
handler+="story.setTiddlerTag(title,\'"+cols[j]+"\',+1);";
handler+="story.focusTiddler(title,'text'); return(false);"
tip="create a new tiddler tagged with: "+hdr;
content+='<a href="javascript:;" '+linkstyle+' onclick="'+handler+'" title="'+tip+'">new tiddler...</a>';
}
out+="<td style='background-color:"+bgcolor+";border:1px solid "+bordercolor+" !important;text-align:center'>"+content+"</td>";
}
out+="</tr>";
}
out+="</table>";
out+="</html>";
createTiddlyElement(place,"span").innerHTML=out;
var time3=new Date();
if (this.verbose) displayMessage("TagGrid: scan="+(time2-time1)+", generate table="+(time3-time2));
},
popup:
function(here,event,row,col,list) {
var tids=list.replace(/"/g,'"').readBracketedList();
var hdr=row+(row!=col?(" AND "+col):"");
if (tids.length) {
var p=Popup.create(here); if (!p) return;
createTiddlyText(p,hdr);
createTiddlyElement(p,'hr');
for(var t=0; t<tids.length; t++) createTiddlyLink(createTiddlyElement(p,'li'),tids[t],true);
createTiddlyElement(p,'hr');
createTiddlyButton(createTiddlyElement(p,'li'),
"open all...", "display all tiddlers tagged with: "+hdr,
function(){story.displayTiddlers(null,tids); return(false);});
var a=createTiddlyButton(createTiddlyElement(p,'li'),
"new tiddler...", "create a new tiddler tagged with: "+hdr,
function(){
var title=config.macros.newTiddler.title;
story.displayTiddler(this,title,DEFAULT_EDIT_TEMPLATE);
story.setTiddlerTag(title,this.getAttribute("rowtag"),+1);
story.setTiddlerTag(title,this.getAttribute("coltag"),+1);
story.focusTiddler(title,"text");
return(false);
});
a.setAttribute("rowtag",row);
a.setAttribute("coltag",col);
Popup.show(p,false);
}
event.cancelBubble = true;
if (event.stopPropagation) event.stopPropagation();
return(false);
},
toggleAllColumns:
function(here,event,defOpen) {
if (here.expanded==undefined) here.expanded=defOpen;
var ex=here.expanded=!here.expanded;
here.innerHTML=ex?"<<<":">>>";
here.title=ex?'hide all column headings':'show all column headings';
var cells=here.parentNode.parentNode.getElementsByTagName("td");
for (i=1; i<cells.length; i++) cells[i].firstChild.style.display=ex?"inline":"none";
event.cancelBubble = true;
if (event.stopPropagation) event.stopPropagation();
return(false);
},
toggleColumn:
function(here,event) {
here.firstChild.style.display=(here.firstChild.style.display=="none")?"inline":"none";
event.cancelBubble = true;
if (event.stopPropagation) event.stopPropagation();
return(false);
}
};
//}}}
/***
|Name|TagGridPluginInfo|
|Source|http://www.TiddlyTools.com/#TagGridPlugin|
|Documentation|http://www.TiddlyTools.com/#TagGridPluginInfo|
|Version|1.6.5|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|documentation|
|Requires||
|Overrides||
|Description|documentation for TagGridPlugin|
!!!!!Usage
<<<
Specify which tags should be used for the columns and rows of the grid to ''see a particular cross-section'' of your document, or use //all// tags to ''get an instant 'birds-eye' overview of your entire document''.
Each grid cell contains a label with the number of tiddlers in that grid cell. Click the number to ''show a popup of cross-indexed tiddler titles''. Grid cells with no matching tiddlers contain a "-" (dash) that can be clicked to ''create new tiddlers automatically pre-tagged with that cell's combination of tags.''
To keep the grid display from getting very wide, the grid tags used as column headings are not initially displayed. ''Click directly above the column to show/hide that heading'', or toggle all column headings at once by clicking the {{{>>>}}} symbol in the upper-left corner of the grid display. Clicking a displayed row/column tag heading opens the tiddler whose title is that tag name.
The macro syntax to include a tag grid in your tiddler content is:
{{{<<tagGrid columntags exclude:tags rowtags exclude:tags startcolor endcolor open inline colorall sortrows sortcolumns>>}}}
where:
''rowtags/columntags'' are each:
* a ''quoted'' space-separated lists of tags: {{{"tag1 tag2 [[tag3 with spaces]] tag4 ..."}}}
* //or,// a tiddler name preceded by "+": {{{+TiddlerName}}} where the specified tiddler contains a space-separated list of tags (same format as DefaultTiddlers)
* //or,// a tiddler name preceded by "@": {{{@TiddlerName}}} to use the same tags as those that are tagging the specified tiddler (i.e., the tiddler is a representative example of the kind of tags you are interested in cross-indexing)
* //or,// a tag name preceded by "=": {{{=tagName}}} to use the group of tags that are themselves, in turn, tagged with the indicated tagName (i.e., useful when you have defined a 'meta-tag'/classification system, a.k.a. "TagglyTagging" techniques)
* //or,// keyword: {{{all}}} (use all tags)
* if only columntags are specified, rows display all tags by default
* if no parameters are provided, both rows and columns display all tags
''exclude:tag tag tag''
* This optional parameter can be placed immediately following the columntags and/or rowtags parameter to selectively omit certain tags from the grid display. You can exclude several tags at once by enclosing the entire parameter in quotes, e.g.: {{{"exclude:tag tag tag"}}}
''startcolor/endcolor''
* describes a ''color gradient'' where the grid cell background color is calculated as a combination of the starting and ending colors, in proportion to the cell value
* colors are specified using 6-digit hex-coded RGB values (e.g., red="FF0000", green="00FF00", blue="0000FF")
* the cells with the lowest number use the starting background color
* the cells with the highest number use the ending background color
* if one or both color values are omitted, all cells have //transparent// backgrounds
''open''
* causes the grid column headings to be shown when the grid is initially displayed (you can hide all the column headings using the ⇐ link, or just toggle one heading by clicking //near// the tag text. (Note: clicking //on// the tag text will open the tiddler with the same name as the tag.
''inline''
* by default, cells with cross-indexed tiddlers display the total number of tiddlers in the cell. When this number is clicked, a popup is displayed, containing links to the individual tiddlers in that cell. However, the popup display makes it difficult to compare the contents of two or more cells because only one popup can be displayed at any given time. To address this, you can use the ''inline'' keyword parameter to ''display the grid contents directly in the cells'', without using any popups. While this can make the grid display significantly larger (to fit the text of each cell), it also enables quick comparisons between cells. Inline rendering of the cell contents also makes it possible to print the entire grid contents for easy off-line reporting and analysis.
''colorall''
* by default, cells with no cross-indexed tiddlers have a //transparent// background (e.g., the tiddler's background colors shows through). However, this can create a 'patchwork' appearance to the grid. Add the ''colorall'' keyword parameter to force these 'empty' cells to use the specified startcolor instead of a transparent background.
''sortrows/sortcolumns''
* rowtags and columntags are normally displayed in the order specified in the macro parameters, or in alphabetical order when ''all'' is used to generate the list of tags. Adding the ''sortrows'' and/or ''sortcolumns'' keyword parameters will sort the tags in decending order so that the most frequently used tags are displayed first (i.e., towards the top-left corner).
<<<
!!!!!Examples
<<<
{{{<<tagGrid +FavoriteTags +FavoriteTags eeeeff 3333ff colorall sortrows sortcolumns>>}}}
<<tagGrid +FavoriteTags +FavoriteTags eeeeff 3333ff colorall sortrows sortcolumns>>
<<<
!!!!!Revisions
<<<
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info tiddler
2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.07.24 [1.6.5] corrected handling for @TiddlerName with excluded tags, so that excluded tags are not actually removed from the @TiddlerName source tiddler.
2007.07.04 [1.6.4] fix fatal "unterminated string" popup error caused by tiddlers containing double-quotes (now being encoded using """)
2007.03.08 [1.6.3] use global flag to replace ALL single-quotes in tiddler titles (fixes popups where more than one tiddler title had a ' in it)
2007.03.06 [1.6.2] removed debugging alert()s... D'oh!
2007.03.06 [1.6.1] fix handling for excluding tags (was only removing last tag in list)
2007.03.05 [1.6.0] added "exclude:tag tag tag..." parameter handling for both rows and columns
2006.12.20 [1.5.1] fixed bordercolor calculation and CSS so grid correctly uses midtone-color for table cell borders
2006.12.09 [1.5.0] added 'inline' keyword parameter to display tiddler titles directly in grid cells (in addition to popup)
2006.11.03 [1.4.0] changed {{{=TiddlerName}}} param usage to {{{@TiddlerName}}} and added {{{=tagName}}} usage for specifying TagglyTagging "meta-tagged" groups of tag (based on ideas by GregWolff)
2006.11.03 [1.3.3] performance optimization: calculate maximum cross-index value while building grid (eliminates extra calc during colormapping)
2006.10.29 [1.3.2] fixes for IE: in decToHex and hexToDec, use substr() instead array indexing. Also, use {{{>>>}}} and {{{<<<}}} instead of {{{⇒}}} and {{{⇐}}} for 'toggle headings' link text
2006.10.29 [1.3.1] suppress border around table
2006.10.21 [1.3.0] added {{{=TiddlerName}}} and {{{open}}} parameter handling
2006.10.17 [1.2.1] fixed row/column sorting to properly sort undefined tags to the end of the list
2006.10.16 [1.2.0] added optional row/column sorting and improved parameter parsing
2006.10.15 [1.1.0] added features: background gradients, collapsible column headings, eliminated table borders around row/column headings
2006.10.06 [1.0.1] calls to displayTiddler() use 'this' instead of 'null'
2006.10.05 [1.0.0] initial release (converted from prototype inline script)
<<<
''Links for various resources about Tiddling''
<<gradient horiz #fc3 #fff>>[[TiddlyWiki Formate Guide|http://www.scribd.com/doc/2189287/Tiddlywiki-Formatting-Guide]]>>
<<gradient horiz #fc3 #fff>>[[Tiddly Extension Index|http://tiddlyvault.tiddlyspot.com/]]>>
<<gradient horiz #fc3 #fff>>[[Tiddly Help for customization|http://twhelp.tiddlyspot.com/]]>>
<<gradient horiz #fc3 #fff>>[[Tiddly tools, many plugins and scripts|http://www.tiddlytools.com/]]>>
<<gradient horiz #fc3 #fff>>[[Visual TW, visual effects|http://visualtw.ouvaton.org/VisualTW.html]]>>
<<gradient horiz #fc3 #fff>>[[TWiki, with printable, and other hints|http://www.penlug.org/twiki/bin/view/TWiki/WebHome]]>>
<<gradient horiz #fc3 #fff>>[[WikiMaps - putting together Free Mind Mapping and Wiki with Ruby on Rails|http://wikimaps.rubyforge.org/]]>>
<<gradient horiz #fc3 #fff>>[[Info management software: FreeMind (for mind-mapping) and TiddlyWiki (for everything else)|http://www.andybrain.com/archive/mind-mapping-organization-software.htm]]>>
<<gradient horiz #fc3 #fff>>[[SWFObject: Javascript Flash Player detection and embed script|http://osflash.org/flashobject]]>>
/***
|''Name:''|TiddlersBarPlugin|
|''Description:''|A bar to switch between tiddlers through tabs (like browser tabs bar). Modified by Hui Li to include permalink, Mar 26, 2008.|
|''Version:''|1.2.5|
|''Date:''|Jan 18,2008|
|''Source:''|http://visualtw.ouvaton.org/VisualTW.html|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''~CoreVersion:''|2.1.0|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0, others|
!Demos
On [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], open several tiddlers to use the tabs bar.
!Installation
#import this tiddler from [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] (tagged as systemConfig)
#save and reload
#''if you're using a custom [[PageTemplate]]'', add {{{<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>}}} before {{{<div id='tiddlerDisplay'></div>}}}
#optionally, adjust StyleSheetTiddlersBar
!Tips
*Doubleclick on the tiddlers bar (where there is no tab) create a new tiddler.
*Tabs include a button to close {{{x}}} or save {{{!}}} their tiddler.
*By default, click on the current tab close all others tiddlers.
!Configuration options
<<option chkDisableTabsBar>> Disable the tabs bar (to print, by example).
<<option chkHideTabsBarWhenSingleTab >> Automatically hide the tabs bar when only one tiddler is displayed.
<<option txtSelectedTiddlerTabButton>> ''selected'' tab command button.
<<option txtPreviousTabKey>> previous tab access key.
<<option txtNextTabKey>> next tab access key.
!Code
***/
//{{{
config.options.chkDisableTabsBar = config.options.chkDisableTabsBar ? config.options.chkDisableTabsBar : false;
config.options.chkHideTabsBarWhenSingleTab = config.options.chkHideTabsBarWhenSingleTab ? config.options.chkHideTabsBarWhenSingleTab : false;
config.options.txtSelectedTiddlerTabButton = config.options.txtSelectedTiddlerTabButton ? config.options.txtSelectedTiddlerTabButton : "closeOthers";
config.options.txtPreviousTabKey = config.options.txtPreviousTabKey ? config.options.txtPreviousTabKey : "";
config.options.txtNextTabKey = config.options.txtNextTabKey ? config.options.txtNextTabKey : "";
config.macros.tiddlersBar = {
tooltip : "see ",
tooltipClose : "click here to close this tab",
tooltipSave : "click here to save this tab",
promptRename : "Enter tiddler new name",
currentTiddler : "",
previousState : false,
previousKey : config.options.txtPreviousTabKey,
nextKey : config.options.txtNextTabKey,
tabsAnimationSource : null, //use document.getElementById("tiddlerDisplay") if you need animation on tab switching.
handler: function(place,macroName,params) {
var previous = null;
if (config.macros.tiddlersBar.isShown())
story.forEachTiddler(function(title,e){
if (title==config.macros.tiddlersBar.currentTiddler){
var d = createTiddlyElement(null,"span",null,"tab tabSelected");
config.macros.tiddlersBar.createActiveTabButton(d,title);
if (previous && config.macros.tiddlersBar.previousKey) previous.setAttribute("accessKey",config.macros.tiddlersBar.nextKey);
previous = "active";
}
else {
var d = createTiddlyElement(place,"span",null,"tab tabUnselected");
var btn = createTiddlyButton(d,title,config.macros.tiddlersBar.tooltip + title,config.macros.tiddlersBar.onSelectTab);
btn.setAttribute("tiddler", title);
if (previous=="active" && config.macros.tiddlersBar.nextKey) btn.setAttribute("accessKey",config.macros.tiddlersBar.previousKey);
previous=btn;
}
var isDirty =story.isDirty(title);
var c = createTiddlyButton(d,isDirty ?"!":"x",isDirty?config.macros.tiddlersBar.tooltipSave:config.macros.tiddlersBar.tooltipClose, isDirty ? config.macros.tiddlersBar.onTabSave : config.macros.tiddlersBar.onTabClose,"tabButton");
c.setAttribute("tiddler", title);
if (place.childNodes) {
place.insertBefore(document.createTextNode(" "),place.firstChild); // to allow break line here when many tiddlers are open
place.insertBefore(d,place.firstChild);
}
else place.appendChild(d);
})
},
refresh: function(place,params){
removeChildren(place);
config.macros.tiddlersBar.handler(place,"tiddlersBar",params);
if (config.macros.tiddlersBar.previousState!=config.macros.tiddlersBar.isShown()) {
story.refreshAllTiddlers();
if (config.macros.tiddlersBar.previousState) story.forEachTiddler(function(t,e){e.style.display="";});
config.macros.tiddlersBar.previousState = !config.macros.tiddlersBar.previousState;
}
},
isShown : function(){
if (config.options.chkDisableTabsBar) return false;
if (!config.options.chkHideTabsBarWhenSingleTab) return true;
var cpt=0;
story.forEachTiddler(function(){cpt++});
return (cpt>1);
},
selectNextTab : function(){ //used when the current tab is closed (to select another tab)
var previous="";
story.forEachTiddler(function(title){
if (!config.macros.tiddlersBar.currentTiddler) {
story.displayTiddler(null,title);
// for permalink
if (!window.story) window.story=window;
var t = encodeURIComponent(String.encodeTiddlyLink(title));
if(window.location.hash != t) window.location.hash = t;
// end permalink
return;
}
if (title==config.macros.tiddlersBar.currentTiddler) {
if (previous) {
story.displayTiddler(null,previous);
// for permalink
if (!window.story) window.story=window;
var t = encodeURIComponent(String.encodeTiddlyLink(previous));
if(window.location.hash != t) window.location.hash = t;
// end permalink
return;
}
else config.macros.tiddlersBar.currentTiddler=""; // so next tab will be selected
}
else previous=title;
});
},
onSelectTab : function(e){
var t = this.getAttribute("tiddler");
if (t) story.displayTiddler(null,t);
// for permalink
if (!window.story) window.story=window;
var tt = encodeURIComponent(String.encodeTiddlyLink(t));
if(window.location.hash != tt) window.location.hash = tt;
// end permalink
return false;
},
onTabClose : function(e){
var t = this.getAttribute("tiddler");
if (t) {
if(story.hasChanges(t) && !readOnly) {
if(!confirm(config.commands.cancelTiddler.warning.format([t])))
return false;
}
story.closeTiddler(t);
}
return false;
},
onTabSave : function(e) {
var t = this.getAttribute("tiddler");
if (!e) e=window.event;
if (t) config.commands.saveTiddler.handler(e,null,t);
return false;
},
onSelectedTabButtonClick : function(event,src,title) {
var t = this.getAttribute("tiddler");
if (!event) event=window.event;
if (t && config.options.txtSelectedTiddlerTabButton && config.commands[config.options.txtSelectedTiddlerTabButton])
config.commands[config.options.txtSelectedTiddlerTabButton].handler(event, src, t);
return false;
},
onTiddlersBarAction: function(event) {
var source = event.target ? event.target.id : event.srcElement.id; // FF uses target and IE uses srcElement;
if (source=="tiddlersBar") story.displayTiddler(null,'New Tiddler',DEFAULT_EDIT_TEMPLATE,false,null,null);
},
createActiveTabButton : function(place,title) {
if (config.options.txtSelectedTiddlerTabButton && config.commands[config.options.txtSelectedTiddlerTabButton]) {
var btn = createTiddlyButton(place, title, config.commands[config.options.txtSelectedTiddlerTabButton].tooltip ,config.macros.tiddlersBar.onSelectedTabButtonClick);
btn.setAttribute("tiddler", title);
}
else
createTiddlyText(place,title);
}
}
story.coreCloseTiddler = story.coreCloseTiddler? story.coreCloseTiddler : story.closeTiddler;
story.coreDisplayTiddler = story.coreDisplayTiddler ? story.coreDisplayTiddler : story.displayTiddler;
story.closeTiddler = function(title,animate,unused) {
if (title==config.macros.tiddlersBar.currentTiddler)
config.macros.tiddlersBar.selectNextTab();
story.coreCloseTiddler(title,false,unused); //disable animation to get it closed before calling tiddlersBar.refresh
var e=document.getElementById("tiddlersBar");
if (e) config.macros.tiddlersBar.refresh(e,null);
}
story.displayTiddler = function(srcElement,tiddler,template,animate,unused,customFields,toggle){
story.coreDisplayTiddler(config.macros.tiddlersBar.tabsAnimationSource,tiddler,template,animate,unused,customFields,toggle);
var title = (tiddler instanceof Tiddler)? tiddler.title : tiddler;
if (config.macros.tiddlersBar.isShown()) {
story.forEachTiddler(function(t,e){
if (t!=title) e.style.display="none";
else e.style.display="";
})
config.macros.tiddlersBar.currentTiddler=title;
}
var e=document.getElementById("tiddlersBar");
if (e) config.macros.tiddlersBar.refresh(e,null);
}
var coreRefreshPageTemplate = coreRefreshPageTemplate ? coreRefreshPageTemplate : refreshPageTemplate;
refreshPageTemplate = function(title) {
coreRefreshPageTemplate(title);
if (config.macros.tiddlersBar) config.macros.tiddlersBar.refresh(document.getElementById("tiddlersBar"));
}
ensureVisible=function (e) {return 0} //disable bottom scrolling (not useful now)
config.shadowTiddlers.StyleSheetTiddlersBar = "/*{{{*/\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar .button {border:0}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar .tab {white-space:nowrap}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar {padding : 1em 0.5em 2px 0.5em}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += ".tabUnselected .tabButton, .tabSelected .tabButton {padding : 0 2px 0 2px; margin: 0 0 0 4px;}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += ".tiddler, .tabContents {border:1px [[ColorPalette::TertiaryPale]] solid;}\n";
config.shadowTiddlers.StyleSheetTiddlersBar +="/*}}}*/";
store.addNotification("StyleSheetTiddlersBar", refreshStyles);
config.refreshers.none = function(){return true;}
config.shadowTiddlers.PageTemplate=config.shadowTiddlers.PageTemplate.replace(/<div id='tiddlerDisplay'><\/div>/m,"<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>\n<div id='tiddlerDisplay'></div>");
//}}}
/%
|Name|ToggleFullScreen|
|Source|http://www.TiddlyTools.com/#ToggleFullScreen|
|Version|1.1.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|show/hide main menu, sidebar and page header|
Usage: <<tiddler ToggleFullScreen with: label altlabel>>
%/<script label="$1" title="FULLSCREEN: toggle display of mainmenu, sidebar, and page header">
window.toggleFullScreen=function() {
config.options.chkFullScreen=!config.options.chkFullScreen;
var showmm=!config.options.chkFullScreen && config.options.chkShowLeftSidebar!==false;
var showsb=!config.options.chkFullScreen && config.options.chkShowRightSidebar!==false;
var showcrumbs=!config.options.chkFullScreen && config.options.chkShowBreadcrumbs!==false
&& config.macros.breadcrumbs && config.macros.breadcrumbs.crumbs.length;
var cw=document.getElementById('contentWrapper');
var da=document.getElementById('displayArea');
var mm=document.getElementById('mainMenu');
var sb=document.getElementById('sidebar');
var sm=document.getElementById('storyMenu');
var bc=document.getElementById('breadCrumbs');
if (cw){
for (var i=0; i<cw.childNodes.length; i++)
if (hasClass(cw.childNodes[i],'header')) { var h=cw.childNodes[i]; break; }
if (h) h.style.display=!config.options.chkFullScreen?'block':'none';
}
if (mm) {
mm.style.display=showmm?'block':'none';
da.style.marginLeft=showmm?(config.options.txtDisplayAreaLeftMargin||''):'1em';
}
if (sb) {
sb.style.display=showsb?'block':'none';
da.style.marginRight=showsb?(config.options.txtDisplayAreaRightMargin||''):'1em';
}
if (sm)
sm.style.display=!config.options.chkFullScreen ?'block':'none';
if (bc)
bc.style.display=showcrumbs?'block':'none';
var label=('$'+'1'=='$1')?'fullscreen':'$1';
var altlabel='$2'; if ('$'+'2'=='$2') altlabel=label;
if (typeof(place)!="undefined" && place!=window.place)
place.innerHTML=!config.options.chkFullScreen?label:altlabel;
var b=document.getElementById('restoreFromFullscreenButton');
if (b) removeNode(b);
else {
var b=createTiddlyElement(null,'span','restoreFromFullscreenButton','selected');
b.innerHTML='◊';
b.title='RESTORE: redisplay page header, menu and sidebar';
b.onclick=window.toggleFullScreen;
var s=b.style;
s.position='fixed'; s.zIndex='1001'; s.top='.3em'; s.right='.3em';
s.border='2px outset ButtonFace'; s.padding='0px 3px'; s.cursor='pointer'; s.fontSize='8pt';
s.backgroundColor='ButtonFace'; s.color='ButtonText !important;'; s.MozAppearance='button';
document.body.insertBefore(b,null);
}
return false;
};
window.toggleFullScreen();
return false;
</script><script>
place.lastChild.innerHTML=('$'+'1'=='$1')?'fullscreen':'$1';
</script>
/%
|Name|ToggleLeftSidebar|
|Source|http://www.TiddlyTools.com/#ToggleLeftSidebar|
|Version|1.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|show/hide left sidebar (MainMenu)|
Usage: <<tiddler ToggleLeftSidebar>>
Config settings:
config.options.txtToggleLeftSideBarLabelShow (►)
config.options.txtToggleLeftSideBarLabelHide (◄)
config.options.txtToggleLeftSideBarTipShow ("show left sidebar")
config.options.txtToggleLeftSideBarTipHide ("hide left sidebar")
%/<script label="show/hide left sidebar">
var mm=document.getElementById('mainMenu'); if (!mm) return;
var show=mm.style.display=='none';
if (!show) { mm.style.display='none'; var margin='1em'; }
else { mm.style.display='block'; var margin=config.options.txtDisplayAreaLeftMargin||''; }
if (typeof(place)!='undefined') {
place.innerHTML=show?
config.options.txtToggleLeftSideBarLabelHide:config.options.txtToggleLeftSideBarLabelShow;
place.title=show?
config.options.txtToggleLeftSideBarTipHide:config.options.txtToggleLeftSideBarTipShow;
}
document.getElementById('displayArea').style.marginLeft=margin;
config.options.chkShowLeftSidebar=show;
saveOptionCookie('chkShowLeftSidebar');
var sm=document.getElementById('storyMenu'); if (sm) config.refreshers.content(sm);
return false;
</script><script>
if (config.options.chkShowLeftSidebar==undefined)
config.options.chkShowLeftSidebar=true;
if (!config.options.txtDisplayAreaLeftMargin||!config.options.txtDisplayAreaLeftMargin.length)
config.options.txtDisplayAreaLeftMargin="13em";
if (config.options.txtToggleLeftSideBarLabelShow==undefined)
config.options.txtToggleLeftSideBarLabelShow="►";
if (config.options.txtToggleLeftSideBarLabelHide==undefined)
config.options.txtToggleLeftSideBarLabelHide=config.browser.isSafari?"◀":"◄";
if (config.options.txtToggleLeftSideBarTipShow==undefined)
config.options.txtToggleLeftSideBarTipShow="show left sidebar";
if (config.options.txtToggleLeftSideBarTipHide==undefined)
config.options.txtToggleLeftSideBarTipHide="hide left sidebar";
var show=config.options.chkShowLeftSidebar;
document.getElementById('mainMenu').style.display=show?"block":"none";
document.getElementById('displayArea').style.marginLeft=show?
config.options.txtDisplayAreaLeftMargin:"1em";
place.lastChild.innerHTML=show?
config.options.txtToggleLeftSideBarLabelHide:config.options.txtToggleLeftSideBarLabelShow;
place.lastChild.title=show?
config.options.txtToggleLeftSideBarTipHide:config.options.txtToggleLeftSideBarTipShow;
place.lastChild.style.fontWeight="normal";
</script>
/%
|Name|ToggleRightSidebar|
|Source|http://www.TiddlyTools.com/#ToggleRightSidebar|
|Version|1.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|show/hide right sidebar (SideBarOptions)|
Usage: <<tiddler ToggleRightSidebar>>
Config settings:
config.options.txtToggleRightSideBarLabelShow (◄)
config.options.txtToggleRightSideBarLabelHide (►)
config.options.txtToggleRightSideBarTipShow ("show right sidebar")
config.options.txtToggleRightSideBarTipHide ("hide right sidebar")
%/<script label="show/hide right sidebar">
var sb=document.getElementById('sidebar'); if (!sb) return;
var show=sb.style.display=='none';
if (!show) { sb.style.display='none'; var margin='1em'; }
else { sb.style.display='block'; var margin=config.options.txtDisplayAreaRightMargin||''; }
if (typeof(place)!='undefined') {
place.innerHTML=show?
config.options.txtToggleRightSideBarLabelHide:config.options.txtToggleRightSideBarLabelShow;
place.title=show?
config.options.txtToggleRightSideBarTipHide:config.options.txtToggleRightSideBarTipShow;
}
document.getElementById('displayArea').style.marginRight=margin;
config.options.chkShowRightSidebar=show;
saveOptionCookie('chkShowRightSidebar');
var sm=document.getElementById('storyMenu'); if (sm) config.refreshers.content(sm);
return false;
</script><script>
if (config.options.chkShowRightSidebar==undefined)
config.options.chkShowRightSidebar=true;
if (!config.options.txtDisplayAreaRightMargin||!config.options.txtDisplayAreaRightMargin.length)
config.options.txtDisplayAreaRightMargin="18em";
if (config.options.txtToggleRightSideBarLabelShow==undefined)
config.options.txtToggleRightSideBarLabelShow=config.browser.isSafari?"◀":"◄";
if (config.options.txtToggleRightSideBarLabelHide==undefined)
config.options.txtToggleRightSideBarLabelHide="►";
if (config.options.txtToggleRightSideBarTipShow==undefined)
config.options.txtToggleRightSideBarTipShow="show right sidebar";
if (config.options.txtToggleRightSideBarTipHide==undefined)
config.options.txtToggleRightSideBarTipHide="hide right sidebar";
var show=config.options.chkShowRightSidebar;
document.getElementById('sidebar').style.display=show?"block":"none";
document.getElementById('displayArea').style.marginRight=show?
config.options.txtDisplayAreaRightMargin:"1em";
place.lastChild.innerHTML=show?
config.options.txtToggleRightSideBarLabelHide:config.options.txtToggleRightSideBarLabelShow;
place.lastChild.title=show?
config.options.txtToggleRightSideBarTipHide:config.options.txtToggleRightSideBarTipShow;
place.lastChild.style.fontWeight="normal";
</script>
/%
|Name|ToggleTopButton|
|Source|http://www.TiddlyTools.com/#ToggleTopButton|
|Version|1.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|adds a floating "scroll to page top" button in the lower right corner of the window. |
%/<script>
window.showTopButton=function(show) {
// remove existing "top" button (if any)
var wrapper=document.getElementById("scrollToTopButton");
if (wrapper) removeNode(wrapper);
if (!show) return; // hiding button... we're done.
// create a toolbar button link that scrolls to the top of page
var wrapper=createTiddlyElement(null,"span","scrollToTopButton","selected");
e=createTiddlyElement(wrapper,"A",null,"","\u25b2");
e.title="scroll to top of page";
e.onclick=function(){window.scrollTo(0,0)};
// make it hover in the window bottom right corner margin
var s=wrapper.style;
s.position="fixed"; s.zIndex="1001";
s.bottom="0.2em"; s.right="3.6em";
s.cursor="pointer"; s.fontSize="9pt";
document.body.insertBefore(wrapper,null);
}
if (config.options.chkShowTopButton==undefined)
config.options.chkShowTopButton=true;
window.showTopButton(config.options.chkShowTopButton);
</script><<option chkShowTopButton>><script>
place.lastChild.onchange=function() {
window.showTopButton(this.checked);
config.options.chkShowTopButton=this.checked;
saveOptionCookie("chkShowTopButton");
};
</script> "scroll-to-top" button
/***
''TwHelpSearch'' for TiddlyWiki 2.0.x to 2.2.x
^^author: Morris S. Gray
source: http://twhelp.tiddlyspot.com/#TwHelpSearchPlugin
documentation: http://twhelp.tiddlyspot.com/#TWHelpSearchDoc
license: [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]^^
|>|>|>|<<search>> |
|>|>| look for in |>|>|>|
| <<option chkSearchTitles>> | <<option chkSearchText>> | <<option chkSearchTags>> | <<option chkHoldSearches>> |
| titles | text | tags | hold |
''A Plugin Tweak for:'' SearchOptionsPlugin
!!!!!Description
<<<
This plugin defines an alternative format for the SearchResults tiddler that is generated by the SearchOptionsPlugin . It presents the search results in tabular form numbering the rows; and showing the tiddler title, the size in bytes, and the tags. It is ready to be used with the [[SortableGridPlugin|http://solo.dc3.com/tw/#SortableGridPlugin]] (check versions) so any column can be sorted; such as size in ascending or descending order.
<<<
!!!!!Installation
<<<
Import (or copy/paste) the following tiddlers into your ~TiddlyWiki:
* http://twhelp.tiddlyspot.com/#TwHelpSearchPlugin
*SearchOptionsPlugin from http://www.tiddlytools.com/#SearchOptionsPlugin
* Get more documentation here [[TWHelpSearchDoc]] or here:
* http://twhelp.tiddlyspot.com/#TwHelpSearchDoc
<<<
!!!!!Revision History
<<<
''2007.09.12 [1.0.6]''
Added overflow scroll to TWHelp-SearchResults for long titles or tags.
''2006.02.03 [1.0.5]''
Added facility for holding the results of multiple searches with tick box on dashboard.
''2006.02.02 [1.0.4]''
Added several options, cleaned up design.Planning one version basic and one with added options this is the added options version.
''2006.01.27 [1.0.3''
Added a column for the size of the text in each tiddler, this does not include the size of the title or tags. Added overall TW statistics button requires TiddlerStatsPlugin.
''2006.01.23 [1.0.2 ]''
''a)''Changed function reportSearchResults(text,matches) to window.reportSearchResults=function(text,matches)
''b)''Added a line so that Incremental Search is automatically disabled config.options.chkSearchIncremental=false; turn off key-by-key searching
''c)''Removed space inside parens. bgcolor(#fe8 )" to "bgcolor(#fe8)". This
is what was causing IE to 'crap out' halfway through drawing the table
headings.
''d)''Added {{{config.options.chkSearchList=true;}}}
''2006.01.20 [1.0.1]''
ELS: reportSearchResults() definition moved to this Plugin Tweak tiddler and removed extranous code
''2006.01.19 [1.0.0]''
This is an adaptation of Eric Shulman's SearchOptionsPlugin. Adapted by MorrisGray to provide search results in table form. All the necessary controls for refining the search is provided within the table including slide-down access to AdvancedOptions.
<<<
!!!!!Code
***/
//{{{
if (config.options.chkSinglePageMode==undefined) config.options.chkSinglePageMode=false;
if (config.options.chkRegExpSearch==undefined) config.options.chkRegExpSearch=true;
if (config.options.chkSearchTitles==undefined) config.options.chkSearchTitles=false;
if (config.options.chkSearchText==undefined) config.options.chkSearchText=true;
if (config.options.chkSearchTags==undefined) config.options.chkSearchTags=false;
if (config.options.chkSearchTitlesFirst==undefined) config.options.chkSearchTitlesFirst=true;
if (config.options.chkSearchList==undefined) config.options.chkSearchList=true;
if (config.options.chkSearchIncremental==undefined) config.options.chkSearchIncremental=false;
if (config.options.chkToggleLinks==true) config.options.chkToggleLinks=false;
if (config.options.chkHoldSearches==undefined) config.options.chkHoldSearches=false;
if (config.options.chkSortTags==undefined) config.options.chkSortTags=false;
config.options.chkToggleLinks=false;
config.options.chkSinglePageMode=false;
config.options.chkHoldSearches=false;
config.options.chkSearchIncremental=false;
config.options.chkHttpReadOnly = false;
config.options.chkRegExpSearch=true;
config.options.chkSearchList=true;
config.options.chkToggleLinks=false;
config.shadowTiddlers.AdvancedOptions += "\n<<option chkHoldSearches>> Hold search results";
//}}}
//{{{
// Give the report a custom name
config.macros.search.reportTitle="TWHelp-SearchResults";
// Override default SearchOptionsPlugin formatting for SearchResults tiddler
window.reportSearchResults=function(text,matches)
{
var title=config.macros.search.reportTitle
config.macros.search.reportTitle;
var q = config.options.chkRegExpSearch ? "/" : "'";
if (!config.options.chkHoldSearches) body="";
body+="\n|>|bgcolor(#8af):@@color(#000080):''"+config.macros.search.successMsg.format([matches.length,q+"{{{"+text+"}}}"+q])+"''@@|bgcolor(#8af): @@color(#A00000): SearchHelp@@ "+"|"+"\n";
body+="|>|>|bgcolor(#E3FFE3):<<search>> <<option chkSearchTitles>> Titles <<option chkSearchText>> Text <<option chkSearchTags>>Tags <<option chkHoldSearches>> Hold |"+"\n";
body+="\n| |bgcolor(#8af): @@color(#000080):sort by: ''Titles''@@ |bgcolor(#8af): @@color(#000080): ''Size'' (bytes)@@ |bgcolor(#8af): @@color(#000080): ''Tags''@@ |h";
for(var t=0;t<matches.length;t++)
body+="\n"+"| "+(t+1)+"|[["+matches[t].title+"]]| "+matches[t].text.length+"|"+"@@"+matches[t].tags+"@@"+"|";
body+="\n";
// create/update the tiddler
var tiddler=store.getTiddler(title); if (!tiddler) tiddler=new Tiddler();
tiddler.set(title,body,config.options.txtUserName,(new Date()),"excludeLists excludeSearch killbookmark");
store.addTiddler(tiddler); story.closeTiddler(title);
// render tiddler
var oldprompt=config.macros.search.label;
config.macros.search.label="search again"; // use alternate "search again" label
story.displayTiddler(null,title,1); // force refresh
config.macros.search.label=oldprompt; // restore standard search label
}
//}}}
!!!!<<gradient horiz #fc3 #ffffff>>TwoColumns^^<<tiddler CloseThisOpen with: FormattingTiddlers '« back'>>|<<toolbar editTiddler>>» ^^>>
See the history of multiple columns [[here.|Multiple Columns in TW]]
''In ~FireFox only'' you can divide a tiddler into columns using these methods.
(Note: There is another method that works with all browsers using the [[PartTiddlerPlugin|PartPlugin]])
!!!How to
''Put this in your StyleSheet.''
<<<
{{{
.twocolumns { display:block; -moz-column-count:2; -moz-column-gap:1em; -moz-column-
width:50%;}
}}}
<<<
''Where you want multiple columns surround your text with this code:''
<<<
{{{
{{twocolumns{ here is much text in two columns}}}
}}}
<<<
''Three or four columns.''
<<<
{{{
.threecolumns { display:block; -moz-column-count:3; -moz-column-gap:1em; -moz-column-
width:33%}
.fourcolumns { display:block; -moz-column-count:4; -moz-column-gap:1em; -moz-column-
width:25%}
}}}
<<<
<<tiddler ThreeColumnExample>>
!!!!End of two columns
<div class='toolbar' macro='toolbar -closeTiddler closeOthers editTiddler permalink references jump'>
<span class='toolbar' macro='tiddler ToggleFullScreen'></span>
</div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<script>addthis_pub = 'huili';</script><html><a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s9.addthis.com/button1-share.gif" width="125" height="16" border="0" alt="" /></a></html><script src="http://s7.addthis.com/js/152/addthis_widget.js"></script>
<script>
if (!window.story) window.story=window;
var title=story.findContainingTiddler(place).getAttribute("tiddler");
var t = encodeURIComponent(String.encodeTiddlyLink(title));
if(window.location.hash != t) window.location.hash = t;
</script>
<html><a href="http://www.soisys.com" target="_blank"><strong>soisys.com</strong></a></html>: Data Analytics and beyond.
''Professional Activities'': Program Committee member for ~NFPSLAM-SOC'09, ACM Compute'09, ICPP'09. Member of IEEE CS, SAP SDN/SRN.
<html><span class="style2">New!</span></html> <html><a href="http://events.sti2.at/nfpslam-soc09/nfpslam-soc2009_cfp.txt" target="_blank">The 3rd Workshop on Non-Functional Properties and SLA Management in Service-Oriented Computing (NFPSLAM-SOC)</a></html>. In conjunction with ICSOC'09, November 24-27, 2009, Stockholm, Sweden.
<<gradient horiz #fc3 #fff>>''PUBLICATIONS''>>
<<tiddler Publications>>
Powered by ~TiddlyWiki <<version>> and optimized for Firefox. © Hui Li, 2008. <<tiddler ToggleTopButton>>
//{{{
//This ensures that the footer sticks to the bottom of the screen when there are no tiddlers open. If that is not desirable, it can be deleted.
function setFooter() {
if (document.getElementById && document.getElementById("contentFooter") ) {
var windowHeight=findWindowHeight();
if (windowHeight>0) {
var contentHeight= document.getElementById('mainMenu').offsetHeight + document.getElementById("header").offsetHeight + document.getElementById("contentFooter").offsetHeight;
var menu= document.getElementById('mainMenu');
if (windowHeight-(contentHeight)>=0) {
menu.style.position='relative';
menu.style.marginBottom=(windowHeight-(contentHeight))+'px';
}
else {
menu.style.position='';
menu.style.marginBottom='';
}
}
}
}
window.onresize = function() {
setFooter();
}
Story.prototype.refreshTiddler_footerhack=Story.prototype.refreshTiddler;
Story.prototype.refreshTiddler = function (title,template,force)
{
var theTiddler = Story.prototype.refreshTiddler_footerhack.apply(this,arguments);
setFooter();
return theTiddler;}
//}}}