Welcome to TiddlyWiki created by Jeremy Ruston, Copyright © 2007 UnaMesa Association
Acronym for "Agree Denotationally, But Object Connotatively"
Discussing in [[When Truth Isn't Enough|http://lesswrong.com/lw/4h/when_truth_isnt_enough/]].
"I think it's an attitude, which is a set of dispositions to think and believe (and thus act) in certain ways. The disposition can be represented internally as a belief, but it's actually something more fundamental. The belief corresponding to an attitude is a representation rather than the thing itself." -- [[Anonym|http://lesswrong.com/lw/7k/incremental_progress_and_the_valley/5cd#comments]]
/***
|Name|BetterTimelineMacro|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#BetterTimelineMacro|
|Version|0.5 beta|
|Requires|~TW2.x|
!!!Description:
A replacement for the core timeline macro that offers more features:
*list tiddlers with only specfic tag
*exclude tiddlers with a particular tag
*limit entries to any number of days, for example one week
*specify a start date for the timeline, only tiddlers after that date will be listed.
!!!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.
Edit the ViewTemplate to add the fullscreen command to the toolbar.
!!!Syntax:
{{{<<timeline better:true>>}}}
''the param better:true enables the advanced features, without it you will get the old timeline behaviour.''
additonal params:
(use only the ones you want)
{{{<<timeline better:true onlyTag:Tag1 excludeTag:Tag2 sortBy:modified/created firstDay:YYYYMMDD maxDays:7 maxEntries:30>>}}}
''explanation of syntax:''
onlyTag: only tiddlers with this tag will be listed. Default is to list all tiddlers.
excludeTag: tiddlers with this tag will not be listed.
sortBy: sort tiddlers by date modified or date created. Possible values are modified or created.
firstDay: useful for starting timeline from a specific date. Example: 20060701 for 1st of July, 2006
maxDays: limits timeline to include only tiddlers from the specified number of days. If you use a value of 7 for example, only tiddlers from the last 7 days will be listed.
maxEntries: limit the total number of entries in the timeline.
!!!History:
*28-07-06: ver 0.5 beta, first release
!!!Code
***/
//{{{
// Return the tiddlers as a sorted array
TiddlyWiki.prototype.getTiddlers = function(field,excludeTag,includeTag)
{
var results = [];
this.forEachTiddler(function(title,tiddler)
{
if(excludeTag == undefined || tiddler.tags.indexOf(excludeTag) == -1)
if(includeTag == undefined || tiddler.tags.indexOf(includeTag) > -1)
results.push(tiddler);
});
if(field)
results.sort(function (a,b) {if(a[field] == b[field]) return(0); else return (a[field] < b[field]) ? -1 : +1; });
return results;
}
//this function by Udo
function getParam(params, name, defaultValue)
{
if (!params)
return defaultValue;
var p = params[0][name];
return p ? p[0] : defaultValue;
}
window.old_timeline_handler= config.macros.timeline.handler;
config.macros.timeline.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
var args = paramString.parseParams("list",null,true);
var betterMode = getParam(args, "better", "false");
if (betterMode == 'true')
{
var sortBy = getParam(args,"sortBy","modified");
var excludeTag = getParam(args,"excludeTag",undefined);
var includeTag = getParam(args,"onlyTag",undefined);
var tiddlers = store.getTiddlers(sortBy,excludeTag,includeTag);
var firstDayParam = getParam(args,"firstDay",undefined);
var firstDay = (firstDayParam!=undefined)? firstDayParam: "00010101";
var lastDay = "";
var field= sortBy;
var maxDaysParam = getParam(args,"maxDays",undefined);
var maxDays = (maxDaysParam!=undefined)? maxDaysParam*24*60*60*1000: (new Date()).getTime() ;
var maxEntries = getParam(args,"maxEntries",undefined);
var last = (maxEntries!=undefined) ? tiddlers.length-Math.min(tiddlers.length,parseInt(maxEntries)) : 0;
for(var t=tiddlers.length-1; t>=last; t--)
{
var tiddler = tiddlers[t];
var theDay = tiddler[field].convertToLocalYYYYMMDDHHMM().substr(0,8);
if ((theDay>=firstDay)&& (tiddler[field].getTime()> (new Date()).getTime() - maxDays))
{
if(theDay != lastDay)
{
var theDateList = document.createElement("ul");
place.appendChild(theDateList);
createTiddlyElement(theDateList,"li",null,"listTitle",tiddler[field].formatString(this.dateFormat));
lastDay = theDay;
}
var theDateListItem = createTiddlyElement(theDateList,"li",null,"listLink",null);
theDateListItem.appendChild(createTiddlyLink(place,tiddler.title,true));
}
}
}
else
{
window.old_timeline_handler.apply(this,arguments);
}
}
//}}}
[[What exactly is bias? by Nick Bostrom| http://www.overcomingbias.com/2006/11/what_exactly_is.html]]
[[To the barricades! Against ... what exactly? by Robin Hanson| http://www.overcomingbias.com/2006/11/to_the_barricad.html]]
[[... What's a bias, again? by Eliezer Yudkowsky| http://www.overcomingbias.com/2006/11/whats_a_bias_ag.html]]
[[Are The Big Four Econ Errors Biases?| http://www.overcomingbias.com/2006/11/the_big_four_ec.html]]
[[In[]cautious defense of bias by Paul Gowder| http://www.overcomingbias.com/2006/11/incautious_defe.html]]
[[Seen vs. Unseen Biases by Robin Hanson| http://www.overcomingbias.com/2006/12/seen_vs_unseen_.html]]
[[Enhancing Our Truth Orientation by Robin Hanson| http://hanson.gmu.edu/moretrue.pdf]]
Type the text for 'New Tiddler'
[[When Truth is a Trap by David J. Balan| http://www.overcomingbias.com/2006/12/when_truth_is_a.html]]
[[The Costs of Rationality|http://lesswrong.com/lw/j/the_costs_of_rationality/]] by [[Robin Hanson]]
[[Reasonable Disagreement by Nicholas Shackel| http://www.overcomingbias.com/2006/12/reasonable_disa.html]]
[[Leamer's 1986 Idea Futures Proposal by Robin Hanson |http://www.overcomingbias.com/2006/12/leamers_1986_id.html]]
[[Agreeing to Agree by Hal Finney| http://www.overcomingbias.com/2006/12/agreeing_to_agr.html]]
[[Are Disagreements Honest? by Tyler Cowen and Robin Hanson| http://hanson.gmu.edu/deceive.pdf]]
[[We Can't Disagree Forever by John Geankopolos and Heraklis Polemarchakis| http://cowles.econ.yale.edu/P/cp/p05b/p0552.pdf]]
[[Information, Trade, and Common Knowledge by Paul Milgrom and Nancy Stokey| http://www.kellogg.northwestern.edu/research/math/papers/377.pdf]]
[[The Modesty Argument by Eliezer Yudkowsky| http://www.overcomingbias.com/2006/12/the_modesty_arg.html]]
[[You Are Never Entitled to Your Opinion by Robin Hanson| http://www.overcomingbias.com/2006/12/you_are_never_e.html]]
[[Normative Bayesianism and Disagreement by Nicholas Shackel| http://www.overcomingbias.com/2006/12/normative_bayes.html]]
From [[Wikipedia|http://en.wikipedia.org/wiki/Eliezer_Yudkowsky]]:
[[Eliezer S. Yudkowsky|http://yudkowsky.net/]] (born, September 11, 1979) is an American artificial intelligence researcher concerned with the Singularity, and an advocate of Friendly Artificial Intelligence.
Yudkowsky is a co-founder and research fellow of the Singularity Institute for Artificial Intelligence (SIAI). Yudkowsky is the author of the SIAI publications "Creating Friendly AI" (2001) and "Levels of Organization in General Intelligence" (2002). His most recent academic contributions include two chapters in Oxford philosopher Nick Bostrom's forthcoming edited volume Global Catastrophic Risks. Yudkowsky is an autodidact with no formal education in artificial intelligence.
Yudkowsky's research work focuses on Artificial Intelligence designs which enable self-understanding, self-modification, and recursive self-improvement (seed AI); and also on artificial-intelligence architectures for stably benevolent motivational structures (Friendly AI). Apart from his research work, Yudkowsky is notable for his explanations of technical subjects in non-academic language, particularly on rationality, such as "An Intuitive Explanation of Bayesian Reasoning". He advocates the moral philosophy of Singularitarianism.
Yudkowsky is a frequent contributor to the [[Overcoming Bias]] blog of the Future of Humanity Institute of Oxford University.
[[Vulcan Logic by Hal Finney| http://www.overcomingbias.com/2006/12/vulcan_logic.html]]
[[The ethic of hand-washing and community epistemic practice|http://lesswrong.com/lw/u/the_ethic_of_handwashing_and_community_epistemic/]] by AnnaSalamon
/***
|''Name:''|ForEachTiddlerPlugin|
|''Version:''|1.0.8 (2007-04-12)|
|''Source:''|http://tiddlywiki.abego-software.de/#ForEachTiddlerPlugin|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''Licence:''|[[BSD open source license (abego Software)|http://www.abego-software.de/legal/apl-v10.html]]|
|''Copyright:''|© 2005-2007 [[abego Software|http://www.abego-software.de]]|
|''TiddlyWiki:''|1.2.38+, 2.0|
|''Browser:''|Firefox 1.0.4+; Firefox 1.5; InternetExplorer 6.0|
!Description
Create customizable lists, tables etc. for your selections of tiddlers. Specify the tiddlers to include and their order through a powerful language.
''Syntax:''
|>|{{{<<}}}''forEachTiddler'' [''in'' //tiddlyWikiPath//] [''where'' //whereCondition//] [''sortBy'' //sortExpression// [''ascending'' //or// ''descending'']] [''script'' //scriptText//] [//action// [//actionParameters//]]{{{>>}}}|
|//tiddlyWikiPath//|The filepath to the TiddlyWiki the macro should work on. When missing the current TiddlyWiki is used.|
|//whereCondition//|(quoted) JavaScript boolean expression. May refer to the build-in variables {{{tiddler}}} and {{{context}}}.|
|//sortExpression//|(quoted) JavaScript expression returning "comparable" objects (using '{{{<}}}','{{{>}}}','{{{==}}}'. May refer to the build-in variables {{{tiddler}}} and {{{context}}}.|
|//scriptText//|(quoted) JavaScript text. Typically defines JavaScript functions that are called by the various JavaScript expressions (whereClause, sortClause, action arguments,...)|
|//action//|The action that should be performed on every selected tiddler, in the given order. By default the actions [[addToList|AddToListAction]] and [[write|WriteAction]] are supported. When no action is specified [[addToList|AddToListAction]] is used.|
|//actionParameters//|(action specific) parameters the action may refer while processing the tiddlers (see action descriptions for details). <<tiddler [[JavaScript in actionParameters]]>>|
|>|~~Syntax formatting: Keywords in ''bold'', optional parts in [...]. 'or' means that exactly one of the two alternatives must exist.~~|
See details see [[ForEachTiddlerMacro]] and [[ForEachTiddlerExamples]].
!Revision history
* v1.0.8 (2007-04-12)
** Adapted to latest TiddlyWiki 2.2 Beta importTiddlyWiki API (introduced with changeset 2004). TiddlyWiki 2.2 Beta builds prior to changeset 2004 are no longer supported (but TiddlyWiki 2.1 and earlier, of cause)
* v1.0.7 (2007-03-28)
** Also support "pre" formatted TiddlyWikis (introduced with TW 2.2) (when using "in" clause to work on external tiddlers)
* v1.0.6 (2006-09-16)
** Context provides "viewerTiddler", i.e. the tiddler used to view the macro. Most times this is equal to the "inTiddler", but when using the "tiddler" macro both may be different.
** Support "begin", "end" and "none" expressions in "write" action
* v1.0.5 (2006-02-05)
** Pass tiddler containing the macro with wikify, context object also holds reference to tiddler containing the macro ("inTiddler"). Thanks to SimonBaird.
** Support Firefox 1.5.0.1
** Internal
*** Make "JSLint" conform
*** "Only install once"
* v1.0.4 (2006-01-06)
** Support TiddlyWiki 2.0
* v1.0.3 (2005-12-22)
** Features:
*** Write output to a file supports multi-byte environments (Thanks to Bram Chen)
*** Provide API to access the forEachTiddler functionality directly through JavaScript (see getTiddlers and performMacro)
** Enhancements:
*** Improved error messages on InternetExplorer.
* v1.0.2 (2005-12-10)
** Features:
*** context object also holds reference to store (TiddlyWiki)
** Fixed Bugs:
*** ForEachTiddler 1.0.1 has broken support on win32 Opera 8.51 (Thanks to BrunoSabin for reporting)
* v1.0.1 (2005-12-08)
** Features:
*** Access tiddlers stored in separated TiddlyWikis through the "in" option. I.e. you are no longer limited to only work on the "current TiddlyWiki".
*** Write output to an external file using the "toFile" option of the "write" action. With this option you may write your customized tiddler exports.
*** Use the "script" section to define "helper" JavaScript functions etc. to be used in the various JavaScript expressions (whereClause, sortClause, action arguments,...).
*** Access and store context information for the current forEachTiddler invocation (through the build-in "context" object) .
*** Improved script evaluation (for where/sort clause and write scripts).
* v1.0.0 (2005-11-20)
** initial version
!Code
***/
//{{{
//============================================================================
//============================================================================
// ForEachTiddlerPlugin
//============================================================================
//============================================================================
// Only install once
if (!version.extensions.ForEachTiddlerPlugin) {
if (!window.abego) window.abego = {};
version.extensions.ForEachTiddlerPlugin = {
major: 1, minor: 0, revision: 8,
date: new Date(2007,3,12),
source: "http://tiddlywiki.abego-software.de/#ForEachTiddlerPlugin",
licence: "[[BSD open source license (abego Software)|http://www.abego-software.de/legal/apl-v10.html]]",
copyright: "Copyright (c) abego Software GmbH, 2005-2007 (www.abego-software.de)"
};
// For backward compatibility with TW 1.2.x
//
if (!TiddlyWiki.prototype.forEachTiddler) {
TiddlyWiki.prototype.forEachTiddler = function(callback) {
for(var t in this.tiddlers) {
callback.call(this,t,this.tiddlers[t]);
}
};
}
//============================================================================
// forEachTiddler Macro
//============================================================================
version.extensions.forEachTiddler = {
major: 1, minor: 0, revision: 8, date: new Date(2007,3,12), provider: "http://tiddlywiki.abego-software.de"};
// ---------------------------------------------------------------------------
// Configurations and constants
// ---------------------------------------------------------------------------
config.macros.forEachTiddler = {
// Standard Properties
label: "forEachTiddler",
prompt: "Perform actions on a (sorted) selection of tiddlers",
// actions
actions: {
addToList: {},
write: {}
}
};
// ---------------------------------------------------------------------------
// The forEachTiddler Macro Handler
// ---------------------------------------------------------------------------
config.macros.forEachTiddler.getContainingTiddler = function(e) {
while(e && !hasClass(e,"tiddler"))
e = e.parentNode;
var title = e ? e.getAttribute("tiddler") : null;
return title ? store.getTiddler(title) : null;
};
config.macros.forEachTiddler.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
// config.macros.forEachTiddler.traceMacroCall(place,macroName,params,wikifier,paramString,tiddler);
if (!tiddler) tiddler = config.macros.forEachTiddler.getContainingTiddler(place);
// --- Parsing ------------------------------------------
var i = 0; // index running over the params
// Parse the "in" clause
var tiddlyWikiPath = undefined;
if ((i < params.length) && params[i] == "in") {
i++;
if (i >= params.length) {
this.handleError(place, "TiddlyWiki path expected behind 'in'.");
return;
}
tiddlyWikiPath = this.paramEncode((i < params.length) ? params[i] : "");
i++;
}
// Parse the where clause
var whereClause ="true";
if ((i < params.length) && params[i] == "where") {
i++;
whereClause = this.paramEncode((i < params.length) ? params[i] : "");
i++;
}
// Parse the sort stuff
var sortClause = null;
var sortAscending = true;
if ((i < params.length) && params[i] == "sortBy") {
i++;
if (i >= params.length) {
this.handleError(place, "sortClause missing behind 'sortBy'.");
return;
}
sortClause = this.paramEncode(params[i]);
i++;
if ((i < params.length) && (params[i] == "ascending" || params[i] == "descending")) {
sortAscending = params[i] == "ascending";
i++;
}
}
// Parse the script
var scriptText = null;
if ((i < params.length) && params[i] == "script") {
i++;
scriptText = this.paramEncode((i < params.length) ? params[i] : "");
i++;
}
// Parse the action.
// When we are already at the end use the default action
var actionName = "addToList";
if (i < params.length) {
if (!config.macros.forEachTiddler.actions[params[i]]) {
this.handleError(place, "Unknown action '"+params[i]+"'.");
return;
} else {
actionName = params[i];
i++;
}
}
// Get the action parameter
// (the parsing is done inside the individual action implementation.)
var actionParameter = params.slice(i);
// --- Processing ------------------------------------------
try {
this.performMacro({
place: place,
inTiddler: tiddler,
whereClause: whereClause,
sortClause: sortClause,
sortAscending: sortAscending,
actionName: actionName,
actionParameter: actionParameter,
scriptText: scriptText,
tiddlyWikiPath: tiddlyWikiPath});
} catch (e) {
this.handleError(place, e);
}
};
// Returns an object with properties "tiddlers" and "context".
// tiddlers holds the (sorted) tiddlers selected by the parameter,
// context the context of the execution of the macro.
//
// The action is not yet performed.
//
// @parameter see performMacro
//
config.macros.forEachTiddler.getTiddlersAndContext = function(parameter) {
var context = config.macros.forEachTiddler.createContext(parameter.place, parameter.whereClause, parameter.sortClause, parameter.sortAscending, parameter.actionName, parameter.actionParameter, parameter.scriptText, parameter.tiddlyWikiPath, parameter.inTiddler);
var tiddlyWiki = parameter.tiddlyWikiPath ? this.loadTiddlyWiki(parameter.tiddlyWikiPath) : store;
context["tiddlyWiki"] = tiddlyWiki;
// Get the tiddlers, as defined by the whereClause
var tiddlers = this.findTiddlers(parameter.whereClause, context, tiddlyWiki);
context["tiddlers"] = tiddlers;
// Sort the tiddlers, when sorting is required.
if (parameter.sortClause) {
this.sortTiddlers(tiddlers, parameter.sortClause, parameter.sortAscending, context);
}
return {tiddlers: tiddlers, context: context};
};
// Returns the (sorted) tiddlers selected by the parameter.
//
// The action is not yet performed.
//
// @parameter see performMacro
//
config.macros.forEachTiddler.getTiddlers = function(parameter) {
return this.getTiddlersAndContext(parameter).tiddlers;
};
// Performs the macros with the given parameter.
//
// @param parameter holds the parameter of the macro as separate properties.
// The following properties are supported:
//
// place
// whereClause
// sortClause
// sortAscending
// actionName
// actionParameter
// scriptText
// tiddlyWikiPath
//
// All properties are optional.
// For most actions the place property must be defined.
//
config.macros.forEachTiddler.performMacro = function(parameter) {
var tiddlersAndContext = this.getTiddlersAndContext(parameter);
// Perform the action
var actionName = parameter.actionName ? parameter.actionName : "addToList";
var action = config.macros.forEachTiddler.actions[actionName];
if (!action) {
this.handleError(parameter.place, "Unknown action '"+actionName+"'.");
return;
}
var actionHandler = action.handler;
actionHandler(parameter.place, tiddlersAndContext.tiddlers, parameter.actionParameter, tiddlersAndContext.context);
};
// ---------------------------------------------------------------------------
// The actions
// ---------------------------------------------------------------------------
// Internal.
//
// --- The addToList Action -----------------------------------------------
//
config.macros.forEachTiddler.actions.addToList.handler = function(place, tiddlers, parameter, context) {
// Parse the parameter
var p = 0;
// Check for extra parameters
if (parameter.length > p) {
config.macros.forEachTiddler.createExtraParameterErrorElement(place, "addToList", parameter, p);
return;
}
// Perform the action.
var list = document.createElement("ul");
place.appendChild(list);
for (var i = 0; i < tiddlers.length; i++) {
var tiddler = tiddlers[i];
var listItem = document.createElement("li");
list.appendChild(listItem);
createTiddlyLink(listItem, tiddler.title, true);
}
};
abego.parseNamedParameter = function(name, parameter, i) {
var beginExpression = null;
if ((i < parameter.length) && parameter[i] == name) {
i++;
if (i >= parameter.length) {
throw "Missing text behind '%0'".format([name]);
}
return config.macros.forEachTiddler.paramEncode(parameter[i]);
}
return null;
}
// Internal.
//
// --- The write Action ---------------------------------------------------
//
config.macros.forEachTiddler.actions.write.handler = function(place, tiddlers, parameter, context) {
// Parse the parameter
var p = 0;
if (p >= parameter.length) {
this.handleError(place, "Missing expression behind 'write'.");
return;
}
var textExpression = config.macros.forEachTiddler.paramEncode(parameter[p]);
p++;
// Parse the "begin" option
var beginExpression = abego.parseNamedParameter("begin", parameter, p);
if (beginExpression !== null)
p += 2;
var endExpression = abego.parseNamedParameter("end", parameter, p);
if (endExpression !== null)
p += 2;
var noneExpression = abego.parseNamedParameter("none", parameter, p);
if (noneExpression !== null)
p += 2;
// Parse the "toFile" option
var filename = null;
var lineSeparator = undefined;
if ((p < parameter.length) && parameter[p] == "toFile") {
p++;
if (p >= parameter.length) {
this.handleError(place, "Filename expected behind 'toFile' of 'write' action.");
return;
}
filename = config.macros.forEachTiddler.getLocalPath(config.macros.forEachTiddler.paramEncode(parameter[p]));
p++;
if ((p < parameter.length) && parameter[p] == "withLineSeparator") {
p++;
if (p >= parameter.length) {
this.handleError(place, "Line separator text expected behind 'withLineSeparator' of 'write' action.");
return;
}
lineSeparator = config.macros.forEachTiddler.paramEncode(parameter[p]);
p++;
}
}
// Check for extra parameters
if (parameter.length > p) {
config.macros.forEachTiddler.createExtraParameterErrorElement(place, "write", parameter, p);
return;
}
// Perform the action.
var func = config.macros.forEachTiddler.getEvalTiddlerFunction(textExpression, context);
var count = tiddlers.length;
var text = "";
if (count > 0 && beginExpression)
text += config.macros.forEachTiddler.getEvalTiddlerFunction(beginExpression, context)(undefined, context, count, undefined);
for (var i = 0; i < count; i++) {
var tiddler = tiddlers[i];
text += func(tiddler, context, count, i);
}
if (count > 0 && endExpression)
text += config.macros.forEachTiddler.getEvalTiddlerFunction(endExpression, context)(undefined, context, count, undefined);
if (count == 0 && noneExpression)
text += config.macros.forEachTiddler.getEvalTiddlerFunction(noneExpression, context)(undefined, context, count, undefined);
if (filename) {
if (lineSeparator !== undefined) {
lineSeparator = lineSeparator.replace(/\\n/mg, "\n").replace(/\\r/mg, "\r");
text = text.replace(/\n/mg,lineSeparator);
}
saveFile(filename, convertUnicodeToUTF8(text));
} else {
var wrapper = createTiddlyElement(place, "span");
wikify(text, wrapper, null/* highlightRegExp */, context.inTiddler);
}
};
// ---------------------------------------------------------------------------
// Helpers
// ---------------------------------------------------------------------------
// Internal.
//
config.macros.forEachTiddler.createContext = function(placeParam, whereClauseParam, sortClauseParam, sortAscendingParam, actionNameParam, actionParameterParam, scriptText, tiddlyWikiPathParam, inTiddlerParam) {
return {
place : placeParam,
whereClause : whereClauseParam,
sortClause : sortClauseParam,
sortAscending : sortAscendingParam,
script : scriptText,
actionName : actionNameParam,
actionParameter : actionParameterParam,
tiddlyWikiPath : tiddlyWikiPathParam,
inTiddler : inTiddlerParam, // the tiddler containing the <<forEachTiddler ...>> macro call.
viewerTiddler : config.macros.forEachTiddler.getContainingTiddler(placeParam) // the tiddler showing the forEachTiddler result
};
};
// Internal.
//
// Returns a TiddlyWiki with the tiddlers loaded from the TiddlyWiki of
// the given path.
//
config.macros.forEachTiddler.loadTiddlyWiki = function(path, idPrefix) {
if (!idPrefix) {
idPrefix = "store";
}
var lenPrefix = idPrefix.length;
// Read the content of the given file
var content = loadFile(this.getLocalPath(path));
if(content === null) {
throw "TiddlyWiki '"+path+"' not found.";
}
var tiddlyWiki = new TiddlyWiki();
// Starting with TW 2.2 there is a helper function to import the tiddlers
if (tiddlyWiki.importTiddlyWiki) {
if (!tiddlyWiki.importTiddlyWiki(content))
throw "File '"+path+"' is not a TiddlyWiki.";
tiddlyWiki.dirty = false;
return tiddlyWiki;
}
// The legacy code, for TW < 2.2
// Locate the storeArea div's
var posOpeningDiv = content.indexOf(startSaveArea);
var posClosingDiv = content.lastIndexOf(endSaveArea);
if((posOpeningDiv == -1) || (posClosingDiv == -1)) {
throw "File '"+path+"' is not a TiddlyWiki.";
}
var storageText = content.substr(posOpeningDiv + startSaveArea.length, posClosingDiv);
// Create a "div" element that contains the storage text
var myStorageDiv = document.createElement("div");
myStorageDiv.innerHTML = storageText;
myStorageDiv.normalize();
// Create all tiddlers in a new TiddlyWiki
// (following code is modified copy of TiddlyWiki.prototype.loadFromDiv)
var store = myStorageDiv.childNodes;
for(var t = 0; t < store.length; t++) {
var e = store[t];
var title = null;
if(e.getAttribute)
title = e.getAttribute("tiddler");
if(!title && e.id && e.id.substr(0,lenPrefix) == idPrefix)
title = e.id.substr(lenPrefix);
if(title && title !== "") {
var tiddler = tiddlyWiki.createTiddler(title);
tiddler.loadFromDiv(e,title);
}
}
tiddlyWiki.dirty = false;
return tiddlyWiki;
};
// Internal.
//
// Returns a function that has a function body returning the given javaScriptExpression.
// The function has the parameters:
//
// (tiddler, context, count, index)
//
config.macros.forEachTiddler.getEvalTiddlerFunction = function (javaScriptExpression, context) {
var script = context["script"];
var functionText = "var theFunction = function(tiddler, context, count, index) { return "+javaScriptExpression+"}";
var fullText = (script ? script+";" : "")+functionText+";theFunction;";
return eval(fullText);
};
// Internal.
//
config.macros.forEachTiddler.findTiddlers = function(whereClause, context, tiddlyWiki) {
var result = [];
var func = config.macros.forEachTiddler.getEvalTiddlerFunction(whereClause, context);
tiddlyWiki.forEachTiddler(function(title,tiddler) {
if (func(tiddler, context, undefined, undefined)) {
result.push(tiddler);
}
});
return result;
};
// Internal.
//
config.macros.forEachTiddler.createExtraParameterErrorElement = function(place, actionName, parameter, firstUnusedIndex) {
var message = "Extra parameter behind '"+actionName+"':";
for (var i = firstUnusedIndex; i < parameter.length; i++) {
message += " "+parameter[i];
}
this.handleError(place, message);
};
// Internal.
//
config.macros.forEachTiddler.sortAscending = function(tiddlerA, tiddlerB) {
var result =
(tiddlerA.forEachTiddlerSortValue == tiddlerB.forEachTiddlerSortValue)
? 0
: (tiddlerA.forEachTiddlerSortValue < tiddlerB.forEachTiddlerSortValue)
? -1
: +1;
return result;
};
// Internal.
//
config.macros.forEachTiddler.sortDescending = function(tiddlerA, tiddlerB) {
var result =
(tiddlerA.forEachTiddlerSortValue == tiddlerB.forEachTiddlerSortValue)
? 0
: (tiddlerA.forEachTiddlerSortValue < tiddlerB.forEachTiddlerSortValue)
? +1
: -1;
return result;
};
// Internal.
//
config.macros.forEachTiddler.sortTiddlers = function(tiddlers, sortClause, ascending, context) {
// To avoid evaluating the sortClause whenever two items are compared
// we pre-calculate the sortValue for every item in the array and store it in a
// temporary property ("forEachTiddlerSortValue") of the tiddlers.
var func = config.macros.forEachTiddler.getEvalTiddlerFunction(sortClause, context);
var count = tiddlers.length;
var i;
for (i = 0; i < count; i++) {
var tiddler = tiddlers[i];
tiddler.forEachTiddlerSortValue = func(tiddler,context, undefined, undefined);
}
// Do the sorting
tiddlers.sort(ascending ? this.sortAscending : this.sortDescending);
// Delete the temporary property that holds the sortValue.
for (i = 0; i < tiddlers.length; i++) {
delete tiddlers[i].forEachTiddlerSortValue;
}
};
// Internal.
//
config.macros.forEachTiddler.trace = function(message) {
displayMessage(message);
};
// Internal.
//
config.macros.forEachTiddler.traceMacroCall = function(place,macroName,params) {
var message ="<<"+macroName;
for (var i = 0; i < params.length; i++) {
message += " "+params[i];
}
message += ">>";
displayMessage(message);
};
// Internal.
//
// Creates an element that holds an error message
//
config.macros.forEachTiddler.createErrorElement = function(place, exception) {
var message = (exception.description) ? exception.description : exception.toString();
return createTiddlyElement(place,"span",null,"forEachTiddlerError","<<forEachTiddler ...>>: "+message);
};
// Internal.
//
// @param place [may be null]
//
config.macros.forEachTiddler.handleError = function(place, exception) {
if (place) {
this.createErrorElement(place, exception);
} else {
throw exception;
}
};
// Internal.
//
// Encodes the given string.
//
// Replaces
// "$))" to ">>"
// "$)" to ">"
//
config.macros.forEachTiddler.paramEncode = function(s) {
var reGTGT = new RegExp("\\$\\)\\)","mg");
var reGT = new RegExp("\\$\\)","mg");
return s.replace(reGTGT, ">>").replace(reGT, ">");
};
// Internal.
//
// Returns the given original path (that is a file path, starting with "file:")
// as a path to a local file, in the systems native file format.
//
// Location information in the originalPath (i.e. the "#" and stuff following)
// is stripped.
//
config.macros.forEachTiddler.getLocalPath = function(originalPath) {
// Remove any location part of the URL
var hashPos = originalPath.indexOf("#");
if(hashPos != -1)
originalPath = originalPath.substr(0,hashPos);
// Convert to a native file format assuming
// "file:///x:/path/path/path..." - pc local file --> "x:\path\path\path..."
// "file://///server/share/path/path/path..." - FireFox pc network file --> "\\server\share\path\path\path..."
// "file:///path/path/path..." - mac/unix local file --> "/path/path/path..."
// "file://server/share/path/path/path..." - pc network file --> "\\server\share\path\path\path..."
var localPath;
if(originalPath.charAt(9) == ":") // pc local file
localPath = unescape(originalPath.substr(8)).replace(new RegExp("/","g"),"\\");
else if(originalPath.indexOf("file://///") === 0) // FireFox pc network file
localPath = "\\\\" + unescape(originalPath.substr(10)).replace(new RegExp("/","g"),"\\");
else if(originalPath.indexOf("file:///") === 0) // mac/unix local file
localPath = unescape(originalPath.substr(7));
else if(originalPath.indexOf("file:/") === 0) // mac/unix local file
localPath = unescape(originalPath.substr(5));
else // pc network file
localPath = "\\\\" + unescape(originalPath.substr(7)).replace(new RegExp("/","g"),"\\");
return localPath;
};
// ---------------------------------------------------------------------------
// Stylesheet Extensions (may be overridden by local StyleSheet)
// ---------------------------------------------------------------------------
//
setStylesheet(
".forEachTiddlerError{color: #ffffff;background-color: #880000;}",
"forEachTiddler");
//============================================================================
// End of forEachTiddler Macro
//============================================================================
//============================================================================
// String.startsWith Function
//============================================================================
//
// Returns true if the string starts with the given prefix, false otherwise.
//
version.extensions["String.startsWith"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
String.prototype.startsWith = function(prefix) {
var n = prefix.length;
return (this.length >= n) && (this.slice(0, n) == prefix);
};
//============================================================================
// String.endsWith Function
//============================================================================
//
// Returns true if the string ends with the given suffix, false otherwise.
//
version.extensions["String.endsWith"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
String.prototype.endsWith = function(suffix) {
var n = suffix.length;
return (this.length >= n) && (this.right(n) == suffix);
};
//============================================================================
// String.contains Function
//============================================================================
//
// Returns true when the string contains the given substring, false otherwise.
//
version.extensions["String.contains"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
String.prototype.contains = function(substring) {
return this.indexOf(substring) >= 0;
};
//============================================================================
// Array.indexOf Function
//============================================================================
//
// Returns the index of the first occurance of the given item in the array or
// -1 when no such item exists.
//
// @param item [may be null]
//
version.extensions["Array.indexOf"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.indexOf = function(item) {
for (var i = 0; i < this.length; i++) {
if (this[i] == item) {
return i;
}
}
return -1;
};
//============================================================================
// Array.contains Function
//============================================================================
//
// Returns true when the array contains the given item, otherwise false.
//
// @param item [may be null]
//
version.extensions["Array.contains"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.contains = function(item) {
return (this.indexOf(item) >= 0);
};
//============================================================================
// Array.containsAny Function
//============================================================================
//
// Returns true when the array contains at least one of the elements
// of the item. Otherwise (or when items contains no elements) false is returned.
//
version.extensions["Array.containsAny"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.containsAny = function(items) {
for(var i = 0; i < items.length; i++) {
if (this.contains(items[i])) {
return true;
}
}
return false;
};
//============================================================================
// Array.containsAll Function
//============================================================================
//
// Returns true when the array contains all the items, otherwise false.
//
// When items is null false is returned (even if the array contains a null).
//
// @param items [may be null]
//
version.extensions["Array.containsAll"] = {major: 1, minor: 0, revision: 0, date: new Date(2005,11,20), provider: "http://tiddlywiki.abego-software.de"};
//
Array.prototype.containsAll = function(items) {
for(var i = 0; i < items.length; i++) {
if (!this.contains(items[i])) {
return false;
}
}
return true;
};
} // of "install only once"
// Used Globals (for JSLint) ==============
// ... DOM
/*global document */
// ... TiddlyWiki Core
/*global convertUnicodeToUTF8, createTiddlyElement, createTiddlyLink,
displayMessage, endSaveArea, hasClass, loadFile, saveFile,
startSaveArea, store, wikify */
//}}}
/***
!Licence and Copyright
Copyright (c) abego Software ~GmbH, 2005 ([[www.abego-software.de|http://www.abego-software.de]])
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
Neither the name of abego Software nor the names of its contributors may be
used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
***/
[[The 80% Forecasting Solution by Robin Hanson| http://www.overcomingbias.com/2006/12/the_80_forecast.html]]
This document is a repository of common terms, phrases, concepts, and references used by the rationalist community currently centered around [[Overcoming Bias]] and [[Less Wrong]]. Eventually, this document may develop into a fully encompassing rationalist resource. The entire site is contained in a single file, and feel free to download a personal copy or distribute as you wish. However, since this is a single file, be careful to save only contributions to the latest version to not affect others' edits.
Please enter a username for signing any edits: <<option txtUserName>>
Contributors start here: [[Topics to develop]]
!!!Information about TiddlyWiki
@@font-weight:bold;font-size:1.0em;color:#444; //Working online// @@ You can edit this ~TiddlyWiki right now, and save your changes using the "save to web" button in the column on the right. [[SyntaxReminder]] provides information on the markup.
@@font-weight:bold;font-size:1.0em;color:#444; //Working offline// @@ A fully functioning copy of this ~TiddlyWiki can be saved onto your hard drive or USB stick. You can make changes and save them locally without being connected to the Internet. When you're ready to sync up again, just click "upload" and your ~TiddlyWiki will be saved back to tiddlyspot.com.
@@font-weight:bold;font-size:1.0em;color:#444; //Help!// @@ Find out more about ~TiddlyWiki at [[TiddlyWiki.com|http://tiddlywiki.com]]. Also visit [[TiddlyWiki.org|http://tiddlywiki.org]] for documentation on learning and using ~TiddlyWiki. New users are especially welcome on the [[TiddlyWiki mailing list|http://groups.google.com/group/TiddlyWiki]], which is an excellent place to ask questions and get help. If you have a tiddlyspot related problem email [[tiddlyspot support|mailto:support@tiddlyspot.com]].
Please email [[feedback@tiddlyspot.com|mailto:feedback@tiddlyspot.com]] with any comments or suggestions.
[[Resolving Your Hypocrisy by Robin Hanson| http://www.overcomingbias.com/2006/12/resolving_your_.html
Acronym for "I Agree With Your Conclusion"
Discussed in [[Support That Sounds Like Dissent|http://lesswrong.com/lw/3y/support_that_sounds_like_dissent/]].
[[Why Not Impossible Worlds? by Robin Hanson| http://www.overcomingbias.com/2006/12/why_not_impossi.html]]
[[Fillers Neglect Framers by Robin Hanson| http://www.overcomingbias.com/2006/12/fillers_neglect.html]]
A principle of intellectual honesty, to be used when arguing against an idea.
The essence of the principle is to, when disputing a general argument, assume that all specific details will align with the argument, //i.e.//, the least convenient possible world for your counterargument. If this world is so unlikely as to be all but impossible, accept the validity of the argument and instead dispute its applicability to the real world.
!!References
[[The Least Convenient Possible World|http://lesswrong.com/lw/2k/the_least_convenient_possible_world/]] on Less Wrong
From http://lesswrong.com/about-less-wrong:
>[[Less Wrong|http://www.lesswrong.com]] is a partially moderated community blog that allows general authors to contribute posts as well as comments. Users vote posts and comments up and down (with code based on Reddit's open source). Separately, "promoted" posts are chosen by the editors on the basis of substantive new content, clear argument, good writing, popularity, and importance.
[[Overcoming Bias|http://www.overcomingbias.com]]
[[LessWrong|http://lesswrong.com]]
/***
|''Name:''|LoadRemoteFileThroughProxy (previous LoadRemoteFileHijack)|
|''Description:''|When the TiddlyWiki file is located on the web (view over http) the content of [[SiteProxy]] tiddler is added in front of the file url. If [[SiteProxy]] does not exist "/proxy/" is added. |
|''Version:''|1.1.0|
|''Date:''|mar 17, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#LoadRemoteFileHijack|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0|
***/
//{{{
version.extensions.LoadRemoteFileThroughProxy = {
major: 1, minor: 1, revision: 0,
date: new Date("mar 17, 2007"),
source: "http://tiddlywiki.bidix.info/#LoadRemoteFileThroughProxy"};
if (!window.bidix) window.bidix = {}; // bidix namespace
if (!bidix.core) bidix.core = {};
bidix.core.loadRemoteFile = loadRemoteFile;
loadRemoteFile = function(url,callback,params)
{
if ((document.location.toString().substr(0,4) == "http") && (url.substr(0,4) == "http")){
url = store.getTiddlerText("SiteProxy", "/proxy/") + url;
}
return bidix.core.loadRemoteFile(url,callback,params);
}
//}}}
[[Home]] [[Topics]] [[Series]] [[Links]]
[[Meme Lineages and Expert Consensus by Carl Shulman| http://www.overcomingbias.com/2006/12/meme_lineages_a.html]]
[[The Modesty Argument by Eliezer Yudkowsky| http://www.overcomingbias.com/2006/12/the_modesty_arg.html]]
[[Does the Modesty Argument Apply to Moral Claims? by Paul Gowder| http://www.overcomingbias.com/2006/12/does_the_modest.html]]
[[Modesty in a Disagreeable World by Hal Finney| http://www.overcomingbias.com/2006/12/modesty_in_a_di.html]]
A fictional entity that represents the pinnacle of possible rationality. Omega is primarily used as the predictor in [[Newcomb's Problem]] or similar scenarios.
[[Overcoming Bias|http://www.overcomingbias.com]] is a group blog on the systemic mistakes humans make, and how we can possibly being correcting them. The primary contributors are [[Robin Hanson]] of George Mason University and [[Eliezer Yudkowsky]] of the Singularity Institute. Common topics include "cognitive psychology, evolutionary psychology, microeconomics, applied statistics, social psychology, probability and decision theory, even a bit of Artificial Intelligence now and then."
[[When Error is High, Simplify by Robin Hanson| http://www.overcomingbias.com/2006/12/when_error_is_h.html]]
[[Academic Overconfidence by Robin Hanson| http://www.overcomingbias.com/2006/12/academic_overco.html]]
<!--{{{-->
<div id='header' class='header'>
<div id='title'>
<div id='topMenu' refresh='content' tiddler='MainMenu'></div>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</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 class='clearAll'></div>
</div>
<div id='contentFooter' refresh='content' tiddler='contentFooter'></div>
<!--}}}-->
/***
|''Name:''|PasswordOptionPlugin|
|''Description:''|Extends TiddlyWiki options with non encrypted password option.|
|''Version:''|1.0.2|
|''Date:''|Apr 19, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#PasswordOptionPlugin|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0 (Beta 5)|
***/
//{{{
version.extensions.PasswordOptionPlugin = {
major: 1, minor: 0, revision: 2,
date: new Date("Apr 19, 2007"),
source: 'http://tiddlywiki.bidix.info/#PasswordOptionPlugin',
author: 'BidiX (BidiX (at) bidix (dot) info',
license: '[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D]]',
coreVersion: '2.2.0 (Beta 5)'
};
config.macros.option.passwordCheckboxLabel = "Save this password on this computer";
config.macros.option.passwordInputType = "password"; // password | text
setStylesheet(".pasOptionInput {width: 11em;}\n","passwordInputTypeStyle");
merge(config.macros.option.types, {
'pas': {
elementType: "input",
valueField: "value",
eventName: "onkeyup",
className: "pasOptionInput",
typeValue: config.macros.option.passwordInputType,
create: function(place,type,opt,className,desc) {
// password field
config.macros.option.genericCreate(place,'pas',opt,className,desc);
// checkbox linked with this password "save this password on this computer"
config.macros.option.genericCreate(place,'chk','chk'+opt,className,desc);
// text savePasswordCheckboxLabel
place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));
},
onChange: config.macros.option.genericOnChange
}
});
merge(config.optionHandlers['chk'], {
get: function(name) {
// is there an option linked with this chk ?
var opt = name.substr(3);
if (config.options[opt])
saveOptionCookie(opt);
return config.options[name] ? "true" : "false";
}
});
merge(config.optionHandlers, {
'pas': {
get: function(name) {
if (config.options["chk"+name]) {
return encodeCookie(config.options[name].toString());
} else {
return "";
}
},
set: function(name,value) {config.options[name] = decodeCookie(value);}
}
});
// need to reload options to load passwordOptions
loadOptionsCookie();
/*
if (!config.options['pasPassword'])
config.options['pasPassword'] = '';
merge(config.optionsDesc,{
pasPassword: "Test password"
});
*/
//}}}
http://en.wikipedia.org/wiki/Philip_Tetlock
[[A 1990 Corporate Prediction Market| http://www.overcomingbias.com/2006/11/first_known_bus.html]] by [[Robin Hanson]]
[[Does Profit Rate Insight Best?| http://www.overcomingbias.com/2006/12/does_profit_rat.html]] by [[Robin Hanson]]
[[Should Prediction Markets be Charities? by Peter McCluskey| http://www.overcomingbias.com/2006/12/should_predicti.html]]
[[The Future of Oil Prices 2: Option Probabilities by Hal Finney| http://www.overcomingbias.com/2006/12/the_future_of_o_1.html]]
[[Why Common Priors by Robin Hanson| http://www.overcomingbias.com/2006/12/why_common_prio.html]]
[[The Martial Art of Rationality by Eliezer Yudkowsky| http://www.overcomingbias.com/2006/11/the_martial_art.html]]
[[Recommended Rationalist Resources|http://lesswrong.com/lw/y/recommended_rationalist_resources/]]
[[Agreeing to Disagree| http://www.ma.huji.ac.il/%7Eraumann/pdf/Agreeing%20to%20Disagree.pdf]]
From [[Wikipedia|http://en.wikipedia.org/wiki/Robin_Hanson]]
[[Robin Hanson|http://hanson.gmu.edu/ ]] (born 1959) is an associate professor of economics at George Mason University. He is known as an expert on idea futures markets and was involved in the creation of the Foresight Exchange and DARPA's FutureMAP project. He is also known for inventing Market Scoring Rules like LMSR (Logarithmic Market Scoring Rule) used by prediction markets such as Inkling Markets and Washington Stock Exchange, and has conducted research on signaling. Hanson has expressed great disappointment in the cancellation of the FutureMAP project, and he attributes this to the controversy surrounding the related Total Information Awareness program. He supports a proposed system of government called 'futarchy', where policies would be determined by prediction markets. He is the lead editor for the Overcoming Bias blog of the Future of Humanity Institute of Oxford University.
Hanson has received publicity in many mainstream publications such as the New York Times. A 2003 article in Fortune examined Hanson's work, revealing, among other things, that he is a believer in cryonics, his ideas have found some acceptance among extropians on the Internet, and he was motivated to seek his doctorate so that his theories would gain more widestream appeal.
Tyler Cowen has described his book Discover Your Inner Economist as "an (attempted) rebuttal to Robin" and notes that he is a major intellectual figure in the work, which includes a fairly detailed discussion of Hanson's views:
>Robin has strange ideas....
>My other friend and colleague Bryan Caplan put it best: "When the typical economist tells me about his latest research, my standard reaction is 'Eh, maybe.' Then I forget about it. When Robin Hanson tell me about his latest research, my standard reaction is 'No way! Impossible!' Then I think about it for years."
Hanson received a B.S. in physics from the University of California, Irvine in 1981, an M.S. in physics and an M.A. in Conceptual Foundations of Science from the University of Chicago in 1984, and a Ph.D. in social science from Caltech in 1997.
Sequences of articles on a particular topic. Intended to provide syllabi for beginners.
!!!Foxes vs. Hedgehogs by [[Hal Finney]]
[[Quiz: Fox or Hedgehog?| http://www.overcomingbias.com/2006/11/quiz_fox_or_hed.html]]
[[Foxes vs Hedgehogs: Predictive Success| http://www.overcomingbias.com/2006/11/foxes_vs_hedgho.html]]
!!!Less Wrong Introductory Posts
[[About Less Wrong|http://lesswrong.com/lw/1/about_less_wrong/]]
[[Tell Us Your Rationalist Origin Story|http://lesswrong.com/lw/2/tell_your_rationalist_origin_story/]]
[[The Most Important Thing You've Learned|http://lesswrong.com/lw/9/the_most_important_thing_you_learned/]]
[[The Most Frequently Useful Thing|http://lesswrong.com/lw/f/the_most_frequently_useful_thing/]]
[[That You'd Tell All Your Friends|http://lesswrong.com/lw/g/that_youd_tell_all_your_friends/]]
!!!Self Deception by [[Eliezer Yudkowsky]]
[[No, Really, I've Deceived Myself|http://lesswrong.com/lw/r/no_really_ive_deceived_myself/]]
[[Belief in Self Deception|http://lesswrong.com/lw/s/belief_in_selfdeception/]]
[[Moore's Paradox|http://lesswrong.com/lw/1f/moores_paradox/]]
[[Don't Believe You'll Self-Deceive|http://lesswrong.com/lw/1o/dont_believe_youll_selfdeceive/]]
[[Striving to Accept|http://lesswrong.com/lw/1r/striving_to_accept/]]
!!!Positivism, Self Deception, and Neuroscience by [[Yvain]] /% Not sure what a fitting title for these posts would be or whether they should actually be grouped together %/
[[Simulaneously Right and Wrong|http://lesswrong.com/lw/1d/simultaneously_right_and_wrong/]]
[[The Mystery of the Haunted Rationalist|http://lesswrong.com/lw/1l/the_mystery_of_the_haunted_rationalist/]]
[[The Apologist and the Revolutionary|http://lesswrong.com/lw/20/the_apologist_and_the_revolutionary/]]
[[You May Already Be A Sinner|http://lesswrong.com/lw/1u/you_may_already_be_a_sinner/]]
[[Talking Snakes: A Cautionary Tale|http://lesswrong.com/lw/2d/talking_snakes_a_cautionary_tale/]]
[[The Skeptic's Trilemma|http://lesswrong.com/lw/2p/the_skeptics_trilemma/]]
[[Are You A Solar Deity?|http://lesswrong.com/lw/2w/are_you_a_solar_deity/]]
[[The "Spot the Fakes" Test|http://lesswrong.com/lw/34/the_spot_the_fakes_test/]]
[[How Not to Lose and Argument|http://lesswrong.com/lw/3k/how_to_not_lose_an_argument/]]
[[The Power of Positivist Thinking|http://lesswrong.com/lw/48/the_power_of_positivist_thinking/]]
[[When Truth Isn't Enough|http://lesswrong.com/lw/4h/when_truth_isnt_enough/]]
!!!Secular Community Building by [[Eliezer Yudkowsky]]
[[Raising the Sanity Waterline|http://lesswrong.com/lw/1e/raising_the_sanity_waterline/]]
[[A Sense That More Is Possible|http://lesswrong.com/lw/2c/a_sense_that_more_is_possible/]]
[[Epistemic Viciousness|http://lesswrong.com/lw/2i/epistemic_viciousness/]]
[[Schools Proliferating Without Evidence|http://lesswrong.com/lw/2j/schools_proliferating_without_evidence/]]
[[Why Our Kind Can't Cooperate|http://lesswrong.com/lw/3h/why_our_kind_cant_cooperate/]]
[[Tolerate Tolerance|http://lesswrong.com/lw/42/tolerate_tolerance/]]
[[You're Calling *Who* a Cult Leader?|http://lesswrong.com/lw/4d/youre_calling_who_a_cult_leader/]]
[[Your Price for Joining|http://lesswrong.com/lw/5j/your_price_for_joining/]]
[[Can Humanism Match Religion's Output?|http://lesswrong.com/lw/5t/can_humanism_match_religions_output/]]
[[Church vs. Taskforce|http://lesswrong.com/lw/5v/church_vs_taskforce/]]
[[Rationality: Common Interest of Many Causes|http://lesswrong.com/lw/66/rationality_common_interest_of_many_causes/]]
[[Helpless Individuals|http://lesswrong.com/lw/64/helpless_individuals/]]
[[Money: The Unit of Caring|http://lesswrong.com/lw/65/money_the_unit_of_caring/]]
[[Purchase Fuzzies and Utilons Seperately|http://lesswrong.com/lw/6z/purchase_fuzzies_and_utilons_separately/]]
[[Selecting Rationalist Groups|http://lesswrong.com/lw/77/selecting_rationalist_groups/]]
!!!Spirituality and the Sacred Mundane
[[The Sacred Mundane|http://lesswrong.com/lw/57/the_sacred_mundane/]]
[[Crowley on Religious Experiences|http://lesswrong.com/lw/5r/crowley_on_religious_experience/]]
!!!Priming and Implicit Association
[[Never Leave Your Room|http://lesswrong.com/lw/3b/never_leave_your_room/]]
[[Bogus Pipeline, Bona Fide Pipeline|http://lesswrong.com/lw/4w/bogus_pipeline_bona_fide_pipeline/]]
[[The Implicit Association Test|http://lesswrong.com/lw/53/the_implicit_association_test/]]
[[Fight Biases, or Route Around Them|http://lesswrong.com/lw/5d/fight_biases_or_route_around_them/]]
<<tabs txtMainTab "Recent" "Recently modified tiddlers" TabTimeline "All" "All tiddlers" TabAll "Tags" "All tags" TabTags "More" "More lists" TabMore>>
[[Do Helping Professions Help More? by Robin Hanson| http://www.overcomingbias.com/2006/12/do_helping_prof.html]]
[[Gifts Hurt by Robin Hanson| http://www.overcomingbias.com/2006/12/gifts_hurt.html]]
[[Benefit of Doubt = Bias by Robin Hanson| http://www.overcomingbias.com/2006/12/benefit_of_doub.html]]
/***
|Name|StoryViewerPlugin|
|Source|http://www.TiddlyTools.com/#StoryViewerPlugin|
|Documentation|http://www.TiddlyTools.com/#StoryViewerPluginInfo|
|Version|1.2.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|view tiddlers in a saved story, one at a time, using a droplist or "first/previous/next/last" links|
A "saved story" is a tiddler that contains a whitespace-separated list of tiddler titles. The {{{<<storyViewer>>}}} macro allows you to quickly ''display //and// navigate between the tiddlers in a saved story'', one at a time, using a droplist containing tiddler titles or individual "first/previous/next/last" text links.
!!!!!Documentation
> see [[StoryViewerPluginInfo]]
!!!!!Revisions
<<<
2008.06.05 [1.2.0] added custom story paramifier to extract story titles from tiddler links instead of using parseParams.<br> Permits use of links from any tiddler as a story, even if it contains wiki-syntax formatting in addition to list of tiddler titles
|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: 2, revision: 0, date: new Date(2008,6,5)};
//}}}
//{{{
config.macros.storyViewer = {
tag: "story",
storynotfoundmsg: "'%0' is an empty or unrecognized story",
firstcmd: "first",
firstbutton: "<<",
firstmsg: "display first tiddler in story '%0'",
nextcmd: "next",
nextbutton: ">",
nextmsg: "display next tiddler in story '%0'",
previouscmd: "previous",
previousbutton: "<",
previousmsg: "display previous tiddler in story '%0'",
lastcmd: "last",
lastbutton: ">>",
lastmsg: "display last tiddler in story '%0'",
refreshmsg: "redisplay '%0'",
refreshmsg: "",
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
// get name of current tiddler (if any)
var here=story.findContainingTiddler(place);
if (here) var tid=here.getAttribute("tiddler");
var storyname="";
var p=params.shift();
if (!p || p=='first'||p=='previous'||p=='here'||p=='next'||p=='last'||p=='list'||p=='links') {
// 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;
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
// get story from tiddler
var tids=[];
var tagged=store.getTaggedTiddlers(storyname,"excludeLists");
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:[];
}
var i=0;
switch (p) {
case 'first':
i=0;
break;
case 'previous':
if (!tid) return; // not in a tiddler
i=tids.indexOf(tid);
if (i==-1) { i=0; break; } // not in story, link to start of story
i--; if (i<0) i=0;
break;
case 'here': // display a refresh link for current tiddler (even if not in a story)
if (!tid) return; // not in a tiddler
var label=tid; if (params[0]) label=params.shift();
createTiddlyButton(place,label,this.refreshmsg.format([tid]),
function(){ story.refreshTiddler(story.findContainingTiddler(place).getAttribute("tiddler"), null,true); });
return;
case 'next':
if (!tid) return; // not in a tiddler
i=tids.indexOf(tid);
if (i==-1) { i=0; break; } // not in story, link to start of story
i++; if (i>tids.length-1) i=tids.length-1;
break;
case 'last':
i=tids.length-1;
break;
case 'links':
var out="{{center{{{floatleft{";
out+="<<storyViewer [["+storyname+"]] first first>> ";
out+="<<storyViewer [["+storyname+"]] previous previous>> ";
out+="}}}{{floatright{";
out+=" <<storyViewer [["+storyname+"]] next next>>";
out+=" <<storyViewer [["+storyname+"]] last last>>";
out+="}}}";
out+=" (story: [["+storyname+"]]) ";
out+="}}}";
wikify(out,place);
return;
case 'list':
default:
var nobuttons=false;
if (params[0]) nobuttons=(params[0].toLowerCase()=="nobuttons");
if (nobuttons) params.shift();
var allbuttons=false;
if (params[0]) allbuttons=(params[0].toLowerCase()=="allbuttons");
if (allbuttons) params.shift();
var onlybuttons=false;
if (params[0]) onlybuttons=(params[0].toLowerCase()=="onlybuttons");
if (onlybuttons) params.shift();
var h="";
h+='<form style="display:inline">';
if ((!nobuttons||onlybuttons) && allbuttons) {
h+='<input type="button" value="'+this.firstbutton+'" ';
h+=' style="padding:0" title="'+this.firstmsg.format([storyname])+'"';
h+=' onclick="this.form.list.selectedIndex=1; this.form.list.onchange();">';
}
if (!nobuttons||onlybuttons) {
h+='<input type="button" value="'+this.previousbutton+'" ';
h+=' style="padding:0 0.3em" title="'+this.previousmsg.format([storyname])+'"';
h+=' onclick="var i=this.form.list.selectedIndex-1; ';
h+=' if (i<1) i=1; this.form.list.selectedIndex=i; this.form.list.onchange();">';
}
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="">'+storyname+'...</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+'" ';
h+=' style="padding:0 0.3em" title="'+this.nextmsg.format([storyname])+'"';
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();">';
}
if ((!nobuttons||onlybuttons) && allbuttons) {
h+='<input type="button" value="'+this.lastbutton+'" ';
h+=' style="padding:0" title="'+this.lastmsg.format([storyname])+'"';
h+=' onclick="this.form.list.selectedIndex=this.form.list.options.length-1; this.form.list.onchange();">';
}
h+='</form>';
createTiddlyElement(place,"span").innerHTML=h;
return;
}
// override default labelling with specified text (if any)
var label=tids[i]; if (params[0]) label=params.shift();
if (tid==tids[i]) { // self-referential links turn into 'refresh links'
var btn=createTiddlyButton(place,null,this.refreshmsg.format([tid]),
function() { story.refreshTiddler(story.findContainingTiddler(place).getAttribute("tiddler"),null,true); });
wikify(label,btn);
}
else // create link
wikify(label,createTiddlyLink(place,tids[i],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.2.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|documentation|
|Requires||
|Overrides||
|Description|documentation for StoryViewerPlugin|
A "saved story" is a tiddler that contains a whitespace-separated list of tiddler titles. The {{{<<storyViewer>>}}} macro allows you to quickly ''display //and// navigate between the tiddlers in a saved story'', one at a time, using a droplist containing tiddler titles or individual "first/previous/next/last" text links.
!!!!!Usage
<<<
You can define a saved story by hand-creating a tiddler containing a whitespace-separated list of tiddler titles, e.g., [[DefaultTiddlers]], [[DocumentInfo]], etc.) and tagging that tiddler with <<tag story>>, so that it will be recognized by the {{{<<storyViewer>>}}} macro. ''You can also use the {{{<<saveStory>>}}} macro (see [[StorySaverPlugin]]), which automatically creates saved stories based on the tiddlers that are currently being viewed.''
The syntax for the {{{<<storyViewer>>}}} macro is:
{{{
<<storyViewer storyname action buttonoption>>
}}}
where:
* ''storyname''<br>is a tiddler containing a saved story. If you omit the storyname 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: ''You can also use any tag value as a storyname.'' Instead of reading the tiddler list from the contents of the storyname tiddler, the story view will be composed of all tiddlers tagged with the specified tag value.//
* ''action'' is one of the following keywords:
** ''list''<br>displays a droplist of tiddlers for the specified story, along with previous/next pushbuttons on either side of the list. When using the ''list'' action, you may also specify an //optional// parameter to indicate which buttons will appear when using the droplist display:
*** ''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
** ''first'', ''previous'', ''here'', ''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, while ''here'' displays the current tiddler name as a link that refreshes (re-renders) the tiddler when clicked.
** ''links''<br>displays the complete set of links (first, previous, next and last) with just one convenient macro invocation, allowing you to quickly and easily embed story navigation links into any tiddler content.
You can also embed the {{{<<storyViewer>>}}} macro directly in the ViewTemplate:
{{{
<span class='floatright smallform' macro='storyViewer list allbuttons'></span>
}}}
If you omit the storyname parameter in the template-based macro, it will automatically display the story navigation interface for those tiddlers that are contained in a saved story, while omitting those controls/links for tiddler that are NOT included in a saved story.
<<<
!!!!!Examples
<<<
*{{{<<storyViewer DocumentInfo>>}}}<br>{{smallform{<<storyViewer DocumentInfo>>}}}
*{{{<<storyViewer systemConfig list allbuttons>>}}} //(uses a tag as a storyname)//<br>{{smallform{<<storyViewer systemConfig list allbuttons>>}}}
*{{{<<storyViewer systemConfig links>>}}} //(uses a tag as a storyname)//<br><<storyViewer systemConfig links>>
<<<
!!!!!Revisions
<<<
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.
<<<
/*{{{*/
/*Bleach Theme for TiddlyWiki*/
/*Design and CSS by Saq Imtiaz*/
/*Version 1.0*/
/*}}}*/
/*{{{*/
/***
!General
***/
body {
background: #fff;
}
#contentWrapper{
margin: 2.5em auto;
width:759px;
line-height: 1.6em;
border:1px solid #999;
font-size: 11px;
font-family: Lucida Grande, Tahoma, Arial, Helvetica, sans-serif;
color: #555;height:1%;
}
.clearAll {clear:both;}
.tagClear {clear:none;}
/*}}}*/
/*{{{*/
/***
!Header
***/
#header {background:#fff; border-bottom:1px solid #999;padding: 2.5em 2em 1.6em 2em; height:1%;
}
.siteTitle {
font-family: 'Trebuchet MS' sans-serif;
font-weight: bold;
font-size: 32px;
color: #EF680E;
background-color: #FFF;
}
.siteSubtitle {
font-size: 1.0em;
display:block;
color: #999999; margin-top:0.5em !important; margin-top:1em; margin-left:3em;
}
#topMenu { positon:relative; float:right; display:inline; margin-right:2em;}
#topMenu br {display:none; }
#topMenu { background: #fff; color:#000;padding: 1em 1em;}
#topMenu a, #topMenu .tiddlyLink, #topMenu .button {margin:0 0.5em; color:#666;}
/*}}}*/
/*{{{*/
/***
!displayArea
***/
#displayArea {margin-left:1.35em; margin-right:16.3em; margin-top:0; padding-top:1em; padding-bottom:10px;}
/*}}}*/
/*{{{*/
/***
!Sidebar
***/
#sidebar {position:relative;float:right; line-height: 1.4em; border-left:0px solid#000; display:inline; background:#fff; right:0;
width: 16em;}
/***
!SidebarOptions
***/
#sidebarOptions {padding-left:0.5em; border-left:1px solid #999;padding-top:1em;}
#sidebarOptions a {
color:#999;
text-decoration: none;}
#sidebarOptions a:hover, #sidebarOptions .button:active {
color:#333;
background-color: #fff;border:1px solid #fff;
}
#sidebarOptions input {border:1px solid #999; width:10em;}
/***
!SidebarTabs
***/
#sidebarTabs {border-left:1px solid #999;}
#sidebarTabs .tabContents {background:#fff;}
#sidebarTabs .tabContents .tiddlyLink, #sidebarTabs .tabContents .button{color:#999;}
#sidebarTabs .tabContents .tiddlyLink:hover,#sidebarTabs .tabContents .button:hover{color:#333;background:#fff;border:none;}
#sidebarTabs .tabContents .button:hover, #sidebarTabs .tabContents .highlight, #sidebarTabs .tabContents .marked, #sidebarTabs .tabContents a.button:active{color:#333;background:#fff}
.tabSelected{color:#fff; background:#999;}
.tabUnselected {
background: #ccc;
}
.tabSelected, .tabSelected:hover {
color: #fff;
background: #999;
border: solid 1px #999;
padding-bottom:1px;
}
#sidebarTabs .tabUnselected:hover { border-bottom: none;padding-bottom:3px;color:#4F4B45}
.tabUnselected {
color: #999;
background: #eee;
border: solid 1px #ccc;
padding-bottom:1px;
}
#sidebarTabs .tabUnselected { border-bottom: none;padding-bottom:3px;}
#sidebarTabs .tabSelected{padding-bottom:3px;}
#sidebarOptions .sliderPanel {
background: #fff; border:none;
font-size: .9em;
}
#sidebarOptions .sliderPanel a {font-weight:normal; }
#sidebarOptions .sliderPanel input {border:1px solid #999;width:auto;}
#sidebarOptions .sliderPanel .txtOptionInput {border:1px solid #999;width:9em;}
#sidebarTabs .tabContents {border-right:0; border-left:0; border-bottom:1px solid#999; padding-left:4px;}
.listLink,#sidebarTabs .tabContents {line-height:1.5em;}
.listTitle {color:#666;}
#sidebarTabs .tabUnselected:hover { border-bottom: none;padding-bottom:3px;color:#4F4B45}
#sidebarTabs .txtMoreTab .tabContents {border-left:1px solid #999;}
#sidebarTabs .txtMainTab .tabContents li a{font-weight:bold;}
/*}}}*/
/*{{{*/
.title {color:#EF680E;}
.subtitle, .subtitle a { color: #999999; font-size: 1em;margin:0.2em; font-variant: small-caps;}
.shadow .title{color:#999;}
.selected .toolbar a {color:#999999;}
.selected .toolbar a:hover {color:#333; background:transparent;border:1px solid #fff;}
.toolbar .button:hover, .toolbar .highlight, .toolbar .marked, .toolbar a.button:active{color:#333; background:transparent;border:1px solid #fff;}
* html .viewer pre {
margin-left: 0em;
}
* html .editor textarea, * html .editor input {
width: 98%;
}
a,#sidebarOptions .sliderPanel a{
color:#EF680E;
text-decoration: none;
}
a:hover,#sidebarOptions .sliderPanel a:hover {
color:#EF680E;
background-color: #fff;
border-bottom:1px dotted #EF680E;
}
.viewer .button, .editorFooter .button{
color: #555;
border: 1px solid #EF680E;
}
.viewer .button:hover,
.editorFooter .button:hover{
color: #fff;
background: #EF680E;
border-color: #EF680E;
}
.viewer .button:active, .viewer .highlight,.editorFooter .button:active, .editorFooter .highlight{color:#fff; background:#DF691B;border-color:#DF691B;}
#topMenu a, #topMenu .button {
padding: 20px 10px; border:none; font-weight:bold;
}
#topMenu a:link{
text-decoration: none;
}
#topMenu a:hover, #topMenu .button:hover {
background-color: #fff;
color:#EF680E;
border:none;
}
.tagging, .tagged {
border: 1px solid #eee;
background-color: #F7F7F7;
}
.selected .tagging, .selected .tagged {
background-color: #eee;
border: 1px solid #BFBAB3;
}
.tagging .listTitle, .tagged .listTitle {
color: #bbb;
}
.selected .tagging .listTitle, .selected .tagged .listTitle {
color: #666;
}
.tagging .button, .tagged .button {
color:#aaa;
}
.selected .tagging .button, .selected .tagged .button {
color:#BFBAB3;
}
.highlight, .marked {background:transparent; color:#111; border:none; text-decoration:underline;}
.tagging .button:hover, .tagged .button:hover, .tagging .button:active, .tagged .button:active {
border: none; background:transparent; text-decoration:underline; color:#333;
}
.popup {
background: #999;
border: 1px solid #999;
}
.popup li.disabled {
color: #000;
}
.popup li a, .popup li a:visited {
color: #eee;
border: none;
}
.popup li a:hover {
background: #6F6A68;
color: #fff;
border: none;
}
.tiddler {
padding-bottom: 40px;
/*border-bottom: 1px solid #999; */
}
#messageArea {
border: 4px solid #999;
background: #f5f5f5;
color: #999;
font-size:90%;
}
#messageArea a:hover { background:#f5f5f5; border:none;}
#messageArea .button{
color: #666;
border: 1px solid #CC6714;
}
#messageArea .button:hover {
color: #fff;
background: #999;
border-color: #999;
}
.viewer blockquote {
border-left: 5px solid #888;
}
.viewer table {
border: 2px solid #888;
}
.viewer th, thead td {
background: #888;
border: 1px solid #888;
color: #fff;
}
.viewer pre {
border: 1px solid #999;
background: #f5f5f5;
}
.viewer code {
color: #111; background:#f5f5f5;
}
.viewer hr {
border-top: dashed 1px #999;
}
.editor input {
border: 1px solid #888;
}
.editor textarea {
border: 1px solid #888;
}
.tabContents {background:#f7f7f7;}
h1,h2,h3,h4,h5 { color: #555; background: transparent; padding-bottom:2px; font-family: Arial, Helvetica, sans-serif; }
h1 {font-size:18px;}
h2 {font-size:16px;}
h3 {font-size: 14px;}
#contentFooter {background:#999; color:#dfdfdf; clear: both; padding: 0.5em 1em; }
#contentFooter a {
color: #dfdfdf;
border-bottom: 1px dotted #fff; font-weight:normal;
}
#contentFooter a:hover {
color: #FFFFFF;
background-color:transparent;
}
/*}}}*/
!Inline Formatting /% DEBUG: buggy (-> monospaced) %/
|!Option|!Syntax|!Output|
|bold font|{{{''bold''}}}|''bold''|
|italic type|{{{//italic//}}}|//italic//|
|underlined text|{{{__underlined__}}}|__underlined__|
|strikethrough text|{{{--strikethrough--}}}|--strikethrough--|
|superscript text|{{{^^super^^script}}}|^^super^^script|
|subscript text|{{{~~sub~~script}}}|~~sub~~script|
|highlighted text|{{{@@highlighted@@}}}|@@highlighted@@|
|preformatted text|{{{{{{preformatted}}}}}}|{{{preformatted}}}|
!Block Elements
!!Headings
{{{
!Heading 1
!!Heading 2
!!!Heading 3
!!!!Heading 4
!!!!!Heading 5
}}}
<<<
!Heading 1
!!Heading 2
!!!Heading 3
!!!!Heading 4
!!!!!Heading 5
<<<
!!Lists
{{{
* unordered list, level 1
** unordered list, level 2
*** unordered list, level 3
# ordered list, level 1
## ordered list, level 2
### unordered list, level 3
; definition list, term
: definition list, description
}}}
<<<
* unordered list, level 1
** unordered list, level 2
*** unordered list, level 3
# ordered list, level 1
## ordered list, level 2
### unordered list, level 3
; definition list, term
: definition list, description
<<<
!!Blockquotes /% DEBUG: hack %/
{{{
> blockquote, level 1
>> blockquote, level 2
>>> blockquote, level 3
<<<
blockquote
<<<
}}}
<<<
> blockquote, level 1
>> blockquote, level 2
>>> blockquote, level 3
> blockquote
<<<
!!Preformatted Text /% DEBUG: hack %/
{{{
{{{
preformatted (e.g. code)
}}}
}}}
<<<
{{{
preformatted (e.g. code)
}}}
<<<
!!Tables
{{{
|CssClass|k
|!heading column 1|!heading column 2|
|row 1, column 1|row 1, column 2|
|row 2, column 1|row 2, column 2|
|>|COLSPAN|
|ROWSPAN| … |
|~| … |
|CssProperty:value;…| … |
|caption|c
}}}
''Annotation:''
* The {{{>}}} marker creates a "colspan", causing the current cell to merge with the one to the right.
* The {{{~}}} marker creates a "rowspan", causing the current cell to merge with the one above.
<<<
|CssClass|k
|!heading column 1|!heading column 2|
|row 1, column 1|row 1, column 2|
|row 2, column 1|row 2, column 2|
|>|COLSPAN|
|ROWSPAN| … |
|~| … |
|CssProperty:value;…| … |
|caption|c
<<<
!!Images /% DEBUG: to do %/
cf. [[TiddlyWiki.com|http://www.tiddlywiki.com/#EmbeddedImages]]
!Hyperlinks
* [[WikiWords|WikiWord]] are automatically transformed to hyperlinks to the respective tiddler
** the automatic transformation can be suppressed by preceding the respective WikiWord with a tilde ({{{~}}}): {{{~WikiWord}}}
* [[PrettyLinks]] are enclosed in square brackets and contain the desired tiddler name: {{{[[tiddler name]]}}}
** optionally, a custom title or description can be added, separated by a pipe character ({{{|}}}): {{{[[title|target]]}}}<br>'''N.B.:''' In this case, the target can also be any website (i.e. URL).
!Custom Styling
* {{{@@CssProperty:value;CssProperty:value;…@@}}}<br>''N.B.:'' CSS color definitions should use lowercase letters to prevent the inadvertent creation of WikiWords.
* {{{{{customCssClass{…}}}}}} /% DEBUG: buggy %/
* raw HTML can be inserted by enclosing the respective code in HTML tags: {{{<html> … </html>}}}
!Special Markers
* {{{<br>}}} forces a manual line break
* {{{----}}} creates a horizontal ruler
* [[HTML entities|http://www.tiddlywiki.com/#HtmlEntities]]
* {{{<<macroName>>}}} calls the respective [[macro|Macros]]
* To hide text within a tiddler so that it is not displayed, it can be wrapped in {{{/%}}} and {{{%/}}}.<br/>This can be a useful trick for hiding drafts or annotating complex markup.
* To prevent wiki markup from taking effect for a particular section, that section can be enclosed in three double quotes: e.g. {{{"""WikiWord"""}}}.
From http://tiddlywiki.org/wiki/TiddlyWiki_Markup
<<timeline better:true sortBy:modified maxEntries:20 excludeTag:siteConfig>>
http://yudkowsky.net/rational/technical
[[A Decent Respect by David J. Balan| http://www.overcomingbias.com/2006/12/a_decent_respec.html]]
!!![[Concepts]]
<<forEachTiddler
where
'tiddler.tags.contains("Concepts")'
sortBy
'(tiddler.title.toLowerCase())'
write
'"* [["+tiddler.title+"]]\n"'
>>
!!![[Jargon]]
<<forEachTiddler
where
'tiddler.tags.contains("Jargon")'
sortBy
'(tiddler.title.toLowerCase())'
write
'"* [["+tiddler.title+"]]\n"'
>>
!!![[People]]
<<forEachTiddler
where
'tiddler.tags.contains("People")'
sortBy
'(tiddler.title.toLowerCase())'
write
'"* [["+tiddler.title+"]]\n"'
>>
!!![[Resources]]
<<forEachTiddler
where
'tiddler.tags.contains("Resources")'
sortBy
'(tiddler.title.toLowerCase())'
write
'"* [["+tiddler.title+"]]\n"'
>>
<<forEachTiddler
where
'tiddler.tags.contains("stub")'
sortBy
'(tiddler.title.toLowerCase())'
write
'"* [["+tiddler.title+"]]\n"'
>>
[[The Simple Truth by Eliezer Yudkowsky| http://sl4.org/wiki/TheSimpleTruth]]
[[Why truth? and... by Eliezer Yudkowsky| http://www.overcomingbias.com/2006/11/why_truth_and.html]]
[[Finding the Truth in Controversies by Hal Finney| http://www.overcomingbias.com/2006/12/finding_the_tru.html]]
/***
Description: Contains the stuff you need to use Tiddlyspot
Note, you also need UploadPlugin, PasswordOptionPlugin and LoadRemoteFileThroughProxy
from http://tiddlywiki.bidix.info for a complete working Tiddlyspot site.
***/
//{{{
// edit this if you are migrating sites or retrofitting an existing TW
config.tiddlyspotSiteId = 'rationality';
// make it so you can by default see edit controls via http
config.options.chkHttpReadOnly = false;
window.readOnly = false; // make sure of it (for tw 2.2)
window.showBackstage = true; // show backstage too
// disable autosave in d3
if (window.location.protocol != "file:")
config.options.chkGTDLazyAutoSave = false;
// tweak shadow tiddlers to add upload button, password entry box etc
with (config.shadowTiddlers) {
SiteUrl = 'http://'+config.tiddlyspotSiteId+'.tiddlyspot.com';
SideBarOptions = SideBarOptions.replace(/(<<saveChanges>>)/,"$1<<tiddler TspotSidebar>>");
OptionsPanel = OptionsPanel.replace(/^/,"<<tiddler TspotOptions>>");
DefaultTiddlers = DefaultTiddlers.replace(/^/,"[[WelcomeToTiddlyspot]] ");
MainMenu = MainMenu.replace(/^/,"[[WelcomeToTiddlyspot]] ");
}
// create some shadow tiddler content
merge(config.shadowTiddlers,{
'WelcomeToTiddlyspot':[
"This document is a ~TiddlyWiki from tiddlyspot.com. A ~TiddlyWiki is an electronic notebook that is great for managing todo lists, personal information, and all sorts of things.",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //What now?// @@ Before you can save any changes, you need to enter your password in the form below. Then configure privacy and other site settings at your [[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]] (your control panel username is //" + config.tiddlyspotSiteId + "//).",
"<<tiddler TspotControls>>",
"See also GettingStarted.",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //Working online// @@ You can edit this ~TiddlyWiki right now, and save your changes using the \"save to web\" button in the column on the right.",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //Working offline// @@ A fully functioning copy of this ~TiddlyWiki can be saved onto your hard drive or USB stick. You can make changes and save them locally without being connected to the Internet. When you're ready to sync up again, just click \"upload\" and your ~TiddlyWiki will be saved back to tiddlyspot.com.",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //Help!// @@ Find out more about ~TiddlyWiki at [[TiddlyWiki.com|http://tiddlywiki.com]]. Also visit [[TiddlyWiki.org|http://tiddlywiki.org]] for documentation on learning and using ~TiddlyWiki. New users are especially welcome on the [[TiddlyWiki mailing list|http://groups.google.com/group/TiddlyWiki]], which is an excellent place to ask questions and get help. If you have a tiddlyspot related problem email [[tiddlyspot support|mailto:support@tiddlyspot.com]].",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //Enjoy :)// @@ We hope you like using your tiddlyspot.com site. Please email [[feedback@tiddlyspot.com|mailto:feedback@tiddlyspot.com]] with any comments or suggestions."
].join("\n"),
'TspotControls':[
"| tiddlyspot password:|<<option pasUploadPassword>>|",
"| site management:|<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . . " + config.tiddlyspotSiteId + ">>//(requires tiddlyspot password)//<br>[[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]], [[download (go offline)|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download]]|",
"| links:|[[tiddlyspot.com|http://tiddlyspot.com/]], [[FAQs|http://faq.tiddlyspot.com/]], [[blog|http://tiddlyspot.blogspot.com/]], email [[support|mailto:support@tiddlyspot.com]] & [[feedback|mailto:feedback@tiddlyspot.com]], [[donate|http://tiddlyspot.com/?page=donate]]|"
].join("\n"),
'TspotSidebar':[
"<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . . " + config.tiddlyspotSiteId + ">><html><a href='http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download' class='button'>download</a></html>"
].join("\n"),
'TspotOptions':[
"tiddlyspot password:",
"<<option pasUploadPassword>>",
""
].join("\n")
});
//}}}
From //[[Tsuyoku Naritai! (I Want To Become Stronger)|http://www.overcomingbias.com/2007/03/tsuyoku_naritai.html]]// by [[Eliezer Yudkowsky]]:
>//Tsuyoku naritai// is Japanese. //Tsuyoku// is "strong"; //naru// is "becoming" and the form //naritai// is "want to become". Together it means "I want to become stronger" and it expresses a sentiment embodied more intensely in Japanese works than in any Western literature I've read. You might say it when expressing your determination to become a professional Go player - or after you lose an important match, but you haven't given up - or after you win an important match, but you're not a ninth-dan player yet - or after you've become the greatest Go player of all time, but you still think you can do better. That is //tsuyoku naritai//, the will to transcendence.
[["I don't know." by Eliezer Yudkowsky| http://www.overcomingbias.com/2006/12/i_dont_know.html]]
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |
| 25/03/2009 00:42:28 | badger | [[/|http://rationality.tiddlyspot.com/]] | [[store.cgi|http://rationality.tiddlyspot.com/store.cgi]] | . | [[index.html | http://rationality.tiddlyspot.com/index.html]] | . | ok |
| 25/03/2009 01:16:58 | badger | [[/|http://rationality.tiddlyspot.com/]] | [[store.cgi|http://rationality.tiddlyspot.com/store.cgi]] | . | [[index.html | http://rationality.tiddlyspot.com/index.html]] | . |
| 28/03/2009 23:12:58 | badger | [[/|http://rationality.tiddlyspot.com/]] | [[store.cgi|http://rationality.tiddlyspot.com/store.cgi]] | . | [[index.html | http://rationality.tiddlyspot.com/index.html]] | . | ok |
| 29/03/2009 00:43:01 | badger | [[/|http://rationality.tiddlyspot.com/]] | [[store.cgi|http://rationality.tiddlyspot.com/store.cgi]] | . | [[index.html | http://rationality.tiddlyspot.com/index.html]] | . |
| 04/04/2009 23:26:28 | badger | [[/|http://rationality.tiddlyspot.com/]] | [[store.cgi|http://rationality.tiddlyspot.com/store.cgi]] | . | [[index.html | http://rationality.tiddlyspot.com/index.html]] | . |
| 05/04/2009 16:07:33 | badger | [[/|http://rationality.tiddlyspot.com/]] | [[store.cgi|http://rationality.tiddlyspot.com/store.cgi]] | . | [[index.html | http://rationality.tiddlyspot.com/index.html]] | . | ok |
| 05/04/2009 16:12:45 | badger | [[/|http://rationality.tiddlyspot.com/]] | [[store.cgi|http://rationality.tiddlyspot.com/store.cgi]] | . | [[index.html | http://rationality.tiddlyspot.com/index.html]] | . | ok |
| 05/04/2009 16:55:55 | badger | [[/|http://rationality.tiddlyspot.com/]] | [[store.cgi|http://rationality.tiddlyspot.com/store.cgi]] | . | [[index.html | http://rationality.tiddlyspot.com/index.html]] | . | ok |
| 05/04/2009 17:29:08 | badger | [[/|http://rationality.tiddlyspot.com/]] | [[store.cgi|http://rationality.tiddlyspot.com/store.cgi]] | . | [[index.html | http://rationality.tiddlyspot.com/index.html]] | . |
| 05/04/2009 16:13:04 | SoullessAutomaton | [[/|http://rationality.tiddlyspot.com/]] | [[store.cgi|http://rationality.tiddlyspot.com/store.cgi]] | . | [[index.html | http://rationality.tiddlyspot.com/index.html]] | . |
/***
|''Name:''|UploadPlugin|
|''Description:''|Save to web a TiddlyWiki|
|''Version:''|4.1.3|
|''Date:''|Feb 24, 2008|
|''Source:''|http://tiddlywiki.bidix.info/#UploadPlugin|
|''Documentation:''|http://tiddlywiki.bidix.info/#UploadPluginDoc|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0|
|''Requires:''|PasswordOptionPlugin|
***/
//{{{
version.extensions.UploadPlugin = {
major: 4, minor: 1, revision: 3,
date: new Date("Feb 24, 2008"),
source: 'http://tiddlywiki.bidix.info/#UploadPlugin',
author: 'BidiX (BidiX (at) bidix (dot) info',
coreVersion: '2.2.0'
};
//
// Environment
//
if (!window.bidix) window.bidix = {}; // bidix namespace
bidix.debugMode = false; // true to activate both in Plugin and UploadService
//
// Upload Macro
//
config.macros.upload = {
// default values
defaultBackupDir: '', //no backup
defaultStoreScript: "store.php",
defaultToFilename: "index.html",
defaultUploadDir: ".",
authenticateUser: true // UploadService Authenticate User
};
config.macros.upload.label = {
promptOption: "Save and Upload this TiddlyWiki with UploadOptions",
promptParamMacro: "Save and Upload this TiddlyWiki in %0",
saveLabel: "save to web",
saveToDisk: "save to disk",
uploadLabel: "upload"
};
config.macros.upload.messages = {
noStoreUrl: "No store URL in parmeters or options",
usernameOrPasswordMissing: "Username or password missing"
};
config.macros.upload.handler = function(place,macroName,params) {
if (readOnly)
return;
var label;
if (document.location.toString().substr(0,4) == "http")
label = this.label.saveLabel;
else
label = this.label.uploadLabel;
var prompt;
if (params[0]) {
prompt = this.label.promptParamMacro.toString().format([this.destFile(params[0],
(params[1] ? params[1]:bidix.basename(window.location.toString())), params[3])]);
} else {
prompt = this.label.promptOption;
}
createTiddlyButton(place, label, prompt, function() {config.macros.upload.action(params);}, null, null, this.accessKey);
};
config.macros.upload.action = function(params)
{
// for missing macro parameter set value from options
if (!params) params = {};
var storeUrl = params[0] ? params[0] : config.options.txtUploadStoreUrl;
var toFilename = params[1] ? params[1] : config.options.txtUploadFilename;
var backupDir = params[2] ? params[2] : config.options.txtUploadBackupDir;
var uploadDir = params[3] ? params[3] : config.options.txtUploadDir;
var username = params[4] ? params[4] : config.options.txtUploadUserName;
var password = config.options.pasUploadPassword; // for security reason no password as macro parameter
// for still missing parameter set default value
if ((!storeUrl) && (document.location.toString().substr(0,4) == "http"))
storeUrl = bidix.dirname(document.location.toString())+'/'+config.macros.upload.defaultStoreScript;
if (storeUrl.substr(0,4) != "http")
storeUrl = bidix.dirname(document.location.toString()) +'/'+ storeUrl;
if (!toFilename)
toFilename = bidix.basename(window.location.toString());
if (!toFilename)
toFilename = config.macros.upload.defaultToFilename;
if (!uploadDir)
uploadDir = config.macros.upload.defaultUploadDir;
if (!backupDir)
backupDir = config.macros.upload.defaultBackupDir;
// report error if still missing
if (!storeUrl) {
alert(config.macros.upload.messages.noStoreUrl);
clearMessage();
return false;
}
if (config.macros.upload.authenticateUser && (!username || !password)) {
alert(config.macros.upload.messages.usernameOrPasswordMissing);
clearMessage();
return false;
}
bidix.upload.uploadChanges(false,null,storeUrl, toFilename, uploadDir, backupDir, username, password);
return false;
};
config.macros.upload.destFile = function(storeUrl, toFilename, uploadDir)
{
if (!storeUrl)
return null;
var dest = bidix.dirname(storeUrl);
if (uploadDir && uploadDir != '.')
dest = dest + '/' + uploadDir;
dest = dest + '/' + toFilename;
return dest;
};
//
// uploadOptions Macro
//
config.macros.uploadOptions = {
handler: function(place,macroName,params) {
var wizard = new Wizard();
wizard.createWizard(place,this.wizardTitle);
wizard.addStep(this.step1Title,this.step1Html);
var markList = wizard.getElement("markList");
var listWrapper = document.createElement("div");
markList.parentNode.insertBefore(listWrapper,markList);
wizard.setValue("listWrapper",listWrapper);
this.refreshOptions(listWrapper,false);
var uploadCaption;
if (document.location.toString().substr(0,4) == "http")
uploadCaption = config.macros.upload.label.saveLabel;
else
uploadCaption = config.macros.upload.label.uploadLabel;
wizard.setButtons([
{caption: uploadCaption, tooltip: config.macros.upload.label.promptOption,
onClick: config.macros.upload.action},
{caption: this.cancelButton, tooltip: this.cancelButtonPrompt, onClick: this.onCancel}
]);
},
options: [
"txtUploadUserName",
"pasUploadPassword",
"txtUploadStoreUrl",
"txtUploadDir",
"txtUploadFilename",
"txtUploadBackupDir",
"chkUploadLog",
"txtUploadLogMaxLine"
],
refreshOptions: function(listWrapper) {
var opts = [];
for(i=0; i<this.options.length; i++) {
var opt = {};
opts.push();
opt.option = "";
n = this.options[i];
opt.name = n;
opt.lowlight = !config.optionsDesc[n];
opt.description = opt.lowlight ? this.unknownDescription : config.optionsDesc[n];
opts.push(opt);
}
var listview = ListView.create(listWrapper,opts,this.listViewTemplate);
for(n=0; n<opts.length; n++) {
var type = opts[n].name.substr(0,3);
var h = config.macros.option.types[type];
if (h && h.create) {
h.create(opts[n].colElements['option'],type,opts[n].name,opts[n].name,"no");
}
}
},
onCancel: function(e)
{
backstage.switchTab(null);
return false;
},
wizardTitle: "Upload with options",
step1Title: "These options are saved in cookies in your browser",
step1Html: "<input type='hidden' name='markList'></input><br>",
cancelButton: "Cancel",
cancelButtonPrompt: "Cancel prompt",
listViewTemplate: {
columns: [
{name: 'Description', field: 'description', title: "Description", type: 'WikiText'},
{name: 'Option', field: 'option', title: "Option", type: 'String'},
{name: 'Name', field: 'name', title: "Name", type: 'String'}
],
rowClasses: [
{className: 'lowlight', field: 'lowlight'}
]}
};
//
// upload functions
//
if (!bidix.upload) bidix.upload = {};
if (!bidix.upload.messages) bidix.upload.messages = {
//from saving
invalidFileError: "The original file '%0' does not appear to be a valid TiddlyWiki",
backupSaved: "Backup saved",
backupFailed: "Failed to upload backup file",
rssSaved: "RSS feed uploaded",
rssFailed: "Failed to upload RSS feed file",
emptySaved: "Empty template uploaded",
emptyFailed: "Failed to upload empty template file",
mainSaved: "Main TiddlyWiki file uploaded",
mainFailed: "Failed to upload main TiddlyWiki file. Your changes have not been saved",
//specific upload
loadOriginalHttpPostError: "Can't get original file",
aboutToSaveOnHttpPost: 'About to upload on %0 ...',
storePhpNotFound: "The store script '%0' was not found."
};
bidix.upload.uploadChanges = function(onlyIfDirty,tiddlers,storeUrl,toFilename,uploadDir,backupDir,username,password)
{
var callback = function(status,uploadParams,original,url,xhr) {
if (!status) {
displayMessage(bidix.upload.messages.loadOriginalHttpPostError);
return;
}
if (bidix.debugMode)
alert(original.substr(0,500)+"\n...");
// Locate the storeArea div's
var posDiv = locateStoreArea(original);
if((posDiv[0] == -1) || (posDiv[1] == -1)) {
alert(config.messages.invalidFileError.format([localPath]));
return;
}
bidix.upload.uploadRss(uploadParams,original,posDiv);
};
if(onlyIfDirty && !store.isDirty())
return;
clearMessage();
// save on localdisk ?
if (document.location.toString().substr(0,4) == "file") {
var path = document.location.toString();
var localPath = getLocalPath(path);
saveChanges();
}
// get original
var uploadParams = new Array(storeUrl,toFilename,uploadDir,backupDir,username,password);
var originalPath = document.location.toString();
// If url is a directory : add index.html
if (originalPath.charAt(originalPath.length-1) == "/")
originalPath = originalPath + "index.html";
var dest = config.macros.upload.destFile(storeUrl,toFilename,uploadDir);
var log = new bidix.UploadLog();
log.startUpload(storeUrl, dest, uploadDir, backupDir);
displayMessage(bidix.upload.messages.aboutToSaveOnHttpPost.format([dest]));
if (bidix.debugMode)
alert("about to execute Http - GET on "+originalPath);
var r = doHttp("GET",originalPath,null,null,username,password,callback,uploadParams,null);
if (typeof r == "string")
displayMessage(r);
return r;
};
bidix.upload.uploadRss = function(uploadParams,original,posDiv)
{
var callback = function(status,params,responseText,url,xhr) {
if(status) {
var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
displayMessage(bidix.upload.messages.rssSaved,bidix.dirname(url)+'/'+destfile);
bidix.upload.uploadMain(params[0],params[1],params[2]);
} else {
displayMessage(bidix.upload.messages.rssFailed);
}
};
// do uploadRss
if(config.options.chkGenerateAnRssFeed) {
var rssPath = uploadParams[1].substr(0,uploadParams[1].lastIndexOf(".")) + ".xml";
var rssUploadParams = new Array(uploadParams[0],rssPath,uploadParams[2],'',uploadParams[4],uploadParams[5]);
var rssString = generateRss();
// no UnicodeToUTF8 conversion needed when location is "file" !!!
if (document.location.toString().substr(0,4) != "file")
rssString = convertUnicodeToUTF8(rssString);
bidix.upload.httpUpload(rssUploadParams,rssString,callback,Array(uploadParams,original,posDiv));
} else {
bidix.upload.uploadMain(uploadParams,original,posDiv);
}
};
bidix.upload.uploadMain = function(uploadParams,original,posDiv)
{
var callback = function(status,params,responseText,url,xhr) {
var log = new bidix.UploadLog();
if(status) {
// if backupDir specified
if ((params[3]) && (responseText.indexOf("backupfile:") > -1)) {
var backupfile = responseText.substring(responseText.indexOf("backupfile:")+11,responseText.indexOf("\n", responseText.indexOf("backupfile:")));
displayMessage(bidix.upload.messages.backupSaved,bidix.dirname(url)+'/'+backupfile);
}
var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
displayMessage(bidix.upload.messages.mainSaved,bidix.dirname(url)+'/'+destfile);
store.setDirty(false);
log.endUpload("ok");
} else {
alert(bidix.upload.messages.mainFailed);
displayMessage(bidix.upload.messages.mainFailed);
log.endUpload("failed");
}
};
// do uploadMain
var revised = bidix.upload.updateOriginal(original,posDiv);
bidix.upload.httpUpload(uploadParams,revised,callback,uploadParams);
};
bidix.upload.httpUpload = function(uploadParams,data,callback,params)
{
var localCallback = function(status,params,responseText,url,xhr) {
url = (url.indexOf("nocache=") < 0 ? url : url.substring(0,url.indexOf("nocache=")-1));
if (xhr.status == 404)
alert(bidix.upload.messages.storePhpNotFound.format([url]));
if ((bidix.debugMode) || (responseText.indexOf("Debug mode") >= 0 )) {
alert(responseText);
if (responseText.indexOf("Debug mode") >= 0 )
responseText = responseText.substring(responseText.indexOf("\n\n")+2);
} else if (responseText.charAt(0) != '0')
alert(responseText);
if (responseText.charAt(0) != '0')
status = null;
callback(status,params,responseText,url,xhr);
};
// do httpUpload
var boundary = "---------------------------"+"AaB03x";
var uploadFormName = "UploadPlugin";
// compose headers data
var sheader = "";
sheader += "--" + boundary + "\r\nContent-disposition: form-data; name=\"";
sheader += uploadFormName +"\"\r\n\r\n";
sheader += "backupDir="+uploadParams[3] +
";user=" + uploadParams[4] +
";password=" + uploadParams[5] +
";uploaddir=" + uploadParams[2];
if (bidix.debugMode)
sheader += ";debug=1";
sheader += ";;\r\n";
sheader += "\r\n" + "--" + boundary + "\r\n";
sheader += "Content-disposition: form-data; name=\"userfile\"; filename=\""+uploadParams[1]+"\"\r\n";
sheader += "Content-Type: text/html;charset=UTF-8" + "\r\n";
sheader += "Content-Length: " + data.length + "\r\n\r\n";
// compose trailer data
var strailer = new String();
strailer = "\r\n--" + boundary + "--\r\n";
data = sheader + data + strailer;
if (bidix.debugMode) alert("about to execute Http - POST on "+uploadParams[0]+"\n with \n"+data.substr(0,500)+ " ... ");
var r = doHttp("POST",uploadParams[0],data,"multipart/form-data; ;charset=UTF-8; boundary="+boundary,uploadParams[4],uploadParams[5],localCallback,params,null);
if (typeof r == "string")
displayMessage(r);
return r;
};
// same as Saving's updateOriginal but without convertUnicodeToUTF8 calls
bidix.upload.updateOriginal = function(original, posDiv)
{
if (!posDiv)
posDiv = locateStoreArea(original);
if((posDiv[0] == -1) || (posDiv[1] == -1)) {
alert(config.messages.invalidFileError.format([localPath]));
return;
}
var revised = original.substr(0,posDiv[0] + startSaveArea.length) + "\n" +
store.allTiddlersAsHtml() + "\n" +
original.substr(posDiv[1]);
var newSiteTitle = getPageTitle().htmlEncode();
revised = revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");
revised = updateMarkupBlock(revised,"PRE-HEAD","MarkupPreHead");
revised = updateMarkupBlock(revised,"POST-HEAD","MarkupPostHead");
revised = updateMarkupBlock(revised,"PRE-BODY","MarkupPreBody");
revised = updateMarkupBlock(revised,"POST-SCRIPT","MarkupPostBody");
return revised;
};
//
// UploadLog
//
// config.options.chkUploadLog :
// false : no logging
// true : logging
// config.options.txtUploadLogMaxLine :
// -1 : no limit
// 0 : no Log lines but UploadLog is still in place
// n : the last n lines are only kept
// NaN : no limit (-1)
bidix.UploadLog = function() {
if (!config.options.chkUploadLog)
return; // this.tiddler = null
this.tiddler = store.getTiddler("UploadLog");
if (!this.tiddler) {
this.tiddler = new Tiddler();
this.tiddler.title = "UploadLog";
this.tiddler.text = "| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |";
this.tiddler.created = new Date();
this.tiddler.modifier = config.options.txtUserName;
this.tiddler.modified = new Date();
store.addTiddler(this.tiddler);
}
return this;
};
bidix.UploadLog.prototype.addText = function(text) {
if (!this.tiddler)
return;
// retrieve maxLine when we need it
var maxLine = parseInt(config.options.txtUploadLogMaxLine,10);
if (isNaN(maxLine))
maxLine = -1;
// add text
if (maxLine != 0)
this.tiddler.text = this.tiddler.text + text;
// Trunck to maxLine
if (maxLine >= 0) {
var textArray = this.tiddler.text.split('\n');
if (textArray.length > maxLine + 1)
textArray.splice(1,textArray.length-1-maxLine);
this.tiddler.text = textArray.join('\n');
}
// update tiddler fields
this.tiddler.modifier = config.options.txtUserName;
this.tiddler.modified = new Date();
store.addTiddler(this.tiddler);
// refresh and notifiy for immediate update
story.refreshTiddler(this.tiddler.title);
store.notify(this.tiddler.title, true);
};
bidix.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir, backupDir) {
if (!this.tiddler)
return;
var now = new Date();
var text = "\n| ";
var filename = bidix.basename(document.location.toString());
if (!filename) filename = '/';
text += now.formatString("0DD/0MM/YYYY 0hh:0mm:0ss") +" | ";
text += config.options.txtUserName + " | ";
text += "[["+filename+"|"+location + "]] |";
text += " [[" + bidix.basename(storeUrl) + "|" + storeUrl + "]] | ";
text += uploadDir + " | ";
text += "[[" + bidix.basename(toFilename) + " | " +toFilename + "]] | ";
text += backupDir + " |";
this.addText(text);
};
bidix.UploadLog.prototype.endUpload = function(status) {
if (!this.tiddler)
return;
this.addText(" "+status+" |");
};
//
// Utilities
//
bidix.checkPlugin = function(plugin, major, minor, revision) {
var ext = version.extensions[plugin];
if (!
(ext &&
((ext.major > major) ||
((ext.major == major) && (ext.minor > minor)) ||
((ext.major == major) && (ext.minor == minor) && (ext.revision >= revision))))) {
// write error in PluginManager
if (pluginInfo)
pluginInfo.log.push("Requires " + plugin + " " + major + "." + minor + "." + revision);
eval(plugin); // generate an error : "Error: ReferenceError: xxxx is not defined"
}
};
bidix.dirname = function(filePath) {
if (!filePath)
return;
var lastpos;
if ((lastpos = filePath.lastIndexOf("/")) != -1) {
return filePath.substring(0, lastpos);
} else {
return filePath.substring(0, filePath.lastIndexOf("\\"));
}
};
bidix.basename = function(filePath) {
if (!filePath)
return;
var lastpos;
if ((lastpos = filePath.lastIndexOf("#")) != -1)
filePath = filePath.substring(0, lastpos);
if ((lastpos = filePath.lastIndexOf("/")) != -1) {
return filePath.substring(lastpos + 1);
} else
return filePath.substring(filePath.lastIndexOf("\\")+1);
};
bidix.initOption = function(name,value) {
if (!config.options[name])
config.options[name] = value;
};
//
// Initializations
//
// require PasswordOptionPlugin 1.0.1 or better
bidix.checkPlugin("PasswordOptionPlugin", 1, 0, 1);
// styleSheet
setStylesheet('.txtUploadStoreUrl, .txtUploadBackupDir, .txtUploadDir {width: 22em;}',"uploadPluginStyles");
//optionsDesc
merge(config.optionsDesc,{
txtUploadStoreUrl: "Url of the UploadService script (default: store.php)",
txtUploadFilename: "Filename of the uploaded file (default: in index.html)",
txtUploadDir: "Relative Directory where to store the file (default: . (downloadService directory))",
txtUploadBackupDir: "Relative Directory where to backup the file. If empty no backup. (default: ''(empty))",
txtUploadUserName: "Upload Username",
pasUploadPassword: "Upload Password",
chkUploadLog: "do Logging in UploadLog (default: true)",
txtUploadLogMaxLine: "Maximum of lines in UploadLog (default: 10)"
});
// Options Initializations
bidix.initOption('txtUploadStoreUrl','');
bidix.initOption('txtUploadFilename','');
bidix.initOption('txtUploadDir','');
bidix.initOption('txtUploadBackupDir','');
bidix.initOption('txtUploadUserName','');
bidix.initOption('pasUploadPassword','');
bidix.initOption('chkUploadLog',true);
bidix.initOption('txtUploadLogMaxLine','10');
// Backstage
merge(config.tasks,{
uploadOptions: {text: "upload", tooltip: "Change UploadOptions and Upload", content: '<<uploadOptions>>'}
});
config.backstageTasks.push("uploadOptions");
//}}}
<!--{{{-->
<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>
<!--}}}-->
[[The Zombie Preacher Of Somerset|http://lesswrong.com/lw/69/the_zombie_preacher_of_somerset/]] by [[Yvain]]