Welcome to TiddlyWiki created by Jeremy Ruston; Copyright © 2004-2007 Jeremy Ruston, Copyright © 2007-2011 UnaMesa Association
<<tiddler Welcome>>
!Why an ONS project?
<<tiddler 'Why an ONS project?'>>
!What is beta?
<<tiddler 'What is beta?'>>
!Contact information
<<tiddler 'Contact information'>>
!Configuration
*Figure out if my bibtex file can automatically be included in a tiddler
*Figure out the best way of dealing with citations that would (somehow) link back to a reference list|
*Add a time stamp to the online TW indicating when it was last synced
*Enable spell checking for entires
*Check if notebook is indexed by search engines (may need to add a 'web crawler file')
*Put together a daily notebook entry template. What fields does it need? (Date, Day#, Summary, Todo's, list of entries linking to it, relevant git commit hash tags,...)
*Set up a ONS rss feed (or maybe not?)
*Think of ways that others could comment on entries in a transparent way. In other words, while people can email me comments it would be more along the spirit of ONS if they could post comments online. Not sure how to do this as I ''do not'' want others to directly edit the online notebook. One possibility (that may or may not make sense) would be to set up a separate ~WordPress blog where the entires are posted as they are created (perhaps via a RSS feed) allowing people to comment.
*Figure out if and how one can get the hash tag for the next commit from git without actually doing the commit?
*My last two projects ended up being around 15GB in size once they were done (99% of which was data). Making this publicly avaliable is easier said than done. How do you make this amount of data publicly avaliable? Torrents?
The aims of this study are to,
#Explore evolutionary dynamics in exogeneously driven fluctuating environments.
#Consider alternative, and more relastic, costs to plasticity, specifically delay in plastic response and irreversible plasticity.
#Determine the temporal scales of climatic change that accelerate evolutionary adaptation while others accelerate the evolution of phenotypic plasticity?
/***
|Name|CheckboxPlugin|
|Source|http://www.TiddlyTools.com/#CheckboxPlugin|
|Documentation|http://www.TiddlyTools.com/#CheckboxPluginInfo|
|Version|2.4.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|Add checkboxes to your tiddler content|
This plugin extends the TiddlyWiki syntax to allow definition of checkboxes that can be embedded directly in tiddler content. Checkbox states are preserved by:
* by setting/removing tags on specified tiddlers,
* or, by setting custom field values on specified tiddlers,
* or, by saving to a locally-stored cookie ID,
* or, automatically modifying the tiddler content (deprecated)
When an ID is assigned to the checkbox, it enables direct programmatic access to the checkbox DOM element, as well as creating an entry in TiddlyWiki's config.options[ID] internal data. In addition to tracking the checkbox state, you can also specify custom javascript for programmatic initialization and onClick event handling for any checkbox, so you can provide specialized side-effects in response to state changes.
!!!!!Documentation
>see [[CheckboxPluginInfo]]
!!!!!Revisions
<<<
2008.01.08 [*.*.*] plugin size reduction: documentation moved to [[CheckboxPluginInfo]]
2008.01.05 [2.4.0] set global "window.place" to current checkbox element when processing checkbox clicks. This allows init/beforeClick/afterClick handlers to reference RELATIVE elements, including using "story.findContainingTiddler(place)". Also, wrap handlers in "function()" so "return" can be used within handler code.
|please see [[CheckboxPluginInfo]] for additional revision details|
2005.12.07 [0.9.0] initial BETA release
<<<
!!!!!Code
***/
//{{{
version.extensions.CheckboxPlugin = {major: 2, minor: 4, revision:0 , date: new Date(2008,1,5)};
//}}}
//{{{
config.checkbox = { refresh: { tagged:true, tagging:true, container:true } };
config.formatters.push( {
name: "checkbox",
match: "\\[[xX_ ][\\]\\=\\(\\{]",
lookahead: "\\[([xX_ ])(=[^\\s\\(\\]{]+)?(\\([^\\)]*\\))?({[^}]*})?({[^}]*})?({[^}]*})?\\]",
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) {
// get params
var checked=(lookaheadMatch[1].toUpperCase()=="X");
var id=lookaheadMatch[2];
var target=lookaheadMatch[3];
if (target) target=target.substr(1,target.length-2).trim(); // trim off parentheses
var fn_init=lookaheadMatch[4];
var fn_clickBefore=lookaheadMatch[5];
var fn_clickAfter=lookaheadMatch[6];
var tid=story.findContainingTiddler(w.output); if (tid) tid=tid.getAttribute("tiddler");
var srctid=w.tiddler?w.tiddler.title:null;
config.macros.checkbox.create(w.output,tid,srctid,w.matchStart+1,checked,id,target,config.checkbox.refresh,fn_init,fn_clickBefore,fn_clickAfter);
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
}
}
} );
config.macros.checkbox = {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
if(!(tiddler instanceof Tiddler)) { // if no tiddler passed in try to find one
var here=story.findContainingTiddler(place);
if (here) tiddler=store.getTiddler(here.getAttribute("tiddler"))
}
var srcpos=0; // "inline X" not applicable to macro syntax
var target=params.shift(); if (!target) target="";
var defaultState=params[0]=="checked"; if (defaultState) params.shift();
var id=params.shift(); if (id && !id.length) id=null;
var fn_init=params.shift(); if (fn_init && !fn_init.length) fn_init=null;
var fn_clickBefore=params.shift();
if (fn_clickBefore && !fn_clickBefore.length) fn_clickBefore=null;
var fn_clickAfter=params.shift();
if (fn_clickAfter && !fn_clickAfter.length) fn_clickAfter=null;
var refresh={ tagged:true, tagging:true, container:false };
this.create(place,tiddler.title,tiddler.title,0,defaultState,id,target,refresh,fn_init,fn_clickBefore,fn_clickAfter);
},
create: function(place,tid,srctid,srcpos,defaultState,id,target,refresh,fn_init,fn_clickBefore,fn_clickAfter) {
// create checkbox element
var c = document.createElement("input");
c.setAttribute("type","checkbox");
c.onclick=this.onClickCheckbox;
c.srctid=srctid; // remember source tiddler
c.srcpos=srcpos; // remember location of "X"
c.container=tid; // containing tiddler (may be null if not in a tiddler)
c.tiddler=tid; // default target tiddler
c.refresh = {};
c.refresh.container = refresh.container;
c.refresh.tagged = refresh.tagged;
c.refresh.tagging = refresh.tagging;
place.appendChild(c);
// set default state
c.checked=defaultState;
// track state in config.options.ID
if (id) {
c.id=id.substr(1); // trim off leading "="
if (config.options[c.id]!=undefined)
c.checked=config.options[c.id];
else
config.options[c.id]=c.checked;
}
// track state in (tiddlername|tagname) or (fieldname@tiddlername)
if (target) {
var pos=target.indexOf("@");
if (pos!=-1) {
c.field=pos?target.substr(0,pos):"checked"; // get fieldname (or use default "checked")
c.tiddler=target.substr(pos+1); // get specified tiddler name (if any)
if (!c.tiddler || !c.tiddler.length) c.tiddler=tid; // if tiddler not specified, default == container
if (store.getValue(c.tiddler,c.field)!=undefined)
c.checked=(store.getValue(c.tiddler,c.field)=="true"); // set checkbox from saved state
} else {
var pos=target.indexOf("|"); if (pos==-1) var pos=target.indexOf(":");
c.tag=target;
if (pos==0) c.tag=target.substr(1); // trim leading "|" or ":"
if (pos>0) { c.tiddler=target.substr(0,pos); c.tag=target.substr(pos+1); }
if (!c.tag.length) c.tag="checked";
var t=store.getTiddler(c.tiddler);
if (t && t.tags)
c.checked=t.isTagged(c.tag); // set checkbox from saved state
}
}
// trim off surrounding { and } delimiters from init/click handlers
if (fn_init) c.fn_init="(function(){"+fn_init.trim().substr(1,fn_init.length-2)+"})()";
if (fn_clickBefore) c.fn_clickBefore="(function(){"+fn_clickBefore.trim().substr(1,fn_clickBefore.length-2)+"})()";
if (fn_clickAfter) c.fn_clickAfter="(function(){"+fn_clickAfter.trim().substr(1,fn_clickAfter.length-2)+"})()";
c.init=true; c.onclick(); c.init=false; // compute initial state and save in tiddler/config/cookie
},
onClickCheckbox: function(event) {
window.place=this;
if (this.init && this.fn_init) // custom function hook to set initial state (run only once)
{ try { eval(this.fn_init); } catch(e) { displayMessage("Checkbox init error: "+e.toString()); } }
if (!this.init && this.fn_clickBefore) // custom function hook to override changes in checkbox state
{ try { eval(this.fn_clickBefore) } catch(e) { displayMessage("Checkbox onClickBefore error: "+e.toString()); } }
if (this.id)
// save state in config AND cookie (only when ID starts with 'chk')
{ config.options[this.id]=this.checked; if (this.id.substr(0,3)=="chk") saveOptionCookie(this.id); }
if (this.srctid && this.srcpos>0 && (!this.id || this.id.substr(0,3)!="chk") && !this.tag && !this.field) {
// save state in tiddler content only if not using cookie, tag or field tracking
var t=store.getTiddler(this.srctid); // put X in original source tiddler (if any)
if (t && this.checked!=(t.text.substr(this.srcpos,1).toUpperCase()=="X")) { // if changed
t.set(null,t.text.substr(0,this.srcpos)+(this.checked?"X":"_")+t.text.substr(this.srcpos+1),null,null,t.tags);
if (!story.isDirty(t.title)) story.refreshTiddler(t.title,null,true);
store.setDirty(true);
}
}
if (this.field) {
if (this.checked && !store.tiddlerExists(this.tiddler))
store.saveTiddler(this.tiddler,this.tiddler,"",config.options.txtUserName,new Date());
// set the field value in the target tiddler
store.setValue(this.tiddler,this.field,this.checked?"true":"false");
// DEBUG: displayMessage(this.field+"@"+this.tiddler+" is "+this.checked);
}
if (this.tag) {
if (this.checked && !store.tiddlerExists(this.tiddler))
store.saveTiddler(this.tiddler,this.tiddler,"",config.options.txtUserName,new Date());
var t=store.getTiddler(this.tiddler);
if (t) {
var tagged=(t.tags && t.tags.indexOf(this.tag)!=-1);
if (this.checked && !tagged) { t.tags.push(this.tag); store.setDirty(true); }
if (!this.checked && tagged) { t.tags.splice(t.tags.indexOf(this.tag),1); store.setDirty(true); }
}
// if tag state has been changed, update display of corresponding tiddlers (unless they are in edit mode...)
if (this.checked!=tagged) {
if (this.refresh.tagged) {
if (!story.isDirty(this.tiddler)) // the TAGGED tiddler in view mode
story.refreshTiddler(this.tiddler,null,true);
else // the TAGGED tiddler in edit mode (with tags field)
config.macros.checkbox.refreshEditorTagField(this.tiddler,this.tag,this.checked);
}
if (this.refresh.tagging)
if (!story.isDirty(this.tag)) story.refreshTiddler(this.tag,null,true); // the TAGGING tiddler
}
}
if (!this.init && this.fn_clickAfter) // custom function hook to react to changes in checkbox state
{ try { eval(this.fn_clickAfter) } catch(e) { displayMessage("Checkbox onClickAfter error: "+e.toString()); } }
// refresh containing tiddler (but not during initial rendering, or we get an infinite loop!) (and not when editing container)
if (!this.init && this.refresh.container && this.container!=this.tiddler)
if (!story.isDirty(this.container)) story.refreshTiddler(this.container,null,true); // the tiddler CONTAINING the checkbox
return true;
},
refreshEditorTagField: function(title,tag,set) {
var tagfield=story.getTiddlerField(title,"tags");
if (!tagfield||tagfield.getAttribute("edit")!="tags") return; // if no tags field in editor (i.e., custom template)
var tags=tagfield.value.readBracketedList();
if (tags.contains(tag)==set) return; // if no change needed
if (set) tags.push(tag); // add tag
else tags.splice(tags.indexOf(tag),1); // remove tag
for (var t=0;t<tags.length;t++) tags[t]=String.encodeTiddlyLink(tags[t]);
tagfield.value=tags.join(" "); // reassemble tag string (with brackets as needed)
return;
}
}
//}}}
|Name|CheckboxPluginInfo|
|Source|http://www.TiddlyTools.com/#CheckboxPlugin|
|Documentation|http://www.TiddlyTools.com/#CheckboxPluginInfo|
|Version|2.4.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|documentation|
|Description|documentation for CheckboxPlugin|
This plugin extends the TiddlyWiki syntax to allow definition of checkboxes that can be embedded directly in tiddler content. Checkbox states are preserved by:
* setting/removing tags on specified tiddlers,
* or, setting custom field values on specified tiddlers,
* or, saving to a locally-stored cookie ID,
* or, automatically modifying the tiddler source content (deprecated).
When an ID is assigned to the checkbox, it enables direct programmatic access to the checkbox DOM element, as well as creating an entry in TiddlyWiki's config.options[ID] internal data. In addition to tracking the checkbox state, you can also specify custom javascript for programmatic initialization and onClick event handling for any checkbox, so you can provide specialized side-effects in response to state changes.
!!!!!Inline (wiki syntax) Usage
<<<
//{{{
[ ]or[_] and [x]or[X]
//}}}
Simple checkboxes using 'Inline X' storage. The current unchecked/checked state is indicated by the character between the {{{[}}} and {{{]}}} brackets ("_" means unchecked, "X" means checked). When you click on a checkbox, the current state is retained by directly modifying the tiddler content to place the corresponding "_" or "X" character in between the brackets.
>//''NOTE: 'Inline X' syntax has been deprecated...'' This storage format only works properly for checkboxes that are directly embedded and accessed from content in a single tiddler. However, if that tiddler is 'transcluded' into another (by using the {{{<<tiddler TiddlerName>>}}} macro), the 'Inline X' will be ''erroneously stored in the containing tiddler's source content, resulting in corrupted content in that tiddler.'' For anything but the most simple of "to do list" uses, you should select from the various alternative storage methods described below...//
//{{{
[x=id]
//}}}
Assign an optional ID to the checkbox so you can use {{{document.getElementByID("id")}}} to manipulate the checkbox DOM element, as well as tracking the current checkbox state in {{{config.options["id"]}}}. If the ID starts with "chk" the checkbox state will also be saved in a cookie, so it can be automatically restored whenever the checkbox is re-rendered (overrides any default {{{[x]}}} or {{{[_]}}} value). If a cookie value is kept, the "_" or "X" character in the tiddler content remains unchanged, and is only applied as the default when a cookie-based value is not currently defined.
//{{{
[x(title|tag)] or [x(title:tag)]
//}}}
Initializes and tracks the current checkbox state by setting or removing a particular tag value from a specified tiddler. If you omit the tiddler title (and the | or : separator), the specified tag is assigned to the current tiddler. If you omit the tag value, as in {{{(title|)}}}, the default tag, {{{checked}}}, is assumed. Omitting both the title and tag, {{{()}}}, tracks the checkbox state by setting the "checked" tag on the current tiddler. When tag tracking is used, the "_" or "X" character in the tiddler content remains unchanged, and is not used to set or track the checkbox state. If a tiddler title named in the tag does not exist, the checkbox state defaults to the "inline X" value. If this value is //checked//, or is subsequently changed to //checked//, it will automatically create the missing tiddler and then add the tag to it. //''NOTE: beginning with version 2.1.2 of this plugin, the "|" separator is the preferred separator between the title and tag name, as it avoids syntactic ambiguity when ":" is used within tiddler titles or tag names.''//
//{{{
[x(field@tiddler)]
//}}}
Initializes and tracks the current checkbox state by setting a particular custom field value from a specified tiddler. If you omit the tiddler title (but not the "@" separator), the specified field on the current tiddler is used. If you omit the field name, as in {{{(@tiddler)}}}, a default fieldname of {{{checked}}} is assumed. Omitting both the field and the tiddler title, {{{(@)}}}, defaults to setting the "checked" field on the current tiddler. When field tracking is used, the "_" or "X" character in the tiddler content remains unchanged, and is not used to set or track the checkbox state. If the tiddler title named in the parameter does not exist, the checkbox state defaults to the "inline X" value. If this value is //checked// or is subsequently changed to //checked//, it will automatically create the missing tiddler and then add the field to it.
//{{{
[x{javascript}{javascript}{javascript}]
//}}}
You can define optional javascript code segments to add custom initialization and/or 'onClick' handlers to a checkbox. The current checkbox state (and it's other DOM attributes) can be set or read from within these code segments by reference to a globally-defined context object, "place" (which can also be referenced as "window.place").
The first code segment will be executed when the checkbox is initially displayed, so that you can programmatically determine it's starting checked/unchecked state. The second code segment (if present) is executed whenever the checkbox is clicked, but //before the regular checkbox processing in performed// ("onClickBefore"), so that you can apply programmed responses or intercept and override the checkbox state based on custom logic. The third code segment (if present) is executed whenver the checkbox is clicked, //after the regular checkbox processing has completed// ("onClickAfter"), so that you can include "side-effect" processing based on the checkbox state just applied.
>Note: if you want to use the default checkbox initialization processing with a custom onClickBefore/After function, use this syntax:
>{{{[x(tag){}{javascript}]}}} or {{{[x(tag){}{}{javascript}]}}}
<<<
!!!!!Macro usage
<<<
In addition to embedded checkboxes using the wiki syntax described above, a ''macro-based syntax'' is also provided, for use in templates where wiki syntax cannot be directly used. This macro syntax can also be used in tiddler content, as an alternative to the wiki syntax. When embedded in [[PageTemplate]], [[ViewTemplate]], or [[EditTemplate]] (or custom alternative templates), use the following macro syntax:
//{{{
<span macro="checkbox target checked id onInit onClickBefore onClickAfter"></span>
//}}}
or, when embedded in tiddler content, use the following macro syntax:
//{{{
<<checkbox target checked id onInit onClickBefore onClickAfter>>
//}}}
where:
''target''
>is either a tag reference (e.g., ''tagname|tiddlername'') or a field reference (e.g. ''fieldname@tiddlername''), as described above.
''checked'' (optional)
>is a keyword that sets the initial state of the checkbox to "checked". When omitted, the default checkbox state is "unchecked".
''id'' (optional)
>specifies an internal config.options.* ID, as described above. If the ID begins with "chk", a cookie-based persistent value will be created to track the checkbox state in between sessions.
''onInit'' (optional)
>contains a javascript event handler to be performed when the checkbox is initially rendered (see details above).
''onClickBefore'' and/or ''onClickAfter'' (optional)
>contains a javascript event handler to be performed each time the checkbox is clicked (see details above). //note: to use the default onInit handler with a custom onClickBefore/After handler, use "" (empty quotes) or {} (empty function) as a placeholder for the onInit and/or onClickBefore parameters//
<<<
!!!!!Examples
<<<
''checked and unchecked static default ("inline X") values:''
//{{{
[X] label
[_] label
//}}}
>[X] label
>[_] label
''document-based value (id='demo', no cookie):''
//{{{
[_=demo] label
//}}}
>[_=demo] label
''cookie-based value (id='chkDemo'):''
//{{{
[_=chkDemo] label
//}}}
>[_=chkDemo] label
''tag-based value (TogglyTagging):''
//{{{
[_(CheckboxPluginInfo|demotag)]
[_(CheckboxPluginInfo|demotag){place.refresh.tagged=place.refresh.container=false}]
//}}}
>[_(CheckboxPluginInfo|demotag)] toggle 'demotag' (and refresh tiddler display)
>[_(CheckboxPluginInfo|demotag){place.refresh.tagged=place.refresh.container=false}] toggle 'demotag' (no refresh)
''field-based values:''
//{{{
[_(demofield@CheckboxPluginInfo)] demofield@CheckboxPluginInfo
[_(demofield@)] demofield@ (equivalent to demonfield@ current tiddler)
[_(checked@CheckboxPluginInfo)] checked@CheckboxPluginInfo
[_(@CheckboxPluginInfo)] @CheckboxPluginInfo
[_(@)] @ (equivalent to checked@ current tiddler)
//}}}
>[_(demofield@CheckboxPluginInfo)] demofield@CheckboxPluginInfo
>[_(demofield@)] demofield@ (current tiddler)
>[_(checked@CheckboxPluginInfo)] checked@CheckboxPluginInfo
>[_(@CheckboxPluginInfo)] @CheckboxPluginInfo
>[_(@)] toggle field: @ (defaults to "checked@here")
>click to view current: <<toolbar fields>>
''custom init and onClick functions:''
//{{{
[X{place.checked=true}{alert(place.checked?"on":"off")}] message box with checkbox state
//}}}
>[X{place.checked=true}{alert(place.checked?"on":"off")}] message box with checkbox state
''retrieving option values:''
>config.options['demo']=<script>return config.options['demo']?"true":"false";</script>
>config.options['chkDemo']=<script>return config.options['chkDemo']?"true":"false";</script>
<<<
!!!!!Configuration
<<<
Normally, when a checkbox state is changed, the affected tiddlers are automatically re-rendered, so that any checkbox-dependent dynamic content can be updated. There are three possible tiddlers to be re-rendered, depending upon where the checkbox is placed, and what kind of storage method it is using.
*''container'': the tiddler in which the checkbox is displayed. (e.g., this tiddler)
*''tagged'': the tiddler that is being tagged (e.g., "~MyTask" when tagging "~MyTask:done")
*''tagging'': the "tag tiddler" (e.g., "~done" when tagging "~MyTask:done")
You can set the default refresh handling for all checkboxes in your document by using the following javascript syntax either in a systemConfig plugin, or as an inline script. (Substitute true/false values as desired):
{{{config.checkbox.refresh = { tagged:true, tagging:true, container:true };}}}
You can also override these defaults for any given checkbox by using an initialization function to set one or more of the refresh options. For example:
{{{[_{place.refresh.container=false}]}}}
<<<
!!!!!Revisions
<<<
2008.01.08 [*.*.*] plugin size reduction: documentation moved to [[CheckboxPluginInfo]]
2008.01.05 2.4.0 set global "window.place" to current checkbox element when processing checkbox clicks. This allows init/beforeClick/afterClick handlers to reference RELATIVE elements, including using "story.findContainingTiddler(place)". Also, wrap handlers in "function()" so "return" can be used within handler code.
2008.01.02 2.3.0 split optional custom onClick handling into separate onClickBefore and onClickAfter handlers. The onClickBefore handler permits interception of the click BEFORE the checkbox is set. onClickAfter allows follow-on 'side-effect' processing to occur AFTER the checkbox is set.
2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.08.06 2.2.5 supress automatic refresh of any tiddler that is currently being edited. Ensures that current tiddler edit sessions are not prematurely discarded (losing any changes). However, if checkbox changes a tag on a tiddler being edited, update the "tags" input field (if any) so that saving the edited tiddler correctly reflects any changes due to checkbox activity... see refreshEditorTagField().
2007.07.13 - 2.2.4 in handler(), fix srctid reference (was "w.tiddler", should have been "w.tiddler.title"). This fixes broken 'inline X' plus fatal macro error when using PartTiddlerPlugin. Thanks to cmari for reporting the problem and UdoBorkowski for finding the code error.
2007.06.21 - 2.2.3 suppress automatic refresh of tiddler when using macro-syntax to prevent premature end of tiddler editing session.
2007.06.20 - 2.2.2 fixed handling for 'inline X' when checkboxes are contained in a 'trancluded' tiddler. Now, regardless of where an inline X checkbox appears, the X will be placed in the originating source tiddler, rather than the tiddler in which the checkbox appears.
2007.06.17 - 2.2.1 Refactored code to add checkbox //macro// syntax for use in templates (e.g., {{{macro="checkbox ..."}}}. Also, code cleanup of existing tag handling.
2007.06.16 - 2.2.0 added support for tracking checkbox states using tiddler fields via "(fieldname@tiddlername)" syntax.
2006.05.04 - 2.1.3 fix use of findContainingTiddler() to check for a non-null return value, so that checkboxes won't crash when used outside of tiddler display context (such as in header, sidebar or mainmenu)
2006.03.11 - 2.1.2 added "|" as delimiter to tag-based storage syntax (e.g. "tiddler|tag") to avoid parsing ambiguity when tiddler titles or tag names contain ":". Using ":" as a delimiter is still supported but is deprecated in favor of the new "|" usage. Based on a problem reported by JeffMason.
2006.02.25 - 2.1.0 added configuration options to enable/disable forced refresh of tiddlers when toggling tags
2006.02.23 - 2.0.4 when toggling tags, force refresh of the tiddler containing the checkbox.
2006.02.23 - 2.0.3 when toggling tags, force refresh of the 'tagged tiddler' so that tag-related tiddler content (such as "to-do" lists) can be re-rendered.
2006.02.23 - 2.0.2 when using tag-based storage, allow use [[ and ]] to quote tiddler or tag names that contain spaces:
{{{[x([[Tiddler with spaces]]:[[tag with spaces]])]}}}
2006.01.10 - 2.0.1 when toggling tags, force refresh of the 'tagging tiddler'. For example, if you toggle the "systemConfig" tag on a plugin, the corresponding "systemConfig" TIDDLER will be automatically refreshed (if currently displayed), so that the 'tagged' list in that tiddler will remain up-to-date.
2006.01.04 - 2.0.0 update for ~TW2.0
2005.12.27 - 1.1.2 Fix lookAhead regExp handling for {{{[x=id]}}}, which had been including the "]" in the extracted ID.
Added check for "chk" prefix on ID before calling saveOptionCookie()
2005.12.26 - 1.1.2 Corrected use of toUpperCase() in tiddler re-write code when comparing {{{[X]}}} in tiddler content with checkbox state. Fixes a problem where simple checkboxes could be set, but never cleared.
2005.12.26 - 1.1.0 Revise syntax so all optional parameters are included INSIDE the [ and ] brackets. Backward compatibility with older syntax is supported, so content changes are not required when upgrading to the current version of this plugin. Based on a suggestion by GeoffSlocock
2005.12.25 - 1.0.0 added support for tracking checkbox state using tags ("TogglyTagging")
Revised version number for official post-beta release.
2005.12.08 - 0.9.3 support separate 'init' and 'onclick' function definitions.
2005.12.08 - 0.9.2 clean up lookahead pattern
2005.12.07 - 0.9.1 only update tiddler source content if checkbox state is actually different. Eliminates unnecessary tiddler changes (and 'unsaved changes' warnings)
2005.12.07 - 0.9.0 initial BETA release
<<<
!Citing the notebook in its entirety
{{{
author = {Pineda-Krch, M},
year = {2011},
title = {Evolution in fluctuating environments: An Open Notebook Science project},
url = {http://pineda-krch.com},
comment = {Research notebook},
}}}
!Citing a specific entry
|TODO|Figure out the proper/best citation style for individual notebook entries|
Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #041
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
!!Physical home
Centre for Mathematical Biology
632 Central Academic Building
University of Alberta
Edmonton, AB ~T6H 2G1, Canada
!!Web home
http://pineda-krch.com
!!Email
mpineda at math dot ualberta dot ca
[img(50%,+)[./images/daphnia.jpg]]
Two genetically identical individuals of the water flea //Daphnia lumholtzi//. The individual on the left was exposed to chemical cues from a predatory fish and the individual to the right was not. The pointed anterior prolongation, or helmet, on the head and the extended tail spine provide protection predators locating its prey by sight. The development of the helmeted phenotype confers a higher metabolic costs than the smaller rounded head resulting in smaller brood volumes. The two phenotypes were initially believed to be a separate species. Scanning electron micrograph courtesy of C. Laforsch and R. Tollrian.
Based on [[Pineda-Krch (2011)]].
[[Welcome]]
[[TabTimeline]]
[[Welcome]]
[[ToC by creation date]]
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser excludeLists'></span></div>
<!--}}}-->
Put some cool pictures here...
[img(100%,+)[./images/reactionnorms.jpg]]
Effects of genotype and environment on the distribution of phenotypes in a series of hypothetical reaction norms. A continuous environmental gradient, e.g. temperature, is shown on the horizontal axis with the distribution of environments experienced by a population indicated ($x$, $y$ and $z$). The blue and red lines represent the reaction norms of different genotypes with the resulting distribution of phenotypes given on the $y$-axis, e.g. $f_1(x)$ is the distribution of phenotypes for genotype 1 in the environmental distribution $x$. (A) In the absence of genotype-by-environment interaction the reaction are parallel and, although different in phenotype ($f_1(x) \neq f_2(x)$) respond similarly to differences in the environment. Note how the variance of the phenotypic distributions differ from the variance of the environmental distribution. (B) In the presence of genotype-by-environment interaction, manifested by the reaction norms having different slopes, the two genotypes respond differently to the environment. Note how the variance of $f_1(x)$ now is different from the variance of $f_2(x)$. In both (A) and (B) the distribution of phenotypes is bimodal and most of the variation is genetic because the genotypes differ substantially in their phenotypes. (C) Crossing reaction norms are an especially strong case of genotype-by-environment interaction. Around the crossing point of the norms, the genotypes are indistinguishable in the phenotypic mixture, i.e. $f_1(y) \approx f_2(y)$, giving an appearance of less genetic diversity than what is actually present in the population. Away from the crossing point the individual genotypes can be identified in the bimodal phenotypic distribution but with a reversed ranking on either side of the crossing point. For example, while genotype 1 is superior in environment $x$, $f_1(x) > f_2(x)$, genotype 2 is ranked higher in environment $z$, i.e. $f_1(z) < f_2(z)$.
Based on [[Pineda-Krch (2011)]].
To get started with this blank [[TiddlyWiki]], you'll need to modify the following tiddlers:
* [[SiteTitle]] & [[SiteSubtitle]]: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* [[MainMenu]]: The menu (usually on the left)
* [[DefaultTiddlers]]: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
{{{
@ARTICLE{hellmann.pineda-krch07,
author = {Hellmann, J. and Pineda-Krch, M.},
title = {Constraints and Reinforcement on Adaptation Under Climate Change: Selection of Genetically Correlated Traits},
journal = {Biological Conservation},
year = {2007},
volume = {137},
pages = {599-609},
note = {Authors in alphabetical order},
file = {hellmann.pineda-krch07.pdf:hellmann.pineda-krch07.pdf:PDF}
}
}}}
http://www.math.ualberta.ca/~mpineda/public/hellmann.pineda-krch07.pdf
/***
|Name|ImageSizePlugin|
|Source|http://www.TiddlyTools.com/#ImageSizePlugin|
|Version|1.2.2|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|adds support for resizing images|
This plugin adds optional syntax to scale an image to a specified width and height and/or interactively resize the image with the mouse.
!!!!!Usage
<<<
The extended image syntax is:
{{{
[img(w+,h+)[...][...]]
}}}
where ''(w,h)'' indicates the desired width and height (in CSS units, e.g., px, em, cm, in, or %). Use ''auto'' (or a blank value) for either dimension to scale that dimension proportionally (i.e., maintain the aspect ratio). You can also calculate a CSS value 'on-the-fly' by using a //javascript expression// enclosed between """{{""" and """}}""". Appending a plus sign (+) to a dimension enables interactive resizing in that dimension (by dragging the mouse inside the image). Use ~SHIFT-click to show the full-sized (un-scaled) image. Use ~CTRL-click to restore the starting size (either scaled or full-sized).
<<<
!!!!!Examples
<<<
{{{
[img(100px+,75px+)[images/meow2.jpg]]
}}}
[img(100px+,75px+)[images/meow2.jpg]]
{{{
[<img(34%+,+)[images/meow.gif]]
[<img(21% ,+)[images/meow.gif]]
[<img(13%+, )[images/meow.gif]]
[<img( 8%+, )[images/meow.gif]]
[<img( 5% , )[images/meow.gif]]
[<img( 3% , )[images/meow.gif]]
[<img( 2% , )[images/meow.gif]]
[img( 1%+,+)[images/meow.gif]]
}}}
[<img(34%+,+)[images/meow.gif]]
[<img(21% ,+)[images/meow.gif]]
[<img(13%+, )[images/meow.gif]]
[<img( 8%+, )[images/meow.gif]]
[<img( 5% , )[images/meow.gif]]
[<img( 3% , )[images/meow.gif]]
[<img( 2% , )[images/meow.gif]]
[img( 1%+,+)[images/meow.gif]]
{{tagClear{
}}}
<<<
!!!!!Revisions
<<<
2010.07.24 [1.2.2] moved tip/dragtip text to config.formatterHelpers.imageSize object to enable customization
2009.02.24 [1.2.1] cleanup width/height regexp, use '+' suffix for resizing
2009.02.22 [1.2.0] added stretchable images
2008.01.19 [1.1.0] added evaluated width/height values
2008.01.18 [1.0.1] regexp for "(width,height)" now passes all CSS values to browser for validation
2008.01.17 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.ImageSizePlugin= {major: 1, minor: 2, revision: 2, date: new Date(2010,7,24)};
//}}}
//{{{
var f=config.formatters[config.formatters.findByField("name","image")];
f.match="\\[[<>]?[Ii][Mm][Gg](?:\\([^,]*,[^\\)]*\\))?\\[";
f.lookaheadRegExp=/\[([<]?)(>?)[Ii][Mm][Gg](?:\(([^,]*),([^\)]*)\))?\[(?:([^\|\]]+)\|)?([^\[\]\|]+)\](?:\[([^\]]*)\])?\]/mg;
f.handler=function(w) {
this.lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var floatLeft=lookaheadMatch[1];
var floatRight=lookaheadMatch[2];
var width=lookaheadMatch[3];
var height=lookaheadMatch[4];
var tooltip=lookaheadMatch[5];
var src=lookaheadMatch[6];
var link=lookaheadMatch[7];
// Simple bracketted link
var e = w.output;
if(link) { // LINKED IMAGE
if (config.formatterHelpers.isExternalLink(link)) {
if (config.macros.attach && config.macros.attach.isAttachment(link)) {
// see [[AttachFilePluginFormatters]]
e = createExternalLink(w.output,link);
e.href=config.macros.attach.getAttachment(link);
e.title = config.macros.attach.linkTooltip + link;
} else
e = createExternalLink(w.output,link);
} else
e = createTiddlyLink(w.output,link,false,null,w.isStatic);
addClass(e,"imageLink");
}
var img = createTiddlyElement(e,"img");
if(floatLeft) img.align="left"; else if(floatRight) img.align="right";
if(width||height) {
var x=width.trim(); var y=height.trim();
var stretchW=(x.substr(x.length-1,1)=='+'); if (stretchW) x=x.substr(0,x.length-1);
var stretchH=(y.substr(y.length-1,1)=='+'); if (stretchH) y=y.substr(0,y.length-1);
if (x.substr(0,2)=="{{")
{ try{x=eval(x.substr(2,x.length-4))} catch(e){displayMessage(e.description||e.toString())} }
if (y.substr(0,2)=="{{")
{ try{y=eval(y.substr(2,y.length-4))} catch(e){displayMessage(e.description||e.toString())} }
img.style.width=x.trim(); img.style.height=y.trim();
config.formatterHelpers.addStretchHandlers(img,stretchW,stretchH);
}
if(tooltip) img.title = tooltip;
// GET IMAGE SOURCE
if (config.macros.attach && config.macros.attach.isAttachment(src))
src=config.macros.attach.getAttachment(src); // see [[AttachFilePluginFormatters]]
else if (config.formatterHelpers.resolvePath) { // see [[ImagePathPlugin]]
if (config.browser.isIE || config.browser.isSafari) {
img.onerror=(function(){
this.src=config.formatterHelpers.resolvePath(this.src,false);
return false;
});
} else
src=config.formatterHelpers.resolvePath(src,true);
}
img.src=src;
w.nextMatch = this.lookaheadRegExp.lastIndex;
}
}
config.formatterHelpers.imageSize={
tip: 'SHIFT-CLICK=show full size, CTRL-CLICK=restore initial size',
dragtip: 'DRAG=stretch/shrink, '
}
config.formatterHelpers.addStretchHandlers=function(e,stretchW,stretchH) {
e.title=((stretchW||stretchH)?this.imageSize.dragtip:'')+this.imageSize.tip;
e.statusMsg='width=%0, height=%1';
e.style.cursor='move';
e.originalW=e.style.width;
e.originalH=e.style.height;
e.minW=Math.max(e.offsetWidth/20,10);
e.minH=Math.max(e.offsetHeight/20,10);
e.stretchW=stretchW;
e.stretchH=stretchH;
e.onmousedown=function(ev) { var ev=ev||window.event;
this.sizing=true;
this.startX=!config.browser.isIE?ev.pageX:(ev.clientX+findScrollX());
this.startY=!config.browser.isIE?ev.pageY:(ev.clientY+findScrollY());
this.startW=this.offsetWidth;
this.startH=this.offsetHeight;
return false;
};
e.onmousemove=function(ev) { var ev=ev||window.event;
if (this.sizing) {
var s=this.style;
var currX=!config.browser.isIE?ev.pageX:(ev.clientX+findScrollX());
var currY=!config.browser.isIE?ev.pageY:(ev.clientY+findScrollY());
var newW=(currX-this.offsetLeft)/(this.startX-this.offsetLeft)*this.startW;
var newH=(currY-this.offsetTop )/(this.startY-this.offsetTop )*this.startH;
if (this.stretchW) s.width =Math.floor(Math.max(newW,this.minW))+'px';
if (this.stretchH) s.height=Math.floor(Math.max(newH,this.minH))+'px';
clearMessage(); displayMessage(this.statusMsg.format([s.width,s.height]));
}
return false;
};
e.onmouseup=function(ev) { var ev=ev||window.event;
if (ev.shiftKey) { this.style.width=this.style.height=''; }
if (ev.ctrlKey) { this.style.width=this.originalW; this.style.height=this.originalH; }
this.sizing=false;
clearMessage();
return false;
};
e.onmouseout=function(ev) { var ev=ev||window.event;
this.sizing=false;
clearMessage();
return false;
};
}
//}}}
Evolution unfolds against a backdrop of environmental variability taking place on different time scales, from rapid climate shifts occuring at a decadal time scale, to climatic changes occurring over a few millennial, regular glacial-interglacial transitions with cycles of roughly a hundred thousand years, to long-term warming or cooling trends over hundreds of thousands to millions of years. Our aim here is to develop a simple eco-evolutionary model aimed at exploring how the time scale of climate change influence evolutionary dynamics.
There are an increasing number of studies showing that adaptive evolution can unfold over timescales spanning several order of magnitude. For example, while organisms with short generation times, e.g. microorganisms and invertebrates, have the potential for rapid adaptations to changes in their environment, organisms with long generation times, e.g. megafauna and long lived trees, are respond over a much longer time scale.
A few real world examples: pesticide resistance in insects (DDT and mosquitoes) and drug resistance in pathogens (antibiotic resistance in bacteria), ...
Several factors determine the rate of evolutionary adaptation, many which are species specific, including the mutation rate, generation rate, nature of selection (strength, direction), genetic constraints ([[Hellmann & Pineda-Krch (2007)]]), etc. In a changing environment, e.g. under global warming, all populations face the same rate of environmental change.
The aim of this study is to explore how variable environments influence evolutionary adaptations, specifically how the rate and amplitude of environmental fluctuations influence evolutionary adaptation to a fixed phenotype or evolution of increased potential for phenotypic plasticity. This work builds on the work by [[Svanbäck et al. (2009)]] addressing how a fluctuating environment promotes the evolution of increased phenotypic plasticity but with the key difference that in this study my goal is to also quantify the time scales over which adaptation to a fixed phenotype or evolution of increased potential for phenotypic plasticity takes place. In contrast to Svanbäck et al. I am here using a simpler model of a siongle population experiencing an exogeneously driven variable environment (similarly to [[Hellmann & Pineda-Krch (2007)]]).
The success of a plastic response largely depend on the predictability of the environment. Lags in the response to environmental changes or unpredictable environmental changes can impose significant ecological costs compared with that experienced by fixed genotypes. Using theoretical models it has been shown that an increased ability for plastic responses is less likely to evolve in stable environments while plastic phenotypes tend to be selectively favoured in environments that are intrinsically variable in space and time, e.g. due to species interactions and in fluctuating environments ([[Svanbäck et al. (2009)]]. The time scale over which the environment is changing relative to the average life span of individuals in the population is one important aspect determining the evolutionary outcome. For example, if the duration of an environmental regime is less than the average generation time of individuals, the population cannot easily respond by adaptation in a fixed (non-plastic) genotype. Under this scenario individuals having genetic variation for phenotypic plasticity are expected to be favoured. Whether the population will adapt by increasing its capacity for phenotypic plasticity ultimately depends on the costs and physiological limits associated with the plastic phenotype.
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></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'>
<div macro='view text wikified'></div>
<div macro='storyViewer journal links'></div>
</div>
<div class='tagClear'></div>
<!--}}}-->
The purpose of this lab meeting is to give a brief whirlwind tour of the historical, political, theoretical and empirical background of phenotypic plasticity. I will discuss some recent theoretical results from the literature on the role of phenotypic plasticity in adaptive evolution and brainstorm around possible questions and directions of this project.
I will start off by briefly outline the scientific methodology (Open Notebook Science) I am using in this research project.
This project has two (very different) overarching aims:
#Explore how variable environments influence evolutionary adaptations, specifically how the rate and amplitude of environmental fluctuations influence evolutionary adaptation to a fixed phenotype or evolution of increased potential for phenotypic plasticity.
#Explore how theoretical research can benefit by being conducted in a completelly transparent way
Her are the "slides":
!Open Notebook Science
#[[Welcome]]
#[[The joy of doing science in the nude]]
!Evolution in fluctuating environments
#[[Woltereck]]
#[[Genotype-by-environment interaction figure]]
#[[Daphnia]]
#[[Reaction norms for larval viability in Drosophila pseudoobscura]]
#[[Examples of phenotypic plasticity]]
#[[Introduction]]
#[[Aims]]
#[[Literature review]]
#[[Model]]
#[[Results]]
#[[Questions needing answers]]
This research project (i.e. notebook, data, code, results, figures, plots, slides, etc.) is licensed under a [[Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License|http://creativecommons.org/licenses/by-nc-sa/3.0/]].
[img(,50px)[images/by-nc-sa.png][http://creativecommons.org/licenses/by-nc-sa/3.0/]]
This means you are free to to share, i.e. to copy, distribute and transmit the work to remix, i.e. to adapt the work, but only under the following conditions:
*''Attribution'' — You must attribute the work in the [[manner specified by the author or licensor|Cite]] (but not in any way that suggests that they endorse you or your use of the work).
*''Noncommercial'' — You may not use this work for commercial purposes.
*''Share Alike'' — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.
This information taken from Julian Knight's ~TiddlyWiki, which can be [[found here|http://knighjm.googlepages.com/knightnet-default-tw.html]].
Macros let you write tiddlers containing more exotic objects than just text. Here are the built-in macros:
|!Macro|!Description|!Syntax|
|allTags|List all the tags used in the current ~TiddlyWiki file<<br>>Each entry is a button that pops up the list of tiddlers for that tag<<br>><<slider sliderID [[Internal Macros/tags]] 'Click to show example output'>>|{{{<<allTags>>}}}|
|br|Force a line break|{{{<<br>>}}}|
|closeAll|Displays a button to close all displayed Tiddlers<<br>><<closeAll>>|{{{<<closeAll>>}}}|
|gradient|<<gradient [horiz|vert] #bbbbbb #eeeeee #ffffff>>Produces a horizontal or vertical background gradient fill>><<br>>There can be 2 or more colours in the format: #rrggbb (hex), or RGB(r,g,b) (CSS)<<br>>Other CSS formatting can also be added, e.g. {{{<<gradient vert #000000 #660000 #aa2222>>color:#ffffff;font-size:12pt;Darkness>>}}}|{{{<<gradient [horiz|vert] #bbbbbb #eeeeee #ffffff>>Some text here>>}}}|
|list all|List all Tiddlers in a Tiddler|{{{<<list all>>}}}|
|list missing|List all missing tiddlers|{{{<<list missing>>}}}|
|list orphans|List all orphaned tiddlers|{{{<<list orphans>>}}}|
|newJournal|Displays a button to create new date & Time stamped Tiddler (Date/time format optional)<<br>><<newJournal "DD MMM YYYY, hh:mm">> <<br>>You can also add optional tag names after the date format: <<newJournal "DD MMM YYYY, hh:mm" tag1 TagTwo>> |{{{<<newJournal [DateFormatString]>>}}} <<br>> {{{<<newJournal "DD MMM YYYY, hh:mm" tag1 TagTwo>>}}} |
|newTiddler|Displays a button to create new Tiddler<<br>><<newTiddler>>|{{{<<newTiddler>>}}}|
|permaview|Displays a button to change the URL link for all open Tiddlers - or the containing tiddler if used in the command bar (See the ViewTemplate)<<br>><<permaview>>|{{{<<permaview>>}}}|
|saveChanges |Button to save all ~TiddlyWiki changes (or the current tiddler if used in the command bar (see EditTemplate)<<br>><<saveChanges>>|{{{<<saveChanges>>}}}|
|search|Display a Search box<<br>><<search>>|{{{<<search>>}}}|
|slider|Display a Slider (a collapsable display of another tiddler)<<br>>See the allTags entry for an example. Note: Put quotes around the label if needing spaces<<br>>where: ''ID''=cookie name to be used to save the state of the slider, ''Tiddler''=name of the tiddler to include in the slider, ''Label''=label text of the slider button, ''tooltip''=text of the buttons tooltip|{{{<<slider ID Tiddler [Label] [toolTip]>>}}}|
|sparkline|Produces a sparkline graphic<<br>>e.g. <<sparkline 163 218 231 236 232 266 176 249 289 1041 1835 2285 3098 2101 1755 3283 3353 3335 2898 2224 1404 1354 1825 1839 2142 1942 1784 1145 979 1328 1611>>|{{{<<sparkline num1 num2 ... numN>>}}}|
|tabs|Display Tabbed content (contents of tab provided by another tiddler)|{{{<<tabs identifier tabLabel tabName Tiddlername>>}}}|
|tag|Display a Tag ~PopUp<<br>><<tag _Config>>|{{{<<tag tagName>>}}}|
|tagChooser|Used in EditTemplate to add tags to the tags field. Doesn't actually add anything unless in edit mode (though it does show the list)<<br>><<tagChooser>>|{{{<<tagChooser>>}}}|
|tagging|<<tiddler [[Internal Macros/tagging]]>>|{{{<<tagging [TiddlerTitle]>>}}}|
|tiddler|Display contents of another tiddler inline|{{{<<tiddler Tiddler>>}}}|
|timeline|Display a timeline list of tiddlers<<br>>where the sortfield is the sort order ("modified" or "created") and maxentries is the maximum number of entries|{{{<<timeline [sortfield] [maxentries]>>}}}|
|today|Display Today's Date<<br>>e.g. <<today>>|{{{<<today [DateFormatString]>>}}}|
|version|Display ~TiddlyWiki's version<<br>>e.g. <<version>>|{{{<<version>>}}}|
!DateFormatString
Several Macros including the today macro take a DateFormatString as an optional argument. This string can be a combination of ordinary text, with some special characters that get substituted by parts of the date:
* DDD - day of week in full (eg, "Monday")
* DD - day of month, 0DD - adds a leading zero
* MMM - month in full (eg, "July")
* MM - month number, 0MM - adds leading zero
* YYYY - full year, YY - two digit year
* hh - hours
* mm - minutes
* ss - seconds
!Notes
If you need to supply a parameter that should be evaluated (e.g. a JavaScript variable), enclose the parameter in {{{{{}}} and {{{}}}}} rather than quotes. Note however, that the scope used in the evaluation is {{{global}}} rather than {{{local}}}. In other words, the evaluation is done ''before'' the parameter is passed to the macro/plugin so it cannot access any of the variables or functions defined within the macro/plugin.
!Commands supported by the toolbar macro
{{{
config.commands = {
closeTiddler: {text: "close", tooltip: "Close this tiddler"},
closeOthers: {text: "close others", tooltip: "Close all other tiddlers"},
editTiddler: {text: "edit", tooltip: "Edit this tiddler", readOnlyText: "view", readOnlyTooltip: "View the source of this tiddler"},
saveTiddler: {text: "done", tooltip: "Save changes to this tiddler", readOnlyText: "done", readOnlyTooltip: "View this tiddler normally"},
cancelTiddler: {text: "cancel", tooltip: "Undo changes to this tiddler", hideReadOnly: true},
deleteTiddler: {text: "delete", tooltip: "Delete this tiddler", warning: "Are you sure you want to delete '%0'?", hideReadOnly: true},
permalink: {text: "permalink", tooltip: "Permalink for this tiddler"},
references: {text: "references", tooltip: "Show tiddlers that link to this one", popupNone: "No references"},
jump: {text: "jump", tooltip: "Jump to another open tiddler"}
};
}}}
(Julian Knight, 2006-04-06)
<part tagging hidden>
Produces a list (NB: <ul> ''not'' a popup) of links to tiddlers that carry the specified tag. If no tag is specified, it looks for tiddlers tagged with the name of the current tiddler.
In HTML, the list is formatted like so:
{{{
<ul>
<li class="listTitle">List title label</li>
<li><a class="tiddlyLink ..." href="javascript:;" onclick="..."
refresh="link" tiddlyLink="ExampleOne">ExampleOne</a></li>
</ul>
}}}
</part>
<part tags hidden>
<<allTags>>
</part>
The current study builds upon the work of [[Svanbäck et al. (2009)]] and [[Hellmann & Pineda-Krch (2007)]]. This is how the current study differs,
#Exogeneously generated fluctuations
#More realistic costs to phenotypic plasticity
#...
<<tiddler ToggleRightSidebar>>
[[About]]
!Entries
[[By creation date|ToC by creation date]]
[[By modification date|ToC by modification date]]
[[Complete timeline|TabTimeline]]
[[Todo]]
[[To read]]
!Project
[[~|./../../]]
[[data|./../../data/]]
[[docs|./../../docs/]]
[[/images/|./../../docs/notebook/images/]]
[[sandbox|./../../sandbox/]]
[[src|./../../src/]]
[[vignettes|./../../vignettes/]]
!Links
[[GitHub|https://github.com/mpk/evolution-in-fluctuating-environments]]
[[MPK|http://pineda-krch.com]]
[img(,30px)[This research project (i.e. notebook, data, code, results, figures, plots, slides, etc.) is publicly available in as close to real-time as possible. |images/ons-aci2.png][http://onsclaims.wikispaces.com/]]
[img(,30px)[This research project (i.e. notebook, data, code, results, figures, plots, slides, etc.) is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.|images/by-nc-sa.png][http://creativecommons.org/licenses/by-nc-sa/3.0/]]
[img(,30px)[images/rss.jpg][index.xml]]
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-6044170-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
\begin{equation}
\frac{dN(x,t)}{dt} = \left\{
\begin{array}{rcl}
\frac{b}{\rho}N(x,t) - F(N) & \mbox{ if } & t \in \left[ nT, nT+T_b \right] \\ \\
- F(N) & \mbox{ if } & t \in \left[ nT+T_b, (n+1)T \right]
\end{array}
\right.
\end{equation}
The aim is to devise a simple quantitative genetic simulation model
[img(50%,)[./images/model_concept_cartoon.jpg]]
!Key parameters
$x(t)$ = the environment at time $t$
$y_0$ = optimal phenotype, where $y_0(x(t)) = $ a function
$y_m$ = ecological genotype, i.e. phenotype in the absence of phenotypic plasticity
$k$ = plasticity genotype, i.e. slope of linear reaction norm
!Key quantities
*Realized ecological pheotype assuming a linear reaction norm: $y = k x(t) + y_m$
*Deviation from optimal phenotype: $y_\Delta = y-y_m$
*Amount of phenotypic plasticity expressed: |y-y_m|
*Realized carrying capacity: $K = K_0 \times \mathcal{N}(y_\Delta, \sigma_K)$ where $K_0$ is the maximal carrying capacity and $\mathcal{N} = \exp \left[ \frac{y_\Delta^2}{2\sigma_K^2} \right]$
* Hence $K=K_0$ if $y_\Delta=0$ and $K \ll K_0$ if $y_\Delta \ll 0$ or $y_\Delta \gg 0$.
!Ecological model: No cost of plasticity
\begin{equation}
\frac{dN(y_m,k,t)}{dt} = r N(y_m,k,t) \left( 1- \frac{N(y_m,k,t)}{K_0 \times \mathcal{N}(y_\Delta, \sigma_K)} \right)
\end{equation}
!Ecological model: Cost of plasticity
If $r=b-d(k)$ then
\begin{equation}
\frac{dN(y_m,k,t)}{dt} = (b-d(y,y_m)) N(y_m,k,t) \left( 1- \frac{N(y_m,k,t)}{K_0 \times \mathcal{N}(y_\Delta, \sigma_K)} \right)
\end{equation}
where $d(y,y_m) = d_0(1+|y-y_m|)$ where $d_0$ is background mortality (in the absence of plasticity).
!Evolution
In this model two uncorrelated traits are under evolution, the ecological genotype $y_m$ and the plasticity genotype $k$.
These guidelines are primarily meant for me to ensure I stick to a consistent and sensible work flow when writing and posting entires.
*Save ''all'' raw and processed data and analysis results that is mentioned and linked to in the notebook (even if it turns out to be erroneous)
*Do not modify existing notebook entries (but see next point).
*Modification of existing notebook entries (e.g. correction of errors) has to be visible, i.e. erroneous parts are striked through and the modification/correction is clearly identified and dated. Exceptions to this rule: fixing minor typos, fixing broken links, minor cosmetic improvements to entry, revising tags.
*Whenever possible minimize the use of external links and iFrame contents. Instead, download the link content and add it to the project folder structure and link it locally link. There are two reasons for this:
##I don't always have internet access
##External links always break sooner or later
*Use relative links only.
*At the end of the day always...
##Write summary for the current notebook entry
##Write commit message
##Get git hash tag (without committing)
##Add commit message and the git hash tag to notebook entry
##Commit changes to git
##Push commits to github
##Syncronize project to server
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
~Pineda-Krch M. Phenotypic plasticity. Chapter in //The Sourcebook in Theoretical Ecology// (Alan Hastings and Louis Gross, eds.). University of California Press. To appear.
Type the text for 'New Tiddler'
/***
|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.6|
|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;
}
}}}
You may also optionally add the following code to load jsMath in [[MarkupPostHead]] if you desire.
{{{
<!--{{{-->
<script src="jsMath/jsMath.js"></script>
<!--}}}-->
}}}
[[Plugin: jsMath]] will normally load jsMath dynamically using AJAX, but adding the above in [[MarkupPostHead]] may be useful if you have jsMath stored in a non-standard location, or if your browser's cross-site origin policy forbids loading files from file URL's using AJAX. (e.g. Google Chrome)
!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
* 5-May-11, version 1.6, Use a script tag to load in Chrome, use jQuery for ajax
!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
***/
//{{{
// Load jsMath
if(typeof jsMath == 'undefined') {
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
};
try {
jQuery.ajax({url: jsMath.Autoload.root+"jsMath.js", dataType: 'script',
async: false, error: function(j, s, e) { throw(e); } });
jsMath.Setup.inited=0; // allow jsMath.Setup.Body() to run again
} catch(e) {
if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1
&& document.location.toString().indexOf('file') == 0) {
var jsMathScript = '<!--{{{-->\n<script src="jsMath/jsMath.js"></script>\n<!--}}}-->';
var MarkupPostHead = store.fetchTiddler("MarkupPostHead");
if(MarkupPostHead && !MarkupPostHead.match(jsMathScript)) {
MarkupPostHead.text += jsMathScript;
} else {
MarkupPostHead = store.createTiddler("MarkupPostHead");
MarkupPostHead.text = jsMathScript;
}
throw("jsMath added to MarkupPostHead: now save and reload (Google Chrome cross origin file:/// URL workaround)");
} else {
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
}
}
}
// 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();
}
}
//}}}
This timline is of what will come (not of what has passed).
|!2011||
|Oct|Start of project|
|Nov||
|Dec||
|!2012||
|Jan||
|Feb||
|Mar||
|May|Start of conference season|
|Jun||
*Should plasticity itself carry a cost (similarly to [[Svanbäck et al. (2009)]])? This means that there would be two costs, i) due to plasticity and ii) due to deviations from the optimal phenotype.
**Pros of plasticity cost: more "realistic"
**Cons of plasticity cost: more complicated model, at least one more parameter
* What should functional form for $y_0(x(t))$ be? Arbitrary? Does the functional form matter? Could it be of interest to explore different functional forms?
**Pros of exploring different functional forms: Results potentially more broadly applicable, we might be able to generalize
**Cons of exploring different functional forms: Simulations and analysis much more time consuming
*Linear reaction norms are simple but probably unrealistic. Should I explore more complex reaction norms, e.g. non-linear reaction norms and/or piece-wise reaction norms (see e.g. [[Reaction norms for larval viability in Drosophila pseudoobscura]])
**Pros of linear $y_0(x(t))$: nice and simple
**Cons of linear $y_0(x(t))$: too simple? Arbitrary choise of functional form. Non-linear functional forms could potentially give very different results.
*Should we wxplore constraints between $y_m$ and $k$ (see e.g. [[Hellmann & Pineda-Krch (2007)]])?
**Pros of constraints: potentially more interesting results, more "realistic"
**Cons of constraints: more complex model, introduces arbitrary stuff (unless we can find studies backing things up)
*Do we need sex?
**Pros of sex: more "realistic"
**Cons of sex: makes life more complicated
[img(75%,+)[./images/reactionnormsdrosophila.jpg]]
Reaction norms for larval viability in a natural population of //Drosophila pseudoobscura//. Each line is the reaction norm for the relative larval viability at three different temperatures for a fourth chromosome homozygote. Most genotypes have a variable phenotype with qualitatively different environmental sensitivities and substantial genotype-by-environment interaction. For example, six out of the 23 genotypes show no significant environmental sensitivity (grey). Other genotypes exhibit poor viability for all temperature regimes (AA 1005) while genotypes have a high viability at low temperatures but deteriorate with increasing temperature (AA 1035). In contrast, genotype AA 1052 exhibits the highest viability at intermediate temperatures while PA 851 shows the opposite trend with higher viability for marginal temperatures. Data from Dobzhansky and Spassky 1944, Genetics 29:270-290.
Based on [[Pineda-Krch (2011)]].
/***
''Name:'' ReferencesPlugin
''Author:'' Garrett Lisi
''Description:'' Places a comma separated list of referring notes at the bottom of each note -- replacing the "references" command bar button.
''Installation:'' Copy this note, change the [[StyleSheet]] to set the references class style, and add a line in the [[ViewTemplate]].
''Code:''
***/
/*{{{*/
config.macros.references = {};
config.macros.references.handler = function(place,macroName,params,wikifier,paramString,note)
{
var references = store.getReferringNotes(note.title);
if(references.length>0)
{
// createTiddlyText(place,"\xAB ");
createTiddlyLink(place,references[0].title,true);
}
for(var r=1; r<references.length; r++)
if(references[r].title != note.title)
{
createTiddlyText(place,", ");
createTiddlyLink(place,references[r].title,true);
}
}
/*}}}*/
No results so far, but event the vanilla model (i.e. no genetic constraints, linear $y_0(x(t))$, etc.) could potentially give very interesting results.
[img(100%,+)[./images/potential_outcomes.jpg]]
From [[Svanbäck et al. (2009)]]
<<search>><<closeAll>><<permaview>><<newTiddler>><<newJournal "DD MMM YYYY" "journal">><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel "options »" "Change TiddlyWiki advanced options">>
/***
|''Name''|SimpleSearchPlugin|
|''Description''|displays search results as a simple list of matching tiddlers|
|''Authors''|FND|
|''Version''|0.4.1|
|''Status''|stable|
|''Source''|http://devpad.tiddlyspot.com/#SimpleSearchPlugin|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/contributors/FND/plugins/SimpleSearchPlugin.js|
|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''Keywords''|search|
!Revision History
!!v0.2.0 (2008-08-18)
* initial release
!!v0.3.0 (2008-08-19)
* added Open All button (renders Classic Search option obsolete)
* sorting by relevance (title matches before content matches)
!!v0.4.0 (2008-08-26)
* added tag matching
!To Do
* tag matching optional
* animations for container creation and removal
* when clicking on search results, do not scroll to the respective tiddler (optional)
* use template for search results
!Code
***/
//{{{
if(!version.extensions.SimpleSearchPlugin) { //# ensure that the plugin is only installed once
version.extensions.SimpleSearchPlugin = { installed: true };
if(!config.extensions) { config.extensions = {}; }
config.extensions.SimpleSearchPlugin = {
heading: "Search Results",
containerId: "searchResults",
btnCloseLabel: "close",
btnCloseTooltip: "dismiss search results",
btnCloseId: "search_close",
btnOpenLabel: "Open all",
btnOpenTooltip: "open all search results",
btnOpenId: "search_open",
displayResults: function(matches, query) {
story.refreshAllTiddlers(true); // update highlighting within story tiddlers
var el = document.getElementById(this.containerId);
query = '"""' + query + '"""'; // prevent WikiLinks
if(el) {
removeChildren(el);
} else { //# fallback: use displayArea as parent
var container = document.getElementById("displayArea");
el = document.createElement("div");
el.id = this.containerId;
el = container.insertBefore(el, container.firstChild);
}
var msg = "!" + this.heading + "\n";
if(matches.length > 0) {
msg += "''" + config.macros.search.successMsg.format([matches.length.toString(), query]) + ":''\n";
this.results = [];
for(var i = 0 ; i < matches.length; i++) {
this.results.push(matches[i].title);
msg += "* [[" + matches[i].title + "]]\n";
}
} else {
msg += "''" + config.macros.search.failureMsg.format([query]) + "''"; // XXX: do not use bold here!?
}
createTiddlyButton(el, this.btnCloseLabel, this.btnCloseTooltip, config.extensions.SimpleSearchPlugin.closeResults, "button", this.btnCloseId);
wikify(msg, el);
if(matches.length > 0) { // XXX: redundant!?
createTiddlyButton(el, this.btnOpenLabel, this.btnOpenTooltip, config.extensions.SimpleSearchPlugin.openAll, "button", this.btnOpenId);
}
},
closeResults: function() {
var el = document.getElementById(config.extensions.SimpleSearchPlugin.containerId);
removeNode(el);
config.extensions.SimpleSearchPlugin.results = null;
highlightHack = null;
},
openAll: function(ev) {
story.displayTiddlers(null, config.extensions.SimpleSearchPlugin.results);
return false;
}
};
config.shadowTiddlers.StyleSheetSimpleSearch = "/*{{{*/\n" +
"#" + config.extensions.SimpleSearchPlugin.containerId + " {\n" +
"\toverflow: auto;\n" +
"\tpadding: 5px 1em 10px;\n" +
"\tbackground-color: [[ColorPalette::TertiaryPale]];\n" +
"}\n\n" +
"#" + config.extensions.SimpleSearchPlugin.containerId + " h1 {\n" +
"\tmargin-top: 0;\n" +
"\tborder: none;\n" +
"}\n\n" +
"#" + config.extensions.SimpleSearchPlugin.containerId + " ul {\n" +
"\tmargin: 0.5em;\n" +
"\tpadding-left: 1.5em;\n" +
"}\n\n" +
"#" + config.extensions.SimpleSearchPlugin.containerId + " .button {\n" +
"\tdisplay: block;\n" +
"\tborder-color: [[ColorPalette::TertiaryDark]];\n" +
"\tpadding: 5px;\n" +
"\tbackground-color: [[ColorPalette::TertiaryLight]];\n" +
"}\n\n" +
"#" + config.extensions.SimpleSearchPlugin.containerId + " .button:hover {\n" +
"\tborder-color: [[ColorPalette::SecondaryMid]];\n" +
"\tbackground-color: [[ColorPalette::SecondaryLight]];\n" +
"}\n\n" +
"#" + config.extensions.SimpleSearchPlugin.btnCloseId + " {\n" +
"\tfloat: right;\n" +
"\tmargin: -5px -1em 5px 5px;\n" +
"}\n\n" +
"#" + config.extensions.SimpleSearchPlugin.btnOpenId + " {\n" +
"\tfloat: left;\n" +
"\tmargin-top: 5px;\n" +
"}\n" +
"/*}}}*/";
store.addNotification("StyleSheetSimpleSearch", refreshStyles);
// override Story.search()
Story.prototype.search = function(text, useCaseSensitive, useRegExp) {
highlightHack = new RegExp(useRegExp ? text : text.escapeRegExp(), useCaseSensitive ? "mg" : "img");
var matches = store.search(highlightHack, null, "excludeSearch");
var q = useRegExp ? "/" : "'";
config.extensions.SimpleSearchPlugin.displayResults(matches, q + text + q);
};
// override TiddlyWiki.search() to sort by relevance
TiddlyWiki.prototype.search = function(searchRegExp, sortField, excludeTag, match) {
var candidates = this.reverseLookup("tags", excludeTag, !!match);
var primary = [];
var secondary = [];
var tertiary = [];
for(var t = 0; t < candidates.length; t++) {
if(candidates[t].title.search(searchRegExp) != -1) {
primary.push(candidates[t]);
} else if(candidates[t].tags.join(" ").search(searchRegExp) != -1) {
secondary.push(candidates[t]);
} else if(candidates[t].text.search(searchRegExp) != -1) {
tertiary.push(candidates[t]);
}
}
var results = primary.concat(secondary).concat(tertiary);
if(sortField) {
results.sort(function(a, b) {
return a[sortField] < b[sortField] ? -1 : (a[sortField] == b[sortField] ? 0 : +1);
});
}
return results;
};
} //# end of "install only once"
//}}}
An Open Notebook Science project ([[beta|What is beta?]])
Evolution in fluctuating environments
/***
|Name|[[StoryViewerPlugin]]|
|Source|http://www.TiddlyTools.com/#StoryViewerPlugin|
|Documentation|http://www.TiddlyTools.com/#StoryViewerPluginInfo|
|Version|1.4.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|view a set of tiddlers using a droplist, "first/previous/next/last" links, or timed slideshow|
The {{{<<storyViewer>>}}} macro allows you to quickly ''display //and// navigate between a set of tiddlers'', using a droplist of titles and/or individual "first/previous/next/last" buttons/text links. It also provides a "slideshow" feature that permits you to ''present one tiddler at a time with a countdown timer to automatically advance to the next tiddler'' after a specified number of seconds.
!!!!!Documentation
> see [[StoryViewerPluginInfo]]
!!!!!Revisions
<<<
2011.03.11 1.4.0 added 'sort:fieldname' parameter
2011.01.24 1.3.4 in droplist onchange handler, don't clear slideshow 'started' flag (allows slideshow to continue after manual navigation)
|please see [[StoryViewerPluginInfo]] for additional revision details|
2007.10.23 1.0.0 Initial release, split {{{<<storyViewer>>}}} macro definition from [[StorySaverPlugin]] to allow separate installation of story saving vs. story viewing features.
<<<
!!!!!Code
***/
//{{{
version.extensions.StoryViewerPlugin= {major: 1, minor: 4, revision: 0, date: new Date(2011,3,11)};
config.macros.storyViewer = {
tag: "story",
storynotfoundmsg: "'%0' is an empty/unrecognized story",
firstcmd: "first",
firstbutton: "<<",
firstmsg: "first: '%0'",
nextcmd: "next",
nextbutton: ">",
nextmsg: "next: '%0'",
previouscmd: "previous",
previousbutton: "<",
prevmsg: "previous: '%0'",
lastcmd: "last",
lastbutton: ">>",
lastmsg: "last: '%0'",
refreshmsg: "redisplay '%0'",
refreshmsg: "",
autostart: false,
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var parsed=paramString.parseParams('anon',null,true,false,false);
var here=story.findContainingTiddler(place);
if (here) var tid=here.getAttribute("tiddler");
var storyname="";
var p=params.shift();
var keywords=['first','previous','here','next','last','list','links','timer','sort'];
if (!p || keywords.indexOf(p.split(':')[0])!=-1) {
// find story from current tiddler name
if (!tid) return; // not in a tiddler... do nothing!
var stories=store.getTaggedTiddlers(this.tag);
if (!stories) return;
for (var s=0; s<stories.length; s++) {
if (!stories[s].linksUpdated) stories[s].changed();
var tids=stories[s].links.slice(0);
if (tids.contains(tid)) { storyname=stories[s].title; break; }
}
if (!storyname.length) return; // current tiddler is not part of a saved story
}
else { storyname=p; p=params.shift(); } // user-specified story name
var sortby=getParam(parsed,'sort','title');
var tids=this.getStory(storyname,sortby); // get tiddler list
var target=null;
switch (p?p.split(':')[0]:'') {
case 'first':
target=tids[0];
break;
case 'previous':
var i=tids.indexOf(tid);
if (i!=-1) var target=tids[Math.max(i-1,0)];
break;
case 'here':
if (tid) target=tid;
break;
case 'next':
var i=tids.indexOf(tid);
if (i!=-1) var target=tids[Math.min(i+1,tids.length-1)];
break;
case 'last':
target=tids[tids.length-1];
break;
case 'links':
this.renderAllLinks(place,storyname);
break;
case 'timer':
var delay=parseInt(getParam(parsed,'timer',15))*1000; // msecs between slides
var autostart=params[0]=='autostart'; if (autostart) params.shift();
var action=params[0]; // null/close/fold
this.renderTimer(place,tids,tid,delay,autostart,action);
break;
case 'list':
default:
var prompt=getParam(parsed,'prompt',storyname+'...');
var nobuttons=params.contains("nobuttons");
var allbuttons=params.contains("allbuttons");
var onlybuttons=params.contains("onlybuttons");
this.renderList(place,tids,tid,storyname,prompt,nobuttons,allbuttons,onlybuttons);
break;
}
var label=getParam(parsed,'label',params[0]||target);
if (target) this.renderLink(place,tid,target,label);
},
getStory: function(storyname,sortby) { // READ TIDDLER LIST
var tids=[];
var fn=store.getMatchingTiddlers||store.getTaggedTiddlers;
var tagged=store.sortTiddlers(fn.apply(store,[storyname]),sortby||'title');
if (tagged.length) // if storyname is a tag, get tagged tiddlers rather than links
for (var t=0; t<tagged.length; t++) tids.push(tagged[t].title);
else {
var t=store.getTiddler(storyname);
if (t && !t.linksUpdated) t.changed();
var tids=t?t.links.slice(0):[];
}
return tids;
},
renderLink: function(place,tid,target,label) {
// override default labelling with specified text (if any)
if (tid==target) { // self-referential links turn into 'refresh links'
var btn=createTiddlyButton(place,null,this.refreshmsg.format([tid]), function() {
var here=story.findContainingTiddler(place).getAttribute("tiddler");
story.refreshTiddler(here,null,true);
});
wikify(label,btn);
}
else // create link
wikify(label,createTiddlyLink(place,target,false));
},
renderAllLinks: function(place,storyname) {
var out="{{floatleft{";
out+="<<storyViewer [["+storyname+"]] first first>> ";
out+="<<storyViewer [["+storyname+"]] previous previous>> ";
out+="}}}";
out+="{{floatright{";
out+=" <<storyViewer [["+storyname+"]] next next>>";
out+=" <<storyViewer [["+storyname+"]] last last>>";
out+="}}}";
out+="{{center{<<storyViewer [["+storyname+"]] here>>}}}";
wikify(out,place);
},
renderList: function(place,tids,tid,storyname,prompt,nobuttons,allbuttons,onlybuttons) {
var h="";
h+='<form style="display:inline">';
if ((!nobuttons||onlybuttons) && allbuttons) {
h+='<input type="button" value="'+this.firstbutton+'" ';
h+=' style="padding:0" title="'+(tids[0]?this.firstmsg.format([tids[0]]):'')+'"';
h+=' onclick="if (this.form.list.length<2) return; ';
h+=' this.form.list.selectedIndex=1; this.form.list.onchange();">';
}
if (!nobuttons||onlybuttons) {
h+='<input type="button" value="'+this.previousbutton+'" style="padding:0 0.3em"';
h+=' onclick="if (this.form.list.length<2) return; ';
h+=' var i=this.form.list.selectedIndex-1; if (i<1) i=1; ';
h+=' this.form.list.selectedIndex=i; this.form.list.onchange();"';
h+=' onmouseover="if (this.form.list.length<2) return; ';
h+=' var i=this.form.list.selectedIndex-1; if (i<1) i=1; ';
h+=' var v=this.form.list.options[i].value; if (!v.length) return; ';
h+=' this.title=config.macros.storyViewer.prevmsg.format([v]);">';
}
h+='<select size="1" name="list"';
if (onlybuttons) h+=' style="display:none;"';
h+=' onchange="if (this.value) story.displayTiddler(this,this.value);">';
h+='<option value="">'+prompt+'</option>';
for (i=0; i<tids.length; i++) {
h+='<option '+
(tids[i]==tid?'selected ':'')+
'value="'+tids[i]+'">\xa0\xa0'+tids[i]+'</option>';
}
h+='</select>';
if (!nobuttons||onlybuttons) {
h+='<input type="button" value="'+this.nextbutton+'" style="padding:0 0.3em"';
h+=' onclick="var i=this.form.list.selectedIndex+1; ';
h+=' if (i>this.form.list.options.length-1) i=this.form.list.options.length-1; ';
h+=' this.form.list.selectedIndex=i; this.form.list.onchange();"';
h+=' onmouseover="var i=this.form.list.selectedIndex+1; ';
h+=' if (i>this.form.list.options.length-1) i=this.form.list.options.length-1; ';
h+=' var v=this.form.list.options[i].value; if (!v.length) return;';
h+=' this.title=config.macros.storyViewer.nextmsg.format([v]);">';
}
if ((!nobuttons||onlybuttons) && allbuttons) {
h+='<input type="button" value="'+this.lastbutton+'" ';
h+=' style="padding:0" title="'+(tids[tids.length-1]?this.lastmsg.format([tids[tids.length-1]]):'')+'"';
h+=' onclick="this.form.list.selectedIndex=this.form.list.options.length-1; this.form.list.onchange();">';
}
h+='</form>';
createTiddlyElement(place,"span").innerHTML=h;
},
renderTimer: function(place,tids,tid,delay,autostart,action) {
var now=new Date().getTime(); // msec
var target=createTiddlyElement(null,'input',now+Math.random()); // unique ID
target.setAttribute('type','button'); target.style.padding='0';
place.appendChild(target);
target.tid =tids[Math.min(tids.indexOf(tid)+1,tids.length-1)]||''; // next tiddler
target.action =action;
target.formatTimer =this.formatTimer;
target.start =this.startTimer;
target.stop =this.stopTimer;
target.onmouseover =this.pauseTimer;
target.onmouseout =this.resumeTimer;
target.tick =this.timerTick;
target.onclick =this.timerClick;
target.next =this.timerNext;
target.start(delay,autostart);
},
formatTimer: function(t) {
return '0:'+String.zeroPad(Math.floor(t/1000),2);
},
startTimer: function(delay,start) {
var co=config.options; // abbrev
start=config.macros.storyViewer.started=start||config.macros.storyViewer.started;
var now=new Date().getTime(); // msec
this.started=start;
this.delay=delay;
this.paused=start?0:delay;
this.stopTime=now+delay; // msec
this.title='CLICK='+(start?'reset':'start')+" slideshow timer... next: '"+this.tid+"'";
this.style.cursor='pointer';
this.value=this.formatTimer(delay);
if (start) {
var code="var e=document.getElementById('"+this.id+"'); if(e)e.tick()";
this.timer=setTimeout(code,500);
}
return false;
},
stopTimer: function() {
this.timer=clearTimeout(this.timer);
this.started=config.macros.storyViewer.started=false;
this.paused=0;
this.title="CLICK=start slideshow timer... next: '"+this.tid+"'";
this.value=this.formatTimer(this.delay);
return false;
},
pauseTimer: function() {
if (!this.started) return;
var now=new Date().getTime(); // msec
this.paused=Math.max(this.stopTime-now,0);
this.stopTime=now+this.paused;
return false;
},
resumeTimer: function() {
if (!this.started || !this.paused) return;
var now=new Date().getTime(); // msec
this.stopTime=now+this.paused;
this.paused=0;
return false;
},
timerTick: function() {
var now=new Date().getTime(); // msec
if (!this.started)
this.stopTime=now+this.delay;
else if (this.paused) {
this.stopTime=now+this.paused;
this.title="[PAUSED] MOUSEOUT=resume, CLICK=reset... next: '"+this.tid+"'";
}
var remaining=this.stopTime-now;
if (remaining>0) {
if (this.started && !this.paused) this.value=this.formatTimer(remaining);
var code="var e=document.getElementById('"+this.id+"'); if(e)e.tick()";
this.timer=setTimeout(code,500);
} else {
this.stop();
this.next();
}
return false;
},
timerClick: function() {
return this.started?this.stop():this.start(this.delay,true);
},
timerNext: function() { // OPEN NEXT TIDDLER
var here=story.findContainingTiddler(this);
config.macros.storyViewer.started=true; // next slide autostarts to continue slideshow
if (this.tid) story.displayTiddler(here,this.tid);
config.macros.storyViewer.started=false;
if (!here) return false;
var t=here.getAttribute('tiddler');
if (this.action=='close') story.closeTiddler(t);
if (this.action=='fold' && config.commands.collapseTiddler) // see CollapseTiddlerPlugin
config.commands.collapseTiddler.handler(null,here,t);
return false;
}
}
//}}}
//{{{
config.paramifiers.story = {
onstart: function(v) {
var t=store.getTiddler(v); if (t) t.changed();
var list=t?t.links:store.getTiddlerText(v,"").parseParams("open",null,false);
story.displayTiddlers(null,list);
}
};
//}}}
/***
|Name|StoryViewerPluginInfo|
|Source|http://www.TiddlyTools.com/#StoryViewerPlugin|
|Documentation|http://www.TiddlyTools.com/#StoryViewerPluginInfo|
|Version|1.4.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|documentation|
|Description|documentation for StoryViewerPlugin|
The {{{<<storyViewer>>}}} macro allows you to quickly ''display //and// navigate between a set of tiddlers'', using a droplist of titles and/or individual "first/previous/next/last" buttons/text links. It also provides a "slideshow" feature that permits you to ''present one tiddler at a time with a countdown timer to automatically advance to the next tiddler'' after a specified number of seconds.
!!!!!Usage
<<<
{{{
<<storyViewer storyname|tagvalue list buttonoption prompt:... sort:...>>
<<storyViewer storyname|tagvalue first|previous|here|next|last sort:...>>
<<storyViewer storyname|tagvalue links sort:fieldname>>
<<storyViewer storyname|tagvalue timer:nnn autostart close|fold sort:...>>
}}}
where:
* ''storyname'' or ''tagvalue''<br>specifies a set of tiddler titles, defined either by matching a tag value, or by creating a tiddler, tagged with <<tag story>>, containing a space-separated list of titles. //Note: You can use the {{{<<saveStory>>}}} macro (see [[StorySaverPlugin]]) to automatically create stories using the titles of the tiddlers that are currently being viewed.// If you omit the storyname/tagname parameter, the plugin will attempt to identify a suitable story by locating the current tiddler title within a saved story tiddler. The story view controls are not displayed unless the current tiddler title is explicitly found in at least one saved story.
** Note: if [[MatchTagsPlugin]] is installed, you can use a compound //boolean tag expression//, enclosed within doubled square brackets. This allows you to generate sets of stories based on complex combinations of tags, rather than matching just one tag value. [[MatchTagsPlugin]] also allows you to use a //wildcard// expression, ".*" (without quotes), that will match all tiddlers, regardless of their tag value(s).
* ''list''<br>displays a droplist of tiddlers for the specified story, with previous/next pushbuttons on either side of the list. You can also specify which buttons will appear when using a droplist:
** ''allbuttons''<br>displays buttons for first/last as well as previous/next.
** ''nobuttons''<br>displays the droplist without any buttons
** ''onlybuttons''<br>hides the droplist and shows just the buttons
* ''prompt:...'' (default={{{"storyname..."}}})<br>specifies non-selectable label text to use as the first item in the droplist.
* ''sort:fieldname'' //(optional)//<br>when a ''tagvalue'' is used to select tiddlers, you can specify a tiddler fieldname that can be used to sort the resulting list of tiddlers, with an optional "-" prefix to indicate descending vs. ascending ordering, e.g, "sort:-modified" will generate a list of tiddlers in reverse date order (newest tiddler first).
* ''first'' or ''previous'' or ''here'' or ''next'' or ''last''<br>displays an individual link to the indicated tiddler within the story. The next/previous links are automatically calculated relative to the current tiddler. ''here'' displays the current tiddler title.
* ''links''<br>displays the set of first, previous, here, next and last links with just one convenient macro invocation, allowing you to quickly and easily embed story navigation links into any tiddler content.
* ''timer:nnn''<br>displays an automatic countdown 'slideshow' timer, where ''nnn'' is the number of seconds between slides. Click on the timer to start the countdown. The countdown is paused when hovering over the timer. Click a //running// timer to immediately advance to the next tiddler in the story. Optional slideshow parameters:
** ''autostart''<br>automatically starts the countdown without an initial click.
** ''close'' or ''fold''<br>close or fold (see [[CollapseTiddlerPlugin]]) the current tiddler when the next tiddler in the story is opened. The default is to simply display the next tiddler following the current one.
<<<
!!!!!Examples
<<<
{{smallform{
{{{
<<storyViewer MenuDefinitions list nobuttons>>
}}}
><<storyViewer MenuDefinitions list nobuttons>> //uses "saved story" tiddler//
{{{
<<storyViewer pluginInfo>>
}}}
><<storyViewer pluginInfo>>
{{{
<<storyViewer pluginInfo list allbuttons prompt:"TiddlyTools menu definitions...">>
}}}
><<storyViewer pluginInfo list allbuttons prompt:"TiddlyTools menu definitions...">>
{{{
<<storyViewer pluginInfo first>>
<<storyViewer pluginInfo previous>>
<<storyViewer pluginInfo next>>
<<storyViewer pluginInfo last>>
}}}
><<storyViewer pluginInfo first>>
><<storyViewer pluginInfo previous>>
><<storyViewer pluginInfo next>>
><<storyViewer pluginInfo last>>
{{{
<<storyViewer pluginInfo previous label:"back">>
<<storyViewer pluginInfo next label:"forward">>
}}}
><<storyViewer pluginInfo previous label:"back">>
><<storyViewer pluginInfo next label:"forward">>
{{{
<<storyViewer pluginInfo links>>
}}}
><<storyViewer pluginInfo links>>
{{{
<<storyViewer pluginInfo timer:20 fold>>
}}}
><<storyViewer pluginInfo timer:20 fold>>
{{{
<<storyViewer ".*" prompt:"timeline..." sort:-modified>>
}}}
><<storyViewer ".*" prompt:"timeline..." sort:-modified>>
}}}
<<<
!!!!!Revisions
<<<
2011.03.11 1.4.0 added 'sort:fieldname' parameter
2011.01.24 1.3.4 in droplist onchange handler, don't clear slideshow 'started' flag (allows slideshow to continue after manual navigation)
2011.01.12 1.3.3 added config.macros.storyViewer.started (controls 'autostart' for automatic presentation of multiple pages)
2011.01.11 1.3.2 use pushbutton instead of text to display slideshow timer
2011.01.11 1.3.1 code and documentation cleanup
2011.01.10 1.3.0 added slideshow (params= timer:nnn, autostart, close/fold). Added custom prompt for droplist (param= prompt:"text"). Added support for [[MatchTagsPlugin]]
2008.06.05 1.2.0 added custom story paramifier to extract story titles from tiddler links instead of using parseParams. Permits use of links from any tiddler as a story, even if it contains wiki-syntax formatting in addition to list of tiddler titles
2008.03.10 *.*.* plugin size reduction: documentation moved to [[StoryViewerPluginInfo]]
2007.12.31 1.1.0 instead of readBracketedList(), use internal tiddler.links[] to retrieve story list from tiddler content. Allows more flexible formatting of story tiddler content.
2007.12.04 *.*.* update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.10.23 1.0.0 Initial release, split {{{<<storyViewer>>}}} macro definition from [[StorySaverPlugin]] to allow separate installation of story saving vs. story viewing features.
<<<
body {
font-size: 0.8em;
margin-bottom: 4em;
}
.viewer {
line-height: 125%;
font-family: 'Consolas' monospace;
font-size: 11pt;
}
/* a contrasting background so I can see where one tiddler ends and the other begins */
body {
background: #eee;
}
/* don't want any background color for headings */
h1,h2,h3,h4,h5,h6 {
background: [[ColorPalette::Background]];
color: [[ColorPalette::Foreground]];
}
/* make shadow go and down right instead of up and left */
.headerShadow {
left: 0px;
top: 0px;
}
/* prefer monospace for editing */
.editor textarea {
font-family: 'Consolas' monospace;
}
/* give tiddlers 3d style border and explicit background */
.tiddler {
background: [[ColorPalette::Background]];
border-right: 2px [[ColorPalette::TertiaryMid]] solid;
border-bottom: 2px [[ColorPalette::TertiaryMid]] solid;
margin-bottom: 1em;
padding-bottom: 1em;
padding-top: 0.75em;
}
/* the borders look wrong with the body background */
#sidebar .button {
border-style: none;
}
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
a {color:[[ColorPalette::PrimaryMid]];}
a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
a img {border:0;}
h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}
.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}
.header {background:[[ColorPalette::PrimaryMid]];}
.headerShadow {color:[[ColorPalette::Foreground]];}
.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
.headerForeground {color:[[ColorPalette::Background]];}
.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}
.tabSelected {color:[[ColorPalette::PrimaryDark]];
background:[[ColorPalette::TertiaryPale]];
border-left:1px solid [[ColorPalette::TertiaryLight]];
border-top:1px solid [[ColorPalette::TertiaryLight]];
border-right:1px solid [[ColorPalette::TertiaryLight]];
}
.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
.tabContents .button {border:0;}
#sidebar {}
#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}
.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
border:1px solid [[ColorPalette::PrimaryMid]];}
.wizardStep.wizardStepDone {background:[[ColorPalette::TertiaryLight]];}
.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}
.wizard .notChanged {background:transparent;}
.wizard .changedLocally {background:#80ff80;}
.wizard .changedServer {background:#8080ff;}
.wizard .changedBoth {background:#ff8080;}
.wizard .notFound {background:#ffff80;}
.wizard .putToServer {background:#ff80ff;}
.wizard .gotFromServer {background:#80ffff;}
#messageArea {border:1px solid [[ColorPalette::SecondaryMid]]; background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]];}
#messageArea .button {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::SecondaryPale]]; border:none;}
.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}
.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}
.tiddler .defaultCommand {font-weight:bold;}
.shadow .title {color:[[ColorPalette::TertiaryDark]];}
.title {color:[[ColorPalette::SecondaryDark]];}
.subtitle {color:[[ColorPalette::TertiaryDark]];}
.toolbar {color:[[ColorPalette::PrimaryMid]];}
.toolbar a {color:[[ColorPalette::TertiaryLight]];}
.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}
.tagging, .tagged {border:1px solid [[ColorPalette::TertiaryPale]]; background-color:[[ColorPalette::TertiaryPale]];}
.selected .tagging, .selected .tagged {background-color:[[ColorPalette::TertiaryLight]]; border:1px solid [[ColorPalette::TertiaryMid]];}
.tagging .listTitle, .tagged .listTitle {color:[[ColorPalette::PrimaryDark]];}
.tagging .button, .tagged .button {border:none;}
.footer {color:[[ColorPalette::TertiaryLight]];}
.selected .footer {color:[[ColorPalette::TertiaryMid]];}
.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
.lowlight {background:[[ColorPalette::TertiaryLight]];}
.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}
.imageLink, #displayArea .imageLink {background:transparent;}
.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}
.viewer .listTitle {list-style-type:none; margin-left:-2em;}
.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}
.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}
.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
.viewer code {color:[[ColorPalette::SecondaryDark]];}
.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}
.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}
.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
.editorFooter {color:[[ColorPalette::TertiaryMid]];}
.readOnly {background:[[ColorPalette::TertiaryPale]];}
#backstageArea {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::TertiaryMid]];}
#backstageArea a {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstageArea a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; }
#backstageArea a.backstageSelTab {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
#backstageButton a {background:none; color:[[ColorPalette::Background]]; border:none;}
#backstageButton a:hover {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstagePanel {background:[[ColorPalette::Background]]; border-color: [[ColorPalette::Background]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]];}
.backstagePanelFooter .button {border:none; color:[[ColorPalette::Background]];}
.backstagePanelFooter .button:hover {color:[[ColorPalette::Foreground]];}
#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.6; filter:alpha(opacity=60);}
/*}}}*/
{{{
@ARTICLE{svanback.etal09,
author = {Svanbäck, R. and Pineda-Krch, M. and Doebeli, M.},
title = {Fluctuating population dynamics promotes the evolution of phenotypic plasticity},
journal = {The American Naturalist},
year = {2009},
volume = {174},
pages = {176-189},
file = {svanback.etal09.pdf:svanback.etal09.pdf:PDF}
}
}}}
http://www.math.ualberta.ca/~mpineda/public/svanback.etal09.pdf
/***
|Name|TaggedTemplateTweak|
|Source|http://www.TiddlyTools.com/#TaggedTemplateTweak|
|Documentation|http://www.TiddlyTools.com/#TaggedTemplateTweakInfo|
|Version|1.6.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|use alternative ViewTemplate/EditTemplate for specific tiddlers|
This plugin extends the core function, story.chooseTemplateForTiddler(), so that any given tiddler can be viewed and/or edited using alternatives to the standard tiddler templates.
!!!!!Documentation
>see [[TaggedTemplateTweakInfo]]
!!!!!Revisions
<<<
2009.09.02 [1.6.1] apply field-based template (if any) *before* tag-based template
| please see [[TaggedTemplateTweakInfo]] for previous revision details |
2007.06.11 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.TaggedTemplateTweak= {major: 1, minor: 6, revision: 1, date: new Date(2009,9,2)};
if (!config.options.txtTemplateTweakFieldname)
config.options.txtTemplateTweakFieldname='template';
Story.prototype.taggedTemplate_chooseTemplateForTiddler = Story.prototype.chooseTemplateForTiddler
Story.prototype.chooseTemplateForTiddler = function(title,template)
{
// get core template and split into theme and template name
var coreTemplate=this.taggedTemplate_chooseTemplateForTiddler.apply(this,arguments);
var theme=""; var template=coreTemplate;
var parts=template.split(config.textPrimitives.sectionSeparator);
if (parts[1]) { theme=parts[0]; template=parts[1]; }
else theme=config.options.txtTheme||""; // if theme is not specified
theme+=config.textPrimitives.sectionSeparator;
// look for template using title as prefix
if (!store.getTaggedTiddlers(title).length) { // if tiddler is not a tag
if (store.getTiddlerText(theme+title+template))
{ return theme+title+template; } // theme##TitleTemplate
if (store.getTiddlerText(title+template))
{ return title+template; } // TitleTemplate
}
// look for templates using custom field value as prefix
var v=store.getValue(title,config.options.txtTemplateTweakFieldname);
if (store.getTiddlerText(theme+v+template))
{ return theme+v+template; } // theme##valueTemplate
if (store.getTiddlerText(v+template))
{ return v+template; } // valueTemplate
// look for template using tags as prefix
var tiddler=store.getTiddler(title);
if (!tiddler) return coreTemplate; // tiddler doesn't exist... use core result
for (i=0; i<tiddler.tags.length; i++) {
var t=tiddler.tags[i]+template; // add tag prefix to template
var c=t.substr(0,1).toUpperCase()+t.substr(1); // capitalized for WikiWord title
if (store.getTiddlerText(theme+t)) { return theme+t; } // theme##tagTemplate
if (store.getTiddlerText(theme+c)) { return theme+c; } // theme##TagTemplate
if (store.getTiddlerText(t)) { return t; } // tagTemplate
if (store.getTiddlerText(c)) { return c; } // TagTemplate
}
// no match... use core result
return coreTemplate;
}
//}}}
/***
|Name|TaggedTemplateTweakInfo|
|Source|http://www.TiddlyTools.com/#TaggedTemplateTweak|
|Documentation|http://www.TiddlyTools.com/#TaggedTemplateTweakInfo|
|Version|1.6.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|documentation|
|Description|Documentation for TaggedTemplateTweak|
This plugin extends the core function, story.chooseTemplateForTiddler(), so that any given tiddler can be viewed and/or edited using alternatives to the standard tiddler templates. To select alternative templates, a 'template prefix' is determined by using the tiddler's title or matching a tag value or using a value stored in a custom tiddler field.
!!!!!Usage
<<<
*The plugin first attempts to use the tiddler's //title// as a prefix added to the standard TiddlyWiki template titles, [[ViewTemplate]] and [[EditTemplate]] (i.e., ''TiddlerNameViewTemplate'' and ''TiddlerNameEditTemplate''). This allows you to associate a custom template with a specific tiddler, without needing to add any special tags or custom field values to that individual tiddler.
*You can also define a tiddler's template prefix by using a //custom tiddler field// named 'template'. If no corresponding template was found using the tiddler's title, then the tiddler's 'template' field value, if present, will be used as a prefix (e.g., if template='SomeThing', then [[SomeThingViewTemplate]] will be applied).
*If no template is found using the either the title or 'template' field, then each of the tiddler's tags is tried as a template prefix, until a corresponding template, if any, is found. For example, any tiddlers that are tagged with ''<<tag media>>'' could find alternative templates named [[mediaViewTemplate]] and [[mediaEditTemplate]].
*If you using a systemTheme, the plugin will also tries adding the currently selected theme name (specified by {{{config.options.txtTheme}}}) to the template name (e.g. ''[[SomeTheme##MediaViewTemplate]]'') so that the alternative template definitions can be contained as //sections// within a single systemTheme tiddler.
*Lastly, if no alternative template is found at all, the standard [[ViewTemplate]] or [[EditTemplate]] definition as determined by the TiddlyWiki core handler is used.
Notes:
*You can redefine the //name// of the custom field used to store the template prefix. For example, to use the name of a TiddlyWeb server-side 'bag' as a prefix (so that tiddlers from separate bags can have different appearances), add the following to a tiddler tagged with<<tag systemConfig>>:{{block{
{{{
config.options.txtTemplateTweakFieldname='server.bag'; // use TiddlyWeb bag name as prefix
}}}
}}}
*To permit use of templates that have proper WikiWord tiddler titles (e.g., [[MediaViewTemplate]] and [[MediaEditTemplate]]), the plugin also attempts to use a capitalized form of the tag value (e.g., ''Media'') as a prefix. //This capitalization is for comparison purposes only and will not alter the actual tag values that are stored in the tiddler.//
<<<
!!!!!Examples
<<<
|Sample tiddler| tag | view template | edit template |
|[[MediaSample - QuickTime]]| <<tag media>> | [[MediaViewTemplate]] | [[MediaEditTemplate]] |
|[[MediaSample - Windows]]| <<tag media>> | [[MediaViewTemplate]] | [[MediaEditTemplate]] |
|[[CDSample]]| <<tag CD>> | [[CDViewTemplate]] | [[CDEditTemplate]] |
|<<newTiddler label:"create new task..." title:SampleTask tag:task text:"Type some text and then press DONE to view the task controls">> | <<tag task>> | [[TaskViewTemplate]] | [[EditTemplate]] |
//(note: if these samples are not present in your document, please visit// http://www.TiddlyTools.com/ //to view these sample tiddlers on-line)//
<<<
!!!!!Revisions
<<<
2009.09.02 1.6.1 apply field-based template (if any) *before* tag-based template
2009.07.31 1.6.0 added support for using custom field value as prefix
2009.05.04 1.5.2 check for tiddler exist *after* title-as-prefix (allows shadow tiddlers to use custom templates)
2009.01.06 1.5.1 reversed logic so that title-as-prefix takes precedence over tag-matched prefix
2008.12.18 1.5.0 added handling for using tiddler //title// as prefix (e.g., {{{SomeTiddlerViewTemplate}}})
2008.08.29 1.4.1 corrected handling for tiddlers with no matching tagged template when non-default theme is in effect (e.g., use "MyTheme##ViewTemplate").
2008.05.15 1.4.0 support use of *shadow* tagged templates (e.g., [[DiscussionViewTemplate]] created by [[DiscussionPlugin]])
2008.05.10 1.3.0 corrected handling for determining core template when using theme with sections
2008.05.01 1.2.5 added support for tagged templates stored as sections in a theme
2008.04.01 1.2.0 added support for using systemTheme section-based template definitions (requested by Phil Hawksworth)
2008.01.22 [*.*.*] plugin size reduction - documentation moved to [[TaggedTemplateTweakInfo]]
2007.06.23 1.1.0 re-written to use automatic 'tag prefix' search instead of hard coded check for each tag. Allows new custom tags to be used without requiring code changes to this plugin.
2007.06.11 1.0.0 initial release
<<<
!JPG image with relative scaling {{{[img(10%,)[./images/cats.jpg]]}}}
[img(10%,)[./images/cats.jpg]]
!JPG image with relative scaling {{{[img(50%,)[./images/cats.jpg]]}}}
[img(50%,)[./images/cats.jpg]]
!JPG image with relative scaling {{{[img(100%,)[./images/cats.jpg]]}}}
[img(100%,)[./images/cats.jpg]]
!JPG image with absolute scaling {{{[img(30cm,)[./images/cats.jpg]]}}}
Not pretty!
[img(30cm,)[./images/cats.jpg]]
! PDF image
[img(100%,)[./images/seasonal_birth.pdf]]
>"In some sense, having your lab 100% completely out in the open is like walking around naked. You probably really don't have anything surprising to hide, but on the other hand, you're uncomfortable doing it and most people aren't interested in seeing it. So, it doesn't hurt to wear some clothing." - [[Koch Lab principles|http://openwetware.org/wiki/Koch_Lab:Principles#Openness_on_the_wikis]]
>"I'm an exhibisionist and most other forms of exhibisionism are prohibited by law." - [[AcademicPensieve|http://katlas.math.toronto.edu/drorbn/AcademicPensieve/About.html]]
>"...the process [of open science is] as being to ordinary research as driving is to pushing a car." - [[Gowers|http://michaelnielsen.org/blog/open-science-2/]]
>"...if we believe that science enriches society then we must accept that society can, and perhaps should, enrich our research. And that can only happen if it is open." - [[Cameron Neylon|http://www.newscientist.com/article/mg21128285.600-cameron-neylon-time-for-total-scientific-openness.html]]
!Todo
*--Find Koch's nude science quote--
Other ONS Tiddlywikis:
*http://elabnotebook.tiddlyspot.com
*http://tjoresearchnotes.tiddlyspot.com/
*http://www.uea.ac.uk/~e356
<<list filter [tag[journal]][sort[-created]]>>
There is also a [[ToC by modification date]].
<<list filter [tag[journal]][sort[-modified]]>>
There is also a [[ToC by creation date]].
''What is this?:'' This is a list of stuff that needs to be done, some of it is important and some of it not.
''Who will do it?:'' Me or you. If you want to contribute this is the place to start.
''If you wish to contribute:'' Email me and let me know what you have in mind.
<<search Todo>>
*Identify relevant key references and add them to a reference folder (probably needs to be password protected)
*Write simulation code
/%
!info
|Name|ToggleLeftSidebar|
|Source|http://www.TiddlyTools.com/#ToggleLeftSidebar|
|Version|2.0.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|transclusion|
|Description|show/hide left sidebar (MainMenu)|
Usage
<<<
{{{
<<tiddler ToggleLeftSidebar>>
<<tiddler ToggleLeftSidebar with: label tooltip>>
}}}
Try it: <<tiddler ToggleLeftSidebar##show
with: {{config.options.chkShowLeftSidebar?'◄':'►'}}>>
<<<
Configuration:
<<<
{{{
config.options.chkShowLeftSidebar (true)
config.options.txtToggleLeftSideBarLabelShow (►)
config.options.txtToggleLeftSideBarLabelHide (◄)
}}}
<<<
!end
!show
<<tiddler {{
var co=config.options;
if (co.chkShowLeftSidebar===undefined) co.chkShowLeftSidebar=true;
var mm=document.getElementById('mainMenu');
var da=document.getElementById('displayArea');
if (mm) {
mm.style.display=co.chkShowLeftSidebar?'block':'none';
da.style.marginLeft=co.chkShowLeftSidebar?'':'1em';
}
'';}}>><html><nowiki><a href='javascript:;' title="$2"
onmouseover="
this.href='javascript:void(eval(decodeURIComponent(%22(function(){try{('
+encodeURIComponent(encodeURIComponent(this.onclick))
+')()}catch(e){alert(e.description?e.description:e.toString())}})()%22)))';"
onclick="
var co=config.options;
var opt='chkShowLeftSidebar';
var show=co[opt]=!co[opt];
var mm=document.getElementById('mainMenu');
var da=document.getElementById('displayArea');
if (mm) {
mm.style.display=show?'block':'none';
da.style.marginLeft=show?'':'1em';
}
saveOptionCookie(opt);
var labelShow=co.txtToggleLeftSideBarLabelShow||'►';
var labelHide=co.txtToggleLeftSideBarLabelHide||'◄';
if (this.innerHTML==labelShow||this.innerHTML==labelHide)
this.innerHTML=show?labelHide:labelShow;
this.title=(show?'hide':'show')+' left sidebar';
var sm=document.getElementById('storyMenu');
if (sm) config.refreshers.content(sm);
return false;
">$1</a></html>
!end
%/<<tiddler {{
var src='ToggleLeftSidebar';
src+(tiddler&&tiddler.title==src?'##info':'##show');
}} with: {{
var co=config.options;
var labelShow=co.txtToggleLeftSideBarLabelShow||'►';
var labelHide=co.txtToggleLeftSideBarLabelHide||'◄';
'$1'!='$'+'1'?'$1':(co.chkShowLeftSidebar?labelHide:labelShow);
}} {{
var tip=(config.options.chkShowLeftSidebar?'hide':'show')+' left sidebar';
'$2'!='$'+'2'?'$2':tip;
}}>>
/%
!info
|Name|ToggleRightSidebar|
|Source|http://www.TiddlyTools.com/#ToggleRightSidebar|
|Version|2.0.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|transclusion|
|Description|show/hide right sidebar (SideBarOptions)|
Usage
<<<
{{{
<<tiddler ToggleRightSidebar>>
<<tiddler ToggleRightSidebar with: label tooltip>>
}}}
Try it: <<tiddler ToggleRightSidebar##show
with: {{config.options.chkShowRightSidebar?'►':'◄'}}>>
<<<
Configuration:
<<<
copy/paste the following settings into a tiddler tagged with <<tag systemConfig>> and then modify the values to suit your preferences:
{{{
config.options.chkShowRightSidebar=true;
config.options.txtToggleRightSideBarLabelShow="◄";
config.options.txtToggleRightSideBarLabelHide="►";
}}}
<<<
!end
!show
<<tiddler {{
var co=config.options;
if (co.chkShowRightSidebar===undefined) co.chkShowRightSidebar=true;
var sb=document.getElementById('sidebar');
var da=document.getElementById('displayArea');
if (sb) {
sb.style.display=co.chkShowRightSidebar?'block':'none';
da.style.marginRight=co.chkShowRightSidebar?'':'1em';
}
'';}}>><html><nowiki><a href='javascript:;' title="$2"
onmouseover="
this.href='javascript:void(eval(decodeURIComponent(%22(function(){try{('
+encodeURIComponent(encodeURIComponent(this.onclick))
+')()}catch(e){alert(e.description?e.description:e.toString())}})()%22)))';"
onclick="
var co=config.options;
var opt='chkShowRightSidebar';
var show=co[opt]=!co[opt];
var sb=document.getElementById('sidebar');
var da=document.getElementById('displayArea');
if (sb) {
sb.style.display=show?'block':'none';
da.style.marginRight=show?'':'1em';
}
saveOptionCookie(opt);
var labelShow=co.txtToggleRightSideBarLabelShow||'◄';
var labelHide=co.txtToggleRightSideBarLabelHide||'►';
if (this.innerHTML==labelShow||this.innerHTML==labelHide)
this.innerHTML=show?labelHide:labelShow;
this.title=(show?'hide':'show')+' right sidebar';
var sm=document.getElementById('storyMenu');
if (sm) config.refreshers.content(sm);
return false;
">$1</a></html>
!end
%/<<tiddler {{
var src='ToggleRightSidebar';
src+(tiddler&&tiddler.title==src?'##info':'##show');
}} with: {{
var co=config.options;
var labelShow=co.txtToggleRightSideBarLabelShow||'◄';
var labelHide=co.txtToggleRightSideBarLabelHide||'►';
'$1'!='$'+'1'?'$1':(co.chkShowRightSidebar?labelHide:labelShow);
}} {{
var tip=(config.options.chkShowRightSidebar?'hide':'show')+' right sidebar';
'$2'!='$'+'2'?'$2':tip;
}}>>
[img(25%,)[./images/underconstruction.jpg]]
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></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>
<!--}}}-->
This is my personal research notebook for the //Evolution in fluctuating environments// project.
This notebook and all the associated data, code and results is publicly available in as close to real-time as possible. This research notebook is primarily a tool for me to organize and record results, ideas, and progress with the aim of being intelligible to me in the future. For someone with a graduate studies background in evolutionary biology, ecology and math, some of what is here might be accessible, and perhaps even be of interest.
If you want to (re)use any content look at the [[license|License]] first. If you want to cite the notebook look at the [[citation guideline|Cite]] first.
*beta aka 'experimental feature'
*experimental feature aka buggy, unreliable, non-permanent, 'testing the waters'
*buggy aka errors
*unreliable aka errors
*non-permanent aka 'I can change my mind any minute'
*'testing the waters' aka 'I can change my mind any minute'
[img[./images/ONS.jpg]]
There are many and reasons why people decide to embark on ONS (Open Notebook Science). Here is an incomplete list of some of the reasons for why I decided to conduct this research project in the spirit of Open Notebook Science? There is no particular order to the list. The entries are numbered to simplify cross-referencing.
#It's your tax dollars at work.
#Much more better use of public money (and of resources in general) by allowing others to reuse and/or build on ideas/code/data... (http://figshare.com/)
#Greatest benefit to society (scientific discoveries disseminated as they happen, not years later when it appears in traditional journals)
#May give rise to collaborations with others in the field
#May give rise to collaborations with others outside of the field which could take the projects in unexpected directions and give rise to new inter/trans-disciplinary research directions and projects.
#More brain power (leverages the collective wet ware of the social web). Combining the ideas of many minds make hard scientific problems easier to solve (http://michaelnielsen.org/blog/open-science-2/). Expand our ability to solve the most challening scientific problems, think of it as parallelized science (computers have done it for decades). As a result this the range of scientific problems we can hope to solve expands.
#Avoid getting scooped, specifically
##//The good//:If it has already been published others can draw your attention to this early on. Better than being told by a referee after submitting your paper.
##//The bad//: If someone else is working on it at the same time they could let you know and allow the two of you to ensure that no-one gets scooped (or they could of course just try to speed things up and get it out before you). Basic principle: treat colleagues the way you want them to treat you, in other words, while I don't want to get scooped I also have no interest to scoop some one else. It is in everyone's interest to avoid accidental scooping. The person you scoop may be on your next search/tenure/promotion/grant committee and or the next faculty that your department hires and puts in the office next to you. And vice versa.
##//The ugly//: Someone stealing your idea/data and publishing it. Will not work since there is a public record that it is yours (case in point, it would be like stealing the Mona Lisa and putting it on displayed in another museum). Isn't stealing a public project/data/idea an oxymoron anyway?
#Reproducibility. Although the number of irreproducible results are increasing perhaps the most famous example is Fermat's Last Theorem which remained irreproducible for hundreds of years.
#Accountability and fraud prevention
#Increase public understanding of how science works and how scientific progress comes about
#Of historical interest. Case in point, we are still studying the notebooks of <//name of favorite famous dead scientist//>, e.g. Darwin, Einstein, etc. (Not that I am suggesting anyone will ever study my notebook)
#Improving the scientific process by encouraging others to embrace more transparent (and reproducible) research practices and contribute to dispelling myths about all the bad stuff people think will happens if you do science in the nude.
#Providing a view into the daily life of a scientist may inspire young people to pursue a career in science (of course it could also dissuade them) (http://stargrads.net/blogs/davinci/2009/06/an-essay-on-open-notebook-science/)
#Increasing exposure and citations (now that people actually can reproduce and/or access the data and result)
#Help others solve problems by allowing them to use and/or modify my code and (perhaps more importantly) letting others learn from your mistakes and dead ends.
#Others can (re)use my data (e.g. for us in projects addressing different/alternative/complementary questions)
#Improve the scientific work environment by increasing trust, respect and openness between researchers and research groups.
#To attract students and postdocs to your research group.
Sounds to good to be true? Others with more ONS experience may have a better feeling for whether these reasons are actually true or just wishful thinking. For me it is an experiment (aka [beta]).
!Text
|!Format|!It will look like this...|!...if you format it like this...|
|Bold-faced type|''text''|{{{''text''}}}|
|Italic text|//text//|{{{//text//}}}|
|Underlined text|__text__|{{{__text__}}}|
|Strike-through text|--text--|{{{--text--}}}|
|Colored text|@@color(green):green colored@@|{{{@@color(green):green colored@@}}}|
|Text with colored background|@@bgcolor(#ff0000):color(#ffffff):red colored@@|{{{@@bgcolor(#ff0000):color(#ffffff):red colored@@}}}|
|Highlighting|@@text@@|{{{@@text@@}}}|
|Superscript|2^^3^^=8|{{{2^^3^^=8}}}|
|Subscript|a~~ij~~ = -a~~ji~~|{{{a~~ij~~ = -a~~ji~~}}}|
!Links and images
|bgcolor(#dddddd):Links with wikiwords|EnchiLada (inactive link - no tiddler yet)<br>WikiWord (active link to tiddler)|{{{EnchiLada}}}<br>{{{WikiWord}}}|
|bgcolor(#dddddd):~De-Wikify a ~WikiWord|~WikiWord, ~EnchiLada|{{{~WikiWord, ~EnchiLada}}}|
|bgcolor(#dddddd):Links with brackets|[[How to add background images]]|{{{[[How to add background images]]}}}|
|bgcolor(#dddddd):Pretty links|[[display text|ColorSchemes]] - links to the tiddler of color schemes|{{{[[display text|ColorSchemes]]}}}|
|bgcolor(#dddddd):External links work the same way:|http://groups.google.com/group/TiddlyWiki <br><br>[[TiddlyWiki Google group|http://groups.google.com/group/TiddlyWiki]]|{{{http://groups.google.com/group/TiddlyWiki}}} <br><br> {{{[[TiddlyWiki Google group|http://groups.google.com/group/TiddlyWiki]]}}}|
|bgcolor(#dddddd):Links to local files|To a file on a CD in your D drive: <br><br>To a file on your USB stick on your e drive: <br><br>To a file in your hard drive:|{{{file:///D:/filename.doc/}}}<br><br>{{{file:///E:/filename.doc/}}}<br><br>{{{file:///C:/filepath/filename.doc/}}}|
''Images:''
{{{[img[http://farm1.static.flickr.com/39/122259544_6913ca58f3_m.jpg]]}}} is the formatting for:
[img[http://farm1.static.flickr.com/39/122259544_6913ca58f3_m.jpg]]
''A tip from Jeremy Hodge:''
"...[You] may add an image as a local file with the following: {{{[img[.\filepath\filename.jpg]]}}} which adds a picture from the directory that is contained within the same directory as TW. This is very useful for me or anyone who carries their own TW on a USB drive such as myself."
!Lists
''Numbered lists:''
{{{#item one }}}
{{{##Item 1a}}}
{{{###Item 1ai}}}
produces:
#item one
##Item 1a
###Item 1ai
''Bulleted lists:''
{{{*Bullet one}}}
{{{**Bullet two}}}
{{{***Bullet three}}}
produces:
*Bullet one
**Bullet two
***Bullet level three
!Tables
{{{|!Table header|!Column Two|}}}
{{{|>| colspan |}}}
{{{| rowspan |left aligned|}}}
{{{|~| right aligned|}}}
{{{|bgcolor(#DC1A1A):colored| centered |}}}
{{{||*lists<br>*within<br>*tables<br><br>and double-spaced too|}}}
{{{|caption|c}}}
!This is the result:
|!Table header|!Column Two|
|>| colspan |
| rowspan |left aligned|
|~| right aligned|
|bgcolor(#DC1A1A):colored| centered |
||*lists<br>*within<br>*tables<br><br>and double-spaced too|
|caption|c
[[More information on tables]]
!Blockquotes
''Line-by-line blockquotes:''
{{{>level 1}}}
{{{>level 1}}}
{{{>>level 2}}}
{{{>>level 2}}}
{{{>>>level 3}}}
{{{>>>level 3}}}
{{{>>level 2}}}
{{{>level 1}}}
produces:
>level 1
>level 1
>>level 2
>>level 2
>>>level 3
>>>level 3
>>level 2
>level 1
''Extended blockquotes:''
{{{<<<}}}
{{{Extended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotes}}}
{{{<<<}}}
produces:
<<<
Extended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotesExtended blockquotes
<<<
!Miscellaneous formatting
''Simple indenting:''
{{{ {{indent{text }}} produces:
{{indent{text
''Headlines'':
{{{!Text}}} produces:
!Text
{{{!!Text}}} produces:
!!Text
{{{!!!Text}}} produces:
!!!Text
and so on.
''Dotted horizontal lines:''
{{{----}}} produces the following line:
----
[img(75%,+)[./images/woltereck.jpg]]
The response curves obtained by Woltereck when rearing three pure lines (A, B and C) of a freshwater daphnia (//Hyalodaphnia cucullata//) on different levels of resources. Horizontal axis: resource level (poor, intermediate, and enriched) and vertical axis: relative head hight. Although Woltereck expected the phenotypic response of the different lines to vary with resources availability he did not expect, however, that the phenotypic response of each genotype under the same environmental conditions would be different. Of the three lines examined for helmet height, one was nearly indifferent to changes in resources (C), another responded to a change from intermediate to abundant resources (B), whereas the third responded to a change from poor to intermediate resources (A). Figure from Woltereck 1909, Verhandlungen der Deutschen Zoologischen Gesellschaft 19:110-173.
Based on [[Pineda-Krch (2011)]].
Dealing with non-electronic resources, type in handwritten notes and scribbles. Pros. looks good and searchable. Cons. time consuming to enter. Scan. Pros: fast Cons: not searchable
Solution: do something inbetween. Scan or photograph the original notes and include them in the notebook as a figure. Then ad a caption where the contens of the figure is summarized using appropriate shorthand keywords and brief summary.
Dealing with copyrighted material, specifically with journal articles. Obviously one would get in trouble fast if one were to post journal articles online. Possible solution, keep journal articles in a password protected folder (access only granted on an individual basis) but incorporate highlighted text, annotations, and clips of figures into notebook. WOuld this raise the hackles of
Dealing with people. How would one deal with people who would not want their comments published online? Anonymize their comments should make them happy but makes it harder for me to manage and use the notebook.
config.options.chkShowRightSidebar=false;
config.options.txtToggleRightSideBarLabelShow="◄";
config.options.txtToggleRightSideBarLabelHide="►";