<!--{{{-->
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml' />
<!--}}}-->
Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}

a {color:[[ColorPalette::PrimaryMid]];}
a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
a img {border:0;}

h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}

.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}

.header {background:[[ColorPalette::PrimaryMid]];}
.headerShadow {color:[[ColorPalette::Foreground]];}
.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
.headerForeground {color:[[ColorPalette::Background]];}
.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}

.tabSelected{color:[[ColorPalette::PrimaryDark]];
	background:[[ColorPalette::TertiaryPale]];
	border-left:1px solid [[ColorPalette::TertiaryLight]];
	border-top:1px solid [[ColorPalette::TertiaryLight]];
	border-right:1px solid [[ColorPalette::TertiaryLight]];
}
.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
.tabContents .button {border:0;}

#sidebar {}
#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}

.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
	border:1px solid [[ColorPalette::PrimaryMid]];}
.wizardStep.wizardStepDone {background:[[ColorPalette::TertiaryLight]];}
.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
	border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
	border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}

.wizard .notChanged {background:transparent;}
.wizard .changedLocally {background:#80ff80;}
.wizard .changedServer {background:#8080ff;}
.wizard .changedBoth {background:#ff8080;}
.wizard .notFound {background:#ffff80;}
.wizard .putToServer {background:#ff80ff;}
.wizard .gotFromServer {background:#80ffff;}

#messageArea {border:1px solid [[ColorPalette::SecondaryMid]]; background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]];}
#messageArea .button {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::SecondaryPale]]; border:none;}

.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}

.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}

.tiddler .defaultCommand {font-weight:bold;}

.shadow .title {color:[[ColorPalette::TertiaryDark]];}

.title {color:[[ColorPalette::SecondaryDark]];}
.subtitle {color:[[ColorPalette::TertiaryDark]];}

.toolbar {color:[[ColorPalette::PrimaryMid]];}
.toolbar a {color:[[ColorPalette::TertiaryLight]];}
.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}

.tagging, .tagged {border:1px solid [[ColorPalette::TertiaryPale]]; background-color:[[ColorPalette::TertiaryPale]];}
.selected .tagging, .selected .tagged {background-color:[[ColorPalette::TertiaryLight]]; border:1px solid [[ColorPalette::TertiaryMid]];}
.tagging .listTitle, .tagged .listTitle {color:[[ColorPalette::PrimaryDark]];}
.tagging .button, .tagged .button {border:none;}

.footer {color:[[ColorPalette::TertiaryLight]];}
.selected .footer {color:[[ColorPalette::TertiaryMid]];}

.sparkline {background:[[ColorPalette::PrimaryPale]]; border:0;}
.sparktick {background:[[ColorPalette::PrimaryDark]];}

.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
.lowlight {background:[[ColorPalette::TertiaryLight]];}

.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}

.imageLink, #displayArea .imageLink {background:transparent;}

.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}

.viewer .listTitle {list-style-type:none; margin-left:-2em;}
.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}

.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}

.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
.viewer code {color:[[ColorPalette::SecondaryDark]];}
.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}

.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}

.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
.editorFooter {color:[[ColorPalette::TertiaryMid]];}

#backstageArea {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::TertiaryMid]];}
#backstageArea a {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstageArea a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; }
#backstageArea a.backstageSelTab {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
#backstageButton a {background:none; color:[[ColorPalette::Background]]; border:none;}
#backstageButton a:hover {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstagePanel {background:[[ColorPalette::Background]]; border-color: [[ColorPalette::Background]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]];}
.backstagePanelFooter .button {border:none; color:[[ColorPalette::Background]];}
.backstagePanelFooter .button:hover {color:[[ColorPalette::Foreground]];}
#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.6; filter:'alpha(opacity=60)';}
/*}}}*/
/*{{{*/
* html .tiddler {height:1%;}

body {font-size:.75em; font-family:arial,helvetica; margin:0; padding:0;}

h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
h4,h5,h6 {margin-top:1em;}
h1 {font-size:1.35em;}
h2 {font-size:1.25em;}
h3 {font-size:1.1em;}
h4 {font-size:1em;}
h5 {font-size:.9em;}

hr {height:1px;}

a {text-decoration:none;}

dt {font-weight:bold;}

ol {list-style-type:decimal;}
ol ol {list-style-type:lower-alpha;}
ol ol ol {list-style-type:lower-roman;}
ol ol ol ol {list-style-type:decimal;}
ol ol ol ol ol {list-style-type:lower-alpha;}
ol ol ol ol ol ol {list-style-type:lower-roman;}
ol ol ol ol ol ol ol {list-style-type:decimal;}

.txtOptionInput {width:11em;}

#contentWrapper .chkOptionInput {border:0;}

.externalLink {text-decoration:underline;}

.indent {margin-left:3em;}
.outdent {margin-left:3em; text-indent:-3em;}
code.escaped {white-space:nowrap;}

.tiddlyLinkExisting {font-weight:bold;}
.tiddlyLinkNonExisting {font-style:italic;}

/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
a.tiddlyLinkNonExisting.shadow {font-weight:bold;}

#mainMenu .tiddlyLinkExisting,
	#mainMenu .tiddlyLinkNonExisting,
	#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}

.header {position:relative;}
.header a:hover {background:transparent;}
.headerShadow {position:relative; padding:4.5em 0 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0 1em 1em; left:0px; top:0px;}

.siteTitle {font-size:3em;}
.siteSubtitle {font-size:1.2em;}

#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}

#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
#sidebarOptions {padding-top:0.3em;}
#sidebarOptions a {margin:0 0.2em; padding:0.2em 0.3em; display:block;}
#sidebarOptions input {margin:0.4em 0.5em;}
#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
#sidebarOptions .sliderPanel input {margin:0 0 0.3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}

.wizard {padding:0.1em 1em 0 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0 0; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0;}
.wizardFooter .status {padding:0 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em;}

#messageArea {position:fixed; top:2em; right:0; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
.messageToolbar {display:block; text-align:right; padding:0.2em;}
#messageArea a {text-decoration:underline;}

.tiddlerPopupButton {padding:0.2em;}
.popupTiddler {position: absolute; z-index:300; padding:1em; margin:0;}

.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
.popup .popupMessage {padding:0.4em;}
.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
.listBreak {font-size:1px; line-height:1px;}
.listBreak div {margin:2px 0;}

.tabset {padding:1em 0 0 0.5em;}
.tab {margin:0 0 0 0.25em; padding:2px;}
.tabContents {padding:0.5em;}
.tabContents ul, .tabContents ol {margin:0; padding:0;}
.txtMainTab .tabContents li {list-style:none;}
.tabContents li.listLink { margin-left:.75em;}

#contentWrapper {display:block;}
#splashScreen {display:none;}

#displayArea {margin:1em 17em 0 14em;}

.toolbar {text-align:right; font-size:.9em;}

.tiddler {padding:1em 1em 0;}

.missing .viewer,.missing .title {font-style:italic;}

.title {font-size:1.6em; font-weight:bold;}

.missing .subtitle {display:none;}
.subtitle {font-size:1.1em;}

.tiddler .button {padding:0.2em 0.4em;}

.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
.isTag .tagging {display:block;}
.tagged {margin:0.5em; float:right;}
.tagging, .tagged {font-size:0.9em; padding:0.25em;}
.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
.tagClear {clear:both;}

.footer {font-size:.9em;}
.footer li {display:inline;}

.annotation {padding:0.5em; margin:0.5em;}

* html .viewer pre {width:99%; padding:0 0 1em 0;}
.viewer {line-height:1.4em; padding-top:0.5em;}
.viewer .button {margin:0 0.25em; padding:0 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}

.viewer table, table.twtable {border-collapse:collapse; margin:0.8em 1.0em;}
.viewer th, .viewer td, .viewer tr,.viewer caption,.twtable th, .twtable td, .twtable tr,.twtable caption {padding:3px;}
table.listView {font-size:0.85em; margin:0.8em 1.0em;}
table.listView th, table.listView td, table.listView tr {padding:0px 3px 0px 3px;}

.viewer pre {padding:0.5em; margin-left:0.5em; font-size:1.2em; line-height:1.4em; overflow:auto;}
.viewer code {font-size:1.2em; line-height:1.4em;}

.editor {font-size:1.1em;}
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
.editorFooter {padding:0.25em 0; font-size:.9em;}
.editorFooter .button {padding-top:0px; padding-bottom:0px;}

.fieldsetFix {border:0; padding:0; margin:1px 0px;}

.sparkline {line-height:1em;}
.sparktick {outline:0;}

.zoomer {font-size:1.1em; position:absolute; overflow:hidden;}
.zoomer div {padding:1em;}

* html #backstage {width:99%;}
* html #backstageArea {width:99%;}
#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0; right:0;}
#backstageButton a {padding:0.1em 0.4em; margin:0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; width:90%; margin-left:3em; padding:1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em;}
#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}

.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
/***
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which need larger font sizes.
***/
/*{{{*/
body {font-size:0.8em;}
#sidebarOptions {font-size:1.05em;}
#sidebarOptions a {font-style:normal;}
#sidebarOptions .sliderPanel {font-size:0.95em;}
.subtitle {font-size:0.8em;}
.viewer table.listView {font-size:0.95em;}
/*}}}*/
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton, #backstageArea {display: none !important;}
#displayArea {margin: 1em 1em 0em;}
noscript {display:none;} /* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
}
/*}}}*/
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
<!--{{{-->
<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>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser excludeLists'></span></div>
<!--}}}-->
To get started with this blank [[TiddlyWiki]], you'll need to modify the following tiddlers:
* [[SiteTitle]] & [[SiteSubtitle]]: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* [[MainMenu]]: The menu (usually on the left)
* [[DefaultTiddlers]]: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
These [[InterfaceOptions]] for customising [[TiddlyWiki]] are saved in your browser

Your username for signing your edits. Write it as a [[WikiWord]] (eg [[JoeBloggs]])

<<option txtUserName>>
<<option chkSaveBackups>> [[SaveBackups]]
<<option chkAutoSave>> [[AutoSave]]
<<option chkRegExpSearch>> [[RegExpSearch]]
<<option chkCaseSensitiveSearch>> [[CaseSensitiveSearch]]
<<option chkAnimate>> [[EnableAnimations]]

----
Also see [[AdvancedOptions]]
<<importTiddlers>>
<code>
! ~/.Xdefaults - X default resource settings
Rxvt*geometry: 90x25
Rxvt*background: #000020
Rxvt*foreground: #ffffbf
!Rxvt*borderColor: Blue
!Rxvt*scrollColor: Blue
!Rxvt*troughColor: Gray
Rxvt*scrollBar: True
Rxvt*scrollBar_right: True
Rxvt*font: Lucida Console-12
!Rxvt*font: Courier New-14
Rxvt*saveLines: 12000
Rxvt*loginShell: True
! VIM-like colors
Rxvt*color0:    #000000
Rxvt*color1:    #FFFFFF
Rxvt*color2:    #00A800
Rxvt*color3:    #FFFF00
Rxvt*color4:    #0000A8
Rxvt*color5:    #A800A8
Rxvt*color6:    #00A8A8
Rxvt*color7:    #D8D8D8
Rxvt*color8:    #000000
Rxvt*color9:    #FFFFFF
Rxvt*color10:   #00A800
Rxvt*color11:   #FFFF00
Rxvt*color12:   #0012A8		! folders
Rxvt*color13:   #A800A8
Rxvt*color14:   #00A8A8
Rxvt*color15:   #D8D8D8
! eof

</code>
<code php>
# base-files version 3.7-1

# To pick up the latest recommended .bash_profile content,
# look in /etc/defaults/etc/skel/.bash_profile

# Modifying /etc/skel/.bash_profile directly will prevent
# setup from updating it.

# The copy in your home directory (~/.bash_profile) is yours, please
# feel free to customise it to create a shell
# environment to your liking.  If you feel a change
# would be benifitial to all, please feel free to send
# a patch to the cygwin mailing list.

# ~/.bash_profile: executed by bash for login shells.

# source the system wide bashrc if it exists
if [ -e /etc/bash.bashrc ] ; then
  source /etc/bash.bashrc
fi

# source the users bashrc if it exists
if [ -e "${HOME}/.bashrc" ] ; then
  source "${HOME}/.bashrc"
fi

# Set PATH so it includes user's private bin if it exists
# if [ -d "${HOME}/bin" ] ; then
#   PATH=${HOME}/bin:${PATH}
# fi

# Set MANPATH so it includes users' private man if it exists
# if [ -d "${HOME}/man" ]; then
#   MANPATH=${HOME}/man:${MANPATH}
# fi

# Set INFOPATH so it includes users' private info if it exists
# if [ -d "${HOME}/info" ]; then
#   INFOPATH=${HOME}/info:${INFOPATH}
# fi

if [ "$BASHHERE" != "" ]; then
    cd $( echo $BASHHERE | tr "\134" /)
fi



HISTSIZE=100000
HISTCONTROL=ignoreboth


</code>
<code php>
# base-files version 3.7-1

# To pick up the latest recommended .bashrc content,
# look in /etc/defaults/etc/skel/.bashrc

# Modifying /etc/skel/.bashrc directly will prevent
# setup from updating it.

# The copy in your home directory (~/.bashrc) is yours, please
# feel free to customise it to create a shell
# environment to your liking.  If you feel a change
# would be benificial to all, please feel free to send
# a patch to the cygwin mailing list.

# User dependent .bashrc file


# Shell Options
# #############

# See man bash for more options...

# Don't wait for job termination notification
# set -o notify

# Don't use ^D to exit
# set -o ignoreeof

# Use case-insensitive filename globbing
# shopt -s nocaseglob

# Make bash append rather than overwrite the history on disk
# shopt -s histappend

# When changing directory small typos can be ignored by bash
# for example, cd /vr/lgo/apaache would find /var/log/apache
# shopt -s cdspell


# Completion options
# ##################

# These completion tuning parameters change the default behavior of bash_completion:

# Define to access remotely checked-out files over passwordless ssh for CVS
# COMP_CVS_REMOTE=1

# Define to avoid stripping description in --option=description of './configure --help'
# COMP_CONFIGURE_HINTS=1

# Define to avoid flattening internal contents of tar files
# COMP_TAR_INTERNAL_PATHS=1

# If this shell is interactive, turn on programmable completion enhancements.
# Any completions you add in ~/.bash_completion are sourced last.
 case $- in
   *i*) [[ -f /etc/bash_completion ]] && . /etc/bash_completion ;;
 esac



# History Options
# ###############

# Don't put duplicate lines in the history.
 export HISTCONTROL="ignoredups"

# Ignore some controlling instructions
# export HISTIGNORE="[   ]*:&:bg:fg:exit"

# Whenever displaying the prompt, write the previous line to disk
# export PROMPT_COMMAND="history -a"


# Aliases
# #######

# Some example alias instructions
# If these are enabled they will be used instead of any instructions
# they may mask.  For example, alias rm='rm -i' will mask the rm
# application.  To override the alias instruction use a \ before, ie
# \rm will call the real rm not the alias.

# Interactive operation...
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'

# Default to human readable figures
 alias df='df -h'
 alias du='du -h'

# Misc :)
 alias less='less -r'                          # raw control characters
# alias whence='type -a'                        # where, of a sort
 alias grep='grep --color'                     # show differences in colour

# Some shortcuts for different directory listings
alias ls='ls -hF --color=tty'                 # classify files in colour
 alias dir='ls --color=auto --format=vertical'
 alias vdir='ls --color=auto --format=long'
 alias ll='ls -l'                              # long list
 alias la='ls -A'                              # all but . and ..
 alias l='ls -CF'                              #

# Some shortcuts by Alfonso Reyes
alias javaApps:='cd /cygdrive/f/PortableEclipse/java; pwd'
alias progs:='cd /cygdrive/f/PortableEclipse; pwd'
alias gr_mech:='cd /cygdrive/f/PortableEclipse/java/webapps/gr_mech;pwd;ls'
# editor
alias jedit='jedit.bat'
# Java
alias java='/cygdrive/c/apps/jdk/bin/java.exe'
alias javac='/cygdrive/c/apps/jdk/bin/javac.exe'
alias jar='/cygdrive/c/apps/jdk/bin/jar.exe'
alias jython='/cygdrive/c/apps/jython2.2.1/jython.bat'
alias jythonc='/cygdrive/c/apps/jython2.2.1/jythonc.bat'

CDPATH='.:~:/cygdrive/f/PortableEclipse/java/selectapps:/cygdrive/f/PortableEclipse/jython'
export CDPATH

# Functions
# #########

# Some example functions
# function settitle() { echo -ne "\e]2;$@\a\e]1;$@\a"; }

export INPUTRC=$HOME/.inputrc

</code>
<<tiddlerList tags:0>>
Added SyntaxHighlighter plugin [[syntaxhighlighterplugin]]
* Move main menu to the side
* modify tab sidebars. compress and add content tab

> adding plugin:
>> RenameTagsPlugin
> Removing plugins:
>> BigThemePlugin
>> GenerateRssByTagPlugin
>> SelectThemePlugin
>> ToggleSideBarMacro
[img[http://latex.codecogs.com/gif.latex?\begin{displaymath} I(z) = \sin( \frac{\pi}{2} z^2 ) \sum_{n=0}^\infty \frac{ (-1)^n \pi^{2n} }{1 \cdot 3 \cdots (4n + 1) } z^{4n + 1} -\cos( \frac{\pi}{2} z^2 ) \sum_{n=0}^\infty \frac{ (-1)^n \pi^{2n + 1} }{1 \cdot 3 \cdots (4n + 3) } z^{4n + 3} \end{displaymath}]]


@@font-family:"Courier,monospaced";\begin{displaymath}
I(z) = \sin( \frac{\pi}{2} z^2 ) \sum_{n=0}^\infty
    \frac{ (-1)^n \pi^{2n} }{1 \cdot 3 
    \cdots (4n + 1) } z^{4n + 1}
    -\cos( \frac{\pi}{2} z^2 ) \sum_{n=0}^\infty
    \frac{ (-1)^n \pi^{2n + 1} }{1 \cdot 3 
    \cdots (4n + 3) } z^{4n + 3}
\end{displaymath}
@@
$$
\begin {displaymath}
I(z) = \sin( \frac{\pi}{2} z^2 ) \sum_{n=0}^\infty
    \frac{ (-1)^n \pi^{2n} }{1 \cdot 3 
    \cdots (4n + 1) } z^{4n + 1}
    -\cos( \frac{\pi}{2} z^2 ) \sum_{n=0}^\infty
    \frac{ (-1)^n \pi^{2n + 1} }{1 \cdot 3 
    \cdots (4n + 3) } z^{4n + 3}
\end {displaymath}
$$
[[JDK (Java Development Kit) location]]
[[cygwin application location]]
In this [[article|Creating Java Web Start applications with Jython and OSP]] I describe a simple process to generated .jar files that can be upload in a web server to deploy powerful applications. In my case, I used [[Open Source Physics|OpenSourcePhysics]] libraries to develop Jython application that can be called and run from the web.
In order to simplify the development I wrote this [[script|~compile.sh]]. It can run in cygwin and Linux. 

!!!To-do
* Write the .jnlp script as well


When the process turns mechanical and repetitive, then it is time to use bash scripts like [[compile.sh]]:
<<tiddler compile.sh>> [[compile.sh]]

Eventually, this bash script will evolve in an [[Ant]] script that we can run from Eclipse.
<<tiddler ShowSection with: [[Who]]>> 

<<tiddler ShowSection with: [[What]]>> 

<<tiddler ShowSection with: [[Why]]>> 

<<tiddler ShowSection with: [[How]]>> 

<<tiddler ShowSection with: [[Where]]>> 

<<tiddler ShowSection with: [[When]]>> 

----

Houston, Texas 77381
LinkedIn: http://www.linkedin.com/in/alfonsorreyes
My website: http://www.linkedin.com/in/alfonsorreyes
/***
name: AllTagsExceptPlugin
author: Garrett
version: 0.1.0
This is a revision of Clint Checketts' allTagsExcept plugin, which lists all tags except those listed.

<<option chkDisableExcept>> show hidden system tags

!!Usage
{{{
<<AllTagsExcept tag1 tag2 ...>>
}}}
!!!Code
***/
/*{{{*/
version.extensions.AllTagsExcept = {major: 0, minor: 1, revision: 0};

if (!config.options.chkDisableExcept) config.options.chkDisableExcept=false; // default to standard action

config.macros.AllTagsExcept = {tooltip: "Show notes tagged with '%0'",noTags: "There are no tags to display"};

config.macros.AllTagsExcept.handler = function(place,macroName,params)
{
	var tags = store.getTags();
	var theDateList = createTiddlyElement(place,"ul");
	if(tags.length == 0)
		createTiddlyElement(theDateList,"li",null,"listTitle",this.noTags);
	for(var t=0; t<tags.length; t++)
		{
		var includeTag = true;
            	for (var p=0;p<params.length; p++) if ((tags[t][0] == params[p])&&(!config.options.chkDisableExcept)) includeTag = false;
            	if (includeTag)
			{
			var theListItem =createTiddlyElement(theDateList,"li");
			var theTag = createTiddlyButton(theListItem,tags[t][0] + " (" + tags[t][1] + ")",this.tooltip.format([tags[t][0]]),onClickTag);
			theTag.setAttribute("tag",tags[t][0]);
			}
		}
}
/*}}}*/
http://www.javalobby.org/articles/jython/

{{{
c:\apps\ApacheTomcat
}}}
<html>
<head>
<title>Lake Applet</title>
</head>

<body>
The Lake-Applet<br><br>
<applet CODE="lake.class" width="370" height="200">
<param name="image" value="sunset.gif">
</applet>
</body>
</html> 
''Java:''
<code java>
double re = reFun.evaluate(new double[] {data[i][j][0], data[i][j][1]});
</code>
''Jython:''
<code py>
re = self.reFun.evaluate([data[i][j][0], data[i][j][1]])
</code>

Kind of tough to find information about [[arrays]] in BeanShell.

This works:
//{{{
bsh% double [] rate = new double [100];
bsh% rate[50] = 123.5;
bsh% print(rate[50]);
123.5
bsh% print(rate[51]);
0.0
//}}}
which has a lot of sense because I didn't assign values yet to rate[51]. That simple!

This is another way to do it:
//{{{
bsh% rte = new double [100];
bsh % rte[50] = 184.5
184.5
bsh % print(rte[10]);
0.0

//}}}
Since Jython is relatively young in scientific development, it is difficult to get documentation on the different implementations on arrays. The libraries are there put one thing is to use them in Java and another thing in Jython.

I have been experimenting with the [[Open Source Physics]] library and found array libraries. Of course, nobody will tell you how to use them in Jython yet but only for Java.

Here is an example:
//{{{
>>> from org.opensourcephysics.numerics import DoubleArray
>>> da = DoubleArray(100)
>>> print da
{0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0, 0.00E0}
>>> 

//}}}

I am still investigating other array classes.

Create a tabbed view with one tab for every tiddler containing the tag "glossar" (using the {{{<<tabs...>>}}} macro).
{{{
<<forEachTiddler
    where
       'tiddler.tags.contains("cygwin")'

    sortBy
       'tiddler.title.toUpperCase()'

    write '" [["+tiddler.title+" ]] \"view ["+tiddler.title+"]\" [["+tiddler.title+"]] "'

        begin '"<<tabs txtMyAutoTab "'

        end '">"+">"'

        none '"//No tiddler tagged with \"glossar\"//"'
>>
}}}
<<forEachTiddler
    where
       'tiddler.tags.contains("cygwin")'

    sortBy
       'tiddler.title.toUpperCase()'

    write '" [["+tiddler.title+" ]] \"view ["+tiddler.title+"]\" [["+tiddler.title+"]] "'

        begin '"<<tabs txtMyAutoTab "'

        end '">"+">"'

        none '"//No tiddler tagged with \"glossar\"//"'
>>

//If you wonder about the trailing space in the tab titles read [[this article|http://twhelp.tiddlyspot.com/#tabs]] (Thanks to Morris Gray for this hint).//
!Equations

[img[BallsInBox_difeq.png]]

!Library
* [[Compadre Digital Library]]
/*{{{*/
/* SHORTCUTS */
[[StyleSheetShortcuts]]

/* ADJUSTMENTS TO SHORTCUTS */
.small	{ font-size:90%; line-height:120%; }
.fine	{ font-size:80%; line-height:120%; }
.tiny	{ font-size:70%; line-height:120%; }
.groupbox	{ padding:.5em; border:1px solid gray; -moz-border-radius:.5em; -webkit-border-radius:.5em; }

/* CUSTOM SHORTCUTS */
.scroll	{ display:block; overflow:auto; width:auto; max-height:8em; padding-bottom:.5em; }
.scroll ul	{ margin:0; }
.scroll li	{ white-space:nowrap; }
*[id="mainMenu"] .scroll li  /* MOZ ONLY */	{ margin-left:-2em; }

/* ADJUSTMENTS TO STANDARD ELEMENTS */
StyleSheetAdjustments

/* ADJUSTMENTS TO CUSTOM ELEMENTS */
.storyListbox	{ font-size:80%; }
.siteNav	{ position:absolute;z-index:1;right:.5em;top:2em;width:14em; }
.siteNav, .siteNav .button	{ color:#fff }
.siteNav .button:hover	{ color:#009 }
.siteNav input[type="checkbox"]	{ margin:0; }

/*}}}*/
Type the text for 'BigInteger'
!Location
 file:///home/msfz751/Programming/ejs/workspaces/ejsExamples-080117/source/_examples/Events

!Events
!! Floor
!!!Zero Condition
{{{
return y-ymin;
//if (vy<0) return y-ymin; else return TOL;
}}}
!!!Action
{{{
vy = -k*vy;
if (Math.abs(vy)<TOL) vy = 0.0;
}}}

!! Left Wall
!!!Zero Condition
{{{
if (vx<0) return  x-xmin; 
else return TOL;
}}}
!!!Action
{{{
vx = -vx;
}}}

! Right Wall
!!!Zero Condition
{{{
if (vx>0) return  xmax-x;
else return TOL;
}}}
!!!Action
{{{
vx = -vx;
}}}

	
!@@ what this applet does@@
!@@ link to applet @@
!@@ compilation @@
!@@ html file @@

Applet

To build an Applet, I used this jythonc command:
{{{
jythonc -J-g:none --core --deep --jar RandBoxes.jar RandBoxesTest.py
}}}

The applet tag looks like:
<code>
  <applet code="RandBoxesTest$RandBoxes"
         archive="RandBoxes.jar,core.jar"
         width=600 height=500>
  </applet>
</code>

External reference: Attribution
Creating bulleted lists is simple.
* Just add an asterisk
* at the beginning of a line.
** If you want to create sub-bullets
** start the line with two asterisks
*** And if you want yet another level
*** use three asterisks
* You can also do [[Numbered Lists]]
{{{
Creating bulleted lists is simple.
* Just add an asterisk
* at the beginning of a line.
** If you want to create sub-bullets
** start the line with two asterisks
*** And if you want yet another level
*** use three asterisks
* You can also do [[Numbered Lists]]
}}}
!Directory structure
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/MasteringJavaClasspath
$ tree -L 3 -P *.java
.
`-- com
    `-- web_tomorrow
        |-- CPTest1.java
        `-- CPTest2.java

2 directories, 2 files
}}}
!Compile the subclass
The concept is cd [root]/com/web_tomorrow:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/MasteringJavaClasspath
$ cd com/web_tomorrow
/cygdrive/f/PortableEclipse/osp_java_jython/MasteringJavaClasspath/com/web_tomorrow
}}}
Then compile [[CPTest1.java]] like this:
{{{
javac -classpath "" CPTest1.java
}}}

!Compile the caller class [[CPTest2.java]]
The concept is:
cd [root]
javac -classpath "." com/web_tomorrow/CPTest2.java
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/MasteringJavaClasspath/com/web_tomorrow
$ cd ../..

msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/MasteringJavaClasspath
$ javac -classpath "." com/web_tomorrow/CPTest2.java
}}}
<code java>
package com.web_tomorrow;
public class CPTest1
{
public static void main(String[] args)
  {
  System.out.println ("Run CPTest1.main()");
  }
}
</code>
<code java>
package com.web_tomorrow;
public class CPTest2
{
public static void main(String[] args)
  {
  System.out.println ("Run CPTest2.main()");
  CPTest1 cpt1 = new CPTest1();
  }
}
</code>
!Code
* [[CalculationApp.java]]
* [[CalculationApp.py]]

		
//{{{
import org.opensourcephysics.controls.*;

public class CalculationApp extends AbstractCalculation {
	public void calculate() {
		control.println("calc button pressed");
		double x= control.getDouble("x value");
		control.println("x*x = "+(x*x));
		control.println("random = "+Math.random());
	}

	public void reset() {
		control.println("reset button pressed");
		control.setValue("x value", 10.0);
	}

	public static void main(String[] args) {
		CalculationControl.createApp(new CalculationApp());
	}
}

//}}}
<code py>
from java.lang import Math
from org.opensourcephysics.controls import *


class CalculationApp(AbstractCalculation):
    def calculate(self):
        control.println("calc button pressed");
        x = self.control.getDouble("x value");
        self.control.println("x*x = " + str(x*x)) ;
        self.control.println("random = " + str(Math.random()) );

    def reset(self):
        self.control.println("reset button pressed");
        self.control.setValue("x value", 10.0);


control = CalculationControl.createApp(CalculationApp());
</code>
! Objective
We will compile a Jython class to bytecode (.class file) so it can be called from a Java application. We will use as a base the example in  the Hightower book - Chapter 11.

This is our current directory:
{{{
$ pwd
 /cygdrive/f/PortableEclipse/osp_java_jython
/compiling_java_class_ch11_hightower
}}}

!Create the Java class
Create the file [[OutputScreen.py]] which will be compiled and create a Java class. Compile with this command:
{{{
$ jythonc -d -w . OutputScreen.py
}}}
The dot indicates the creation of the Java classes in the current directory.

!Compiling
Now, let's create the Java caller [[testOutScreen.java]] and compile it with:
{{{
$ javac testOutScreen.java
}}}

!Run
We will run it with:
{{{
$ java testOutScreen
}}}

!Output
The output is:
{{{
1
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
10
11
12
}}}

!Tree structure
This is the tree:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/compiling_java_class_ch11_hightower
$ tree
.
|-- OutputScreen$_PyInner.class
|-- OutputScreen.class
|-- OutputScreen.java
|-- OutputScreen.py
|-- bin
|-- testOutScreen.class
`-- testOutScreen.java

1 directory, 6 files
}}}
[img[CeilingBounce_difeq.jpg]]
!Model
[[Ceiling Bounce Model]]

!EJS equations
<<tiddler [[Ceiling Bounce Differential Equation]]>>

!Library:
[[Compadre Digital Library ]]
The MessageArea looked with gray background and very small font.
It was necessary to remove the MessageArea definition in [[DGStyleSheet]].
!Removed:
{{{
#messageArea {
	position:absolute;
	top:0;
	left:50em;
	right: 10em;
	margin:0.3em;
	padding: 0.4em;
	border: 1px solid #999;
	background: #ddd;
	color: #014;}
#messageArea a{text-decoration: none; font-size: .75em; }
*[id='messageArea'] {position:absolute !important; z-index:99;}
.messageToolbar {padding: 0em;}
#messageArea .button {
        border: 1px solid #555;
	padding: 0.1em 0.1em 0.1em 0.1em;
	color: #014;
	background: #aaa;}
}}}
In order to make TagTreeMenu menus smaller [[TagsTreePlugin]] from:

{{{
	styles : ["h1","h2","h3","h4","h5","h6"],
}}}

{{{
	styles : ["h2","h3","h4","h5","h6","div"],
}}}

[img(34%,auto)[tooltip|http://thesmartfield.com/images/tw-modeling/ChargedParticlesElectricField3D.jpg][http://thesmartfield.com/images/tw-modeling/ChargedParticlesElectricField3D.jpg]]
[img(34%,auto)[tooltip|ChargedParticlesElectricField3D.view.jpg][ChargedParticlesElectricField3D.view.jpg0]]
[img[tooltip|ChargedParticlesElectricField3D.view.jpg][ChargedParticlesElectricField3D.view.jpg]]
!Sections
[[ChargedParticlesElectricField3D_Custom-Methods]]
[[ChargedParticlesElectricField3D_Fixed-Relations]]
{{{
public void initializeCharge() {
  if(n!=q.length){            // has number of charges changed? 
    x = new double[n];        // create arrays of proper length 
    y = new double[n];
    z = new double[n];
    q = new double[n]; 
    colors = new Color[n]; 
  }
  double r= 0.25;             // distance from center
  double theta = 0;           // angle
  double dtheta= 2*Math.PI/n; // angle increment
  for(int i=0; i<n; i++){     // set position of n particles
    x[i]=r*Math.cos(theta);   // x position
    y[i]=r*Math.sin(theta);   // y position
    z[i] = 0;
    q[i]=(i%2==1)?-1:1;       // charges alternate in sign
    colors[i]=(i%2==1)?Color.BLUE:Color.RED;  
    theta += dtheta;          // increment angle
  }
}
}}}
{{{
// electrostatic potential energy is computed at each grid point
if(n!=q.length) {
  initializeCharge();
}
for(int i=0; i<m; i++) {
  // loop over grid x
  double xi= _view.vectorField3D.indexToX(i);      // x-coordinate of grid point
  for(int j=0; j<m; j++) {
    // loop over grid y
    double yj= _view.vectorField3D.indexToY(j);    // y-x-coordinate of grid point
    for(int k=0; k<m; k++) {
      // loop over grid z
      double zk= _view.vectorField3D.indexToZ(k);    // z-y-x-coordinate of grid point
      ex[i][j][k]=ey[i][j][k]=ez[i][j][k]=0;       // zero field components
      mag[i][j][k]=0;                                 // zero magnitude
      for(int p=0; p<n; p++) {
        // loop over charges
        double dx=xi-x[p];                         // x-separation from grid point
        double dy=yj-y[p];                         // y-separation from grid point
        double dz=zk-z[p];
        double r2=dx*dx+dy*dy+dz*dz;              // charge to grid point distance squared
        double r3=r2*Math.sqrt(r2);                // charge to grid point distance cubed
        if(r2==0) continue;                         // check for singularity
        ex[i][j][k]+=q[p]*dx/r3;
        ey[i][j][k]+=q[p]*dy/r3;
        ez[i][j][k]+=q[p]*dz/r3;
      } // end of charge loop
      mag[i][j][k]=Math.sqrt(ex[i][j][k]*ex[i][j][k]+ey[i][j][k]*ey[i][j][k]+ez[i][j][k]*ez[i][j][k]);
    } // end of z loop
  } // end of y loop
} // end of x loop
}}}
!!<<view title>>
<html>
<span class="math">
\begin{eqnarray}
\omega^{(0)}&=&1  \\
\omega^{(1)}&=&\frac{\textstyle 1}{\textstyle 1-\lambda_{J}^{2}/2}  \\
\omega^{(k+1)}&=&\frac{\textstyle 1}{\textstyle 1-\lambda_{J}^{2}\omega^{(k)}/4}
  \,,\;\;k=1, \dots 
\end{eqnarray}
 </span>
</html>
!Compiling the Jython subclass
You have two options for compiling the Jython subclass. Compiling to the default folder jpywork or compiling it against the final package structure.
!!Compiling to jpywork
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/jythonpkgjava
$ jythonc -d -p examples.chap11 OutputScreen.py
}}}
!!Compiling and placing on the package structure
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/jythonpkgjava
$ jythonc -d -w "."  -p examples.chap11 OutputScreen.py
}}}
!!Jythonc output
In both cases we will obtain the following files as output:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/jythonpkgjava/jpywork
$ tree
.
`-- examples
    `-- chap11
        |-- OutputScreen$_PyInner.class
        |-- OutputScreen.class
        `-- OutputScreen.java

2 directories, 3 files
}}}
!Compiling the caller class:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/jythonpkgjava
$ javac -classpath "." examples/chap11/testOutScreen.java
}}}

!Run
Running the caller class:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/jythonpkgjava
$ java examples.chap11.testOutScreen
1
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
10
11
12

}}}
[img(34%,auto)[CobWebPlot|http://reyesaguayo.com/osp/images/CobWebPlot.jpg][http://reyesaguayo.com/osp/images/CobWebPlot.jpg]]
/***
Authors: Eric Shulman & Bradley Meck
version: 2007.30.03
source: http://www.tiddlytools.com/
***/
/*{{{*/
config.commands.collapseTiddler = {
text: "-",
tooltip: "Collapse this tiddler",
handler: function(event,src,title)
{
var e = story.findContainingTiddler(src);
if(e.getAttribute("template") != config.tiddlerTemplates[DEFAULT_EDIT_TEMPLATE]){
var t = (readOnly&&store.tiddlerExists("WebCollapsedTemplate"))?"WebCollapsedTemplate":"CollapsedTemplate";
if(e.getAttribute("template") != t ){
e.setAttribute("oldTemplate",e.getAttribute("template"));
story.displayTiddler(null,title,t);
}
}
}
}

config.commands.expandTiddler = {
text: " | ",
tooltip: "Expand this tiddler",
handler: function(event,src,title)
{
var e = story.findContainingTiddler(src);
story.displayTiddler(null,title,e.getAttribute("oldTemplate"));
}
}

config.macros.collapseAll = {
handler: function(place,macroName,params,wikifier,paramString,tiddler){
createTiddlyButton(place,"-","Collapse all tiddlers",function(){
story.forEachTiddler(function(title,tiddler){
if(tiddler.getAttribute("template") != config.tiddlerTemplates[DEFAULT_EDIT_TEMPLATE])
var t = (readOnly&&store.tiddlerExists("WebCollapsedTemplate"))?"WebCollapsedTemplate":"CollapsedTemplate";
story.displayTiddler(null,title,t);
})})
}
}

config.macros.expandAll = {
handler: function(place,macroName,params,wikifier,paramString,tiddler){
createTiddlyButton(place,"expand all","Expand all tiddlers",function(){
story.forEachTiddler(function(title,tiddler){
var t = (readOnly&&store.tiddlerExists("WebCollapsedTemplate"))?"WebCollapsedTemplate":"CollapsedTemplate";
if(tiddler.getAttribute("template") == t) story.displayTiddler(null,title,tiddler.getAttribute("oldTemplate"));
})})
}
}

config.commands.collapseOthers = {
text: "Ø",
tooltip: "Expand this tiddler and collapse all others",
handler: function(event,src,title)
{
var e = story.findContainingTiddler(src);
story.forEachTiddler(function(title,tiddler){
if(tiddler.getAttribute("template") != config.tiddlerTemplates[DEFAULT_EDIT_TEMPLATE]){
var t = (readOnly&&store.tiddlerExists("WebCollapsedTemplate"))?"WebCollapsedTemplate":"CollapsedTemplate";
if (e==tiddler) t=e.getAttribute("oldTemplate");
//////////
// ELS 2006.02.22 - removed this line.  if t==null, then the *current* view template, not the default "ViewTemplate", will be used.
// if (!t||!t.length) t=!readOnly?"ViewTemplate":"WebViewTemplate";
//////////
story.displayTiddler(null,title,t);
}
})
}
}
/*}}}*/
<div>
<span class='toolbar' macro='toolbar +editTiddler expandTiddler collapseOthers closeOthers -closeTiddler'></span>
<span class='title' macro='view title'></span>
</div>

''Location:'' file:///home/msfz751/Programming/ejs/workspaces/ejs-examples/source/_examples/Elements/3D

!!!![[Launch Cone|http://thesmartfield.com/tw/modeling/jws/ejs_cone.jnlp]]
!!@@[[Launch Cone|http://www.thesmartfield.com/tw/modeling/jws/cone.jnlp]]@@
><<tiddler [[cone.jpg]]>>

!Equations
<<tiddler [[radial velocity]]>>
<<tiddler [[radial acceleration]]>>
<<tiddler [[Effective Potential Energy]]>>
<<tiddler [[angular velocity of particle]]>>

!EHS Methods
*[[cone.Initialization.Greek]]

!Libraries
*[[ehu_mechanics.jar]]

!Illustrations
*[[cone-eq.jpeg]]
!Plugins installed
*[[InlineJavascriptPlugin]]
**used for the [[DisplayControl]] and other scripts.
**and for [[HideTags]]
*[[Plugin: jsMath]]
** this processes the [[LaTeX]].  The AJAX part had problems, so I put the jsmath load into the source directly.
** added custom LaTeX/jsmath command abbreviations into plugin from Garret Lizi DG tiddlywiki.
*[[CollapsePlugin]] 
**[[CollapsedTemplate]]

*[[AllTagsExceptPlugin]]
**check to see system tags
*[[CopyTiddlerPlugin]]
** duplicates tiddlers
** updated to latest revision
*[[DisableWikiLinksPlugin]] 
**remove checkbox so it's always on
**this is very tricky in combination with [[jsMathPlugin]] and \ss pytw problem
*[[ReferencesPlugin]] -- places reference tiddlers on the bottom
** updated to latest revision
*[[RecentPlugin]]
**set to show last 2 updated tiddlers
*[[zzConfig]]
** custom configuration file
** sets user name, 
** makes backup folder permanent to it doesn't go around saving files in main folder
** defines a minimum length for a tiddler before calling it empty
** creates a browser window title with customized content
** modifies label for //more// and //less// toolbar commands

!Plugins removed from original [[DG]]
*[[RearrangeTiddlersPlugin]] -- disabled for now. Cannot select tiddler titles
*[[ListTaggedPlugin]] -- removed because tiddlerList macro gives more functionality
**used for folder/tag listings

! Content tables
**[[SiteTitle]]
**[[SiteSubtitle]]
**[[SiteUrl]]
**[[DefaultTiddlers]]
**[[MainMenu]]
**[[SideBarOptions]]
**[[OptionsPanel]]
***[[SideBarOptionsText]]
**[[AdvancedOptions]]
**[[SideBarTabs]]
***[[TabContents]]
***[[TabTimeline]]
***[[TabAll]] 
***[[TabTags]]
**[[DisplayControl]]

! CSS layout templates:
**[[PageTemplate]]
**[[ViewTemplate]]
**[[EditTemplate]]
**[[CollapsedTemplate]]
*And these change the system and css options:
**[[SystemConfig]]
**[[StyleSheet]]
**[[StyleSheetPrint]]
*[[StyleSheetLayout]]
*[[StyleSheetColors]]

!Evil raw html/javascript TW source code tweakage

*Insert this just after body. (This starts jsmath)
**{{{<script src="jsMath/jsMath.js"></script>}}}

!edited jsMath.js
*changed cookie default font scaling to {{{scale: 110}}} and {{{warn: 0}}}

!Continuity Equation
Replacing Darcy's Law ''//q//'' in the mass balance equation:

[img[http://latex.codecogs.com/gif.latex?\frac{\partial }{\partial r} (\frac{2 \pi r k h}{\mu} \: \rho \: \frac{\partial p}{\partial r}) = 2 \pi r h \phi \: \frac{\partial \rho}{\partial t}]]

$$
\frac{\partial }{\partial r} (\frac{2 \pi r k h}{\mu} \: \rho \: \frac{\partial p}{\partial r}) = 2 \pi r h \phi \: \frac{\partial \rho}{\partial t}
$$

Finally, we obtain:

[img[http://latex.codecogs.com/gif.latex?\frac{1}{r} \frac{\partial }{\partial r} (\frac{ k \rho }{\mu} \: r \frac{\partial p}{\partial r}) = \phi \: \frac{\partial \rho}{\partial t}]]
!Examples:
{{{
axis = ((ControlElement3D) _view.getElement("Axis")).getElement();
armBasis = ((ControlElement3D) _view.getElement("ArmBasis")).getElement();
arm = ((ControlElement3D) _view.getElement("Arm")).getElement();
pendulum = ((ControlElement3D) _view.getElement("Pendulum")).getElement();
}}}
The variables axis, armBasis, arm and pendulum are created as Objects in the Variables section.

!Import
[[org.colos.ejs.library.control.display3d.*]]
!Location:
file:/home/msfz751/Programming/ejs/workspaces/ejs_demo/source/ModelingScience/Ch05_ODE

!EJS Methods
*[[CoolingCoffee_Fixed-Relations]]
*[[CoolingCoffee_Evolution]]

!EJS objects
*[[Trace ]]
{{{
t += dt; // Increment the time
if (t>=tMax) _pause(); // Stop if maximum time is exceeded
}}}
{{{
T = Tr + (T0-Tr)*Math.exp(-k*t); // Closed-form solution
}}}
/***
|Name|CopyTiddlerPlugin|
|Source|http://www.TiddlyTools.com/#CopyTiddlerPlugin|
|Version|3.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br> and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Quickly create a copy of any existing tiddler|

!!!!!Usage
<<<
View a tiddler and select the "copy" toolbar item.  A new tiddler editor is opened with a title of "Copy of TiddlerName" containing copies of the text/tags from the original tiddler.  Note: If select the "copy" toolbar item while //editing// a tiddler, the current values of the text/tags that are displayed in the existing tiddler editor are used (including any unsaved changes you may have made to those values).
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''CopyTiddlerPlugin'' (tagged with <<tag systemConfig>>)

* When using the default (shadow) EditTemplate, the plugin automatically updates the template to include the ''copyTiddler'' toolbar command.
* If you have created a custom EditTemplate tiddler, you will need to manually add the ''copyTiddler'' toolbar command to your existing template toolbar definition.
* If you add ''copyTiddler'' to the ViewTemplate toolbar definition, the ''copy'' toolbar command will also appear when viewing a tiddler.
{{{
<!-- add 'copyTiddler' command to existing toolbar definition -->
<div class='toolbar' macro='toolbar ... copyTiddler ... '>
}}}
<<<
!!!!!Revisions
<<<
''2007.06.28 [3.0.0]'' complete re-write to handle custom fields and alternative view/edit templates
''2007.05.17 [2.1.2]'' use store.getTiddlerText() to retrieve tiddler content, so that SHADOW tiddlers can be copied correctly when in VIEW mode
''2007.04.01 [2.1.1]'' in copyTiddler.handler(), fix check for editor fields by ensuring that found field actually has edit=="text" attribute
''2007.02.05 [2.1.0]'' in copyTiddler.handler(), if editor fields (textfield and/or tagsfield) can't be found (i.e., tiddler is in VIEW mode, not EDIT mode), then get text/tags values from stored tiddler instead of active editor fields.  Allows use of COPY toolbar directly from VIEW mode (based on a request from LaurentCharles)
''2006.12.12 [2.0.0]'' completely rewritten so plugin just creates a new tiddler EDITOR with a copy of the current tiddler EDITOR contents, instead of creating the new tiddler in the STORE by copying the current tiddler values from the STORE.
''2005.xx.xx [1.0.0]'' original version by Tim Morgan
<<<
!!!!!Credits
>This feature was originally developed by Tim Morgan.  Current version developed by EricShulman from [[ELS Design Studios|http://www.elsdesign.com]]
!!!!!Code
***/
//{{{
version.extensions.copyTiddler= {major: 3, minor: 0, revision: 0, date: new Date(2007,6,28)};

// automatically tweak shadow EditTemplate to add "copyTiddler" toolbar command (following "cancelTiddler")
config.shadowTiddlers.EditTemplate=config.shadowTiddlers.EditTemplate.replace(/cancelTiddler/,"cancelTiddler copyTiddler");

config.commands.copyTiddler = {
	text: 'copy',
	hideReadOnly: true,
	tooltip: 'Make a copy of this tiddler',
	prefix: "Copy of ",
	handler: function(event,src,title) {
		var tiddlerElem=document.getElementById(story.idPrefix+title); // current tiddler element
		var template=tiddlerElem.getAttribute("template") // current tiddler template
		var newTitle = this.prefix+title; // add "copy of" to create new tiddler title
		if (!story.isDirty(title)) { // if existing tiddler is being VIEWED (not EDITED)
			// duplicate existing stored tiddler (and clear "changecount")
			var tid=store.getTiddler(title);
//wikify(tid.tags,place);
	                store.saveTiddler(newTitle,newTitle,tid.text,config.options.txtUserName,new Date(),tid.tags, tid.fields, true);
			// display new tiddler using same view template as current tiddler
			story.displayTiddler(story.findContainingTiddler(src),newTitle,template);
		} else {
			// display new tiddler editor using same editor template as current tiddler
			story.displayTiddler(story.findContainingTiddler(src),newTitle,template);
			// get fields from current tiddler editor
			var fields=config.commands.copyTiddler.gatherFields(tiddlerElem);
			// set fields in new editor
			var newTiddlerElem = document.getElementById(story.idPrefix+newTitle);
			for (var f=0; f<fields.length; f++) { 
				if (fields[f].name=="title") fields[f].value=newTitle; // rename title in new tiddler
				var fieldElem=config.commands.copyTiddler.findField(newTiddlerElem,fields[f].name);
				if (fieldElem) {
					if (fieldElem.getAttribute("type")=="checkbox")
						fieldElem.checked=fields[f].value;
					else 
						fieldElem.value=fields[f].value;
				}
			}
		}
		story.focusTiddler(newTitle,"title");
		return false;
	},
	findField: function(tiddlerElem,field) {
		var inputs=tiddlerElem.getElementsByTagName("input");
		for (var i=0; i<inputs.length; i++) {
			if (inputs[i].getAttribute("type")=="checkbox" && inputs[i].field == field) return inputs[i];
			if (inputs[i].getAttribute("type")=="text" && inputs[i].getAttribute("edit") == field) return inputs[i];
		}
		var tas=tiddlerElem.getElementsByTagName("textarea");
		for (var i=0; i<tas.length; i++) if (tas[i].getAttribute("edit") == field) return tas[i];
		var sels=tiddlerElem.getElementsByTagName("select");
		for (var i=0; i<sels.length; i++) if (sels[i].getAttribute("edit") == field) return sels[i];
		return null;
	},
	gatherFields: function(tiddlerElem) { // get field names and values from current tiddler editor
		var fields=[];
		// get checkboxes and edit fields
		var inputs=tiddlerElem.getElementsByTagName("input");
		for (var i=0; i<inputs.length; i++) {
			if (inputs[i].getAttribute("type")=="checkbox")
				if (inputs[i].field) fields.push({name:inputs[i].field,value:inputs[i].checked});
			if (inputs[i].getAttribute("type")=="text")
				if (inputs[i].getAttribute("edit")) fields.push({name:inputs[i].getAttribute("edit"),value:inputs[i].value});
		}
		// get textareas (multi-line edit fields)
		var tas=tiddlerElem.getElementsByTagName("textarea");
		for (var i=0; i<tas.length; i++)
			if (tas[i].getAttribute("edit")) fields.push({name:tas[i].getAttribute("edit"),value:tas[i].value});
		// get selection lists (droplist or listbox)
		var sels=tiddlerElem.getElementsByTagName("select");
		for (var i=0; i<sels.length; i++)
			if (sels[i].getAttribute("edit")) fields.push({name:sels[i].getAttribute("edit"),value:sels[i].value});
		return fields;
	}
};
//}}}
/***
The StyleSheet holds the custom style modifications.  It augments  and overrides the hidden default pages.
***/

/*{{{*/
body {background:#ddd;
        position: static;
	font-size: .75em;
	font-family: arial,helvetica;}
.header {height: 5.8em;}
.headerShadow {
	padding: 2em 1em 1em 20em;
	left: 1px;
	top: 1px;}
.headerForeground {
	padding: 2em 1em 1em 20em;
	color: #ddd}
.siteTitle {font-size: 2.5em;}
.siteSubtitle {font-size: 1em;}
#displayControl {
	position:absolute;
	top:0;
	left:0;
	margin:0em;
	padding: 0em;
	background: #ddd;}
#displayControl a{text-decoration: none; font-size: 1em; color: #04b;}
#sidebar {
	font-size: 1em;
	left: 0em;
	width: 19em;
	overflow: hidden;}
#mainMenu {
	position: relative;
	width: 17em;
	margin: .5em 0em 0em .5em;
	padding: 0.3em .5em 0.3em .5em;
	text-align: left;
	line-height: 1.4em;
	font-size: 1em;
	border-bottom:1px solid #bbb;
	border-right:1px solid #bbb;
	background:#eee;}
#sidebarOptions {
	width: 17.5em;
	margin: .5em .5em 0em .5em;
	padding: 0.3em 0em 0.3em 0.4em;
        overflow: hidden;
	font-size: 1em;
	border-bottom:1px solid #bbb;
	border-right:1px solid #bbb;
	background:#eee;}
#sidebarOptions a {
	margin: 0em 0em;
	padding: 0.15em .3em;
	font-size: 1.1em;
	display: inline;}
#sidebarOptions input {
	margin: 0em 0.1em;
	width: 7.5em;
	font-size: 1em;
	padding: 0.2em 0.2em;
	border: 1px solid #888;}
#sidebarOptions .button {border: 1px solid #eee;}
#sidebarOptions .button:hover {
	color: #014;
	background: #fe8;
	border: 1px solid #db4;}
#sidebarOptions .sliderPanel {
	margin-top: .5em;
	margin-right: 1em;
	margin-bottom: .5em;
	margin-left: .5em;
	font-size: 1em;
	padding: 1em;
	background: #aaa;}
#sidebarOptions .sliderPanel a {
	display: inline;}
#sidebarOptions .sliderPanel input {
	width: 1em;
	font-size: 1em;}
#sidebar .inputFix input{width: 8em;}
#sidebarTabs {
	width: 16em;
	margin: .5em .5em 1em .5em;
	font-size: 1em;}
#sidebarTabs .tabset {padding: .3em 0em 0em 0em;}
#sidebarTabs .tab {margin: .5em 0em 0em 0.5em;
	padding: 2px;
	border-top: 1px solid #ddd;
	border-left: 1px solid #ddd;
	border-right:1px solid #bbb;}
#sidebarTabs .tabContents {
	width: 18em;
	margin: 0em 0em 0em 0em;
	padding: .25em 0em .25em 0em;
	border-top: none;
	border-left: none;
	border-bottom:1px solid #bbb;
	border-right:1px solid #bbb;
	overflow: hidden;}
#sidebarTabs .tabContents ul{
	margin-left: .65em;
	overflow: hidden;}
.popup {
	background: #fe8;
	border: 1px solid #db4;}
.popup hr {
	color: #db4;
	background: #db4;
	border-bottom: 1px;}
.popup li.disabled {
	color: #db4;}
.popup li a, .popup li a:visited {
	color: #04b;
	border: none;}
.popup li a:hover {
	background: #04b;
	color: #fe8;
	border: none;}
#displayArea {
	margin-left: 18.5em;
	margin-right: 0em;
	margin-top: 0em;
	padding-top: 0em;
	padding-bottom: .25em;}
.toolbar {
	float: right;
	font-size: 1em;}
.tiddler {
	border-bottom: 1px solid #bbb;
	border-right: 1px solid #bbb;
	margin: .5em .5em .5em .75em;
	padding-bottom: .5em;
	padding-top: .75em;
	background-color: white;}
.shadow .title {
	color: #000; background: #fff;}
.title {
	font-size: 1.75em;
        background: #fff;
	color: #000;}
h1,h2,h3,h4,h5,h6 {
	padding-left: 0em;
	padding-top: 0em;
	padding-bottom: 0em;
	margin-top: .5em;
	margin-bottom: .1em;
	color: #000;
	background: transparent;}
h1 {font-size: 1.2em;}
h2 {font-size: 1.15em;}
h3 {font-size: 1.1em;}
h4 {font-size: 1.05em;}
h5 {font-size: 1em;}
h6 {font-size: 0.8em;}
.subtitle {
	font-size: .8em;
	padding-right: 1em;
        padding-left: 3em;
        padding-top: 0em;
        margin-bottom: 0.25em;
	color: #888;}
/*      ie fix?                                                                              */
.viewer {
       line-height: 120%;
       font-size: 1.25em;}
.viewer .listTitle {list-style-type:none; margin-left:-2em; background-color:white;}
.viewer ul, .viewer ol {
	margin-left: 0.5em;
	margin-top: 0em;
	margin-bottom: 0em;
	padding-left: 1.5em;}
.viewer pre {overflow: visible;}
.viewer hr {
	border: 0;
	border-top: solid 1px #666;}
.editorFooter .button {padding-top: 0px; padding-bottom: 0px;}

/*}}}*/
Existing [[Tags]] and tiddler population:
<<tiddlerList tags:"-folder,-plugin,-system,-systemConfig,-systemTiddlers,-template">>
<!--{{{-->
<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>
<!--}}}-->
<<forEachTiddler
  where 
       'tiddler.tags.contains(context.inTiddler.title)'
  write 
     ' "<<slider chkSlider"+tiddler.title + " " 
     + tiddler.title + " " + tiddler.title + "» "+ tiddler.text[0]+ "$))" 
     + "[[o|"+tiddler.title+"]] \n" ' >>
/***
|Name:|zzConfig|
|Version:|1.0|
|Customized by:|Alfonso Reyes|
|CoreVersion:|2.4.3|
|Description|Hard code cookies & modify shadow tiddlers|
***/
{{{
config.options.txtUserName="Alfonso Reyes";
config.options.txtBackupFolder="backup"; // this will avoid saving in root TW folder
config.views.editor.defaultText = "";   // don't need message when creating a new tiddler
config.options.chkSaveBackups=true;  // true:will save backups indicated by ".txtBackupFolder"
config.options.chkAutoSave=false;  // true: will auto save this tiddlywiki when a change occurs
config.options.chkInsertTabs = true;    // tab inserts a tab when editing a tiddler
// Modify Shadow Tiddler Site Information
merge(config.shadowTiddlers,{
	SiteTitle: "Modeling & Simulations",
	SiteSubtitle: "beta - for petroleum production engineering",
	SiteUrl: "",
	WindowTitle: "<script>return config.options.txtUserName</script>'s Petroleum Eng. Modeling and Simulations <html><a href='javascript:;' onclick='story.closeAllTiddlers();restart();'>Notebook</a></html> v<<version>> - Last Modified: <script>document.write(document.lastModified);</script>",
	});
}}}
/***
|Name|CopyTiddlerPlugin|
|Source|http://www.TiddlyTools.com/#CopyTiddlerPlugin|
|Version|3.2.5|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.3|
|Type|plugin|
|Requires||
|Overrides||
|Description|Quickly create a copy of any existing tiddler|
!!!Usage
<<<
The plugin automatically updates the default (shadow) ToolbarCommands definitions to insert the ''copyTiddler'' command, which will appear as ''copy'' when a tiddler is rendered.  If you are already using customized toolbar definitions, you will need to manually add the ''copyTiddler'' toolbar command to your existing ToolbarCommands tiddler, e.g.:
{{{
|EditToolbar|... copyTiddler ... |
}}}
When the ''copy'' command is selected, a new tiddler is created containing an exact copy of the current text/tags/fields, using a title of "{{{TiddlerName (n)}}}", where ''(n)'' is the next available number (starting with 1, of course).  If you copy while //editing// a tiddler, the current values displayed in the editor are used (including any changes you may have already made to those values), and the new tiddler is immediately opened for editing.

The plugin also provides a macro that allows you to embed a ''copy'' command directly in specific tiddler content:
{{{
<<copyTiddler TidderName label:"..." prompt:"...">>
}}}
where
* ''TiddlerName'' (optional)<br>specifies the //source// tiddler to be copied.  If omitted, the current containing tiddler (if any) will be copied.
* ''label:"..."'' (optional)<br>specifies text to use for the embedded link (default="copy TiddlerName")
* ''prompt:"..."'' (optional)<br>specifies mouseover 'tooltip' help text for link
//Note: to use non-default label/prompt values with the current containing tiddler, use "" for the TiddlerName//
<<<
!!!Configuration
<<<
<<option chkCopyTiddlerDate>> use date/time from existing tiddler (otherwise, use current date/time)
{{{<<option chkCopyTiddlerDate>>}}}
<<<
!!!Revisions
<<<
2009.06.08 [3.2.5] added option to use timestamp from source tiddler
2009.03.09 [3.2.4] fixed IE-specific syntax error
2009.03.02 [3.2.3] refactored code (again) to restore use of config.commands.copyTiddler.* custom settings
2009.02.13 [3.2.2] in click(), fix calls to displayTiddler() to use current tiddlerElem and use getTiddlerText() to permit copying of shadow tiddler content
2009.01.30 [3.2.1] fixed handling for copying field values when in edit mode
2009.01.23 [3.2.0] refactored code and added {{{<<copyTiddler TiddlerName>>}}} macro
2008.12.18 [3.1.4] corrected code for finding next (n) value when 'sparse' handling is in effect (thanks to RussThomas for identifying and diagnosing the problem)
2008.11.14 [3.1.3] added optional 'sparse' setting (avoids 'filling in' missing numbers that may have been previously deleted)
2008.11.14 [3.1.2] added optional 'zeroPad' setting
2008.11.14 [3.1.1] moved hard-coded '(n)' regex into 'suffixPattern' object property so it can be customized
2008.09.26 [3.1.0] changed new title generation to use '(n)' suffix instead of 'Copy of' prefix
2008.05.20 [3.0.3] in handler, when copying from VIEW mode, create duplicate array from existing tags array before saving new tiddler.
2007.12.19 [3.0.2] in handler, when copying from VIEW mode, duplicate custom fields before saving new tiddler. Thanks to bug report from Ken Girard.
2007.09.26 [3.0.1] in handler, use findContainingTiddler(src) to get tiddlerElem (and title).  Allows 'copy' command to find correct tiddler when transcluded using {{{<<tiddler>>}}} macro or enhanced toolbar inclusion (see [[CoreTweaks]])
2007.06.28 [3.0.0] complete re-write to handle custom fields and alternative view/edit templates
2007.05.17 [2.1.2] use store.getTiddlerText() to retrieve tiddler content, so that SHADOW tiddlers can be copied correctly when in VIEW mode
2007.04.01 [2.1.1] in copyTiddler.handler(), fix check for editor fields by ensuring that found field actually has edit=='text' attribute
2007.02.05 [2.1.0] in copyTiddler.handler(), if editor fields (textfield and/or tagsfield) can't be found (i.e., tiddler is in VIEW mode, not EDIT mode), then get text/tags values from stored tiddler instead of active editor fields.  Allows use of COPY toolbar directly from VIEW mode (based on a request from LaurentCharles)
2006.12.12 [2.0.0] completely rewritten so plugin just creates a new tiddler EDITOR with a copy of the current tiddler EDITOR contents, instead of creating the new tiddler in the STORE by copying the current tiddler values from the STORE.
2005.xx.xx [1.0.0] original version by Tim Morgan
<<<
!!!Code
***/
//{{{
version.extensions.CopyTiddlerPlugin= {major: 3, minor: 2, revision: 5, date: new Date(2009,6,8)};

// automatically tweak shadow EditTemplate to add 'copyTiddler' toolbar command (following 'cancelTiddler')
config.shadowTiddlers.ToolbarCommands=config.shadowTiddlers.ToolbarCommands.replace(/cancelTiddler/,'cancelTiddler copyTiddler');

if (config.options.chkCopyTiddlerDate===undefined) config.options.chkCopyTiddlerDate=false;

config.commands.copyTiddler = {
	text: 'copy',
	hideReadOnly: true,
	tooltip: 'Make a copy of this tiddler',
	notitle: 'this tiddler',
	prefix: '',
	suffixText: ' (%0)',
	suffixPattern: / \(([0-9]+)\)$/,
	zeroPad: 0,
	sparse: false,
	handler: function(event,src,title)
		{ return config.commands.copyTiddler.click(src,event); },
	click: function(here,ev) {
		var tiddlerElem=story.findContainingTiddler(here);
		var template=tiddlerElem?tiddlerElem.getAttribute('template'):null;
		var title=here.getAttribute('from');
		if (!title || !title.length) {
			if (!tiddlerElem) return false;
			else title=tiddlerElem.getAttribute('tiddler');
		}
		var root=title.replace(this.suffixPattern,''); // title without suffix
		// find last matching title
		var last=title;
		if (this.sparse) { // don't fill-in holes... really find LAST matching title
			var tids=store.getTiddlers('title','excludeLists');
			for (var t=0; t<tids.length; t++) if (tids[t].title.startsWith(root)) last=tids[t].title;
		}
		// get next number (increment from last matching title)
		var n=1; var match=this.suffixPattern.exec(last); if (match) n=parseInt(match[1])+1;
		var newTitle=this.prefix+root+this.suffixText.format([String.zeroPad(n,this.zeroPad)]);
		// if not sparse mode, find the next hole to fill in...
		while (store.tiddlerExists(newTitle)||document.getElementById(story.idPrefix+newTitle))
			{ n++; newTitle=this.prefix+root+this.suffixText.format([String.zeroPad(n,this.zeroPad)]); }
		if (!story.isDirty(title)) { // if tiddler is not being EDITED
			// duplicate stored tiddler (if any)
			var text=store.getTiddlerText(title,'');
			var who=config.options.txtUserName;
			var when=new Date();
			var newtags=[]; var newfields={};
			var tid=store.getTiddler(title); if (tid) {
				if (config.options.chkCopyTiddlerDate) var when=tid.modified;
				for (var t=0; t<tid.tags.length; t++) newtags.push(tid.tags[t]);
				store.forEachField(tid,function(t,f,v){newfields[f]=v;},true);
			}
	                store.saveTiddler(newTitle,newTitle,text,who,when,newtags,newfields,true);
			story.displayTiddler(tiddlerElem,newTitle,template);
		} else {
			story.displayTiddler(tiddlerElem,newTitle,template);
			var fields=config.commands.copyTiddler.gatherFields(tiddlerElem); // get current editor fields
			var newTiddlerElem=document.getElementById(story.idPrefix+newTitle);
			for (var f=0; f<fields.length; f++) {  // set fields in new editor
				if (fields[f].name=='title') fields[f].value=newTitle; // rename title in new tiddler
				var fieldElem=config.commands.copyTiddler.findField(newTiddlerElem,fields[f].name);
				if (fieldElem) {
					if (fieldElem.getAttribute('type')=='checkbox')
						fieldElem.checked=fields[f].value;
					else 
						fieldElem.value=fields[f].value;
				}
			}
		}
		story.focusTiddler(newTitle,'title');
		return false;
	},
	findField: function(tiddlerElem,field) {
		var inputs=tiddlerElem.getElementsByTagName('input');
		for (var i=0; i<inputs.length; i++) {
			if (inputs[i].getAttribute('type')=='checkbox' && inputs[i].field == field) return inputs[i];
			if (inputs[i].getAttribute('type')=='text' && inputs[i].getAttribute('edit') == field) return inputs[i];
		}
		var tas=tiddlerElem.getElementsByTagName('textarea');
		for (var i=0; i<tas.length; i++) if (tas[i].getAttribute('edit') == field) return tas[i];
		var sels=tiddlerElem.getElementsByTagName('select');
		for (var i=0; i<sels.length; i++) if (sels[i].getAttribute('edit') == field) return sels[i];
		return null;
	},
	gatherFields: function(tiddlerElem) { // get field names and values from current tiddler editor
		var fields=[];
		// get checkboxes and edit fields
		var inputs=tiddlerElem.getElementsByTagName('input');
		for (var i=0; i<inputs.length; i++) {
			if (inputs[i].getAttribute('type')=='checkbox')
				if (inputs[i].field) fields.push({name:inputs[i].field,value:inputs[i].checked});
			if (inputs[i].getAttribute('type')=='text')
				if (inputs[i].getAttribute('edit')) fields.push({name:inputs[i].getAttribute('edit'),value:inputs[i].value});
		}
		// get textareas (multi-line edit fields)
		var tas=tiddlerElem.getElementsByTagName('textarea');
		for (var i=0; i<tas.length; i++)
			if (tas[i].getAttribute('edit')) fields.push({name:tas[i].getAttribute('edit'),value:tas[i].value});
		// get selection lists (droplist or listbox)
		var sels=tiddlerElem.getElementsByTagName('select');
		for (var i=0; i<sels.length; i++)
			if (sels[i].getAttribute('edit')) fields.push({name:sels[i].getAttribute('edit'),value:sels[i].value});
		return fields;
	}
};
//}}}
// // MACRO DEFINITION
//{{{
config.macros.copyTiddler = {
	label: 'copy',
	prompt: 'Make a copy of %0',
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var title=params.shift();
		params=paramString.parseParams('anon',null,true,false,false);
		var label	=getParam(params,'label',this.label+(title?' '+title:''));
		var prompt	=getParam(params,'prompt',this.prompt).format([title||this.notitle]);
		var b=createTiddlyButton(place,label,prompt,
			function(ev){return config.commands.copyTiddler.click(this,ev)});
		b.setAttribute('from',title||'');
	}
};
//}}}
[img[http://latex.codecogs.com/gif.latex?\begin{displaymath} \mathop{\mathrm{corr}}(X,Y)= \frac{\displaystyle \sum_{i=1}^n(x_i-\overline x) (y_i-\overline y)} {\displaystyle\biggl%5B \sum_{i=1}^n(x_i-\overline x)^2 \sum_{i=1}^n(y_i-\overline y)^2 \biggr%5D^{1/2}} \end{displaymath}]]

@@font-family:"Courier,monospaced";\begin{displaymath}
\mathop{\mathrm{corr}}(X,Y)=
\frac{\displaystyle
\sum_{i=1}^n(x_i-\overline x)
(y_i-\overline y)}
{\displaystyle\biggl[
\sum_{i=1}^n(x_i-\overline x)^2
\sum_{i=1}^n(y_i-\overline y)^2
\biggr]^{1/2}}
\end{displaymath}
@@

!Create a work directory

!Run the jython file [[Scribble.py]]:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/workspace/workspace_JavaWebStart/ownScribble
$ jython Scribble.py
}}}
[[Here|Scribble.py]] is the source code.

!Copy the Jython JNLP working structure

!Copy the .py file to the working folder

!Compile with jythonc

!Create the manifest indicating the main class to run
Add the following line:
{{{
Main-Class: Scribble
}}}

!Package the working folder with JAR
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/workspace/workspace_JavaWebStart/ownScribble
$ jar cmvf META-INF/MANIFEST.MF ../Scribble.jar .
}}}
Don't forget the dot at the end of the line. It means "pack what is here".

!Test if the executable .jar file runs
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/workspace/workspace_JavaWebStart/ownScribble
$ java -jar ../Scribble.jar
}}}

!Copy the .jar file and .jnlp file to the web server
Using any text editor create the JWS or .jnlp file. It should look like this: 
<<tiddler SurfaceArrayApp.jnlp>> [[SurfaceArrayApp.jnlp]]

I used my web server ''reyesaguayo.com'' but you can use your own local drive or a local host. Run the WebStart application here http://www.reyesaguayo.com/osp/jws/SurfaceArrayApp.jnlp
@@IMPORTANT@@
The key fields in the .jnlp file are <codebase>, <j2se version>, <jar href> and <application-desc main-class>. Be very careful when you type in these values. 
# Create a folder that will be used as the the new workspace folder.
# Copy a [[OSP]] folder structure under the new workspace folder. Let's do this in case we decide to modify any of the files in the [[OSP]] library.
# In Eclipse, browse to directory and select
# Create a new project called ''osp'' and import from the folder in step 2.
# Create another new project and indicate that you want separate output folder (/bin)

!Create a work directory and copy the Jython and Java files
We will place the Jython ''.py'' files under the @@work@@ directory folder -we will call it the @@code@@ folder. Its parent folder is jython_osp.

<html><a href="http://reyesaguayo.com/osp/images/folder_structure01.png" target="_blank" title="Folder Structure"><img src="http://reyesaguayo.com/osp/images/folder_structure01.png" width="240" height="160" alt="folder structure" /></a></html>

This is the Jython code [[SurfaceArrayApp.py]] I translated to Jython and this is the original Java source code [[SurfaceArrayApp.java]] from Open Source Physics.

We will start using [[cygwin]] for more commands. Here we show the tree after copying the source files:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/jython_osp
$ tree
.
`-- code
    |
    `-- SurfaceArrayApp.py

1 directory, 2 files
}}}

!!Test the Jython file. It will fail. Why?
Because it doesn't have a physical library available. I have chosen not to used CLASSPATH to make the build autonomous. It's a way of checking that if it doesn't work at local or PC level it won't work either at web or host level. It is important that we disable the CLASSPATH and other executables that reside usually in PATH. I have customized my [[cygwin environment]] so it gives me direct access to jython.bat, jythonc.bat, java.exe, jar.exe and other applications.

This is the command to run the Jython application and its error message:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/jython_osp/code
$ jython SurfaceArrayApp.py
Traceback (innermost last):
  File "SurfaceArrayApp.py", line 2, in ?
ImportError: no module named opensourcephysics
}}}
See? The Jython application doesn't find the [[OpenSourcePhysics]] library. We will give a solution to this in a second.
/%----------------------------------------------------------------------------%/
!Get and copy the osp.jar to the code directory.
Get the osp.jar file from the OpenSourcePhysics website at http://www.opensourcephysics.org/binary/osp.jar and copy it to your ''code'' folder.

Let's see the tree again:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/jython_osp
$ tree
.
`-- code
    |-- SurfaceArrayApp.java
    |-- SurfaceArrayApp.py
    `-- osp.jar

1 directory, 3 files
}}}
/%----------------------------------------------------------------------------%/
![[Unpack the osp.jar library]]
<<tiddler "Unpack the osp.jar library">>
/%----------------------------------------------------------------------------%/
!Now, test the Jython application again. It will work!
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/jython_osp/code
$ jython SurfaceArrayApp.py
}}}

This is the plot generated by the application. Note: You will see also a bunch of numbers in the console; those are the matrix components.
<<tiddler SurfaceArrayApp.jpg>>

Close it. Next step is to create the Java class files with jythonc that we will use to create the combined OSP/Jython .jar library.
/%----------------------------------------------------------------------------%/
!Compile and run the Jython application to Java
Since we will need the Jython classes to run the application from the web we will compile the @@.py@@ file to obtain the .class files and a .jar file with the internal Jython classes. They will be contained in .jar file (that's why we use """--jar""" argument), that we are naming it with an underscore and the name of the application. Once we extract all the classes from this file we will delete it. This is the command:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/jython_osp/code
$ jythonc -A --all --core -w "."  --jar _SurfaceArrayApp.jar SurfaceArrayApp.py
}}}

The output will look to something like this:
{{{
Warning: jythonc is unmaintained and will not be included in Jython-2.3.  See http://jython.org/Project/jythonc.html for alternatives to jythonc.  Add '-i' to your invocation of jythonc to turn off this warning
processing SurfaceArrayApp

Required packages:
  javax.swing
  org.opensourcephysics.display
  org.opensourcephysics.display2d

Creating adapters:

Creating .java files:
  SurfaceArrayApp module

Compiling .java to .class...
Compiling with args: ['C:\\Apps\\jdk\\bin\\javac', '-classpath', 'C:\\Apps\\jython2.2.1\\jython.jar;.;;.\\.;;C:\\Apps\\jython2.2.1\\Tools\\jythonc;C:\\Apps\\jython2.2.1\\Lib;__classpath__;C:\\Apps\\jython2.2.1', '.\\.\\SurfaceArrayApp.java']
0  
Building archive: _SurfaceArrayApp.jar
Tracking java dependencies:
}}}
>Keep in mind, the underscore here means temporary. We will remove the file later.

If you get compiling errors it could be a conflict between the Jython application and a new installed Java JRE or JDK. What I did is to remove the Jython folder altogether and reinstall Jython ''indicating'' my preferred Java binaries folder. This is very important. This has caused me lots of headaches, specially since I upgraded to Java6. But found the easiest solution is to let Jython rebuild its .jars and classes by reinstalling it. Good deal!

The result will be the new .jar file and .class files. Let's see what we get with the tree command:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/jython_osp/code
$ tree -L 2
.
|-- META-INF
|   `-- MANIFEST.MF
|-- SurfaceArrayApp$_PyInner.class
|-- SurfaceArrayApp.class
|-- SurfaceArrayApp.java
|-- SurfaceArrayApp.py
|-- _SurfaceArrayApp.jar
|-- demo
|   |-- FirstPlotApp.class
|   `-- HelloWorldApp.class
|-- launcher_default.xset
|-- org
|   |-- jibble
|   `-- opensourcephysics
|-- osp
|-- osp.jar
`-- osp_title.html

6 directories, 11 files
}}}

Now, withe new .jar file, we will unpack it to let it create its file structure under the ''org'' folder.
{{{
$ jar -xvf _SurfaceArrayApp.jar
}}}
We should have a final file structure like this:
{{{
$ tree -L 2
.
|-- META-INF
|   `-- MANIFEST.MF
|-- SimplePlot.py
|-- SurfaceArrayApp$_PyInner.class
|-- SurfaceArrayApp.class
|-- SurfaceArrayApp.java
|-- SurfaceArrayApp.py
|-- _SurfaceArrayApp.jar
|-- _SurfaceArrayApp.java
|-- demo
|   |-- FirstPlotApp.class
|   `-- HelloWorldApp.class
|-- launcher_default.xset
|-- org
|   |-- jibble
|   |-- opensourcephysics
|   `-- python
|-- osp.jar
`-- osp_title.html

6 directories, 13 file
}}}
Interesting to note is the ''python'' folder under the ''org'' folder. There is where the Jython internal classes are stored.

!!Run now the application:
{{{
$ java SurfaceArrayApp
}}}
We should obtain the same graph as above. We have both: the Java libraries and the Jython libraries.
/%-----------------------------------------------------------------------------%/
!Create the combined OSP and Jython .jar library
First some cleanup. Let's remove the osp.jar and the temporary Jython .jar file.
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/jython_osp/code
$ rm *.jar
}}}
Ok. JAR files removed. And now let's see what is in the ''code'' folder:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/jython_osp/code
$ ls
META-INF/                       SurfaceArrayApp.java   launcher_default.xset
SimplePlot.py                   SurfaceArrayApp.py     org/
SurfaceArrayApp$_PyInner.class  _SurfaceArrayApp.java  osp_title.html
SurfaceArrayApp.class           demo/
}}}

Now, let's create the super .jar library:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/jython_osp/code
$ jar cmvf META-INF/MANIFEST.MF ../jython_osp.jar .
}}}
>Here is the [[jython_osp.jar|http://reyesaguayo.com/osp/jws/jython_osp.jar]] file if you want to play with it. It's a 3.5 MB file.

The file jython_osp.jar will be now located in the parent directory of ''code'' which is ''jython_osp''. If you double-click on the file in Explorer it will execute the application we just built. When we unpacked the application .jar file, it automatically added the MANIFEST.MF file with the name of the application, in this particular case ''SurfaceArrayApp'' was set as the main application in the manifest file. 
/%-----------------------------------------------------------------------------%/
![[Create the Java Web Start file]]
<<tiddler "Create the Java Web Start file">>
/%-----------------------------------------------------------------------------%/
![[Java Web Start - Running from a local .jnlp file]]
<<tiddler "Java Web Start - Running from a local .jnlp file">>
/%-----------------------------------------------------------------------------%/
!![[A script to automate tasks described]]
<<tiddler "A script to automate tasks described">>
/%-----------------------------------------------------------------------------%/
!Conclusion
I have been trying for a while using Jython to build web-enabled applications with these powerful math and scientific libraries created by the [[OpenSourcePhysics]] community. Jython/Python brings extra advantages to the Java development with its elegant code, faster to develop, easier to explain and understand after writing the code. Combined with the powerful Java libraries out there, both, Java and Jython, make a terrific companion for educational purposes. In the Java world we can find innumerable tools for graphics, plotting, mathematics, scientific, calculation and simulation purposes, reducing development and debugging time considerably when used with duo Jython/Python.

One of the most important things after you created the library is that it later can be used for other OSP+Jython applications. It can be enhanced as you compile more Jython applications. We will develop this, using the library for multiple applications in another article.
/%-----------------------------------------------------------------------------%/
!To-do
# Upload more jWS (Jython Web Start) applications
# Build a menu to launch any of the applications from the web
# A distributable .jar file with all applications
# Start developing own engineering applications using OSP and jWS
/%-----------------------------------------------------------------------------%/
![[Examples Jython Web Start OSP applications]]
<<tiddler "Examples Jython Web Start OSP applications">>
@@Add more sections explaining the compilation@@

!Folder structure
Our root folder this time is selectapps. It contains two main child directories: jarselect and webselect. This is how the main folder structure would look.
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/selectapps
$ tree -d -L 2
.
|-- jarselect
|   |-- META-INF
|   |-- demo
|   `-- org
`-- webselect
    `-- index_files

6 directories
}}}
!Creating the jar file
Once all classes are compiled we create the jar file, directly on the folder that we will publish to the web.
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/selectapps/jarselect
$ jar cvf ../webselect/select.jar .
}}}
This is our folder structure:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/java/USF/CS601/code/tools
$ tree
.
|-- Hello.class
|-- Hello.java
|-- T.class
|-- T.java
|-- U.class
|-- U.java
|-- U.java~
`-- foo
    |-- Hello.class
    |-- Hello.java
    |-- T.class
    |-- T.java
    |-- U.class
    `-- U.java

1 directory, 13 files
}}}


The java files are:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/java/USF/CS601/code/tools
$ ls
Hello.java  T.java  U.java  U.java~
}}}

Compiling all the files:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/java/USF/CS601/code/tools
$ javac *.java

msfz751@a3800xp64 /cygdrive/f/PortableEclipse/java/USF/CS601/code/tools
$ ls
Hello.class  Hello.java  T.class  T.java  U.class  U.java  U.java~
}}}

We change now to the folder tmp:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/java/USF/CS601/code/tools
$ cd /cygdrive/f/PortableEclipse/java/tmp

msfz751@a3800xp64 /cygdrive/f/PortableEclipse/java/USF/CS601/code/tools
tmp$ pwd
/cygdrive/f/PortableEclipse/java/tmp
}}}

We now try to run the class “T�?:

tmp$ java -classpath ../USF/CS601/code/tools T
Salut, Le Monde

We run now the clas “U�?:
tmp$ java -classpath ../USF/CS601/code/tools U
hell


Alfonso.Reyes@HOUTSP-L-99987:foo$ pwd
/cygdrive/f/PortableEclipse/java/USF/CS601/code/tools/foo

Alfonso.Reyes@HOUTSP-L-99987:foo$ ls
Hello.java  T.java  U.java

Alfonso.Reyes@HOUTSP-L-99987:foo$ javac *.java

Alfonso.Reyes@HOUTSP-L-99987:foo$ cd ..

Alfonso.Reyes@HOUTSP-L-99987:tools$ java foo.T
Salut, Le Monde

Alfonso.Reyes@HOUTSP-L-99987:tools$ java foo.U
hello

Alfonso.Reyes@HOUTSP-L-99987:tools$ jar cvf ../../../../tmp/tools.jar *.class
security properties not found. using defaults.
adding: Hello.class (in=385) (out=272) (deflated 29%)
adding: T.class (in=411) (out=286) (deflated 30%)
adding: U.class (in=283) (out=222) (deflated 21%)

To view the contents of we have just packaged:
Alfonso.Reyes@HOUTSP-L-99987:tools$ jar tvf ../../../../tmp/tools.jar
   407 Fri Oct 24 15:52:42 CDT 2008 META-INF/MANIFEST.MF
   385 Fri Oct 24 15:40:34 CDT 2008 Hello.class
   411 Fri Oct 24 15:40:34 CDT 2008 T.class
   283 Fri Oct 24 15:40:34 CDT 2008 U.class

Alfonso.Reyes@HOUTSP-L-99987:tools$ ls      
Hello.class  Hello.java  T.class  T.java  U.class  U.java  U.java~  foo/

Generating foo.jar now: 
Alfonso.Reyes@HOUTSP-L-99987:tools$ jar cvf ../../../../tmp/foo.jar foo    
security properties not found. using defaults.
adding: foo/ (in=0) (out=0) (stored 0%)
adding: foo/Hello.java (in=120) (out=98) (deflated 18%)
adding: foo/T.java (in=138) (out=116) (deflated 15%)
adding: foo/U.java (in=158) (out=123) (deflated 22%)
adding: foo/Hello.class (in=389) (out=276) (deflated 29%)
adding: foo/T.class (in=415) (out=288) (deflated 30%)
adding: foo/U.class (in=291) (out=226) (deflated 22%)

List what is in the tools folder:
Alfonso.Reyes@HOUTSP-L-99987:tools$ ls ../../../../tmp/
compile01/  flanagan.jar  foo.jar  fxolib.jar  mechanics.jar  myflanagan.jar  tools.jar

And generating the jar file again to test:
Alfonso.Reyes@HOUTSP-L-99987:tools$ jar cvf ../../../../tmp/foo.jar foo
added manifest
adding: foo/(in = 0) (out= 0)(stored 0%)
adding: foo/Hello.java(in = 120) (out= 98)(deflated 18%)
adding: foo/T.java(in = 138) (out= 116)(deflated 15%)
adding: foo/U.java(in = 158) (out= 123)(deflated 22%)
adding: foo/Hello.class(in = 389) (out= 276)(deflated 29%)
adding: foo/T.class(in = 415) (out= 288)(deflated 30%)
adding: foo/U.class(in = 291) (out= 226)(deflated 22%)

We change to the java folder:
Alfonso.Reyes@HOUTSP-L-99987:f$ cd /cygdrive/f/PortableEclipse/java/

Alfonso.Reyes@HOUTSP-L-99987:java$ ls
USF/   cash/       examples/   myApps/  roman/    tiny/
calc/  compile01/  greetings/  raise/   testpkg/  tmp/

And test the jar file execution:
Alfonso.Reyes@HOUTSP-L-99987:java$ java -classpath tmp/tools.jar T
Salut, Le Monde

Alfonso.Reyes@HOUTSP-L-99987:java$




Location: the cygwin installation directory. I prefer the [[rxvt]] console; very customizable.

{{{
@echo off
C:
chdir C:\Apps\cygwin\bin
set EDITOR=nano
set VISUAL=nano
set BASHHERE=%1
rxvt -e /bin/bash --login -i
}}}
!EJS Methods
*[[levelColors]]

!EJS Sections
*[[CylinderExample_Initialization]]
{{{
for (int i=1; i<colors; i++) {
  levels[i-1] = -1.0 + (2.0*i)/colors;
}
levelColors[0] = new java.awt.Color (0,0,255);
levelColors[1] = new java.awt.Color (0,128,128);
levelColors[2] = new java.awt.Color (0,255,0);
levelColors[3] = new java.awt.Color (128,128,0);
levelColors[4] = new java.awt.Color (255,0,0);
}}}
[[Deferential Geometry]]
/***
The StyleSheet holds the custom style modifications.  It augments  and overrides the hidden default pages.
***/

/*{{{*/
body {background:#ddd;
        position: static;
	font-size: .75em;
	font-family: arial,helvetica;}
.header {height: 5.8em;}
.headerShadow {
	padding: 2em 1em 1em 20em;
	left: 1px;
	top: 1px;}
.headerForeground {
	padding: 2em 1em 1em 20em;
	color: #ddd}
.siteTitle {font-size: 2.5em;}
.siteSubtitle {font-size: 1em;}
#displayControl {
	position:absolute;
	top:0;
	left:0;
	margin:0em;
	padding: 0em;
	background: #ddd;}
#displayControl a{text-decoration: none; font-size: 1em; color: #04b;}
#sidebar {
	font-size: 1em;
	left: 0em;
	width: 19em;
	overflow: hidden;}
#mainMenu {
	position: relative;
	width: 17em;
	margin: .5em 0em 0em .5em;
	padding: 0.3em .5em 0.3em .5em;
	text-align: left;
	line-height: 1.4em;
	font-size: 1em;
	border-bottom:1px solid #bbb;
	border-right:1px solid #bbb;
	background:#eee;}
#sidebarOptions {
	width: 17.5em;
	margin: .5em .5em 0em .5em;
	padding: 0.3em 0em 0.3em 0.4em;
        overflow: hidden;
	font-size: 1em;
	border-bottom:1px solid #bbb;
	border-right:1px solid #bbb;
	background:#eee;}
#sidebarOptions a {
	margin: 0em 0em;
	padding: 0.15em .3em;
	font-size: 1.1em;
	display: inline;}
#sidebarOptions input {
	margin: 0em 0.1em;
	width: 7.5em;
	font-size: 1em;
	padding: 0.2em 0.2em;
	border: 1px solid #888;}
#sidebarOptions .button {border: 1px solid #eee;}
#sidebarOptions .button:hover {
	color: #014;
	background: #fe8;
	border: 1px solid #db4;}


#sidebarOptions .sliderPanel {
	margin-top: .5em;
	margin-right: 1em;
	margin-bottom: .5em;
	margin-left: .5em;
	font-size: 1em;
	padding: 1em;
	background: #aaa;}
#sidebarOptions .sliderPanel a {
	display: inline;}

/***
AReyes: Removed 
    #sidebarOptions .sliderPanel input {
	width: 1em;
	font-size: 1em;}
Because was cutting username texbox at 10% width
***/

#sidebar .inputFix input{width: 8em;}
#sidebarTabs {
	width: 16em;
	margin: .5em .5em 1em .5em;
	font-size: 1em;}
#sidebarTabs .tabset {padding: 1.0em 0em 0em 0em;}
#sidebarTabs .tab {margin: .5em 0em 0em 0.5em;
	padding: 2px;
	border-top: 1px solid #ddd;
	border-left: 1px solid #ddd;
	border-right:1px solid #bbb;}
#sidebarTabs .tabContents {
	width: 18em;
	margin: 0em 0em 0em 0em;
	padding: .25em 0em .25em 0em;
	border-top: none;
	border-left: none;
	border-bottom:1px solid #bbb;
	border-right:1px solid #bbb;
	overflow: hidden;}
#sidebarTabs .tabContents ul{
	margin-left: .65em;
	overflow: hidden;}
.popup {
	background: #fe8;
	border: 1px solid #db4;}
.popup hr {
	color: #db4;
	background: #db4;
	border-bottom: 1px;}
.popup li.disabled {
	color: #db4;}
.popup li a, .popup li a:visited {
	color: #04b;
	border: none;}
.popup li a:hover {
	background: #04b;
	color: #fe8;
	border: none;}
#displayArea {
	margin-left: 18.5em;
	margin-right: 0em;
	margin-top: 0em;
	padding-top: 0em;
	padding-bottom: .25em;}
.toolbar {
	float: right;
	font-size: 1em;}
.tiddler {
	border-bottom: 1px solid #bbb;
	border-right: 1px solid #bbb;
	margin: .5em .5em .5em .75em;
	padding-bottom: .5em;
	padding-top: .75em;
	background-color: white;}
.shadow .title {
	color: #000; background: #fff;}
.title {
	font-size: 1.75em;
        background: #fff;
	color: #000;}
h1,h2,h3,h4,h5,h6 {
	padding-left: 0em;
	padding-top: 0em;
	padding-bottom: 0em;
	margin-top: .5em;
	margin-bottom: .1em;
	color: #000;
	background: transparent;}
h1 {font-size: 1.2em;}
h2 {font-size: 1.15em;}
h3 {font-size: 1.1em;}
h4 {font-size: 1.05em;}
h5 {font-size: 1em;}
h6 {font-size: 0.8em;}
.subtitle {
	font-size: .8em;
	padding-right: 1em;
        padding-left: 3em;
        padding-top: 0em;
        margin-bottom: 0.25em;
	color: #888;}
/*      ie fix?                                                                              */
.viewer {
       line-height: 120%;
       font-size: 1.25em;}
.viewer .listTitle {list-style-type:none; margin-left:-2em; background-color:white;}
.viewer ul, .viewer ol {
	margin-left: 0.5em;
	margin-top: 0em;
	margin-bottom: 0em;
	padding-left: 1.5em;}
.viewer pre {overflow: visible;}
.viewer hr {
	border: 0;
	border-top: solid 1px #666;}
.editorFooter .button {padding-top: 0px; padding-bottom: 0px;}

/*}}}*/
!Darcy's Law
$$
q = \frac{2 \pi r k h}{\mu}\: \frac{\partial p}{\partial r}
$$
+++
{{{
q = \frac{2 \pi r k h}{\mu}\: \frac{\partial p}{\partial r}
}}}
===
!!In Another form
[[Charged Particles model|Charged Particles model]]
!One format per column
{{{
"0,0, 000, 000.00"
}}}
!Array of elements.
{{{
new double[]{n,depth, T, Tavg}
}}}
{{{
new double[] {t,xCM, yCM, xT,yT}
}}}

!Columns separated by commas. Can use space.
{{{
"row#,n,    Depth, Temp, Tavg"
}}}
[img[DecimalFormat.png]]
!Custom
{{{
double getLz(double theta, double phiDot){
  return Math.sin(theta)*Math.sin(theta)*phiDot;
}
}}}
!Variables
|!Name	|!Initial Value		|!Type		|!Dimension|
|function	|null				|Function		|		|

!External Imports
{{{
org.opensourcephysics.numerics.specialfunctions.*
org.opensourcephysics.numerics.Function
java.util.ArrayList
}}}

!Custom Methods
{{{
public void initializeFunction () {
  // new function selected so clear old
  _view.curve.clear();
  functionList.clear();
  oneIndex=true;
  if(type.equals("Legendre")){
    function=Legendre.getPolynomial(n);
    xmin=-1;
    xmax=1;
    xtest=0.5;
  }else if(type.equals("associated Legendre")){
    m=Math.min(m,n);
    m=Math.max(m,-n);
    function=Legendre.getAssociatedFunction(n,m);
    oneIndex=false;
    xmin=-1;
    xmax=1;
    xtest=0.5;
  }else if(type.equals("Laguerre")){
    function=Laguerre.getPolynomial(n);
    xmin=0;
    xmax=10;
    xtest=4;
  }else if(type.equals("associated Laguerre")){
    function=Laguerre.getPolynomial(n,m);
    oneIndex=false;
    xmin=0;
    xmax=10;
    xtest=4;
  }else if(type.equals("Chebyshev T")){
    function=Chebyshev.getPolynomialT(n);
    xmin=-1;
    xmax=1;
    xtest=0.5;
  }else if(type.equals("Chebyshev U")){
    function=Chebyshev.getPolynomialU(n);
    xmin=-1;
    xmax=1;
    xtest=0.5;
  }else if(type.equals("Bessel")){
    function=Bessel.getFunction(n);
    xmin=0;
    xmax=25;
    xtest=5;
  }else if(type.equals("Bessel derivative")){
    function=Bessel.getDerivative(n);
    xmin=0;
    xmax=25;
  }else{
    System.out.println("Requested function not found.");
    return;
  }
  addSegment(function);
}


ArrayList<Function> functionList = new ArrayList<Function>();

public void addSegment(Function f){
  double x0=xmin, dx=(xmax-xmin)/(np-1);
  if(functionList.contains(f)){ 
    return;  // function is in the list and has already been drawn
  }
  if(singleCurve){
    _view.curve.clear();
    functionList.clear();
  }else{  // new segment is being created to show this function
     _view.curve.newSegment();
  }
  drawingColor=functionList.size();
  functionList.add(f);
  for(int i=0;i<np;i++){
    _view.curve.addPoint(x0,f.evaluate(x0));
    x0+=dx;
  }
}
}}}

{{{
public void additionalFunction() {
  if(type.equals("Legendre")){
    function=Legendre.getPolynomial(n);
    xtest=0.5;
  }else if(type.equals("associated Legendre")){
    m=Math.min(m,n);
    m=Math.max(m,-n);
    function=Legendre.getAssociatedFunction(n,m);
  }else if(type.equals("Laguerre")){
    function=Laguerre.getPolynomial(n);
  }else if(type.equals("associated Laguerre")){
    function=Laguerre.getPolynomial(n,m);
  }else if(type.equals("Chebyshev T")){
    function=Chebyshev.getPolynomialT(n);
  }else if(type.equals("Chebyshev U")){
    function=Chebyshev.getPolynomialU(n);
  }else if(type.equals("Bessel")){
    function=Bessel.getFunction(n);
  }else if(type.equals("Bessel derivative")){
    function=Bessel.getDerivative(n);
  }else{
    System.out.println("Requested function not found.");
    return;
  }
  addSegment(function);
}
}}}

{{{
public void plotAllFunctions(){
  _view.curve.clear();  // removes all segments from trail
  drawingColor=0;
  for (Function f: functionList){
    _view.updateVariables();// updates drawing color variable
    double x0=xmin, dx=(xmax-xmin)/(np-1);
    for(int i=0;i<np;i++){
      _view.curve.addPoint(x0,f.evaluate(x0));
      x0+=dx;
    }
    drawingColor++;
    _view.curve.newSegment();
  }
}


}}}
<code java>
	n = 128
	xdata = java.lang.reflect.Array.newInstance(java.lang.Double.TYPE,[n])
	zdata = java.lang.reflect.Array.newInstance(java.lang.Double.TYPE,[2*n]) # real and imaginary values alternate
</code>
''Java:''
<code java>
public class CalcComplexPlotApp implements Calculation {
  private Control myControl;
  private DrawingPanel drawingPanel = new DrawingPanel();
  private DrawingFrame drawingFrame = new DrawingFrame(drawingPanel);
  private GridPointData pointdata;
  private ComplexSurfacePlot plot;
  private MultiVarFunction reFun, imFun;
</code>
''Jython:''
<code python>
class CalcComplexPlotApp(Calculation):
    def __init__(self):
        self.myControl = Control
        self.drawingPanel = DrawingPanel()
        self.drawingFrame = DrawingFrame(self.drawingPanel)
        self.pointdata = GridPointData
        self.plot = ComplexSurfacePlot
        self.reFun = MultiVarFunction
        self.imFun = MultiVarFunction
</code>
[[Welcome]]
$$
\left| A \right| = \left| L \right| \cdot \left| U \right|
= u_{11}  u_{22} \dots u_{NN}
$$

DISABLE WINDOWS FILE PROTECTION (WFP) TEMPORARILY

a. Open the Registry Editor: Start Menu > Run > 'regedit'
b. Navigate down in the tree to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
c. Change the value of the 'SFCDisable' key on the right to '1' and click 'OK'
d. Close the Registry Editor


/***
Authors: Eric Shulman
version: 1.0.0
source: http://www.tiddlytools.com/
This plugin allows you to disable TiddlyWiki's automatic WikiWord linking behavior, so that WikiWords embedded in tiddler content will be rendered as regular text, instead of being automatically converted to tiddler links.  To create a tiddler link when automatic linking is disabled, you must enclose the link text within {{{[[}}} and {{{]]}}}.
!!!!!Code
***/
//{{{
version.extensions.disableWikiLinks= {major: 1, minor: 0, revision: 0, date: new Date(2005,12,9)};

// G changed to have this on, without checkbox
config.options.chkDisableWikiLinks= true;

// find the formatter for wikiLink and replace handler with 'pass-thru' rendering
for (var i=0; i<config.formatters.length && config.formatters[i].name!="wikiLink"; i++);
config.formatters[i].coreHandler=config.formatters[i].handler;
config.formatters[i].handler=function(w) {
	// if not enabled, just do standard WikiWord link formatting
	if (!config.options.chkDisableWikiLinks) return this.coreHandler(w);
	// supress any leading "~" (if present)
	var skip=(w.matchText.substr(0,1)==config.textPrimitives.unWikiLink)?1:0;
	w.outputText(w.output,w.matchStart+skip,w.nextMatch)
}
//}}}
&nbsp;<script label="O" title="toggle sidebar">
   var sb=document.getElementById('sidebar');
   var da=document.getElementById('displayArea');
   if (sb.style.display == 'none') {
      da.style.marginLeft = '18.5em';
      sb.style.display = 'block';}
   else {
      da.style.marginLeft = '0em';
      sb.style.display = 'none';}
</script>&nbsp;<script label="O" title="toggle title">
   var h=document.getElementById('head');
   if (h.style.height == '1em') {
      h.style.height = '5.8em';}
   else {
      h.style.height = '1em';}
</script>&nbsp;<script label="§" title="save tiddlywiki">
saveChanges();
</script>&nbsp;
!Copy the Jython .jar file

!

http://www.um.es/fem/EjsWiki/index.php/Main/PredefinedMethods
We will use this package in our computer modeling. 
"Learning science is learning to develop, test, and apply models to explain or predict natural phenomena. This process can be greatly facilitated by the use of computer models."
Since writing programs is a labor intensive task we will build our computer models and simulation without the traditional programming tools. Creating models with Easy Java Simulations (Ejs) makes development faster and easier.

http://www.um.es/fem/EjsWiki/
Type the text for 'prog.Eclipse'
{{{
c:\apps\EasyEclipse-for-Python-1.3.1
}}}
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser excludeLists'></span></div>
<!--}}}-->
/***
|Name|EditTiddlerPlugin|
|Source|http://www.TiddlyTools.com/#EditTiddlerPlugin|
|Version|1.2.0|
|Author|Eric Shulman|
|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|embed an 'edit' link in tiddler content to invoke edit on any specified tiddler title|

!!!!!Usage:
<<<
{{{<<editTiddler TiddlerName linktext>>}}}
If no tiddler title is specified (or the special keyword "here" is used), the tiddler containing the rendered macro is assumed.  You can also specify optional alternative "link text" to be displayed. The default link text is "edit".
<<<
!!!!!Revisions:
<<<
2007.03.22 1.2.0 added support for 'here' keyword and optional 2nd param to specify label text
2007.03.15 1.1.1 fixed 'get tiddler ID' logic so it actually works! D'oh! 
2007.03.11 1.1.0 changed 'get tiddler ID' logic so that macro can be used outside a tiddler (i.e., in mainMenu) by specifying the ID
2006.10.04 1.0.1 invoke findContainingTiddler() as fallback when 'tiddler' param is null
2006.04.28 1.0.0 Initial release
<<<
!!!Code:
***/
//{{{
config.macros.editTiddler={
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var tid=params.shift(); // use specified tiddler ID (or "here")
		if (!tid || tid=="here") {
			if (tiddler)
				tid=tiddler.title; // use current tiddler, fallback to find tiddler if none provided
			else { 
				var here=story.findContainingTiddler(place);
				if (!here) return; // not in a tiddler, do nothing
				tid=here.getAttribute('tiddler'); // get ID from tiddler element
			}
		}
		var label="edit"; if (params[0]) label=params.shift();
		createTiddlyButton(place,label,'edit tiddler: '+tid,this.onclick).setAttribute('which',tid);
	},
	onclick: function(e) {
		story.displayTiddler(null,this.getAttribute('which'),DEFAULT_EDIT_TEMPLATE);
	}
}
//}}}
__[[Effective Potential Energy]]__

[img[http://latex.codecogs.com/gif.latex?E_{ff} = m\;g\;r\;cos \, \alpha + \frac{1}{2} \:r^2 \, sin^2\alpha]]
:where:
::E~~ff~~: Effective Potential Energy
:://m//: mass of particle
:://r//: polar distance of particle
:://g//: gravity acceleration
:://&alpha;//: cone half-opening angle
!Equations
[img(50%,auto)[ElasticCollision_difeq.png][ElasticCollision_difeq.png]]
[[ElasticCollision_difeq.png]]

!Libraries
*  [[Compadre Digital Library]] 
[img[ElasticCollision_difeq.png]]
Images can be included by their filename or full URL. It's good practice to include a title to be shown as a tooltip, and when the image isn't available. An image can also link to another tiddler or or a URL
[img[Romanesque broccoli|images/fractalveg.jpg][http://www.flickr.com/photos/jermy/10134618/]]
{{{
[img[Romanesque broccoli|images/fractalveg.jpg]
   [http://www.flickr.com/photos/jermy/10134618/]]
[img[title|filename]]
[img[filename]]
[img[title|filename][link]]
[img[filename][link]]
}}}
[<img[Forest|images/forest.jpg][http://www.flickr.com/photos/jermy/8749660/]][>img[Field|images/field.jpg][http://www.flickr.com/photos/jermy/8749285/]]You can also float images to the left or right: the forest is left aligned with {{{[<img[}}}, and the field is right aligned with {{{[>img[}}}.
@@clear(left):clear(right):display(block):You can use CSS to clear the floats@@
{{{
[<img[Forest|images/forest.jpg][http://www.flickr.com/photos/jermy/8749660/]]
[>img[Field|images/field.jpg][http://www.flickr.com/photos/jermy/8749285/]]
You can also float images to the left or right:
 the forest is left aligned with {{{[<img[}}},
and the field is right aligned with {{{[>img[}}}.
@@clear(left):clear(right):display(block):
You can use CSS to clear the floats@@
}}}
To indicate a different compiler or if the current version is not JDK bur JRE, then modify the jython registry:
{{{
python.jythonc.compiler = C:\\Program Files (x86)\\Java\\jdk1.6.0_02\\bin\\javac.exe
}}}
Besides the default applications, I recommend to install also these:
* bash: 
* rsync: the best synchronization tool ever.
* mc: the Midnight Commander, a file manager
* open-ssl: will give ssh, scp
* rxvt: a resizeable and configurable console.
* make
* nano: an easy to use editor. Standard in Unix environments.
* [[tree]] - we will compile it after you install the base cygwin system

<code XML>
<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for CookXml Jython Extension Demo -->
<jnlp
	spec="1.0+"
	codebase="http://cookxml.yuanheng.org/cookjython"
	href="cookjythondemo.jnlp">

	<information>
		<title>CookXml Jython Extension Demo</title>
		<vendor>Heng Yuan</vendor>
		<homepage href="index.html"/>
		<description>CookXml Jython Extension Demo</description>
		<description kind="short">A demo of the capabilities of using Jython with CookSwing.</description>
		<offline-allowed/>
	</information>
	<security>
		<all-permissions/>
	</security>
	<resources>
		<j2se version="1.4+"/>
		<jar href="../jar/cookxml.jar"/>
		<jar href="../jar/cookswing.jar"/>
		<jar href="../jar/cookjython.jar"/>
		<jar href="../jar/jython.jar"/>
		<jar href="../jar/cookjython_examples.jar" main="true"/>
	</resources>
	<application-desc main-class="examples.cookjython.CookJythonDemo"/>
</jnlp>
</code>

Reference: http://cookxml.yuanheng.org/cookjython
/%
|Name|ExpandSlidersScript|
|Source|http://www.TiddlyTools.com/#ExpandSlidersScript|
|Version|1.1.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|script|
|Requires|InlineJavascriptPlugin NestedSlidersPlugin (optional)|
|Overrides||
|Description|simulateously expand/collapse all nested sliders in a tiddler (or ID'd DOM element)|

Usage:
	<<tiddler ExpandSlidersScript with: elementID expandlabel collapselabel>>
Where elementID is one of:
	""   = the current tiddler
	here = the current container
	ID   = specific DOM element ID (e.g., "mainMenu")

%/<script label="expand" title="expand/collapse sliders">
	var here=story.findContainingTiddler(place)||place.parentNode.parentNode; // tiddler or container
	if ('$1'!='$'+'1' && '$1'.length) {
		if ('$1'=='here') here=place.parentNode.parentNode; // container
		else here=document.getElementById('$1'); // ID
	}
	if (!here) return false;
	var expandlabel='expand'; if ('$2'!='$'+'2') var expandlabel='$2';
	var collapselabel='collapse'; if ('$3'!='$'+'3') var collapselabel='$3';
	var elems=here.getElementsByTagName('*');
	var state=(place.innerHTML.toLowerCase()==expandlabel)?'none':'block';
	for (var e=0; e<elems.length; e++) { var p=elems[e];
		if (p.className!='sliderPanel' || p.style.display!=state) continue;
		if (p.button) window.onClickNestedSlider({target:p.button});
		else p.previousSibling.onclick();
	}
	place.innerHTML=state=='none'?collapselabel:expandlabel;
	return false;
</script><script>
	place.lastChild.style.fontWeight='normal';
	var expandlabel='expand'; if ('$2'!='$'+'2') var expandlabel='$2';
	var collapselabel='collapse'; if ('$3'!='$'+'3') var collapselabel='$3';
	var currlabel=place.lastChild.innerHTML.toLowerCase();
	place.lastChild.innerHTML=expandlabel;
</script>
''Bold''
{{{''Bold''}}}
==Strikethrough==
{{{==Strikethrough==}}}
__Underline__ 
{{{__Underline__}}}
//Italic// 
{{{//Italic//}}}
2^^3^^=8 
{{{2^^3^^=8}}}
a~~ij~~ = -a~~ji~~ 
{{{a~~ij~~ = -a~~ji~~}}}
@@highlight@@ 
{{{@@highlight@@}}}

//The highlight can also accept CSS syntax to directly style the text://
@@color:green;green coloured@@
{{{@@color:green;green coloured@@}}}
@@background-color:#ff0000;color:#ffffff;red coloured@@
{{{@@background-color:#ff0000;color:#ffffff;red coloured@@}}}
@@text-shadow:black 3px 3px 8px;font-size:18pt;display:block;margin:1em 1em 1em 1em;border:1px solid black;Access any CSS style@@
{{{@@text-shadow:black 3px 3px 8px;font-size:18pt;display:block;margin:1em 1em 1em 1em;border:1px solid black;Access any CSS style@@}}}
@@display:block;text-align:center;centered text or image@@
{{{@@display:block;text-align:center;centered text or image@@}}}

//For backwards compatibility, the following highlight syntax is also accepted://
@@bgcolor(#ff0000):color(#ffffff):red coloured@@
{{{
@@bgcolor(#ff0000):color(#ffffff):red coloured@@
}}}
In $\partial u /\partial t = \lambda \partial^{2} u/\partial x^{2}$, replace $\partial u/\partial t$ by DNGF and $\partial^{2} u/\partial x^{2}$ by DDST formula:

$\Longrightarrow$ forward time-centered space algorithm,
$$
\begin{eqnarray}
\frac{\textstyle 1}{\textstyle \Delta t} \left[ u_{j}^{n+1}-u_{j}^{n}\right] &=& 
\frac{\textstyle \lambda}{\textstyle (\Delta x)^{2}} 
 \left[u_{j+1}^{n}-2 u_{j}^{n}+u_{j-1}^{n}\right]
\end{eqnarray}
$$
Using $a \equiv \lambda \Delta t / (\Delta x)^{2}$ this is
$$
\begin{eqnarray}
&&
u_{j}^{n+1}=(1-2a)u_{j}^{n} + a(u_{j-1}^{n}+u_{j+1}^{n})
\end{eqnarray}
$$
Stability:
For the $k$-dependent growth factor we find $g(k) = 1-4a\sin^{2}\frac{\textstyle k \Delta x}{\textstyle 2}$, which tells us that for stability the condition is
$
\Delta t \leq \frac{\textstyle (\Delta x)^{2}}{\textstyle 2\lambda} \equiv \tau  
$
where $\tau$ is the characteristic time for the diffusion over a distance $\Delta x$ (i.e. one lattice space).
<code java>

// numbers/Factorial.java - Computes factorial
// Fred Swartz - 2003-11-02
import java.math.BigInteger;
public class FactorialBigInteger {
    public static void main(String[] args) {

        //-- BigInteger solution.
        BigInteger n = BigInteger.ONE;
        System.out.println("Factorial with BigInteger");
        for (int i=1; i<=50; i++) {
            n = n.multiply(BigInteger.valueOf(i));
            System.out.println(i + "! = " + n);
        }

        //-- int solution (BAD IDEA BECAUSE ONLY WORKS TO 12).
        int fact = 1;
        System.out.println("Factorial with Integer -- bad idea ...");
        for (int i=1; i<=50; i++) {
            fact = fact * i;
            System.out.println(i + "! = " + fact);
        }
    }
}

</code>
<code java>
/**
   demonstration
   of the Euler method for solving the equation for an object
   falling in a constant gravitational field.
*/

public class FallingObject
{
  public static void main (String args[])
  {
    // Put code between this line
    //--------------------------------------------
    // Variables
    double t, y, vy;
    double totalT;
    int n;

    // Constants
    double y0 =  0.0;
    double v0 =  0.0;
    double g  = -9.80;// meter per sec**2

    // Version 1
    double dt =  0.1;
    int nSteps = 10;
    y = y0;
    vy = v0;

    for( n=0; n< nSteps; n++)
    {
      y = y + vy * dt;
      vy = vy + g * dt;
    }

    totalT = n * dt;

    System.out.println("Version 1, dt=0.1 ");
    System.out.println("Time = "+ totalT);
    System.out.println("y = "+y+", vy = "+vy);
    System.out.println();

    // Version 2
    dt =  0.01;
    nSteps = 100;
    y = y0;
    vy = v0;

    for( n=0; n< nSteps; n++)
    {
      y = y + vy * dt;
      vy = vy + g * dt;
    }

    totalT = n * dt;

    System.out.println("Version 2, dt=0.01 ");
    System.out.println("Time = "+ totalT);
    System.out.println("y = "+y+", vy = "+vy);
    System.out.println();

    // Version 3
    dt =  0.001;
    nSteps = 1000;
    y = y0;
    vy = v0;

    for( n=0; n< nSteps; n++)
    {
      y = y + vy * dt;
      vy = vy + g * dt;
    }

    totalT = n * dt;

    System.out.println("Version 3, dt=0.001 ");
    System.out.println("Time = "+ totalT);
    System.out.println("y = "+y+", vy = "+vy);
    System.out.println();

    // Version 40
    dt =  0.0001;
    nSteps = 10000;
    y = y0;
    vy = v0;

    for( n=0; n< nSteps; n++)
    {
      y = y + vy * dt;
      vy = vy + g * dt;
    }

    totalT = n * dt;

    System.out.println("Version 4, dt=0.0001 ");
    System.out.println("Time = "+ totalT);
    System.out.println("y = "+y+", vy = "+vy);
    System.out.println();


    vy = v0 + g;
    y = y0 + 0.5 * g;
    System.out.println("Formulas for tTotal = 1.0sec");
    System.out.println("y = "+y+", vy = "+vy);

    //--------------------------------------------
    // and this line.
  }

  // Paint message in Applet window.
/*  public void paint(java.awt.Graphics g)
  {
     g.drawString("FallingObject1_Applet1",10,20);
  }
*/
}
</code>
$$
q = q_{max} \left[ 1 - \left( \frac {p_{wf}} {\bar p} \right)^2 \right]^n
$$
+++
{{{
q = q_{max} \left[ 1 - \left( \frac {p_{wf}} {\bar p} \right)^2 \right]^n
}}}
===
or
$$
q = C \left( \bar p^2 - p_{wf}^2 \right)^n
$$
$C$ and $n$ are empirical constants: $C = q_{max} / p^{2n}$ 
+++
{{{
q = C \left( \bar p^2 - p_{wf}^2 \right)^n
}}}
===
@@in progress@@
The file structure of the main .jar file for the web application will look like this:
> ''demo'' - couple of examples
> ''org''
>> jbible
>> opensourcephysics
>>> ... 
>>> controls
>>> davidson
>>>> ''applets'' 	<- we will need this path for our applet construction
>>> display
>>> ejs
>>> numerics
>>> jahasbun3
>>>> ''mechanics'' 	<- list of all work application classes
> META-INF 		<- define here the main class and other
/%

Usage:
	<<tiddler ReplaceTiddlerTitle with: "new title text">>

%/<script>
	var tid="$1";
var s = "$1";
var out = "";
	if (tid=='$'+'1') { // use current tiddler
		var here=story.findContainingTiddler(place); if (!here) return;
		var tid=here.getAttribute('tiddler');
	}
out = "<<chkSlider" + s + " " + s + " " + s + ">>";
notes = "$2";
lbl = "$1"+"..." + "\xBB";
folder = "$1"+ "F";

wikify("<<slider " + "chkSlider"+ "_" + "$1" + "F " + "$1" + "F  " +  lbl + " " + "[[" +notes +"]]"+ ">>"  ,place);

//return (s);
</script>
Type the text for 'ForEachTiddlerExamples'
/***
|''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:''|&copy; 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.
***/
!Location
 file:///home/msfz751/Programming/ejs/workspaces/_distribution/source/users/davidson/wochristian/fourier

!EJS objects
* [[RadioButton]]
[img[tooltip|FourierSynthesisSound.jpg][FourierSynthesisSound.jpg]]
[img(44%,auto)[tooltip|FourierSynthesisSound.jpg][FourierSynthesisSound.jpg]]
!Location
file:////home/msfz751/Programming/ejs/workspaces/petroleum/source/external/02 Intermediate/apps/FirstOrderODE/

!Methods
* [[getColor(int index)]]

!EJS Objects used
*[[ComboBox]] 
*[[JSliderDouble]] 

!Imports
??
$$
\rho'(r) = -q_{j}\left(\frac{\textstyle \eta^{2}}{\textstyle \pi} \right)^{3/2}
e^{\textstyle - \eta^{2}( r- r_{j})^{2}}
$$
$$
K = -{1\over 2\sqrt{EG}} \left[{\partial\over\partial u}{G_u\over 
\sqrt{EG}} + {\partial\over\partial v}{E_v\over\sqrt{EG}}\right]
={1\over\sqrt{EG}}\left[ -{\partial\over\partial u}
\left(\kappa_2\sqrt{G}\,\right) + {\partial\over\partial v} 
\left(\kappa_1\sqrt{E}\,\right)\right],
$$
{{{
<<forEachTiddler 
 where
 'tiddler.tags.contains("systemConfig")'
 write
 '((index == 0) ? "" : ", ")+"[["+tiddler.title+"]]"'
>>
}}}
''//Explaination//''
The initial idea to accomplish the task is use a write parameter list this: {{{"[["+tiddler.name+"]], "}. But to avoid that a comma is appended after the final tiddler the write parameter is a little bit more complex and refers to the build-in variable {{index}}.

''//Result://''
<<forEachTiddler
 where
 'tiddler.tags.contains("systemConfig")'
 write
 '((index == 0) ? "" : ", ")+"[["+tiddler.title+"]]"'
>>


See Also ForEachTiddlerExamples.
''Java:''
<code java>
mx = data.length;
</code>
''Jython:''
<code py>
mx = len(data)
</code>
$$
q = q_{max } \left[ 1 - 0.2 \left( \frac{ p_{wf}} {\bar p} \right) - 0.8 \left( \frac{ p_{wf}} {\bar p} \right)^2 \right]
$$
or 
$$
p_{wf} = 0.125 \bar p \left[ \sqrt {81 -80 \left( \frac{ q} {q_{max}} \right) } -1 \right]
$$
+++
{{{
$$
q = q_{max } \left[ 1 - 0.2 \left( \frac{ p_{wf}} {\bar p} \right) - 0.8 \left( \frac{ p_{wf}} {\bar p} \right)^2 \right]
$$
}}}
{{{
$$
p_{wf} = 0.125 \bar p \left[ \sqrt {81 -80 \left( \frac{ q} {q_{max}} \right) -1} \right]
$$
}}}
===
To get started with this blank [[TiddlyWiki]], you'll need to modify the following tiddlers:
* [[SiteTitle]] & [[SiteSubtitle]]: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* [[MainMenu]]: The menu (usually on the left)
* [[DefaultTiddlers]]: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
{{borderlessL{
|option|Name|
|<<option txtUserName>>|username for signing your edits:|
|<<option txtBackupFolder>>|Name of folder to use for backups|
}}}
$$
\int_C P\,du + Q\, dv =
 \int\!\!\!\int_A \left({\partial Q\over \partial u} - {\partial P\over 
 \partial v}\right) {1\over \sqrt{EG-F^2}}\,dA,
$$
!Equations

[img[HardDiskCollision_difeq.png]]
Inert Monatomic Gas model

!EJS objects
* [[ParticleSet]]
<code java>
public class HelloWorld {
    public static void main(String args[]) {
        System.out.println("HelloWorld!");
    }
}
</code>
I was looking everywhere for this kind of type, and Delicious allowed me to find it:

"I just added the JDBC Driver jar (ojdbc14.jar) to my CLASSPATH and it works."

Reference:
http://www.halfcooked.com/mt/archives/000979.html
/***
|Name:|HideWhenPlugin|
|Description:|Allows conditional inclusion/exclusion in templates|
|Version:|3.1 ($Rev: 3919 $)|
|Date:|$Date: 2008-03-13 02:03:12 +1000 (Thu, 13 Mar 2008) $|
|Source:|http://mptw.tiddlyspot.com/#HideWhenPlugin|
|Author:|Simon Baird <simon.baird@gmail.com>|
|License:|http://mptw.tiddlyspot.com/#TheBSDLicense|
For use in ViewTemplate and EditTemplate. Example usage:
{{{<div macro="showWhenTagged Task">[[TaskToolbar]]</div>}}}
{{{<div macro="showWhen tiddler.modifier == 'BartSimpson'"><img src="bart.gif"/></div>}}}
***/
//{{{

window.hideWhenLastTest = false;

window.removeElementWhen = function(test,place) {
	window.hideWhenLastTest = test;
	if (test) {
		removeChildren(place);
		place.parentNode.removeChild(place);
	}
};


merge(config.macros,{

	hideWhen: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( eval(paramString), place);
	}},

	showWhen: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( !eval(paramString), place);
	}},

	hideWhenTagged: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( tiddler.tags.containsAll(params), place);
	}},

	showWhenTagged: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( !tiddler.tags.containsAll(params), place);
	}},

	hideWhenTaggedAny: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( tiddler.tags.containsAny(params), place);
	}},

	showWhenTaggedAny: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( !tiddler.tags.containsAny(params), place);
	}},

	hideWhenTaggedAll: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( tiddler.tags.containsAll(params), place);
	}},

	showWhenTaggedAll: { handler: function (place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( !tiddler.tags.containsAll(params), place);
	}},

	hideWhenExists: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( store.tiddlerExists(params[0]) || store.isShadowTiddler(params[0]), place);
	}},

	showWhenExists: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( !(store.tiddlerExists(params[0]) || store.isShadowTiddler(params[0])), place);
	}},

	hideWhenTitleIs: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( tiddler.title == params[0], place);
	}},

	showWhenTitleIs: { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( tiddler.title != params[0], place);
	}},

	'else': { handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		removeElementWhen( !window.hideWhenLastTest, place);
	}}

});

//}}}

A horizontal dividing line.
----
{{{----}}}
<<top>>
<<toggleSideBar>><<renameButton '>' >>
<<jump j '' top>>
<<saveChanges>><<renameButton s 'Save TiddlyWiki'>>
<<newTiddler>><<renameButton n>>
The two main pieces from which this site is built are [[TiddlyWiki|http://www.tiddlywiki.com/]], created by Jeremy Ruston, and [[jsMath|http://www.math.union.edu/~dpvc/jsMath/]], made by Davide P. Cervone.  Both of these excellent open source software packages are under continuing development and have supportive communities. 

[[Open Source Physics]] is the work of [[numerous people|osp team]]. They have published a couple of books, one on computational physics and the second is a user guide. The OSP project also contains an excellent set of computational libraries that can be used in any discipline. I have translated some OSP applications to Python+Java (or Jython), to make them even more accessible using the non-verbose Python syntax, besides the fact that I really love [[Python|python]].

[[Easy Java Simulations]] has been created by Francisco Esquembre and is part of the [[Open Source Physics]] project. It is a wonderful environment for developing simulations and models. The good thing about it is that doesn't need a skillful programmer to start producing models but knowing the physics behind, the equations and algorithms.
... as shown in Figure 3.8. Create a new model named [[ChargedParticlesElectricField3D.xml]] and save it in your working directory.

<<tiddler ChargedParticlesElectricField3D.jpg>>

!Create the view
Create a main window with a 3D drawing panel and a control panel using tje EJS elements. Set the properties azimuth, altitude, Focus X, Focus-Y, Focus-Z and rotation  of the DrawingPanel3D element to a value of zero. Set the ''Screen At'' with a value of 5.0. Add a vector field (VectorField3D) and ParticleSet3D elements to the drawing panel. Create the 3D grid by setting X, Y and Z components of the vector field to the 3D arrays {{{ex}}}, {{{ey}}} and ''{{{ez}}}''. Set the length property to ''0.05''. Set the ''ColorComponent'' property to {{{mag}}}, a 3D array which will be later created in the variables section. Set the ''AutoScale'' to false, the minimum to 0 and maximum to 10. Set the invisibility level to 4.

As for the particle set, open the inspector and set the positions X, Y and Z to ''{{{x}}}'', ''{{{y}}}'' and ''{{{z}}}'' variable names. Set the draggable property to true, so we can move the charges with the mouse and the ''Fill Color'' property to the array ''{{{colors}}}''.

Our panel should look like this:
<<tiddler ChargedParticlesElectricField3D.view.jpg>>

!Create the variables
Navigate to the variables section of the Model workpanel, create an integer variable for the grid size ''{{{m}}}'' with a value of 16, and create the ''{{{ex[m][m[m]}}}'', ''{{{ey[m][m[m]}}}'' and ''{{{ez[m][m[m]}}}'' arrays. Create the magnitude for the vectors with the array ''{{{mag[m][m[m]}}}''.

We next create variables to specify the location of the charged particles. Create ''{{{x}}}'', ''{{{y}}}'', ''{{{z}}}'', and ''{{{q}}}'' variables with dimension [//n//], where //n// is the number of charged particles and //q//[i] is the charge of the //i//-th particle. Set the value of //n// to 6. 

!Create the custom methods
Navigate to the Custom workpanel and define a method that positions the //n// charges on a circle (sphere?) with radius //r//.

<<tiddler ChargedParticlesElectricField3D_Custom-Methods>>

Navigate to the Initialization workpanel and add the following statement to invoke th custom method.

{{{
initializeCharge(); 	// sets charge position
}}}

!Create the Fixed Relations
<<tiddler [[Total Electrostatic Potential Energy]]>>

Navigate to the fixed relations workpanel and add code to compute the electrostatic potential energy at the grid points.

<<tiddler ChargedParticlesElectricField3D_Fixed-Relations>>
http://thesmartfield.com/images/tw-modeling/
http://thesmartfield.com/modeling/images/
/***
|Name|ImagePathPlugin|
|Source|http://www.TiddlyTools.com/#ImagePathPlugin|
|Version|0.7.1|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin,formatter|
|Requires||
|Overrides|'image' formatter|
|Description|Tell TiddlyWiki where to look for image files.  Permits multiple 'fallback' locations|
|Status|ALPHA - initial development/testing only - may be unstable - do not distribute|

!!!!!Usage
<<<
This plugin adds "resolvePath()" fallback processing to the {{{[img[...]]}}} formatter's handler, so that local image file references can be successfully resolved, even if the files cannot be located on the local filesystem.

The plugin tries alternative file "paths" that are listed, one per line, in an optional tiddler, [[ImagePathList]].  Each path in the list is combined with the image filename, which is then checked for existence, until the file is located.  If no alternative is found, or [[ImagePathList]] is not present, then a 'last-ditch' fallback is attempted using the remote system and path specified in [[SiteUrl]] (if present).

If no fallback attempt is successful (i.e., because no [[ImagePathList]] OR [[SiteUrl]] tiddlers have been defined), the plugin simply passes the original image file value along for default handling by the browser without any "path resolution" being applied.(i.e, the current TW core behavior occurs).

| ''Important note: This plugin may cause one or more security alert messages to appear, because it uses browser-specific functions that can require security permission in order to access the local filesystem to check for the existence of a given image file.  If you block local access, the 'last-ditch' fallback using the remote [[SiteUrl]] (if present) will be attempted.'' |

Note: the image formatter code contained here also includes support for AttachFilePlugin extensions (if installed).  AttachFilePlugin includes its own fallback mechanism for handling embedded vs. local file vs. remote URL references to the attached binary file.  Both methods may be used: ImagePathPlugin provides fallback for images contained in tiddler content, while AttachFilePlugin works well for access to non-image binary files (or images used in CSS as backgrounds, textures, etc.)
<<<
!!!!!Examples
<<<
coming soon...
<<<
!!!!!Revision History
<<<
''2007.04.13 [0.7.1]'' in testFile(), convert any file:// references to local native format before checking for existence.
''2007.03.26 [0.7.0]'' for IE, use onError handling to trigger call to resolvePath() so it will only be invoked if the original path/file is not found by the browser-native lookup.  This avoids an unneeded call to fileExists() and the accompanying ActiveX security alert message box (as well as being slightly more efficient...)
''2007.03.25 [0.6.0]'' code cleanup (moved global functions into config.formatterHelpers) plus documentation re-write
''2007.03.24 [0.5.0]'' initial implementation - ALPHA - do not distribute
<<<
!!!!!Code
***/
//{{{
version.extensions.imagePath = {major: 0, minor: 7, revision: 1, date: new Date(2007,4,13)};
//}}}
//{{{
// name of path definition tiddler
if (config.options.txtPathTiddler==undefined) config.options.txtPathTiddler="ImagePathList";
//}}}
//{{{
// low-level wrapper for platform-specific tests for local file existence
// returns true/false without visible error display
// Uses Components for FF and ActiveX FSO object for MSIE
// NOTE: this can cause a security warning on some browsers
config.formatterHelpers.fileExists=function(theFile) {
	var found=false;
	// DEBUG: alert('testing fileExists('+theFile+')...');
	if(window.Components) {
		try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); }
		catch(e) { return false; } // security access denied
		var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
		try { file.initWithPath(theFile); }
		catch(e) { return false; } // invalid directory
		found = file.exists();
	}
	else { // use ActiveX FSO object for MSIE 
		var fso = new ActiveXObject("Scripting.FileSystemObject");
		found = fso.FileExists(theFile)
	}
	// DEBUG: alert(theFile+" "+(found?"exists":"not found"));
	return found;
}
//}}}
//{{{
// higher-level logic for checking local file existence.
// with secondary check for finding relative file references
// and automatic OK of http-based references without checking local filesystem
config.formatterHelpers.testFile=function(theFile) {
	if (document.location.protocol!="file:") return true; // viewing remote document, can't test local filesystem... assume OK
	if (theFile.substr(0,5)=="http:") return true; // remote HTTP reference... assume OK
	if (theFile.substr(0,5)=="file:") theFile=getLocalPath(theFile); // convert local FILE reference to native format
	if (this.fileExists(theFile)) return true; // file exists locally... OK to use!
	// file might have been relative, add path from current document and try again
	var docPath=document.location.href;
	var slashpos=docPath.lastIndexOf("/"); if (slashpos==-1) slashpos=docPath.lastIndexOf("\\"); 
	if (slashpos!=-1 && slashpos!=docPath.length-1) docPath=docPath.substr(0,slashpos+1); // trim off filename
	if (this.fileExists(getLocalPath(docPath+theFile)))
		return true; // ah ha!... file exists relative to current document... OK to use!
	return false; // file not found on local system
}
//}}}
//{{{
// given a path/file string, check for existence and
// try alternatives (if any) defined in a tiddler
// with last-ditch using system/path from SiteUrl (if any)
config.formatterHelpers.resolvePath=function(theFile,testoriginal) {
	if (testoriginal && this.testFile(theFile)) return theFile; // FOUND FILE - use specified path/file without modification
	// get the filename portion only
	var slashpos=theFile.lastIndexOf("/"); if (slashpos==-1) slashpos=theFile.lastIndexOf("\\"); 
	var theName=(slashpos==-1)?theFile:theFile.substr(slashpos+1);
	// get list of fallbacks (if any)
	var pathText=store.getTiddlerText(config.options.txtPathTiddler);
	if (pathText && pathText.length) {
		var paths=pathText.split("\n");
		for (p=0; p<paths.length; p++) // combine path+filename until one works...
			if (this.testFile(paths[p]+theName))
				return paths[p]+theName; // FOUND FILE - use alternative path+filename
	}
	// try "last ditch" fallback using SiteURL - assumes that original path/file was relative to document location
	var siteURL=store.getTiddlerText("SiteUrl");
	if (!siteURL||!siteURL.length) return theFile; // NO FALLBACK - use original path/file and hope for the best
	// trim filename (if any) from site URL
	var slashpos=siteURL.lastIndexOf("/"); if (slashpos==-1) slashpos=siteURL.lastIndexOf("\\"); 
	if (slashpos!=-1 && slashpos!=siteURL.length-1) siteURL=siteURL.substr(0,slashpos+1);
	return siteURL+theFile; // LAST DITCH: use system/path from SiteUrl combined with original file/path
}
//}}}
//{{{
// replace standard handler for image formatter
// adds call to resolvePath() to handle fallback processing
// includes support for AttachFilePlugin as well
config.formatters[config.formatters.findByField("name","image")].handler=function(w) {
	if (!this.lookaheadRegExp)  // fixup for TW2.0.x
		this.lookaheadRegExp = new RegExp(this.lookahead,"mg");
	this.lookaheadRegExp.lastIndex = w.matchStart;
	var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
	if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
		// Simple bracketted link
		var e = w.output;
		if(lookaheadMatch[5]) {
			var link = lookaheadMatch[5];
			if (!config.formatterHelpers.isExternalLink) // fixup for TW2.0.x
				var external=!store.tiddlerExists(link)&&!store.isShadowTiddler(link);
			else
				var external=config.formatterHelpers.isExternalLink(link);
			if (external) {
				if (config.macros.attach && config.macros.attach.isAttachment(link)) { // ELS - attachments
					e = createExternalLink(w.output,link);
					e.href=config.macros.attach.getAttachment(link);
					e.title = config.macros.attach.linkTooltip + link;
				} else
					e = createExternalLink(w.output,link);
			} else 
				e = createTiddlyLink(w.output,link,false,null,w.isStatic);
			addClass(e,"imageLink");
		}
		var img = createTiddlyElement(e,"img");
		if(lookaheadMatch[1])
			img.align = "left";
		else if(lookaheadMatch[2])
			img.align = "right";
		if(lookaheadMatch[3])
			img.title = lookaheadMatch[3];
		if (config.macros.attach!=undefined && config.macros.attach.isAttachment(lookaheadMatch[4])) // ELS - attachments
			img.src=config.macros.attach.getAttachment(lookaheadMatch[4]);
		else {
			if (config.browser.isIE || config.browser.isSafari) { // ELS - path processing
				// IE and Safari use browser's onError handling to check the original file...
				// avoids extra security alert messages due to use of Components/ActiveX for filesystem access
				img.onerror=(function(){this.src=config.formatterHelpers.resolvePath(this.src,false);return false;});
				img.src=lookaheadMatch[4]; // ELS - path processing
			} else {
				// if NOT IE or Safari, always check the original path/file before rendering
				img.src=config.formatterHelpers.resolvePath(lookaheadMatch[4],true);
			}
		}
		w.nextMatch = this.lookaheadRegExp.lastIndex;
	}
}
//}}}

/***
|Name|ImageSizePlugin|
|Source|http://www.TiddlyTools.com/#ImageSizePlugin|
|Version|1.1.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,formatter|
|Requires||
|Overrides|'image' formatter|
|Description|extends image syntax to add optional CSS width/height values|
!!!!!Usage
<<<
Extends standard TiddlyWiki image syntax, ''{{{[img[...]]}}}'', so you can specify CSS width/height values.

The extended syntax is:
>''{{{[img(x,y)[...]]}}}''
>where x and y are the desired width and height of the image, specified using CSS units of measurement (e.g., px, em, cm, in, or %).  Use ''auto'' for either the width or height to scale image proportionally (i.e., maintain aspect ratio).  You may also calculate a CSS value on-the-fly by using //evaluated javascript//, enclosed between """{{""" and """}}""", e.g, {{{({{widthFunction()}},{{heightFunction()}})}}}.

Note: this plugin also includes enhancements to support:
*[[AttachFilePluginFormatters]] (embed image files as text-encoded tiddlers)
* [[ImagePathPlugin]] (fallback locations for missing images)
Please refer to those plugins for details...
<<<
!!!!!Examples
<<<
{{{
[<img(34%,auto)[images/meow.gif]]
[<img(21%,auto)[images/meow.gif]]
[<img(13%,auto)[images/meow.gif]]
[<img(8%,auto)[images/meow.gif]]
[<img(5%,auto)[images/meow.gif]]
[<img(3%,auto)[images/meow.gif]]
[<img(2%,auto)[images/meow.gif]]
[img(1%,auto)[images/meow.gif]]
}}}
[<img(34%,auto)[images/meow.gif]]
[<img(21%,auto)[images/meow.gif]]
[<img(13%,auto)[images/meow.gif]]
[<img(8%,auto)[images/meow.gif]]
[<img(5%,auto)[images/meow.gif]]
[<img(3%,auto)[images/meow.gif]]
[<img(2%,auto)[images/meow.gif]]
[img(1%,auto)[images/meow.gif]]
{{clear block{}}}
<<<
!!!!!Revisions
<<<
2008.01.19 [1.1.0] added support for evaluated width/height values!!
2008.01.18 [1.0.1] code cleanup plus improved regexp for matching "(width,height)" by eliminating hard-coded recognition of [px,em,cm,in,%] CSS units.  Syntax now accepts ANY values for width/height, and leaves it to the browser's CSS processing to handle any invalid values.
2008.01.17 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.ImageSizePlugin= {major: 1, minor: 1, revision: 0, date: new Date(2008,1,19)};

// replace standard handler for image formatter
// note: includes modifications for [[AttachFilePluginFormatters]] AND [[ImagePathPlugin]]
var f=config.formatters.findByField("name","image");
config.formatters[f].match="\\[[<>]?[Ii][Mm][Gg](?:\\([^,]*,[^\\)]*\\))?\\[";
config.formatters[f].lookaheadRegExp=/\[([<]?)(>?)[Ii][Mm][Gg](\([^,]*,[^\)]*\))?\[(?:([^\|\]]+)\|)?([^\[\]\|]+)\](?:\[([^\]]*)\])?\]/mg;
config.formatters[f].handler=function(w) {
	this.lookaheadRegExp.lastIndex = w.matchStart;
	var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
	if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
		var floatLeft=lookaheadMatch[1];
		var floatRight=lookaheadMatch[2];
		var XY=lookaheadMatch[3];
		var tooltip=lookaheadMatch[4];
		var src=lookaheadMatch[5];
		var link=lookaheadMatch[6];
		// Simple bracketted link
		var e = w.output;
		if(link) { // LINKED IMAGE
			if (config.formatterHelpers.isExternalLink(link)) {
				if (config.macros.attach && config.macros.attach.isAttachment(link)) {
					// see [[AttachFilePluginFormatters]]
					e = createExternalLink(w.output,link);
					e.href=config.macros.attach.getAttachment(link);
					e.title = config.macros.attach.linkTooltip + link;
				} else
					e = createExternalLink(w.output,link);
			} else 
				e = createTiddlyLink(w.output,link,false,null,w.isStatic);
			addClass(e,"imageLink");
		}
		var img = createTiddlyElement(e,"img");
		if(floatLeft) img.align="left"; else if(floatRight) img.align="right"; // FLOAT LEFT/RIGHT
		if(XY) { // CUSTOM SIZE with optional EVAL'ED width/height ({{...}},{{...}})
			var parts=XY.replace(/[\(\)]/g,'').split(","); var x=parts[0]; var y=parts[1];
			if (x.substr(0,2)=="{{") {
				try{img.style.width=eval(x.substr(2,x.length-4));}
				catch(e){displayMessage(e.description||e.toString())}
			} else img.style.width=x;

			if (y.substr(0,2)=="{{") {
				try{img.style.height=eval(y.substr(2,y.length-4));}
				catch(e){displayMessage(e.description||e.toString())}
			} else img.style.height=y;
		}
		if(tooltip) img.title = tooltip; // TOOLTIP
		// GET IMAGE SOURCE (get attachment or resolve fallback path as needed)
		if (config.macros.attach && config.macros.attach.isAttachment(src))
			src=config.macros.attach.getAttachment(src); // see [[AttachFilePluginFormatters]]
		else if (config.formatterHelpers.resolvePath) { // see [[ImagePathPlugin]]
			// Note: IE and Safari use onError to call resolvePath() only if initial lookup fails
			// (avoids security messages for initial filesystem access)... otherwise, attempt to
			// resolve the original path/file before initial rendering
			if (config.browser.isIE || config.browser.isSafari) {
				img.onerror=(function(){
					this.src=config.formatterHelpers.resolvePath(this.src,false);
					return false;
				});
			} else
				src=config.formatterHelpers.resolvePath(lookaheadMatch[5],true);
		}
		img.src=src; // RENDER IMAGE
		w.nextMatch = this.lookaheadRegExp.lastIndex;
	}
}
//}}}
Type the text for 'New Tiddler'
<<tiddlerList tags:[[In Progress]]>>
<<<
A whole block
of text to be quoted.
<<<
or
>>>Multiple levels of indented quotes.
>>Just like [[Bullet Points]].
>yep
>>or like [[Numbered Lists]]
That's what they said.
{{{
<<<
A whole block
of text to be quoted.
<<<
or
>>>Multiple levels of indented quotes.
>>Just like [[Bullet Points]].
>yep
>>or like [[Numbered Lists]]
That's what they said.
}}}

* Array of colors
* Call data from file method
{{{
speedColorList =  new Color[] {
  new Color(20, 0, 180), new Color(60, 0, 170), 
  new Color(80, 0, 160), new Color(100, 0, 150), 
  new Color(120, 0, 120), new Color(140, 0, 80),
  new Color(160, 0, 0), new Color(180, 0, 0),
  new Color(200, 0, 0), new Color(230, 0, 0), Color.RED,
  new Color(255, 60, 0), new Color(255, 90, 0),
  new Color(255, 120, 0), new Color(255, 150, 0),
  new Color(255, 180, 0), new Color(255, 210, 0), 
  new Color(255, 230, 0), Color.YELLOW,
  new Color(255, 255, 120)
} ;

readDataFromFile();
}}}
TiddlyWiki lets you write ordinary HTML by enclosing it in {{{<html>}}} and {{{</html>}}}:
<html>
<a href="javascript:;" onclick="onClickTiddlerLink(event);" 
tiddlyLink="Welcome"
style="background-color: yellow;">
Link to Welcome constructed in HTML</a>
</html>
{{{
<html>
<a href="javascript:;" onclick="onClickTiddlerLink(event);" 
tiddlyLink="Welcome"
style="background-color: yellow;">
Link to Welcome constructed in HTML</a>
</html>
}}}
HTML can enable some exotic new features (like [[embedding GMail and Outlook|http://groups.google.com/group/TiddlyWiki/browse_thread/thread/d363303aff5868d0/056269d8409d121f?lnk=st&q=embedding+gmail&rnum=1#056269d8409d121f]] in a TiddlyWiki). But, care needs to be taken with including things like JavaScript code.
/***
''InlineJavascriptPlugin''
^^version: 1.6.0
author: Eric Shulman - ELS Design Studios
source: http://www.tiddlytools.com/
license: [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]^^
see source link (above) for usage.
!!!!!Code
***/
/*{{{*/
version.extensions.inlineJavascript= {major: 1, minor: 6, revision: 0, date: new Date(2007,2,19)};

config.formatters.push( {
	name: "inlineJavascript",
	match: "\\<script",
	lookahead: "\\<script(?: src=\\\"((?:.|\\n)*?)\\\")?(?: label=\\\"((?:.|\\n)*?)\\\")?(?: title=\\\"((?:.|\\n)*?)\\\")?( show)?\\>((?:.|\\n)*?)\\</script\\>",

	handler: function(w) {
		var lookaheadRegExp = new RegExp(this.lookahead,"mg");
		lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = lookaheadRegExp.exec(w.source)
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
			if (lookaheadMatch[1]) { // load a script library
				// make script tag, set src, add to body to execute, then remove for cleanup
				var script = document.createElement("script"); script.src = lookaheadMatch[1];
				document.body.appendChild(script); document.body.removeChild(script);
			}
			if (lookaheadMatch[5]) { // there is script code
				if (lookaheadMatch[4]) // show inline script code in tiddler output
					wikify("{{{\n"+lookaheadMatch[0]+"\n}}}\n",w.output);
				if (lookaheadMatch[2]) { // create a link to an 'onclick' script
					// add a link, define click handler, save code in link (pass 'place'), set link attributes
					var link=createTiddlyElement(w.output,"a",null,"tiddlyLinkExisting",lookaheadMatch[2]);
					link.onclick=function(){try{return(eval(this.code))}catch(e){alert(e.description?e.description:e.toString())}}
					link.code="function _out(place){"+lookaheadMatch[5]+"\n};_out(this);"
					link.setAttribute("title",lookaheadMatch[3]?lookaheadMatch[3]:"");
					link.setAttribute("href","javascript:;");
					link.style.cursor="pointer";
				}
				else { // run inline script code
					var code="function _out(place){"+lookaheadMatch[5]+"\n};_out(w.output);"
					code=code.replace(/document.write\(/gi,'place.innerHTML+=(');
					try { var out = eval(code); } catch(e) { out = e.description?e.description:e.toString(); }
					if (out && out.length) wikify(out,w.output,w.highlightRegExp,w.tiddler);
				}
			}
			w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
		}
	}
} )
/*}}}*/
/***
|''Name:''|IntelliTaggerPlugin|
|''Version:''|1.0.2 (2007-07-25)|
|''Type:''|plugin|
|''Source:''|http://tiddlywiki.abego-software.de/#IntelliTaggerPlugin|
|''Author:''|Udo Borkowski (ub [at] abego-software [dot] de)|
|''Documentation:''|[[IntelliTaggerPlugin Documentation]]|
|''~SourceCode:''|[[IntelliTaggerPlugin SourceCode]]|
|''Licence:''|[[BSD open source license (abego Software)]]|
|''~CoreVersion:''|2.0.8|
|''Browser:''|Firefox 1.5.0.2 or better|
***/
/***
!Version History
* 1.0.2 (2007-07-25): 
** Feature: "Return" key may be used to accept first tag suggestion (beside "Alt-1")
** Bugfix: Keyboard shortcuts (Alt+3 etc.) shifted
* 1.0.1 (2007-05-18): Improvement: Speedup when using TiddlyWikis with many tags
* 1.0.0 (2006-04-26): Initial release

***/
// /%
if(!version.extensions.IntelliTaggerPlugin){if(!window.abego){window.abego={};}if(!abego.internal){abego.internal={};}abego.alertAndThrow=function(s){alert(s);throw s;};if(version.major<2){abego.alertAndThrow("Use TiddlyWiki 2.0.8 or better to run the IntelliTagger Plugin.");}version.extensions.IntelliTaggerPlugin={major:1,minor:0,revision:2,date:new Date(2007,6,25),type:"plugin",source:"http://tiddlywiki.abego-software.de/#IntelliTaggerPlugin",documentation:"[[IntelliTaggerPlugin Documentation]]",sourcecode:"[[IntelliTaggerPlugin SourceCode]]",author:"Udo Borkowski (ub [at] abego-software [dot] de)",licence:"[[BSD open source license (abego Software)]]",tiddlywiki:"Version 2.0.8 or better",browser:"Firefox 1.5.0.2 or better"};abego.createEllipsis=function(_2){var e=createTiddlyElement(_2,"span");e.innerHTML="&hellip;";};abego.isPopupOpen=function(_4){return _4&&_4.parentNode==document.body;};abego.openAsPopup=function(_5){if(_5.parentNode!=document.body){document.body.appendChild(_5);}};abego.closePopup=function(_6){if(abego.isPopupOpen(_6)){document.body.removeChild(_6);}};abego.getWindowRect=function(){return {left:findScrollX(),top:findScrollY(),height:findWindowHeight(),width:findWindowWidth()};};abego.moveElement=function(_7,_8,_9){_7.style.left=_8+"px";_7.style.top=_9+"px";};abego.centerOnWindow=function(_a){if(_a.style.position!="absolute"){throw "abego.centerOnWindow: element must have absolute position";}var _b=abego.getWindowRect();abego.moveElement(_a,_b.left+(_b.width-_a.offsetWidth)/2,_b.top+(_b.height-_a.offsetHeight)/2);};abego.isDescendantOrSelf=function(_c,e){while(e){if(_c==e){return true;}e=e.parentNode;}return false;};abego.toSet=function(_e){var _f={};for(var i=0;i<_e.length;i++){_f[_e[i]]=true;}return _f;};abego.filterStrings=function(_11,_12,_13){var _14=[];for(var i=0;i<_11.length&&(_13===undefined||_14.length<_13);i++){var s=_11[i];if(s.match(_12)){_14.push(s);}}return _14;};abego.arraysAreEqual=function(a,b){if(!a){return !b;}if(!b){return false;}var n=a.length;if(n!=b.length){return false;}for(var i=0;i<n;i++){if(a[i]!=b[i]){return false;}}return true;};abego.moveBelowAndClip=function(_1b,_1c){if(!_1c){return;}var _1d=findPosX(_1c);var _1e=findPosY(_1c);var _1f=_1c.offsetHeight;var _20=_1d;var _21=_1e+_1f;var _22=findWindowWidth();if(_22<_1b.offsetWidth){_1b.style.width=(_22-100)+"px";}var _23=_1b.offsetWidth;if(_20+_23>_22){_20=_22-_23-30;}if(_20<0){_20=0;}_1b.style.left=_20+"px";_1b.style.top=_21+"px";_1b.style.display="block";};abego.compareStrings=function(a,b){return (a==b)?0:(a<b)?-1:1;};abego.sortIgnoreCase=function(arr){var _27=[];var n=arr.length;for(var i=0;i<n;i++){var s=arr[i];_27.push([s.toString().toLowerCase(),s]);}_27.sort(function(a,b){return (a[0]==b[0])?0:(a[0]<b[0])?-1:1;});for(i=0;i<n;i++){arr[i]=_27[i][1];}};abego.getTiddlerField=function(_2d,_2e,_2f){var _30=document.getElementById(_2d.idPrefix+_2e);var e=null;if(_30!=null){var _32=_30.getElementsByTagName("*");for(var t=0;t<_32.length;t++){var c=_32[t];if(c.tagName.toLowerCase()=="input"||c.tagName.toLowerCase()=="textarea"){if(!e){e=c;}if(c.getAttribute("edit")==_2f){e=c;}}}}return e;};abego.setRange=function(_35,_36,end){if(_35.setSelectionRange){_35.setSelectionRange(_36,end);var max=0+_35.scrollHeight;var len=_35.textLength;var top=max*_36/len,bot=max*end/len;_35.scrollTop=Math.min(top,(bot+top-_35.clientHeight)/2);}else{if(_35.createTextRange!=undefined){var _3b=_35.createTextRange();_3b.collapse();_3b.moveEnd("character",end);_3b.moveStart("character",_36);_3b.select();}else{_35.select();}}};abego.internal.TagManager=function(){var _3c=null;var _3d=function(){if(_3c){return;}_3c={};store.forEachTiddler(function(_3e,_3f){for(var i=0;i<_3f.tags.length;i++){var tag=_3f.tags[i];var _42=_3c[tag];if(!_42){_42=_3c[tag]={count:0,tiddlers:{}};}_42.tiddlers[_3f.title]=true;_42.count+=1;}});};var _43=TiddlyWiki.prototype.saveTiddler;TiddlyWiki.prototype.saveTiddler=function(_44,_45,_46,_47,_48,_49){var _4a=this.fetchTiddler(_44);var _4b=_4a?_4a.tags:[];var _4c=(typeof _49=="string")?_49.readBracketedList():_49;_43.apply(this,arguments);if(!abego.arraysAreEqual(_4b,_4c)){abego.internal.getTagManager().reset();}};var _4d=TiddlyWiki.prototype.removeTiddler;TiddlyWiki.prototype.removeTiddler=function(_4e){var _4f=this.fetchTiddler(_4e);var _50=_4f&&_4f.tags.length>0;_4d.apply(this,arguments);if(_50){abego.internal.getTagManager().reset();}};this.reset=function(){_3c=null;};this.getTiddlersWithTag=function(tag){_3d();var _52=_3c[tag];return _52?_52.tiddlers:null;};this.getAllTags=function(_53){_3d();var _54=[];for(var i in _3c){_54.push(i);}for(i=0;_53&&i<_53.length;i++){_54.pushUnique(_53[i],true);}abego.sortIgnoreCase(_54);return _54;};this.getTagInfos=function(){_3d();var _56=[];for(var _57 in _3c){_56.push([_57,_3c[_57]]);}return _56;};var _58=function(a,b){var a1=a[1];var b1=b[1];var d=b[1].count-a[1].count;return d!=0?d:abego.compareStrings(a[0].toLowerCase(),b[0].toLowerCase());};this.getSortedTagInfos=function(){_3d();var _5e=this.getTagInfos();_5e.sort(_58);return _5e;};this.getPartnerRankedTags=function(_5f){var _60={};for(var i=0;i<_5f.length;i++){var _62=this.getTiddlersWithTag(_5f[i]);for(var _63 in _62){var _64=store.getTiddler(_63);if(!(_64 instanceof Tiddler)){continue;}for(var j=0;j<_64.tags.length;j++){var tag=_64.tags[j];var c=_60[tag];_60[tag]=c?c+1:1;}}}var _68=abego.toSet(_5f);var _69=[];for(var n in _60){if(!_68[n]){_69.push(n);}}_69.sort(function(a,b){var d=_60[b]-_60[a];return d!=0?d:abego.compareStrings(a.toLowerCase(),b.toLowerCase());});return _69;};};abego.internal.getTagManager=function(){if(!abego.internal.gTagManager){abego.internal.gTagManager=new abego.internal.TagManager();}return abego.internal.gTagManager;};(function(){var _6e=2;var _6f=1;var _70=30;var _71;var _72;var _73;var _74;var _75;var _76;if(!abego.IntelliTagger){abego.IntelliTagger={};}var _77=function(){return _72;};var _78=function(tag){return _75[tag];};var _7a=function(s){var i=s.lastIndexOf(" ");return (i>=0)?s.substr(0,i):"";};var _7d=function(_7e){var s=_7e.value;var len=s.length;return (len>0&&s[len-1]!=" ");};var _81=function(_82){var s=_82.value;var len=s.length;if(len>0&&s[len-1]!=" "){_82.value+=" ";}};var _85=function(tag,_87,_88){if(_7d(_87)){_87.value=_7a(_87.value);}story.setTiddlerTag(_88.title,tag,0);_81(_87);abego.IntelliTagger.assistTagging(_87,_88);};var _89=function(n){if(_76&&_76.length>n){return _76[n];}return (_74&&_74.length>n)?_74[n]:null;};var _8b=function(n,_8d,_8e){var _8f=_89(n);if(_8f){_85(_8f,_8d,_8e);}};var _90=function(_91){var pos=_91.value.lastIndexOf(" ");var _93=(pos>=0)?_91.value.substr(++pos,_91.value.length):_91.value;return new RegExp(_93.escapeRegExp(),"i");};var _94=function(_95,_96){var _97=0;for(var i=0;i<_95.length;i++){if(_96[_95[i]]){_97++;}}return _97;};var _99=function(_9a,_9b,_9c){var _9d=1;var c=_9a[_9b];for(var i=_9b+1;i<_9a.length;i++){if(_9a[i][1].count==c){if(_9a[i][0].match(_9c)){_9d++;}}else{break;}}return _9d;};var _a0=function(_a1,_a2){var _a3=abego.internal.getTagManager().getSortedTagInfos();var _a4=[];var _a5=0;for(var i=0;i<_a3.length;i++){var c=_a3[i][1].count;if(c!=_a5){if(_a2&&(_a4.length+_99(_a3,i,_a1)>_a2)){break;}_a5=c;}if(c==1){break;}var s=_a3[i][0];if(s.match(_a1)){_a4.push(s);}}return _a4;};var _a9=function(_aa,_ab){return abego.filterStrings(abego.internal.getTagManager().getAllTags(_ab),_aa);};var _ac=function(){if(!_71){return;}var _ad=store.getTiddlerText("IntelliTaggerMainTemplate");if(!_ad){_ad="<b>Tiddler IntelliTaggerMainTemplate not found</b>";}_71.innerHTML=_ad;applyHtmlMacros(_71,null);refreshElements(_71,null);};var _ae=function(e){if(!e){var e=window.event;}var tag=this.getAttribute("tag");if(_73){_73.call(this,tag,e);}return false;};var _b2=function(_b3){createTiddlyElement(_b3,"span",null,"tagSeparator"," | ");};var _b4=function(_b5,_b6,_b7,_b8,_b9){if(!_b6){return;}var _ba=_b8?abego.toSet(_b8):{};var n=_b6.length;var c=0;for(var i=0;i<n;i++){var tag=_b6[i];if(_ba[tag]){continue;}if(c>0){_b2(_b5);}if(_b9&&c>=_b9){abego.createEllipsis(_b5);break;}c++;var _bf="";var _c0=_b5;if(_b7<10){_c0=createTiddlyElement(_b5,"span",null,"numberedSuggestion");_b7++;var key=_b7<10?""+(_b7):"0";createTiddlyElement(_c0,"span",null,"suggestionNumber",key+") ");var _c2=_b7==1?"Return or ":"";_bf=" (Shortcut: %1Alt-%0)".format([key,_c2]);}var _c3=config.views.wikified.tag.tooltip.format([tag]);var _c4=(_78(tag)?"Remove tag '%0'%1":"Add tag '%0'%1").format([tag,_bf]);var _c5="%0; Shift-Click: %1".format([_c4,_c3]);var btn=createTiddlyButton(_c0,tag,_c5,_ae,_78(tag)?"currentTag":null);btn.setAttribute("tag",tag);}};var _c7=function(){if(_71){window.scrollTo(0,ensureVisible(_71));}if(_77()){window.scrollTo(0,ensureVisible(_77()));}};var _c8=function(e){if(!e){var e=window.event;}if(!_71){return;}var _cb=resolveTarget(e);if(_cb==_77()){return;}if(abego.isDescendantOrSelf(_71,_cb)){return;}abego.IntelliTagger.close();};addEvent(document,"click",_c8);var _cc=Story.prototype.gatherSaveFields;Story.prototype.gatherSaveFields=function(e,_ce){_cc.apply(this,arguments);var _cf=_ce.tags;if(_cf){_ce.tags=_cf.trim();}};var _d0=function(_d1){story.focusTiddler(_d1,"tags");var _d2=abego.getTiddlerField(story,_d1,"tags");if(_d2){var len=_d2.value.length;abego.setRange(_d2,len,len);window.scrollTo(0,ensureVisible(_d2));}};var _d4=config.macros.edit.handler;config.macros.edit.handler=function(_d5,_d6,_d7,_d8,_d9,_da){_d4.apply(this,arguments);var _db=_d7[0];if((_da instanceof Tiddler)&&_db=="tags"){var _dc=_d5.lastChild;_dc.onfocus=function(e){abego.IntelliTagger.assistTagging(_dc,_da);setTimeout(function(){_d0(_da.title);},100);};_dc.onkeyup=function(e){if(!e){var e=window.event;}if(e.altKey&&!e.ctrlKey&&!e.metaKey&&(e.keyCode>=48&&e.keyCode<=57)){_8b(e.keyCode==48?9:e.keyCode-49,_dc,_da);}else{if(e.ctrlKey&&e.keyCode==32){_8b(0,_dc,_da);}}if(!e.ctrlKey&&(e.keyCode==13||e.keyCode==10)){_8b(0,_dc,_da);}setTimeout(function(){abego.IntelliTagger.assistTagging(_dc,_da);},100);return false;};_81(_dc);}};var _e0=function(e){if(!e){var e=window.event;}var _e3=resolveTarget(e);var _e4=_e3.getAttribute("tiddler");if(_e4){story.displayTiddler(_e3,_e4,"IntelliTaggerEditTagsTemplate",false);_d0(_e4);}return false;};var _e5=config.macros.tags.handler;config.macros.tags.handler=function(_e6,_e7,_e8,_e9,_ea,_eb){_e5.apply(this,arguments);abego.IntelliTagger.createEditTagsButton(_eb,createTiddlyElement(_e6.lastChild,"li"));};var _ec=function(){if(_71&&_72&&!abego.isDescendantOrSelf(document,_72)){abego.IntelliTagger.close();}};setInterval(_ec,100);abego.IntelliTagger.displayTagSuggestions=function(_ed,_ee,_ef,_f0,_f1){_74=_ed;_75=abego.toSet(_ee);_76=_ef;_72=_f0;_73=_f1;if(!_71){_71=createTiddlyElement(document.body,"div",null,"intelliTaggerSuggestions");_71.style.position="absolute";}_ac();abego.openAsPopup(_71);if(_77()){var w=_77().offsetWidth;if(_71.offsetWidth<w){_71.style.width=(w-2*(_6e+_6f))+"px";}abego.moveBelowAndClip(_71,_77());}else{abego.centerOnWindow(_71);}_c7();};abego.IntelliTagger.assistTagging=function(_f3,_f4){var _f5=_90(_f3);var s=_f3.value;if(_7d(_f3)){s=_7a(s);}var _f7=s.readBracketedList();var _f8=_f7.length>0?abego.filterStrings(abego.internal.getTagManager().getPartnerRankedTags(_f7),_f5,_70):_a0(_f5,_70);abego.IntelliTagger.displayTagSuggestions(_a9(_f5,_f7),_f7,_f8,_f3,function(tag,e){if(e.shiftKey){onClickTag.call(this,e);}else{_85(tag,_f3,_f4);}});};abego.IntelliTagger.close=function(){abego.closePopup(_71);_71=null;return false;};abego.IntelliTagger.createEditTagsButton=function(_fb,_fc,_fd,_fe,_ff,id,_101){if(!_fd){_fd="[edit]";}if(!_fe){_fe="Edit the tags";}if(!_ff){_ff="editTags";}var _102=createTiddlyButton(_fc,_fd,_fe,_e0,_ff,id,_101);_102.setAttribute("tiddler",(_fb instanceof Tiddler)?_fb.title:String(_fb));return _102;};abego.IntelliTagger.getSuggestionTagsMaxCount=function(){return 100;};config.macros.intelliTagger={label:"intelliTagger",handler:function(_103,_104,_105,_106,_107,_108){var _109=_107.parseParams("list",null,true);var _10a=_109[0]["action"];for(var i=0;_10a&&i<_10a.length;i++){var _10c=_10a[i];var _10d=config.macros.intelliTagger.subhandlers[_10c];if(!_10d){abego.alertAndThrow("Unsupported action '%0'".format([_10c]));}_10d(_103,_104,_105,_106,_107,_108);}},subhandlers:{showTags:function(_10e,_10f,_110,_111,_112,_113){_b4(_10e,_74,_76?_76.length:0,_76,abego.IntelliTagger.getSuggestionTagsMaxCount());},showFavorites:function(_114,_115,_116,_117,_118,_119){_b4(_114,_76,0);},closeButton:function(_11a,_11b,_11c,_11d,_11e,_11f){var _120=createTiddlyButton(_11a,"close","Close the suggestions",abego.IntelliTagger.close);},version:function(_121){var t="IntelliTagger %0.%1.%2".format([version.extensions.IntelliTaggerPlugin.major,version.extensions.IntelliTaggerPlugin.minor,version.extensions.IntelliTaggerPlugin.revision]);var e=createTiddlyElement(_121,"a");e.setAttribute("href","http://tiddlywiki.abego-software.de/#IntelliTaggerPlugin");e.innerHTML="<font color=\"black\" face=\"Arial, Helvetica, sans-serif\">"+t+"<font>";},copyright:function(_124){var e=createTiddlyElement(_124,"a");e.setAttribute("href","http://tiddlywiki.abego-software.de");e.innerHTML="<font color=\"black\" face=\"Arial, Helvetica, sans-serif\">&copy; 2006-2007 <b><font color=\"red\">abego</font></b> Software<font>";}}};})();config.shadowTiddlers["IntelliTaggerStyleSheet"]="/***\n"+"!~IntelliTagger Stylesheet\n"+"***/\n"+"/*{{{*/\n"+".intelliTaggerSuggestions {\n"+"\tposition: absolute;\n"+"\twidth: 600px;\n"+"\n"+"\tpadding: 2px;\n"+"\tlist-style: none;\n"+"\tmargin: 0;\n"+"\n"+"\tbackground: #eeeeee;\n"+"\tborder: 1px solid DarkGray;\n"+"}\n"+"\n"+".intelliTaggerSuggestions .currentTag {\n"+"\tfont-weight: bold;\n"+"}\n"+"\n"+".intelliTaggerSuggestions .suggestionNumber {\n"+"\tcolor: #808080;\n"+"}\n"+"\n"+".intelliTaggerSuggestions .numberedSuggestion{\n"+"\twhite-space: nowrap;\n"+"}\n"+"\n"+".intelliTaggerSuggestions .intelliTaggerFooter {\n"+"\tmargin-top: 4px;\n"+"\tborder-top-width: thin;\n"+"\tborder-top-style: solid;\n"+"\tborder-top-color: #999999;\n"+"}\n"+".intelliTaggerSuggestions .favorites {\n"+"\tborder-bottom-width: thin;\n"+"\tborder-bottom-style: solid;\n"+"\tborder-bottom-color: #999999;\n"+"\tpadding-bottom: 2px;\n"+"}\n"+"\n"+".intelliTaggerSuggestions .normalTags {\n"+"\tpadding-top: 2px;\n"+"}\n"+"\n"+".intelliTaggerSuggestions .intelliTaggerFooter .button {\n"+"\tfont-size: 10px;\n"+"\n"+"\tpadding-left: 0.3em;\n"+"\tpadding-right: 0.3em;\n"+"}\n"+"\n"+"/*}}}*/\n";config.shadowTiddlers["IntelliTaggerMainTemplate"]="<!--\n"+"{{{\n"+"-->\n"+"<div class=\"favorites\" macro=\"intelliTagger action: showFavorites\"></div>\n"+"<div class=\"normalTags\" macro=\"intelliTagger action: showTags\"></div>\n"+"<!-- The Footer (with the Navigation) ============================================ -->\n"+"<table class=\"intelliTaggerFooter\" border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tbody>\n"+" <tr>\n"+"\t<td align=\"left\">\n"+"\t\t<span macro=\"intelliTagger action: closeButton\"></span>\n"+"\t</td>\n"+"\t<td align=\"right\">\n"+"\t\t<span macro=\"intelliTagger action: version\"></span>, <span macro=\"intelliTagger action: copyright \"></span>\n"+"\t</td>\n"+" </tr>\n"+"</tbody></table>\n"+"<!--\n"+"}}}\n"+"-->\n";config.shadowTiddlers["IntelliTaggerEditTagsTemplate"]="<!--\n"+"{{{\n"+"-->\n"+"<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler'></div>\n"+"<div class='title' macro='view title'></div>\n"+"<div class='tagged' macro='tags'></div>\n"+"<div class='viewer' macro='view text wikified'></div>\n"+"<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler'></div>\n"+"<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>\n"+"<!--\n"+"}}}\n"+"-->\n";config.shadowTiddlers["BSD open source license (abego Software)"]="See [[Licence|http://tiddlywiki.abego-software.de/#%5B%5BBSD%20open%20source%20license%5D%5D]].";config.shadowTiddlers["IntelliTaggerPlugin Documentation"]="[[Documentation on abego Software website|http://tiddlywiki.abego-software.de/doc/IntelliTagger.pdf]].";config.shadowTiddlers["IntelliTaggerPlugin SourceCode"]="[[Plugin source code on abego Software website|http://tiddlywiki.abego-software.de/archive/IntelliTaggerPlugin/Plugin-IntelliTagger-src.1.0.2.js]]\n";(function(){var _126=restart;restart=function(){setStylesheet(store.getTiddlerText("IntelliTaggerStyleSheet"),"IntelliTaggerStyleSheet");_126.apply(this,arguments);};})();}
// %/
/***
!~IntelliTagger Stylesheet
***/
/*{{{*/
.intelliTaggerSuggestions {
	position: absolute;
	width: 600px;

	padding: 2px;
	list-style: none;
	margin: 0;

	background: #eeeeee;
	border: 1px solid DarkGray;
}

.intelliTaggerSuggestions .currentTag {
	font-weight: bold;
}

.intelliTaggerSuggestions .suggestionNumber {
	color: #808080;
}

.intelliTaggerSuggestions .numberedSuggestion{
	white-space: nowrap;
}

.intelliTaggerSuggestions .intelliTaggerFooter {
	margin-top: 4px;
	border-top-width: thin;
	border-top-style: solid;
	border-top-color: #999999;
}
.intelliTaggerSuggestions .favorites {
	border-bottom-width: thin;
	border-bottom-style: solid;
	border-bottom-color: #999999;
	padding-bottom: 2px;
}

.intelliTaggerSuggestions .normalTags {
	padding-top: 2px;
}

.intelliTaggerSuggestions .intelliTaggerFooter .button {
	font-size: 10px;

	padding-left: 0.3em;
	padding-right: 0.3em;
}

/*}}}*/
http://homepage.univie.ac.at/Franz.Vesely/cp_tut/nol2h/new/index.html
!!!![[Launch iprFlowSelector|http://thesmartfield.com/tw/modeling/jws/IprFlowSelector.jnlp]]
<<tiddler [[CobWebPlot.jpg]]>>
{{{
c:\apps\jdk
}}}
!Tree structure
$ tree -L 1
{{{
.
|-- COPYRIGHT
|-- LICENSE
|-- LICENSE.rtf
|-- README.html
|-- THIRDPARTYLICENSEREADME.txt
|-- bin
|-- demo
|-- include
|-- jre
|-- lib
|-- sample
`-- src.zip

6 directories, 6 files
}}}
This is a hidden feature.
It must declared first in EJS ''//Options and Files//'' in //''Imports''//:
{{{
org.colos.ejs.library.control.swing.JSliderDouble;
}}}
Then must be declared in the Variables module as a type ''JSliderDouble''.

!![[JSliderDouble.png]]
[img(90%,auto)[JSliderDouble.png][JSliderDouble.png]]
[img[JSliderDouble.png]]
''Java:''
<code java>
    try {
      reFun = new ParsedMultiVarFunction(fstr, new String[] {"x", "y"});
    } catch(ParserException ex) {
      myControl.println("invalid function:"+fstr);
      myControl.println(ex.getMessage());
      return;
    }
</code>
''Jython:''
<code py>
        try:
            self.reFun = ParsedMultiVarFunction(fstr, ["x", "y"]);
        except ParserException, ex:
            self.myControl.println("invalid function:" + fstr);
            self.myControl.println(ex.getMessage());
            return
</code>
In my Linux Mint box (Felicia), following the same instructions that apply to [[cygwin]], I obtained the same results. Assuming that the JWS file [[SurfaceArrayApp.local.jnlp]] is created under the folder {{{/home/user/Programming/jython_osp}}} and [[jython_osp.jar]] reside in the same folder, then we can run the Java Web Start application from our local drive. The .jnlp should look like this:
<<tiddler SurfaceArrayApp.local.jnlp>> [[SurfaceArrayApp.local.jnlp]]
<code python>
from java.lang import Math
import java.lang.reflect.Array
n = 128
xdata = java.lang.reflect.Array.newInstance(java.lang.Double.TYPE,[n])
# real and imaginary values alternate
zdata = java.lang.reflect.Array.newInstance(java.lang.Double.TYPE,[2*n]) 
mode = 4
for i in range(0,n,1):
	a = Math.exp(-x*x/4)  # wave function amplitude
	# function is e^(-x*x/4)e^(i*mode*x) where x=[-pi,pi)
	zdata[2*i] = a*Math.cos(mode*x);
	zdata[2*i+1] = a*Math.sin(mode*x);
	xdata[i] = x;
	x = x + dx;
</code>
<code java>
Display3DFrame frame = new Display3DFrame("3D Demo 1");
Element cylinder1 = new ElementCylinder();
private double x, y, vx, vy; // initial position and velocity
Polynomial p;
IdealDemon idealGas = new IdealDemon();
SimulationControl control = SimulationControl.createApp(new IdealDemonApp());

</code>

<code python>
frame = Display3DFrame("3D Demo 1")
cylinder1 = ElementCylinder()
x, y, vx, vy = 0.0, 0.0, 0.0, 0.0    # initial position and velocity
p = Polynomial
idealGas = IdealDemon()
control = SimulationControl.createApp(IdealDemonApp())

</code>
http://www.prasannatech.net/2008/10/jython-inheritance-java.html?showComment=1223402880000
I have been trying to write a physics application using the Open Source Physics (OSP) libraries at http://www.opensourcephysics.org/ but had no success.

The people at http://www.nabble.com/jython-users-f4123.html helped me and finally I was able to resolve the issue that was stopping me to use the OSP "control." GUI utilities.

There were indeed two issues: one, that I missed to add the "self." to the abstract class method calls, and two, that Jython would not allow you by default to access the non-public methods inside an abstract class - you will need to tell Jython to allow that by modifying the registry.

To do that, open the Jython registry and change the registry from

python.security.respectJavaAccessibility = true

to

python.security.respectJavaAccessibility = false

That's it!

Here is the code for [[CalculationApp.py]] and here is the code for [[CalculationApp.java]].

!Why in first place shall we use [[cygwin]]? 
With all those good IDE tools around why should we choose a command console like [[cygwin]]?

This doesn't mean at all that I don't use anymore [[Eclipse]] -my favorite IDE-, or Sun NetBeans. They are great development environments. But when it comes to understand the core of the process -specially, compilation and generation of JAR libraries, it is better to work under the hood using the command line. Once the process is understood and is made repeatable we can go back to the IDE. 

We won't be able to configure any IDE if we first do not understand first the use of the commands: [[javac]], [[jar]], [[jythonc]], [[java]] or [[jython]], much less [[CLASSPATH]] or [[Ant]]. You will find out after compiling Jython code to Java bytecode that all these steps can be put in an [[Ant]] script and executed from Eclipse, for instance.
 
I choose [[cygwin]] over the Windows cmd.exe console because [[cygwin]] is the closest that you can get to the Unix/Linux environment. The combinations of parameter's configuration are endless; the commands and tools available are unmatched if compared to the Windows console. And, you can borrow scripts from Unix or Linux and they will run in your [[cygwin]] console. 

No, I am not a *nix wizard; just started to fall in love with Unix/Linux a 3-4 years ago. Installing [[cygwin]] just brings that power to your programming development.

So, my perception is that the [[cygwin]] console is a perfect companion of the IDEs - say Eclipse or NetBeans - rather than being mutually exclusive among them.

Alfonso Reyes - Houston, Texas - November 2008

!Step 1: Strategy and definitions
It reduces to this:
* where you will install all your binaries and applications
** cygwin
** Java JDK and JRE
** Jython
** your editor, it could be jEdit or GVim if [[vi]] or [[nano]] are not too graphical for you
** Eclipse IDE - optional at this phase
** Tomcat - optional at this phase

!!Start defining what will be your binaries location:
It is preferable that you choose a folder different than [[C:\Program Files]] because the space in the file name will not help you and cause trouble when we start compiling and packaging. I don't mean you cannot do it but gets your process more complicated. Additionally, you establish a unique folder organization that you know you created and have control.

!!!This is for Jython:
<<tiddler "Jython folder location">>

!!!And this is for the Java JDK:
<<tiddler "Location for Java .jar libraries">>

!!!This is for the Eclipse IDE:
<<tiddler "Eclipse location">>

!!!This is for Tomcat local server:
<<tiddler "Apache Tomcat location">>

!!!And here where you could install ''cygwin'': 
[[edit|cygwin folder location]]
<<tiddler "cygwin folder location">>

!Step 2: Install the software
!Step 3: Set the environment
!Step 4: Test with some simple applications
{{{
c:\apps\jython2.2.1
}}}
I started with Jython couple of weeks ago and found it perfect for my purposes. Jython combines the simplicity of Python programming and the vast source of Java libraries.
[[Interfacing Java and Jython]]
Access keys are shortcuts to common functions accessed by typing a letter with either the 'alt' (PC) or 'control' (Mac) key:
|!PC|!Mac|!Function|
|Alt-F|Ctrl-F|Search|
|Alt-J|Ctrl-J|NewJournal|
|Alt-N|Ctrl-N|NewTiddler|
|Alt-S|Ctrl-S|SaveChanges|
These access keys are provided by the associated internal [[Macros]] for the functions above. The macro needs to be used in an open tiddler (or the [[MainMenu]] or SideBar) in order for the access keys to work.

While editing a tiddler:
* ~Control-Enter or ~Control-Return accepts your changes and switches out of editing mode (use ~Shift-Control-Enter or ~Shift-Control-Return to stop the date and time being updated for MinorChanges)
* Escape abandons your changes and reverts the tiddler to its previous state

In the search box:
* Escape clears the search term
//Use the first method in each example below, unless you have some reason not to.//
Mathematical symbols, such as \(e^{x^2}\), may be inserted inline.
{{{
Mathematical symbols, such as $e^{x^2}$, may be inserted inline.
Mathematical symbols, such as \(e^{x^2}\), may be inserted inline.
}}}
Or as displayed math,$$e^{x^2}$$ on its own line.
{{{
Or as displayed math, \[e^{x^2}\] on its own line.
Or as displayed math, $$e^{x^2}$$ on its own line.
Or as displayed math, \begin{equation}e^{x^2}\end{equation} on its own line.
}}}
Or as an equation array,
\begin{eqnarray}A &=& e^{x^2}\\&=&C\end{eqnarray}
{{{
Or as an equation array,\begin{eqnarray}A &=& e^{x^2}\\&=& C\end{eqnarray}
}}}

Some of the available TeX symbols can be found at [[jsMath|http://www.math.union.edu/~dpvc/jsMath/symbols/welcome.html]], the best method I could find  for displaying TeX online.  The small button in the lower right corner of this window opens its control planel.  I'm not sure how many LaTeX and AMSTeX commands are supported -- play around.

TeX substitution macros such as $\f{A}$, ({{{$\f{A}$}}}), may be inserted into the [[jsMathPlugin]] just before the jsMath.process call.  See that plugin for abbreviated commands I've included.

!EJS Objects used:
*[[ArrayPanels]]
Lax method with half-step: $\Delta x/2$, $\Delta t/2$:
$
\begin{eqnarray}
 u_{j+1/2}^{n+1/2} & = & \frac{1}{2}
\left[ u_{j+1}^{n}+ u_{j}^{n} \right]
-\frac{\textstyle \Delta t}{\textstyle 2\Delta x}
\left[ j_{j+1}^{n}- j_{j}^{n} \right]
 \end{eqnarray}
$
and analogously for $ u_{j-1/2}^{n+1/2}\;$.

Evaluation, e.g. for the advective case $j= C \cdot u$:
$
\begin{eqnarray}
 u_{j+1/2}^{n+1/2} &\Longrightarrow& j_{j+1/2}^{n+1/2}
 \end{eqnarray}
$


Leapfrog with half-step:
$
\begin{eqnarray}
 u_{j}^{n+1}&=& u_{j}^{n}
-\frac{\textstyle \Delta t}{\textstyle \Delta x}
\left[ j_{j+1/2}^{n+1/2}- j_{j-1/2}^{n+1/2} \right]
 \end{eqnarray}
$
$$
u(r)= 4 \epsilon \left[ \left(
\frac{\textstyle r}{\textstyle \sigma}\right)^{-12}
- \left(\frac{\textstyle r}{\textstyle \sigma}\right)^{-6} \right]
$$
/***
| Name|LessBackupsPlugin|
| Description|Intelligently limit the number of backup files you create|
| Version|3.0 ($Rev: 2320 $)|
| Date|$Date: 2007-06-18 22:37:46 +1000 (Mon, 18 Jun 2007) $|
| Source|http://mptw.tiddlyspot.com/#LessBackupsPlugin|
| Author|Simon Baird|
| Email|simon.baird@gmail.com|
| License|http://mptw.tiddlyspot.com/#TheBSDLicense|
!!!Description
You end up with just backup one per year, per month, per weekday, per hour, minute, and second.  So total number won't exceed about 200 or so. Can be reduced by commenting out the seconds/minutes/hours line from modes array

!!!Notes
Works in IE and Firefox only.  Algorithm by Daniel Baird. IE code by by Saq Imtiaz.
!!!Code
***/
//{{{
window.getSpecialBackupPath = function(backupPath) {

	var MINS  = 60 * 1000;
	var HOURS = 60 * MINS;
	var DAYS  = 24 * HOURS;

	// comment out the ones you don't want
	var modes = [
		["YYYY",  365*DAYS], // one per year for ever
		["MMM",   31*DAYS],  // one per month
		["ddd",   7*DAYS],   // one per weekday
		//["d0DD",  1*DAYS],   // one per day of month
		["h0hh",  24*HOURS], // one per hour
		["m0mm",  1*HOURS],  // one per minute
		["s0ss",  1*MINS],   // one per second
		["latest",0]         // always keep last version. (leave this).
	];

	var now = new Date();

	for (var i=0;i<modes.length;i++) {

		// the filename we will try
		var specialBackupPath = backupPath.replace(/(\.)([0-9]+\.[0-9]+)(\.html)$/,
						'$1'+now.formatString(modes[i][0]).toLowerCase()+'$3')

		// open the file

		try {
			if (config.browser.isIE) {
				var fsobject = new ActiveXObject("Scripting.FileSystemObject")
				var fileExists  = fsobject.FileExists(specialBackupPath);
				if (fileExists) {
					var fileObject = fsobject.GetFile(specialBackupPath);
					var modDate = new Date(fileObject.DateLastModified).valueOf();
				}
			}
			else {
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
				var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
				file.initWithPath(specialBackupPath);
				var fileExists = file.exists();
				if (fileExists) {
					var modDate = file.lastModifiedTime;
				}
			}
		}
		catch(e) {
			// give up
			return backupPath;
		}

		// expiry is used to tell if it's an 'old' one. Eg, if the month is June and there is a
		// June file on disk that's more than an month old then it must be stale so overwrite
		// note that "latest" should be always because the expiration period is zero (see above)
		var expiry = new Date(modDate + modes[i][1]);
		if (!fileExists || now > expiry)
			return specialBackupPath;
	}
}

// hijack the core function
window.getBackupPath_orig = window.getBackupPath;
window.getBackupPath = function(localPath) {
	return getSpecialBackupPath(getBackupPath_orig(localPath));
}

//}}}
http://stp.clarku.edu/simulations/index.html
Link to tiddlers, such as [[Horizontal Rule]].
{{{
Link to tiddlers, such as [[Horizontal Rule]].
}}}
Link to [[external sites|http://www.osmosoft.com]] or [[ordinary tiddlers|Horizontal Rule]] with ordinary words,
without the messiness of the full URL appearing.
{{{
Link to [[external sites|http://www.osmosoft.com]] or [[ordinary tiddlers|Horizontal Rule]] with ordinary words,
without the messiness of the full URL appearing.
}}}
Or just type out http://www.osmosoft.com and it will be automatically linkified.
+++[show code|tooltip]
{{{
<<forEachTiddler
	sortBy 
		'getSortedTagsText(tiddler)+"###"+tiddler.title'

	script
		'
		function getSortedTagsText(tiddler) {
			var tags = tiddler.tags; 
			if (!tags || !tags.length) 
				return "{no tags}"; 
			tags.sort(); 
			var result = ""; 
			for (var i = 0; i < tags.length;i++) {
				result += tags[i]+ " ";
			} 
			return result;
		} 

		function getGroupTitle(tiddler, context) {
			if (!context.lastGroup || context.lastGroup != getSortedTagsText(tiddler)) {
				context.lastGroup = getSortedTagsText(tiddler); 
				return "* [["+(context.lastGroup?context.lastGroup:"no tags")+"]]\n";
			} else 
				return "";
		}
		'
	
	write
		 'getGroupTitle(tiddler, context)+"** [[" + tiddler.title+"]]\n"'
>>
}}}

===

<<forEachTiddler
	sortBy 
		'getSortedTagsText(tiddler)+"###"+tiddler.title'
	
	script
		'
		function getSortedTagsText(tiddler) {
			var tags = tiddler.tags; 
			if (!tags || !tags.length) 
				return "{no tags}"; 
			tags.sort(); 
			var result = ""; 
			for (var i = 0; i < tags.length;i++) {
				result += tags[i]+ " ";
			} 
			return result;
		} 

		function getGroupTitle(tiddler, context) {
			if (!context.lastGroup || context.lastGroup != getSortedTagsText(tiddler)) {
				context.lastGroup = getSortedTagsText(tiddler); 
				return "* [["+(context.lastGroup?context.lastGroup:"no tags")+"]]\n";
			} else 
				return "";
		}
		'
	
	write
		 '  getGroupTitle(tiddler, context) + "** [[" + tiddler.title + "]]\n" '
>>
+++[show code|tooltip]
code here
===

<<forEachTiddler
	sortBy 
		'getGroupTitle(tiddler, context)'
	descending
	script
		'
		function getSortedTagsText(tiddler) {
			var tags = tiddler.tags; 
			if (!tags || !tags.length) 
				return "{no tags}"; 
			tags.sort(); 
			var result = ""; 
			for (var i = 0; i < tags.length;i++) {
				result += tags[i]+ " ";
			} 
			return result;
		} 

		function getGroupTitle(tiddler, context) {
			if (!context.lastGroup || context.lastGroup != getSortedTagsText(tiddler)) {
				context.lastGroup = getSortedTagsText(tiddler); 
				return "* [["+(context.lastGroup?context.lastGroup:"no tags")+"]]\n";
			} else 
				return "";
		}
		'
	
	write
		 '  getGroupTitle(tiddler, context) + "** [[" + tiddler.title + "]]\n" '
>>
//''Result:''//
<<forEachTiddler 
 where
 'tiddler.tags.length == 0'
>>
See also [[ForEachTiddlerExamples]].
<<tiddler [[ReactionApp.Summary]]>>
<<tiddler [[centralApp.Summary]]>>
<<tiddler [[ProjectileApp.Summary]]>>
<<tiddler [[MatrixRotationApp.Summary]]>>
<<tiddler [[SurfaceArrayApp.Summary]]>>


{{{
<<forEachTiddler
    sortBy 
        tiddler.modified
    descending

    write 
        '(index < 10) ? "# [["+tiddler.title+"]]\n" : ""'
>>
}}}

''//Result://''
<<forEachTiddler
    sortBy 
        tiddler.modified
    descending

    write 
        '(index < 10) ? "# [["+tiddler.title+"]]\n" : ""'
>>
See also: [[List the first 10 tiddlers that have the tag 'basic']].
{{{
<<forEachTiddler
    where
        'tiddler.title.contains("jpg") || tiddler.title.contains("png")'
    write
        ' "|" + (index+1) + "|[[" + tiddler.title + "]]|\n"  '
        begin '"|!#|!Tiddler|\n"'
        end 'count+" Tiddlers found\n"'
        none '"No Tiddlers found\n"'
>>
}}}
<<forEachTiddler
    where
        'tiddler.title.contains("jpg") || tiddler.title.contains("png")'
    write
        ' "|" + (index+1) + "|[[" + tiddler.title + "]]|\n"  '
        begin '"|!#|!Tiddler|\n"'
        end 'count+" Tiddlers found\n"'
        none '"No Tiddlers found\n"'
>>
I prefer not to put the Java libraries here when I am developing for stand alone applications (applets, JWS. But it will be fine to place the Java libraries here when you are learning or you are testing in a hurry. It's better to keep the system a little bit out of "automatic" pilot mode.
{{{
C:\Apps\jdk\jre\lib\ext
}}}
Macros let you write tiddlers containing more exotic objects than just text.  Macros may be added as plugins.  If so, they should be tagged<<tag plugin>>, and described in [[Configuration]].
!These are some of the built-in macros:
Today is <<today>>
{{{
Today is <<today>>
}}}
Click on <<tag editing>> to popup all tiddlers tagged "editing".
{{{
Click on <<tag editing>> to popup all tiddlers tagged "editing".
}}}
Transclude one tiddler into another via
<<tiddler 'Horizontal Rule'>>
{{{
Transclude one tiddler into another via
<<tiddler 'Horizontal Rule'>>
}}}
//There is no protection against inadvertently setting up endless loops.  And this may have problems if the transcluded tiddler isn't loaded.//
Slider: <<slider chkTestSlider 'Horizontal Rule' 'press me»' "Click here to see the Horizontal Rule slide out">>
{{{
Slider: <<slider chkTestSlider 'Horizontal Rule' 'press me»' "Click here to see the Horizontal Rule slide out">>
}}}
The slider parameters are:
* cookie name to be used to save the state of the slider
* name of the tiddler to include in the slider
* title text of the slider
* tooltip text of the slider
&nbsp;&nbsp;[[About]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[Tags]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[Symbols]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[To Do]]
*<<slider chkSliderejsF ejsF 'ejs »' 'physics stuff, what this site is all about'>>

!Running directly with Jython:
This works
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/jython_osp
$ jython org/opensourcephysics/davidson/ode/basic_examples/ReactionApp.py
}}}

!File Structure
Under the following folder structure where [[Reaction.py]] and [[ReactionApp.py]] are under org/opensourcephysics/davidson/ode/basic_examples/
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/jython_osp
$ tree -L 6 -P *.py
.
|-- META-INF
|-- demo
|-- org
|   |-- jibble
|   |   `-- epsgraphics
|   `-- opensourcephysics
|       |-- controls
|       |-- davidson
|       |   |-- applets
|       |   `-- ode
|       |       `-- basic_examples
|       |           |-- Reaction.py
|       |           `-- ReactionApp.py
|       |-- display
|       |   |-- axes
|       |   `-- dialogs
|       |-- display2d
|       |-- display3d
|       |   |-- core
|       |   |   `-- interaction
|       |   `-- simple3d
|       |       `-- utils
|       |-- ejs
|       |   `-- control
|       |       |-- swing
|       |       `-- value
|       |-- frames
|       |-- media
|       |   |-- core
|       |   `-- gif
|       |-- numerics
|       |-- resources
|       |   |-- controls
|       |   |   |-- doctypes
|       |   |   `-- images
|       |   |-- display
|       |   |-- ejs
|       |   |-- media
|       |   `-- tools
|       |       `-- images
|       `-- tools


msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/jython_osp
$ 
}}}

!Compiling
We may be tempted to compile the jython subclass [[Reaction.py]] like this:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/jython_osp
$ jythonc -d -w "." -p org.opensourcephysics.davidson.ode.basic_examples org/opensourcephysics/davidson/ode/basic_examples/Reaction.py
}}}
And like this, to compile the main application [[ReactionApp.py]]:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/jython_osp
$ jythonc -d -w "." -p org.opensourcephysics.davidson.ode.basic_examples org/opensourcephysics/davidson/ode/basic_examples/ReactionApp.py
}}}
@@But that would not work@@. Why?

We must compile both at the same time using *.py:
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/jython_osp
$ jythonc -d -w "." -p org.opensourcephysics.davidson.ode.basic_examples org/opensourcephysics/davidson/ode/basic_examples/*.py
}}}

!Compilation results
{{{
Warning: jythonc is unmaintained and will not be included in Jython-2.3.  See http://jython.org/Project/jythonc.html for alternatives to jythonc.  Add '-i' to your invocation of jythonc to turn off this warning
processing Reaction
processing ReactionApp

Required packages:
  org.opensourcephysics.frames
  org.opensourcephysics.controls*
  java.lang.reflect
  org.opensourcephysics.numerics

Creating adapters:

Creating .java files:
  Reaction module
    Reaction extends java.lang.Object implements org.opensourcephysics.numerics.ODE
  ReactionApp module
    ReactionApp extends org.opensourcephysics.controls.AbstractSimulation

Compiling .java to .class...
Compiling with args: ['C:\\Apps\\jre\\bin\\javac', '-classpath', 'C:\\Apps\\jython2.2.1\\jython.jar;.;c:\\Apps\\jython2.2.1\\jython.jar;.\\.;org\\opensourcephysics\\davidson\\ode\\basic_examples;C:\\Apps\\jython2.2.1\\Tools\\jythonc;C:\\Apps\\jython2.2.1\\Lib;__classpath__;C:\\Apps\\jython2.2.1', '.\\.\\org\\opensourcephysics\\davidson\\ode\\basic_examples\\Reaction.java', '.\\.\\org\\opensourcephysics\\davidson\\ode\\basic_examples\\ReactionApp.java']
0  Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
}}}

!Running the new java application
{{{
msfz751@a3800xp64 /cygdrive/f/PortableEclipse/osp_java_jython/jython_osp
$ java org.opensourcephysics.davidson.ode.basic_examples.ReactionApp
}}}
[img[http://latex.codecogs.com/gif.latex?\frac{\partial (q \rho) }{\partial r} = 2 \pi r h \phi \: \frac{\partial \rho}{\partial t}]]
<<tiddler cone.jpg>>
$$
\frac{\partial (q \rho) }{\partial r} = 2 \pi r h \phi \: \frac{\partial \rho}{\partial t}
$$
Read this:
http://www.kevinboone.com/classpath.html

<<tiddler [[CPTest1, CPTest2 - Instructions to compile and run]]>>
<code java>
//package mathlibrary;

class MathLibraryExample {

  public static void main(String args[]) {

    int i = 7;
    int j = -9;
    double x = 72.3;
    double y = 0.34;

    System.out.println("i is " + i);
    System.out.println("j is " + j);
    System.out.println("x is " + x);
    System.out.println("y is " + y);

    // The absolute value of a number is equal to
    // the number if the number is positive or
    // zero and equal to the negative of the number
    // if the number is negative.

    System.out.println("|" + i + "| is " +
                       Math.abs(i));
    System.out.println("|" + j + "| is " +
                       Math.abs(j));
    System.out.println("|" + x + "| is " +
                       Math.abs(x));
    System.out.println("|" + y + "| is " +
                       Math.abs(y));

    // Truncating and Rounding functions

    // You can round off a floating point number
    // to the nearest integer with round()
    System.out.println(x + " is approximately " +
                       Math.round(x));
    System.out.println(y + " is approximately " +
                       Math.round(y));

    // The "ceiling" of a number is the
    // smallest integer greater than or equal to
    // the number. Every integer is its own
    // ceiling.
    System.out.println("The ceiling of " + i +
                       " is " + Math.ceil(i));
    System.out.println("The ceiling of " + j +
                       " is " + Math.ceil(j));
    System.out.println("The ceiling of " + x +
                       " is " + Math.ceil(x));
    System.out.println("The ceiling of " + y +
                       " is " + Math.ceil(y));

    // The "floor" of a number is the largest
    // integer less than or equal to the number.
    // Every integer is its own floor.
    System.out.println("The floor of " + i +
                       " is " + Math.floor(i));
    System.out.println("The floor of " + j +
                       " is " + Math.floor(j));
    System.out.println("The floor of " + x +
                       " is " + Math.floor(x));
    System.out.println("The floor of " + y +
                       " is " + Math.floor(y));

    // Comparison operators

    // min() returns the smaller of the two
    // arguments you pass it
    System.out.println("min(" + i + "," + j +
                       ") is " + Math.min(i, j));
    System.out.println("min(" + x + "," + y +
                       ") is " + Math.min(x, y));
    System.out.println("min(" + i + "," + x +
                       ") is " + Math.min(i, x));
    System.out.println("min(" + y + "," + j +
                       ") is " + Math.min(y, j));

    // There's a corresponding max() method
    // that returns the larger of two numbers
    System.out.println("max(" + i + "," + j +
                       ") is " + Math.max(i, j));
    System.out.println("max(" + x + "," + y +
                       ") is " + Math.max(x, y));
    System.out.println("max(" + i + "," + x +
                       ") is " + Math.max(i, x));
    System.out.println("max(" + y + "," + j +
                       ") is " + Math.max(y, j));

    // The Math library defines a couple
    // of useful constants:
    System.out.println("Pi is " + Math.PI);
    System.out.println("e is " + Math.E);

    // Trigonometric methods
    // All arguments are given in radians

    // Convert a 45 degree angle to radians
    double angle = 45.0 * 2.0 * Math.PI / 360.0;
    System.out.println("cos(" + angle +
                       ") is " + Math.cos(angle));
    System.out.println("sin(" + angle +
                       ") is " + Math.sin(angle));

    // Inverse Trigonometric methods
    // All values are returned as radians

    double value = 0.707;

    System.out.println("acos(" + value +
                       ") is " + Math.acos(value));
    System.out.println("asin(" + value +
                       ") is " + Math.asin(value));
    System.out.println("atan(" + value +
                       ") is " + Math.atan(value));

    // Exponential and Logarithmic Methods

    // exp(a) returns e (2.71828...) raised
    // to the power of a.

    System.out.println("exp(1.0) is " +
                       Math.exp(1.0));
    System.out.println("exp(10.0) is " +
                       Math.exp(10.0));
    System.out.println("exp(0.0) is " +
                       Math.exp(0.0));

    // log(a) returns  the natural
    // logarithm (base e) of a.
    System.out.println("log(1.0) is " +
                       Math.log(1.0));
    System.out.println("log(10.0) is " +
                       Math.log(10.0));
    System.out.println("log(Math.E) is " +
                       Math.log(Math.E));

    // pow(x, y) returns the x raised
    // to the yth power.
    System.out.println("pow(2.0, 2.0) is " +
                       Math.pow(2.0, 2.0));
    System.out.println("pow(10.0, 3.5) is " +
                       Math.pow(10.0, 3.5));
    System.out.println("pow(8, -1) is " +
                       Math.pow(8, -1));

    // sqrt(x) returns the square root of x.
    for (i = 0; i < 10; i++) {
      System.out.println("The square root of " +
                         i + " is " + Math.sqrt(i));
    }

    // Finally there's one Random method
    // that returns a pseudo-random number
    // between 0.0 and 1.0;

    System.out.println(
        "Here's one random number: " + Math.random());
    System.out.println(
        "Here's another random number: " +
        Math.random());

  }

}
</code>
[[org.opensourcephysics.numerics]]
{{{
t+=dt;
theta+= omega*dt;
}}}
Example:
{{{
_view.shaftGroup.setTransformation(Matrix3DTransformation.rotationZ(theta));
}}}
{{{
_view.bodyGroup.setTransformation(Matrix3DTransformation.rotationX(tilt));
}}}
!![[MatrixRotationApp]]
<part description>
This is 3D application showing the rotation of an ellipsoid in real time. The ellipsoid is created and animated using threading.
</part>

@@[[Launch MatrixRotationApp|http://www.reyesaguayo.com/osp/jws/MatrixRotationApp.jnlp]]@@
<<tiddler [[MatrixRotationApp.jpg]]>>
!!!Features
* Rotates in real time
* Can obtain diferent 3D views and rotate if you press and drag the mouse cursor
!!!Java vs. Jython learnings
!!!! Have to declare explicitly some modules in Jython
<<<
<code python>
#These four modules not explicitly declared in Java
import javax.swing.JFrame
from java.lang import Exception
from java.lang import Thread
from java.lang import Math
</code>
<<<

!!!! ''Try'' and ''except'' differ a little bit from Java cousin
<<<
<code python>
    while(True):    # animate until the program exits
        try:
            Thread.sleep(100)
        except InterruptedException, e:
            print "this exception", e         
        theta += Math.PI/40
</code>
while in Java is:
<code java>
    while(true) { // animate until the program exits
      try {
        Thread.sleep(100);
      } catch(InterruptedException ex) {}
      theta += Math.PI/40;
</code>
<<<

!Code
[[MatrixRotationApp.py]]     [[MatrixRotationApp.java]]     [[MatrixRotationApp.jnlp]]    
![[MatrixRotationApp]]
{{borderlessL{
|[img(50%,auto)[MatrixRotationApp|http://reyesaguayo.com/osp/images/MatrixRotationApp.jpg][http://reyesaguayo.com/osp/images/MatrixRotationApp.jpg]]<br>&nbsp;&nbsp;@@color:#c06;<<tiddler ./execute>>@@|vertical-align:top;width:30em;<<tiddler MatrixRotationApp/description>> <<tiddler ./javacode>> <<tiddler ./jythoncode>>|
}}}
<part description hidden>
!!!!Description
~TiddlyWiki, being a single file, is best utilized by storing images elsewhere. Here is an image and the code to present it. In this case it also includes a tooltip and link to a larger version of the image.
</part>
<part execute hidden>
@@[[Launch MatrixRotationApp JWS application|http://www.reyesaguayo.com/osp/jws/MatrixRotationApp.jnlp]]@@ 
</part>
<part javacode hidden>
!!!!Java Code
[[MatrixRotationApp.java]]
</part>
<part jythoncode hidden>
!!!!Jython Code
[[MatrixRotationApp.py]]
</part>
<code java>
/*
 * Open Source Physics software is free software as described near the bottom of this code file.
 *
 * For additional information and documentation on Open Source Physics please see: 
 * <http://www.opensourcephysics.org/>
 */

package org.opensourcephysics.manual.ch11;
import org.opensourcephysics.display3d.simple3d.*;
import org.opensourcephysics.frames.Display3DFrame;
import org.opensourcephysics.numerics.*;

/**
 * MatrixRotationApp Demonstrates how to use the a Matrix3DTransformation to rotate a 3D Element.
 *
 * @author W. Christian
 * @version 1.0
 */
public class MatrixRotationApp {
  public static void main(String[] args) {
    Display3DFrame frame = new Display3DFrame("Axis-angle Rotation");
    frame.setDecorationType(VisualizationHints.DECORATION_AXES);
    Element ellipsoid = new ElementEllipsoid();
    Element arrow = new ElementArrow();
    ellipsoid.setSizeXYZ(0.4, 0.4, 1.0);
    frame.addElement(arrow);
    frame.addElement(ellipsoid);
    frame.setVisible(true);
    frame.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
    double theta = 0;
    double[] axis = new double[] {0.5, 0.5, 1}; // rotation axis
    arrow.setSizeXYZ(axis);
    while(true) { // animate until the program exits
      try {
        Thread.sleep(100);
      } catch(InterruptedException ex) {}
      theta += Math.PI/40;
      Transformation transformation = Matrix3DTransformation.rotation(theta, axis);
      ellipsoid.setTransformation(transformation);
      frame.render();
    }
  }
}

/*
 * Open Source Physics software is free software; you can redistribute
 * it and/or modify it under the terms of the GNU General Public License (GPL) as
 * published by the Free Software Foundation; either version 2 of the License,
 * or(at your option) any later version.

 * Code that uses any portion of the code in the org.opensourcephysics package
 * or any subpackage (subdirectory) of this package must must also be be released
 * under the GNU GPL license.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston MA 02111-1307 USA
 * or view the license online at http://www.gnu.org/copyleft/gpl.html
 *
 * For additional information and documentation on Open Source Physics,
 * please see <http://www.opensourcephysics.org/>.
 *
 * Copyright (c) 2007  The Open Source Physics project
 *                     http://www.opensourcephysics.org
 */
</code>
<code xml>
  <?xml version="1.0" encoding="utf-8"?> 
    <jnlp spec="1.0+" codebase="http://www.reyesaguayo.com/osp/jws/" 
           href="MatrixRotationApp.jnlp"> 
    <information> 
     <title>MatrixRotationApp</title> 
     <vendor>OpenSourcePhysics.org</vendor> 
     <description>JNLP-Demo Application MatrixRotationApp</description>
     <icon href="MatrixRotationApp.gif"/> 
     <offline-allowed/> 
   </information> 
   <resources> 
     <j2se version="1.4+"/> 
     <jar href="jython_osp.jar"/> 
   </resources> 
   <application-desc main-class="MatrixRotationApp"/> 
  </jnlp>
</code>
[img(35%,auto)[MatrixRotationApp|http://reyesaguayo.com/osp/images/MatrixRotationApp.jpg][http://reyesaguayo.com/osp/images/MatrixRotationApp.jpg]]
<code py>
"""
" Project:     osp_guide
" Package:     org.opensourcephysics.manual.ch11
" Java code:    <http://www.opensourcephysics.org/>
" Jython code:  Alfonso Reyes 
"""
from org.opensourcephysics.display3d.simple3d import *
from org.opensourcephysics.frames import Display3DFrame
from org.opensourcephysics.numerics import *
# These four modules not explicitly declared in Java
import javax.swing.JFrame
from java.lang import Exception
from java.lang import Thread
from java.lang import Math

"""
MatrixRotationApp Demonstrates how to use the a Matrix3DTransformation to rotate a 3D Element.
"""
class MatrixRotationApp:
    frame = Display3DFrame("Axis-angle Rotation")
    frame = Display3DFrame("Axis-angle Rotation")
    frame.setDecorationType(VisualizationHints.DECORATION_AXES)
    ellipsoid = ElementEllipsoid()
    arrow = ElementArrow()
    ellipsoid.setSizeXYZ(0.4, 0.4, 1.0)
    frame.addElement(arrow)
    frame.addElement(ellipsoid)
    frame.setVisible(True)
    frame.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE)
    theta = 0.0
    axis = [0.5, 0.5, 1]    # rotation axis
    arrow.setSizeXYZ(axis)    
    while(True):    # animate until the program exits
        try:
            Thread.sleep(100)
        except InterruptedException, e:
            print "this exception", e         
        theta += Math.PI/40
        transformation = Matrix3DTransformation.rotation(theta, axis)
        ellipsoid.setTransformation(transformation)
        frame.render()    

app = MatrixRotationApp()
</code>
[[ejs]]
[[osp]]
[[programming]]
!!@@[[Launch MolecularDynamicsDemo|http://thesmartfield.com/tw/modeling/jws/MolecularDynamicsDemo.jnlp]]@@
><<tiddler MolecularDynamicsDemo.jpg>>

!Library
[[Compadre Phy200 Computational Physics]]

!Methods
* [[Initialize Molecules]]
* [[readDataFromFile ()]]
* [[setAnimationSpeed ()]]
[img(34%,auto)[tooltip|http://thesmartfield.com/images/tw-modeling/MolecularDynamicsDemo.jpg][http://thesmartfield.com/images/tw-modeling/MolecularDynamicsDemo.jpg]]
!!MolecularDynamicsDemo
@@[[Launch MolecularDynamicsDemo|http://www.thesmartfield.com/tw/modeling/jws/MolecularDynamicsDemo.jnlp]]@@
><<tiddler MolecularDynamicsDemo.jpg>>

!!!![[Launch MolecularDynamicsDemo|http://thesmartfield.com/tw/modeling/jws/MolecularDynamicsDemo.jnlp]]

Inline {{{monospaced text}}} with no editing commands executed inside the brackets.
Inline <html>{{{</html>monospaced text<html>}}}</html> with no editing commands executed inside the brackets.
{{{
monospaced
   blocks
(useful for source code)
}}}
By putting "<html>{{{</html>" and "<html>}}}</html>" on their own lines.

!Location
file:///home/msfz751/Programming/ejs/workspaces/ejs_tpt_modeling/source/Advanced_Modeling
{{{
System.arraycopy(zeros,0,force,0,force.length);
}}}

!EJS objects used
*[[ComboBox]] 
*[[arraycopy]]

!Special Java keywords
*[[static final]] 
!Example of Python [[Nested Classes]]
<code python>
class SomeClass:
    SomeAttribute = 1
    
    def outerMethod(self):
        print "method in the outer class called"

    class SomeNestedClass:
        SomeOtherAttribute = 2
        
        def __init__(self, parent):
            self.parent = parent
            return
    
        def SomeNestedClassMethod(self):
            print "%s-%s" % (
                             self.parent.SomeAttribute,
                             self.SomeOtherAttribute)
            self.parent.outerMethod()
    
    def __init__(self):
        self.SNC = self.SomeNestedClass(self)
        return

if __name__=="__main__":
    a = SomeClass()
    a.SNC.SomeNestedClassMethod()
</code>
/***
|Name|NestedSlidersPlugin|
|Source|http://www.TiddlyTools.com/#NestedSlidersPlugin|
|Version|2.3.2|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Slider.prototype.stop|
|Description|show content in nest-able 'slider' or 'floating' panels, without needing to create separate tiddlers for each panel|

!!!!!Configuration
<<<
Enable animation for slider panels
<<option chkFloatingSlidersAnimate>> allow sliders to animate when opening/closing
>(note: This setting is in //addition// to the general option for enabling/disabling animation effects:
><<option chkAnimate>> enable animations (entire document)
>For slider animation to occur, you must also allow animation in general.

Debugging messages for 'lazy sliders' deferred rendering:
<<option chkDebugLazySliderDefer>> show debugging alert when deferring slider rendering
<<option chkDebugLazySliderRender>> show debugging alert when deferred slider is actually rendered
<<<
!!!!!Usage
<<<
When installed, this plugin adds new wiki syntax for embedding 'slider' panels directly into tiddler content.  Use {{{+++}}} and {{{===}}} to delimit the slider content.  You can also 'nest' these sliders as deep as you like (see complex nesting example below), so that expandable 'tree-like' hierarchical displays can be created.  This is most useful when converting existing in-line text content to create in-line annotations, footnotes, context-sensitive help, or other subordinate information displays.

Additional optional syntax elements let you specify
*default to open
*cookiename
*heading level
*floater (with optional CSS width value)
*transient display (clicking elsewhere closes panel)
*custom class/label/tooltip/accesskey
*alternate label/tooltip (displayed when panel is open)
*panelID (for later use with {{{<<DOM>>}}} macro.  See [[DOMTweaksPlugin]])
*automatic blockquote style on panel
*deferred rendering of panel content
The complete syntax, using all options, is:
//{{{
++++(cookiename)!!!!!^width^*{{class{[label=key|tooltip][altlabel|alttooltip]}}}#panelID:>...
content goes here
===
//}}}
where:
* {{{+++}}} (or {{{++++}}}) and {{{===}}}<br>marks the start and end of the slider definition, respectively.  When the extra {{{+}}} is used, the slider will be open when initially displayed.
* {{{(cookiename)}}}<br>saves the slider opened/closed state, and restores this state whenever the slider is re-rendered.
* {{{!}}} through {{{!!!!!}}}<br>displays the slider label using a formatted headline (Hn) style instead of a button/link style
* {{{^width^}}} (or just {{{^}}})<br>makes the slider 'float' on top of other content rather than shifting that content downward.  'width' must be a valid CSS value (e.g., "30em", "180px", "50%", etc.).  If omitted, the default width is "auto" (i.e., fit to content)
* {{{"*"}}} //(without the quotes)//<br>denotes "transient display": when a click occurs elsewhere in the document, the slider/floating panel will be automatically closed.  This is useful for creating 'pulldown menus' that automatically go away after they are used.  //Note: using SHIFT-click on a slider label will open/close that slider without triggering the automatic closing of any transient slider panels that are currently displayed, permitting ''temporary'' display of several transient panels at once.//
* """{{class{[label=key|tooltip][altlabel|alttooltip]}}}"""<br>uses label/tooltip/accesskey.  """{{class{...}}}""", """=key""", """|tooltip""" and """[altlabel|alttooltip]""" are optional.  'class' is any valid CSS class name, used to style the slider label text.  'key' must be a ''single letter only''.  altlabel/alttooltip specifiy alternative label/tooltip for use when slider/floating panel is displayed.
* {{{#panelID:}}}<br>defines a unique DOM element ID that is assigned to the panel element used to display the slider content.  This ID can then be used later to reposition the panel using the {{{<<DOM move id>>}}} macro (see [[DOMTweaksPlugin]]), or to access/modify the panel element through use of {{{document.getElementById(...)}}}) javascript code in a plugin or inline script.
* {{{">"}}} //(without the quotes)//<br>automatically adds blockquote formatting to slider content
* {{{"..."}}} //(without the quotes)//<br>defers rendering of closed sliders until the first time they are opened.  //Note: deferred rendering may produce unexpected results in some cases.  Use with care.//

//Note: to make slider definitions easier to read and recognize when editing a tiddler, newlines immediately following the {{{+++}}} 'start slider' or preceding the {{{===}}} 'end slider' sequence are automatically supressed so that excess whitespace is eliminated from the output.//
<<<
!!!!!Examples
<<<
simple in-line slider: 
{{{
+++
   content
===
}}}
+++
   content
===
----
use a custom label and tooltip: 
{{{
+++[label|tooltip]
   content
===
}}}
+++[label|tooltip]
   content
===
----
content automatically blockquoted: 
{{{
+++>
   content
===
}}}
+++>
   content
===
----
all options combined //(default open, cookie, heading, sized floater, transient, class, label/tooltip/key, blockquoted, deferred)//
{{{
++++(testcookie)!!!^30em^*{{big{[label=Z|click or press Alt-Z to open]}}}>...
   content
===
}}}
++++(testcookie)!!!^30em^*{{big{[label=Z|click or press Alt-Z to open]}}}>...
   content
===
----
complex nesting example:
{{{
+++[get info...=I|click for information or press Alt-I]
	put some general information here,
	plus a floating panel with more specific info:
	+++^10em^[view details...|click for details]
		put some detail here, which could in turn contain a transient panel,
		perhaps with a +++^25em^*[glossary definition]explaining technical terms===
	===
===
}}}
+++[get info...=I|click for information or press Alt-I]
	put some general information here,
	plus a floating panel with more specific info:
	+++^10em^[view details...|click for details]
		put some detail here, which could in turn contain a transient panel,
		perhaps with a +++^25em^*[glossary definition]explaining technical terms===
	===
===
<<<
!!!!!Installation
<<<
import (or copy/paste) the following tiddlers into your document:
''NestedSlidersPlugin'' (tagged with <<tag systemConfig>>)
<<<
!!!!!Revision History
<<<
''2007.11.14 - 2.3.2'' in onClickNestedSlider(), prevent SHIFT-click events from opening a new, empty browser window by setting "cancelBubble=true" and calling "stopPropagation()".  Note: SHIFT-click is still processed as a normal click (i.e., it toggles the slider panel display).  Also, using SHIFT-click will prevent 'transient' sliders from being automatically closed when another slider is opened, allowing you to *temporarily* display several transient sliders at once.
''2007.07.26 - 2.3.1'' in document.onclick(), propagate return value from hijacked core click handler to consume OR bubble up click as needed.  Fixes "IE click disease", whereby nearly every mouse click causes a page transition.
|please see [[NestedSlidersPluginHistory]] for additional revision details|
''2005.11.03 - 1.0.0'' initial public release
<<<
!!!!!Credits
<<<
This feature was implemented by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]] with initial research and suggestions from RodneyGomes, GeoffSlocock, and PaulPetterson.
<<<
!!!!!Code
***/
//{{{
version.extensions.nestedSliders = {major: 2, minor: 3, revision: 2, date: new Date(2007,11,14)};
//}}}

//{{{
// options for deferred rendering of sliders that are not initially displayed
if (config.options.chkDebugLazySliderDefer==undefined) config.options.chkDebugLazySliderDefer=false;
if (config.options.chkDebugLazySliderRender==undefined) config.options.chkDebugLazySliderRender=false;
if (config.options.chkFloatingSlidersAnimate==undefined) config.options.chkFloatingSlidersAnimate=false;

// default styles for 'floating' class
setStylesheet(".floatingPanel { position:absolute; z-index:10; padding:0.5em; margin:0em; \
	background-color:#eee; color:#000; border:1px solid #000; text-align:left; }","floatingPanelStylesheet");
//}}}

//{{{
config.formatters.push( {
	name: "nestedSliders",
	match: "\\n?\\+{3}",
	terminator: "\\s*\\={3}\\n?",
	lookahead: "\\n?\\+{3}(\\+)?(\\([^\\)]*\\))?(\\!*)?(\\^(?:[^\\^\\*\\[\\>]*\\^)?)?(\\*)?(?:\\{\\{([\\w]+[\\s\\w]*)\\{)?(\\[[^\\]]*\\])?(\\[[^\\]]*\\])?(?:\\}{3})?(\\#[^:]*\\:)?(\\>)?(\\.\\.\\.)?\\s*",
	handler: function(w)
		{
			lookaheadRegExp = new RegExp(this.lookahead,"mg");
			lookaheadRegExp.lastIndex = w.matchStart;
			var lookaheadMatch = lookaheadRegExp.exec(w.source)
			if(lookaheadMatch && lookaheadMatch.index == w.matchStart)
			{
				// var defopen=lookaheadMatch[1]
				// var cookiename=lookaheadMatch[2]
				// var header=lookaheadMatch[3]
				// var panelwidth=lookaheadMatch[4]
				// var transient=lookaheadMatch[5]
				// var class=lookaheadMatch[6]
				// var label=lookaheadMatch[7]
				// var openlabel=lookaheadMatch[8]
				// var panelID=lookaheadMatch[9]
				// var blockquote=lookaheadMatch[10]
				// var deferred=lookaheadMatch[11]

				// location for rendering button and panel
				var place=w.output;

				// default to closed, no cookie, no accesskey, no alternate text/tip
				var show="none"; var cookie=""; var key="";
				var closedtext=">"; var closedtip="";
				var openedtext="<"; var openedtip="";

				// extra "+", default to open
				if (lookaheadMatch[1]) show="block";

				// cookie, use saved open/closed state
				if (lookaheadMatch[2]) {
					cookie=lookaheadMatch[2].trim().slice(1,-1);
					cookie="chkSlider"+cookie;
					if (config.options[cookie]==undefined)
						{ config.options[cookie] = (show=="block") }
					show=config.options[cookie]?"block":"none";
				}

				// parse label/tooltip/accesskey: [label=X|tooltip]
				if (lookaheadMatch[7]) {
					var parts=lookaheadMatch[7].trim().slice(1,-1).split("|");
					closedtext=parts.shift();
					if (closedtext.substr(closedtext.length-2,1)=="=")	
						{ key=closedtext.substr(closedtext.length-1,1); closedtext=closedtext.slice(0,-2); }
					openedtext=closedtext;
					if (parts.length) closedtip=openedtip=parts.join("|");
					else { closedtip="show "+closedtext; openedtip="hide "+closedtext; }
				}

				// parse alternate label/tooltip: [label|tooltip]
				if (lookaheadMatch[8]) {
					var parts=lookaheadMatch[8].trim().slice(1,-1).split("|");
					openedtext=parts.shift();
					if (parts.length) openedtip=parts.join("|");
					else openedtip="hide "+openedtext;
				}

				var title=show=='block'?openedtext:closedtext;
				var tooltip=show=='block'?openedtip:closedtip;

				// create the button
				if (lookaheadMatch[3]) { // use "Hn" header format instead of button/link
					var lvl=(lookaheadMatch[3].length>6)?6:lookaheadMatch[3].length;
					var btn = createTiddlyElement(createTiddlyElement(place,"h"+lvl,null,null,null),"a",null,lookaheadMatch[6],title);
					btn.onclick=onClickNestedSlider;
					btn.setAttribute("href","javascript:;");
					btn.setAttribute("title",tooltip);
				}
				else
					var btn = createTiddlyButton(place,title,tooltip,onClickNestedSlider,lookaheadMatch[6]);
				btn.innerHTML=title; // enables use of HTML entities in label

				// set extra button attributes
				btn.setAttribute("closedtext",closedtext);
				btn.setAttribute("closedtip",closedtip);
				btn.setAttribute("openedtext",openedtext);
				btn.setAttribute("openedtip",openedtip);
				btn.sliderCookie = cookie; // save the cookiename (if any) in the button object
				btn.defOpen=lookaheadMatch[1]!=null; // save default open/closed state (boolean)
				btn.keyparam=key; // save the access key letter ("" if none)
				if (key.length) {
					btn.setAttribute("accessKey",key); // init access key
					btn.onfocus=function(){this.setAttribute("accessKey",this.keyparam);}; // **reclaim** access key on focus
				}
				btn.onmouseover=function(event) // mouseover on button aligns floater position with button
					{ if (window.adjustSliderPos) window.adjustSliderPos(this.parentNode,this,this.sliderPanel,this.sliderPanel.className); }

				// create slider panel
				var panelClass=lookaheadMatch[4]?"floatingPanel":"sliderPanel";
				var panelID=lookaheadMatch[9]; if (panelID) panelID=panelID.slice(1,-1); // trim off delimiters
				var panel=createTiddlyElement(place,"div",panelID,panelClass,null);
				panel.button = btn; // so the slider panel know which button it belongs to
				btn.sliderPanel=panel; // so the button knows which slider panel it belongs to
				panel.defaultPanelWidth=(lookaheadMatch[4] && lookaheadMatch[4].length>2)?lookaheadMatch[4].slice(1,-1):"";
				panel.setAttribute("transient",lookaheadMatch[5]=="*"?"true":"false");
				panel.style.display = show;
				panel.style.width=panel.defaultPanelWidth;
				panel.onmouseover=function(event) // mouseover on panel aligns floater position with button
					{ if (window.adjustSliderPos) window.adjustSliderPos(this.parentNode,this.button,this,this.className); }

				// render slider (or defer until shown) 
				w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
				if ((show=="block")||!lookaheadMatch[11]) {
					// render now if panel is supposed to be shown or NOT deferred rendering
					w.subWikify(lookaheadMatch[10]?createTiddlyElement(panel,"blockquote"):panel,this.terminator);
					// align floater position with button
					if (window.adjustSliderPos) window.adjustSliderPos(place,btn,panel,panelClass);
				}
				else {
					var src = w.source.substr(w.nextMatch);
					var endpos=findMatchingDelimiter(src,"+++","===");
					panel.setAttribute("raw",src.substr(0,endpos));
					panel.setAttribute("blockquote",lookaheadMatch[10]?"true":"false");
					panel.setAttribute("rendered","false");
					w.nextMatch += endpos+3;
					if (w.source.substr(w.nextMatch,1)=="\n") w.nextMatch++;
					if (config.options.chkDebugLazySliderDefer) alert("deferred '"+title+"':\n\n"+panel.getAttribute("raw"));
				}
			}
		}
	}
)

// TBD: ignore 'quoted' delimiters (e.g., "{{{+++foo===}}}" isn't really a slider)
function findMatchingDelimiter(src,starttext,endtext) {
	var startpos = 0;
	var endpos = src.indexOf(endtext);
	// check for nested delimiters
	while (src.substring(startpos,endpos-1).indexOf(starttext)!=-1) {
		// count number of nested 'starts'
		var startcount=0;
		var temp = src.substring(startpos,endpos-1);
		var pos=temp.indexOf(starttext);
		while (pos!=-1)  { startcount++; pos=temp.indexOf(starttext,pos+starttext.length); }
		// set up to check for additional 'starts' after adjusting endpos
		startpos=endpos+endtext.length;
		// find endpos for corresponding number of matching 'ends'
		while (startcount && endpos!=-1) {
			endpos = src.indexOf(endtext,endpos+endtext.length);
			startcount--;
		}
	}
	return (endpos==-1)?src.length:endpos;
}
//}}}

//{{{
window.onClickNestedSlider=function(e)
{
	if (!e) var e = window.event;
	var theTarget = resolveTarget(e);
	var theLabel = theTarget.firstChild.data;
	var theSlider = theTarget.sliderPanel
	var isOpen = theSlider.style.display!="none";

	// toggle label
	theTarget.innerHTML=isOpen?theTarget.getAttribute("closedText"):theTarget.getAttribute("openedText");
	// toggle tooltip
	theTarget.setAttribute("title",isOpen?theTarget.getAttribute("closedTip"):theTarget.getAttribute("openedTip"));

	// deferred rendering (if needed)
	if (theSlider.getAttribute("rendered")=="false") {
		if (config.options.chkDebugLazySliderRender)
			alert("rendering '"+theLabel+"':\n\n"+theSlider.getAttribute("raw"));
		var place=theSlider;
		if (theSlider.getAttribute("blockquote")=="true")
			place=createTiddlyElement(place,"blockquote");
		wikify(theSlider.getAttribute("raw"),place);
		theSlider.setAttribute("rendered","true");
	}
	// show/hide the slider
	if(config.options.chkAnimate && (theSlider.className!='floatingPanel' || config.options.chkFloatingSlidersAnimate))
		anim.startAnimating(new Slider(theSlider,!isOpen,e.shiftKey || e.altKey,"none"));
	else
		theSlider.style.display = isOpen ? "none" : "block";
	// reset to default width (might have been changed via plugin code)
	theSlider.style.width=theSlider.defaultPanelWidth;
	// align floater panel position with target button
	if (!isOpen && window.adjustSliderPos) window.adjustSliderPos(theSlider.parentNode,theTarget,theSlider,theSlider.className);
	// if showing panel, set focus to first 'focus-able' element in panel
	if (theSlider.style.display!="none") {
		var ctrls=theSlider.getElementsByTagName("*");
		for (var c=0; c<ctrls.length; c++) {
			var t=ctrls[c].tagName.toLowerCase();
			if ((t=="input" && ctrls[c].type!="hidden") || t=="textarea" || t=="select")
				{ ctrls[c].focus(); break; }
		}
	}
	var cookie=theTarget.sliderCookie;
	if (cookie && cookie.length) {
		config.options[cookie]=!isOpen;
		if (config.options[cookie]!=theTarget.defOpen)
			saveOptionCookie(cookie);
		else { // remove cookie if slider is in default display state
			var ex=new Date(); ex.setTime(ex.getTime()-1000);
			document.cookie = cookie+"=novalue; path=/; expires="+ex.toGMTString();
		}
	}
	// prevent SHIFT-CLICK from being processed by browser (opens blank window... yuck!)
	// but allow plain click to bubble up to page background (to dismiss open popup, if any)
	if (e.shiftKey) { e.cancelBubble=true; if (e.stopPropagation) e.stopPropagation(); }
	return false;
}
//}}}

//{{{
// click in document background closes transient panels 
document.nestedSliders_savedOnClick=document.onclick;
document.onclick=function(ev) { if (!ev) var ev=window.event; var target=resolveTarget(ev);
	// call original click handler
	if (document.nestedSliders_savedOnClick)
		var retval=document.nestedSliders_savedOnClick.apply(this,arguments);
	// if click was inside transient panel (or something contained by a transient panel)... leave it alone
	var p=target;
	while (p)
		if ((p.className=="floatingPanel"||p.className=="sliderPanel")&&p.getAttribute("transient")=="true") break;
		else p=p.parentNode;
	if (p) return retval;
	// otherwise, find and close all transient panels...
	var all=document.all?document.all:document.getElementsByTagName("DIV");
	for (var i=0; i<all.length; i++) {
		 // if it is not a transient panel, or the click was on the button that opened this panel, don't close it.
		if (all[i].getAttribute("transient")!="true" || all[i].button==target) continue;
		// otherwise, if the panel is currently visible, close it by clicking it's button
		if (all[i].style.display!="none") window.onClickNestedSlider({target:all[i].button}) 
	}
	return retval;
};
//}}}

//{{{
// adjust floating panel position based on button position
if (window.adjustSliderPos==undefined) window.adjustSliderPos=function(place,btn,panel,panelClass) {
	if (panelClass=="floatingPanel") {
		var left=0;
		var top=btn.offsetHeight; 
		if (place.style.position!="relative") {
			var left=findPosX(btn);
			var top=findPosY(btn)+btn.offsetHeight;
			var p=place; while (p && p.className!='floatingPanel') p=p.parentNode;
			if (p) { left-=findPosX(p); top-=findPosY(p); }
		}
		if (findPosX(btn)+panel.offsetWidth > getWindowWidth())  // adjust position to stay inside right window edge
			left-=findPosX(btn)+panel.offsetWidth-getWindowWidth()+15; // add extra 15px 'fudge factor'
		panel.style.left=left+"px"; panel.style.top=top+"px";
	}
}

function getWindowWidth() {
	if(document.width!=undefined)
		return document.width; // moz (FF)
	if(document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
		return document.documentElement.clientWidth; // IE6
	if(document.body && ( document.body.clientWidth || document.body.clientHeight ) )
		return document.body.clientWidth; // IE4
	if(window.innerWidth!=undefined)
		return window.innerWidth; // IE - general
	return 0; // unknown
}
//}}}

//{{{
// TW2.1 and earlier:
// hijack Slider animation handler 'stop' handler so overflow is visible after animation has completed
Slider.prototype.coreStop = Slider.prototype.stop;
Slider.prototype.stop = function()
	{ this.coreStop.apply(this,arguments); this.element.style.overflow = "visible"; }

// TW2.2+
// hijack Morpher animation handler 'stop' handler so overflow is visible after animation has completed
if (version.major+.1*version.minor+.01*version.revision>=2.2) {
	Morpher.prototype.coreStop = Morpher.prototype.stop;
	Morpher.prototype.stop = function()
		{ this.coreStop.apply(this,arguments); this.element.style.overflow = "visible"; }
}
//}}}


Type the text for 'New Tiddler'
/***
| Name:|NewHerePlugin|
| Description:|Creates the new here and new journal macros|
| Version:|3.0 ($Rev: 1845 $)|
| Date:|$Date: 2007-03-16 15:19:22 +1000 (Fri, 16 Mar 2007) $|
| Source:|http://mptw.tiddlyspot.com/#NewHerePlugin|
| Author:|Simon Baird <simon.baird@gmail.com>|
| License|http://mptw.tiddlyspot.com/#TheBSDLicense|
***/
//{{{
merge(config.macros, {
	newHere: {
		handler: function(place,macroName,params,wikifier,paramString,tiddler) {
			wikify("<<newTiddler "+paramString+" tag:[["+tiddler.title+"]]>>",place,null,tiddler);
		}
	},
	newJournalHere: {
		handler: function(place,macroName,params,wikifier,paramString,tiddler) {
			wikify("<<newJournal "+paramString+" tag:[["+tiddler.title+"]]>>",place,null,tiddler);
		}
	}
});

//}}}
<code java>
from org.opensourcephysics.controls import *
from org.reyesaguayo import BouncingBallAdapter

class A(BouncingBallAdapter):
    def f(): 
        pass
class B(AbstractSimulation): 
    pass
    def f(): 
        pass
class C(A, B): 
    pass

""" output
Traceback (innermost last):
  File "F:\PortableEclipse\workspace\workspace_jython_osp\open_csm.jython\BouncingBallApp\MultipleInheritanceBouncingBallApp.py", line 17, in ?
TypeError: no multiple inheritance for Java classes: org.python.proxies.__main__$B$2 and org.python.proxies.__main__$A$1
"""
</code>
Creating numbered lists is simple.
# Just add a pounds sign
# at the beginning of a line.
## If you want to create sub-lists
## start the line with two pounds
### And if you want yet another level
### use three pounds
# You can also do [[Bullet Points]]
{{{
Creating numbered lists is simple.
# Just add a pounds sign
# at the beginning of a line.
## If you want to create sub-lists
## start the line with two pounds
### And if you want yet another level
### use three pounds
# You can also do [[Bullet Points]]
}}}
http://www.compadre.org/osp/items/detail.cfm?ID=7147
http://reyesaguayo.com/osp/workspace_mechanics/Mechanics_Java_applications/mechanics.htm

http://reyesaguayo.com/osp/workspace_mechanics/Mechanics_Java_applications/readme.txt
http://reyesaguayo.com/osp/workspace_mechanics/Mechanics_Java_applications/
<<tiddler ReactionApp>>

<<tiddler ProjectileApp>>

<<tiddler MatrixRotationApp>>

<<tiddler centralApp>>

<<tiddler SurfaceArrayApp>>
!!!Content
http://www.westga.edu/~jhasbun/osp/osp.htm

!!!File Listing
http://www.westga.edu/~jhasbun/osp/
|!Symbol|![[LaTeX]]|!Use|
| $\phi$ | {{{\phi}}} | porosity |
| $\bar{p}$ | {{{ \bar{p} }}} | average reservoir pressure |
| $k$ | {{{ k }}} | Permeability |
| $ h $ | {{{ h }}} | thickness |
| $\rho$ | {{{ \rho }}} | density |
| $ \mu $ | {{{ \mu }}} | viscosity |
| $ \frac{\partial \rho}{\partial t} $ | {{{ \frac{\partial \rho}{\partial t} }}} | 1st derivative of density |
| $ \frac{\partial p}{\partial r} $ | {{{ \frac{\partial p}{\partial r} }}} | 1st derivative of pressure over radius |
| $ 2 \pi r $ | {{{ 2 \pi r }}} | drainage area |
| $ q $ | {{{ q }}} | flow rate |
| $ q_{max} $ | {{{ q_{max} }}} | maximum flow rate |
| $ q_{o} $ | {{{ q_{o} }}} | oil flow rate |
| $ q_{g} $ | {{{ q_{g} }}} | gas flow rate |
| $ q_{w} $ | {{{ q_{w} }}} | water flow rate |
| $ p_{wf} $ | {{{ p_{wf} }}} | bottomhole flowing pressure |
| $ p_{wh} $ | {{{ p_{wh} }}} | wellhead flowing pressure |
| $ \gamma $ | {{{ \gamma }}} | specific gravity |
| $ z $ | {{{ z }}} | compressibility factor |
| $ B_{o} $ | {{{ B_{o} }}} | Oil Formation Volume Factor |
| $ B_{w} $ | {{{ B_{w} }}} | Water in-situ Volume Factor |
| $ k_{ro} $ | {{{ k_{ro} }}} | Relative permeability to oil |
| $ c_{d} $ | {{{ c_{d} }}} | discharge coefficient |
| $ S $ | {{{ S }}} | skin factor |
| $ \Delta P $ | {{{ \Delta P }}} | delta pressure |
| $ P_{b} $ | {{{ P_{b} }}} | bubble pressure |
| $ r_{e} $ | {{{ r_{e} }}} | reservoir external radius |
| $ r_{w} $ | {{{ r_{w} }}} | well radius |
| $ P^{*} $ | {{{ P^{*} }}} | P star. Reservoir Pressure |
Open Source Physics
!The main websites
http://www.opensourcephysics.org/
http://www.compadre.org/osp/

!Eclipse Workspace with source code
<<tiddler [[Eclipse Workspace with source code]]>>

!A Tour of Open Source Physics (Draft)
http://www.compadre.org/osp/items/detail.cfm?ID=7373


If you save this ~TiddlyWiki file to your computer and then check out this tiddler, you will see buttons that allow you to access an index of your C, D, E, or F files. Why ever leave your ~TiddlyWiki again? Thanks to Morris Gray whose [[TW Help site|http://twhelp.tiddlyspot.com]] drew this to my attention.

|<html><FORM action="file:///c:/" target="_blank"><INPUT type=submit value="c:\ drive" name="button" class="btn" name=submit2></FORM></html>|<html><FORM action="file:///d:/" target="_blank"><INPUT type=submit value="d:\ drive" name="button" class="btn" name=submit2></FORM></html>|<html><FORM action="file:///H:/" target="_blank"><INPUT type=submit value="H:\ drive" name="button" class="btn" name=submit2></FORM></html>|<html><FORM action="file:///M:/" target="_blank"><INPUT type=submit value="M:\ drive" name="button" class="btn" name=submit2></FORM></html>|
!Libraries, binaries
http://www.opensourcephysics.org/binary/

!OSP User Guide Examples
http://www.compadre.org/OSP/document/ServeFile.cfm?ID=7153&DocID=352&DocFID=490&Attachment=1

!Computer Simulation Methods examples
http://www.compadre.org/OSP/document/ServeFile.cfm?ID=7154&DocID=353&DocFID=491&Attachment=1
These options are saved in the browser:

username: <<option txtUserName>>
backupDir: <<option txtBackupFolder>>
<<option chkSaveBackups>> [[SaveBackups]]
<<option chkAutoSave>> [[AutoSave]]
<<option chkRegExpSearch>> [[RegExpSearch]]
<<option chkCaseSensitiveSearch>> [[CaseSensitiveSearch]]

Change [[AdvancedOptions]]
<code py>
from java.io import OutputStream
import types

# Class OutputScreen is a subclass of Java class OutputStream
class OutputScreen(OutputStream):
    def write(self, *args):
        if len(args) > 1 or not type(args[0]) is types.IntType:
            apply(OutputStream.write, (self,)+args)
        else:
            print args[0]
</code>
<!--{{{-->
<div id='head' class='header' macro='gradient vert #18f #04b'>
   <div class='headerShadow'>
      <span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
      <span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
   </div>
   <div class='headerForeground'>
      <span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
      <span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
   </div>
   <div id='displayControl' refresh='content' tiddler='DisplayControl'></div> <!-- added by G -->
</div>
<div id='sidebar'>
   <div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
   <div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
   <div id='sidebarTabs' refresh='content' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
   <div id='messageArea'></div>
   <div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
/***
|<html><a name="Top"/></html>''Name:''|PartTiddlerPlugin|
|''Version:''|1.0.9 (2007-07-14)|
|''Source:''|http://tiddlywiki.abego-software.de/#PartTiddlerPlugin|
|''Author:''|UdoBorkowski (ub [at] abego-software [dot] de)|
|''Licence:''|[[BSD open source license]]|
|''CoreVersion:''|2.1.3|
|''Browser:''|Firefox 1.0.4+; InternetExplorer 6.0|
!Table of Content<html><a name="TOC"/></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Description',null, event)">Description, Syntax</a></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Applications',null, event)">Applications</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('LongTiddler',null, event)">Refering to Paragraphs of a Longer Tiddler</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Citation',null, event)">Citation Index</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('TableCells',null, event)">Creating "multi-line" Table Cells</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Tabs',null, event)">Creating Tabs</a></html>
** <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Sliders',null, event)">Using Sliders</a></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Revisions',null, event)">Revision History</a></html>
* <html><a href="javascript:;" onclick="window.scrollAnchorVisible('Code',null, event)">Code</a></html>
!Description<html><a name="Description"/></html>
With the {{{<part aPartName> ... </part>}}} feature you can structure your tiddler text into separate (named) parts. 
Each part can be referenced as a "normal" tiddler, using the "//tiddlerName//''/''//partName//" syntax (e.g. "About/Features").  E.g. you may create links to the parts (e.g. {{{[[Quotes/BAX95]]}}} or {{{[[Hobbies|AboutMe/Hobbies]]}}}), use it in {{{<<tiddler...>>}}} or {{{<<tabs...>>}}} macros etc.


''Syntax:'' 
|>|''<part'' //partName// [''hidden''] ''>'' //any tiddler content// ''</part>''|
|//partName//|The name of the part. You may reference a part tiddler with the combined tiddler name "//nameOfContainerTidder//''/''//partName//. <<br>>If you use a partName containing spaces you need to quote it (e.g. {{{"Major Overview"}}} or {{{[[Shortcut List]]}}}).|
|''hidden''|When defined the content of the part is not displayed in the container tiddler. But when the part is explicitly referenced (e.g. in a {{{<<tiddler...>>}}} macro or in a link) the part's content is displayed.|
|<html><i>any&nbsp;tiddler&nbsp;content</i></html>|<html>The content of the part.<br>A part can have any content that a "normal" tiddler may have, e.g. you may use all the formattings and macros defined.</html>|
|>|~~Syntax formatting: Keywords in ''bold'', optional parts in [...]. 'or' means that exactly one of the two alternatives must exist.~~|
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!Applications<html><a name="Applications"/></html>
!!Refering to Paragraphs of a Longer Tiddler<html><a name="LongTiddler"/></html>
Assume you have written a long description in a tiddler and now you want to refer to the content of a certain paragraph in that tiddler (e.g. some definition.) Just wrap the text with a ''part'' block, give it a nice name, create a "pretty link" (like {{{[[Discussion Groups|Introduction/DiscussionGroups]]}}}) and you are done.

Notice this complements the approach to first writing a lot of small tiddlers and combine these tiddlers to one larger tiddler in a second step (e.g. using the {{{<<tiddler...>>}}} macro). Using the ''part'' feature you can first write a "classic" (longer) text that can be read "from top to bottom" and later "reuse" parts of this text for some more "non-linear" reading.

<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!!Citation Index<html><a name="Citation"/></html>
Create a tiddler "Citations" that contains your "citations". 
Wrap every citation with a part and a proper name. 

''Example''
{{{
<part BAX98>Baxter, Ira D. et al: //Clone Detection Using Abstract Syntax Trees.// 
in //Proc. ICSM//, 1998.</part>

<part BEL02>Bellon, Stefan: //Vergleich von Techniken zur Erkennung duplizierten Quellcodes.// 
Thesis, Uni Stuttgart, 2002.</part>

<part DUC99>Ducasse, Stéfane et al: //A Language Independent Approach for Detecting Duplicated Code.// 
in //Proc. ICSM//, 1999.</part>
}}}

You may now "cite" them just by using a pretty link like {{{[[Citations/BAX98]]}}} or even more pretty, like this {{{[[BAX98|Citations/BAX98]]}}}.

<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!!Creating "multi-line" Table Cells<html><a name="TableCells"/></html>
You may have noticed that it is hard to create table cells with "multi-line" content. E.g. if you want to create a bullet list inside a table cell you cannot just write the bullet list
{{{
* Item 1
* Item 2
* Item 3
}}}
into a table cell (i.e. between the | ... | bars) because every bullet item must start in a new line but all cells of a table row must be in one line.

Using the ''part'' feature this problem can be solved. Just create a hidden part that contains the cells content and use a {{{<<tiddler >>}}} macro to include its content in the table's cell.

''Example''
{{{
|!Subject|!Items|
|subject1|<<tiddler ./Cell1>>|
|subject2|<<tiddler ./Cell2>>|

<part Cell1 hidden>
* Item 1
* Item 2
* Item 3
</part>
...
}}}

Notice that inside the {{{<<tiddler ...>>}}} macro you may refer to the "current tiddler" using the ".".

BTW: The same approach can be used to create bullet lists with items that contain more than one line.

<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!!Creating Tabs<html><a name="Tabs"/></html>
The build-in {{{<<tabs ...>>}}} macro requires that you defined an additional tiddler for every tab it displays. When you want to have "nested" tabs you need to define a tiddler for the "main tab" and one for every tab it contains. I.e. the definition of a set of tabs that is visually displayed at one place is distributed across multiple tiddlers.

With the ''part'' feature you can put the complete definition in one tiddler, making it easier to keep an overview and maintain the tab sets.

''Example''
The standard tabs at the sidebar are defined by the following eight tiddlers:
* SideBarTabs
* TabAll
* TabMore
* TabMoreMissing
* TabMoreOrphans
* TabMoreShadowed
* TabTags
* TabTimeline

Instead of these eight tiddlers one could define the following SideBarTabs tiddler that uses the ''part'' feature:
{{{
<<tabs txtMainTab 
    Timeline Timeline SideBarTabs/Timeline 
    All 'All tiddlers' SideBarTabs/All 
    Tags 'All tags' SideBarTabs/Tags 
    More 'More lists' SideBarTabs/More>>
<part Timeline hidden><<timeline>></part>
<part All hidden><<list all>></part>
<part Tags hidden><<allTags>></part>
<part More hidden><<tabs txtMoreTab 
    Missing 'Missing tiddlers' SideBarTabs/Missing 
    Orphans 'Orphaned tiddlers' SideBarTabs/Orphans 
    Shadowed 'Shadowed tiddlers' SideBarTabs/Shadowed>></part>
<part Missing hidden><<list missing>></part>
<part Orphans hidden><<list orphans>></part>
<part Shadowed hidden><<list shadowed>></part>
}}}

Notice that you can easily "overwrite" individual parts in separate tiddlers that have the full name of the part.

E.g. if you don't like the classic timeline tab but only want to see the 100 most recent tiddlers you could create a tiddler "~SideBarTabs/Timeline" with the following content:
{{{
<<forEachTiddler 
		sortBy 'tiddler.modified' descending 
		write '(index < 100) ? "* [["+tiddler.title+"]]\n":""'>>
}}}
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!!Using Sliders<html><a name="Sliders"/></html>
Very similar to the build-in {{{<<tabs ...>>}}} macro (see above) the {{{<<slider ...>>}}} macro requires that you defined an additional tiddler that holds the content "to be slid". You can avoid creating this extra tiddler by using the ''part'' feature

''Example''
In a tiddler "About" we may use the slider to show some details that are documented in the tiddler's "Details" part.
{{{
...
<<slider chkAboutDetails About/Details details "Click here to see more details">>
<part Details hidden>
To give you a better overview ...
</part>
...
}}}

Notice that putting the content of the slider into the slider's tiddler also has an extra benefit: When you decide you need to edit the content of the slider you can just doubleclick the content, the tiddler opens for editing and you can directly start editing the content (in the part section). In the "old" approach you would doubleclick the tiddler, see that the slider is using tiddler X, have to look for the tiddler X and can finally open it for editing. So using the ''part'' approach results in a much short workflow.

<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!Revision history<html><a name="Revisions"/></html>
* v1.0.9 (2007-07-14)
** Bugfix: Error when using the SideBarTabs example and switching between "More" and "Shadow". Thanks to cmari for reporting the issue.
* v1.0.8 (2007-06-16)
** Speeding up display of tiddlers containing multiple pard definitions. Thanks to Paco Rivière for reporting the issue.
** Support "./partName" syntax inside <<tabs ...>> macro
* v1.0.7 (2007-03-07)
** Bugfix: <<tiddler "./partName">> does not always render correctly after a refresh (e.g. like it happens when using the "Include" plugin). Thanks to Morris Gray for reporting the bug.
* v1.0.6 (2006-11-07)
** Bugfix: cannot edit tiddler when UploadPlugin by Bidix is installed. Thanks to José Luis González Castro for reporting the bug.
* v1.0.5 (2006-03-02)
** Bugfix: Example with multi-line table cells does not work in IE6. Thanks to Paulo Soares for reporting the bug.
* v1.0.4 (2006-02-28)
** Bugfix: Shadow tiddlers cannot be edited (in TW 2.0.6). Thanks to Torsten Vanek for reporting the bug.
* v1.0.3 (2006-02-26)
** Adapt code to newly introduced Tiddler.prototype.isReadOnly() function (in TW 2.0.6). Thanks to Paulo Soares for reporting the problem.
* v1.0.2 (2006-02-05)
** Also allow other macros than the "tiddler" macro use the "." in the part reference (to refer to "this" tiddler)
* v1.0.1 (2006-01-27)
** Added Table of Content for plugin documentation. Thanks to RichCarrillo for suggesting.
** Bugfix: newReminder plugin does not work when PartTiddler is installed. Thanks to PauloSoares for reporting.
* v1.0.0 (2006-01-25)
** initial version
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!Code<html><a name="Code"/></html>
<html><sub><a href="javascript:;" onclick="window.scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
***/
//{{{
//============================================================================
//                           PartTiddlerPlugin

// Ensure that the PartTiddler Plugin is only installed once.
//
if (!version.extensions.PartTiddlerPlugin) {



version.extensions.PartTiddlerPlugin = {
    major: 1, minor: 0, revision: 9,
    date: new Date(2007, 6, 14), 
    type: 'plugin',
    source: "http://tiddlywiki.abego-software.de/#PartTiddlerPlugin"
};

if (!window.abego) window.abego = {};
if (version.major < 2) alertAndThrow("PartTiddlerPlugin requires TiddlyWiki 2.0 or newer.");

//============================================================================
// Common Helpers

// Looks for the next newline, starting at the index-th char of text. 
//
// If there are only whitespaces between index and the newline 
// the index behind the newline is returned, 
// otherwise (or when no newline is found) index is returned.
//
var skipEmptyEndOfLine = function(text, index) {
	var re = /(\n|[^\s])/g;
	re.lastIndex = index;
	var result = re.exec(text);
	return (result && text.charAt(result.index) == '\n') 
			? result.index+1
			: index;
}


//============================================================================
// Constants

var partEndOrStartTagRE = /(<\/part>)|(<part(?:\s+)((?:[^>])+)>)/mg;
var partEndTagREString = "<\\/part>";
var partEndTagString = "</part>";

//============================================================================
// Plugin Specific Helpers

// Parse the parameters inside a <part ...> tag and return the result.
//
// @return [may be null] {partName: ..., isHidden: ...}
//
var parseStartTagParams = function(paramText) {
	var params = paramText.readMacroParams();
	if (params.length == 0 || params[0].length == 0) return null;
	
	var name = params[0];
	var paramsIndex = 1;
	var hidden = false;
	if (paramsIndex < params.length) {
		hidden = params[paramsIndex] == "hidden";
		paramsIndex++;
	}
	
	return {
		partName: name, 
		isHidden: hidden
	};
}

// Returns the match to the next (end or start) part tag in the text, 
// starting the search at startIndex.
// 
// When no such tag is found null is returned, otherwise a "Match" is returned:
// [0]: full match
// [1]: matched "end" tag (or null when no end tag match)
// [2]: matched "start" tag (or null when no start tag match)
// [3]: content of start tag (or null if no start tag match)
//
var findNextPartEndOrStartTagMatch = function(text, startIndex) {
	var re = new RegExp(partEndOrStartTagRE);
	re.lastIndex = startIndex;
	var match = re.exec(text);
	return match;
}

//============================================================================
// Formatter

// Process the <part ...> ... </part> starting at (w.source, w.matchStart) for formatting.
//
// @return true if a complete part section (including the end tag) could be processed, false otherwise.
//
var handlePartSection = function(w) {
	var tagMatch = findNextPartEndOrStartTagMatch(w.source, w.matchStart);
	if (!tagMatch) return false;
	if (tagMatch.index != w.matchStart || !tagMatch[2]) return false;

	// Parse the start tag parameters
	var arguments = parseStartTagParams(tagMatch[3]);
	if (!arguments) return false;
	
	// Continue processing
	var startTagEndIndex = skipEmptyEndOfLine(w.source, tagMatch.index + tagMatch[0].length);
	var endMatch = findNextPartEndOrStartTagMatch(w.source, startTagEndIndex);
	if (endMatch && endMatch[1]) {
		if (!arguments.isHidden) {
			w.nextMatch = startTagEndIndex;
			w.subWikify(w.output,partEndTagREString);
		}
		w.nextMatch = skipEmptyEndOfLine(w.source, endMatch.index + endMatch[0].length);
		
		return true;
	}
	return false;
}

config.formatters.push( {
    name: "part",
    match: "<part\\s+[^>]+>",
	
	handler: function(w) {
		if (!handlePartSection(w)) {
			w.outputText(w.output,w.matchStart,w.matchStart+w.matchLength);
		}
	}
} )

//============================================================================
// Extend "fetchTiddler" functionality to also recognize "part"s of tiddlers 
// as tiddlers.

var currentParent = null; // used for the "." parent (e.g. in the "tiddler" macro)

// Return the match to the first <part ...> tag of the text that has the
// requrest partName.
//
// @return [may be null]
//
var findPartStartTagByName = function(text, partName) {
	var i = 0;
	
	while (true) {
		var tagMatch = findNextPartEndOrStartTagMatch(text, i);
		if (!tagMatch) return null;

		if (tagMatch[2]) {
			// Is start tag
	
			// Check the name
			var arguments = parseStartTagParams(tagMatch[3]);
			if (arguments && arguments.partName == partName) {
				return tagMatch;
			}
		}
		i = tagMatch.index+tagMatch[0].length;
	}
}

// Return the part "partName" of the given parentTiddler as a "readOnly" Tiddler 
// object, using fullName as the Tiddler's title. 
//
// All remaining properties of the new Tiddler (tags etc.) are inherited from 
// the parentTiddler.
// 
// @return [may be null]
//
var getPart = function(parentTiddler, partName, fullName) {
	var text = parentTiddler.text;
	var startTag = findPartStartTagByName(text, partName);
	if (!startTag) return null;
	
	var endIndexOfStartTag = skipEmptyEndOfLine(text, startTag.index+startTag[0].length);
	var indexOfEndTag = text.indexOf(partEndTagString, endIndexOfStartTag);

	if (indexOfEndTag >= 0) {
		var partTiddlerText = text.substring(endIndexOfStartTag,indexOfEndTag);
		var partTiddler = new Tiddler();
		partTiddler.set(
						fullName,
						partTiddlerText,
						parentTiddler.modifier,
						parentTiddler.modified,
						parentTiddler.tags,
						parentTiddler.created);
		partTiddler.abegoIsPartTiddler = true;
		return partTiddler;
	}
	
	return null;
}

// Hijack the store.fetchTiddler to recognize the "part" addresses.
//
var hijackFetchTiddler = function() {
	var oldFetchTiddler = store.fetchTiddler ;
	store.fetchTiddler = function(title) {
		var result = oldFetchTiddler.apply(this, arguments);
		if (!result && title) {
			var i = title.lastIndexOf('/');
			if (i > 0) {
				var parentName = title.substring(0, i);
				var partName = title.substring(i+1);
				var parent = (parentName == ".") 
						? store.resolveTiddler(currentParent)
						: oldFetchTiddler.apply(this, [parentName]);
				if (parent) {
					return getPart(parent, partName, parent.title+"/"+partName);
				}
			}
		}
		return result;	
	};
};

// for debugging the plugin is not loaded through the systemConfig mechanism but via a script tag. 
// At that point in the "store" is not yet defined. In that case hijackFetchTiddler through the restart function.
// Otherwise hijack now.
if (!store) {
	var oldRestartFunc = restart;
	window.restart = function() {
		hijackFetchTiddler();
		oldRestartFunc.apply(this,arguments);
	};
} else
	hijackFetchTiddler();




// The user must not edit a readOnly/partTiddler
//

config.commands.editTiddler.oldIsReadOnlyFunction = Tiddler.prototype.isReadOnly;

Tiddler.prototype.isReadOnly = function() {
	// Tiddler.isReadOnly was introduced with TW 2.0.6.
	// For older version we explicitly check the global readOnly flag
	if (config.commands.editTiddler.oldIsReadOnlyFunction) {
		if (config.commands.editTiddler.oldIsReadOnlyFunction.apply(this, arguments)) return true;
	} else {
		if (readOnly) return true;
	}

	return this.abegoIsPartTiddler;
}

config.commands.editTiddler.handler = function(event,src,title)
{
	var t = store.getTiddler(title);
	// Edit the tiddler if it either is not a tiddler (but a shadowTiddler)
	// or the tiddler is not readOnly
	if(!t || !t.abegoIsPartTiddler)
		{
		clearMessage();
		story.displayTiddler(null,title,DEFAULT_EDIT_TEMPLATE);
		story.focusTiddler(title,"text");
		return false;
		}
}

// To allow the "./partName" syntax in macros we need to hijack 
// the invokeMacro to define the "currentParent" while it is running.
// 
var oldInvokeMacro = window.invokeMacro;
function myInvokeMacro(place,macro,params,wikifier,tiddler) {
	var oldCurrentParent = currentParent;
	if (tiddler) currentParent = tiddler;
	try {
		oldInvokeMacro.apply(this, arguments);
	} finally {
		currentParent = oldCurrentParent;
	}
}
window.invokeMacro = myInvokeMacro;

// To correctly support the "./partName" syntax while refreshing we need to hijack 
// the config.refreshers.tiddlers to define the "currentParent" while it is running.
// 
(function() {
	var oldTiddlerRefresher= config.refreshers.tiddler;
	config.refreshers.tiddler = function(e,changeList) {
		var oldCurrentParent = currentParent;
		try {
			currentParent = e.getAttribute("tiddler");
			return oldTiddlerRefresher.apply(this,arguments);
		} finally {
			currentParent = oldCurrentParent;
		}
	};
})();

// Support "./partName" syntax inside <<tabs ...>> macro
(function() {
	var extendRelativeNames = function(e, title) {
		var nodes = e.getElementsByTagName("a");
		for(var i=0; i<nodes.length; i++) {
			var node = nodes[i];
			var s = node.getAttribute("content");
			if (s && s.indexOf("./") == 0)
				node.setAttribute("content",title+s.substr(1));
		}
	};
	var oldHandler = config.macros.tabs.handler;
	config.macros.tabs.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
		var result = oldHandler.apply(this,arguments);
		if (tiddler)
			extendRelativeNames(place, tiddler.title);
		return result;
	};
})();

// Scroll the anchor anchorName in the viewer of the given tiddler visible.
// When no tiddler is defined use the tiddler of the target given event is used.
window.scrollAnchorVisible = function(anchorName, tiddler, evt) {
	var tiddlerElem = null;
	if (tiddler) {
		tiddlerElem = document.getElementById(story.idPrefix + tiddler);
	}
	if (!tiddlerElem && evt) {
		var target = resolveTarget(evt);
		tiddlerElem = story.findContainingTiddler(target);
	}
	if (!tiddlerElem) return;

	var children = tiddlerElem.getElementsByTagName("a");
	for (var i = 0; i < children.length; i++) {
		var child = children[i];
		var name = child.getAttribute("name");
		if (name == anchorName) {
			var y = findPosY(child);
			window.scrollTo(0,y);
			return;
		}
	}
}

} // of "install only once"
//}}}

/***
<html><sub><a href="javascript:;" onclick="scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>

!Licence and Copyright
Copyright (c) abego Software ~GmbH, 2006 ([[www.abego-software.de|http://www.abego-software.de]])

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.

Neither the name of abego Software nor the names of its contributors may be
used to endorse or promote products derived from this software without specific
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.

<html><sub><a href="javascript:;" onclick="scrollAnchorVisible('Top',null, event)">[Top]</sub></a></html>
***/


<<slideShow toc:headers>> Default slide show
[[Mass Balance Equation]]
[[Darcy's Law]]
[[Continuity Equation]]


[[GridPointData]] initializes pointdata as an array.

__[[CalcComplexPlotApp.py]]:__
<code python>
# CalcComplexPlotApp.py
class CalcComplexPlotApp(Calculation):
    def __init__(self):
        self.myControl = Control
        self.pointdata = GridPointData
        self.reFun = MultiVarFunction
        self.imFun = MultiVarFunction
	...

    def evaluateFunctionOnGrid(self):
        # data will be a 3D array
        data = self.pointdata.getData()
        mx = len(data)
        for i in range(0,mx,1):
            my = len(data[0])
            for j in range(0,my,1):
                re = self.reFun.evaluate([data[i][j][0], data[i][j][1]])
                data[i][j][3] = re
                im = self.imFun.evaluate([data[i][j][0], data[i][j][1]])
                data[i][j][4] = im
                data[i][j][2] = Math.sqrt(re*re+im*im)
		...

    def calculate(self):
        # read the grid size and create the 2d data-storage object
        # getInt() gets the integer of the string
        # getDouble() gets the double of the string
        size = self.myControl.getInt("grid size")    # grid size is 1st row in table
        self.pointdata = GridPointData(size, size, 3); # a grid with amp, re, and im data components
        # setting the scale of the graph with xmin, xmax, ymin and ymax
        self.pointdata.setScale(self.myControl.getDouble("xmin"), self.myControl.getDouble("xmax"), 		self.myControl.getDouble("ymin"), self.myControl.getDouble("ymax"));

</code>
Format blocks of CSS definitions as:
{{{
/***
Description and comments go here, surrounded by comment brackets.
Followed by CSS code, which will be displayed in a code block.
***/
/*{{{*/
div {color: #ff0000;}
/*}}}*/
}}}
That way the code will be run without the wikitext messing it up, and it will still be displayed nicely.
/***
|Name|Plugin: jsMath|
|Created by|BobMcElrath|
|Email|my first name at my last name dot org|
|Location|http://bob.mcelrath.org/tiddlyjsmath.html|
|Version|1.5.1|
|Requires|[[TiddlyWiki|http://www.tiddlywiki.com]] &ge; 2.0.3, [[jsMath|http://www.math.union.edu/~dpvc/jsMath/]] &ge; 3.0|
!Description
LaTeX is the world standard for specifying, typesetting, and communicating mathematics among scientists, engineers, and mathematicians.  For more information about LaTeX itself, visit the [[LaTeX Project|http://www.latex-project.org/]].  This plugin typesets math using [[jsMath|http://www.math.union.edu/~dpvc/jsMath/]], which is an implementation of the TeX math rules and typesetting in javascript, for your browser.  Notice the small button in the lower right corner which opens its control panel.
!Installation
In addition to this plugin, you must also [[install jsMath|http://www.math.union.edu/~dpvc/jsMath/download/jsMath.html]] on the same server as your TiddlyWiki html file.  If you're using TiddlyWiki without a web server, then the jsMath directory must be placed in the same location as the TiddlyWiki html file.

I also recommend modifying your StyleSheet use serif fonts that are slightly larger than normal, so that the math matches surrounding text, and \\small fonts are not unreadable (as in exponents and subscripts).
{{{
.viewer {
  line-height: 125%;
  font-family: serif;
  font-size: 12pt;
}
}}}

If you had used a previous version of [[Plugin: jsMath]], it is no longer necessary to edit the main tiddlywiki.html file to add the jsMath <script> tag.  [[Plugin: jsMath]] now uses ajax to load jsMath.
!History
* 11-Nov-05, version 1.0, Initial release
* 22-Jan-06, version 1.1, updated for ~TW2.0, tested with jsMath 3.1, editing tiddlywiki.html by hand is no longer necessary.
* 24-Jan-06, version 1.2, fixes for Safari, Konqueror
* 27-Jan-06, version 1.3, improved error handling, detect if ajax was already defined (used by ZiddlyWiki)
* 12-Jul-06, version 1.4, fixed problem with not finding image fonts
* 26-Feb-07, version 1.5, fixed problem with Mozilla "unterminated character class".
* 27-Feb-07, version 1.5.1, Runs compatibly with TW 2.1.0+, by Bram Chen
!Examples
|!Source|!Output|h
|{{{The variable $x$ is real.}}}|The variable $x$ is real.|
|{{{The variable \(y\) is complex.}}}|The variable \(y\) is complex.|
|{{{This \[\int_a^b x = \frac{1}{2}(b^2-a^2)\] is an easy integral.}}}|This \[\int_a^b x = \frac{1}{2}(b^2-a^2)\] is an easy integral.|
|{{{This $$\int_a^b \sin x = -(\cos b - \cos a)$$ is another easy integral.}}}|This $$\int_a^b \sin x = -(\cos b - \cos a)$$ is another easy integral.|
|{{{Block formatted equations may also use the 'equation' environment \begin{equation}  \int \tan x = -\ln \cos x \end{equation} }}}|Block formatted equations may also use the 'equation' environment \begin{equation}  \int \tan x = -\ln \cos x \end{equation}|
|{{{Equation arrays are also supported \begin{eqnarray} a &=& b \\ c &=& d \end{eqnarray} }}}|Equation arrays are also supported \begin{eqnarray} a &=& b \\ c &=& d \end{eqnarray} |
|{{{I spent \$7.38 on lunch.}}}|I spent \$7.38 on lunch.|
|{{{I had to insert a backslash (\\) into my document}}}|I had to insert a backslash (\\) into my document|
!Code
***/
//{{{

// AJAX code adapted from http://timmorgan.org/mini
// This is already loaded by ziddlywiki...
if(typeof(window["ajax"]) == "undefined") {
  ajax = {
      x: function(){try{return new ActiveXObject('Msxml2.XMLHTTP')}catch(e){try{return new ActiveXObject('Microsoft.XMLHTTP')}catch(e){return new XMLHttpRequest()}}},
      gets: function(url){var x=ajax.x();x.open('GET',url,false);x.send(null);return x.responseText}
  }
}

// Load jsMath
jsMath = {
  Setup: {inited: 1},          // don't run jsMath.Setup.Body() yet
  Autoload: {root: new String(document.location).replace(/[^\/]*$/,'jsMath/')}  // URL to jsMath directory, change if necessary
};
var jsMathstr;
try {
  jsMathstr = ajax.gets(jsMath.Autoload.root+"jsMath.js");
} catch(e) {
  alert("jsMath was not found: you must place the 'jsMath' directory in the same place as this file.  "
       +"The error was:\n"+e.name+": "+e.message);
  throw(e);  // abort eval
}
try {
  window.eval(jsMathstr);
} catch(e) {
  alert("jsMath failed to load.  The error was:\n"+e.name + ": " + e.message + " on line " + e.lineNumber);
}
jsMath.Setup.inited=0;  //  allow jsMath.Setup.Body() to run again

// Define wikifers for latex
config.formatterHelpers.mathFormatHelper = function(w) {
    var e = document.createElement(this.element);
    e.className = this.className;
    var endRegExp = new RegExp(this.terminator, "mg");
    endRegExp.lastIndex = w.matchStart+w.matchLength;
    var matched = endRegExp.exec(w.source);
    if(matched) {
        var txt = w.source.substr(w.matchStart+w.matchLength, 
            matched.index-w.matchStart-w.matchLength);
        if(this.keepdelim) {
          txt = w.source.substr(w.matchStart, matched.index+matched[0].length-w.matchStart);
        }
        e.appendChild(document.createTextNode(txt));
        w.output.appendChild(e);
        w.nextMatch = endRegExp.lastIndex;
    }
}

config.formatters.push({
  name: "displayMath1",
  match: "\\\$\\\$",
  terminator: "\\\$\\\$\\n?", // 2.0 compatability
  termRegExp: "\\\$\\\$\\n?",
  element: "div",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

config.formatters.push({
  name: "inlineMath1",
  match: "\\\$", 
  terminator: "\\\$", // 2.0 compatability
  termRegExp: "\\\$",
  element: "span",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

var backslashformatters = new Array(0);

backslashformatters.push({
  name: "inlineMath2",
  match: "\\\\\\\(",
  terminator: "\\\\\\\)", // 2.0 compatability
  termRegExp: "\\\\\\\)",
  element: "span",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

backslashformatters.push({
  name: "displayMath2",
  match: "\\\\\\\[",
  terminator: "\\\\\\\]\\n?", // 2.0 compatability
  termRegExp: "\\\\\\\]\\n?",
  element: "div",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

backslashformatters.push({
  name: "displayMath3",
  match: "\\\\begin\\{equation\\}",
  terminator: "\\\\end\\{equation\\}\\n?", // 2.0 compatability
  termRegExp: "\\\\end\\{equation\\}\\n?",
  element: "div",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

// These can be nested.  e.g. \begin{equation} \begin{array}{ccc} \begin{array}{ccc} ...
backslashformatters.push({
  name: "displayMath4",
  match: "\\\\begin\\{eqnarray\\}",
  terminator: "\\\\end\\{eqnarray\\}\\n?", // 2.0 compatability
  termRegExp: "\\\\end\\{eqnarray\\}\\n?",
  element: "div",
  className: "math",
  keepdelim: true,
  handler: config.formatterHelpers.mathFormatHelper
});

// The escape must come between backslash formatters and regular ones.
// So any latex-like \commands must be added to the beginning of
// backslashformatters here.
backslashformatters.push({
    name: "escape",
    match: "\\\\.",
    handler: function(w) {
        w.output.appendChild(document.createTextNode(w.source.substr(w.matchStart+1,1)));
        w.nextMatch = w.matchStart+2;
    }
});

config.formatters=backslashformatters.concat(config.formatters);

window.wikify = function(source,output,highlightRegExp,tiddler)
{
    if(source && source != "") {
        if(version.major == 2 && version.minor > 0) {
            var wikifier = new Wikifier(source,getParser(tiddler),highlightRegExp,tiddler);
            wikifier.subWikifyUnterm(output);
        } else {
            var wikifier = new Wikifier(source,formatter,highlightRegExp,tiddler);
            wikifier.subWikify(output,null);
        }
        jsMath.ProcessBeforeShowing();
    }
}



/* insert jsMath LaTeX macros here */


jsMath.Extension.Require('underset-overset');
jsMath.Font.Load("bbold10");

jsMath.Macro('al','\\alpha');
jsMath.Macro('be','\\beta');
jsMath.Macro('ga','\\gamma');
jsMath.Macro('de','\\delta');
jsMath.Macro('ep','\\epsilon');
jsMath.Macro('va','\\varepsilon');
jsMath.Macro('ze','\\zeta	');
jsMath.Macro('et','\\eta');
jsMath.Macro('th','\\theta');
jsMath.Macro('io','\\iota');
jsMath.Macro('ka','\\kappa');
jsMath.Macro('la','\\lambda');
jsMath.Macro('rh','\\rho');
jsMath.Macro('si','\\sigma');
jsMath.Macro('ta','\\tau');
jsMath.Macro('up','\\upsilon');
jsMath.Macro('ph','\\phi');
jsMath.Macro('ch','\\chi');
jsMath.Macro('ps','\\psi');
jsMath.Macro('om','\\omega');
jsMath.Macro('Ga','\\Gamma');
jsMath.Macro('De','\\Delta');
jsMath.Macro('Th','\\Theta');
jsMath.Macro('La','\\Lambda');
jsMath.Macro('Si','\\Sigma');
jsMath.Macro('Up','\\Upsilon');
jsMath.Macro('Ph','\\Phi');
jsMath.Macro('Ps','\\Psi');
jsMath.Macro('Om','\\Omega');
jsMath.Macro('pa','\\partial');
jsMath.Macro('na','\\nabla');
jsMath.Macro('ti','\\times');
jsMath.Macro('lb','\\left[');
jsMath.Macro('rb','\\right]');
jsMath.Macro('lp','\\left(');
jsMath.Macro('rp','\\right)');
jsMath.Macro('li','\\left<');
jsMath.Macro('ri','\\right>');
jsMath.Macro('ll','\\left|');
jsMath.Macro('rl','\\right|');
jsMath.Macro('lc','\\left\\{');
jsMath.Macro('rc','\\right\\}');
jsMath.Macro('ld','\\left.');
jsMath.Macro('rd','\\right.');
jsMath.Macro('ha','{\\small \\frac{1}{2}}');
jsMath.Macro('fr','{\\small \\frac{#1}{#2}}',2);
jsMath.Macro('p','\\phantom{#1}',1);
jsMath.Macro('f','{\\underset{\\raise4mu{\\smash{\\rightharpoondown}}}{{#1}}}',1);
jsMath.Macro('ff','{\\underset{\\raise6mu{\\smash{\\rightharpoondown}}}{\\underset{\\raise4mu{\\smash{\\rightharpoondown}}}{{#1}}}}',1);
jsMath.Macro('ub','{\\underset{\\raise4mu{\\smash{-}}}{{#1}}}',1);
jsMath.Macro('ud','{\\underset{\\raise4mu{\\smash{\\cdot}}}{{#1}}}',1);
jsMath.Macro('od','{\\overset{\\lower4mu{.}}{{#1}}}',1);
jsMath.Macro('udf','{\\underset{\\raise4mu{\\smash{\\cdot\\rightharpoondown}}}{{#1}}}',1);
jsMath.Macro('ve','{\\overset{\\lower4mu{\\moveright1mu{\\rightharpoonup}}}{{#1}}}',1);
jsMath.Macro('vv','{\\overset{\\lower6mu{\\moveright1mu{\\rightharpoonup}}}{\\overset{\\lower4mu{\\moveright1mu{\\rightharpoonup}}}{{#1}}}}',1);

/* end of jsMath macros */


//}}}
<<forEachTiddler
    where
       'tiddler.tags.contains(context.inTiddler.title)'
    sortBy
       'tiddler.title.toUpperCase()'
    write ' "* [[" + tiddler.title + "]] \n"'
     none '"//No tiddler tagged with \"ThisTag\"//"'
>>
<code java>
/*
 * Open Source Physics software is free software as described near the bottom of this code file.
 *
 * For additional information and documentation on Open Source Physics please see: 
 * <http://www.opensourcephysics.org/>
 */

package org.opensourcephysics.sip.ch03;
import java.awt.*;
import org.opensourcephysics.display.*;
import org.opensourcephysics.numerics.*;

/**
 * Projectile models the dynamics of a projectile and forms a template for other simulations.
 *
 * @author Wolfgang Christian, Jan Tobochnik, Harvey Gould
 * @version 1.0  05/16/05
 */
public class Projectile implements Drawable, ODE {
  static final double g = 9.8;
  double[] state = new double[5]; // {x,vx,y,vy,t}
  int pixRadius = 6;              // pixel radius for drawing of projectile
  EulerRichardson odeSolver = new EulerRichardson(this);

  public void setStepSize(double dt) {
    odeSolver.setStepSize(dt);
  }

  /**
   * Steps (advances) the time.
   *
   * @param dt the time step.
   */
  public void step() {
    odeSolver.step(); // do one time step using selected algorithm
  }

  /**
   * Sets the state.
   *
   * @param x
   * @param vx
   * @param y
   * @param vy
   */
  public void setState(double x, double vx, double y, double vy) {
    state[0] = x;
    state[1] = vx;
    state[2] = y;
    state[3] = vy;
    state[4] = 0;
  }

  /**
   * Gets the state.  Required for ODE interface.
   * @return double[] the state
   */
  public double[] getState() {
    return state;
  }

  /**
   * Gets the rate.  Required for ODE inteface
   * @param state double[] the state
   * @param rate double[]  the computed rate
   */
  public void getRate(double[] state, double[] rate) {
    rate[0] = state[1]; // rate of change of x
    rate[1] = 0;        // rate of change of vx
    rate[2] = state[3]; // rate of change of y
    rate[3] = -g;       // rate of change of vy
    rate[4] = 1;        // dt/dt = 1
  }

  /**
   * Draws the projectile. Required for Drawable interface.
   *
   * @param drawingPanel
   * @param g
   */
  public void draw(DrawingPanel drawingPanel, Graphics g) {
    int xpix = drawingPanel.xToPix(state[0]);
    int ypix = drawingPanel.yToPix(state[2]);
    g.setColor(Color.red);
    g.fillOval(xpix-pixRadius, ypix-pixRadius, 2*pixRadius, 2*pixRadius);
    g.setColor(Color.green);
    int xmin = drawingPanel.xToPix(-100);
    int xmax = drawingPanel.xToPix(100);
    int y0 = drawingPanel.yToPix(0);
    g.drawLine(xmin, y0, xmax, y0); // draw a line to represent the ground
  }
}

/* 
 * Open Source Physics software is free software; you can redistribute
 * it and/or modify it under the terms of the GNU General Public License (GPL) as
 * published by the Free Software Foundation; either version 2 of the License,
 * or(at your option) any later version.

 * Code that uses any portion of the code in the org.opensourcephysics package
 * or any subpackage (subdirectory) of this package must must also be be released
 * under the GNU GPL license.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston MA 02111-1307 USA
 * or view the license online at http://www.gnu.org/copyleft/gpl.html
 *
 * Copyright (c) 2007  The Open Source Physics project
 *                     http://www.opensourcephysics.org
 */
</code>
<code python>
from java.awt import *
from org.opensourcephysics.display import *
from org.opensourcephysics.numerics import *
import jarray
"""
"  Projectile models the dynamics of a projectile and forms a template for other simulations.
"""
class Projectile(Drawable, ODE):
    g = 9.8
    state = jarray.zeros(5, "d")    # {x,vx,y,vy,t}
    pixRadius = 6                    # pixel radius for drawing of projectile


    def setStepSize(self, dt):
        self.odeSolver = EulerRichardson(self)
        self.odeSolver.setStepSize(dt)

    def step(self):
        self.odeSolver.step();  # do one time step using selected algorithm

    def setState(self, x, vx, y,  vy):
        self.state[0] = x;
        self.state[1] = vx;
        self.state[2] = y;
        self.state[3] = vy;
        self.state[4] = 0;

    def getState(self):
        return self.state

    def getRate(self, state, rate):    #state, rate -> arrays
        rate[0] = state[1];     # rate of change of x
        rate[1] = 0;            # rate of change of vx
        rate[2] = state[3];     # rate of change of y
        rate[3] = -self.g;           # rate of change of vy
        rate[4] = 1;            # dt/dt = 1

    def draw(self, drawingPanel, g):
        xpix = drawingPanel.xToPix(self.state[0])
        ypix = drawingPanel.yToPix(self.state[2])
        g.setColor(Color.red);
        g.fillOval(xpix-self.pixRadius, ypix-self.pixRadius, 2*self.pixRadius, 2*self.pixRadius);
        g.setColor(Color.green);
        xmin = drawingPanel.xToPix(-100);
        xmax = drawingPanel.xToPix(100);
        y0 = drawingPanel.yToPix(0);
        g.drawLine(xmin, y0, xmax, y0); # draw a line to represent the ground

</code>
!![[ProjectileApp]]
<part description>
This is the classic projectile application showing a 2D animated trajectory. Angle and velocity can be changed from the parameters window. 
</part>
>@@[[Launch ProjectileApp|http://www.reyesaguayo.com/osp/jws/ProjectileApp.jnlp]]@@
><<tiddler [[ProjectileApp.jpg]]>>
!!!Features
* Can change projectile launch from control box
* Animated trajectory
* Plot for horizontal position versus height
* Plot for x,y position vs. time

!Code
*[[Projectile.java]]     [[ProjectileApp.java]]     [[ProjectileApp.py]]    [[Projectile.py]]

[[ProjectileApp libraries]]
{{{
Required packages:
  org.opensourcephysics.frames*
  org.opensourcephysics.controls*
  java.awt.print
  java.awt.peer
  org.opensourcephysics.display*
  java.awt.font
  java.awt.datatransfer
  java.awt.geom
  java.awt*
  org.opensourcephysics.numerics*
  java.awt.im
  java.awt.image
  java.awt.dnd
  org.opensourcephysics.display.dialogs
  java.awt.color
  java.awt.event
  org.opensourcephysics.display.axes
}}}
![[ProjectileApp]]
{{borderlessL{
|[img(100%,auto)[ProjectileApp|http://reyesaguayo.com/osp/images/ProjectileApp.jpg][http://reyesaguayo.com/osp/images/ProjectileApp.jpg]]<br>&nbsp;&nbsp;@@color:#c06;<<tiddler ./execute>>@@|vertical-align:top;width:30em;<<tiddler ./description>> <<tiddler ./javacode>> <<tiddler ./jythoncode>>|
}}}
<part description hidden>
!!!!Description
<<tiddler [[ProjectileApp/description]]>>
</part>

<part execute hidden>
@@[[Launch ProjectileApp JWS application|http://www.reyesaguayo.com/osp/jws/ProjectileApp.jnlp]]@@ 
</part>
<part javacode hidden>
!!!!Java Code
[[Projectile.java]] [[ProjectileApp.java]]
</part>
<part jythoncode hidden>
!!!!Jython Code
[[Projectile.py]] [[ProjectileApp.py]]
</part>
<code java>
/*
 * Open Source Physics software is free software as described near the bottom of this code file.
 *
 * For additional information and documentation on Open Source Physics please see: 
 * <http://www.opensourcephysics.org/>
 */

package org.opensourcephysics.sip.ch03;
import org.opensourcephysics.controls.*;
import org.opensourcephysics.frames.*;

/**
 * ProjectileApp solves and displays the time evolution of a projectile by stepping a projectile model.
 *
 * @author Wolfgang Christian, Jan Tobochnik, Harvey Gould
 * @version 1.0  05/16/05
 */
public class ProjectileApp extends AbstractSimulation {
  PlotFrame plotFrame = new PlotFrame("Time", "x,y", "Position versus time");
  Projectile projectile = new Projectile();
  PlotFrame animationFrame = new PlotFrame("x", "y", "Trajectory");

  public ProjectileApp() {
    animationFrame.addDrawable(projectile);
    plotFrame.setXYColumnNames(0, "t", "x");
    plotFrame.setXYColumnNames(1, "t", "y");
  }

  /**
   * Initializes the simulation.
   */
  public void initialize() {
    double dt = control.getDouble("dt");
    double x = control.getDouble("initial x");
    double vx = control.getDouble("initial vx");
    double y = control.getDouble("initial y");
    double vy = control.getDouble("initial vy");
    projectile.setState(x, vx, y, vy);
    projectile.setStepSize(dt);
    double size = (vx*vx+vy*vy)/10; // estimate of size needed for display
    animationFrame.setPreferredMinMax(-1, size, -1, size);
  }

  /**
   * Does a time step.
   */
  public void doStep() {
    plotFrame.append(0, projectile.state[4], projectile.state[0]); // x vs time data added
    plotFrame.append(1, projectile.state[4], projectile.state[2]); // y vs time data added
    animationFrame.append(0, projectile.state[0], projectile.state[2]); // trajectory data added
    projectile.step(); // advance the state by one time step
  }

  /**
   * Resets the simulation.
   */
  public void reset() {
    control.setValue("initial x", 0);
    control.setValue("initial vx", 10);
    control.setValue("initial y", 0);
    control.setValue("initial vy", 10);
    control.setValue("dt", 0.01);
    enableStepsPerDisplay(true);
  }

  /**
   * Starts the Java application.
   * @param args  command line parameters
   */
  public static void main(String[] args) {
    SimulationControl.createApp(new ProjectileApp());
  }
}

/* 
 * Open Source Physics software is free software; you can redistribute
 * it and/or modify it under the terms of the GNU General Public License (GPL) as
 * published by the Free Software Foundation; either version 2 of the License,
 * or(at your option) any later version.

 * Code that uses any portion of the code in the org.opensourcephysics package
 * or any subpackage (subdirectory) of this package must must also be be released
 * under the GNU GPL license.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston MA 02111-1307 USA
 * or view the license online at http://www.gnu.org/copyleft/gpl.html
 *
 * Copyright (c) 2007  The Open Source Physics project
 *                     http://www.opensourcephysics.org
 */
</code>
[img(34%,auto)[ProjectileApp|http://reyesaguayo.com/osp/images/ProjectileApp.jpg][http://reyesaguayo.com/osp/images/ProjectileApp.jpg]]
<code py>
from org.opensourcephysics.controls import *
from org.opensourcephysics.frames import *
from Projectile import *
"""
"  ProjectileApp solves and displays the time evolution of a projectile by stepping a projectile model.
"""
class ProjectileApp(AbstractSimulation):
    plotFrame = PlotFrame("Time", "x,y", "Position versus time");
    projectile = Projectile();
    animationFrame = PlotFrame("x", "y", "Trajectory");

    def __init__(self):
        self.animationFrame.addDrawable(self.projectile);
        self.plotFrame.setXYColumnNames(0, "t", "x");
        self.plotFrame.setXYColumnNames(1, "t", "y");

    def initialize(self):
        dt = self.control.getDouble("dt");
        x = self.control.getDouble("initial x");
        vx = self.control.getDouble("initial vx");
        y = self.control.getDouble("initial y");
        vy = self.control.getDouble("initial vy");
        self.projectile.setState(x, vx, y, vy);
        self.projectile.setStepSize(dt);
        size = (vx*vx+vy*vy)/10;     # estimate of size needed for display
        self.animationFrame.setPreferredMinMax(-1, size, -1, size);

    def doStep(self):
        self.plotFrame.append(0, self.projectile.state[4], self.projectile.state[0]); # x vs time data added
        self.plotFrame.append(1, self.projectile.state[4], self.projectile.state[2]); # y vs time data added
        self.animationFrame.append(0, self.projectile.state[0], self.projectile.state[2]); # trajectory data added
        self.projectile.step();     # advance the state by one time step

    def reset(self):
        self.control.setValue("initial x", 0);
        self.control.setValue("initial vx", 10);
        self.control.setValue("initial y", 0);
        self.control.setValue("initial vy", 10);
        self.control.setValue("dt", 0.01);
        self.enableStepsPerDisplay(True);

SimulationControl.createApp(ProjectileApp());
</code>
{{{
_view.shaftGroup.setTransformation(new Quaternion(cos, 0, 0, sin));
}}}
{{{
  Transformation rotation = new Quaternion(cos, sin, 0, 0);
}}}

<code java>
package org.opensourcephysics.davidson.ode.basic_examples;
import org.opensourcephysics.numerics.ODE;

/**
 * Reaction models an autocatalytic oscillating chemical reaction (Brusselator model)
 * by implementing the ODE interface.
 * @author Wolfgang Christian
 * @version 1.0
 */
public class Reaction implements ODE {
  double[] state = new double[3]; // X, Y, t
  double k1=1.0, k2=2.5, k3=1.0, k4=1.0; // reaction rates
  double A=1, B=1;       // reactant concenterations

  /**
   * Constructs an autocatalytic oscillating chemical reaction using the given initial conditions.
   * @param initialConditions double[]
   */
  Reaction(double[] initialConditions){
     state=(double[])initialConditions.clone();
  }

  /**
   * Gets the model's state variables.
   * @return double[]
   */
  public double[] getState() { return state; }

  /**
   * Computes the rate using the given state.
   * @param state double[] the state that will be used to compute the rate
   * @param rate double[]  the computed rate
   */
  public void getRate(double[] state, double[] rate ){
    double xxy=state[0]*state[0]*state[1];
    rate[0] = k1*A-k2*B*state[0]+k3*xxy-k4*state[0];  // X rate
    rate[1] = k2*B*state[0]-k3*xxy ; // Y rate
    rate[2] = 1; // time derivative
  }
}
</code>
<code python>
from org.opensourcephysics.numerics import ODE;
import jarray

class Reaction(ODE):

    def __init__(self, initialConditions):
        n = len(initialConditions)
        self.state1 = jarray.zeros(n, "d")
        self.k1 = 1.0
        self.k2 = 2.5;
        self.k3 = 1.0;
        self.k4 = 1.0;
        self.A = 1.0;
        self.B = 1.0;
        getClone(self.state1, initialConditions)

    def getState(self):
        return self.state1

    def getRate(self, state, rate):
        xxy = state[0] * state[0] * state[1]
        rate[0] = ((self.k1 * self.A - self.k2 * self.B * state[0]) + self.k3 * xxy) - self.k4 * state[0];
        rate[1] = self.k2 * self.B * state[0] - self.k3 * xxy
        rate[2] = 1.0

def getClone(tar,src):
    n = len(tar)
    for i in range(0,n,1):
        tar[i] = src[i]
    
if __name__ == '__main__':
    M = 10
    icond = jarray.zeros(M, "d");
    r = Reaction(icond)

</code>
!![[ReactionApp]]
>  <part description> This application solves an autocatalytic oscillating chemical reaction (Brusselator model) using a fouth-order Runge-Kutta algorithm.</part><br>
>@@[[Launch ReactionApp|http://www.reyesaguayo.com/osp/jws/ReactionApp.jnlp]]@@
><<tiddler [[ReactionApp.jpg]]>>
!Code
|[[ReactionApp.py]] | [[Reaction.py]] | [[ReactionApp.java]] | [[Reaction.java]] | [[ReactionApp.jnlp]] |
|[[ReactionApp.html]] |

<<tiddler [[Link to ReactionApp.jnlp]]>>
![[ReactionApp]]
{{borderlessL{
|[img(100%,auto)[ReactionApp|http://reyesaguayo.com/osp/images/ReactionApp.jpg][http://reyesaguayo.com/osp/images/ReactionApp.jpg]]<br>&nbsp;&nbsp;@@color:#c06;<<tiddler ./execute>>@@|vertical-align:top;width:30em;<<tiddler ./description>> <<tiddler ./javacode>> <<tiddler ./jythoncode>>|
}}}
<part description hidden>
!!!!Description
<<tiddler [[ReactionApp/description]]>>
</part>

<part execute hidden>
@@[[Launch ReactionApp JWS application|http://www.reyesaguayo.com/osp/jws/ReactionApp.jnlp]]@@ 
</part>

<part javacode hidden>
!!!!Java Code
[[Reaction.java]] [[ReactionApp.java]]
</part>
<part jythoncode hidden>
!!!!Jython Code
[[Reaction.py]] [[ReactionApp.py]]
</part>
<code html>
<html>
<head>
<title>ReactionApp</title>
</head>
<body>
<h1>ReactionApp</h1>
<hr>
<p>
<applet codebase="."
code="org.opensourcephysics.davidson.applets.ApplicationApplet.class" 
archive="select.jar" name="ReactionApp" 
width="250" height="50" hspace="10" vspace="10" align="top">
<param name="target"value="org.opensourcephysics.davidson.ode.basic_examples.ReactionApp">
</applet>
</p>
</body>
</html>
</code>
<code java>
package org.opensourcephysics.davidson.ode.basic_examples;

import org.opensourcephysics.controls.*;
import org.opensourcephysics.numerics.*;
import org.opensourcephysics.frames.*;

/**
 * ReactionApp solves an autocatalytic oscillating chemical reaction (Brusselator model) using
 * a fouth-order Runge-Kutta algorithm.
 * @author Wolfgang Christian
 * @version 1.0
 */
public class ReactionApp extends AbstractSimulation {
   Reaction reaction;
   ODESolver solver;
   PlotFrame phasePlot= new PlotFrame("X","Y","Product Phase Space");
   PlotFrame timePlot= new PlotFrame("t","X and Y","Reaction Products");

   /**
    * Initializes the simulation by reading parameters from the control.
    */
   public void initialize(){
      double x = control.getDouble("X");
      double y = control.getDouble("Y");
      reaction = new Reaction(new double[]{x, y, 0}); // create reaction model
      solver = new RK4(reaction);                     // create solver for this model
   }

   /**
    * Steps (advances) the reaction and plots the results.
    * The solver increments the time using its internal stepsize.
    */
   protected void doStep() {
      solver.step();
      timePlot.append(0,reaction.state[2],reaction.state[0]);
      timePlot.append(1,reaction.state[2],reaction.state[1]);
      phasePlot.append(0,reaction.state[0],reaction.state[1]);
   }

   /**
    * Resets the reaction into a predefined state.
    */
   public void reset() {
      timePlot.setConnected(true);  // connect data points with straight line segments
      phasePlot.setConnected(true); // connect data points with straight line segments
      control.setValue("X","1");
      control.setValue("Y",5);
      control.setValue("dt",0.1);
      enableStepsPerDisplay(true);
      initialize();
   }

   /**
    * Starts the ReactionApp program.
    * @param args String[]
    */
   public static void main(String[] args) { SimulationControl.createApp(new ReactionApp(), args); }
}
</code>


<code XML>
  <?xml version="1.0" encoding="utf-8"?> 
    <jnlp spec="1.0+" codebase="http://www.reyesaguayo.com/osp/jws/" 
           href="ReactionApp.jnlp"> 
    <information> 
     <title>ReactionApp</title> 
     <vendor>OpenSourcePhysics.org</vendor> 
     <description>JNLP-Demo Application ReactionApp</description>
     <icon href="ReactionApp.gif"/> 
     <offline-allowed/> 
   </information> 
   <resources> 
     <j2se version="1.4+"/> 
     <jar href="jython_osp.jar"/> 
   </resources> 
   <application-desc main-class="ReactionApp"/> 
  </jnlp>
</code>
[img(34%,auto)[tooltip|http://reyesaguayo.com/osp/images/ReactionApp.jpg][http://reyesaguayo.com/osp/images/ReactionApp.jpg]]
[img(34%,auto)[tooltip|ReactionApp.jpg][ReactionApp.jpg]]
<code python>
from org.opensourcephysics.controls import *;
from org.opensourcephysics.frames import PlotFrame;
from org.opensourcephysics.numerics import ODESolver;
from org.opensourcephysics.numerics import RK4;
from Reaction import *
import java.lang.Double
from java.lang.reflect import Array
import jarray

class ReactionApp(AbstractSimulation):
    phasePlot = PlotFrame
    timePlot = PlotFrame
    reaction = Reaction
    solver =  ODESolver

    def __init__(self):
        self.phasePlot = PlotFrame("X", "Y", "Product Phase Space");
        self.timePlot = PlotFrame("t", "X and Y", "Reaction Products");

    def initialize(self):
        x = self.control.getDouble("X");
        y = self.control.getDouble("Y");
        #data = Array.newInstance(java.lang.Double.TYPE, [3])
        data = jarray.zeros(3, "d");
        data = [x, y, 0.0]
        self.reaction = Reaction(data)
        self.solver = RK4(self.reaction)

    def doStep(self):
        self.solver.step();
        self.timePlot.append(0, self.reaction.state1[2], self.reaction.state1[0])
        self.timePlot.append(1, self.reaction.state1[2], self.reaction.state1[1])
        self.phasePlot.append(0, self.reaction.state1[0], self.reaction.state1[1])

    def reset(self):
        self.timePlot.setConnected(True);
        self.phasePlot.setConnected(True);
        self.control.setValue("X", "1");
        self.control.setValue("Y", 5);
        self.control.setValue("dt", 0.10000000000000001);
        self.enableStepsPerDisplay(True);
        self.initialize()

if __name__ == '__main__':
    SimulationControl.createApp(ReactionApp())

</code>
//''Shows DefaultTiddlers + most recently modified tiddlers as default when any TiddlyWiki or adaptation is first loaded.''//
//To use, copy this tiddler's contents to a new tiddler on your site and tag it "systemConfig".//

{{{
var num = 3;
var ignore_tags = ['systemConfig', 'systemTiddlers', 'system', 'plugin', 'plugin-examples', 'system', 'stylesheet', 'template', 'folder', 'menu', 'In Progress', '0', 'modified', 'user', 'test', 'meta', 'plugin-examples'];
var ignore_tiddlers = [];

function in_array(item, arr){for(var i=0;i<arr.length;i++)if(item==arr[i])return true};
function get_parent(tiddler){while(tiddler && in_array('comments', tiddler.tags)) tiddler=store.fetchTiddler(tiddler.tags[0]);return tiddler};
function unique_list(list){var l=[];for(i=0;i<list.length;i++)if(!in_array(list[i], l))l.push(list[i]);return l};
function get_recent_tiddlers(){
  var tiddlers = store.getTiddlers('modified');
  var names = store.getTiddlerText("DefaultTiddlers").readBracketedList();

  for(var i=0; i<ignore_tags.length; i++)
    ignore_tiddlers=ignore_tiddlers.concat(store.getTaggedTiddlers(ignore_tags[i]));
  for(var i=tiddlers.length-1; i>=0; i--) {
    if (in_array('comments', tiddlers[i].tags)) {
      var t = get_parent(tiddlers[i]);
      if (t) names.push(t.title)
    }
    else if (!in_array(tiddlers[i], ignore_tiddlers))
      names.push(tiddlers[i].title);
  }
  return unique_list(names).slice(0, num);
}
var names = get_recent_tiddlers();
_restart = restart
restart = function() {
  if(window.location.hash) _restart();
  else story.displayTiddlers(null,names);
}
}}}
<code java>
public class RectangularArray {

	public static void main(String[] args) {
		int[][] a2 = new int[7][5];
		 // print array in rectangular form
		 for (int r=0; r<a2.length; r++) {
		     for (int c=0; c<a2[r].length; c++) {
		         System.out.print(" " + a2[r][c]);
		     }
		     System.out.println("");
		 }
	}
}
</code>
/***
''Name:'' ReferencesPlugin
''Author:'' Garrett Lisi
''Description:'' Places a comma separated list of referring notes at the bottom of each note -- replacing the "references" command bar button.
''Installation:'' Copy this note, change the [[StyleSheet]] to set the references class style, and add a line in the [[ViewTemplate]].

''Code:''
***/
/*{{{*/
config.macros.references = {};
config.macros.references.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
	var references = store.getReferringTiddlers(tiddler.title);
	if(references.length>0)
		{
//		createTiddlyText(place,"\xAB ");	
		createTiddlyLink(place,references[0].title,true);
		}
	for(var r=1; r<references.length; r++)
		if(references[r].title != tiddler.title)
			{
			createTiddlyText(place,", ");
			createTiddlyLink(place,references[r].title,true);
			}
}
/*}}}*/
.references {
	font-size: 1em;
	text-align: center;
	color: #666;
	margin-top: .75em;
	padding: .25em;
	border: 1px solid #eee;
	background-color: #eee;}
.selected .references {
	background-color: #eee;
	border: 1px solid #ccc;}
.references .tiddlyLinkExisting {font-weight: normal;}
<div class='references' macro="references"></div>

/***
| Name:|RenameTagsPlugin|
| Description:|Allows you to easily rename or delete tags across multiple tiddlers|
| Version:|3.0 ($Rev: 1845 $)|
| Date:|$Date: 2007-03-16 15:19:22 +1000 (Fri, 16 Mar 2007) $|
| Source:|http://mptw.tiddlyspot.com/#RenameTagsPlugin|
| Author:|Simon Baird <simon.baird@gmail.com>|
| License|http://mptw.tiddlyspot.com/#TheBSDLicense|
Rename a tag and you will be prompted to rename it in all its tagged tiddlers.
***/
//{{{
config.renameTags = {

	prompts: {
		rename: "Rename the tag '%0' to '%1' in %2 tidder%3?",
		remove: "Remove the tag '%0' from %1 tidder%2?"
	},

	removeTag: function(tag,tiddlers) {
		store.suspendNotifications();
		for (var i=0;i<tiddlers.length;i++) {
			store.setTiddlerTag(tiddlers[i].title,false,tag);
		}
		store.resumeNotifications();
		store.notifyAll();
	},

	renameTag: function(oldTag,newTag,tiddlers) {
		store.suspendNotifications();
		for (var i=0;i<tiddlers.length;i++) {
			store.setTiddlerTag(tiddlers[i].title,false,oldTag); // remove old
			store.setTiddlerTag(tiddlers[i].title,true,newTag);  // add new
		}
		store.resumeNotifications();
		store.notifyAll();
	},

	storeMethods: {

		saveTiddler_orig_renameTags: TiddlyWiki.prototype.saveTiddler,

		saveTiddler: function(title,newTitle,newBody,modifier,modified,tags,fields) {
			if (title != newTitle) {
				var tagged = this.getTaggedTiddlers(title);
				if (tagged.length > 0) {
					// then we are renaming a tag
					if (confirm(config.renameTags.prompts.rename.format([title,newTitle,tagged.length,tagged.length>1?"s":""])))
						config.renameTags.renameTag(title,newTitle,tagged);

					if (!this.tiddlerExists(title) && newBody == "")
						// dont create unwanted tiddler
						return null;
				}
			}
			return this.saveTiddler_orig_renameTags(title,newTitle,newBody,modifier,modified,tags,fields);
		},

		removeTiddler_orig_renameTags: TiddlyWiki.prototype.removeTiddler,

		removeTiddler: function(title) {
			var tagged = this.getTaggedTiddlers(title);
			if (tagged.length > 0)
				if (confirm(config.renameTags.prompts.remove.format([title,tagged.length,tagged.length>1?"s":""])))
					config.renameTags.removeTag(title,tagged);
			return this.removeTiddler_orig_renameTags(title);
		}

	},

	init: function() {
		merge(TiddlyWiki.prototype,this.storeMethods);
	}
}

config.renameTags.init();

//}}}
!!!![[Launch RootApp|http://thesmartfield.com/tw/modeling/jws/RootApp.jnlp]]
!Variables

<<tiddler [[RotationAndTranslation_variables.png]]>>

!Equations

<<tiddler [[RotationAndTranslation_difeq.png]]>>

!EJS objects used
*[[Point2D]]
*[[AffineTransform]]
[img[RotationAndTranslation_difeq.png]]
[img[RotationAndTranslation_variables.png]]
!EJS objects
* [[ControlElement3D ]]
!EJS Objects used
*[[ArrayPanel]] 
*[[RadioButton]]

!Library
[[ejs.davidson.edu]]

<code python>
from java.awt import BorderLayout as BL, Color, Button, Panel

class Scribble(Panel):
    """ A simple GUI example """

    def __init__ (self):  # constructor
        Panel.__init__(self, BL())
        self.add(Button('Clear', actionPerformed=self.doClear),
                         BL.SOUTH)
        self.mouseDragged = self.doDrag
        self.mousePressed = self.doPress
        self.__last = 0, 0

    def doClear (self, event):
        """ clear background """
        g = self.graphics
        g.color = self.background  
        g.fillRect(0, 0, self.size.width, self.size.height)

    def doDrag (self, event):
        """ draw line from last to here """
        g = self.graphics
        g.color = Color.black
        lx, ly = self.__last
        x = event.x; y = event.y
        g.drawLine(lx, ly, x, y)   # draw new line segment
        self.__last = x, y   # save coordinates

    def doPress (self, event):
        """ save click point """
        self.__last = event.x, event.y 

if __name__ == "__main__":
    def doClose (event):
        import sys
        sys.exit()
    from java.awt import Frame
    frame = Frame("Scribble", windowClosing=doClose)
    frame.add( Scribble() )
    frame.size = 400, 300
    frame.visible = 1
</code>
show all shadow tiddlers (not visible otherwise)
<<list shadowed>>

@@font-size:75%;<<editTiddler [[$1]]>>@@
<<tiddler [[$1]]>> 
!!!$1 @@font-size:75%;<<editTiddler [[$1]]>>@@
<<tiddler [[$1]]>> 
<<search>><<newTiddler>><<permaview>><<collapseAll>><<closeAll>><<slider chkSliderOptionsPanel OptionsPanel '»' 'Change options'>>
<<tabs txtMainTab Contents 'Hierarchy of tags and content' TabContents Latest 'Recently modified tiddlers' TabTimeline Tags 'List all tags' TabTags All 'List all tiddlers' TabAll More "More lists" TabMore>>
<<tabs txtMainTab Timeline "Timeline" TabTimeline Al" "All tiddlers" TabAll Tags "All tags" TabTags More "More lists" TabMore>>
<HTML>
<HEAD>
   <TITLE>Applet HTML Page</TITLE>
</HEAD>
<BODY>

<H3><HR WIDTH="100%">Applet HTML Page<HR WIDTH="100%"></H3>

<P>
<APPLET codebase="." code="SimpleDraw/SimpleDraw.class" width=350 height=200></APPLET>
</P>

<HR WIDTH="100%"><FONT SIZE=-1><I>Generated by NetBeans IDE</I></FONT>
</BODY>
</HTML>


!Location 
file:///home/msfz751/Programming/ejs/workspaces/ejsExamples-080117/source/_examples/Experiments

!EJS Objects
* [[Pipe]] 
* [[Tank]]
.sliderPanel { margin-left: 0.750em; }  
beta - for petroleum production engineering
Modeling & Simulations
http://interstice.com/~aglisi/dg/index.cgi
/***
|Name|SliderMacro|
|Version|1.0.3|
|Requires|~TW2.x|

!Code
***/
//{{{

// this part is not actually required but useful to other people using your plugin
version.extensions.SliderFolderMacro = { major: 1, minor: 0, revision: 3, date: new Date(2006,3,3),
 source: "http://"
};

config.macros.sliderFolder = {
	label: "sliderFolder",
	prompt: "This will send a message" 
};
config.macros.sliderFolder.handler = function (place,macroName,params,wikifier,paramString,tiddler) {
	tg = params[0] && params[0] != '.' ? params[0] : "NameForgotten";
	lb = params[1] && params[1] != '.' ? params[1] : tg;
	nt = params[2] && params[2] != '.' ? params[2] : "CommentForgotten";

	var who = params.length > 0 ? params[0] : "world";
//	var tg = params.length > 0 ? params[0] : "world";
//	var note = params[1] != null ?  params[1] : "please, add a comment"; 
	var note = nt;
	note = "[["+note+"]]";
	var folder =  tg + "F";
	var lbl = "[["+lb + " " + "\xBB" +  "]]";
	var opnTid = "[[" + "\xA4" + "|"+ tg + "]]";
//	var opnFdr = "[[" + "⊡" + "|"+folder+"]]";
	var opnFdr = "[[" + "-" + "|"+folder+"]]";

	wikify(opnTid + opnFdr+" <<slider " + "[[chkSlider" + folder + "]]" + " " + "[[" + folder + "]]" + " " + lbl + " " + note + ">>",place);
}

// a one liner...
config.macros.MySlider = { 
	handler: function(place,name,params) { 
		wikify("//''@@font-size:5em;color:#696;"+ params[0] + "!@@''//", place); 
	} 
};

//}}}
/***
!Example
{{{<<sliderFolder systemConfig . "start-up executed tiddlers">>}}}
<<sliderFolder systemConfig . "start-up executed tiddlers">>

{{{<<sliderFolder systemConfig 'System Configuration' "start-up executed tiddlers">>}}}
<<sliderFolder systemConfig 'System Configuration' "start-up executed tiddlers">>

***/
Type the text for 'New Tiddler'

$$
\begin{eqnarray}
v_{n+1} & = & v_{n} e^{\textstyle -\eta \Delta t}
 + \int \limits_{0}^{\Delta t}
 e^{\textstyle -\eta(\Delta t-t')}  a(t_{n}+t') dt' 
\\
 r_{n+1} & = & r_{n}+ v_{n}
 \frac{1-e^{\textstyle -\eta \Delta t}}{\eta} 
  + \int \limits_{0}^{\Delta t}
  \frac{1-e^{\textstyle -\eta(\Delta t-t')}}{\eta}  a(t_{n}+t') dt'
\end{eqnarray}
$$
[[DGStyleSheet]]
[[ReferencesStyleSheet]]
[[StyleSheetSyntaxHighlighter]]
[[SiteMapStyleSheet]]

TagsTreeStyleSheet
[[UserDefinedStyleSheet]]
[[IntelliTaggerStyleSheet]]
StyleSheetShortcuts
BasicsStyleSheet
/*{{{*/
#mainMenu
	{ text-align:left; width:14em; padding:0.5em; }
#mainMenu table, #mainMenu table td 
	{ border:1px solid #999; border-collapse:collapse; padding:.3em; }

#displayArea
	{ margin-left:16em; margin-right:15em; }


/*}}}*/
/***
|Name|StyleSheetShortcuts|
|Source|http://www.TiddlyTools.com/#StyleSheetShortcuts|
|Version||
|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|CSS|
|Requires||
|Overrides||
|Description|'convenience' classes for common formatting, alignment, boxes, tables, etc.|

These 'style tweaks' can be easily included in other stylesheet tiddler so they can share a baseline look-and-feel that can then be customized to create a wide variety of 'flavors'.
***/
/*{{{*/

/* text alignments */
.left
	{ display:block;text-align:left; }
.center
	{ display:block;text-align:center; }
.center table
	{ margin:auto !important; }
.right	
	{ display:block;text-align:right; }
.justify
	{ display:block;text-align:justify; }
.indent
	{ display:block;margin:0;padding:0;border:0;margin-left:2em; }
.floatleft
	{ float:left; }
.floatright
	{ float:right; }
.valignTop, .valignTop table, .valignTop tbody, .valignTop th, .valignTop tr, .valignTop td
	{ vertical-align:top; }
.valignBottom, .valignBottom table, .valignBottom tbody, .valignBottom th, .valignBottom tr, .valignBottom td
	{ vertical-align:bottom; }
.clear
	{ clear:both; }
.wrap
	{ white-space:normal; }
.nowrap
	{ white-space:nowrap; }
.hidden
	{ display:none; }
.show
	{ display:inline !important; }
.span
	{ display:span; }
.block
	{ display:block; }
.relative
	{ position:relative; }
.absolute
	{ position:absolute; }

/* font sizes */
.big
	{ font-size:14pt;line-height:120% }
.medium
	{ font-size:12pt;line-height:120% }
.normal
	{ font-size:9pt;line-height:120% }
.small
	{ font-size:8pt;line-height:120% }
.fine
	{ font-size:7pt;line-height:120% }
.tiny
	{ font-size:6pt;line-height:120% }
.larger
	{ font-size:120%; }
.smaller
	{ font-size:80%; }

/* font styles */
.bold
	{ font-weight:bold; }
.italic
	{ font-style:italic; }
.underline
	{ text-decoration:underline; }

/* plain list items (no bullets or indent) */
.nobullets li { list-style-type: none; margin-left:-2em; }

/* multi-column tiddler content (not supported in Internet Explorer) */
.twocolumns { display:block;
	-moz-column-count:2; -moz-column-gap:1em; -moz-column-width:50%; /* FireFox */
	-webkit-column-count:2; -webkit-column-gap:1em; -webkit-column-width:50%; /* Safari */
	column-count:2; column-gap:1em; column-width:50%; /* Opera */
}
.threecolumns { display:block;
	-moz-column-count:3; -moz-column-gap:1em; -moz-column-width:33%; /* FireFox */
	-webkit-column-count:3; -webkit-column-gap:1em; -webkit-column-width:33%; /* Safari */
	column-count:3; column-gap:1em; column-width:33%; /* Opera */
}
.fourcolumns { display:block;
	-moz-column-count:4; -moz-column-gap:1em; -moz-column-width:25%; /* FireFox */
	-webkit-column-count:4; -webkit-column-gap:1em; -webkit-column-width:25%; /* Safari */
	column-count:4; column-gap:1em; column-width:25%; /* Opera */
}

/* show/hide browser-specific content for InternetExplorer vs. non-IE ("moz") browsers */
*[class="ieOnly"]
	{ display:none; } /* hide in moz (uses CSS selector) */
* html .mozOnly, *:first-child+html .mozOnly
	{ display: none; } /* hide in IE (uses IE6/IE7 CSS hacks) */

/* borderless tables */
.borderless, .borderless table, .borderless td, .borderless tr, .borderless th, .borderless tbody
	{ border:0 !important; margin:0 !important; padding:0 !important; }
.widetable, .widetable table
	{ width:100%; }

/* thumbnail images (fixed-sized scaled images) */
.thumbnail img { height:5em !important; }

/* stretchable images (auto-size to fit tiddler) */
.stretch img { width:95%; }

/* grouped content */
.outline
	{ display:block; padding:1em; -moz-border-radius:1em;-webkit-border-radius:1em; border:1px solid; }
.menubox
	{ display:block; padding:1em; -moz-border-radius:1em;-webkit-border-radius:1em; border:1px solid; background:#fff; color:#000; }
.menubox .button, .menubox .tiddlyLinkExisting, .menubox .tiddlyLinkNonExisting
	{ color:#009 !important; }
.groupbox
	{ display:block; padding:1em; -moz-border-radius:1em;-webkit-border-radius:1em; border:1px solid; background:#ffe; color:#000; }
.groupbox a, .groupbox .button, .groupbox .tiddlyLinkExisting, .groupbox .tiddlyLinkNonExisting
	{ color:#009 !important; }
.groupbox code
	{ color:#333 !important; }
.borderleft
	{ margin:0;padding:0;border:0;margin-left:1em; border-left:1px dotted; padding-left:.5em; }
.borderright
	{ margin:0;padding:0;border:0;margin-right:1em; border-right:1px dotted; padding-right:.5em; }
.borderbottom
	{ margin:0;padding:1px 0;border:0;border-bottom:1px dotted; margin-bottom:1px; padding-bottom:1px; }
.bordertop
	{ margin:0;padding:0;border:0;border-top:1px dotted; margin-top:1px; padding-top:1px; }

/* scrolled content */
.scrollbars { overflow:auto; }
.height10em { height:10em; }
.height15em { height:15em; }
.height20em { height:20em; }
.height25em { height:25em; }
.height30em { height:30em; }
.height35em { height:35em; }
.height40em { height:40em; }

/* compact form */
.smallform
	{ white-space:nowrap; }
.smallform input, .smallform textarea, .smallform button, .smallform checkbox, .smallform radio, .smallform select
	{ font-size:8pt; }

/* stretchable edit fields and textareas (auto-size to fit tiddler) */
.stretch input { width:99%; }
.stretch textarea { width:99%; }

/* compact input fields (limited to a few characters for entering percentages and other small values) */
.onechar input   { width:1em; }
.twochar input   { width:2em; }
.threechar input { width:3em; }
.fourchar input  { width:4em; }
.fivechar input  { width:5em; }

/* text colors */
.white { color:#fff !important }
.gray  { color:#999 !important }
.black { color:#000 !important }
.red   { color:#f66 !important }
.green { color:#0c0 !important }
.blue  { color:#99f !important }

/* rollover highlighting */
.mouseover 
	{color:[[ColorPalette::TertiaryLight]] !important;}
.mouseover a
	{color:[[ColorPalette::TertiaryLight]] !important;}
.selected .mouseover
	{color:[[ColorPalette::Foreground]] !important;}
.selected .mouseover .button, .selected .mouseover a
	{color:[[ColorPalette::PrimaryDark]] !important;}

/* rollover zoom text */
.zoomover
	{ font-size:80% !important; }
.selected .zoomover
	{ font-size:100% !important; }

/* [[ColorPalette]] text colors */
.Background	{ color:[[ColorPalette::Background]];	 }
.Foreground	{ color:[[ColorPalette::Foreground]];	 }
.PrimaryPale	{ color:[[ColorPalette::PrimaryPale]];	 }
.PrimaryLight	{ color:[[ColorPalette::PrimaryLight]];	 }
.PrimaryMid	{ color:[[ColorPalette::PrimaryMid]];	 }
.PrimaryDark	{ color:[[ColorPalette::PrimaryDark]];	 }
.SecondaryPale	{ color:[[ColorPalette::SecondaryPale]]; }
.SecondaryLight	{ color:[[ColorPalette::SecondaryLight]];}
.SecondaryMid	{ color:[[ColorPalette::SecondaryMid]];	 }
.SecondaryDark	{ color:[[ColorPalette::SecondaryDark]]; }
.TertiaryPale	{ color:[[ColorPalette::TertiaryPale]];	 }
.TertiaryLight	{ color:[[ColorPalette::TertiaryLight]]; }
.TertiaryMid	{ color:[[ColorPalette::TertiaryMid]];	 }
.TertiaryDark	{ color:[[ColorPalette::TertiaryDark]];	 }
.Error		{ color:[[ColorPalette::Error]];	 }

/* [[ColorPalette]] background colors */
.BGBackground	  { background-color:[[ColorPalette::Background]];	}
.BGForeground	  { background-color:[[ColorPalette::Foreground]];	}
.BGPrimaryPale	  { background-color:[[ColorPalette::PrimaryPale]];	}
.BGPrimaryLight	  { background-color:[[ColorPalette::PrimaryLight]];	}
.BGPrimaryMid	  { background-color:[[ColorPalette::PrimaryMid]];	}
.BGPrimaryDark	  { background-color:[[ColorPalette::PrimaryDark]];	}
.BGSecondaryPale  { background-color:[[ColorPalette::SecondaryPale]]; 	}
.BGSecondaryLight { background-color:[[ColorPalette::SecondaryLight]];	}
.BGSecondaryMid	  { background-color:[[ColorPalette::SecondaryMid]];	}
.BGSecondaryDark  { background-color:[[ColorPalette::SecondaryDark]]; 	}
.BGTertiaryPale	  { background-color:[[ColorPalette::TertiaryPale]];	}
.BGTertiaryLight  { background-color:[[ColorPalette::TertiaryLight]]; 	}
.BGTertiaryMid	  { background-color:[[ColorPalette::TertiaryMid]];	}
.BGTertiaryDark	  { background-color:[[ColorPalette::TertiaryDark]];	}
.BGError	  { background-color:[[ColorPalette::Error]];	 	}
/*}}}*/
/***
StyleSheet for ~SyntaxHighlighter
***/

/*{{{*/
.dp-highlighter
{
	font-family: "Consolas", "Courier New", Courier, mono, serif;
	font-size: 12px;
	background-color: #E7E5DC;
	width: 99%;
	overflow: auto;
	margin: 18px 0 18px 0 !important;
	padding-top: 1px; /* adds a little border on top when controls are hidden */
}

/* clear styles */
.dp-highlighter ol,
.dp-highlighter ol li,
.dp-highlighter ol li span 
{
	margin: 0;
	padding: 0;
	border: none;
}

.dp-highlighter a,
.dp-highlighter a:hover
{
	background: none;
	border: none;
	padding: 0;
	margin: 0;
}

.dp-highlighter .bar
{
	padding-left: 45px;
}

.dp-highlighter.collapsed .bar,
.dp-highlighter.nogutter .bar
{
	padding-left: 0px;
}

.dp-highlighter ol
{
	list-style: decimal; /* for ie */
	background-color: #fff;
	margin: 0px 0px 1px 45px !important; /* 1px bottom margin seems to fix occasional Firefox scrolling */
	padding: 0px;
	color: #5C5C5C;
}

.dp-highlighter.nogutter ol,
.dp-highlighter.nogutter ol li
{
	list-style: none !important;
	margin-left: 0px !important;
}

.dp-highlighter ol li,
.dp-highlighter .columns div
{
	list-style: decimal-leading-zero; /* better look for others, override cascade from OL */
	list-style-position: outside !important;
	border-left: 3px solid #6CE26C;
	background-color: #F8F8F8;
	color: #5C5C5C;
	padding: 0 3px 0 10px !important;
	margin: 0 !important;
	line-height: 14px;
}

.dp-highlighter.nogutter ol li,
.dp-highlighter.nogutter .columns div
{
	border: 0;
}

.dp-highlighter .columns
{
	background-color: #F8F8F8;
	color: gray;
	overflow: hidden;
	width: 100%;
}

.dp-highlighter .columns div
{
	padding-bottom: 5px;
}

.dp-highlighter ol li.alt
{
	background-color: #FFF;
	color: inherit;
}

.dp-highlighter ol li span
{
	color: black;
	background-color: inherit;
}

/* Adjust some properties when collapsed */

.dp-highlighter.collapsed ol
{
	margin: 0px;
}

.dp-highlighter.collapsed ol li
{
	display: none;
}

/* Additional modifications when in print-view */

.dp-highlighter.printing
{
	border: none;
}

.dp-highlighter.printing .tools
{
	display: none !important;
}

.dp-highlighter.printing li
{
	display: list-item !important;
}

/* Styles for the tools */

.dp-highlighter .tools
{
	padding: 3px 8px 3px 10px;
	font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif;
	color: silver;
	background-color: #f8f8f8;
	padding-bottom: 10px;
	border-left: 3px solid #6CE26C;
}

.dp-highlighter.nogutter .tools
{
	border-left: 0;
}

.dp-highlighter.collapsed .tools
{
	border-bottom: 0;
}

.dp-highlighter .tools a
{
	font-size: 9px;
	color: #a0a0a0;
	background-color: inherit;
	text-decoration: none;
	margin-right: 10px;
}

.dp-highlighter .tools a:hover
{
	color: red;
	background-color: inherit;
	text-decoration: underline;
}

/* About dialog styles */

.dp-about { background-color: #fff; color: #333; margin: 0px; padding: 0px; }
.dp-about table { width: 100%; height: 100%; font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; }
.dp-about td { padding: 10px; vertical-align: top; }
.dp-about .copy { border-bottom: 1px solid #ACA899; height: 95%; }
.dp-about .title { color: red; background-color: inherit; font-weight: bold; }
.dp-about .para { margin: 0 0 4px 0; }
.dp-about .footer { background-color: #ECEADB; color: #333; border-top: 1px solid #fff; text-align: right; }
.dp-about .close { font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; background-color: #ECEADB; color: #333; width: 60px; height: 22px; }

/* Language specific styles */

.dp-highlighter .comment, .dp-highlighter .comments { color: #008200; background-color: inherit; }
.dp-highlighter .string { color: blue; background-color: inherit; }
.dp-highlighter .keyword { color: #069; font-weight: bold; background-color: inherit; }
.dp-highlighter .preprocessor { color: gray; background-color: inherit; }

/*}}}*/
!Header 1
!!Header 2
!!!Header 3
!!!!Header 4
!!!!!Header 5
!!!!!!Header 6
{{{
!Header 1
!!Header 2
!!!Header 3
!!!!Header 4
!!!!!Header 5
}}}
A carriage return ends a paragraph, so a slightly larger (this should be made bigger) space appears between paragraphs.  But the beginning of a new paragraph is not indented, even if tabs or spaces are inserted.  So, for now, use extra carriage returns to separate paragraphs.

And maybe implement tab indentation in the future.
$$
\begin{eqnarray}
\lambda_{S} &=&  \left[ 
  \frac{\textstyle \lambda_{J}}{\textstyle 1+\sqrt{1-\lambda_{J}^{2}}}
  \right]^{2}
\end{eqnarray}
$$
!![[SurfaceArrayApp]]
><part description>Creates a surface plot from an array.</part>
>@@[[Launch SurfaceArrayApp|http://www.reyesaguayo.com/osp/jws/SurfaceArrayApp.jnlp]]@@
><<tiddler [[SurfaceArrayApp.jpg]]>>
!!! Features
* 3D view
* Can obtain diferent 3D views and rotate if you press and drag the mouse cursor
* Multidimensional arrays
!!! Java vs. Jython Learnings
!!!! Use of arraydata to create a multidimensional array.
<<<
In Java:
<code java>
ArrayData arraydata = new ArrayData(32, 32, 1);
</code>
In Jython:
<code py>
arraydata = ArrayData(32, 32, 1)
</code>
<<<
!!!! Explicit declaration in Jython of JFrame while in Java is not necessary
<<<
<code py>
import javax.swing.JFrame; 
</code>

!Code
* [[SurfaceArrayApp.java]]
* [[SurfaceArrayApp.jnlp]]
* [[SurfaceArrayApp.local.jnlp]]
* [[SurfaceArrayApp.py]]
![[SurfaceArrayApp]]
{{borderlessL{
|[img(55%,auto)[SurfaceArrayApp|http://reyesaguayo.com/osp/images/SurfaceArrayApp.jpg][http://reyesaguayo.com/osp/images/SurfaceArrayApp.jpg]]<br>&nbsp;&nbsp;@@color:#c06;<<tiddler ./execute>>@@|vertical-align:top;width:30em;<<tiddler ./description>> <<tiddler ./javacode>> <<tiddler ./jythoncode>>|
}}}
<part description hidden>
!!!!Description
<<tiddler [[SurfaceArrayApp/description]]>>
</part>
<part execute hidden>
@@[[Launch SurfaceArrayApp JWS application|http://www.reyesaguayo.com/osp/jws/SurfaceArrayApp.jnlp]]@@ 
</part>
<part javacode hidden>
!!!!Java Code
[[SurfaceArrayApp.java]]
</part>
<part jythoncode hidden>
!!!!Jython Code
[[SurfaceArrayApp.py]]
</part>
<code java>
/*
 * Open Source Physics software is free software as described near the bottom of this code file.
 *
 * For additional information and documentation on Open Source Physics please see: 
 * <http://www.opensourcephysics.org/>
 */

package org.opensourcephysics.manual.ch08;
import org.opensourcephysics.display.DrawingFrame;
import org.opensourcephysics.display.DrawingPanel;
import org.opensourcephysics.display2d.ArrayData;
import org.opensourcephysics.display2d.SurfacePlot;
import org.opensourcephysics.display2d.SurfacePlotMouseController;
import javax.swing.JFrame;

/**
 * SurfacePlotApp creates a surface plot.
 *
 * @author       Wolfgang Christian
 * @version 1.0
 */
public class SurfaceArrayApp {

  /**
   * Starts the Java application.
   * @param args[]  the input parameters
   */
  public static void main(String[] args) {
    DrawingPanel drawingPanel = new DrawingPanel();
    drawingPanel.setShowCoordinates(false);
    DrawingFrame frame = new DrawingFrame(drawingPanel);
    ArrayData arraydata = new ArrayData(32, 32, 1);
    arraydata.setScale(-1, 1, -1, 1);
    double[][] data = arraydata.getData()[0];
    double x = arraydata.getLeft(), dx = arraydata.getDx();
    for(int i = 0, nx = data.length;i<nx;i++) {
      double y = arraydata.getTop(), dy = arraydata.getDy();
      for(int j = 0, ny = data[0].length;j<ny;j++) {
        data[i][j] = y*x; // magnitude
        y += dy;
      }
      x += dx;
    }
    SurfacePlot plot = new SurfacePlot(arraydata);
    drawingPanel.addDrawable(plot);
    SurfacePlotMouseController mouseController = new SurfacePlotMouseController(drawingPanel, plot);
    drawingPanel.addMouseListener(mouseController);
    drawingPanel.addMouseMotionListener(mouseController);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
    // GUIUtils.timingTest(plot);
  }
}

/*
 * Open Source Physics software is free software; you can redistribute
 * it and/or modify it under the terms of the GNU General Public License (GPL) as
 * published by the Free Software Foundation; either version 2 of the License,
 * or(at your option) any later version.

 * Code that uses any portion of the code in the org.opensourcephysics package
 * or any subpackage (subdirectory) of this package must must also be be released
 * under the GNU GPL license.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston MA 02111-1307 USA
 * or view the license online at http://www.gnu.org/copyleft/gpl.html
 *
 * For additional information and documentation on Open Source Physics,
 * please see <http://www.opensourcephysics.org/>.
 *
 * Copyright (c) 2007  The Open Source Physics project
 *                     http://www.opensourcephysics.org
 */
</code>
<code xml>
  <?xml version="1.0" encoding="utf-8"?> 
    <jnlp spec="1.0+" codebase="http://www.reyesaguayo.com/osp/jws/" 
           href="SurfaceArrayApp.jnlp"> 
    <information> 
     <title>SurfaceArrayApp</title> 
     <vendor>OpenSourcePhysics.org</vendor> 
     <description>JNLP-Demo Application SurfaceArrayApp</description>
     <icon href="SurfaceArrayApp.gif"/> 
     <offline-allowed/> 
   </information> 
   <resources> 
     <j2se version="1.4+"/> 
     <jar href="jython_osp.jar"/> 
   </resources> 
   <application-desc main-class="SurfaceArrayApp"/> 
  </jnlp>
</code>
[img(20%,auto)[SurfaceArrayApp|http://reyesaguayo.com/osp/images/SurfaceArrayApp.jpg][http://reyesaguayo.com/osp/images/SurfaceArrayApp.jpg]]
<code xml>
  <?xml version="1.0" encoding="utf-8"?> 
    <jnlp spec="1.0+" codebase="file:///home/user/Programming/jython_osp" 
           href="SurfaceArrayApp.local.jnlp"> 
    <information> 
     <title>SurfaceArrayApp</title> 
     <vendor>OpenSourcePhysics.org</vendor> 
     <description>JNLP-Demo Application SurfaceArrayApp</description>
     <icon href="SurfaceArrayApp.gif"/> 
     <offline-allowed/> 
   </information> 
   <resources> 
     <j2se version="1.4+"/> 
     <jar href="jython_osp.jar"/> 
   </resources> 
   <application-desc main-class="SurfaceArrayApp"/> 
  </jnlp>
</code>
<code python>
# Created by OpenSourcePhysics.org
# Translated to Jython by Alfonso R. Reyes
# Use of 3D arrays
from org.opensourcephysics.display import DrawingFrame;
from org.opensourcephysics.display import DrawingPanel;
from org.opensourcephysics.display2d import ArrayData;
from org.opensourcephysics.display2d import SurfacePlot;
from org.opensourcephysics.display2d import SurfacePlotMouseController;
from javax.swing import JFrame;

drawingPanel = DrawingPanel();
drawingPanel.setShowCoordinates(False);
frame = DrawingFrame(drawingPanel);
#public ArrayData(int ix, int iy, int nsamples
arraydata = ArrayData(32, 32, 1);
arraydata.setScale(-1, 1, -1, 1);
print arraydata
"""    public double[][][] getData()
    {
        return data;
    } """
data = arraydata.getData()[0];
print "data= ", data
x = arraydata.getLeft()
dx = arraydata.getDx();
nx = len(data)
print "nx=", nx
for i in range(0, nx, 1):
    y = arraydata.getTop()
    dy = arraydata.getDy();
    ny = len(data[0])
    # for(int i = 0, nx = data.length;i<nx;i++) {
    for j in range(0, ny, 1):
        data[i][j] = y * x;  # magnitude
        print "[" , i , "]" , "[" , j , "]= " , data[i][j];
        y += dy;
    x += dx;
print data
plot = SurfacePlot(arraydata);
drawingPanel.addDrawable(plot);
mouseController = SurfacePlotMouseController(drawingPanel, plot);
drawingPanel.addMouseListener(mouseController);
drawingPanel.addMouseMotionListener(mouseController);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(True);

</code>
|!Symbol|![[LaTeX]]|!Use|
| $\mathbb{R} \;\; n \;\; \ud{a}$ | {{{\mathbb{R} n \ud{a} }}} |[[real numbers|http://en.wikipedia.org/wiki/Real_numbers]], [[manifold]] dimension or [[Clifford algebra]] dimension, [[Grassmann number]] |
| $M \; \; T_p M \; \; T_p^* M$ | {{{M T_p M T_p^* M }}} |[[manifold]], [[tangent space to M at point p|coordinate basis vectors]], [[cotangent space to M at point p|coordinate basis 1-forms]] |
| $x^i \; \; \ve{\pa_i} \; \; \ve{v} \; \; \vv{l}$ | {{{x^i \ve{\pa_i} \ve{v} \vv{l} }}} |[[coordinates|manifold]] and [[coordinate basis vectors]] with coordinate [[indices]], [[tangent vector]], [[loop|vector-form algebra]] |
| $t \; \; \ta$ | {{{ t \ta }}} |parameter time, [[proper time]] |
| $\f{dx^i} \; \; \f{f} \; \; \ff{a} \; \; \ub{b}$ | {{{\f{dx^i} \f{f} \ff{a} \ub{b} }}} |[[coordinate basis 1-forms]], [[1-form]], [[2-form|differential form]], [[differential form]] of high or unspecified form grade |
| $\pa_i \;\; \f{\pa} \;\; \f{d}$ | {{{\pa_i \f{\pa} \f{d} }}} |[[partial derivative]], partial derivative, [[exterior derivative]] |
| $\ph \; \; \ph^* \; \; \ph_*$ | {{{\ph \ph^* \ph_* }}} |[[diffeomorphism]], [[pullback]], pushforward |
| ${\cal L}_{\ve{v}} \;\; \lb\ve{v},\ve{u}\rb_L \;\; \ve{\De}$ | {{{{\cal L}_{\ve{v}} \lb\ve{v},\ve{u}\rb_L \ve{\De} }}} |[[Lie derivative]], [[Lie bracket|Lie derivative]] of two [[vector fields|tangent bundle]], [[distribution]] |
| $\ub{\ve{A}} \;\; {\cal L}_{\ub{\ve{K}}} \;\; \lb\ub{\ve{K}},\ub{\ve{L}}\rb_L \;\; \f{\ve{P}}$ | {{{ \f{\ve{A}} {\cal L}_{ \ub{\ve{K}} } \lb\ub{\ve{K}},\ub{\ve{L}}\rb_L \f{\ve{P}} }}} |[[vector valued form]], [[FuN derivative]], FuN bracket, [[vector projection]] |
| $\f{\ve{\cal A}} \;\; \ff{\ve{\cal F}} \;\; \f{\cal D}$ | {{{ \f{\ve{\cal A}} \ff{\ve{\cal F}} \f{\cal D} }}} |[[Ehresmann connection]], [[FuN curvature]], [[Ehresmann covariant derivative]] |
| $\de_i^j \;\; \et_{\al \be} \; \; \ep_{\al \dots \be} \; \; \otimes$ | {{{ \de_i^j \et_{\al \be} \ep_{\al \dots \be} \otimes }}} |[[Kronecker delta|http://en.wikipedia.org/wiki/Kronecker_delta]], [[Minkowski metric]], [[permutation symbol]], [[Kronecker product]] |
| $G \;\; g^- \;\; T_A \;\; \lb{T_A,T_B}\rb$ | {{{G g^- T_A \lb{T_A,T_B}\rb }}} |[[Lie group]], [[inverse]] of a group element, [[Lie algebra]] generators, [[commutator]] bracket |
| $\f{\na} \;\; \f{A} \;\; \ff{F}$ | {{{\f{\na} \f{A} \ff{F} }}} |[[covariant derivative]], [[connection]], [[curvature]] |
| $\f{\cal I} \;\; \f{\ve{\cal I}} \;\; \ve{\xi^L_A} \;\; \ve{\xi^R_A}$ | {{{\f{\cal I} \f{\ve{\cal I}} \ve{\xi^L_A} \ve{\xi^R_A} }}} |[[Maurer-Cartan form]], Ehresmann-Maurer-Cartan form, [[left and right action vector fields|Lie group geometry]] |
| $Cl \; \; Cl^*$ | {{{Cl Cl^* }}} |[[Clifford algebra]], [[Clifford group]] |
| $\ga_\al \; \; \ga_{\al \dots \be} \; \; \ga$ | {{{\ga_\al \ga_{\al \dots \be} \ga }}} |[[Clifford basis vectors]], [[Clifford basis elements]], Clifford [[pseudoscalar]] |
| $\hat{A} \; \; \tilde{A} \; \; \bar{A} \; \; A^\dagger \; \; \overline{A}$ | {{{\hat{ \tilde{ \bar{ \overline{A}^\dagger } } } }}} |[[Clifford involution, reverse, conjugate, Hermitian conjugate, Dirac conjugate|Clifford conjugate]]  |
| $\cdot \; \; \times$ | {{{\cdot \times }}} |symmetric and antisymmetric [[Clifford algebra]] product  |
| $\lb{A,\dots,B}\rb_A \;\; a_{\lb{\al\dots\be}\rb}$ | {{{ \lb{A,\dots,B}\rb_A a_{\lb{\al\dots\be}\rb} }}} |[[antisymmetric bracket]], [[index bracket]] |
| $\li{A}\ri_q \; \; \li{A}\ri$ | {{{ \li{A}\ri_q \li{A}\ri }}} |[[Clifford grade]] $q$ part, [[scalar part|Clifford grade]] |
| $\f{A} \; \; \ff{b} \; \; \ve{e}$ | {{{ \f{A} \ff{b} \ve{e} }}} |[[Lieform]]s or [[Clifform]]s |
| $\lp{e_i}\rp^\al \;\; \lp{e_\al}\rp^i \;\; g_{ij} \;\; \lp\ve{u},\ve{v}\rp$ | {{{ \lp{e_i}\rp^\al \lp{e_\al}\rp^i g_{ij} \lp\ve{u},\ve{v}\rp }}} |co[[frame]] matrix, frame matrix, [[metric]], scalar product |
| $\f{e^\al} \;\; \ve{e_\al}$ | {{{ \f{e^\al} \ve{e_\al} }}} |co[[frame]] 1-forms, orthonormal basis vectors |
| $\f{e} \;\; \ve{e}$ | {{{ \f{e} \lp{e_i}\rp^\al \ve{e} \lp{e_\al}\rp^i g_{ij} }}} |co[[frame]], frame |
| $\ub{e} \;\; \ll{e}\rl$ | {{{ \ub{e} \ll{e}\rl }}} |[[volume form]], frame [[determinant]] |
| $\f{e^s} \;\; \lp{e^s_i}\rp^\al \;\; s$ | {{{ \f{e^s} \;\; \lp{e^s_i}\rp^\al \;\; s }}} |[[special frame]], special coframe matrix, conformal scalar |
| $TM \;\; T^*M$ | {{{ TM T^*M }}} |[[tangent bundle]], [[cotangent bundle]] |
| $\Ga^k{}_{ij} \;\; \f{\Ga}^k{}_j \;\; \ff{F}^k{}_j$ | {{{ \Ga^k{}_{ij} \f{\Ga}^k{}_j \ff{F}^k{}_j }}} |[[Christoffel symbols]], [[tangent bundle connection]], [[tangent bundle curvature]] |
| $L^\be{}_\al \;\; \f{w}^\be{}_\al \;\; \ff{F}^\be{}_\al$ | {{{ L^\be{}_\al \f{w}^\be{}_\al \ff{F}^\be{}_\al }}} |[[Lorentz rotation]], [[tangent bundle spin connection|tangent bundle connection]], [[tangent bundle curvature]] |
| $ClM \;\; Cl^1M$ | {{{ ClM Cl^1M }}} |[[Clifford bundle]], [[Clifford vector bundle]] |
| $\f{A} \;\; \f{\om} \;\; \ff{F}$ | {{{ \f{A} \f{\om} \ff{F} }}} |[[Clifford connection]], [[spin connection]], [[curvature]] |
| $\ff{T} \;\; \f{\ka}$ | {{{ \ff{T} \f{\ka} }}} |[[torsion]], contorsion |
/***
!Metadata:
|''Name:''|SyntaxHighlighterPlugin|
|''Description:''|Code Syntax Highlighter Plugin for TiddlyWiki.|
|''Version:''|1.1.3|
|''Date:''|Oct 24, 2008|
|''Source:''|http://www.coolcode.cn/show-310-1.html|
|''Author:''|Ma Bingyao (andot (at) ujn (dot) edu (dot) cn)|
|''License:''|[[GNU Lesser General Public License|http://www.gnu.org/licenses/lgpl.txt]]|
|''~CoreVersion:''|2.4.1|
|''Browser:''|Firefox 1.5+; InternetExplorer 6.0; Safari; Opera; Chrome; etc.|

!Syntax:
{{{
<code options>
codes
</code>
}}}

!Examples:
{{{
<code java>
public class HelloWorld {
    public static void main(String args[]) {
        System.out.println("HelloWorld!");
    }
}
</code>
}}}

!Revision History:
|''Version''|''Date''|''Note''|
|1.1.2|Oct 15, 2008|Optimize Highlight|
|1.0.0|Oct 13, 2008|Initial release|

!Code section:
***/
//{{{
var dp={sh:{Toolbar:{},Utils:{},RegexLib:{},Brushes:{},Strings:{AboutDialog:"<html><head><title>About...</title></head><body class=\"dp-about\"><table cellspacing=\"0\"><tr><td class=\"copy\"><p class=\"title\">dp.SyntaxHighlighter</div><div class=\"para\">Version: {V}</p><p><a href=\"http://www.dreamprojections.com/syntaxhighlighter/?ref=about\" target=\"_blank\">http://www.dreamprojections.com/syntaxhighlighter</a></p>&copy;2004-2007 Alex Gorbatchev.</td></tr><tr><td class=\"footer\"><input type=\"button\" class=\"close\" value=\"OK\" onClick=\"window.close()\"/></td></tr></table></body></html>"},ClipboardSwf:null,Version:"1.5.1"}};dp.SyntaxHighlighter=dp.sh;dp.sh.Toolbar.Commands={ExpandSource:{label:"+ expand source",check:function($){return $.collapse},func:function($,_){$.parentNode.removeChild($);_.div.className=_.div.className.replace("collapsed","")}},ViewSource:{label:"view plain",func:function($,_){var A=dp.sh.Utils.FixForBlogger(_.originalCode).replace(/</g,"&lt;"),B=window.open("","_blank","width=750, height=400, location=0, resizable=1, menubar=0, scrollbars=0");B.document.write("<textarea style=\"width:99%;height:99%\">"+A+"</textarea>");B.document.close()}},CopyToClipboard:{label:"copy to clipboard",check:function(){return window.clipboardData!=null||dp.sh.ClipboardSwf!=null},func:function($,A){var B=dp.sh.Utils.FixForBlogger(A.originalCode).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&");if(window.clipboardData)window.clipboardData.setData("text",B);else if(dp.sh.ClipboardSwf!=null){var _=A.flashCopier;if(_==null){_=document.createElement("div");A.flashCopier=_;A.div.appendChild(_)}_.innerHTML="<embed src=\""+dp.sh.ClipboardSwf+"\" FlashVars=\"clipboard="+encodeURIComponent(B)+"\" width=\"0\" height=\"0\" type=\"application/x-shockwave-flash\"></embed>"}alert("The code is in your clipboard now")}},PrintSource:{label:"print",func:function($,B){var _=document.createElement("IFRAME"),A=null;_.style.cssText="position:absolute;width:0px;height:0px;left:-500px;top:-500px;";document.body.appendChild(_);A=_.contentWindow.document;dp.sh.Utils.CopyStyles(A,window.document);A.write("<div class=\""+B.div.className.replace("collapsed","")+" printing\">"+B.div.innerHTML+"</div>");A.close();_.contentWindow.focus();_.contentWindow.print();alert("Printing...");document.body.removeChild(_)}},About:{label:"?",func:function(_){var A=window.open("","_blank","dialog,width=300,height=150,scrollbars=0"),$=A.document;dp.sh.Utils.CopyStyles($,window.document);$.write(dp.sh.Strings.AboutDialog.replace("{V}",dp.sh.Version));$.close();A.focus()}}};dp.sh.Toolbar.Create=function(B){var A=document.createElement("DIV");A.className="tools";for(var _ in dp.sh.Toolbar.Commands){var $=dp.sh.Toolbar.Commands[_];if($.check!=null&&!$.check(B))continue;A.innerHTML+="<a href=\"#\" onclick=\"dp.sh.Toolbar.Command('"+_+"',this);return false;\">"+$.label+"</a>"}return A};dp.sh.Toolbar.Command=function(_,$){var A=$;while(A!=null&&A.className.indexOf("dp-highlighter")==-1)A=A.parentNode;if(A!=null)dp.sh.Toolbar.Commands[_].func($,A.highlighter)};dp.sh.Utils.CopyStyles=function(A,_){var $=_.getElementsByTagName("link");for(var B=0;B<$.length;B++)if($[B].rel.toLowerCase()=="stylesheet")A.write("<link type=\"text/css\" rel=\"stylesheet\" href=\""+$[B].href+"\"></link>")};dp.sh.Utils.FixForBlogger=function($){return(dp.sh.isBloggerMode==true)?$.replace(/<br\s*\/?>|&lt;br\s*\/?&gt;/gi,"\n"):$};dp.sh.RegexLib={MultiLineCComments:new RegExp("/\\*[\\s\\S]*?\\*/","gm"),SingleLineCComments:new RegExp("//.*$","gm"),SingleLinePerlComments:new RegExp("#.*$","gm"),DoubleQuotedString:new RegExp("\"(?:\\.|(\\\\\\\")|[^\\\"\"\\n])*\"","g"),SingleQuotedString:new RegExp("'(?:\\.|(\\\\\\')|[^\\''\\n])*'","g")};dp.sh.Match=function(_,$,A){this.value=_;this.index=$;this.length=_.length;this.css=A};dp.sh.Highlighter=function(){this.noGutter=false;this.addControls=true;this.collapse=false;this.tabsToSpaces=true;this.wrapColumn=80;this.showColumns=true};dp.sh.Highlighter.SortCallback=function($,_){if($.index<_.index)return-1;else if($.index>_.index)return 1;else if($.length<_.length)return-1;else if($.length>_.length)return 1;return 0};dp.sh.Highlighter.prototype.CreateElement=function(_){var $=document.createElement(_);$.highlighter=this;return $};dp.sh.Highlighter.prototype.GetMatches=function(_,B){var $=0,A=null;while((A=_.exec(this.code))!=null)this.matches[this.matches.length]=new dp.sh.Match(A[0],A.index,B)};dp.sh.Highlighter.prototype.AddBit=function($,A){if($==null||$.length==0)return;var C=this.CreateElement("SPAN");$=$.replace(/ /g,"&nbsp;");$=$.replace(/</g,"&lt;");$=$.replace(/\n/gm,"&nbsp;<br>");if(A!=null){if((/br/gi).test($)){var _=$.split("&nbsp;<br>");for(var B=0;B<_.length;B++){C=this.CreateElement("SPAN");C.className=A;C.innerHTML=_[B];this.div.appendChild(C);if(B+1<_.length)this.div.appendChild(this.CreateElement("BR"))}}else{C.className=A;C.innerHTML=$;this.div.appendChild(C)}}else{C.innerHTML=$;this.div.appendChild(C)}};dp.sh.Highlighter.prototype.IsInside=function(_){if(_==null||_.length==0)return false;for(var A=0;A<this.matches.length;A++){var $=this.matches[A];if($==null)continue;if((_.index>$.index)&&(_.index<$.index+$.length))return true}return false};dp.sh.Highlighter.prototype.ProcessRegexList=function(){for(var $=0;$<this.regexList.length;$++)this.GetMatches(this.regexList[$].regex,this.regexList[$].css)};dp.sh.Highlighter.prototype.ProcessSmartTabs=function(E){var B=E.split("\n"),$="",D=4,A="\t";function _(A,E,_){var B=A.substr(0,E),C=A.substr(E+1,A.length),$="";for(var D=0;D<_;D++)$+=" ";return B+$+C}function C(B,C){if(B.indexOf(A)==-1)return B;var D=0;while((D=B.indexOf(A))!=-1){var $=C-D%C;B=_(B,D,$)}return B}for(var F=0;F<B.length;F++)$+=C(B[F],D)+"\n";return $};dp.sh.Highlighter.prototype.SwitchToList=function(){var C=this.div.innerHTML.replace(/<(br)\/?>/gi,"\n"),B=C.split("\n");if(this.addControls==true)this.bar.appendChild(dp.sh.Toolbar.Create(this));if(this.showColumns){var A=this.CreateElement("div"),_=this.CreateElement("div"),E=10,G=1;while(G<=150)if(G%E==0){A.innerHTML+=G;G+=(G+"").length}else{A.innerHTML+="&middot;";G++}_.className="columns";_.appendChild(A);this.bar.appendChild(_)}for(var G=0,D=this.firstLine;G<B.length-1;G++,D++){var $=this.CreateElement("LI"),F=this.CreateElement("SPAN");$.className=(G%2==0)?"alt":"";F.innerHTML=B[G]+"&nbsp;";$.appendChild(F);this.ol.appendChild($)}this.div.innerHTML=""};dp.sh.Highlighter.prototype.Highlight=function(C){function A($){return $.replace(/^\s*(.*?)[\s\n]*$/g,"$1")}function $($){return $.replace(/\n*$/,"").replace(/^\n*/,"")}function _(B){var E=dp.sh.Utils.FixForBlogger(B).split("\n"),C=new Array(),D=new RegExp("^\\s*","g"),$=1000;for(var F=0;F<E.length&&$>0;F++){if(A(E[F]).length==0)continue;var _=D.exec(E[F]);if(_!=null&&_.length>0)$=Math.min(_[0].length,$)}if($>0)for(F=0;F<E.length;F++)E[F]=E[F].substr($);return E.join("\n")}function D(A,$,_){return A.substr($,_-$)}var F=0;if(C==null)C="";this.originalCode=C;this.code=$(_(C));this.div=this.CreateElement("DIV");this.bar=this.CreateElement("DIV");this.ol=this.CreateElement("OL");this.matches=new Array();this.div.className="dp-highlighter";this.div.highlighter=this;this.bar.className="bar";this.ol.start=this.firstLine;if(this.CssClass!=null)this.ol.className=this.CssClass;if(this.collapse)this.div.className+=" collapsed";if(this.noGutter)this.div.className+=" nogutter";if(this.tabsToSpaces==true)this.code=this.ProcessSmartTabs(this.code);this.ProcessRegexList();if(this.matches.length==0){this.AddBit(this.code,null);this.SwitchToList();this.div.appendChild(this.bar);this.div.appendChild(this.ol);return}this.matches=this.matches.sort(dp.sh.Highlighter.SortCallback);for(var E=0;E<this.matches.length;E++)if(this.IsInside(this.matches[E]))this.matches[E]=null;for(E=0;E<this.matches.length;E++){var B=this.matches[E];if(B==null||B.length==0)continue;this.AddBit(D(this.code,F,B.index),null);this.AddBit(B.value,B.css);F=B.index+B.length}this.AddBit(this.code.substr(F),null);this.SwitchToList();this.div.appendChild(this.bar);this.div.appendChild(this.ol)};dp.sh.Highlighter.prototype.GetKeywords=function($){return"\\b"+$.replace(/ /g,"\\b|\\b")+"\\b"};dp.sh.BloggerMode=function(){dp.sh.isBloggerMode=true};dp.sh.HighlightAll=function(N,B,K,I,O,E){function A(){var $=arguments;for(var _=0;_<$.length;_++){if($[_]==null)continue;if(typeof($[_])=="string"&&$[_]!="")return $[_]+"";if(typeof($[_])=="object"&&$[_].value!="")return $[_].value+""}return null}function J($,_){for(var A=0;A<_.length;A++)if(_[A]==$)return true;return false}function L(A,B,C){var _=new RegExp("^"+A+"\\[(\\w+)\\]$","gi"),$=null;for(var D=0;D<B.length;D++)if(($=_.exec(B[D]))!=null)return $[1];return C}function C(B,A,_){var $=document.getElementsByTagName(_);for(var C=0;C<$.length;C++)if($[C].getAttribute("name")==A)B.push($[C])}var T=[],P=null,M={},$="innerHTML";C(T,N,"pre");C(T,N,"textarea");if(T.length==0)return;for(var R in dp.sh.Brushes){var F=dp.sh.Brushes[R].Aliases;if(F==null)continue;for(var G=0;G<F.length;G++)M[F[G]]=R}for(G=0;G<T.length;G++){var _=T[G],U=A(_.attributes["class"],_.className,_.attributes["language"],_.language),Q="";if(U==null)continue;U=U.split(":");Q=U[0].toLowerCase();if(M[Q]==null)continue;P=new dp.sh.Brushes[M[Q]]();_.style.display="none";P.noGutter=(B==null)?J("nogutter",U):!B;P.addControls=(K==null)?!J("nocontrols",U):K;P.collapse=(I==null)?J("collapse",U):I;P.showColumns=(E==null)?J("showcolumns",U):E;var D=document.getElementsByTagName("head")[0];if(P.Style&&D){var S=document.createElement("style");S.setAttribute("type","text/css");if(S.styleSheet)S.styleSheet.cssText=P.Style;else{var H=document.createTextNode(P.Style);S.appendChild(H)}D.appendChild(S)}P.firstLine=(O==null)?parseInt(L("firstline",U,1)):O;P.Highlight(_[$]);P.source=_;_.parentNode.insertBefore(P.div,_)}};version.extensions.SyntaxHighLighterPlugin={major:1,minor:1,revision:3,date:new Date(2008,10,24)};dp.sh.ClipboardSwf="clipboard.swf";dp.sh.Highlight=function(_,Q,B,J,H,M,D){function A(){var $=arguments;for(var _=0;_<$.length;_++){if($[_]==null)continue;if(typeof($[_])=="string"&&$[_]!="")return $[_]+"";if(typeof($[_])=="object"&&$[_].value!="")return $[_].value+""}return null}function I($,_){for(var A=0;A<_.length;A++)if(_[A]==$)return true;return false}function K(A,B,C){var _=new RegExp("^"+A+"\\[(\\w+)\\]$","gi"),$=null;for(var D=0;D<B.length;D++)if(($=_.exec(B[D]))!=null)return $[1];return C}var N=null,$="innerHTML";if(this.registered==undefined){var L={};for(var O in dp.sh.Brushes){var E=dp.sh.Brushes[O].Aliases;if(E==null)continue;for(var F=0;F<E.length;F++)L[E[F]]=O}this.registered=L}Q=Q.split(":");language=Q[0].toLowerCase();if(this.registered[language]==null)return;N=new dp.sh.Brushes[this.registered[language]]();_.style.display="none";N.noGutter=(B==null)?I("nogutter",Q):!B;N.addControls=(J==null)?!I("nocontrols",Q):J;N.collapse=(H==null)?I("collapse",Q):H;N.showColumns=(D==null)?I("showcolumns",Q):D;var C=document.getElementsByTagName("head")[0],P=document.getElementById(N.CssClass);if(N.Style&&C&&!P){P=document.createElement("style");P.setAttribute("id",N.CssClass);P.setAttribute("type","text/css");if(P.styleSheet)P.styleSheet.cssText=N.Style;else{var G=document.createTextNode(N.Style);P.appendChild(G)}C.appendChild(P)}N.firstLine=(M==null)?parseInt(K("firstline",Q,1)):M;N.Highlight(_[$]);N.source=_;_.parentNode.insertBefore(N.div,_)};config.formatters.push({name:"SyntaxHighlighter",match:"^<code[\\s]+[^>]+>\\n",element:"pre",handler:function(_){this.lookaheadRegExp=/<code[\s]+([^>]+)>\n((?:^[^\n]*\n)+?)(^<\/code>$\n?)/mg;this.lookaheadRegExp.lastIndex=_.matchStart;var $=this.lookaheadRegExp.exec(_.source);if($&&$.index==_.matchStart){var C=$[1],B=$[2];if(config.browser.isIE)B=B.replace(/\n/g,"\r");var A=createTiddlyElement(_.output,this.element,null,null,B);dp.sh.Highlight(A,C);_.nextMatch=$.index+$[0].length}}});config.formatterHelpers.enclosedTextHelper=function(_){this.lookaheadRegExp.lastIndex=_.matchStart;var $=this.lookaheadRegExp.exec(_.source);if($&&$.index==_.matchStart){var B=$[1];if(config.browser.isIE)B=B.replace(/\n/g,"\r");var A=createTiddlyElement(_.output,this.element,null,null,B);switch(_.matchText){case"/*{{{*/\n":dp.sh.Highlight(A,"css");break;case"//{{{\n":dp.sh.Highlight(A,"js");break;case"<!--{{{-->\n":dp.sh.Highlight(A,"xml");break}_.nextMatch=$.index+$[0].length}};dp.sh.Brushes.AS3=function(){var _="class interface package",$="Array Boolean Date decodeURI decodeURIComponent encodeURI encodeURIComponent escape "+"int isFinite isNaN isXMLName Number Object parseFloat parseInt "+"String trace uint unescape XML XMLList "+"Infinity -Infinity NaN undefined "+"as delete instanceof is new typeof "+"break case catch continue default do each else finally for if in "+"label return super switch throw try while with "+"dynamic final internal native override private protected public static "+"...rest const extends function get implements namespace set "+"import include use "+"AS3 flash_proxy object_proxy "+"false null this true "+"void Null";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"blockcomment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"definition"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp("var","gm"),css:"variable"}];this.CssClass="dp-as";this.Style=".dp-as .comment { color: #009900; font-style: italic; }"+".dp-as .blockcomment { color: #3f5fbf; }"+".dp-as .string { color: #990000; }"+".dp-as .preprocessor { color: #0033ff; }"+".dp-as .definition { color: #9900cc; font-weight: bold; }"+".dp-as .keyword { color: #0033ff; }"+".dp-as .variable { color: #6699cc; font-weight: bold; }"};dp.sh.Brushes.AS3.prototype=new dp.sh.Highlighter();dp.sh.Brushes.AS3.Aliases=["as","actionscript","ActionScript","as3","AS3"];dp.sh.Brushes.Bash=function(){var _="alias bg bind break builtin cd command compgen complete continue "+"declare dirs disown echo enable eval exec exit export fc fg "+"getopts hash help history jobs kill let local logout popd printf "+"pushd pwd read readonly return set shift shopt source "+"suspend test times trap type typeset ulimit umask unalias unset wait",$="case do done elif else esac fi for function if in select then "+"time until while";this.regexList=[{regex:dp.sh.RegexLib.SingleLinePerlComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("[()[\\]{}]","g"),css:"delim"},{regex:new RegExp("\\$\\w+","g"),css:"vars"},{regex:new RegExp("\\w+=","g"),css:"vars"},{regex:new RegExp("\\s-\\w+","g"),css:"flag"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"builtin"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-bash";this.Style=".dp-bash .builtin {color: maroon; font-weight: bold;}"+".dp-bash .comment {color: gray;}"+".dp-bash .delim {font-weight: bold;}"+".dp-bash .flag {color: green;}"+".dp-bash .string {color: red;}"+".dp-bash .vars {color: blue;}"};dp.sh.Brushes.Bash.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Bash.Aliases=["bash","sh"];dp.sh.Brushes.Batch=function(){var _="APPEND ATTRIB CD CHDIR CHKDSK CHOICE CLS COPY DEL ERASE DELTREE "+"DIR EXIT FC COMP FDISK FIND FORMAT FSUTIL HELP JOIN "+"LABEL LOADFIX MK MKDIR MEM MEMMAKER MORE MOVE MSD PCPARK "+"PRINT RD RMDIR REN SCANDISK SHARE SORT SUBST SYS "+"TIME DATE TREE TRUENAME TYPE UNDELETE VER XCOPY",$="DO ELSE FOR IN CALL CHOICE GOTO SHIFT PAUSE ERRORLEVEL "+"IF NOT EXIST LFNFOR START SETLOCAL ENDLOCAL ECHO SET";this.regexList=[{regex:new RegExp("REM.*$","gm"),css:"comment"},{regex:new RegExp("::.*$","gm"),css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("[()[\\]{}]","g"),css:"delim"},{regex:new RegExp("%\\w+%","g"),css:"vars"},{regex:new RegExp("%%\\w+","g"),css:"vars"},{regex:new RegExp("\\w+=","g"),css:"vars"},{regex:new RegExp("@\\w+","g"),css:"keyword"},{regex:new RegExp(":\\w+","g"),css:"keyword"},{regex:new RegExp("\\s/\\w+","g"),css:"flag"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"builtin"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-batch";this.Style=".dp-batch .builtin {color: maroon; font-weight: bold;}"+".dp-batch .comment {color: gray;}"+".dp-batch .delim {font-weight: bold;}"+".dp-batch .flag {color: green;}"+".dp-batch .string {color: red;}"+".dp-batch .vars {color: blue;font-weight: bold;}"};dp.sh.Brushes.Batch.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Batch.Aliases=["batch","dos"];dp.sh.Brushes.ColdFusion=function(){this.CssClass="dp-coldfusion";this.Style=".dp-coldfusion { font: 13px \"Courier New\", Courier, monospace; }"+".dp-coldfusion .tag, .dp-coldfusion .tag-name { color: #990033; }"+".dp-coldfusion .attribute { color: #990033; }"+".dp-coldfusion .attribute-value { color: #0000FF; }"+".dp-coldfusion .cfcomments { background-color: #FFFF99; color: #000000; }"+".dp-coldfusion .cfscriptcomments { color: #999999; }"+".dp-coldfusion .keywords { color: #0000FF; }"+".dp-coldfusion .mgkeywords { color: #CC9900; }"+".dp-coldfusion .numbers { color: #ff0000; }"+".dp-coldfusion .strings { color: green; }";this.mgKeywords="setvalue getvalue addresult viewcollection viewstate";this.keywords="var eq neq gt gte lt lte not and or true false "+"abs acos addsoaprequestheader addsoapresponseheader "+"arrayappend arrayavg arrayclear arraydeleteat arrayinsertat "+"arrayisempty arraylen arraymax arraymin arraynew "+"arrayprepend arrayresize arrayset arraysort arraysum "+"arrayswap arraytolist asc asin atn binarydecode binaryencode "+"bitand bitmaskclear bitmaskread bitmaskset bitnot bitor bitshln "+"bitshrn bitxor ceiling charsetdecode charsetencode chr cjustify "+"compare comparenocase cos createdate createdatetime createobject "+"createobject createobject createobject createobject createodbcdate "+"createodbcdatetime createodbctime createtime createtimespan "+"createuuid dateadd datecompare dateconvert datediff dateformat "+"datepart day dayofweek dayofweekasstring dayofyear daysinmonth "+"daysinyear de decimalformat decrementvalue decrypt decryptbinary "+"deleteclientvariable directoryexists dollarformat duplicate encrypt "+"encryptbinary evaluate exp expandpath fileexists find findnocase "+"findoneof firstdayofmonth fix formatbasen generatesecretkey "+"getauthuser getbasetagdata getbasetaglist getbasetemplatepath "+"getclientvariableslist getcontextroot getcurrenttemplatepath "+"getdirectoryfrompath getencoding getexception getfilefrompath "+"getfunctionlist getgatewayhelper gethttprequestdata gethttptimestring "+"getk2serverdoccount getk2serverdoccountlimit getlocale "+"getlocaledisplayname getlocalhostip getmetadata getmetricdata "+"getpagecontext getprofilesections getprofilestring getsoaprequest "+"getsoaprequestheader getsoapresponse getsoapresponseheader "+"gettempdirectory gettempfile gettemplatepath gettickcount "+"gettimezoneinfo gettoken hash hour htmlcodeformat htmleditformat "+"iif incrementvalue inputbasen insert int isarray isbinary isboolean "+"iscustomfunction isdate isdebugmode isdefined isk2serverabroker "+"isk2serverdoccountexceeded isk2serveronline isleapyear islocalhost "+"isnumeric isnumericdate isobject isquery issimplevalue issoaprequest "+"isstruct isuserinrole isvalid isvalid isvalid iswddx isxml "+"isxmlattribute isxmldoc isxmlelem isxmlnode isxmlroot javacast "+"jsstringformat lcase left len listappend listchangedelims listcontains "+"listcontainsnocase listdeleteat listfind listfindnocase listfirst "+"listgetat listinsertat listlast listlen listprepend listqualify "+"listrest listsetat listsort listtoarray listvaluecount "+"listvaluecountnocase ljustify log log10 lscurrencyformat lsdateformat "+"lseurocurrencyformat lsiscurrency lsisdate lsisnumeric lsnumberformat "+"lsparsecurrency lsparsedatetime lsparseeurocurrency lsparsenumber "+"lstimeformat ltrim max mid min minute month monthasstring now "+"numberformat paragraphformat parameterexists parsedatetime pi "+"preservesinglequotes quarter queryaddcolumn queryaddrow querynew "+"querysetcell quotedvaluelist rand randomize randrange refind "+"refindnocase releasecomobject removechars repeatstring replace "+"replacelist replacenocase rereplace rereplacenocase reverse right "+"rjustify round rtrim second sendgatewaymessage setencoding "+"setlocale setprofilestring setvariable sgn sin spanexcluding "+"spanincluding sqr stripcr structappend structclear structcopy "+"structcount structdelete structfind structfindkey structfindvalue "+"structget structinsert structisempty structkeyarray structkeyexists "+"structkeylist structnew structsort structupdate tan timeformat "+"tobase64 tobinary toscript tostring trim ucase urldecode urlencodedformat "+"urlsessionformat val valuelist week wrap writeoutput xmlchildpos "+"xmlelemnew xmlformat xmlgetnodetype xmlnew xmlparse xmlsearch xmltransform "+"xmlvalidate year yesnoformat";this.stringMatches=new Array();this.attributeMatches=new Array()};dp.sh.Brushes.ColdFusion.prototype=new dp.sh.Highlighter();dp.sh.Brushes.ColdFusion.Aliases=["coldfusion","cf"];dp.sh.Brushes.ColdFusion.prototype.ProcessRegexList=function(){function B(_,$){_[_.length]=$}function A(A,$){for(var _=0;_<A.length;_++)if(A[_]==$)return _;return-1}var _=null,$=null;this.GetMatches(new RegExp("\\b(\\d+)","gm"),"numbers");this.GetMatches(new RegExp(this.GetKeywords(this.mgKeywords),"igm"),"mgkeywords");this.GetMatches(dp.sh.RegexLib.SingleLineCComments,"cfscriptcomments");this.GetMatches(dp.sh.RegexLib.MultiLineCComments,"cfscriptcomments");this.GetMatches(new RegExp("(&lt;|<)!---[\\s\\S]*?---(&gt;|>)","gm"),"cfcomments");$=new RegExp("(cfset\\s*)?([:\\w-.]+)\\s*=\\s*(\".*?\"|'.*?')*","gm");while((_=$.exec(this.code))!=null){if(_[1]!=undefined&&_[1]!="")continue;if(_[3]!=undefined&&_[3]!=""&&_[3]!="\"\""&&_[3]!="''"){B(this.matches,new dp.sh.Match(_[2],_.index,"attribute"));B(this.matches,new dp.sh.Match(_[3],_.index+_[0].indexOf(_[3]),"attribute-value"));B(this.stringMatches,_[3]);B(this.attributeMatches,_[2])}}this.GetMatches(new RegExp("(&lt;|<)/*\\?*(?!\\!)|/*\\?*(&gt;|>)","gm"),"tag");$=new RegExp("(?:&lt;|<)/*\\?*\\s*([:\\w-.]+)","gm");while((_=$.exec(this.code))!=null)B(this.matches,new dp.sh.Match(_[1],_.index+_[0].indexOf(_[1]),"tag-name"));$=new RegExp(this.GetKeywords(this.keywords),"igm");while((_=$.exec(this.code))!=null)if(A(this.attributeMatches,_[0])==-1)B(this.matches,new dp.sh.Match(_[0],_.index,"keywords"));$=new RegExp("cfset\\s*.*(\".*?\"|'.*?')","gm");while((_=$.exec(this.code))!=null)if(_[1]!=undefined&&_[1]!=""){B(this.matches,new dp.sh.Match(_[1],_.index+_[0].indexOf(_[1]),"strings"));B(this.stringMatches,_[1])}while((_=dp.sh.RegexLib.DoubleQuotedString.exec(this.code))!=null)if(A(this.stringMatches,_[0])==-1)B(this.matches,new dp.sh.Match(_[0],_.index,"strings"));while((_=dp.sh.RegexLib.SingleQuotedString.exec(this.code))!=null)if(A(this.stringMatches,_[0])==-1)B(this.matches,new dp.sh.Match(_[0],_.index,"strings"))};dp.sh.Brushes.Cpp=function(){var _="ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR "+"DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH "+"HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP "+"HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY "+"HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT "+"HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE "+"LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF "+"LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR "+"LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR "+"PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT "+"PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 "+"POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR "+"PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 "+"PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT "+"SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG "+"ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM "+"char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t "+"clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS "+"FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t "+"__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t "+"jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler "+"sig_atomic_t size_t _stat __stat64 _stati64 terminate_function "+"time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf "+"va_list wchar_t wctrans_t wctype_t wint_t signed",$="break case catch class const __finally __exception __try "+"const_cast continue private public protected __declspec "+"default delete deprecated dllexport dllimport do dynamic_cast "+"else enum explicit extern if for friend goto inline "+"mutable naked namespace new noinline noreturn nothrow "+"register reinterpret_cast return selectany "+"sizeof static static_cast struct switch template this "+"thread throw true false try typedef typeid typename union "+"using uuid virtual void volatile whcar_t while";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^ *#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"datatypes"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-cpp";this.Style=".dp-cpp .datatypes { color: #2E8B57; font-weight: bold; }"};dp.sh.Brushes.Cpp.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Cpp.Aliases=["cpp","c","c++"];dp.sh.Brushes.CSharp=function(){var $="abstract as base bool break byte case catch char checked class const "+"continue decimal default delegate do double else enum event explicit "+"extern false finally fixed float for foreach get goto if implicit in int "+"interface internal is lock long namespace new null object operator out "+"override params private protected public readonly ref return sbyte sealed set "+"short sizeof stackalloc static string struct switch this throw true try "+"typeof uint ulong unchecked unsafe ushort using virtual void while";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-c";this.Style=".dp-c .vars { color: #d00; }"};dp.sh.Brushes.CSharp.prototype=new dp.sh.Highlighter();dp.sh.Brushes.CSharp.Aliases=["c#","c-sharp","csharp"];dp.sh.Brushes.CSS=function(){var _="ascent azimuth background-attachment background-color background-image background-position "+"background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top "+"border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color "+"border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width "+"border-bottom-width border-left-width border-width border cap-height caption-side centerline clear clip color "+"content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display "+"elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font "+"height letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top "+"margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans "+"outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page "+"page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position "+"quotes richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress "+"table-layout text-align text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em "+"vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index",$="above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder "+"both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed "+"continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double "+"embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia "+"gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic "+"justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha "+"lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower "+"navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset "+"outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side "+"rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow "+"small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize "+"table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal "+"text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin "+"upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow",A="[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif";this.regexList=[{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("\\#[a-zA-Z0-9]{3,6}","g"),css:"value"},{regex:new RegExp("(-?\\d+)(.\\d+)?(px|em|pt|:|%|)","g"),css:"value"},{regex:new RegExp("!important","g"),css:"important"},{regex:new RegExp(this.GetKeywordsCSS(_),"gm"),css:"keyword"},{regex:new RegExp(this.GetValuesCSS($),"g"),css:"value"},{regex:new RegExp(this.GetValuesCSS(A),"g"),css:"value"}];this.CssClass="dp-css";this.Style=".dp-css .value { color: black; }"+".dp-css .important { color: red; }"};dp.sh.Highlighter.prototype.GetKeywordsCSS=function($){return"\\b([a-z_]|)"+$.replace(/ /g,"(?=:)\\b|\\b([a-z_\\*]|\\*|)")+"(?=:)\\b"};dp.sh.Highlighter.prototype.GetValuesCSS=function($){return"\\b"+$.replace(/ /g,"(?!-)(?!:)\\b|\\b()")+":\\b"};dp.sh.Brushes.CSS.prototype=new dp.sh.Highlighter();dp.sh.Brushes.CSS.Aliases=["css"];dp.sh.Brushes.Delphi=function(){var $="abs addr and ansichar ansistring array as asm begin boolean byte cardinal "+"case char class comp const constructor currency destructor div do double "+"downto else end except exports extended false file finalization finally "+"for function goto if implementation in inherited int64 initialization "+"integer interface is label library longint longword mod nil not object "+"of on or packed pansichar pansistring pchar pcurrency pdatetime pextended "+"pint64 pointer private procedure program property pshortstring pstring "+"pvariant pwidechar pwidestring protected public published raise real real48 "+"record repeat set shl shortint shortstring shr single smallint string then "+"threadvar to true try type unit until uses val var varirnt while widechar "+"widestring with word write writeln xor";this.regexList=[{regex:new RegExp("\\(\\*[\\s\\S]*?\\*\\)","gm"),css:"comment"},{regex:new RegExp("{(?!\\$)[\\s\\S]*?}","gm"),css:"comment"},{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("\\{\\$[a-zA-Z]+ .+\\}","g"),css:"directive"},{regex:new RegExp("\\b[\\d\\.]+\\b","g"),css:"number"},{regex:new RegExp("\\$[a-zA-Z0-9]+\\b","g"),css:"number"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-delphi";this.Style=".dp-delphi .number { color: blue; }"+".dp-delphi .directive { color: #008284; }"+".dp-delphi .vars { color: #000; }"};dp.sh.Brushes.Delphi.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Delphi.Aliases=["delphi","pascal"];dp.sh.Brushes.Java=function(){var $="abstract assert boolean break byte case catch char class const "+"continue default do double else enum extends "+"false final finally float for goto if implements import "+"instanceof int interface long native new null "+"package private protected public return "+"short static strictfp super switch synchronized this throw throws true "+"transient try void volatile while";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b","gi"),css:"number"},{regex:new RegExp("(?!\\@interface\\b)\\@[\\$\\w]+\\b","g"),css:"annotation"},{regex:new RegExp("\\@interface\\b","g"),css:"keyword"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-j";this.Style=".dp-j .annotation { color: #646464; }"+".dp-j .number { color: #C00000; }"};dp.sh.Brushes.Java.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Java.Aliases=["java"];dp.sh.Brushes.JScript=function(){var $="abstract boolean break byte case catch char class const continue debugger "+"default delete do double else enum export extends false final finally float "+"for function goto if implements import in instanceof int interface long native "+"new null package private protected public return short static super switch "+"synchronized this throw throws transient true try typeof var void volatile while with";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-c"};dp.sh.Brushes.JScript.prototype=new dp.sh.Highlighter();dp.sh.Brushes.JScript.Aliases=["js","jscript","javascript"];dp.sh.Brushes.Lua=function(){var $="break do end else elseif function if local nil not or repeat return and then until while this",_="math\\.\\w+ string\\.\\w+ os\\.\\w+ debug\\.\\w+ io\\.\\w+ error fopen dofile coroutine\\.\\w+ arg getmetatable ipairs loadfile loadlib loadstring longjmp print rawget rawset seek setmetatable assert tonumber tostring";this.regexList=[{regex:new RegExp("--\\[\\[[\\s\\S]*\\]\\]--","gm"),css:"comment"},{regex:new RegExp("--[^\\[]{2}.*$","gm"),css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"func"},];this.CssClass="dp-lua"};dp.sh.Brushes.Lua.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Lua.Aliases=["lua"];dp.sh.Brushes.Mxml=function(){this.CssClass="dp-mxml";this.Style=".dp-mxml .cdata { color: #000000; }"+".dp-mxml .tag { color : #0000ff; }"+".dp-mxml .tag-name { color: #0000ff; }"+".dp-mxml .script { color: green; }"+".dp-mxml .metadata { color: green; }"+".dp-mxml .attribute { color: #000000; }"+".dp-mxml .attribute-value { color: #990000; }"+".dp-mxml .trace { color: #cc6666; }"+".dp-mxml .var { color: #6699cc; }"+".dp-mxml .comment { color: #009900; }"+".dp-mxml .string { color: #990000; }"+".dp-mxml .keyword { color: blue; }"};dp.sh.Brushes.Mxml.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Mxml.Aliases=["mxml"];dp.sh.Brushes.Mxml.prototype.ProcessRegexList=function(){function H(_,$){_[_.length]=$}function B(B,_){var A=0,$=false;for(A=0;A<B.length;A++)if(_.index>B[A].firstIndex&&_.index<B[A].lastIndex)$=true;return $}var $=0,F=null,D=null,A=null,C="",E=new Array(),_="abstract boolean break byte case catch char class const continue debugger "+"default delete do double else enum export extends false final finally float "+"for function goto if implements import in instanceof int interface long native "+"new null package private protected public return short static super switch "+"synchronized this throw throws transient true try typeof var void volatile while with",G=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords("trace"),"gm"),css:"trace"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"keyword"}];A=new RegExp("&lt;\\!\\[CDATA\\[(.|\\s)*?\\]\\]&gt;","gm");while((F=A.exec(this.code))!=null){C=F[0].substr(0,12);H(this.matches,new dp.sh.Match(C,F.index,"cdata"));C=F[0].substr(12,F[0].length-12-6);for(var I=0;I<G.length;I++)while((D=G[I].regex.exec(C))!=null)H(this.matches,new dp.sh.Match(D[0],F.index+12+D.index,G[I].css));C=F[0].substr(F[0].length-6,6);H(this.matches,new dp.sh.Match(C,F.index+F[0].length-6,"cdata"));E.push({firstIndex:F.index,lastIndex:F.index+F[0].length-1})}this.GetMatches(new RegExp("(&lt;|<)!--\\s*.*?\\s*--(&gt;|>)","gm"),"comments");A=new RegExp("([:\\w-.]+)\\s*=\\s*(\".*?\"|'.*?'|\\w+)*|(\\w+)","gm");while((F=A.exec(this.code))!=null){if(F[1]==null)continue;if(B(E,F))continue;H(this.matches,new dp.sh.Match(F[1],F.index,"attribute"));if(F[2]!=undefined)H(this.matches,new dp.sh.Match(F[2],F.index+F[0].indexOf(F[2]),"attribute-value"))}A=new RegExp("(?:&lt;|<)/*\\?*\\s*([:\\w-.]+)","gm");while((F=A.exec(this.code))!=null){if(B(E,F))continue;C=F[0].substr(4,F[0].length-4);switch(C){case"mx:Script":case"/mx:Script":H(this.matches,new dp.sh.Match(F[0]+"&gt;",F.index,"script"));break;case"mx:Metadata":case"/mx:Metadata":H(this.matches,new dp.sh.Match(F[0]+"&gt;",F.index,"metadata"));break;default:H(this.matches,new dp.sh.Match(F[0],F.index,"tag-name"));break}}A=new RegExp("\\?&gt;|&gt;|/&gt;","gm");while((F=A.exec(this.code))!=null){if(B(E,F))continue;H(this.matches,new dp.sh.Match(F[0],F.index,"tag"))}};dp.sh.Brushes.Perl=function(){var _="abs accept alarm atan2 bind binmode bless caller chdir chmod chomp chop chown chr chroot close closedir connect cos crypt dbmclose dbmopen defined delete dump each endgrent endhostent endnetent endprotoent endpwent endservent eof exec exists exp fcntl fileno flock fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getppid getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt glob gmtime grep hex import index int ioctl join keys kill lc lcfirst length link listen localtime lock log lstat m map mkdir msgctl msgget msgrcv msgsnd no oct open opendir ord pack pipe pop pos print printf prototype push q qq quotemeta qw qx rand read readdir readline readlink readpipe recv ref rename reset reverse rewinddir rindex rmdir scalar seek seekdir semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unlink unpack unshift untie utime values vec waitpid wantarray warn write qr",$="s select goto die do package redo require return continue for foreach last next wait while use if else elsif eval exit unless switch case",A="my our local";this.regexList=[{regex:dp.sh.RegexLib.SingleLinePerlComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("(\\$|@|%)\\w+","g"),css:"vars"},{regex:new RegExp(this.GetKeywords(_),"gmi"),css:"func"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp(this.GetKeywords(A),"gm"),css:"declarations"}];this.CssClass="dp-perl"};dp.sh.Brushes.Perl.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Perl.Aliases=["perl"];dp.sh.Brushes.Php=function(){var _="abs acos acosh addcslashes addslashes "+"array_change_key_case array_chunk array_combine array_count_values array_diff "+"array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill "+"array_filter array_flip array_intersect array_intersect_assoc array_intersect_key "+"array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map "+"array_merge array_merge_recursive array_multisort array_pad array_pop array_product "+"array_push array_rand array_reduce array_reverse array_search array_shift "+"array_slice array_splice array_sum array_udiff array_udiff_assoc "+"array_udiff_uassoc array_uintersect array_uintersect_assoc "+"array_uintersect_uassoc array_unique array_unshift array_values array_walk "+"array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert "+"basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress "+"bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir "+"checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists "+"closedir closelog copy cos cosh count count_chars date decbin dechex decoct "+"deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log "+"error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded "+"feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents "+"fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype "+"floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf "+"fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname "+"gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt "+"getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext "+"gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set "+"interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double "+"is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long "+"is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault "+"is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br "+"parse_ini_file parse_str parse_url passthru pathinfo readlink realpath rewind rewinddir rmdir "+"round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split "+"str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes "+"stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk "+"strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime "+"strtoupper strtr strval substr substr_compare",$="and or xor __FILE__ __LINE__ array as break case "+"cfunction class const continue declare default die do else "+"elseif empty enddeclare endfor endforeach endif endswitch endwhile "+"extends for foreach function include include_once global if "+"new old_function return static switch use require require_once "+"var while __FUNCTION__ __CLASS__ "+"__METHOD__ abstract interface public implements extends private protected throw";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("\\$\\w+","g"),css:"vars"},{regex:new RegExp(this.GetKeywords(_),"gmi"),css:"func"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-c"};dp.sh.Brushes.Php.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Php.Aliases=["php"];dp.sh.Brushes.Python=function(){var $="and assert break class continue def del elif else "+"except exec finally for from global if import in is "+"lambda not or pass print raise return try yield while",_="None True False self cls class_";this.regexList=[{regex:dp.sh.RegexLib.SingleLinePerlComments,css:"comment"},{regex:new RegExp("^\\s*@\\w+","gm"),css:"decorator"},{regex:new RegExp("(['\"]{3})([^\\1])*?\\1","gm"),css:"comment"},{regex:new RegExp("\"(?!\")(?:\\.|\\\\\\\"|[^\\\"\"\\n\\r])*\"","gm"),css:"string"},{regex:new RegExp("'(?!')*(?:\\.|(\\\\\\')|[^\\''\\n\\r])*'","gm"),css:"string"},{regex:new RegExp("\\b\\d+\\.?\\w*","g"),css:"number"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"special"}];this.CssClass="dp-py";this.Style=".dp-py .builtins { color: #ff1493; }"+".dp-py .magicmethods { color: #808080; }"+".dp-py .exceptions { color: brown; }"+".dp-py .types { color: brown; font-style: italic; }"+".dp-py .commonlibs { color: #8A2BE2; font-style: italic; }"};dp.sh.Brushes.Python.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Python.Aliases=["py","python"];dp.sh.Brushes.Ruby=function(){var $="alias and BEGIN begin break case class def define_method defined do each else elsif "+"END end ensure false for if in module new next nil not or raise redo rescue retry return "+"self super then throw true undef unless until when while yield",_="Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload "+"Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol "+"ThreadGroup Thread Time TrueClass";this.regexList=[{regex:dp.sh.RegexLib.SingleLinePerlComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp(":[a-z][A-Za-z0-9_]*","g"),css:"symbol"},{regex:new RegExp("(\\$|@@|@)\\w+","g"),css:"variable"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"builtin"}];this.CssClass="dp-rb";this.Style=".dp-rb .symbol { color: #a70; }"+".dp-rb .variable { color: #a70; font-weight: bold; }"};dp.sh.Brushes.Ruby.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Ruby.Aliases=["ruby","rails","ror"];dp.sh.Brushes.Sql=function(){var _="abs avg case cast coalesce convert count current_timestamp "+"current_user day isnull left lower month nullif replace right "+"session_user space substring sum system_user upper user year",$="absolute action add after alter as asc at authorization begin bigint "+"binary bit by cascade char character check checkpoint close collate "+"column commit committed connect connection constraint contains continue "+"create cube current current_date current_time cursor database date "+"deallocate dec decimal declare default delete desc distinct double drop "+"dynamic else end end-exec escape except exec execute false fetch first "+"float for force foreign forward free from full function global goto grant "+"group grouping having hour ignore index inner insensitive insert instead "+"int integer intersect into is isolation key last level load local max min "+"minute modify move name national nchar next no numeric of off on only "+"open option order out output partial password precision prepare primary "+"prior privileges procedure public read real references relative repeatable "+"restrict return returns revoke rollback rollup rows rule schema scroll "+"second section select sequence serializable set size smallint static "+"statistics table temp temporary then time timestamp to top transaction "+"translation trigger true truncate uncommitted union unique update values "+"varchar varying view when where with work",A="all and any between cross in join like not null or outer some";this.regexList=[{regex:new RegExp("--(.*)$","gm"),css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp(this.GetKeywords(_),"gmi"),css:"func"},{regex:new RegExp(this.GetKeywords(A),"gmi"),css:"op"},{regex:new RegExp(this.GetKeywords($),"gmi"),css:"keyword"}];this.CssClass="dp-sql";this.Style=".dp-sql .func { color: #ff1493; }"+".dp-sql .op { color: #808080; }"};dp.sh.Brushes.Sql.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Sql.Aliases=["sql"];dp.sh.Brushes.Vb=function(){var $="AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto "+"Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate "+"CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType "+"Date Decimal Declare Default Delegate Dim DirectCast Do Double Each "+"Else ElseIf End Enum Erase Error Event Exit False Finally For Friend "+"Function Get GetType GoSub GoTo Handles If Implements Imports In "+"Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module "+"MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing "+"NotInheritable NotOverridable Object On Option Optional Or OrElse "+"Overloads Overridable Overrides ParamArray Preserve Private Property "+"Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume "+"Return Select Set Shadows Shared Short Single Static Step Stop String "+"Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until "+"Variant When While With WithEvents WriteOnly Xor";this.regexList=[{regex:new RegExp("'.*$","gm"),css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-vb"};dp.sh.Brushes.Vb.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Vb.Aliases=["vb","vb.net"];dp.sh.Brushes.Xml=function(){this.CssClass="dp-xml";this.Style=".dp-xml .cdata { color: #ff1493; }"+".dp-xml .tag, .dp-xml .tag-name { color: #069; font-weight: bold; }"+".dp-xml .attribute { color: red; }"+".dp-xml .attribute-value { color: blue; }"};dp.sh.Brushes.Xml.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Xml.Aliases=["xml","xhtml","xslt","html","xhtml"];dp.sh.Brushes.Xml.prototype.ProcessRegexList=function(){function B(_,$){_[_.length]=$}var $=0,A=null,_=null;this.GetMatches(new RegExp("(&lt;|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](&gt;|>)","gm"),"cdata");this.GetMatches(new RegExp("(&lt;|<)!--\\s*.*?\\s*--(&gt;|>)","gm"),"comments");_=new RegExp("([:\\w-.]+)\\s*=\\s*(\".*?\"|'.*?'|\\w+)*|(\\w+)","gm");while((A=_.exec(this.code))!=null){if(A[1]==null)continue;B(this.matches,new dp.sh.Match(A[1],A.index,"attribute"));if(A[2]!=undefined)B(this.matches,new dp.sh.Match(A[2],A.index+A[0].indexOf(A[2]),"attribute-value"))}this.GetMatches(new RegExp("(&lt;|<)/*\\?*(?!\\!)|/*\\?*(&gt;|>)","gm"),"tag");_=new RegExp("(?:&lt;|<)/*\\?*\\s*([:\\w-.]+)","gm");while((A=_.exec(this.code))!=null)B(this.matches,new dp.sh.Match(A[1],A.index+A[0].indexOf(A[1]),"tag-name"))}
//}}}
/***
The new SystemConfig feature allows arbitrary JavaScript code to be executed at startup from any tiddler that is tagged with 'systemConfig', one of the new SpecialTags.
***/
/*{{{*/
config.messages.messageClose.text = "\xD7";
config.messages.messageClose.tooltip = "Close this message";
config.views.wikified.defaultText = "";
config.views.wikified.tag.labelTags = "";
config.views.wikified.tag.openTag = "";
config.views.wikified.tag.tooltip = "Show other tiddlers tagged with '%0'";
config.views.editor.tagPrompt = "separated by spaces, using [[double square brackets]] if necessary";

config.commands.closeTiddler.text = "\xD7";
config.commands.closeTiddler.tooltip = "Close this tiddler";
config.commands.closeOthers.text = "\xA4";
config.commands.closeOthers.tooltip = "Close all others";
config.commands.jump.text = "\xBB";
config.commands.jump.tooltip = "Jump to another open tiddler";
config.commands.copyTiddler.text = "\xA9";
config.commands.copyTiddler.readOnlyText = "  ";
config.commands.editTiddler.text = "\x45";
config.commands.editTiddler.readOnlyText = "  ";
config.commands.editTiddler.tooltip = "Edit this tiddler (double click)";
config.commands.references.text = "\xA5";
config.commands.references.tooltip = "Tiddlers that link to this one";
config.commands.saveTiddler.text = "\xA7";
config.commands.saveTiddler.readOnlyText = ".";
config.commands.saveTiddler.tooltip = "Save changes";
config.commands.cancelTiddler.text = "\xA2";
config.commands.cancelTiddler.tooltip = "Cancel changes";
config.commands.deleteTiddler.text = "\xD8";
config.commands.deleteTiddler.tooltip = "Delete this tiddler";
config.commands.syncing.text = "↔";
config.commands.fields.text = "≡";

config.macros.timeline.dateFormat = "MMM DD, YYYY";
config.macros.search.prompt = "Search this site";
config.macros.search.successMsg = "%0 tiddlers found matching %1";
config.macros.search.failureMsg = "No tiddlers found matching %0";
config.macros.newTiddler.prompt = "Create a new tiddler";
config.macros.newTiddler.label = "+";
config.macros.saveChanges.label = "Save";
config.macros.saveChanges.prompt = "Save this whole wiki as an html file";
config.macros.newJournal.prompt = "Create a new tiddler from the current date and time";
config.macros.permaview.label = "\xA5";
config.macros.permaview.prompt = "Make a URL showing all currently displayed tiddlers";
config.macros.closeAll.label = "\xD7";
config.macros.permaview.label = "\xA5";
config.macros.search.label = "\xA7";
/*}}}*/
<<sliderFolder production "Production" "Production Petroleum Engineering">>
<<sliderFolder physics "Physics" "Physics stuff">>
<<sliderFolder ejs "EJS" "Easy Java Simulations">>
<<sliderFolder osp "OSP" "Open Source Physics">>
<<sliderFolder meta "meta" "System settings">>
<<tiddlerList tags:none>>
<<siteMap menu . sliders>>
----
[[About]]
[[Welcome]]
{{tuduSlider{<<slider chkModeling Modeling 'Modeling »'>>}}}{{tuduSlider{<<slider chkProduction Production 'Production »'>>}}}{{tuduSlider{<<slider chkphysics physics 'physics »'>>}}}{{tuduSlider{<<slider chkMeta meta 'Meta... »'>>}}}


[[Instructions]]
NewPluginTemplateInput


^^~TiddlyWiki is © 2007 [[UnaMesa|http://www.unamesa.org/]]^^
<<tagsTree menu ""  1 5 index label>>
----
[[About]]
[[Welcome]]
Existing [[Tags]] and tiddler population:
<<AllTagsExcept excludeLists folder plugin system systemConfig systemTiddlers template>>
<<siteMap physics . sliders>>
<<siteMap production . sliders>>
<<siteMap modeling . sliders>>
<<siteMap meta . sliders>>
Use of [[BigInteger]]

<code java>
//package MyApps.TableOfPowerBigInt;

// Exercise 8.11: TableOfPowers.java
// Displays a table of powers up to a given limit.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.math.BigInteger; // Import BigInteger from java.math package

public class TableOfPowers extends JFrame {
    // JLabel and JTextField for limit of loop counter
    private JLabel limitJLabel;
    private JTextField limitJTextField;

    // JTextArea for displaying results
    private JTextArea outputJTextArea;

    // JButton to initiate calculations
    private JButton calculateJButton;

    private JDesktopPane desktop;
    private JFrame f;


    // no-argument constructor
    public TableOfPowers() {
        createUserInterface();
    }

    // create and position GUI components; register event handlers
    private void createUserInterface() {
        // get content pane for attaching GUI components
        Container contentPane = getContentPane();

        // enable explicit positioning of GUI components
        contentPane.setLayout( null );

        // set up limitJLabel
        limitJLabel = new JLabel();
        limitJLabel.setBounds( 16, 16, 64, 26 );
        limitJLabel.setText( "Upper limit:" );
        contentPane.add( limitJLabel );

        // set up limitJTextField
        limitJTextField = new JTextField();
        limitJTextField.setBounds( 85, 16, 59, 26 );
        limitJTextField.setHorizontalAlignment( JTextField.RIGHT );
        contentPane.add( limitJTextField );
        limitJTextField.addKeyListener(

        new KeyAdapter() // anonymous inner class
        {
            // event handler called if key pressed in limitJTextField
            public void keyPressed( KeyEvent event ) {
                limitJTextFieldKeyPressed( event );
            }

        } // end anonymous inner class

        ); // end call to addKeyListener

        // set up calculateJButton
        calculateJButton = new JButton();
        calculateJButton.setBounds( 166, 16, 130, 26 );
        calculateJButton.setText( "Calculate" );
        contentPane.add( calculateJButton );
        calculateJButton.addActionListener(

        new ActionListener() // anonymous inner class
        {
            // event handler called when user clicks calculateJButton
            public void actionPerformed( ActionEvent event ) {
                calculateJButtonActionPerformed( event );
            }

        } // end anonymous inner class

        ); // end call to addActionListener


        // get content pane for attaching GUI components
        //Container outputPane = getContentPane();
        //outputPane.setLayout( null );

        // set up outputJTextArea
        outputJTextArea = new JTextArea();
        outputJTextArea.setEditable( false );


         // create JScrollPane that provides scrolling
        // for outputJTextArea
        JScrollPane scrollJScrollPane = new JScrollPane( outputJTextArea );
        scrollJScrollPane.setBounds( 16, 56, 380, 95 );
        contentPane.add( scrollJScrollPane );


        // set properties of application's window
        setTitle( "Table Of Powers" ); // set title bar text
        setSize( 420, 195 );           // set window's size
        setVisible( true );            // display window

    } // end method createUserInterface

    // called when user presses key in limitJTextField
    private void limitJTextFieldKeyPressed( KeyEvent event ) {

        outputJTextArea.setText( "" );
    }

    // called when user clicks calculateJButton
    public void calculateJButtonActionPerformed( ActionEvent event ) {

        int counter = 1;
        double nsquared;
        double ncubed;
        BigInteger squaredBI, cubedBI, counterBI;

        squaredBI = BigInteger.ZERO;
        cubedBI = BigInteger.ZERO;
        counterBI = BigInteger.ZERO;

        // clear outputJTextArea
        outputJTextArea.setText( "" );

        // add header to outputJTextArea
        outputJTextArea.append( "n\t n-squared\tn-cubed" );

        // retrieve user input
        int limit = Integer.parseInt( limitJTextField.getText() );

        while (counter <= limit ) {
            counterBI = BigInteger.valueOf(counter);
            nsquared = counter * counter;
            ncubed = counter * counter * counter;
            squaredBI = counterBI.pow(2);
            cubedBI = counterBI.pow(3);
            outputJTextArea.append( "\n" + counter + "\t" + squaredBI + "\t" + cubedBI );

            counter++;

        } // end while
    } // end method calculateJButtonActionPerformed

    // main method
    public static void main( String[] args ) {
        TableOfPowers application = new TableOfPowers();

        application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

    } // end method main

} // end class TableOfPowers
</code>
sample table:
|!th1111111111|!th2222222222|
|>| colspan |
| rowspan |left|
|~| right|
|bgcolor(#a0ffa0):colored| center |
|caption|c
{{{
sample table:
|!th1111111111|!th2222222222|
|>| colspan |
| rowspan |left|
|~| right|
|bgcolor(#a0ffa0):colored| center |
|caption|c
}}}
<<tabs txtFavourite
Urgent "Priority 1" ToDo1
Important "Priority 2" ToDo2
"Need To Do" "Priority 3" ToDo3
>>
{{{
<<tabs txtFavourite
Urgent "Priority 1" ToDo1
Important "Priority 2" ToDo2
"Need To Do" "Priority 3" ToDo3
>>
}}}
/***
| Name|TagglyTaggingPlugin|
| Description|tagglyTagging macro is a replacement for the builtin tagging macro in your ViewTemplate|
| Version|3.1 ($Rev: 2351 $)|
| Date|$Date: 2007-07-12 10:18:02 +1000 (Thu, 12 Jul 2007) $|
| Source|http://mptw.tiddlyspot.com/#TagglyTaggingPlugin|
| Author|Simon Baird <simon.baird@gmail.com>|
| License|http://mptw.tiddlyspot.com/#TheBSDLicense|
!Notes
See http://mptw.tiddlyspot.com/#TagglyTagging
***/
//{{{
config.taggly = {

	// for translations
	lingo: {
		labels: {
			asc:        "\u2191", // down arrow
			desc:       "\u2193", // up arrow
			title:      "title",
			modified:   "modified",
			created:    "created",
			show:       "+",
			hide:       "-",
			normal:     "normal",
			group:      "group",
			commas:     "commas",
			sitemap:    "sitemap",
			numCols:    "cols\u00b1", // plus minus sign
			label:      "Tagged as '%0':",
			excerpts:   "excerpts",
			contents:   "contents",
			sliders:    "sliders",
			noexcerpts: "title only"
		},

		tooltips: {
			title:    "Click to sort by title",
			modified: "Click to sort by modified date",
			created:  "Click to sort by created date",
			show:     "Click to show tagging list",
			hide:     "Click to hide tagging list",
			normal:   "Click to show a normal ungrouped list",
			group:    "Click to show list grouped by tag",
			sitemap:  "Click to show a sitemap style list",
			commas:   "Click to show a comma separated list",
			numCols:  "Click to change number of columns",
			excerpts: "Click to show excerpts",
			contents: "Click to show entire tiddler contents",
			sliders:  "Click to show tiddler contents in sliders",
			noexcerpts: "Click to show entire title only"
		}
	},

	config: {
		showTaggingCounts: true,
		listOpts: {
			// the first one will be the default
			sortBy:     ["title","modified","created"],
			sortOrder:  ["asc","desc"],
			hideState:  ["show","hide"],
			listMode:   ["normal","group","sitemap","commas"],
			numCols:    ["4","1","2","3","5","6"],
			excerpts:   ["noexcerpts","excerpts","contents","sliders"]
		},
		valuePrefix: "taggly.",
		excludeTags: ["excludeLists","excludeTagging"],
		excerptSize: 50,
		excerptMarker: "/%"+"%/"
	},

	getTagglyOpt: function(title,opt) {
		var val = store.getValue(title,this.config.valuePrefix+opt);
		return val ? val : this.config.listOpts[opt][0];
	},

	setTagglyOpt: function(title,opt,value) {
		if (!store.tiddlerExists(title))
			// create it silently
			store.saveTiddler(title,title,config.views.editor.defaultText.format([title]),config.options.txtUserName,new Date(),null);
		// if value is default then remove it to save space
		return store.setValue(title,
			this.config.valuePrefix+opt,
			value == this.config.listOpts[opt][0] ? null : value);
	},

	getNextValue: function(title,opt) {
		var current = this.getTagglyOpt(title,opt);
		var pos = this.config.listOpts[opt].indexOf(current);
		// a little usability enhancement. actually it doesn't work right for grouped or sitemap
		var limit = (opt == "numCols" ? store.getTaggedTiddlers(title).length : this.config.listOpts[opt].length);
		var newPos = (pos + 1) % limit;
		return this.config.listOpts[opt][newPos];
	},

	toggleTagglyOpt: function(title,opt) {
		var newVal = this.getNextValue(title,opt);
		this.setTagglyOpt(title,opt,newVal);
	}, 

	createListControl: function(place,title,type) {
		var lingo = config.taggly.lingo;
		var label;
		var tooltip;
		var onclick;

		if ((type == "title" || type == "modified" || type == "created")) {
			// "special" controls. a little tricky. derived from sortOrder and sortBy
			label = lingo.labels[type];
			tooltip = lingo.tooltips[type];

			if (this.getTagglyOpt(title,"sortBy") == type) {
				label += lingo.labels[this.getTagglyOpt(title,"sortOrder")];
				onclick = function() {
					config.taggly.toggleTagglyOpt(title,"sortOrder");
					return false;
				}
			}
			else {
				onclick = function() {
					config.taggly.setTagglyOpt(title,"sortBy",type);
					config.taggly.setTagglyOpt(title,"sortOrder",config.taggly.config.listOpts.sortOrder[0]);
					return false;
				}
			}
		}
		else {
			// "regular" controls, nice and simple
			label = lingo.labels[type == "numCols" ? type : this.getNextValue(title,type)];
			tooltip = lingo.tooltips[type == "numCols" ? type : this.getNextValue(title,type)];
			onclick = function() {
				config.taggly.toggleTagglyOpt(title,type);
				return false;
			}
		}

		// hide button because commas don't have columns
		if (!(this.getTagglyOpt(title,"listMode") == "commas" && type == "numCols"))
			createTiddlyButton(place,label,tooltip,onclick,type == "hideState" ? "hidebutton" : "button");
	},

	makeColumns: function(orig,numCols) {
		var listSize = orig.length;
		var colSize = listSize/numCols;
		var remainder = listSize % numCols;

		var upperColsize = colSize;
		var lowerColsize = colSize;

		if (colSize != Math.floor(colSize)) {
			// it's not an exact fit so..
			upperColsize = Math.floor(colSize) + 1;
			lowerColsize = Math.floor(colSize);
		}

		var output = [];
		var c = 0;
		for (var j=0;j<numCols;j++) {
			var singleCol = [];
			var thisSize = j < remainder ? upperColsize : lowerColsize;
			for (var i=0;i<thisSize;i++) 
				singleCol.push(orig[c++]);
			output.push(singleCol);
		}

		return output;
	},

	drawTable: function(place,columns,theClass) {
		var newTable = createTiddlyElement(place,"table",null,theClass);
		var newTbody = createTiddlyElement(newTable,"tbody");
		var newTr = createTiddlyElement(newTbody,"tr");
		for (var j=0;j<columns.length;j++) {
			var colOutput = "";
			for (var i=0;i<columns[j].length;i++) 
				colOutput += columns[j][i];
			var newTd = createTiddlyElement(newTr,"td",null,"tagglyTagging"); // todo should not need this class
			wikify(colOutput,newTd);
		}
		return newTable;
	},

	createTagglyList: function(place,title) {
		switch(this.getTagglyOpt(title,"listMode")) {
			case "group":  return this.createTagglyListGrouped(place,title); break;
			case "normal": return this.createTagglyListNormal(place,title,false); break;
			case "commas": return this.createTagglyListNormal(place,title,true); break;
			case "sitemap":return this.createTagglyListSiteMap(place,title); break;
		}
	},

	getTaggingCount: function(title) {
		// thanks to Doug Edmunds
		if (this.config.showTaggingCounts) {
			var tagCount = store.getTaggedTiddlers(title).length;
			if (tagCount > 0)
				return " ("+tagCount+")";
		}
		return "";
	},

	getExcerpt: function(inTiddlerTitle,title,indent) {
    if (!indent)
			indent = 1;
		if (this.getTagglyOpt(inTiddlerTitle,"excerpts") == "excerpts") {
			var t = store.getTiddler(title);
			if (t) {
				var text = t.text.replace(/\n/," ");
				var marker = text.indexOf(this.config.excerptMarker);
				if (marker != -1) {
					return " {{excerpt{<nowiki>" + text.substr(0,marker) + "</nowiki>}}}";
				}
				else if (text.length < this.config.excerptSize) {
					return " {{excerpt{<nowiki>" + t.text + "</nowiki>}}}";
				}
				else {
					return " {{excerpt{<nowiki>" + t.text.substr(0,this.config.excerptSize) + "..." + "</nowiki>}}}";
				}
			}
		}
		else if (this.getTagglyOpt(inTiddlerTitle,"excerpts") == "contents") {
			var t = store.getTiddler(title);
			if (t) {
				return "\n{{contents indent"+indent+"{\n" + t.text + "\n}}}";
			}
		}
		else if (this.getTagglyOpt(inTiddlerTitle,"excerpts") == "sliders") {
			var t = store.getTiddler(title);
			if (t) {
				return "<slider slide>\n{{contents{\n" + t.text + "\n}}}\n</slider>";
			}
		}
		return "";
	},

	notHidden: function(t,inTiddler) {
		if (typeof t == "string") 
			t = store.getTiddler(t);
		return (!t || !t.tags.containsAny(this.config.excludeTags) ||
				(inTiddler && this.config.excludeTags.contains(inTiddler)));
	},

	// this is for normal and commas mode
	createTagglyListNormal: function(place,title,useCommas) {

		var list = store.getTaggedTiddlers(title,this.getTagglyOpt(title,"sortBy"));

		if (this.getTagglyOpt(title,"sortOrder") == "desc")
			list = list.reverse();

		var output = [];
		var first = true;
		for (var i=0;i<list.length;i++) {
			if (this.notHidden(list[i],title)) {
				var countString = this.getTaggingCount(list[i].title);
				var excerpt = this.getExcerpt(title,list[i].title);
				if (useCommas)
					output.push((first ? "" : ", ") + "[[" + list[i].title + "]]" + countString + excerpt);
				else
					output.push("*[[" + list[i].title + "]]" + countString + excerpt + "\n");

				first = false;
			}
		}

		return this.drawTable(place,
			this.makeColumns(output,useCommas ? 1 : parseInt(this.getTagglyOpt(title,"numCols"))),
			useCommas ? "commas" : "normal");
	},

	// this is for the "grouped" mode
	createTagglyListGrouped: function(place,title) {
		var sortBy = this.getTagglyOpt(title,"sortBy");
		var sortOrder = this.getTagglyOpt(title,"sortOrder");

		var list = store.getTaggedTiddlers(title,sortBy);

		if (sortOrder == "desc")
			list = list.reverse();

		var leftOvers = []
		for (var i=0;i<list.length;i++)
			leftOvers.push(list[i].title);

		var allTagsHolder = {};
		for (var i=0;i<list.length;i++) {
			for (var j=0;j<list[i].tags.length;j++) {

				if (list[i].tags[j] != title) { // not this tiddler

					if (this.notHidden(list[i].tags[j],title)) {

						if (!allTagsHolder[list[i].tags[j]])
							allTagsHolder[list[i].tags[j]] = "";

						if (this.notHidden(list[i],title)) {
							allTagsHolder[list[i].tags[j]] += "**[["+list[i].title+"]]"
										+ this.getTaggingCount(list[i].title) + this.getExcerpt(title,list[i].title) + "\n";

							leftOvers.setItem(list[i].title,-1); // remove from leftovers. at the end it will contain the leftovers

						}
					}
				}
			}
		}

		var allTags = [];
		for (var t in allTagsHolder)
			allTags.push(t);

		var sortHelper = function(a,b) {
			if (a == b) return 0;
			if (a < b) return -1;
			return 1;
		};

		allTags.sort(function(a,b) {
			var tidA = store.getTiddler(a);
			var tidB = store.getTiddler(b);
			if (sortBy == "title") return sortHelper(a,b);
			else if (!tidA && !tidB) return 0;
			else if (!tidA) return -1;
			else if (!tidB) return +1;
			else return sortHelper(tidA[sortBy],tidB[sortBy]);
		});

		var leftOverOutput = "";
		for (var i=0;i<leftOvers.length;i++)
			if (this.notHidden(leftOvers[i],title))
				leftOverOutput += "*[["+leftOvers[i]+"]]" + this.getTaggingCount(leftOvers[i]) + this.getExcerpt(title,leftOvers[i]) + "\n";

		var output = [];

		if (sortOrder == "desc")
			allTags.reverse();
		else if (leftOverOutput != "")
			// leftovers first...
			output.push(leftOverOutput);

		for (var i=0;i<allTags.length;i++)
			if (allTagsHolder[allTags[i]] != "")
				output.push("*[["+allTags[i]+"]]" + this.getTaggingCount(allTags[i]) + this.getExcerpt(title,allTags[i]) + "\n" + allTagsHolder[allTags[i]]);

		if (sortOrder == "desc" && leftOverOutput != "")
			// leftovers last...
			output.push(leftOverOutput);

		return this.drawTable(place,
				this.makeColumns(output,parseInt(this.getTagglyOpt(title,"numCols"))),
				"grouped");

	},

	// used to build site map
	treeTraverse: function(title,depth,sortBy,sortOrder) {

		var list = store.getTaggedTiddlers(title,sortBy);
		if (sortOrder == "desc")
			list.reverse();

		var indent = "";
		for (var j=0;j<depth;j++)
			indent += "*"

		var childOutput = "";
		for (var i=0;i<list.length;i++)
			if (list[i].title != title)
				if (this.notHidden(list[i].title,this.config.inTiddler))
					childOutput += this.treeTraverse(list[i].title,depth+1,sortBy,sortOrder);

		if (depth == 0)
			return childOutput;
		else
			return indent + "[["+title+"]]" + this.getTaggingCount(title) + this.getExcerpt(this.config.inTiddler,title,depth) + "\n" + childOutput;
	},

	// this if for the site map mode
	createTagglyListSiteMap: function(place,title) {
		this.config.inTiddler = title; // nasty. should pass it in to traverse probably
		var output = this.treeTraverse(title,0,this.getTagglyOpt(title,"sortBy"),this.getTagglyOpt(title,"sortOrder"));
		return this.drawTable(place,
				this.makeColumns(output.split(/(?=^\*\[)/m),parseInt(this.getTagglyOpt(title,"numCols"))), // regexp magic
				"sitemap"
				);
	},

	macros: {
		tagglyTagging: {
			handler: function (place,macroName,params,wikifier,paramString,tiddler) {
				var refreshContainer = createTiddlyElement(place,"div");
				// do some refresh magic to make it keep the list fresh - thanks Saq
				refreshContainer.setAttribute("refresh","macro");
				refreshContainer.setAttribute("macroName",macroName);
        			refreshContainer.setAttribute("title",tiddler.title);
				this.refresh(refreshContainer);
			},

			refresh: function(place) {
				var title = place.getAttribute("title");
				removeChildren(place);
				if (store.getTaggedTiddlers(title).length > 0) {
					var lingo = config.taggly.lingo;
					config.taggly.createListControl(place,title,"hideState");
					if (config.taggly.getTagglyOpt(title,"hideState") == "show") {
						createTiddlyElement(place,"span",null,"tagglyLabel",lingo.labels.label.format([title]));
						config.taggly.createListControl(place,title,"title");
						config.taggly.createListControl(place,title,"modified");
						config.taggly.createListControl(place,title,"created");
						config.taggly.createListControl(place,title,"listMode");
						config.taggly.createListControl(place,title,"excerpts");
						config.taggly.createListControl(place,title,"numCols");
						config.taggly.createTagglyList(place,title);
					}
				}
			}
		}
	},

	// todo fix these up a bit
	styles: [
"/*{{{*/",
"/* created by TagglyTaggingPlugin */",
".tagglyTagging { padding-top:0.5em; }",
".tagglyTagging li.listTitle { display:none; }",
".tagglyTagging ul {",
"	margin-top:0px; padding-top:0.5em; padding-left:2em;",
"	margin-bottom:0px; padding-bottom:0px;",
"}",
".tagglyTagging { vertical-align: top; margin:0px; padding:0px; }",
".tagglyTagging table { margin:0px; padding:0px; }",
".tagglyTagging .button { visibility:hidden; margin-left:3px; margin-right:3px; }",
".tagglyTagging .button, .tagglyTagging .hidebutton {",
"	color:[[ColorPalette::TertiaryLight]]; font-size:90%;",
"	border:0px; padding-left:0.3em;padding-right:0.3em;",
"}",
".tagglyTagging .button:hover, .hidebutton:hover, ",
".tagglyTagging .button:active, .hidebutton:active  {",
"	border:0px; background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]];",
"}",
".selected .tagglyTagging .button { visibility:visible; }",
".tagglyTagging .hidebutton { color:[[ColorPalette::Background]]; }",
".selected .tagglyTagging .hidebutton { color:[[ColorPalette::TertiaryLight]] }",
".tagglyLabel { color:[[ColorPalette::TertiaryMid]]; font-size:90%; }",
".tagglyTagging ul {padding-top:0px; padding-bottom:0.5em; margin-left:1em; }",
".tagglyTagging ul ul {list-style-type:disc; margin-left:-1em;}",
".tagglyTagging ul ul li {margin-left:0.5em; }",
".editLabel { font-size:90%; padding-top:0.5em; }",
".tagglyTagging .commas { padding-left:1.8em; }",
"/* not technically tagglytagging but will put them here anyway */",
".tagglyTagged li.listTitle { display:none; }",
".tagglyTagged li { display: inline; font-size:90%; }",
".tagglyTagged ul { margin:0px; padding:0px; }",
".excerpt { color:[[ColorPalette::TertiaryDark]]; }",
"div.tagglyTagging table,",
"div.tagglyTagging table tr,",
"td.tagglyTagging",
" {border-style:none!important; }",
".tagglyTagging .contents { border-bottom:2px solid [[ColorPalette::TertiaryPale]]; padding:0 1em 1em 0.5em;",
"  margin-bottom:0.5em; }",
".tagglyTagging .indent1  { margin-left:3em;  }",
".tagglyTagging .indent2  { margin-left:4em;  }",
".tagglyTagging .indent3  { margin-left:5em;  }",
".tagglyTagging .indent4  { margin-left:6em;  }",
".tagglyTagging .indent5  { margin-left:7em;  }",
".tagglyTagging .indent6  { margin-left:8em;  }",
".tagglyTagging .indent7  { margin-left:9em;  }",
".tagglyTagging .indent8  { margin-left:10em; }",
".tagglyTagging .indent9  { margin-left:11em; }",
".tagglyTagging .indent10 { margin-left:12em; }",
"/*}}}*/",
		""].join("\n"),

	init: function() {
		merge(config.macros,this.macros);
		config.shadowTiddlers["TagglyTaggingStyles"] = this.styles;
		store.addNotification("TagglyTaggingStyles",refreshStyles);
	}
};

config.taggly.init();

//}}}

/***
InlineSlidersPlugin
By Saq Imtiaz
http://tw.lewcid.org/sandbox/#InlineSlidersPlugin

// syntax adjusted to not clash with NestedSlidersPlugin

***/
//{{{
config.formatters.unshift( {
	name: "inlinesliders",
	// match: "\\+\\+\\+\\+|\\<slider",
	match: "\\<slider",
	// lookaheadRegExp: /(?:\+\+\+\+|<slider) (.*?)(?:>?)\n((?:.|\n)*?)\n(?:====|<\/slider>)/mg,
	lookaheadRegExp: /(?:<slider) (.*?)(?:>)\n((?:.|\n)*?)\n(?:<\/slider>)/mg,
	handler: function(w) {
		this.lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart ) {
			var btn = createTiddlyButton(w.output,lookaheadMatch[1] + " "+"\u00BB",lookaheadMatch[1],this.onClickSlider,"button sliderButton");
			var panel = createTiddlyElement(w.output,"div",null,"sliderPanel");
			panel.style.display = "none";
			wikify(lookaheadMatch[2],panel);
			w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
		}
   },
   onClickSlider : function(e) {
		if(!e) var e = window.event;
		var n = this.nextSibling;
		n.style.display = (n.style.display=="none") ? "block" : "none";
		return false;
	}
});

//}}}
*<<tag meta>>- describes the operation of this site
**<<tag editing>>- tips on editing and authoring notes, including all sorts of tools
**<<tag 0>>- a note that's linked to but is empty or needs editing
**<<tag system>>- control how the site operates and is layed out
***<<tag xsystemConfig>>- deactivated code
***<<tag systemNotes>>- system control notes loaded at startup, used to control content
***<<tag plugin>>- code snippets enhancing functionality, and containing descriptions of what they do
***<<tag template>>- custom css page template, used to describe layout
***<<tag folder>>- a folder is a tag is a note
**<<tag illus>>- notes containing illustrations
**<<tag slide>>- presentation slide (start note title with ".")
/***
|''Name:''|TagsTreePlugin|
|''Description:''|Displays tags hierachy as a tree of tagged tiddlers.<br>Can be used to create dynamic outline navigation.|
|''Version:''|1.0.1|
|''Date:''|Jan 04,2008|
|''Source:''|http://visualtw.ouvaton.org/VisualTW.html|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''~CoreVersion:''|2.1.0|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0|
!Demo
On the plugin [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] :
*Try to tag some <<newTiddler>> with a tag displayed in the menu and edit MainMenu.
*Look at some tags like [[Plugins]] or [[menu]].
!Installation
#import the plugin,
#save and reload,
#optionally, edit TagsTreeStyleSheet.
! Usage
{{{<<tagsTree>>}}} macro accepts the following //optional// parameters.
|!#|!parameter|!description|!by default|
|1|{{{root}}}|Uses {{{root}}} tag as tree root|- In a //tiddler// content or template : uses the tiddler as root tag.<br>- In the //page// content or template (by ex MainMenu) : displays all untagged tags.|
|2|{{{excludeTag}}}|Excludes all such tagged tiddlers from the tree|Uses default excludeLists tag|
|3|{{{level}}}|Expands nodes until level {{{level}}}.<br>Value {{{0}}} hides expand/collapse buttons.|Nodes are collapsed on first level|
|4|{{{depth}}}|Hierachy depth|6 levels depth (H1 to H6 header styles)|
|5|{{{sortField}}}|Alternate sort field. By example : "index".|Sorts tags and tiddlers alphabetically (on their title)|
|6|{{{labelField}