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]];}

#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 0em 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0em 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:0em 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 .3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}

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

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

.tiddlerPopupButton {padding:0.2em 0.2em 0.2em 0.2em;}
.popupTiddler {position: absolute; z-index:300; padding:1em 1em 1em 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 0em;}
.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 0em 0em 0.5em;}
.tab {margin:0em 0em 0em 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 0em 14em;}

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

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

.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:0em 0.25em; padding:0em 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 0em; font-size:.9em;}
.editorFooter .button {padding-top:0px; padding-bottom:0px;}

.fieldsetFix {border:0; padding:0; margin:1px 0px 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 0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0em; right:0em;}
#backstageButton a {padding:0.1em 0.4em 0.1em 0.4em; margin:0.1em 0.1em 0.1em 0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; margin:0em 3em 0em 3em; padding:1em 1em 1em 1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em 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 use a logographic writing system and 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;}

.htmlarea .toolbarHA table {border:1px solid ButtonFace; margin:0em 0em;}
/*}}}*/
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton, #backstageArea {display: none ! important;}
#displayArea {margin: 1em 1em 0em 1em;}
/* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
noscript {display:none;}
}
/*}}}*/
<!--{{{-->
<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 closeTiddler closeOthers +editTiddler > fields syncing permalink references jump'></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 +saveTiddler -cancelTiddler deleteTiddler'></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'></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
|''Type:''|file|
|''URL:''|http://dataanalysis.tiddlyspot.com/|
|''Workspace:''|(default)|

This tiddler was automatically created to record the details of this server
|''Type:''|file|
|''URL:''|http://mva.tiddlyspot.com/|
|''Workspace:''|(default)|

This tiddler was automatically created to record the details of this server
<<tabs "" [[第1組]] "" [[statpf02201001]][[第2組]] "" [[statpf02201002]][[第3組]] "" [[statpf02201003]][[第4組]] "" [[statpf02201004]][[第5組]] "" [[statpf02201005]][[第6組]] "" [[statpf02201006]][[第7組]] "" [[statpf02201007]][[第8組]] "" [[statpf02201008]][[第9組]] "" [[statpf02201009]][[第10組]] "" [[statpf02201010]][[第11組]] "" [[statpf02201011]][[第12組]] "" [[statpf02201012]]>>
<<tabs "" [[第1組]] "" [[statpf01201001]][[第2組]] "" [[statpf01201002]][[第3組]] "" [[statpf01201003]][[第4組]] "" [[statpf01201004]][[第5組]] "" [[statpf01201005]][[第6組]] "" [[statpf01201006]][[第7組]] "" [[statpf01201007]][[第8組]] "" [[statpf01201008]][[第9組]] "" [[statpf01201009]][[第10組]] "" [[statpf01201010]][[第11組]] "" [[statpf01201011]][[第12組]] "" [[statpf01201012]][[第13組]] "" [[statpf01201013]][[第14組]] "" [[statpf01201014]]>>
[[網路統計學院]]
[[MyMAP]]
/***
|Name|FontSizePlugin|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#FontSizePlugin|
|Version|1.0|
|Requires|~TW2.x|
!Description:
Resize tiddler text on the fly. The text size is remembered between sessions by use of a cookie.
You can customize the maximum and minimum allowed sizes.
(only affects tiddler content text, not any other text)

Also, you can load a TW file with a font-size specified in the url.
Eg: http://tw.lewcid.org/#font:110

!Demo:
Try using the font-size buttons in the sidebar, or in the MainMenu above.

!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.
Then put {{{<<fontSize "font-size:">>}}} in your SideBarOptions tiddler, or anywhere else that you might like.

!Usage
{{{<<fontSize>>}}} results in <<fontSize>>
{{{<<fontSize font-size: >>}}} results in <<fontSize font-size:>>

!Customizing:
The buttons and prefix text are wrapped in a span with class fontResizer, for easy css styling.
To change the default font-size, and the maximum and minimum font-size allowed, edit the config.fontSize.settings section of the code below.

!Notes:
This plugin assumes that the initial font-size is 100% and then increases or decreases the size by 10%. This stepsize of 10% can also be customized.

!History:
*27-07-06, version 1.0 : prevented double clicks from triggering editing of containing tiddler.
*25-07-06,  version 0.9

!Code
***/

//{{{
config.fontSize={};

//configuration settings
config.fontSize.settings =
{
            defaultSize : 100,  // all sizes in %
            maxSize : 200,
            minSize : 40,
            stepSize : 10
};

//startup code
var fontSettings = config.fontSize.settings;

if (!config.options.txtFontSize)
            {config.options.txtFontSize = fontSettings.defaultSize;
            saveOptionCookie("txtFontSize");}
setStylesheet(".tiddler .viewer {font-size:"+config.options.txtFontSize+"%;}\n","fontResizerStyles");
setStylesheet("#contentWrapper .fontResizer .button {display:inline;font-size:105%; font-weight:bold; margin:0 1px; padding: 0 3px; text-align:center !important;}\n .fontResizer {margin:0 0.5em;}","fontResizerButtonStyles");

//macro
config.macros.fontSize={};
config.macros.fontSize.handler = function (place,macroName,params,wikifier,paramString,tiddler)
{

               var sp = createTiddlyElement(place,"span",null,"fontResizer");
               sp.ondblclick=this.onDblClick;
               if (params[0])
                           createTiddlyText(sp,params[0]);
               createTiddlyButton(sp,"+","increase font-size",this.incFont);
               createTiddlyButton(sp,"=","reset font-size",this.resetFont);
               createTiddlyButton(sp,"–","decrease font-size",this.decFont);
}

config.macros.fontSize.onDblClick = function (e)
{
             if (!e) var e = window.event;
             e.cancelBubble = true;
             if (e.stopPropagation) e.stopPropagation();
             return false;
}

config.macros.fontSize.setFont = function ()
{
               saveOptionCookie("txtFontSize");
               setStylesheet(".tiddler .viewer {font-size:"+config.options.txtFontSize+"%;}\n","fontResizerStyles");
}

config.macros.fontSize.incFont=function()
{
               if (config.options.txtFontSize < fontSettings.maxSize)
                  config.options.txtFontSize = (config.options.txtFontSize*1)+fontSettings.stepSize;
               config.macros.fontSize.setFont();
}

config.macros.fontSize.decFont=function()
{

               if (config.options.txtFontSize > fontSettings.minSize)
                  config.options.txtFontSize = (config.options.txtFontSize*1) - fontSettings.stepSize;
               config.macros.fontSize.setFont();
}

config.macros.fontSize.resetFont=function()
{

               config.options.txtFontSize=fontSettings.defaultSize;
               config.macros.fontSize.setFont();
}

config.paramifiers.font =
{
               onstart: function(v)
                  {
                   config.options.txtFontSize = v;
                   config.macros.fontSize.setFont();
                  }
};
//}}}
/***
|Name|HoverMenuPlugin|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#HoverMenuPlugin|
|Version|1.11|
|Requires|~TW2.x|
!Description:
Provides a hovering menu on the edge of the screen for commonly used commands, that scrolls with the page.

!Demo:
Observe the hovering menu on the right edge of the screen.

!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.
To customize your HoverMenu, edit the HoverMenu shadow tiddler.

To customize whether the menu sticks to the right or left edge of the screen, and its start position, edit the HoverMenu configuration settings part of the code below. It's well documented, so don't be scared!

The menu has an id of hoverMenu, in case you want to style the buttons in it using css.

!Notes:
Since the default HoverMenu contains buttons for toggling the side bar and jumping to the top of the screen and to open tiddlers, the ToggleSideBarMacro, JumpMacro and the JumpToTopMacro are included in this tiddler, so you dont need to install them separately. Having them installed separately as well could lead to complications.

If you dont intend to use these three macros at all, feel free to remove those sections of code in this tiddler.

!To Do:
* rework code to allow multiple hovering menus in different positions, horizontal etc.
* incorporate code for keyboard shortcuts that correspond to the buttons in the hovermenu

!History:
*03-08-06, ver 1.1.2: compatibility fix with SelectThemePlugin
*03-08-06,  ver 1.11: fixed error with button tooltips
*27-07-06, ver 1.1 : added JumpMacro to hoverMenu
*23-07-06

!Code
***/

/***
start HoverMenu plugin code
***/
//{{{
config.hoverMenu={};
//}}}

/***
HoverMenu configuration settings
***/
//{{{
config.hoverMenu.settings={
               align: 'right',    //align menu to right or left side of screen, possible values are 'right' and 'left'               
               x: 1,              // horizontal distance of menu from side of screen, increase to your liking.
               y: 158            //vertical distance of menu from top of screen at start, increase or decrease to your liking
               };
//}}}

//{{{
//continue HoverMenu plugin code
config.hoverMenu.handler=function()
{              
               if (!document.getElementById("hoverMenu"))
               {
               var theMenu = createTiddlyElement(document.getElementById("contentWrapper"), "div","hoverMenu");
               theMenu.setAttribute("refresh","content");
               theMenu.setAttribute("tiddler","HoverMenu");
               var menuContent = store.getTiddlerText("HoverMenu");
               wikify(menuContent,theMenu);
              }

	       var Xloc = this.settings.x;
	       Yloc =this.settings.y;
	       var ns = (navigator.appName.indexOf("Netscape") != -1);
	       function SetMenu(id)
                        {
		        var GetElements=document.getElementById?document.getElementById(id):document.all?document.all[id]:document.layers[id];
		        if(document.layers)GetElements.style=GetElements;
		        GetElements.sP=function(x,y){this.style[config.hoverMenu.settings.align]=x +"px";this.style.top=y +"px";};
		        GetElements.x = Xloc;
		        GetElements.y = findScrollY();
		        GetElements.y += Yloc;
		        return GetElements;
	                }
               window.LoCate_XY=function()
                        {
		        var pY =  findScrollY();
                        ftlObj.y += (pY + Yloc - ftlObj.y)/15;
		        ftlObj.sP(ftlObj.x, ftlObj.y);
		        setTimeout("LoCate_XY()", 10);
	                }
               ftlObj = SetMenu("hoverMenu");
	       LoCate_XY();
};

window.old_lewcid_hovermenu_restart = restart;
restart = function()
{
               window.old_lewcid_hovermenu_restart();
               config.hoverMenu.handler();
};

setStylesheet(
"#hoverMenu .imgLink, #hoverMenu .imgLink:hover {border:none; padding:0px; float:right; margin-bottom:2px; margin-top:0px;}\n"+
"#hoverMenu  .button, #hoverMenu  .tiddlyLink {border:none; font-weight:bold; background:#18f; color:#FFF; padding:0 5px; float:right; margin-bottom:4px;}\n"+
"#hoverMenu .button:hover, #hoverMenu .tiddlyLink:hover {font-weight:bold; border:none; color:#fff; background:#000; padding:0 5px; float:right; margin-bottom:4px;}\n"+
"#hoverMenu .button {width:100%; text-align:center}"+
"#hoverMenu { position:absolute; width:7px;}\n"+
"\n","hoverMenuStyles");


config.macros.renameButton={};
config.macros.renameButton.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{

               if (place.lastChild.tagName!="BR")
                     {
                      place.lastChild.firstChild.data = params[0];
                      if (params[1]) {place.lastChild.title = params[1];}
                     }
};

config.shadowTiddlers["HoverMenu"]="<<top>>\n<<toggleSideBar>><<renameButton '>' >>\n<<jump j '' top>>\n<<saveChanges>><<renameButton s 'Save TiddlyWiki'>>\n<<newTiddler>><<renameButton n>>\n";
//}}}
//end HoverMenu plugin code

//Start ToggleSideBarMacro code
//{{{
config.macros.toggleSideBar={};

config.macros.toggleSideBar.settings={
         styleHide :  "#sidebar { display: none;}\n"+"#contentWrapper #displayArea { margin-right: 1em;}\n"+"",
         styleShow : " ",
         arrow1: "«",
         arrow2: "»"
};

config.macros.toggleSideBar.handler=function (place,macroName,params,wikifier,paramString,tiddler)
{
          var tooltip= params[1]||'toggle sidebar';
          var mode = (params[2] && params[2]=="hide")? "hide":"show";
          var arrow = (mode == "hide")? this.settings.arrow1:this.settings.arrow2;
          var label= (params[0]&&params[0]!='.')?params[0]+" "+arrow:arrow;
          var theBtn = createTiddlyButton(place,label,tooltip,this.onToggleSideBar,"button HideSideBarButton");
          if (mode == "hide")
             { 
             (document.getElementById("sidebar")).setAttribute("toggle","hide");
              setStylesheet(this.settings.styleHide,"ToggleSideBarStyles");
             }
};

config.macros.toggleSideBar.onToggleSideBar = function(){
          var sidebar = document.getElementById("sidebar");
          var settings = config.macros.toggleSideBar.settings;
          if (sidebar.getAttribute("toggle")=='hide')
             {
              setStylesheet(settings.styleShow,"ToggleSideBarStyles");
              sidebar.setAttribute("toggle","show");
              this.firstChild.data= (this.firstChild.data).replace(settings.arrow1,settings.arrow2);
              }
          else
              {    
               setStylesheet(settings.styleHide,"ToggleSideBarStyles");
               sidebar.setAttribute("toggle","hide");
               this.firstChild.data= (this.firstChild.data).replace(settings.arrow2,settings.arrow1);
              }

     return false;
}

setStylesheet(".HideSideBarButton .button {font-weight:bold; padding: 0 5px;}\n","ToggleSideBarButtonStyles");
//}}}
//end ToggleSideBarMacro code

//start JumpToTopMacro code
//{{{
config.macros.top={};
config.macros.top.handler=function(place,macroName)
{
               createTiddlyButton(place,"^","jump to top",this.onclick);
}
config.macros.top.onclick=function()
{
               window.scrollTo(0,0);
};

config.commands.top =
{
               text:" ^ ",
               tooltip:"jump to top"
};

config.commands.top.handler = function(event,src,title)
{
               window.scrollTo(0,0);
}
//}}}
//end JumpToStartMacro code

//start JumpMacro code
//{{{
config.macros.jump= {};
config.macros.jump.handler = function (place,macroName,params,wikifier,paramString,tiddler)
{
        var label = (params[0] && params[0]!=".")? params[0]: 'jump';
        var tooltip = (params[1] && params[1]!=".")? params[1]: 'jump to an open tiddler';
        var top = (params[2] && params[2]=='top') ? true: false;        

        var btn =createTiddlyButton(place,label,tooltip,this.onclick);
        if (top==true)
              btn.setAttribute("top","true")
}

config.macros.jump.onclick = function(e)
{
        if (!e) var e = window.event;
        var theTarget = resolveTarget(e);
        var top = theTarget.getAttribute("top");
	var popup = Popup.create(this);
	if(popup)
		{
                 if(top=="true")
                                {createTiddlyButton(createTiddlyElement(popup,"li"),'Top ↑','Top of TW',config.macros.jump.top);
                                 createTiddlyElement(popup,"hr");}
		
		story.forEachTiddler(function(title,element) {
			createTiddlyLink(createTiddlyElement(popup,"li"),title,true);
			});
                }
	Popup.show(popup,false);
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
	return false;
}

config.macros.jump.top = function()
{
       window.scrollTo(0,0);
}
//}}}
//end JumpMacro code

//utility functions
//{{{
Popup.show = function(unused,slowly)
{
	var curr = Popup.stack[Popup.stack.length-1];
	var rootLeft = findPosX(curr.root);
	var rootTop = findPosY(curr.root);
	var rootHeight = curr.root.offsetHeight;
	var popupLeft = rootLeft;
	var popupTop = rootTop + rootHeight;
	var popupWidth = curr.popup.offsetWidth;
	var winWidth = findWindowWidth();
        if (isChild(curr.root,'hoverMenu'))
              var x = config.hoverMenu.settings.x;
        else
              var x = 0;
	if(popupLeft + popupWidth+x > winWidth)
		popupLeft = winWidth - popupWidth -x;
        if (isChild(curr.root,'hoverMenu'))
  	        {curr.popup.style.right = x + "px";}
        else
                curr.popup.style.left = popupLeft + "px";
	curr.popup.style.top = popupTop + "px";
	curr.popup.style.display = "block";
	addClass(curr.root,"highlight");
	if(config.options.chkAnimate)
		anim.startAnimating(new Scroller(curr.popup,slowly));
	else
		window.scrollTo(0,ensureVisible(curr.popup));
}

window.isChild = function(e,parentId) {
        while (e != null) {
                var parent = document.getElementById(parentId);
                if (parent == e) return true;
                e = e.parentNode;
                }
        return false;
};
//}}}


/***
|''Name:''|LoadRemoteFileThroughProxy (previous LoadRemoteFileHijack)|
|''Description:''|When the TiddlyWiki file is located on the web (view over http) the content of [[SiteProxy]] tiddler is added in front of the file url. If [[SiteProxy]] does not exist "/proxy/" is added. |
|''Version:''|1.1.0|
|''Date:''|mar 17, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#LoadRemoteFileHijack|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0|
***/
//{{{
version.extensions.LoadRemoteFileThroughProxy = {
 major: 1, minor: 1, revision: 0, 
 date: new Date("mar 17, 2007"), 
 source: "http://tiddlywiki.bidix.info/#LoadRemoteFileThroughProxy"};

if (!window.bidix) window.bidix = {}; // bidix namespace
if (!bidix.core) bidix.core = {};

bidix.core.loadRemoteFile = loadRemoteFile;
loadRemoteFile = function(url,callback,params)
{
 if ((document.location.toString().substr(0,4) == "http") && (url.substr(0,4) == "http")){ 
  url = store.getTiddlerText("SiteProxy", "/proxy/") + url;
 }
 return bidix.core.loadRemoteFile(url,callback,params);
}
//}}}
[[選讀書單|選讀書單]]
[[報告報告|報告報告]]
[[讀書會部落格基本內容|讀書會部落格基本內容]]
[[樣板TiddlyWiki|http://exfcuxx.tiddlyspot.com/]]
[[地球上其他人的創意|http://tiddlyspot.com/?page=gallery]]
----
[[單變量的故事:首部曲|http://singlevar.tiddlyspot.com/]]
[[單變量的故事:續曲|http://singlevar.tiddlyspot.com/]]
----
[[機率|http://prob.tiddlyspot.com/]]
[[隨機變數|http://randomvar.tiddlyspot.com/]]
[[常態分配|http://normal.tiddlyspot.com/]]
[[數據|http://varanddata.tiddlyspot.com/]]
[[點估計與中央極限定理|http://clt.tiddlyspot.com/]]
----
[[點估計與信賴區間|http://estimation.tiddlyspot.com/]]
[[假設檢定|http://hypothesis.tiddlyspot.com/]]
[[雙變量的故事|http://doublevar.tiddlyspot.com/]]
[[多變量的故事|http://mva.tiddlyspot.com/]]
----
[[考古題]]
[[意義深遠的小故事]]
----
[[DASL|http://lib.stat.cmu.edu/DASL/]]
[[看卡通學統計|http://cartoonstat.tiddlyspot.com/]]
[[圖書館統計研習營|http://presentstat.tiddlyspot.com/]]
[[TiddlyWiki講座|http://exp.tiddlyspot.com/]]
[[逢甲大學BB|http://bb.fcu.edu.tw/]]
----
[[2010年畢業之財稅甲班|2010年畢業之財稅甲班]]
[[2010年畢業之財稅乙班|2010年畢業之財稅乙班]]
----
&copy;
<html><div align="center"><br><a href="http://www.maploco.com/view.php?id=2241666"><img border=0 src="http://www.maploco.com/vmap/2241666.png" alt="Visitor Map"></a><br><a href="http://www.maploco.com/">Create your own visitor map!</a><br></div></html>
/***
|Name|NestedSlidersPlugin|
|Source|http://www.TiddlyTools.com/#NestedSlidersPlugin|
|Documentation|http://www.TiddlyTools.com/#NestedSlidersPluginInfo|
|Version|2.3.4|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|show content in nest-able sliding/floating panels, without creating separate tiddlers for each panel's content|
This plugin adds new wiki syntax for embedding 'slider' panels directly into tiddler content.  
!!!!!Documentation
>see [[NestedSlidersPluginInfo]]
!!!!!Configuration
<<<
Enable animation for slider panels
<<option chkFloatingSlidersAnimate>> allow sliders to animate when opening/closing
>(note: This setting is in //addition// to the general option for enabling/disabling animation effects:
><<option chkAnimate>> enable animations (entire document)
>For slider animation to occur, you must also allow animation in general.

Debugging messages for 'lazy sliders' deferred rendering:
<<option chkDebugLazySliderDefer>> show debugging alert when deferring slider rendering
<<option chkDebugLazySliderRender>> show debugging alert when deferred slider is actually rendered
<<<
!!!!!Revisions
<<<
2008.01.08 - [*.*.*] plugin size reduction: documentation moved to ...Info tiddler
2007.12.28 - 2.3.4 added hijack for Animator.prototype.startAnimating().  Previously, the plugin code simply set the overflow to "visible" after animation.  This code tweak corrects handling of elements that were styled with overflow=hidden/auto/scroll before animation by saving the overflow style and then restoring it after animation has completed.
|please see [[NestedSlidersPluginInfo]] for additional revision details|
2005.11.03 - 1.0.0 initial public release.  Thanks to RodneyGomes, GeoffSlocock, and PaulPetterson for suggestions and experiments.
<<<
!!!!!Code
***/
//{{{
version.extensions.nestedSliders = {major: 2, minor: 3, revision: 4, date: new Date(2007,12,28)};
//}}}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// TW2.2+
// hijack start/stop handlers so overflow style is saved and restored after animation has completed
if (version.major+.1*version.minor+.01*version.revision>=2.2) {
/**
	Animator.prototype.core_startAnimating = Animator.prototype.startAnimating;
	Animator.prototype.startAnimating = function() {
		for(var t=0; t<arguments.length; t++)
			arguments[t].element.save_overflow=arguments[t].element.style.overflow;
		return this.core_startAnimating.apply(this,arguments);
	};
**/
	Morpher.prototype.coreStop = Morpher.prototype.stop;
	Morpher.prototype.stop = function() {
		this.coreStop.apply(this,arguments);
		this.element.style.overflow = this.element.save_overflow||"visible";
	};
}
//}}}
// 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();
    }
}
a reusable non-linear personal web notebook, <<today>>, (<<version>>), 榮彬爸爸網路統計學元年<<fontSize "">>
~MySTATistics
/***
Contains the stuff you need to use Tiddlyspot
Note you must also have UploadPlugin installed
***/
//{{{

// edit this if you are migrating sites or retrofitting an existing TW
config.tiddlyspotSiteId = 'stat';

// make it so you can by default see edit controls via http
config.options.chkHttpReadOnly = false;
window.readOnly = false; // make sure of it (for tw 2.2)

// disable autosave in d3
if (window.location.protocol != "file:")
	config.options.chkGTDLazyAutoSave = false;

// tweak shadow tiddlers to add upload button, password entry box etc
with (config.shadowTiddlers) {
	SiteUrl = 'http://'+config.tiddlyspotSiteId+'.tiddlyspot.com';
	SideBarOptions = SideBarOptions.replace(/(<<saveChanges>>)/,"$1<<tiddler TspotSidebar>>");
	OptionsPanel = OptionsPanel.replace(/^/,"<<tiddler TspotOptions>>");
	DefaultTiddlers = DefaultTiddlers.replace(/^/,"[[WelcomeToTiddlyspot]] ");
	MainMenu = MainMenu.replace(/^/,"[[WelcomeToTiddlyspot]] ");
}

// create some shadow tiddler content
merge(config.shadowTiddlers,{

'WelcomeToTiddlyspot':[
 "This document is a ~TiddlyWiki from tiddlyspot.com.  A ~TiddlyWiki is an electronic notebook that is great for managing todo lists, personal information, and all sorts of things.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //What now?// &nbsp;&nbsp;@@ Before you can save any changes, you need to enter your password in the form below.  Then configure privacy and other site settings at your [[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]] (your control panel username is //" + config.tiddlyspotSiteId + "//).",
 "<<tiddler TspotControls>>",
 "See also GettingStarted.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Working online// &nbsp;&nbsp;@@ You can edit this ~TiddlyWiki right now, and save your changes using the \"save to web\" button in the column on the right.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Working offline// &nbsp;&nbsp;@@ A fully functioning copy of this ~TiddlyWiki can be saved onto your hard drive or USB stick.  You can make changes and save them locally without being connected to the Internet.  When you're ready to sync up again, just click \"upload\" and your ~TiddlyWiki will be saved back to tiddlyspot.com.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Help!// &nbsp;&nbsp;@@ Find out more about ~TiddlyWiki at [[TiddlyWiki.com|http://tiddlywiki.com]].  Also visit [[TiddlyWiki Guides|http://tiddlywikiguides.org]] for documentation on learning and using ~TiddlyWiki. New users are especially welcome on the [[TiddlyWiki mailing list|http://groups.google.com/group/TiddlyWiki]], which is an excellent place to ask questions and get help.  If you have a tiddlyspot related problem email [[tiddlyspot support|mailto:support@tiddlyspot.com]].",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Enjoy :)// &nbsp;&nbsp;@@ We hope you like using your tiddlyspot.com site.  Please email [[feedback@tiddlyspot.com|mailto:feedback@tiddlyspot.com]] with any comments or suggestions."
].join("\n"),

'TspotControls':[
 "| tiddlyspot password:|<<option pasUploadPassword>>|",
 "| site management:|<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . .  " + config.tiddlyspotSiteId + ">>//(requires tiddlyspot password)//<<br>>[[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]], [[download (go offline)|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download]]|",
 "| links:|[[tiddlyspot.com|http://tiddlyspot.com/]], [[FAQs|http://faq.tiddlyspot.com/]], [[announcements|http://announce.tiddlyspot.com/]], [[blog|http://tiddlyspot.com/blog/]], email [[support|mailto:support@tiddlyspot.com]] & [[feedback|mailto:feedback@tiddlyspot.com]], [[donate|http://tiddlyspot.com/?page=donate]]|"
].join("\n"),

'TspotSidebar':[
 "<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . .  " + config.tiddlyspotSiteId + ">><html><a href='http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download' class='button'>download</a></html>"
].join("\n"),

'TspotOptions':[
 "tiddlyspot password:",
 "<<option pasUploadPassword>>",
 ""
].join("\n")

});
//}}}
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |
| 25/04/2008 10:25:59 | YourName | [[/|http://stat.tiddlyspot.com/]] | [[store.cgi|http://stat.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stat.tiddlyspot.com/index.html]] | . | ok |
| 25/04/2008 10:30:23 | YourName | [[/|http://stat.tiddlyspot.com/]] | [[store.cgi|http://stat.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stat.tiddlyspot.com/index.html]] | . | ok |
| 25/04/2008 10:31:27 | YourName | [[/|http://stat.tiddlyspot.com/]] | [[store.cgi|http://stat.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stat.tiddlyspot.com/index.html]] | . |
| 14/05/2008 10:24:03 | YourName | [[/|http://stat.tiddlyspot.com/]] | [[store.cgi|http://stat.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stat.tiddlyspot.com/index.html]] | . |
| 14/05/2008 10:53:07 | YourName | [[/|http://stat.tiddlyspot.com/]] | [[store.cgi|http://stat.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stat.tiddlyspot.com/index.html]] | . | ok |
| 14/05/2008 11:27:29 | YourName | [[/|http://stat.tiddlyspot.com/]] | [[store.cgi|http://stat.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stat.tiddlyspot.com/index.html]] | . |
| 14/05/2008 17:18:35 | 吳榮彬 | [[/|http://stat.tiddlyspot.com/]] | [[store.cgi|http://stat.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stat.tiddlyspot.com/index.html]] | . |
| 22/05/2008 08:02:49 | 吳榮彬 | [[/|http://stat.tiddlyspot.com/]] | [[store.cgi|http://stat.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stat.tiddlyspot.com/index.html]] | . | ok |
| 22/05/2008 08:06:04 | 吳榮彬 | [[/|http://stat.tiddlyspot.com/]] | [[store.cgi|http://stat.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stat.tiddlyspot.com/index.html]] | . | ok |
| 22/05/2008 10:38:02 | 吳榮彬 | [[/|http://stat.tiddlyspot.com/]] | [[store.cgi|http://stat.tiddlyspot.com/store.cgi]] | . | [[index.html | http://stat.tiddlyspot.com/index.html]] | . |
/***
|''Name:''|PasswordOptionPlugin|
|''Description:''|Extends TiddlyWiki options with non encrypted password option.|
|''Version:''|1.0.2|
|''Date:''|Apr 19, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#PasswordOptionPlugin|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0 (Beta 5)|
***/
//{{{
version.extensions.PasswordOptionPlugin = {
	major: 1, minor: 0, revision: 2, 
	date: new Date("Apr 19, 2007"),
	source: 'http://tiddlywiki.bidix.info/#PasswordOptionPlugin',
	author: 'BidiX (BidiX (at) bidix (dot) info',
	license: '[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D]]',
	coreVersion: '2.2.0 (Beta 5)'
};

config.macros.option.passwordCheckboxLabel = "Save this password on this computer";
config.macros.option.passwordInputType = "password"; // password | text
setStylesheet(".pasOptionInput {width: 11em;}\n","passwordInputTypeStyle");

merge(config.macros.option.types, {
	'pas': {
		elementType: "input",
		valueField: "value",
		eventName: "onkeyup",
		className: "pasOptionInput",
		typeValue: config.macros.option.passwordInputType,
		create: function(place,type,opt,className,desc) {
			// password field
			config.macros.option.genericCreate(place,'pas',opt,className,desc);
			// checkbox linked with this password "save this password on this computer"
			config.macros.option.genericCreate(place,'chk','chk'+opt,className,desc);			
			// text savePasswordCheckboxLabel
			place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));
		},
		onChange: config.macros.option.genericOnChange
	}
});

merge(config.optionHandlers['chk'], {
	get: function(name) {
		// is there an option linked with this chk ?
		var opt = name.substr(3);
		if (config.options[opt]) 
			saveOptionCookie(opt);
		return config.options[name] ? "true" : "false";
	}
});

merge(config.optionHandlers, {
	'pas': {
 		get: function(name) {
			if (config.options["chk"+name]) {
				return encodeCookie(config.options[name].toString());
			} else {
				return "";
			}
		},
		set: function(name,value) {config.options[name] = decodeCookie(value);}
	}
});

// need to reload options to load passwordOptions
loadOptionsCookie();

/*
if (!config.options['pasPassword'])
	config.options['pasPassword'] = '';

merge(config.optionsDesc,{
		pasPassword: "Test password"
	});
*/
//}}}

/***
|''Name:''|UploadPlugin|
|''Description:''|Save to web a TiddlyWiki|
|''Version:''|4.1.0|
|''Date:''|May 5, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#UploadPlugin|
|''Documentation:''|http://tiddlywiki.bidix.info/#UploadPluginDoc|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0 (#3125)|
|''Requires:''|PasswordOptionPlugin|
***/
//{{{
version.extensions.UploadPlugin = {
	major: 4, minor: 1, revision: 0,
	date: new Date("May 5, 2007"),
	source: 'http://tiddlywiki.bidix.info/#UploadPlugin',
	author: 'BidiX (BidiX (at) bidix (dot) info',
	coreVersion: '2.2.0 (#3125)'
};

//
// Environment
//

if (!window.bidix) window.bidix = {}; // bidix namespace
bidix.debugMode = false;	// true to activate both in Plugin and UploadService
	
//
// Upload Macro
//

config.macros.upload = {
// default values
	defaultBackupDir: '',	//no backup
	defaultStoreScript: "store.php",
	defaultToFilename: "index.html",
	defaultUploadDir: ".",
	authenticateUser: true	// UploadService Authenticate User
};
	
config.macros.upload.label = {
	promptOption: "Save and Upload this TiddlyWiki with UploadOptions",
	promptParamMacro: "Save and Upload this TiddlyWiki in %0",
	saveLabel: "save to web", 
	saveToDisk: "save to disk",
	uploadLabel: "upload"	
};

config.macros.upload.messages = {
	noStoreUrl: "No store URL in parmeters or options",
	usernameOrPasswordMissing: "Username or password missing"
};

config.macros.upload.handler = function(place,macroName,params) {
	if (readOnly)
		return;
	var label;
	if (document.location.toString().substr(0,4) == "http") 
		label = this.label.saveLabel;
	else
		label = this.label.uploadLabel;
	var prompt;
	if (params[0]) {
		prompt = this.label.promptParamMacro.toString().format([this.destFile(params[0], 
			(params[1] ? params[1]:bidix.basename(window.location.toString())), params[3])]);
	} else {
		prompt = this.label.promptOption;
	}
	createTiddlyButton(place, label, prompt, function() {config.macros.upload.action(params);}, null, null, this.accessKey);
};

config.macros.upload.action = function(params)
{
		// for missing macro parameter set value from options
		var storeUrl = params[0] ? params[0] : config.options.txtUploadStoreUrl;
		var toFilename = params[1] ? params[1] : config.options.txtUploadFilename;
		var backupDir = params[2] ? params[2] : config.options.txtUploadBackupDir;
		var uploadDir = params[3] ? params[3] : config.options.txtUploadDir;
		var username = params[4] ? params[4] : config.options.txtUploadUserName;
		var password = config.options.pasUploadPassword; // for security reason no password as macro parameter	
		// for still missing parameter set default value
		if ((!storeUrl) && (document.location.toString().substr(0,4) == "http")) 
			storeUrl = bidix.dirname(document.location.toString())+'/'+config.macros.upload.defaultStoreScript;
		if (storeUrl.substr(0,4) != "http")
			storeUrl = bidix.dirname(document.location.toString()) +'/'+ storeUrl;
		if (!toFilename)
			toFilename = bidix.basename(window.location.toString());
		if (!toFilename)
			toFilename = config.macros.upload.defaultToFilename;
		if (!uploadDir)
			uploadDir = config.macros.upload.defaultUploadDir;
		if (!backupDir)
			backupDir = config.macros.upload.defaultBackupDir;
		// report error if still missing
		if (!storeUrl) {
			alert(config.macros.upload.messages.noStoreUrl);
			clearMessage();
			return false;
		}
		if (config.macros.upload.authenticateUser && (!username || !password)) {
			alert(config.macros.upload.messages.usernameOrPasswordMissing);
			clearMessage();
			return false;
		}
		bidix.upload.uploadChanges(false,null,storeUrl, toFilename, uploadDir, backupDir, username, password); 
		return false; 
};

config.macros.upload.destFile = function(storeUrl, toFilename, uploadDir) 
{
	if (!storeUrl)
		return null;
		var dest = bidix.dirname(storeUrl);
		if (uploadDir && uploadDir != '.')
			dest = dest + '/' + uploadDir;
		dest = dest + '/' + toFilename;
	return dest;
};

//
// uploadOptions Macro
//

config.macros.uploadOptions = {
	handler: function(place,macroName,params) {
		var wizard = new Wizard();
		wizard.createWizard(place,this.wizardTitle);
		wizard.addStep(this.step1Title,this.step1Html);
		var markList = wizard.getElement("markList");
		var listWrapper = document.createElement("div");
		markList.parentNode.insertBefore(listWrapper,markList);
		wizard.setValue("listWrapper",listWrapper);
		this.refreshOptions(listWrapper,false);
		var uploadCaption;
		if (document.location.toString().substr(0,4) == "http") 
			uploadCaption = config.macros.upload.label.saveLabel;
		else
			uploadCaption = config.macros.upload.label.uploadLabel;
		
		wizard.setButtons([
				{caption: uploadCaption, tooltip: config.macros.upload.label.promptOption, 
					onClick: config.macros.upload.action},
				{caption: this.cancelButton, tooltip: this.cancelButtonPrompt, onClick: this.onCancel}
				
			]);
	},
	refreshOptions: function(listWrapper) {
		var uploadOpts = [
			"txtUploadUserName",
			"pasUploadPassword",
			"txtUploadStoreUrl",
			"txtUploadDir",
			"txtUploadFilename",
			"txtUploadBackupDir",
			"chkUploadLog",
			"txtUploadLogMaxLine",
			]
		var opts = [];
		for(i=0; i<uploadOpts.length; i++) {
			var opt = {};
			opts.push()
			opt.option = "";
			n = uploadOpts[i];
			opt.name = n;
			opt.lowlight = !config.optionsDesc[n];
			opt.description = opt.lowlight ? this.unknownDescription : config.optionsDesc[n];
			opts.push(opt);
		}
		var listview = ListView.create(listWrapper,opts,this.listViewTemplate);
		for(n=0; n<opts.length; n++) {
			var type = opts[n].name.substr(0,3);
			var h = config.macros.option.types[type];
			if (h && h.create) {
				h.create(opts[n].colElements['option'],type,opts[n].name,opts[n].name,"no");
			}
		}
		
	},
	onCancel: function(e)
	{
		backstage.switchTab(null);
		return false;
	},
	
	wizardTitle: "Upload with options",
	step1Title: "These options are saved in cookies in your browser",
	step1Html: "<input type='hidden' name='markList'></input><br>",
	cancelButton: "Cancel",
	cancelButtonPrompt: "Cancel prompt",
	listViewTemplate: {
		columns: [
			{name: 'Description', field: 'description', title: "Description", type: 'WikiText'},
			{name: 'Option', field: 'option', title: "Option", type: 'String'},
			{name: 'Name', field: 'name', title: "Name", type: 'String'}
			],
		rowClasses: [
			{className: 'lowlight', field: 'lowlight'} 
			]}
}

//
// upload functions
//

if (!bidix.upload) bidix.upload = {};

if (!bidix.upload.messages) bidix.upload.messages = {
	//from saving
	invalidFileError: "The original file '%0' does not appear to be a valid TiddlyWiki",
	backupSaved: "Backup saved",
	backupFailed: "Failed to upload backup file",
	rssSaved: "RSS feed uploaded",
	rssFailed: "Failed to upload RSS feed file",
	emptySaved: "Empty template uploaded",
	emptyFailed: "Failed to upload empty template file",
	mainSaved: "Main TiddlyWiki file uploaded",
	mainFailed: "Failed to upload main TiddlyWiki file. Your changes have not been saved",
	//specific upload
	loadOriginalHttpPostError: "Can't get original file",
	aboutToSaveOnHttpPost: 'About to upload on %0 ...',
	storePhpNotFound: "The store script '%0' was not found."
};

bidix.upload.uploadChanges = function(onlyIfDirty,tiddlers,storeUrl,toFilename,uploadDir,backupDir,username,password)
{
	var callback = function(status,uploadParams,original,url,xhr) {
		if (!status) {
			displayMessage(bidix.upload.messages.loadOriginalHttpPostError);
			return;
		}
		if (bidix.debugMode) 
			alert(original.substr(0,500)+"\n...");
		// Locate the storeArea div's 
		var posDiv = locateStoreArea(original);
		if((posDiv[0] == -1) || (posDiv[1] == -1)) {
			alert(config.messages.invalidFileError.format([localPath]));
			return;
		}
		bidix.upload.uploadRss(uploadParams,original,posDiv);
	};
	
	if(onlyIfDirty && !store.isDirty())
		return;
	clearMessage();
	// save on localdisk ?
	if (document.location.toString().substr(0,4) == "file") {
		var path = document.location.toString();
		var localPath = getLocalPath(path);
		saveChanges();
	}
	// get original
	var uploadParams = Array(storeUrl,toFilename,uploadDir,backupDir,username,password);
	var originalPath = document.location.toString();
	// If url is a directory : add index.html
	if (originalPath.charAt(originalPath.length-1) == "/")
		originalPath = originalPath + "index.html";
	var dest = config.macros.upload.destFile(storeUrl,toFilename,uploadDir);
	var log = new bidix.UploadLog();
	log.startUpload(storeUrl, dest, uploadDir,  backupDir);
	displayMessage(bidix.upload.messages.aboutToSaveOnHttpPost.format([dest]));
	if (bidix.debugMode) 
		alert("about to execute Http - GET on "+originalPath);
	var r = doHttp("GET",originalPath,null,null,null,null,callback,uploadParams,null);
	if (typeof r == "string")
		displayMessage(r);
	return r;
};

bidix.upload.uploadRss = function(uploadParams,original,posDiv) 
{
	var callback = function(status,params,responseText,url,xhr) {
		if(status) {
			var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
			displayMessage(bidix.upload.messages.rssSaved,bidix.dirname(url)+'/'+destfile);
			bidix.upload.uploadMain(params[0],params[1],params[2]);
		} else {
			displayMessage(bidix.upload.messages.rssFailed);			
		}
	};
	// do uploadRss
	if(config.options.chkGenerateAnRssFeed) {
		var rssPath = uploadParams[1].substr(0,uploadParams[1].lastIndexOf(".")) + ".xml";
		var rssUploadParams = Array(uploadParams[0],rssPath,uploadParams[2],'',uploadParams[4],uploadParams[5]);
		bidix.upload.httpUpload(rssUploadParams,convertUnicodeToUTF8(generateRss()),callback,Array(uploadParams,original,posDiv));
	} else {
		bidix.upload.uploadMain(uploadParams,original,posDiv);
	}
};

bidix.upload.uploadMain = function(uploadParams,original,posDiv) 
{
	var callback = function(status,params,responseText,url,xhr) {
		var log = new bidix.UploadLog();
		if(status) {
			// if backupDir specified
			if ((params[3]) && (responseText.indexOf("backupfile:") > -1))  {
				var backupfile = responseText.substring(responseText.indexOf("backupfile:")+11,responseText.indexOf("\n", responseText.indexOf("backupfile:")));
				displayMessage(bidix.upload.messages.backupSaved,bidix.dirname(url)+'/'+backupfile);
			}
			var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
			displayMessage(bidix.upload.messages.mainSaved,bidix.dirname(url)+'/'+destfile);
			store.setDirty(false);
			log.endUpload("ok");
		} else {
			alert(bidix.upload.messages.mainFailed);
			displayMessage(bidix.upload.messages.mainFailed);
			log.endUpload("failed");			
		}
	};
	// do uploadMain
	var revised = bidix.upload.updateOriginal(original,posDiv);
	bidix.upload.httpUpload(uploadParams,revised,callback,uploadParams);
};

bidix.upload.httpUpload = function(uploadParams,data,callback,params)
{
	var localCallback = function(status,params,responseText,url,xhr) {
		url = (url.indexOf("nocache=") < 0 ? url : url.substring(0,url.indexOf("nocache=")-1));
		if (xhr.status == httpStatus.NotFound)
			alert(bidix.upload.messages.storePhpNotFound.format([url]));
		if ((bidix.debugMode) || (responseText.indexOf("Debug mode") >= 0 )) {
			alert(responseText);
			if (responseText.indexOf("Debug mode") >= 0 )
				responseText = responseText.substring(responseText.indexOf("\n\n")+2);
		} else if (responseText.charAt(0) != '0') 
			alert(responseText);
		if (responseText.charAt(0) != '0')
			status = null;
		callback(status,params,responseText,url,xhr);
	};
	// do httpUpload
	var boundary = "---------------------------"+"AaB03x";	
	var uploadFormName = "UploadPlugin";
	// compose headers data
	var sheader = "";
	sheader += "--" + boundary + "\r\nContent-disposition: form-data; name=\"";
	sheader += uploadFormName +"\"\r\n\r\n";
	sheader += "backupDir="+uploadParams[3] +
				";user=" + uploadParams[4] +
				";password=" + uploadParams[5] +
				";uploaddir=" + uploadParams[2];
	if (bidix.debugMode)
		sheader += ";debug=1";
	sheader += ";;\r\n"; 
	sheader += "\r\n" + "--" + boundary + "\r\n";
	sheader += "Content-disposition: form-data; name=\"userfile\"; filename=\""+uploadParams[1]+"\"\r\n";
	sheader += "Content-Type: text/html;charset=UTF-8" + "\r\n";
	sheader += "Content-Length: " + data.length + "\r\n\r\n";
	// compose trailer data
	var strailer = new String();
	strailer = "\r\n--" + boundary + "--\r\n";
	data = sheader + data + strailer;
	if (bidix.debugMode) alert("about to execute Http - POST on "+uploadParams[0]+"\n with \n"+data.substr(0,500)+ " ... ");
	var r = doHttp("POST",uploadParams[0],data,"multipart/form-data; boundary="+boundary,uploadParams[4],uploadParams[5],localCallback,params,null);
	if (typeof r == "string")
		displayMessage(r);
	return r;
};

// same as Saving's updateOriginal but without convertUnicodeToUTF8 calls
bidix.upload.updateOriginal = function(original, posDiv)
{
	if (!posDiv)
		posDiv = locateStoreArea(original);
	if((posDiv[0] == -1) || (posDiv[1] == -1)) {
		alert(config.messages.invalidFileError.format([localPath]));
		return;
	}
	var revised = original.substr(0,posDiv[0] + startSaveArea.length) + "\n" +
				store.allTiddlersAsHtml() + "\n" +
				original.substr(posDiv[1]);
	var newSiteTitle = getPageTitle().htmlEncode();
	revised = revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");
	revised = updateMarkupBlock(revised,"PRE-HEAD","MarkupPreHead");
	revised = updateMarkupBlock(revised,"POST-HEAD","MarkupPostHead");
	revised = updateMarkupBlock(revised,"PRE-BODY","MarkupPreBody");
	revised = updateMarkupBlock(revised,"POST-SCRIPT","MarkupPostBody");
	return revised;
};

//
// UploadLog
// 
// config.options.chkUploadLog :
//		false : no logging
//		true : logging
// config.options.txtUploadLogMaxLine :
//		-1 : no limit
//      0 :  no Log lines but UploadLog is still in place
//		n :  the last n lines are only kept
//		NaN : no limit (-1)

bidix.UploadLog = function() {
	if (!config.options.chkUploadLog) 
		return; // this.tiddler = null
	this.tiddler = store.getTiddler("UploadLog");
	if (!this.tiddler) {
		this.tiddler = new Tiddler();
		this.tiddler.title = "UploadLog";
		this.tiddler.text = "| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |";
		this.tiddler.created = new Date();
		this.tiddler.modifier = config.options.txtUserName;
		this.tiddler.modified = new Date();
		store.addTiddler(this.tiddler);
	}
	return this;
};

bidix.UploadLog.prototype.addText = function(text) {
	if (!this.tiddler)
		return;
	// retrieve maxLine when we need it
	var maxLine = parseInt(config.options.txtUploadLogMaxLine,10);
	if (isNaN(maxLine))
		maxLine = -1;
	// add text
	if (maxLine != 0) 
		this.tiddler.text = this.tiddler.text + text;
	// Trunck to maxLine
	if (maxLine >= 0) {
		var textArray = this.tiddler.text.split('\n');
		if (textArray.length > maxLine + 1)
			textArray.splice(1,textArray.length-1-maxLine);
			this.tiddler.text = textArray.join('\n');		
	}
	// update tiddler fields
	this.tiddler.modifier = config.options.txtUserName;
	this.tiddler.modified = new Date();
	store.addTiddler(this.tiddler);
	// refresh and notifiy for immediate update
	story.refreshTiddler(this.tiddler.title);
	store.notify(this.tiddler.title, true);
};

bidix.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir,  backupDir) {
	if (!this.tiddler)
		return;
	var now = new Date();
	var text = "\n| ";
	var filename = bidix.basename(document.location.toString());
	if (!filename) filename = '/';
	text += now.formatString("0DD/0MM/YYYY 0hh:0mm:0ss") +" | ";
	text += config.options.txtUserName + " | ";
	text += "[["+filename+"|"+location + "]] |";
	text += " [[" + bidix.basename(storeUrl) + "|" + storeUrl + "]] | ";
	text += uploadDir + " | ";
	text += "[[" + bidix.basename(toFilename) + " | " +toFilename + "]] | ";
	text += backupDir + " |";
	this.addText(text);
};

bidix.UploadLog.prototype.endUpload = function(status) {
	if (!this.tiddler)
		return;
	this.addText(" "+status+" |");
};

//
// Utilities
// 

bidix.checkPlugin = function(plugin, major, minor, revision) {
	var ext = version.extensions[plugin];
	if (!
		(ext  && 
			((ext.major > major) || 
			((ext.major == major) && (ext.minor > minor))  ||
			((ext.major == major) && (ext.minor == minor) && (ext.revision >= revision))))) {
			// write error in PluginManager
			if (pluginInfo)
				pluginInfo.log.push("Requires " + plugin + " " + major + "." + minor + "." + revision);
			eval(plugin); // generate an error : "Error: ReferenceError: xxxx is not defined"
	}
};

bidix.dirname = function(filePath) {
	if (!filePath) 
		return;
	var lastpos;
	if ((lastpos = filePath.lastIndexOf("/")) != -1) {
		return filePath.substring(0, lastpos);
	} else {
		return filePath.substring(0, filePath.lastIndexOf("\\"));
	}
};

bidix.basename = function(filePath) {
	if (!filePath) 
		return;
	var lastpos;
	if ((lastpos = filePath.lastIndexOf("#")) != -1) 
		filePath = filePath.substring(0, lastpos);
	if ((lastpos = filePath.lastIndexOf("/")) != -1) {
		return filePath.substring(lastpos + 1);
	} else
		return filePath.substring(filePath.lastIndexOf("\\")+1);
};

bidix.initOption = function(name,value) {
	if (!config.options[name])
		config.options[name] = value;
};

//
// Initializations
//

// require PasswordOptionPlugin 1.0.1 or better
bidix.checkPlugin("PasswordOptionPlugin", 1, 0, 1);

// styleSheet
setStylesheet('.txtUploadStoreUrl, .txtUploadBackupDir, .txtUploadDir {width: 22em;}',"uploadPluginStyles");

//optionsDesc
merge(config.optionsDesc,{
	txtUploadStoreUrl: "Url of the UploadService script (default: store.php)",
	txtUploadFilename: "Filename of the uploaded file (default: in index.html)",
	txtUploadDir: "Relative Directory where to store the file (default: . (downloadService directory))",
	txtUploadBackupDir: "Relative Directory where to backup the file. If empty no backup. (default: ''(empty))",
	txtUploadUserName: "Upload Username",
	pasUploadPassword: "Upload Password",
	chkUploadLog: "do Logging in UploadLog (default: true)",
	txtUploadLogMaxLine: "Maximum of lines in UploadLog (default: 10)"
});

// Options Initializations
bidix.initOption('txtUploadStoreUrl','');
bidix.initOption('txtUploadFilename','');
bidix.initOption('txtUploadDir','');
bidix.initOption('txtUploadBackupDir','');
bidix.initOption('txtUploadUserName','');
bidix.initOption('pasUploadPassword','');
bidix.initOption('chkUploadLog',true);
bidix.initOption('txtUploadLogMaxLine','10');


/* don't want this for tiddlyspot sites

// Backstage
merge(config.tasks,{
	uploadOptions: {text: "upload", tooltip: "Change UploadOptions and Upload", content: '<<uploadOptions>>'}
});
config.backstageTasks.push("uploadOptions");

*/


//}}}
<html><div align="center"><br><iframe src="http://statpf01201001.tiddlyspot.com/" frameborder="0" width="800" height="500"></iframe></div></html>
<html><div align="center"><br><iframe src="http://statpf01201002.tiddlyspot.com/" frameborder="0" width="800" height="500"></iframe></div></html>
<html><div align="center"><br><iframe src="http://statpf01201003.tiddlyspot.com/" frameborder="0" width="800" height="500"></iframe></div></html>
<html><div align="center"><br><iframe src="http://statpf01201006.tiddlyspot.com/" frameborder="0" width="800" height="500"></iframe></div></html>
<html><div align="center"><br><iframe src="http://statpf01201007.tiddlyspot.com/" frameborder="0" width="800" height="500"></iframe></div></html>
<html><div align="center"><br><iframe src="http://statpf01201009.tiddlyspot.com/" frameborder="0" width="800" height="500"></iframe></div></html>
<html><div align="center"><br><iframe src="http://statpf01201010.tiddlyspot.com/" frameborder="0" width="800" height="500"></iframe></div></html>
<html><div align="center"><br><iframe src="http://statpf01201011.tiddlyspot.com/" frameborder="0" width="800" height="500"></iframe></div></html>
<html><div align="center"><br><iframe src="http://statpf02201001.tiddlyspot.com/" frameborder="0" width="800" height="500"></iframe></div></html>
<html><div align="center"><br><iframe src="http://statpf02201002.tiddlyspot.com/" frameborder="0" width="800" height="500"></iframe></div></html>
<html><div align="center"><br><iframe src="http://statpf02201003.tiddlyspot.com/" frameborder="0" width="800" height="500"></iframe></div></html>
<html><div align="center"><br><iframe src="http://statpf02201004.tiddlyspot.com/" frameborder="0" width="800" height="500"></iframe></div></html>
<html><div align="center"><br><iframe src="http://statpf02201006.tiddlyspot.com/" frameborder="0" width="800" height="500"></iframe></div></html>
<html><div align="center"><br><iframe src="http://statpf02201007.tiddlyspot.com/" frameborder="0" width="800" height="500"></iframe></div></html>
<html><div align="center"><br><iframe src="http://statpf02201008.tiddlyspot.com/" frameborder="0" width="800" height="500"></iframe></div></html>
<html><div align="center"><br><iframe src="http://statpf02201011.tiddlyspot.com/" frameborder="0" width="800" height="500"></iframe></div></html>
Type the text for '中央極限定理'
!外部連接
http://estimation.tiddlyspot.com/
http://www.books.com.tw/exep/prod/booksfile.php?item=0010283649
http://www.books.com.tw/exep/prod/booksfile.php?item=0010283103
Type the text for '單變量的故事'
!讀書會
* 挑選一本[[選讀書單|選讀書單]]內等級列為「入門」的書,
# [[別讓統計數字騙了你|http://www.books.com.tw/exep/prod/booksfile.php?item=0010283103]]
# [[統計數字:是事實,還是謊言?|http://www.books.com.tw/exep/prod/booksfile.php?item=0010392720]]
# [[別讓統計圖表唬弄你|http://www.books.com.tw/exep/prod/booksfile.php?item=0010283649]]
# [[看漫畫,學統計|http://www.books.com.tw/exep/prod/booksfile.php?item=0010222358]]
# [[統計,讓數字說話|http://www.books.com.tw/exep/prod/booksfile.php?item=0010071753]]
# [[真實的謊言─揭開民調與統計的黑盒子|http://www.books.com.tw/exep/prod/booksfile.php?item=0010070178]]
* 自訂「門風」成立讀書會。比如說,
# 每週固定「什麼時候」,在「什麼地方」面對面一起讀書。@@color:red;注意:記得留下證據。@@
# 用MSN即時網上討論。
# @@color:blue;其他有創意的門風。@@
* 成果:讀書心得之「~TiddlyWiki部落格」網頁。
* 評分標準:
# 創意 (30%)。@@color:red;指的是網頁的整體印象。@@
# 技巧 (20%)。@@color:red;指的當然是網頁設計技巧。@@
# 內容 (50%)
## 引經據典 (30%)。「經」自何來?跟選讀那一本書有關的
### 網頁。
### 中文文章。
### 英文文章。
### 書上本身的內容。
## 個人見解 (20%)。「見解在那裡」?
### 哪一門課(逢甲大學開出來的選修或是必修課)學到的知識。
### 哪一位名師(逢甲大學的專兼任教師)的至理名言。
### 你們那一組獨到的見解。(@@color:red;注意:必須說服評分教授,才會拿到分數。@@)
* 五級分:根據「評分標準」初評,然後把所有報告排名後,分成五種等級。依照以下表格給分:
| 等級 | 分數 | 報告的份數(有幾份報告會拿到這個分數) |
| A | 85 | 最多2份 |
| B | 80 | 最少5份 |
| C | 75 | 最少4份 |
| D | 70 | 最多1份 |
| F | 0 | 最多12份 |
Type the text for '多變量的故事'
Type the text for 'New Tiddler'
第一組標籤提供機率的入口。第二組標籤提供統計的入口。
----
分兩組標籤的用意,有
# 區分機率與統計。這樣做的原因是因為機率是統計之母。機率掌管統計的數學機制。
# 大部分台灣的管理學院與商學院,都會安排一學年的必修統計學。一般用的課程名稱就是「統計學(一)」跟「統計學(二)」,而且統計學(一)的涵蓋範圍通常包括概論(實驗單元、變數、母體、樣本、抽樣等等)與機率,而統計學(二)則包括關於單變量、雙變量與多變量數據的統計分析方法論,以及「估計」與「檢定」這兩種基礎的統計方法論。
<<tabs "" [[統計學(一):機率]] "" [[機率小序]][[機率]] "" [[機率]][[隨機變數]] "" [[隨機變數]][[數據]] "" [[數據]][[中央極限定理]] "" [[中央極限定理]]>>
<<tabs "" [[統計學(二):統計]] "" [[統計小序]][[估計]] "" [[估計]][[檢定]] "" [[檢定]][[單變量的故事]] "" [[單變量的故事]][[雙變量的故事]] "" [[雙變量的故事]][[多變量的故事]] "" [[多變量的故事]]>>
!!!@@color:blue;逢甲大學統計系吳榮彬版權所有。@@
Type the text for '數據'
Type the text for '機率'
Type the text for 'New Tiddler'
!外部連接
http://hypothesis.tiddlyspot.com/
http://www.books.com.tw/exep/prod/booksfile.php?item=0010222358
http://www.books.com.tw/exep/prod/booksfile.php?item=0010070178
http://www.books.com.tw/exep/prod/booksfile.php?item=0010263819
甲、(綠頭鴨的故事)(20% = 2 * 10%)
小女孩依舊希望檢定$H_0: p = 0.5$對上$H_1: p > 0.5$。假設$X$表示最後有幾隻母鴨一開始就撲向綠麵包。已知虛無假設下,$X \sim BIN(n = 10, p = 0.5)$,而且$P(X \le 6) = 0.828$, $P(X \le 7) = 0.945$, $P(X \le 8) = 0.989$, $P(X \le 9) = 0.999$。
# (10%)+++[答案]@@color:red;這是一種右尾的假設檢定,加上$p$值,$P(X \ge 7) = 1 - P(X \le 6) = 1 - 0.828 = 0.172$,超過0.10,所以小女孩不拒絕虛無假設。@@===如果小女孩記錄到有7隻母鴨一開始就撲向綠麵包。小女孩會「拒絕虛無假設」嗎?為什麼?
# (10%)+++[答案]@@color:red;因為$P(X \ge 8) = 1 - P(X \le 7) = 0.055, P(X \ge 9) = 1 - P(X \le 8) = 0.011$,所以小女孩至少要看到9隻母鴨一開始就撲向綠麵包,她才會『拒絕虛無假設』。@@===如果設定$\alpha = 0.05$,那麼「小女孩至少要看到幾隻母鴨一開始就撲向綠麵包,她才會『拒絕虛無假設』?」
乙、(10%)以下那些是正確的?+++[答案]@@color:red;1, 4@@===
# 如果犯了型I錯誤(Type I error),表示「冤枉好人」。
# 如果犯了型II錯誤(Type II error),表示「冤枉好人」。
# 如果犯了型I錯誤(Type I error),表示「縱容壞人」。
# 如果犯了型II錯誤(Type II error),表示「縱容壞人」。
丙、(50% = 5 * 10%)(新垃圾袋)你是一位垃圾袋研發人員。市面上某等級垃圾袋的「平均撕裂力」,根據可信任的報告,「不超過40」。現在你開發一種新的同等級垃圾袋。
# (10%)+++[答案]@@color:red;$H_0: \mu \le 40$ vs $H_1: \mu > 40$@@===為了證明(實證)你的垃圾袋「平均撕裂力」比市面上同等級的垃圾袋要「高」,你會設計什麼樣的「虛無假設」與「研究假設」?
# (10%)+++[答案]@@color:red;右尾@@===「左尾」?「右尾」?還是「雙尾」檢定?
# (10%)+++[答案]@@color:red;b@@===(選擇與說明題)什麼時候你「可能」會犯下型I錯誤?請說明理由。
## 看到「新垃圾袋的樣本平均撕裂力 = 35」。
## 看到「新垃圾袋的樣本平均撕裂力 = 45」。
# (10%)設定$\alpha = 0.05$。已知樣本數等於36,而且$\sigma^2 = 4$。請用「數字的區間、$(40, x)$)」回答以下的問題。
## +++[答案]@@color:red;$(40, 45)$@@===什麼樣的「臨界值」,會讓你根據「新垃圾袋的樣本平均撕裂力 = 45」拒絕虛無假設?
## +++[答案]@@color:red;$(40, 50)$@@===什麼樣的「臨界值」,會讓你根據「新垃圾袋的樣本平均撕裂力 = 50」拒絕虛無假設?
# (10%)+++[答案]@@color:red;$40 + 1.645 \times 2/6$@@===設定$\alpha = 0.05$。已知樣本數等於36,而且$\sigma^2 = 4$。針對「丙(1.)」小題的答案,拒絕虛無假設的臨界值等於多少?(注意:$z_{0.05} = 1.645$)
丁、(10% = 2 * 5%)(信賴區間)實驗發現「新垃圾袋的樣本平均撕裂力 $\bar x = 50$」。另外,我們知道「新垃圾袋之母體平均撕裂力的90%信賴區間等於$\bar x \pm 1.645 \times \sigma_{\bar X}$」。請回答:
# (5%)+++[答案]@@color:red;$\sigma_{\bar X} > 10/1.645$@@===至少什麼樣的$\sigma_{\bar X}$,「新垃圾袋樣本平均撕裂力的標準差」,會使得上述的90%信賴區間包含「40」這個數字?
# (5%)+++[答案]@@color:red;$2/\sqrt{n} > 10/1.645$@@===如果$\sigma^2 = 4$,頂多什麼樣的「樣本數$n$」會使得上述的90%信賴區間包含「40」這個數字?
戊、(10% = 10 * 1%)($\alpha$跟$\beta$)
# (1%)+++[答案]@@color:red;1@@===$\alpha + \beta$的最大值?
# (1%)+++[答案]@@color:red;0@@===$\alpha + \beta$的最小值?
# (1%)+++[答案]@@color:red;1@@===$\alpha$的最大值?
# (1%)+++[答案]@@color:red;0@@===$\alpha$的最小值?
# (1%)+++[答案]@@color:red;1@@===$\beta$的最大值?
# (1%)+++[答案]@@color:red;0@@===$\beta$的最小值?
# (4% = 4 * 1%)如果$p$值小於
* (1%) +++[答案]@@color:red;一些@@===$0.10$,我們有「??(兩個字)」$H_0$錯誤的證據。
* (1%) +++[答案]@@color:red;強烈@@===$0.05$,我們有$H_0$錯誤「??(兩個字)」的證據。
* (1%) +++[答案]@@color:red;非常強烈@@===$0.01$,我們有$H_0$錯誤「????(四個字)」的證據。
* (1%) +++[答案]@@color:red;極端強烈@@===$0.001$,我們有$H_0$錯誤「????(四個字)」烈的證據。
Type the text for 'New Tiddler'
http://www.books.com.tw/exep/prod/booksfile.php?item=0010392720
http://www.books.com.tw/exep/prod/booksfile.php?item=0010178635
http://www.books.com.tw/exep/prod/booksfile.php?item=0010071753
這是「MySTATistics」的首頁,連接「網路統計學院」為各位準備的基礎統計學。它是學習統計學的起點,也是你學習的中繼站。在這裡,泡杯茶、幾片餅乾,享受科技、享受學習,「輕鬆讀、歡喜收」。
!「統計學」學什麼?
「統計學」根據「數據」推論(包括估計與檢定)「母體」(之「機率分配」)的特徵,諸如「平均」、「中位數」、「分位數」、「變異數」、「標準差」等等,甚至整個母體的「機率分配」。「估計」與「檢定」是基本功。加料之後衍生其他新的功夫,比如說,如果「諸多平均」之間有著某種「函數關係」,那就會帶出「迴歸分析」或是「變異數分析」。
!學「統計學」需要什麼樣的數學?
「機率」是「統計學」的數學。為什麼是機率呢?一言以蔽之,統計推論的本質是「舉證」,證據的強度靠機率衡量之。這就是原因了。但請注意,統計學的機率,只是數學分支機率論的一部份。各位讀者諸君不需緊張。
!數據之「實驗單元」、「處理」、「水準」、「變數」、「母體」、「樣本」、「數據」
手邊的數據在統計推論這件事上,到底扮演著什麼樣的角色?請看下面的故事。
{{{
我有一群老鼠(全世界的老鼠都在我家!!!)。
我餵「一號食譜」給其中幾隻老鼠,餵「二號食譜」給另外幾隻老鼠,最後餵「三號食譜」給剩下沒吃到飯的老鼠。
一個月後,我測量這些(所有)老鼠的「性別」、「身高」、「體重」、「心跳」。
我得到四個母體。
因為我沒有時間「餵所有老鼠」跟「測量所有老鼠」,所以你只會看到「部分老鼠」的「性別」、「身高」、「體重」、「心跳」的「樣本」。
}}}
+++[實驗單元]
{{{
老鼠
}}}
===
+++[處理]
{{{
食譜
}}}
===
+++[水準]
{{{
一號、二號、三號食譜
}}}
===
+++[變數]
{{{
「性別」、「體溫」、「體重」、「心跳」
}}}
===
+++[母體]
{{{
「全世界老鼠的性別」、「全世界老鼠的體溫」、「全世界老鼠的體重」、「全世界老鼠的心跳」
}}}
===
+++[樣本]
{{{
「部分老鼠的性別」、「部分老鼠的體溫」、「部分老鼠的體重」、「部分老鼠的心跳」
}}}
===
+++[數據]
{{{
「性別的觀察值」、「體溫的觀察值」、「體重的觀察值」、「心跳的觀察值」
}}}
===
| 年次 | 主題 | 卷子 |
| 2008 | 信賴區間 | [[財稅二乙的信賴區間小考]], [[財稅二甲的信賴區間小考]] |
|~| 信賴區間與假設檢定 | [[統計學(II)期中考]] |
|~| 雙樣本與卡方檢定 | [[雙樣本與卡方檢定小考(I)]], [[雙樣本與卡方檢定小考(II)]] |
----
逢甲大學有一項服務,「[[逢甲大學優質學生報告服務網|http://pixie.lib.fcu.edu.tw/library/serv_epaper/]]」。理念如下:
> 隨著數位學習時代的降臨,知識的生命循環愈趨迅速且擴大,過去在知識創造與知識傳播過程中的產出物,也具有教育與學習的價值(例如網路上的學習討論、學生的專題報告、學期報告),而且值得保存與後續的傳播運用。
注意,榮彬爸爸只摘要部分,請點選[[這裡|http://pixie.lib.fcu.edu.tw/library/serv_epaper/organization.htm]]閱讀全文。

根據[[逢甲大學學生報告ePaper格式|http://pixie.lib.fcu.edu.tw/library/serv_epaper/question.htm#5]],榮彬爸爸制訂「財稅二年級統計學讀書會部落格基本內容」如下:
* 篇名:設定為網頁的標題(SiteTitle)。
* 中文摘要:300~500字的摘要說明。建議各組將部落格所要討論的故事重點,用一段完整的文字呈現。
* 英文摘要:上述「中文摘要」的英文翻譯。
* 關鍵字:自訂與故事有關的關鍵字8至10個。最好這些關鍵字都是各組設計的標籤(tags)。
* 圖目錄:利用「標籤技術」,讓讀者可以快速瀏覽你們放在報告的圖片。
* 表目錄:利用「標籤技術」,讓讀者可以快速瀏覽你們放在報告的表格。
* 報告本文(依章節順序):這部分請自行安排。
* 參考文獻:列出各位撰寫這一份部落格所參考的各項資料,包括「網頁」、「中文文章」、「英文文章」、其他。並請提供「超連結」。
* 附錄:如果有些內容並不是你的主流,但是與你的主題有關,你可以給它標籤「附錄」,並且利用「標籤技術」供讀者參考。

@@color:red;請參考對應的[[樣板TiddlyWiki|http://exfcuxx.tiddlyspot.com/]]。@@
一、 (20%=4*5%)
# +++[答案]@@color:red;$|\hat P - p|$@@===請定義「樣本比例估計母體比例的估計誤差」。
# +++[答案]@@color:red;$P(|\hat P - p| \le 0.05) = P(|Z| \le \frac{0.05}{\sqrt{0.75 \times 0.25 / 25}}) = P(|Z| \le 0.58) = 2 \times 0.2190 = 0.438$@@===如果經過調查「樣本數26」的隨機樣本之後,發現「樣本比例是0.75」,請計算「大樣本下,估計誤差小於0.05的機率」。
# +++[答案]@@color:red;$P(|\hat P - p| \le B) = 0.95; P(|Z| \le \frac{B}{\sqrt{0.75 \times 0.25 / 25}}) = 0.95, B = 1.96 \times \sqrt{0.75 \times 0.25 / 25} = 0.1697$@@===一樣的條件下,請計算「信賴係數0.95之下,樣本比例估計母體比例的估計誤差之上限」。
# +++[答案]@@color:red;$|\hat P - p| \le 0.1697, p \in 0.75 \pm 0.1697$@@===根據上述問題的答案,請提供「母體比例的95%大樣本信賴區間」。
二、 (30%=6*5%) 從以下表格內挑答案,回答接著下來的問題。以下問題的樣本數都是$n$。(提示:答案可能不只一個。)
| $Z$ | $\chi_{n - 1}^2$ | $F_{a - 1, n - a}$ | $N(\mu, \sigma^2/n)$ | $N(p, p(1 - p)/n)$ | $BIN(n, p)$ | $N(0, \sigma^2/n)$ | $t_{n - 1}$ |
# +++[答案]@@color:red;$N(p, p(1 - p)/n), BIN(n, p)$@@===樣本來自「成功機率等於$p$」的白努利母體,樣本比例的抽樣分配。
# +++[答案]@@color:red;$N(\mu, \sigma^2/n)$@@===樣本來自「平均等於$\mu$,標準差$\sigma$」的母體,樣本平均的抽樣分配。
# +++[答案]@@color:red;$Z$@@===樣本來自「成功機率等於$p$」的白努利母體,$\frac{\hat P - p}{\sqrt{p(1-p)/n}}$的抽樣分配。
# +++[答案]@@color:red;$Z$@@===樣本來自「平均等於$\mu$,標準差$\sigma$」的母體,$\frac{\bar X - \mu}{\sigma/\sqrt{n}}$的抽樣分配。
# +++[答案]@@color:red;$\chi^2_{n - 1}$@@===樣本來自「平均等於$\mu$,標準差$\sigma$」的常態母體,$\frac{(n - 1)S^2}{\sigma^2}$的抽樣分配。
# +++[答案]@@color:red;$t_{n - 1}, Z$@@===樣本來自「平均等於$\mu$,標準差$\sigma$」的常態母體,$\frac{\bar X - \mu}{s/\sqrt{n}}$的抽樣分配。
三、 (20%=4*5%)
針對以下每一種改變,請「清楚說明」母體平均$\mu$的某種信賴區間的半長是「變長」、「變短」還是「不變」?
# +++[答案]@@color:red;長@@===增加信心水準。
# +++[答案]@@color:red;短@@===增加樣本數。
# +++[答案]@@color:red;不變@@===樣本平均變大。
# +++[答案]@@color:red;短@@===增加錯誤機率。
四、 (10%=2*5%)針對以下的信心水準,查表得知用來計算某種$\mu$信賴區間所需要的$z_{\alpha/2}$。
# +++[答案]@@color:red;$z_{0.00135} = 2.99 \sim 3.00$@@===$99.73\%$
# +++[答案]@@color:red;$z_{0.04} = 1.75 \sim 1.76$@@===$92\%$
五、 (20%)考慮垃圾袋問題。假如某個獨立實驗室測驗一些垃圾袋,發現市面上沒有撕裂力超過50磅的30加侖垃圾袋。根據這些結果,新改善過的垃圾袋製造商覺得他們的30加侖垃圾袋將會是市面上最強的,如果他們的新垃圾袋之平均撕裂力超過50磅。ㄧ組40只垃圾袋樣本的撕裂力數據顯示它們的平均$\bar x = 50.575$而標準差$s = 1.6438$。如果我們令新型垃圾袋的平均撕裂力是$\mu$。
# +++[答案]@@color:red;$95\% CI = [50.066, 51.085]; 99\% CI = [49.907, 51.245]$@@===計算$\mu$的95%跟99%信賴區間。
# +++[答案]@@color:red;YES@@===利用95%信賴區間,我們有95%的信心認為$\mu$至少50磅嗎?試解釋之。
# +++[答案]@@color:red;NO@@===利用99%信賴區間,我們有99%的信心認為$\mu$至少50磅嗎?試解釋之。
# +++[答案]@@color:red;95%@@===根據2.跟3.部分的答案,對新型垃圾袋是市面上最強的,你有多少信心?
一、 (20%=4*5%)假設「母體標準差等於12」。
# +++[答案]@@color:red;$|\bar X - \mu|$@@===請定義「樣本平均估計母體平均的估計誤差」。
# +++[答案]@@color:red;$P(|\bar X - \mu| \le 5) = P(|Z| \le \frac{5}{12/\sqrt{36}}) = P(|Z| \le 2.5) = 0.9876$@@===如果經過調查「樣本數36」的隨機樣本之後,發現「樣本平均是75」,請計算「大樣本下,估計誤差小於5的機率」。
# +++[答案]@@color:red;$P(|\bar X - \mu| \le B) = 0.95, P(|Z| \le B) = 0.95, B = 1.96 \times 2 = 3.92$@@===一樣的條件下,請計算「信賴係數0.95之下,樣本平均估計母體平均的估計誤差之上限」。
# +++[答案]@@color:red;$|\bar X - \mu| \le 3.92, \mu \in 75 \pm 3.92$@@===根據上述問題的答案,請提供「母體平均的95%大樣本信賴區間」。
二、 (30%=6*5%) 以下問題的樣本數都是$n$。
# +++[答案]@@color:red;$N(p, p(1 - p)/n)$@@===樣本來自「成功機率等於$p$」的白努利母體,樣本比例的大樣本抽樣分配。
# +++[答案]@@color:red;$N(\mu, \sigma^2/n)$@@===樣本來自「平均等於$\mu$,標準差$\sigma$」的母體,樣本平均的大樣本抽樣分配。
# +++[答案]@@color:red;$Z$@@===樣本來自「成功機率等於$p$」的白努利母體,$\frac{\hat P - p}{\sqrt{p(1-p)/n}}$的大樣本抽樣分配。
# +++[答案]@@color:red;$N(0, \sigma^2/n)$@@===樣本來自「平均等於$\mu$,標準差$\sigma$」的母體,$\bar X - \mu$的大樣本抽樣分配。
# +++[答案]@@color:red;$N(0, p(1 - p)/n)$@@===樣本來自「成功機率等於$p$」的白努利母體,$\hat P - p$的大樣本抽樣分配。
# +++[答案]@@color:red;$t_{n - 1}, Z$@@===樣本來自「平均等於$\mu$,標準差$\sigma$」的常態母體,$\frac{\bar X - \mu}{s/\sqrt{n}}$的抽樣分配。
三、 (20%=4*5%)
針對以下每一種改變,請「清楚說明」母體比例$p$的某種大樣本信賴區間的半長是「變長」、「變短」還是「不變」?
# +++[答案]@@color:red;長@@===增加信心水準。
# +++[答案]@@color:red;短@@===增加樣本數。
# +++[答案]@@color:red;$\hat p \in [0, 0.5]$,長;$\hat p \in [0.5, 1.0]$,短。@@===樣本比例變大。
# +++[答案]@@color:red;短@@===增加錯誤機率。
四、 (10%=2*5%)針對以下的信心水準,查表得知用來計算某種$\mu$信賴區間所需要的$z_{\alpha/2}$。
# +++[答案]@@color:red;$z_{0.00135} = 2.99 \sim 3.00$@@===$99.73\%$
# +++[答案]@@color:red;$z_{0.04} = 1.75 \sim 1.76$@@===$92\%$
五、 (20%)考慮垃圾袋問題。假如某個獨立實驗室測驗一些垃圾袋,發現市面上沒有撕裂力超過50磅的30加侖垃圾袋。根據這些結果,新改善過的垃圾袋製造商覺得他們的30加侖垃圾袋將會是市面上最強的,如果他們的新垃圾袋之平均撕裂力超過50磅。ㄧ組25只垃圾袋樣本的撕裂力數據顯示它們的平均$\bar x = 50.575$而標準差$s = 1.6438$。如果我們令新型垃圾袋的平均撕裂力是$\mu$。
# +++[答案]@@color:red;$90\% CI = [50.0126, 51.1374], 95\% CI = [49.865, 51.2535]$@@===計算$\mu$的90%跟95%信賴區間。
# +++[答案]@@color:red;YES@@===利用90%信賴區間,我們有90%的信心認為$\mu$至少50磅嗎?試解釋之。
# +++[答案]@@color:red;NO@@===利用95%信賴區間,我們有95%的信心認為$\mu$至少50磅嗎?試解釋之。
# +++[答案]@@color:red;90%@@===根據2.跟3.部分的答案,對新型垃圾袋是市面上最強的,你有多少信心?
(注意:$t_{0.025, 24} = 2.063899, t_{0.05, 24} = 1.710882$)
<<tabs "" [[等級:入門(I)]] "" [[]][[別讓統計數字騙了你]] "" [[別讓統計數字騙了你]][[統計數字:是事實,還是謊言?]] "" [[統計數字:是事實,還是謊言?]][[別讓統計圖表唬弄你]] "" [[別讓統計圖表唬弄你]]>>
<<tabs "" [[等級:入門(II)]] "" [[]][[看漫畫,學統計]] "" [[看漫畫,學統計]][[統計,讓數字說話]] "" [[統計,讓數字說話]][[真實的謊言─揭開民調與統計的黑盒子]] "" [[真實的謊言─揭開民調與統計的黑盒子]]>>
<<tabs "" [[等級:中階]] "" [[]][[統計 你贏的機率]] "" [[統計 你贏的機率]]>>
<<tabs "" [[等級:進階]] "" [[]][[統計,改變了世界]] "" [[統計,改變了世界]]>>
Type the text for '隨機變數'
甲、(30%)根據以下的數據回答第一大題:(假設$\mu_{X_1} = \mu_1, \mu_{X_2} = \mu_2$)
| 觀察點 | $X_1$ | $X_2$ |
| 1 | 7 | 4 |
| 2 | 3 | 3 |
| 3 | 6 | 3 |
| 4 | 2 | 4 |
| 5 | 8 | 5 |
| 6 | 1 | 3 |
# (5%)+++[答案]$S^2_{x_1}=\frac{1}{5}(163-6\cdot4.5^2)=8.3$===計算$X_1$樣本的樣本變異數。
# (5%)+++[答案]$S^2_{x_2}=\frac{1}{5}(84-6\cdot3.6667^2)=0.6667$===計算$X_2$樣本的樣本變異數。
# (10%)+++[答案]$\sigma^2_{x_1}\neq\sigma^2_{x_2} 
t=\frac{\bar{x_1}-\bar{x_2}}{\sqrt{\frac{S^2_{x_1}}{n_1}+\frac{S^2_{x_2}}{n_2}}}=\frac{4.5-3.6667}{\sqrt{\frac{8.3}{6}+\frac{.6667}{6}}}=0.6814$
===如果$\sigma^2_{X_1} \ne \sigma^2_{X_2}$,那麼檢定$\mu_1 = \mu_2$的檢定統計量會等於多少?
# (10%)+++[答案]$\sigma^2_{x_1}=\sigma^2_{x_2}
S^2_p=\frac{(n_1-1)S^2_1+(n_2-1)S^2_2}{n_1+n_2-2}=\frac{5\cdot8.3+5\cdot0.6667}{6+6-2}=4.4835   t=\frac{\bar{x_1}-\bar{x_2}}{\sqrt{S^2_p(\frac{1}{n_1}+\frac{1}{n_2})}}=\frac{4.5-3.6667}{\sqrt{4.4835(\frac{1}{6}+\frac{1}{6})}}=0.6814$
===如果$\sigma^2_{X_1} = \sigma^2_{X_2}$,那麼檢定$\mu_1 = \mu_2$的檢定統計量會等於多少?
----
乙、(30%)根據以下的數據回答第二大題:(假設$p_{X_1} = p_1, p_{X_2} = p_2$,$z_{0.025} = 1.96$)
| 第幾次 | $X_1$ | $X_2$ |
| 1 | 7 | 4 |
| 2 | 3 | 3 |
| 3 | 6 | 3 |
| 4 | 2 | 4 |
| 5 | 8 | 5 |
| 6 | 1 | 3 |
針對某一次選舉,民意調查公司作了「六」次民調,結果如上表。每一次民調都問了20位隨機挑到且有投票權的公民。10位問他/她是否支持「1號候選人」,另外10位問他/她是否支持「2號候選人」。比如說,第一次的「7」表示「10位被問到的公民有7位支持1號候選人」;「4」表示「10位被問到的公民有4位支持2號候選人」。請問這六次民調有哪幾次拒絕虛無假設「$p_1 = p_2$」。
----
丙、(10%)最近一次排行榜,晚上11點跟11點半人們收看某些頻道的比例如下:($\chi^2_{4, 0.05} = 9.48773$)
| WDUX | WWTY | WACO | WTJW | Others |
| 15% | 19% | 22% | 16% | 28% |
假設剛剛的排行榜,一項2000位觀眾的結果如下:
| WDUX | WWTY | WACO | WTJW | Others |
| 182 | 536 | 354 | 151 | 777 |
在顯注水準0.05之下檢定現在的排行榜是否跟最近一次的不一樣。你的結論是什麼?
----
丁、(15%)某家行銷研究公司希望知道酒類消費與收看職業網球比賽的關係。100位隨機挑到的人們,被問到他們是否喝酒,跟他們是否看網球比賽。得到以下的結果:
|| 看網球比賽 | 不看網球比賽 | 總和 |
| 飲酒 | 16 | 24 | 40 |
| 不飲酒 | 4 | 56 | 60 |
| 總和 | 20 | 80 | 100 |
# (10%)檢定人們「是否喝酒」跟「是否看網球比賽」是獨立的。設定($\alpha = 0.05$,$\chi^2_{1, 0.05} = 3.84146$)。
# (5%)提供卡方檢定的結果,你覺得在網球比賽的轉播時段廣告某種酒有意義嗎?試解釋之。
----
戊、(5%)假設我們想要檢定$H_0: p_1 = 2p_2 = 3p_3$。現在樣本數等於22,請問「第三種情況(也就是發生機率$p_3$對應的情況)的期望個數有幾個?
----
己、(10%)寫下以下狀況的虛無假設:
# (5%)+++[以下這一個表的「是否喝酒」跟「是否看網球比賽」是獨立的。]
|| 看網球比賽 | 不看網球比賽 ||
| 飲酒 | $p_{11}$ | $p_{12}$ | $p_{1*}$ |
| 不飲酒 | $p_{21}$ | $p_{22}$ | $p_{2*}$ |
|| $p_{*1}$ | $p_{*2}$ | $1$ |
===

# (5%)+++[以下這一個表的「男性」跟「女性」對「飲酒的偏好」沒有差別。]
|| 男性 | 女性 |
| 飲酒 | $p_{11}$ | $p_{12}$ |
| 不飲酒 | $p_{21}$ | $p_{22}$ |
|| $1$ | $1$ |
===
甲、(30%)根據以下的數據回答第一大題:(假設$p_{X_1} = p_1, p_{X_2} = p_2$,$z_{0.025} = 1.96$)
| 觀察點 | $X_1$ | $X_2$ |
| 1 | 5 | 8 |
| 2 | 6 | 7 |
| 3 | 5 | 2 |
| 4 | 6 | 3 |
| 5 | 6 | 8 |
| 6 | 5 | 4 |
針對某一次選舉,民意調查公司作了「六」次民調,結果如上表。每一次民調都問了20位隨機挑到且有投票權的公民。10位問他/她是否支持「1號候選人」,另外10位問他/她是否支持「2號候選人」。比如說,第一次的「5」表示「10位被問到的公民有5位支持1號候選人」;「8」表示「10位被問到的公民有8位支持2號候選人」。請問這六次民調有哪幾次拒絕虛無假設「$p_1 = p_2$」。
----
乙、(30%)根據以下的數據回答第二大題:
| 觀察點 | $X_1$ | $X_2$ |
| 1 | 5 | 8 |
| 2 | 6 | 7 |
| 3 | 5 | 2 |
| 4 | 6 | 3 |
| 5 | 6 | 8 |
| 6 | 5 | 4 |
# (5%)計算$X_1$樣本的樣本變異數。
# (5%)計算$X_2$樣本的樣本變異數。
# (10%)如果$\sigma^2_{X_1} \ne \sigma^2_{X_2}$,那麼檢定$\mu_1 = \mu_2$的檢定統計量會等於多少?
# (10%)如果$\sigma^2_{X_1} = \sigma^2_{X_2}$,那麼檢定$\mu_1 = \mu_2$的檢定統計量會等於多少?
----
丙、(10%)最近一次排行榜,一項2000位觀眾晚上11點跟11點半收看某些頻道的結果如下:($\chi^2_{4, 0.05} = 9.48773$)
| WDUX | WWTY | WACO | WTJW | OWWW |
| 182 | 536 | 354 | 151 | 777 |
在顯注水準0.05之下檢定「頻道受歡迎的程度是一樣的」。你的結論是什麼?
----
丁、(15%)人們「是否喝酒」跟「是否看網球比賽」是獨立的。
|| 看網球比賽 | 不看網球比賽 | 總和 |
| 飲酒 | ? | ? | 40 |
| 不飲酒 | ? | ? | 60 |
| 總和 | 20 | 80 | 100 |
# (10%)回填上述表格內「?」的數字。
# (5%)如果人們「是否喝酒」跟「是否看網球比賽」真的是「獨立的」,你覺得在網球比賽的轉播時段廣告某種酒有意義嗎?試解釋之。
----
己、(10%)寫下以下狀況的虛無假設:
# (5%)+++[以下這一個表的「男性」跟「女性」對「飲酒的偏好」沒有差別。]
|| 男性 | 女性 |
| 飲酒 | $p_{11}$ | $p_{12}$ |
| 不飲酒 | $p_{21}$ | $p_{22}$ |
|| $1$ | $1$ |
===

# (5%)+++[以下這一個表的「是否喝酒」跟「是否看網球比賽」是獨立的。]
|| 看網球比賽 | 不看網球比賽 ||
| 飲酒 | $p_{11}$ | $p_{12}$ | $p_{1*}$ |
| 不飲酒 | $p_{21}$ | $p_{22}$ | $p_{2*}$ |
|| $p_{*1}$ | $p_{*2}$ | $1$ |
===

----
戊、(5%)假設我們想要檢定$H_0: p_1 = 3p_2 = 5p_3$。多少樣本才會讓「第三種情況(也就是發生機率$p_3$對應的情況)的期望個數等6?
Type the text for '雙變量的故事'
一位生意人上飛機坐定後,很驚訝地發覺身旁竟坐了一隻衣冠楚楚,繫著安全帶的鸚鵡。

當生意人向空服人員要咖啡喝時,身旁的鸚鵡對著空服員嘎嘎叫道:「小姐,妳怎麼這麼胖啊?妳一定很懶惰。好吧!反正妳要跑一趟,順便幫我弄杯威士忌來喝喝吧,動作快點。」當面受到這種侮辱,空服員儘管心裡氣惱,還是盡責地端來一杯威士忌,不過卻把生意人要的咖啡給忘了。當她要再跑一趟去端咖啡時,鸚鵡已經把剛端來的威士忌一飲而盡,又嘎嘎叫道:「再給老子來一杯,妳這個又賤又醜的女人。」 自顧咬牙切齒的空服員不久後端來第二杯威士忌,但因怒火中燒,又把咖啡給忘了。生意人再也受不了這種劣等服務,決定試試鸚鵡的方法。「喂!小姐」他疾言道,「我跟妳要了兩次咖啡,兩次妳都忘記。妳這個豬頭!現在趕快去給我端來,否則我海扁妳一頓。」幾分鐘後,兩名壯碩的空中少爺走過來,把生意人和鸚鵡從座位上揪起來,打開緊急逃生門,把他們扔出飛機。

正當一人一鳥在空中急速下墜時,鸚鵡忽然展開雙翅,轉頭對生意人說:「以一個不會飛的傢伙而言,你剛才真他媽的有種……」

+++[啟示]不要問「別人可以做,為什麼我做就不行?」@@因為別人有你沒有的優勢! @@===