\s[ P(x_1, x_2, ..., x_n) = \sPi_{i=1}^n P(x_i|\stext{parents}(X_i)) \s]\nเริ่มจากการแปลง [[joint probability distribution]] ให้อยู่ในรูปของ [[conditional probability]]\n\s[ P(x_1, ..., x_n) = P(x_n|x_{n-1}, ..., x_1) P(x_{n-1}, ..., x_1) \s]\nเมื่อเราแก้พจน์ขวาสุดของสมการนี้ไปเรื่อยๆ ([[chain rule]]) จะได้\n\sbegin{eqnarray}\nP(x_1, ..., x_n) & = & P(x_n|x_{n-1}, ..., x_1) P(x_{n-1}|x_{n-2}, ..., x_1) ... P(x_2|x_1) P(x_1) \s\s\n& = & \sprod_{i=1}^nP(x_i|x_{i-1}, ..., x_1)\n\send{eqnarray}\nซึ่งสามารถเขียนออกมาเป็นสมการ\n\s[ P(x_1, ..., x_n) = \sPi_{i=1}^n P(x_i|\stext{parents}(X_i)) \s]\nและสำหรับทุกๆตัวแปร \s( X_i \s) ใน network เราได้\n\s[ P(X_i|X_{i-1}, ...,X_1) = P(X_i|\stext{Parents(X_i)}) \s]\nโดยที่ \s( \stext{Parents}(X_i)\ssubseteq {X_{i-1}, ..., X_1} \s) ซึ่งสามารภทำได้โดยการเรียงลำดับตัวแปรตามโครงสร้างของกราฟ\n\nจากสมการดังกล่าวเราพบว่าการที่โครงสร้างของ Bayesian Networks นั้นจะถูกต้องได้ก็ต่อเมื่อแต่ละโหนดนั้น [[conditionally independent]] กับ predecessors ของมัน.\n\nการสร้าง Bayesian Networks นั้นเราจะต้องเลือก parents ที่มีอิทธิพลโดยตรงกับโหนด \s( X_i \s) ใดๆเท่านั้น แทนที่จะเป็น predecessor ทั้งหมด ดังตัวอย่าง\n* รูป\nเนื่องจาก Burglary และ EarthQuake นั้นส่งอิทธิพลต่อ MaryCalls ผ่านทาง Alarm แล้ว และการที่ John จะโทรมาหรือไม่ก็ไม่ได้เกี่ยวกับโอกาสที่ Mary จะโทรมา ดังนั้น\n\s[ P(\stext{MaryCalls}|\stext{JohnCalls}, \stext{Alarm}, \stext{Earthquake}, \stext{Burglaty}) = P(\stext{MaryCalls}|\stext{Alarm}) \s]\n\n
8:00 สอบ TOEFL
วันสุดท้ายของการเรียน Goethe
สอบวิชา Basic English Speaking and Listening เวลา 10.00น. กับ Andy\n\n13.00 ประชุมแลป\n15.00 สอบเขียน essay ที่ IT1
ABZee is my nickname in the internet.
config.options.chkHttpReadOnly = false;\n
เป็นแบบจำลองกราฟทีถูกคิดค้นโดยนักคณิตศาสตร์ชาวอังกฤษชื่อ [[Thomas Bayes]] ซึ่งในแบบจำลองนี้ถูกแสดงโดยกราฟ และ joint probability distribution ที่แสดงความสัมพันธ์ระหว่างโหนด\n\nแต่ละโหนดในกราฟนั้นเก็บข้อมูล conditional probability distribution ที่ขึ้นกับ parents ของโหนดนั้นๆ\nซึ่งข้อมูลในแต่ละโหนดนี้สามารถนำมาใช้คำนวณความน่าจะเป็นของสถานะใดๆของระบบได้\n\nการศึกษา [[Bayesian Networks]] นั้นสามารถศึกษาได้จากคุณสมบัติของมัน และความหมายของมันในมุมมองต่างๆ\n\n@@font-weight:bold;font-size:1.3em;color:#444; //Bayesian Networks (What it is?)//   @@ นั้นคือ [[Directed Acyclic Graph]] ที่:\n# โหนดแต่ละโหนดแสดงถึงตัวตัวแปร\n# เส้นตรงแต่ละเส้นแสดงถึง dependence ระหว่างตัวแปรสองตัว และมี [[conditional probability]] \s( P( X_i|\stext{Parent}(X_i)) \s)\nยกตัวอย่างเช่น\n\nคุณได้นำสัญญาณกันขโมยมาติดตั้งที่บ้าน โดยปกติแล้วสัญญาณกันขโมยจะทำงานได้ค่อนข้างแม่นยำ แต่บางทีสัญญาณนั้นก็เกิดข้อผิดพลาดได้ เช่น การเกิดแผ่นดินไหวทำให้สัญญาณกันขโมยส่งเสียง หรือสัญญาณกันขโมยไม่ส่งเสียงทั้งๆที่มีขโมยบุกเข้ามา\n\nเพื่อนบ้านของคุณจะโทรมาหาคุณหากเขาได้ยินเสียงสัญญาณกันขโมยร้อง\nซึ่งเพื่อนบ้านทั้งสองของคุณ, John และ Mary, อาจจะเกิดข้อผิดพลาดบางกรณี เช่นทั้งคู่อาจไม่อยู่บ้านทั้งคู่ หรือมีคนสับสนระหว่างสัญญาณกันขโมยและนาฬิกาปลุก\n\nตัวอย่างดังกล่าวสามารถนำมาเขียน Bayesian Networks ได้ดังนี้\n* ยังไม่ได้เขียน\n\n@@font-weight:bold;font-size:1.3em;color:#444; //Bayesian Networks (What it means?)//   @@ สามารถมองได้จากสองมุมมอง คือ\n# [[Numerical View|Numerical View of Bayesian Networks]] (มุมมองเชิงตัวเลข) คือการมองว่า network เป็นสิ่งที่ใช้แสดงถึง [[joint probability distribution]] ซึ่งมุมมองแบบนี้มีประโยชน์ต่อเราในการให้ความเข้าใจถึงกระบวนการสร้าง network\n# [[Topological View|Topological View of Bayesian Networks]] (มุมมองเชิงโครงสร้าง) คือการมองว่า network เป็นการนำ [[conditional probability]] ของแต่ละ [[random variable]] มาเขียนเป็นกราฟซึ่งมุมมองนี้มีประโยชน์ในด้านการออกแบบ inference\n\n
[[Bhattacharyya Distance]] นั้นใช้่วัดความคล้ายกันของสอง discrete probability distribution ใดๆ\nในโดเมน x ซึ่งมี discrete probability distribution p และ q จะมี Bhattacharyya Distance คือ\n\s[ BC(p,q) = \ssum_{x\sin{X}}{\ssqrt{p(x)q(x)}} \s]\nโดย assume ว่าค่าในโดเมน x มีการกระจายตัวแบบ [[Gaussian Distribution]]
<<calendar thismonth>>\n
/***\n|''Name:''|CalendarPlugin|\n|''Source:''|http://www.TiddlyTools.com/#CalendarPlugin|\n|''Author:''|SteveRumsby|\n|''License:''|unknown|\n|''~CoreVersion:''|2.0.10|\n\n// // updated by Jeremy Sheeley to add cacheing for reminders\n// // see http://www.geocities.com/allredfaq/reminderMacros.html\n// // ''Changes by ELS 2006.08.23:''\n// // added handling for weeknumbers (code supplied by Martin Budden. see "wn**" comment marks)\n// // ''Changes by ELS 2005.10.30:''\n// // config.macros.calendar.handler()\n// // ^^use "tbody" element for IE compatibility^^\n// // ^^IE returns 2005 for current year, FF returns 105... fix year adjustment accordingly^^\n// // createCalendarDays()\n// // ^^use showDate() function (if defined) to render autostyled date with linked popup^^\n// // calendar stylesheet definition\n// // ^^use .calendar class-specific selectors, add text centering and margin settings^^\n\n\n!!!!!Configuration:\n<<option chkDisplayWeekNumbers>> Display week numbers //(note: Monday will be used as the start of the week)//\n|''First day of week:''|<<option txtCalFirstDay>>|(Monday = 0, Sunday = 6)|\n|''First day of weekend:''|<<option txtCalStartOfWeekend>>|(Monday = 0, Sunday = 6)|\n\n!!!!!Syntax:\n|{{{<<calendar>>}}}|Produce a full-year calendar for the current year|\n|{{{<<calendar year>>}}}|Produce a full-year calendar for the given year|\n|{{{<<calendar year month>>}}}|Produce a one-month calendar for the given month and year|\n|{{{<<calendar thismonth>>}}}|Produce a one-month calendar for the current month|\n|{{{<<calendar lastmonth>>}}}|Produce a one-month calendar for last month|\n|{{{<<calendar nextmonth>>}}}|Produce a one-month calendar for next month|\n\n***/\n// //Modify this section to change the text displayed for the month and day names, to a different language for example. You can also change the format of the tiddler names linked to from each date, and the colours used.\n\n//{{{\nconfig.macros.calendar = {};\n\nconfig.macros.calendar.monthnames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];\nconfig.macros.calendar.daynames = ["M", "T", "W", "T", "F", "S", "S"];\n\nconfig.macros.calendar.weekendbg = "#c0c0c0";\nconfig.macros.calendar.monthbg = "#e0e0e0";\nconfig.macros.calendar.holidaybg = "#ffc0c0";\n\n//}}}\n// //''Code section:''\n// (you should not need to alter anything below here)//\n//{{{\nif(config.options.txtCalFirstDay == undefined)\n config.options.txtCalFirstDay = 0;\nif(config.options.txtCalStartOfWeekend == undefined)\n config.options.txtCalStartOfWeekend = 5;\nif(config.options.chkDisplayWeekNumbers == undefined)//wn**\n config.options.chkDisplayWeekNumbers = false;\nif(config.options.chkDisplayWeekNumbers)\n config.options.txtCalFirstDay = 0;\n\nconfig.macros.calendar.tiddlerformat = "0DD/0MM/YYYY"; // This used to be changeable - for now, it isn't// <<smiley :-(>> \n\nversion.extensions.calendar = { major: 0, minor: 6, revision: 0, date: new Date(2006, 1, 22)};\nconfig.macros.calendar.monthdays = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\nconfig.macros.calendar.holidays = [ ]; // Not sure this is required anymore - use reminders instead\n//}}}\n\n// //Is the given date a holiday?\n//{{{\nfunction calendarIsHoliday(date)\n{\n var longHoliday = date.formatString("0DD/0MM/YYYY");\n var shortHoliday = date.formatString("0DD/0MM");\n\n for(var i = 0; i < config.macros.calendar.holidays.length; i++) {\n if(config.macros.calendar.holidays[i] == longHoliday || config.macros.calendar.holidays[i] == shortHoliday) {\n return true;\n }\n }\n return false;\n}\n//}}}\n\n// //The main entry point - the macro handler.\n// //Decide what sort of calendar we are creating (month or year, and which month or year)\n// // Create the main calendar container and pass that to sub-ordinate functions to create the structure.\n// ELS 2005.10.30: added creation and use of "tbody" for IE compatibility and fixup for year >1900//\n// ELS 2005.10.30: fix year calculation for IE's getYear() function (which returns '2005' instead of '105')//\n// ELS 2006.05.29: add journalDateFmt handling//\n//{{{\nconfig.macros.calendar.handler = function(place,macroName,params)\n{\n var calendar = createTiddlyElement(place, "table", null, "calendar", null);\n var tbody = createTiddlyElement(calendar, "tbody", null, null, null);\n var today = new Date();\n var year = today.getYear();\n if (year<1900) year+=1900;\n \n // get format for journal link by reading from SideBarOptions (ELS 5/29/06 - based on suggestion by Martin Budden)\n var text = store.getTiddlerText("SideBarOptions");\n this.journalDateFmt = "DD-MMM-YYYY";\n var re = new RegExp("<<(?:newJournal)([^>]*)>>","mg"); var fm = re.exec(text);\n if (fm && fm[1]!=null) { var pa=fm[1].readMacroParams(); if (pa[0]) this.journalDateFmt = pa[0]; }\n\n if (params[0] == "thismonth")\n {\n cacheReminders(new Date(year, today.getMonth(), 1, 0, 0), 31);\n createCalendarOneMonth(tbody, year, today.getMonth());\n } \n else if (params[0] == "lastmonth") {\n var month = today.getMonth()-1; if (month==-1) { month=11; year--; }\n cacheReminders(new Date(year, month, 1, 0, 0), 31);\n createCalendarOneMonth(tbody, year, month);\n }\n else if (params[0] == "nextmonth") {\n var month = today.getMonth()+1; if (month>11) { month=0; year++; }\n cacheReminders(new Date(year, month, 1, 0, 0), 31);\n createCalendarOneMonth(tbody, year, month);\n }\n else {\n if (params[0]) year = params[0];\n if(params[1])\n {\n cacheReminders(new Date(year, params[1]-1, 1, 0, 0), 31);\n createCalendarOneMonth(tbody, year, params[1]-1);\n }\n else\n {\n cacheReminders(new Date(year, 0, 1, 0, 0), 366);\n createCalendarYear(tbody, year);\n }\n }\n window.reminderCacheForCalendar = null;\n}\n//}}}\n//{{{\n//This global variable is used to store reminders that have been cached\n//while the calendar is being rendered. It will be renulled after the calendar is fully rendered.\nwindow.reminderCacheForCalendar = null;\n//}}}\n//{{{\nfunction cacheReminders(date, leadtime)\n{\n if (window.findTiddlersWithReminders == null)\n return;\n window.reminderCacheForCalendar = {};\n var leadtimeHash = [];\n leadtimeHash [0] = 0;\n leadtimeHash [1] = leadtime;\n var t = findTiddlersWithReminders(date, leadtimeHash, null, 1);\n for(var i = 0; i < t.length; i++) {\n //just tag it in the cache, so that when we're drawing days, we can bold this one.\n window.reminderCacheForCalendar[t[i]["matchedDate"]] = "reminder:" + t[i]["params"]["title"]; \n }\n}\n//}}}\n//{{{\nfunction createCalendarOneMonth(calendar, year, mon)\n{\n var row = createTiddlyElement(calendar, "tr", null, null, null);\n createCalendarMonthHeader(calendar, row, config.macros.calendar.monthnames[mon] + " " + year, true, year, mon);\n row = createTiddlyElement(calendar, "tr", null, null, null);\n createCalendarDayHeader(row, 1);\n createCalendarDayRowsSingle(calendar, year, mon);\n}\n//}}}\n\n//{{{\nfunction createCalendarMonth(calendar, year, mon)\n{\n var row = createTiddlyElement(calendar, "tr", null, null, null);\n createCalendarMonthHeader(calendar, row, config.macros.calendar.monthnames[mon] + " " + year, false, year, mon);\n row = createTiddlyElement(calendar, "tr", null, null, null);\n createCalendarDayHeader(row, 1);\n createCalendarDayRowsSingle(calendar, year, mon);\n}\n//}}}\n\n//{{{\nfunction createCalendarYear(calendar, year)\n{\n var row;\n row = createTiddlyElement(calendar, "tr", null, null, null);\n var back = createTiddlyElement(row, "td", null, null, null);\n var backHandler = function() {\n removeChildren(calendar);\n createCalendarYear(calendar, year-1);\n };\n createTiddlyButton(back, "<", "Previous year", backHandler);\n back.align = "center";\n\n var yearHeader = createTiddlyElement(row, "td", null, "calendarYear", year);\n yearHeader.align = "center";\n //yearHeader.setAttribute("colSpan", 19);\n yearHeader.setAttribute("colSpan",config.options.chkDisplayWeekNumbers?22:19);//wn**\n\n var fwd = createTiddlyElement(row, "td", null, null, null);\n var fwdHandler = function() {\n removeChildren(calendar);\n createCalendarYear(calendar, year+1);\n };\n createTiddlyButton(fwd, ">", "Next year", fwdHandler);\n fwd.align = "center";\n\n createCalendarMonthRow(calendar, year, 0);\n createCalendarMonthRow(calendar, year, 3);\n createCalendarMonthRow(calendar, year, 6);\n createCalendarMonthRow(calendar, year, 9);\n}\n//}}}\n\n//{{{\nfunction createCalendarMonthRow(cal, year, mon)\n{\n var row = createTiddlyElement(cal, "tr", null, null, null);\n createCalendarMonthHeader(cal, row, config.macros.calendar.monthnames[mon], false, year, mon);\n createCalendarMonthHeader(cal, row, config.macros.calendar.monthnames[mon+1], false, year, mon);\n createCalendarMonthHeader(cal, row, config.macros.calendar.monthnames[mon+2], false, year, mon);\n row = createTiddlyElement(cal, "tr", null, null, null);\n createCalendarDayHeader(row, 3);\n createCalendarDayRows(cal, year, mon);\n}\n//}}}\n\n//{{{\nfunction createCalendarMonthHeader(cal, row, name, nav, year, mon)\n{\n var month;\n if(nav) {\n var back = createTiddlyElement(row, "td", null, null, null);\n back.align = "center";\n back.style.background = config.macros.calendar.monthbg;\n\n/*\n back.setAttribute("colSpan", 2);\n\n var backYearHandler = function() {\n var newyear = year-1;\n removeChildren(cal);\n cacheReminders(new Date(newyear, mon , 1, 0, 0), 31);\n createCalendarOneMonth(cal, newyear, mon);\n };\n createTiddlyButton(back, "<<", "Previous year", backYearHandler);\n*/\n var backMonHandler = function() {\n var newyear = year;\n var newmon = mon-1;\n if(newmon == -1) { newmon = 11; newyear = newyear-1;}\n removeChildren(cal);\n cacheReminders(new Date(newyear, newmon , 1, 0, 0), 31);\n createCalendarOneMonth(cal, newyear, newmon);\n };\n createTiddlyButton(back, "<", "Previous month", backMonHandler);\n\n\n month = createTiddlyElement(row, "td", null, "calendarMonthname", name)\n// month.setAttribute("colSpan", 3);\n// month.setAttribute("colSpan", 5);\n month.setAttribute("colSpan", config.options.chkDisplayWeekNumbers?6:5);//wn**\n\n var fwd = createTiddlyElement(row, "td", null, null, null);\n fwd.align = "center";\n fwd.style.background = config.macros.calendar.monthbg; \n\n// fwd.setAttribute("colSpan", 2);\n var fwdMonHandler = function() {\n var newyear = year;\n var newmon = mon+1;\n if(newmon == 12) { newmon = 0; newyear = newyear+1;}\n removeChildren(cal);\n cacheReminders(new Date(newyear, newmon , 1, 0, 0), 31);\n createCalendarOneMonth(cal, newyear, newmon);\n };\n createTiddlyButton(fwd, ">", "Next month", fwdMonHandler);\n/*\n var fwdYear = createTiddlyElement(row, "td", null, null, null);\n var fwdYearHandler = function() {\n var newyear = year+1;\n removeChildren(cal);\n cacheReminders(new Date(newyear, mon , 1, 0, 0), 31);\n createCalendarOneMonth(cal, newyear, mon);\n };\n createTiddlyButton(fwd, ">>", "Next year", fwdYearHandler);\n*/\n } else {\n month = createTiddlyElement(row, "td", null, "calendarMonthname", name)\n //month.setAttribute("colSpan", 7);\n month.setAttribute("colSpan",config.options.chkDisplayWeekNumbers?8:7);//wn**\n }\n month.align = "center";\n month.style.background = config.macros.calendar.monthbg;\n}\n//}}}\n\n//{{{\nfunction createCalendarDayHeader(row, num)\n{\n var cell;\n for(var i = 0; i < num; i++) {\n if (config.options.chkDisplayWeekNumbers) createTiddlyElement(row, "td");//wn**\n for(var j = 0; j < 7; j++) {\n var d = j + (config.options.txtCalFirstDay - 0);\n if(d > 6) d = d - 7;\n cell = createTiddlyElement(row, "td", null, null, config.macros.calendar.daynames[d]);\n if(d == (config.options.txtCalStartOfWeekend-0) || d == (config.options.txtCalStartOfWeekend-0+1))\n cell.style.background = config.macros.calendar.weekendbg;\n }\n }\n}\n//}}}\n\n//{{{\nfunction createCalendarDays(row, col, first, max, year, mon)\n{\n var i;\n if (config.options.chkDisplayWeekNumbers){\n if (first<=max) {\n var ww = new Date(year,mon,first);\n createTiddlyElement(row, "td", null, null, "w"+ww.getWeek());//wn**\n }\n else createTiddlyElement(row, "td", null, null, null);//wn**\n }\n for(i = 0; i < col; i++) {\n createTiddlyElement(row, "td", null, null, null);\n }\n var day = first;\n for(i = col; i < 7; i++) {\n var d = i + (config.options.txtCalFirstDay - 0);\n if(d > 6) d = d - 7;\n var daycell = createTiddlyElement(row, "td", null, null, null);\n var isaWeekend = ((d == (config.options.txtCalStartOfWeekend-0) || d == (config.options.txtCalStartOfWeekend-0+1))? true:false);\n\n if(day > 0 && day <= max) {\n var celldate = new Date(year, mon, day);\n // ELS 2005.10.30: use <<date>> macro's showDate() function to create popup\n if (window.showDate) {\n showDate(daycell,celldate,"popup","DD",config.macros.calendar.journalDateFmt,true, isaWeekend); // ELS 5/29/06 - use journalDateFmt \n } else {\n if(isaWeekend) daycell.style.background = config.macros.calendar.weekendbg;\n var title = celldate.formatString(config.macros.calendar.tiddlerformat);\n if(calendarIsHoliday(celldate)) {\n daycell.style.background = config.macros.calendar.holidaybg;\n }\n if(window.findTiddlersWithReminders == null) {\n var link = createTiddlyLink(daycell, title, false);\n link.appendChild(document.createTextNode(day));\n } else {\n var button = createTiddlyButton(daycell, day, title, onClickCalendarDate);\n }\n }\n }\n day++;\n }\n}\n//}}}\n\n// //We've clicked on a day in a calendar - create a suitable pop-up of options.\n// //The pop-up should contain:\n// // * a link to create a new entry for that date\n// // * a link to create a new reminder for that date\n// // * an <hr>\n// // * the list of reminders for that date\n//{{{\nfunction onClickCalendarDate(e)\n{\n var button = this;\n var date = button.getAttribute("title");\n var dat = new Date(date.substr(6,4), date.substr(3,2)-1, date.substr(0, 2));\n\n date = dat.formatString(config.macros.calendar.tiddlerformat);\n var popup = createTiddlerPopup(this);\n popup.appendChild(document.createTextNode(date));\n var newReminder = function() {\n var t = store.getTiddlers(date);\n displayTiddler(null, date, 2, null, null, false, false);\n if(t) {\n document.getElementById("editorBody" + date).value += "\sn<<reminder day:" + dat.getDate() +\n " month:" + (dat.getMonth()+1) +\n " year:" + (dat.getYear()+1900) + " title: >>";\n } else {\n document.getElementById("editorBody" + date).value = "<<reminder day:" + dat.getDate() +\n " month:" + (dat.getMonth()+1) +\n " year:" + (dat.getYear()+1900) + " title: >>";\n }\n };\n var link = createTiddlyButton(popup, "New reminder", null, newReminder); \n popup.appendChild(document.createElement("hr"));\n\n var t = findTiddlersWithReminders(dat, [0,14], null, 1);\n for(var i = 0; i < t.length; i++) {\n link = createTiddlyLink(popup, t[i].tiddler, false);\n link.appendChild(document.createTextNode(t[i].tiddler));\n }\n}\n//}}}\n\n//{{{\nfunction calendarMaxDays(year, mon)\n{\n var max = config.macros.calendar.monthdays[mon];\n if(mon == 1 && (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0)) {\n max++;\n }\n return max;\n}\n//}}}\n\n//{{{\nfunction createCalendarDayRows(cal, year, mon)\n{\n var row = createTiddlyElement(cal, "tr", null, null, null);\n\n var first1 = (new Date(year, mon, 1)).getDay() -1 - (config.options.txtCalFirstDay-0);\n if(first1 < 0) first1 = first1 + 7;\n var day1 = -first1 + 1;\n var first2 = (new Date(year, mon+1, 1)).getDay() -1 - (config.options.txtCalFirstDay-0);\n if(first2 < 0) first2 = first2 + 7;\n var day2 = -first2 + 1;\n var first3 = (new Date(year, mon+2, 1)).getDay() -1 - (config.options.txtCalFirstDay-0);\n if(first3 < 0) first3 = first3 + 7;\n var day3 = -first3 + 1;\n\n var max1 = calendarMaxDays(year, mon);\n var max2 = calendarMaxDays(year, mon+1);\n var max3 = calendarMaxDays(year, mon+2);\n\n while(day1 <= max1 || day2 <= max2 || day3 <= max3) {\n row = createTiddlyElement(cal, "tr", null, null, null);\n createCalendarDays(row, 0, day1, max1, year, mon); day1 += 7;\n createCalendarDays(row, 0, day2, max2, year, mon+1); day2 += 7;\n createCalendarDays(row, 0, day3, max3, year, mon+2); day3 += 7;\n }\n}\n//}}}\n\n//{{{\nfunction createCalendarDayRowsSingle(cal, year, mon)\n{\n var row = createTiddlyElement(cal, "tr", null, null, null);\n\n var first1 = (new Date(year, mon, 1)).getDay() -1 - (config.options.txtCalFirstDay-0);\n if(first1 < 0) first1 = first1+ 7;\n var day1 = -first1 + 1;\n var max1 = calendarMaxDays(year, mon);\n\n while(day1 <= max1) {\n row = createTiddlyElement(cal, "tr", null, null, null);\n createCalendarDays(row, 0, day1, max1, year, mon); day1 += 7;\n }\n}\n//}}}\n\n// //ELS 2005.10.30: added styles\n//{{{\nsetStylesheet(".calendar, .calendar table, .calendar th, .calendar tr, .calendar td { text-align:center; } .calendar, .calendar a { margin:0px !important; padding:0px !important; }", "calendarStyles");\n//}}}\n
// // override cookie settings for CalendarPlugin:\n//{{{\nconfig.options.txtCalFirstDay=6;\nconfig.options.txtCalStartOfWeekend=5;\n//}}}\n
[[Poom Kongniratsaikul]] [[Projects]]\n
เนื่องจากภาพที่สายตามนุษย์รับได้นั้นแตกต่างกับภาพที่หน่วยประมวลผลภาพสร้างขึ้นมา และคอมพิวเตอร์นั้นไม่สามารถแยกแยะความแตกต่างของสีได้แบบเดียวกับมนุษย์ ดังนั้นการประมวลผลภาพนั้นจึงนิยมทำการแปลงภาพจากโมเดล RGB ให้อยู่ในโมเดล HSI ที่มีลักษณะใกล้เคียงกับการแยกแยะสีของมนุษย์มากกว่า\n\nโมเดลสีประเภท RGB และ CMYK ที่นิยมใช้เพื่อการแสดงภาพให้แก่มนุษย์นั้นจะนิยามสีโดยการรวมกันของแสงสีหรือเม็ดสี ขณะที่ HSI นั้นเป็นการให้ข้อมูลของสีในลักษณะที่คุ้นเคยกับมนุษย์ เช่น สีนั้นเป็นสีอะไร? (Hue) สีนั้นเข้มแค่ไหน? (Saturate) หรือสีนั้นมีความสว่างมากน้อยเพียงใด? (Intensity)\nทำให้ข้อมูลสีที่ได้นั้นเหมาะแก่การคำนวณโดยใช้คอมพิวเตอร์ยิ่งขึ้น\n\n[img[http://pirun.ku.ac.th/~b4605083/upload/hsi.png]]\n
Willkommen zu meinem homepage. Mein Name ist [[Poom Kongniratsaikul]]. Ich bin Programmierer von [[Moscii Systems Co., Ltd.|http://www.moscii.com]]. Jetzt learne ich Deutsch am Goethe Institut, Bangkok, weil Ich nach Deutschland studieren möchte.\n\n[img[http://cc.cpe.ku.ac.th/~b4605083/upload/teddybear.jpg]]\nDas bin ich!!\n\nIch würde um die Welt reisen. Es ist mein Traum. Ich glaube eine Denke von jeden Leuten sehr interessant und erstaunlich sein. Deshalb lerne ich so gern Sprachen. Wenn ich viele Sprachen sprechen kann, will ich mehr Leute um die Welt kennen. \n\n[img[http://cc.cpe.ku.ac.th/~b4605083/upload/step.jpg]]\nMein Schritt nach Chinese (Hotel).\n\n[img[http://cc.cpe.ku.ac.th/~b4605083/upload/skuba-fu.gif]]\nIch, meine Mannschaft, und FU-Fighters. In Robocup 2006, Bremen, Germany.\n\nMein Interesse ist Robotics und [[Multiagentensystem|http://en.wikipedia.org/wiki/Multi-agent_system]]. Ich denke, wenn Systeme sehr kompliziert sind, dann müssen die Systeme besseres Innenkommunikation machen. Das Multiagentensystem ist eine Annäherung für Untereinanderkommunakation. Man kann das "selbstorganisiert System" sagen.\n\n[img[http://www.cs.iastate.edu/~baojie/acad/current/mas/ants.jpg]]\nAmeisekolonie ist ein Beispiel für das Multiagentsystem.\n\nMein Hobby ist Fotographieren, aber meine Kamera ist jetzt kaputt. Deshalb fotographiere ich nicht mehr.\n\n[img[http://cc.cpe.ku.ac.th/~b4605083/img/lotus01_.jpg]]\nEine Lotusblume im Kamphaengsan Campus, Kasetsart University. (ABZee ist mein Spitzname im Internet)\n\n[img[http://pirun.ku.ac.th/~b4605083/phpcmder/upload/img/Lomo001d.jpg]]\nMein Freunden in der sea. Kein Stuntman, Keine Schlinge!!\n\n[img[http://cc.cpe.ku.ac.th/~b4605083/img/this-for-soccer.jpg]]\nIch habe Fußball gespielt mit meine Fußballmannschaft, ... und wir verlieren.\n
มีอัลกอริทึมหลายชนิดที่สามารถนำมาใช้ตรวจสอบได้ว่าวัตถุสองชิ้นใดๆนั้นเป็นวัตถุเดียวกันหรือไม่ ซึ่งในแต่ละวิธีนั้นมีข้อดีข้อด้วยแตกต่างกันไปทั้งในด้านความเร็วและความถูกต้องแม่นยำ\n\nอัลกอริทึมที่เลือกใช้ในโครงงานนี้คือ [[Histogram Matching]] ซึ่งเป็นการนำข้อมูล histogram ของภาพสองภาพใดๆมาเปรียบเทียบความคล้ายกัน หาก histogram ของทั้งสองภาพนั้นแตกต่างกันน้อย วัตถุในภาพทั้งสองนั้นก็จะมีโอกาสที่จะเป็นวัตถุเดียวกันสูง\n\n[img[http://pirun.ku.ac.th/~b4605083/upload/histogram.png]]\n
"Histogram-based Particle Filter for Human Tracking on Distributed Vision System" is my senior project at [[Kasetsart University|http://en.wikipedia.org/wiki/Kasetsart_University]]. I wrote the details in Thai for any Thai students who interest in my project so they don't have to drill on papers and get lost.\n\nโปรเจค Histogram-based Particle Filter for Human Tracking on Distributed Vision System นั้นจะทำการสร้างโปรแกรมที่สามารถ "ติดตามตำแหน่งบุคคลผ่านกล้องจำนวนมาก" โดยใช้อัลกอริทึมที่เรียกว่า [[Particle Filtering]]\n\nวัตถุประสงค์: พัฒนาระบบสังเกตการณ์และติดตามตำแหน่งวัตถุ ซึ่งรองรับการทำงานของหน่วยรับภาพจำนวนมาก เพื่อความครอบคลุมพื้นที่สังเกตการณ์\n\nkeyword: human tracking, [[Particle Filtering]], [[Monte Carlo Algorithm]], multiple cameras, [[Distributed Vision System]] \n\nทฤษฏีและเทคนิคที่เกี่ยวข้อง\n*[[HSI Model]]\n*[[Histogram Matching]]\n**[[Bhattacharyya Distance]]\n*[[Bayesian Networks]]\n*[[Inference in Bayesian Networks]]\n**[[Markov Chain Monte Carlo]] (MCMC)\n*[[Dynamic Bayesian Networks]]\n*[[Inference in Dynamic Bayesian Networks]]\n**[[Sequential Monte Carlo|Particle Filtering]] (SMC) aka. [[Particle Filtering]]\n*[[Autoregressive Model]]\n**[[First-order Autoregressive]]\n**[[Second-order Autoregressive]]\n*[[Network Communication Though UDP-IP]]\n\nThis project will be finished before 15 Jan 2007.\n
Welcome to my personal website. I used to devote this website to my senior project, [[Histogram-based Particle Filter for Human Tracking on Distributed Vision System]], but now the projected is finished and I have so many projects to write about. Now the website is about my projects and works in the past.\n\nWnat to know about [[me|Poom Kongniratsaikul]]?
การอนุมานค่าใน [[Bayesian Networks]] สามารถแบ่งได้สองประเภท คือ\n* [[Exact Inference|Exact Inference in Bayesian Networks]] (การอนุมานอย่างแม่นยำ) ได้แก่วิธี\n** [[Inference by Enumeration]] (การอนุมานโดยการแจกแจง)\n** [[Inference by Variables Elimination]] (การอนุมานโดนการลดตัวแปร)\n* [[Approximate Inference|Approximate Inference in Bayesian Networks]] (การอนุมานโดยการประมาณ) ได้แก่วิธี\n** [[Direct Sampling Method]] (การสุ่มตัวอย่างโดยตรง)\n** [[Rejection Sampling]]\n** [[Likelihood Weighing]]\n** [[Markov Chain monte Carlo]]\nการคำนวณความน่าจะเป็นของสถานะใดๆในระบบขนาดใหญ่นั้นจะใช้เวลาในการประมวลผลมากหากให้การอนุมานความน่าจะเป็นอย่างแม่นยำบนเครือข่ายของเบยส์ (Exact inference in Bayesian Networks) การอนุมานโดยประมาณนั้นจะช่วยเพิ่มความเร็วให้กับการคำนวณโดยแลกกับความเสียงเล็กน้อยที่อาจเกิดขึ้นจากส่วนต่างของค่าที่ประมาณกับค่าจริง วิธีที่นิยมใช้คือวิธี Markov Chain Monte Carlo
/***\n|''Name:''|LegacyStrikeThroughPlugin|\n|''Description:''|Support for legacy (pre 2.1) strike through formatting|\n|''Version:''|1.0.1|\n|''Date:''|Jul 21, 2006|\n|''Source:''|http://www.tiddlywiki.com/#LegacyStrikeThroughPlugin|\n|''Author:''|MartinBudden (mjbudden (at) gmail (dot) com)|\n|''License:''|[[BSD open source license]]|\n|''CoreVersion:''|2.1.0|\n|''Browser:''|Firefox 1.0.4+; Firefox 1.5; InternetExplorer 6.0|\n\n***/\n\n//{{{\n\n// Ensure that the LegacyStrikeThrough Plugin is only installed once.\nif(!version.extensions.LegacyStrikeThroughPlugin)\n {\n version.extensions.LegacyStrikeThroughPlugin = true;\n\nconfig.formatters.push(\n{\n name: "legacyStrikeByChar",\n match: "==",\n termRegExp: /(==)/mg,\n element: "strike",\n handler: config.formatterHelpers.createElementAndWikify\n});\n\n} // end of "install only once"\n//}}}\n
[[Home]]\n[[Projects]]\n[[About Me|Poom Kongniratsaikul]]\n\n[[Hausarbeit]]\n\n[[edit|MainMenu]]\n\n<<calendar thismonth>>
วิธีการของ [[Markov Chain Monte Carlo]] (MCMC) นั้นเป็น [[Monte Carlo Algorithm]] ในการ sampling จาก probability distribution โดยการสร้าง [[Markov Chain]] ซึ่งมี distribution เหมือนกับ [[stationary distribution]]. หลังจาก chain ผ่านจำนวน step เป็นจำนวนมากแล้ว สถานะสุดท้ายของ chain จะถูกนำมาเป็น sample. ยิ่งจำนวน step มีจำนวนมากเท่าใด คุณภาพของ sample ที่ได้ก็จะมากขึึ้นเท่านั้น.\n
[[Monte Carlo Algorithm]] เป็นอัลกอรึทึมที่ใช้ random number มาช่วยในการหาคำตอบ คำตอบที่ได้จากอัลกอรึทึมนี้นั้นมีความคลาดเคลื่อนในขอบเขตที่จำกัด และอัลกอรึทึมนี้จะให้คำตอบที่แม่นยำยิ่งขึ้นเมื่อเพิ่มจำนวนข้อมุลให้มากขึ้น\n\nยกตัวอย่างเช่น\n\nในไหใบหนึ่งมีก้อนหินสีขาว-ดำ ปะปนกันไป โดยในไหนั้นมีหินทั้งสิ้น 10,000 ก้อน แต่เราไม่ทราบจำนวนของหินที่แน่ชัด. เราสามารถหาจำนวนของหินสีดำได้โดยการนับหินทีละก้อนจนครบ 10,000 ครั้ง.\nแต่การนับหินให้ครบทั้ง 10,000 ก้อนนั้นเป็นการเสียเวลามากจนเกินไป ผู้นับอาจยอมแลกความคลาดเคลื่อนเล็กน้อยกับความเร็วในการนับมากขึ้น โดยการสุ่มหยิบหินขึ้นมา 100 ก้อนและนับจำนวนหินสีดำของหินทั้งหมดที่หยิบขึ้นมา\n\nวิธีนี้มีความน่าจะเป็นสูงต่ำตามจำนวนของ sample ที่นำมาใช้ ซึ่งหากจำนวนของ sample มาก ความน่าจะเป็นที่คำตอบจะถูกนั้นก็จะมากตามไปด้วย.\n\nผลจากโปรแกรมทดลองหยิบหิน และเปอร์เซนต์ความถูกต้อง\n\nจำนวนที่หยิบ จำนวนหินสีดำ %ของหิินสีดำ\n50 13 26\n100 18 18\n200 42 21\n500 109 21\n1,000 212 21\n10,000 2,000 20 -> หยิบหินครบทุกก้อน\n\n
เราสามารถนำข้อมูลใน network มาแสดง [[full joint probability distribution]] ได้ เช่น เราสามารถหา \s( P(x_1, ..., x_n) \s) ได้จาก\n\s[ P(x_1, ..., x_n) = \sprod_{i=1}^n P(x_i|\stext{parents}(X_i)) \s]\nดังนั้นในแต่ละ entry ของ [[full joint probability distribution]] นั้นสามารถแสดงให้อยุ่ในรูปของผลคูณของ [[conditional probability]] ได้ดังตัวอย่าง\n* ยังไม่ได้เขียน\n\n[[วิธีการสร้าง Bayesian Networks จาก joint probability distribution| Constructing Bayesian Networks]]
/***\n|Name|Plugin: jsMath|\n|Created by|BobMcElrath|\n|Email|my first name at my last name dot org|\n|Location|http://bob.mcelrath.org/tiddlyjsmath-2.0.3.html|\n|Version|1.4|\n|Requires|[[TiddlyWiki|http://www.tiddlywiki.com]] &ge; 2.0.3, [[jsMath|http://www.math.union.edu/~dpvc/jsMath/]] &ge; 3.0|\n!Description\nLaTeX is the world standard for specifying, typesetting, and communicating mathematics among scientists, engineers, and mathematicians. For more information about LaTeX itself, visit the [[LaTeX Project|http://www.latex-project.org/]]. This plugin typesets math using [[jsMath|http://www.math.union.edu/~dpvc/jsMath/]], which is an implementation of the TeX math rules and typesetting in javascript, for your browser. Notice the small button in the lower right corner which opens its control panel.\n!Installation\nIn addition to this plugin, you must also [[install jsMath|http://www.math.union.edu/~dpvc/jsMath/download/jsMath.html]] on the same server as your TiddlyWiki html file. If you're using TiddlyWiki without a web server, then the jsMath directory must be placed in the same location as the TiddlyWiki html file.\n\nI also recommend modifying your StyleSheet use serif fonts that are slightly larger than normal, so that the math matches surrounding text, and \s\ssmall fonts are not unreadable (as in exponents and subscripts).\n{{{\n.viewer {\n line-height: 125%;\n font-family: serif;\n font-size: 12pt;\n}\n}}}\n\nIf you had used a previous version of [[Plugin: jsMath]], it is no longer necessary to edit the main tiddlywiki.html file to add the jsMath <script> tag. [[Plugin: jsMath]] now uses ajax to load jsMath.\n!History\n* 11-Nov-05, version 1.0, Initial release\n* 22-Jan-06, version 1.1, updated for ~TW2.0, tested with jsMath 3.1, editing tiddlywiki.html by hand is no longer necessary.\n* 24-Jan-06, version 1.2, fixes for Safari, Konqueror\n* 27-Jan-06, version 1.3, improved error handling, detect if ajax was already defined (used by ZiddlyWiki)\n* 12-Jul-06, version 1.4, fixed problem with not finding image fonts\n!Examples\n|!Source|!Output|h\n|{{{The variable $x$ is real.}}}|The variable $x$ is real.|\n|{{{The variable \s(y\s) is complex.}}}|The variable \s(y\s) is complex.|\n|{{{This \s[\sint_a^b x = \sfrac{1}{2}(b^2-a^2)\s] is an easy integral.}}}|This \s[\sint_a^b x = \sfrac{1}{2}(b^2-a^2)\s] is an easy integral.|\n|{{{This $$\sint_a^b \ssin x = -(\scos b - \scos a)$$ is another easy integral.}}}|This $$\sint_a^b \ssin x = -(\scos b - \scos a)$$ is another easy integral.|\n|{{{Block formatted equations may also use the 'equation' environment \sbegin{equation} \sint \stan x = -\sln \scos x \send{equation} }}}|Block formatted equations may also use the 'equation' environment \sbegin{equation} \sint \stan x = -\sln \scos x \send{equation}|\n|{{{Equation arrays are also supported \sbegin{eqnarray} a &=& b \s\s c &=& d \send{eqnarray} }}}|Equation arrays are also supported \sbegin{eqnarray} a &=& b \s\s c &=& d \send{eqnarray} |\n|{{{I spent \s$7.38 on lunch.}}}|I spent \s$7.38 on lunch.|\n|{{{I had to insert a backslash (\s\s) into my document}}}|I had to insert a backslash (\s\s) into my document|\n!Code\n***/\n//{{{\n\n// AJAX code adapted from http://timmorgan.org/mini\n// This is already loaded by ziddlywiki...\nif(typeof(window["ajax"]) == "undefined") {\n ajax = {\n x: function(){try{return new ActiveXObject('Msxml2.XMLHTTP')}catch(e){try{return new ActiveXObject('Microsoft.XMLHTTP')}catch(e){return new XMLHttpRequest()}}},\n gets: function(url){var x=ajax.x();x.open('GET',url,false);x.send(null);return x.responseText}\n }\n}\n\n// Load jsMath\njsMath = {\n Setup: {inited: 1}, // don't run jsMath.Setup.Body() yet\n Autoload: {root: new String(document.location).replace(/[^/]*$/,'jsMath/')} // URL to jsMath directory, change if necessary\n};\nvar jsMathstr;\ntry {\n jsMathstr = ajax.gets(jsMath.Autoload.root+"jsMath.js");\n} catch(e) {\n alert("jsMath was not found: you must place the 'jsMath' directory in the same place as this file. "\n +"The error was:\sn"+e.name+": "+e.message);\n throw(e); // abort eval\n}\ntry {\n window.eval(jsMathstr);\n} catch(e) {\n alert("jsMath failed to load. The error was:\sn"+e.name + ": " + e.message + " on line " + e.lineNumber);\n}\njsMath.Setup.inited=0; // allow jsMath.Setup.Body() to run again\n\n// Define wikifers for latex\nconfig.formatterHelpers.mathFormatHelper = function(w) {\n var e = document.createElement(this.element);\n e.className = this.className;\n var endRegExp = new RegExp(this.terminator, "mg");\n endRegExp.lastIndex = w.matchStart+w.matchLength;\n var matched = endRegExp.exec(w.source);\n if(matched) {\n var txt = w.source.substr(w.matchStart+w.matchLength, \n matched.index-w.matchStart-w.matchLength);\n if(this.keepdelim) {\n txt = w.source.substr(w.matchStart, matched.index+matched[0].length-w.matchStart);\n }\n e.appendChild(document.createTextNode(txt));\n w.output.appendChild(e);\n w.nextMatch = endRegExp.lastIndex;\n }\n}\n\nconfig.formatters.push({\n name: "displayMath1",\n match: "\s\s\s$\s\s\s$",\n terminator: "\s\s\s$\s\s\s$\s\sn?",\n element: "div",\n className: "math",\n handler: config.formatterHelpers.mathFormatHelper\n});\n\nconfig.formatters.push({\n name: "inlineMath1",\n match: "\s\s\s$", \n terminator: "\s\s\s$",\n element: "span",\n className: "math",\n handler: config.formatterHelpers.mathFormatHelper\n});\n\nvar backslashformatters = new Array(0);\n\nbackslashformatters.push({\n name: "inlineMath2",\n match: "\s\s\s\s\s\s\s(",\n terminator: "\s\s\s\s\s\s\s)",\n element: "span",\n className: "math",\n handler: config.formatterHelpers.mathFormatHelper\n});\n\nbackslashformatters.push({\n name: "displayMath2",\n match: "\s\s\s\s\s\s\s[",\n terminator: "\s\s\s\s\s\s\s]\s\sn?",\n element: "div",\n className: "math",\n handler: config.formatterHelpers.mathFormatHelper\n});\n\nbackslashformatters.push({\n name: "displayMath3",\n match: "\s\s\s\sbegin\s\s{equation\s\s}",\n terminator: "\s\s\s\send\s\s{equation\s\s}\s\sn?",\n element: "div",\n className: "math",\n handler: config.formatterHelpers.mathFormatHelper\n});\n\n// These can be nested. e.g. \sbegin{equation} \sbegin{array}{ccc} \sbegin{array}{ccc} ...\nbackslashformatters.push({\n name: "displayMath4",\n match: "\s\s\s\sbegin\s\s{eqnarray\s\s}",\n terminator: "\s\s\s\send\s\s{eqnarray\s\s}\s\sn?",\n element: "div",\n className: "math",\n keepdelim: true,\n handler: config.formatterHelpers.mathFormatHelper\n});\n\n// The escape must come between backslash formatters and regular ones.\n// So any latex-like \scommands must be added to the beginning of\n// backslashformatters here.\nbackslashformatters.push({\n name: "escape",\n match: "\s\s\s\s.",\n handler: function(w) {\n w.output.appendChild(document.createTextNode(w.source.substr(w.matchStart+1,1)));\n w.nextMatch = w.matchStart+2;\n }\n});\n\nconfig.formatters=backslashformatters.concat(config.formatters);\n\nwindow.wikify = function(source,output,highlightRegExp,tiddler)\n{\n if(source && source != "") {\n var wikifier = new\n Wikifier(source,formatter,highlightRegExp,tiddler);\n wikifier.subWikify(output,null);\n jsMath.ProcessBeforeShowing();\n }\n}\n//}}}
This wiki is now closed.\n\nPlease visit [[LongSpine.com|http://www.longspine.com]].
It's an abbreviation of [[Poom Kongniratsaikul|PoomK]], my name.\n\n
*My senior project: [[Histogram-based Particle Filter for Human Tracking on Distributed Vision System]]\n*My Robocup team: [[Skuba|http://iml.cpe.ku.ac.th/skuba/]]
It's Your Right to Believe.
PoomK
\n\n
มุมมองเชิงโครงสร้าง
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |\n| 15/12/2006 17:50:55 | poomk | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 15/12/2006 18:7:24 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 15/12/2006 18:10:2 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 16/12/2006 11:15:9 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 17/12/2006 21:39:30 | PoomK | [[/|http://poomk.tiddlyspot.com/#PoomK%20%5B%5BHistogram-based%20Particle%20Filter%20for%20Human%20Tracking%20on%20Multiple%20Cameras%5D%5D]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 17/12/2006 22:48:50 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 17/12/2006 22:50:27 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 18/12/2006 1:41:17 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 18/12/2006 1:59:29 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 19/12/2006 14:51:31 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 19/12/2006 15:51:48 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 19/12/2006 15:58:26 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 19/12/2006 16:32:23 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 19/12/2006 16:32:49 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 19/12/2006 16:33:59 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 19/12/2006 16:36:5 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 20/12/2006 15:41:12 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 20/12/2006 15:43:49 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 20/12/2006 15:46:4 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 20/12/2006 15:55:37 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 20/12/2006 15:58:6 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 20/12/2006 16:39:14 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 20/12/2006 22:17:38 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 20/12/2006 22:45:39 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 25/12/2006 15:31:43 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 25/12/2006 15:37:10 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 30/12/2006 2:25:59 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 30/12/2006 2:26:46 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 30/12/2006 2:36:42 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 30/12/2006 2:39:25 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 30/12/2006 13:50:32 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 30/12/2006 17:19:15 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 30/12/2006 20:7:8 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 22/1/2007 14:38:2 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/1/2007 14:38:21 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/1/2007 14:39:27 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/1/2007 14:40:5 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/1/2007 14:40:17 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/1/2007 14:47:7 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 26/1/2007 3:35:17 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 26/1/2007 14:35:46 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 22/4/2007 19:18:16 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/4/2007 20:36:56 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 22/4/2007 20:49:17 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/4/2007 21:6:11 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/4/2007 22:11:10 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/4/2007 22:16:41 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/4/2007 22:42:45 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/4/2007 23:8:18 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/4/2007 23:24:39 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 22/4/2007 23:24:51 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/4/2007 23:26:59 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/4/2007 23:28:39 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/4/2007 23:30:13 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/4/2007 23:38:15 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/4/2007 23:41:21 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 22/4/2007 23:45:49 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 6/6/2007 15:28:53 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 10/7/2008 22:23:46 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 4/5/2009 3:21:44 | PoomK | [[/|http://poomk.tiddlyspot.com/]] | [[store.cgi|http://poomk.tiddlyspot.com/store.cgi]] | . | index.html | . |
/***\n|''Name:''|UploadPlugin|\n|''Description:''|Save to web a TiddlyWiki|\n|''Version:''|3.4.4|\n|''Date:''|Sep 30, 2006|\n|''Source:''|http://tiddlywiki.bidix.info/#UploadPlugin|\n|''Documentation:''|http://tiddlywiki.bidix.info/#UploadDoc|\n|''Author:''|BidiX (BidiX (at) bidix (dot) info)|\n|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|\n|''~CoreVersion:''|2.0.0|\n|''Browser:''|Firefox 1.5; InternetExplorer 6.0; Safari|\n|''Include:''|config.lib.file; config.lib.log; config.lib.options; PasswordTweak|\n|''Require:''|[[UploadService|http://tiddlywiki.bidix.info/#UploadService]]|\n***/\n//{{{\nversion.extensions.UploadPlugin = {\n major: 3, minor: 4, revision: 4, \n date: new Date(2006,8,30),\n source: 'http://tiddlywiki.bidix.info/#UploadPlugin',\n documentation: 'http://tiddlywiki.bidix.info/#UploadDoc',\n author: 'BidiX (BidiX (at) bidix (dot) info',\n license: '[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D]]',\n coreVersion: '2.0.0',\n browser: 'Firefox 1.5; InternetExplorer 6.0; Safari'\n};\n//}}}\n\n////+++!![config.lib.file]\n\n//{{{\nif (!config.lib) config.lib = {};\nif (!config.lib.file) config.lib.file= {\n author: 'BidiX',\n version: {major: 0, minor: 1, revision: 0}, \n date: new Date(2006,3,9)\n};\nconfig.lib.file.dirname = function (filePath) {\n var lastpos;\n if ((lastpos = filePath.lastIndexOf("/")) != -1) {\n return filePath.substring(0, lastpos);\n } else {\n return filePath.substring(0, filePath.lastIndexOf("\s\s"));\n }\n};\nconfig.lib.file.basename = function (filePath) {\n var lastpos;\n if ((lastpos = filePath.lastIndexOf("#")) != -1) \n filePath = filePath.substring(0, lastpos);\n if ((lastpos = filePath.lastIndexOf("/")) != -1) {\n return filePath.substring(lastpos + 1);\n } else\n return filePath.substring(filePath.lastIndexOf("\s\s")+1);\n};\nwindow.basename = function() {return "@@deprecated@@";};\n//}}}\n////===\n\n////+++!![config.lib.log]\n\n//{{{\nif (!config.lib) config.lib = {};\nif (!config.lib.log) config.lib.log= {\n author: 'BidiX',\n version: {major: 0, minor: 1, revision: 1}, \n date: new Date(2006,8,19)\n};\nconfig.lib.Log = function(tiddlerTitle, logHeader) {\n if (version.major < 2)\n this.tiddler = store.tiddlers[tiddlerTitle];\n else\n this.tiddler = store.getTiddler(tiddlerTitle);\n if (!this.tiddler) {\n this.tiddler = new Tiddler();\n this.tiddler.title = tiddlerTitle;\n this.tiddler.text = "| !date | !user | !location |" + logHeader;\n this.tiddler.created = new Date();\n this.tiddler.modifier = config.options.txtUserName;\n this.tiddler.modified = new Date();\n if (version.major < 2)\n store.tiddlers[tiddlerTitle] = this.tiddler;\n else\n store.addTiddler(this.tiddler);\n }\n return this;\n};\n\nconfig.lib.Log.prototype.newLine = function (line) {\n var now = new Date();\n var newText = "| ";\n newText += now.getDate()+"/"+(now.getMonth()+1)+"/"+now.getFullYear() + " ";\n newText += now.getHours()+":"+now.getMinutes()+":"+now.getSeconds()+" | ";\n newText += config.options.txtUserName + " | ";\n var location = document.location.toString();\n var filename = config.lib.file.basename(location);\n if (!filename) filename = '/';\n newText += "[["+filename+"|"+location + "]] |";\n this.tiddler.text = this.tiddler.text + "\sn" + newText;\n this.addToLine(line);\n};\n\nconfig.lib.Log.prototype.addToLine = function (text) {\n this.tiddler.text = this.tiddler.text + text;\n this.tiddler.modifier = config.options.txtUserName;\n this.tiddler.modified = new Date();\n if (version.major < 2)\n store.tiddlers[this.tiddler.tittle] = this.tiddler;\n else {\n store.addTiddler(this.tiddler);\n story.refreshTiddler(this.tiddler.title);\n store.notify(this.tiddler.title, true);\n }\n if (version.major < 2)\n store.notifyAll(); \n};\n//}}}\n////===\n\n////+++!![config.lib.options]\n\n//{{{\nif (!config.lib) config.lib = {};\nif (!config.lib.options) config.lib.options = {\n author: 'BidiX',\n version: {major: 0, minor: 1, revision: 0}, \n date: new Date(2006,3,9)\n};\n\nconfig.lib.options.init = function (name, defaultValue) {\n if (!config.options[name]) {\n config.options[name] = defaultValue;\n saveOptionCookie(name);\n }\n};\n//}}}\n////===\n\n////+++!![PasswordTweak]\n\n//{{{\nversion.extensions.PasswordTweak = {\n major: 1, minor: 0, revision: 3, date: new Date(2006,8,30),\n type: 'tweak',\n source: 'http://tiddlywiki.bidix.info/#PasswordTweak'\n};\n//}}}\n/***\n!!config.macros.option\n***/\n//{{{\nconfig.macros.option.passwordCheckboxLabel = "Save this password on this computer";\nconfig.macros.option.passwordType = "password"; // password | text\n\nconfig.macros.option.onChangeOption = function(e)\n{\n var opt = this.getAttribute("option");\n var elementType,valueField;\n if(opt) {\n switch(opt.substr(0,3)) {\n case "txt":\n elementType = "input";\n valueField = "value";\n break;\n case "pas":\n elementType = "input";\n valueField = "value";\n break;\n case "chk":\n elementType = "input";\n valueField = "checked";\n break;\n }\n config.options[opt] = this[valueField];\n saveOptionCookie(opt);\n var nodes = document.getElementsByTagName(elementType);\n for(var t=0; t<nodes.length; t++) \n {\n var optNode = nodes[t].getAttribute("option");\n if (opt == optNode) \n nodes[t][valueField] = this[valueField];\n }\n }\n return(true);\n};\n\nconfig.macros.option.handler = function(place,macroName,params)\n{\n var opt = params[0];\n if(config.options[opt] === undefined) {\n return;}\n var c;\n switch(opt.substr(0,3)) {\n case "txt":\n c = document.createElement("input");\n c.onkeyup = this.onChangeOption;\n c.setAttribute ("option",opt);\n c.className = "txtOptionInput "+opt;\n place.appendChild(c);\n c.value = config.options[opt];\n break;\n case "pas":\n // input password\n c = document.createElement ("input");\n c.setAttribute("type",config.macros.option.passwordType);\n c.onkeyup = this.onChangeOption;\n c.setAttribute("option",opt);\n c.className = "pasOptionInput "+opt;\n place.appendChild(c);\n c.value = config.options[opt];\n // checkbox link with this password "save this password on this computer"\n c = document.createElement("input");\n c.setAttribute("type","checkbox");\n c.onclick = this.onChangeOption;\n c.setAttribute("option","chk"+opt);\n c.className = "chkOptionInput "+opt;\n place.appendChild(c);\n c.checked = config.options["chk"+opt];\n // text savePasswordCheckboxLabel\n place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));\n break;\n case "chk":\n c = document.createElement("input");\n c.setAttribute("type","checkbox");\n c.onclick = this.onChangeOption;\n c.setAttribute("option",opt);\n c.className = "chkOptionInput "+opt;\n place.appendChild(c);\n c.checked = config.options[opt];\n break;\n }\n};\n//}}}\n/***\n!! Option cookie stuff\n***/\n//{{{\nwindow.loadOptionsCookie_orig_PasswordTweak = window.loadOptionsCookie;\nwindow.loadOptionsCookie = function()\n{\n var cookies = document.cookie.split(";");\n for(var c=0; c<cookies.length; c++) {\n var p = cookies[c].indexOf("=");\n if(p != -1) {\n var name = cookies[c].substr(0,p).trim();\n var value = cookies[c].substr(p+1).trim();\n switch(name.substr(0,3)) {\n case "txt":\n config.options[name] = unescape(value);\n break;\n case "pas":\n config.options[name] = unescape(value);\n break;\n case "chk":\n config.options[name] = value == "true";\n break;\n }\n }\n }\n};\n\nwindow.saveOptionCookie_orig_PasswordTweak = window.saveOptionCookie;\nwindow.saveOptionCookie = function(name)\n{\n var c = name + "=";\n switch(name.substr(0,3)) {\n case "txt":\n c += escape(config.options[name].toString());\n break;\n case "chk":\n c += config.options[name] ? "true" : "false";\n // is there an option link with this chk ?\n if (config.options[name.substr(3)]) {\n saveOptionCookie(name.substr(3));\n }\n break;\n case "pas":\n if (config.options["chk"+name]) {\n c += escape(config.options[name].toString());\n } else {\n c += "";\n }\n break;\n }\n c += "; expires=Fri, 1 Jan 2038 12:00:00 UTC; path=/";\n document.cookie = c;\n};\n//}}}\n/***\n!! Initializations\n***/\n//{{{\n// define config.options.pasPassword\nif (!config.options.pasPassword) {\n config.options.pasPassword = 'defaultPassword';\n window.saveOptionCookie('pasPassword');\n}\n// since loadCookies is first called befor password definition\n// we need to reload cookies\nwindow.loadOptionsCookie();\n//}}}\n////===\n\n////+++!![config.macros.upload]\n\n//{{{\nconfig.macros.upload = {\n accessKey: "U",\n formName: "UploadPlugin",\n contentType: "text/html;charset=UTF-8",\n defaultStoreScript: "store.php"\n};\n\n// only this two configs need to be translated\nconfig.macros.upload.messages = {\n aboutToUpload: "About to upload TiddlyWiki to %0",\n backupFileStored: "Previous file backuped in %0",\n crossDomain: "Certainly a cross-domain isue: access to an other site isn't allowed",\n errorDownloading: "Error downloading",\n errorUploadingContent: "Error uploading content",\n fileLocked: "Files is locked: You are not allowed to Upload",\n fileNotFound: "file to upload not found",\n fileNotUploaded: "File %0 NOT uploaded",\n mainFileUploaded: "Main TiddlyWiki file uploaded to %0",\n passwordEmpty: "Unable to upload, your password is empty",\n urlParamMissing: "url param missing",\n rssFileNotUploaded: "RssFile %0 NOT uploaded",\n rssFileUploaded: "Rss File uploaded to %0"\n};\n\nconfig.macros.upload.label = {\n promptOption: "Save and Upload this TiddlyWiki with UploadOptions",\n promptParamMacro: "Save and Upload this TiddlyWiki in %0",\n saveLabel: "save to web", \n saveToDisk: "save to disk",\n uploadLabel: "upload" \n};\n\nconfig.macros.upload.handler = function(place,macroName,params){\n // parameters initialization\n var storeUrl = params[0];\n var toFilename = params[1];\n var backupDir = params[2];\n var uploadDir = params[3];\n var username = params[4];\n var password; // for security reason no password as macro parameter\n var label;\n if (document.location.toString().substr(0,4) == "http")\n label = this.label.saveLabel;\n else\n label = this.label.uploadLabel;\n var prompt;\n if (storeUrl) {\n prompt = this.label.promptParamMacro.toString().format([this.toDirUrl(storeUrl, uploadDir, username)]);\n }\n else {\n prompt = this.label.promptOption;\n }\n createTiddlyButton(place, label, prompt, \n function () {\n config.macros.upload.upload(storeUrl, toFilename, uploadDir, backupDir, username, password); \n return false;}, \n null, null, this.accessKey);\n};\nconfig.macros.upload.UploadLog = function() {\n return new config.lib.Log('UploadLog', " !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |" );\n};\nconfig.macros.upload.UploadLog.prototype = config.lib.Log.prototype;\nconfig.macros.upload.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir, backupDir) {\n var line = " [[" + config.lib.file.basename(storeUrl) + "|" + storeUrl + "]] | ";\n line += uploadDir + " | " + toFilename + " | " + backupDir + " |";\n this.newLine(line);\n};\nconfig.macros.upload.UploadLog.prototype.endUpload = function() {\n this.addToLine(" Ok |");\n};\nconfig.macros.upload.basename = config.lib.file.basename;\nconfig.macros.upload.dirname = config.lib.file.dirname;\nconfig.macros.upload.toRootUrl = function (storeUrl, username)\n{\n return root = (this.dirname(storeUrl)?this.dirname(storeUrl):this.dirname(document.location.toString()));\n}\nconfig.macros.upload.toDirUrl = function (storeUrl, uploadDir, username)\n{\n var root = this.toRootUrl(storeUrl, username);\n if (uploadDir && uploadDir != '.')\n root = root + '/' + uploadDir;\n return root;\n}\nconfig.macros.upload.toFileUrl = function (storeUrl, toFilename, uploadDir, username)\n{\n return this.toDirUrl(storeUrl, uploadDir, username) + '/' + toFilename;\n}\nconfig.macros.upload.upload = function(storeUrl, toFilename, uploadDir, backupDir, username, password)\n{\n // parameters initialization\n storeUrl = (storeUrl ? storeUrl : config.options.txtUploadStoreUrl);\n toFilename = (toFilename ? toFilename : config.options.txtUploadFilename);\n backupDir = (backupDir ? backupDir : config.options.txtUploadBackupDir);\n uploadDir = (uploadDir ? uploadDir : config.options.txtUploadDir);\n username = (username ? username : config.options.txtUploadUserName);\n password = config.options.pasUploadPassword; // for security reason no password as macro parameter\n if (!password || password === '') {\n alert(config.macros.upload.messages.passwordEmpty);\n return;\n }\n if (storeUrl === '') {\n storeUrl = config.macros.upload.defaultStoreScript;\n }\n if (config.lib.file.dirname(storeUrl) === '') {\n storeUrl = config.lib.file.dirname(document.location.toString())+'/'+storeUrl;\n }\n if (toFilename === '') {\n toFilename = config.lib.file.basename(document.location.toString());\n }\n\n clearMessage();\n // only for forcing the message to display\n if (version.major < 2)\n store.notifyAll();\n if (!storeUrl) {\n alert(config.macros.upload.messages.urlParamMissing);\n return;\n }\n // Check that file is not locked\n if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {\n if (BidiX.GroupAuthoring.lock.isLocked() && !BidiX.GroupAuthoring.lock.isMyLock()) {\n alert(config.macros.upload.messages.fileLocked);\n return;\n }\n }\n \n var log = new this.UploadLog();\n log.startUpload(storeUrl, toFilename, uploadDir, backupDir);\n if (document.location.toString().substr(0,5) == "file:") {\n saveChanges();\n }\n var toDir = config.macros.upload.toDirUrl(storeUrl, toFilename, uploadDir, username);\n displayMessage(config.macros.upload.messages.aboutToUpload.format([toDir]), toDir);\n this.uploadChanges(storeUrl, toFilename, uploadDir, backupDir, username, password);\n if(config.options.chkGenerateAnRssFeed) {\n //var rssContent = convertUnicodeToUTF8(generateRss());\n var rssContent = generateRss();\n var rssPath = toFilename.substr(0,toFilename.lastIndexOf(".")) + ".xml";\n this.uploadContent(rssContent, storeUrl, rssPath, uploadDir, '', username, password, \n function (responseText) {\n if (responseText.substring(0,1) != '0') {\n displayMessage(config.macros.upload.messages.rssFileNotUploaded.format([rssPath]));\n }\n else {\n var toFileUrl = config.macros.upload.toFileUrl(storeUrl, rssPath, uploadDir, username);\n displayMessage(config.macros.upload.messages.rssFileUploaded.format(\n [toFileUrl]), toFileUrl);\n }\n // for debugging store.php uncomment last line\n //DEBUG alert(responseText);\n });\n }\n return;\n};\n\nconfig.macros.upload.uploadChanges = function(storeUrl, toFilename, uploadDir, backupDir, \n username, password) {\n var original;\n if (document.location.toString().substr(0,4) == "http") {\n original = this.download(storeUrl, toFilename, uploadDir, backupDir, username, password);\n return;\n }\n else {\n // standard way : Local file\n \n original = loadFile(getLocalPath(document.location.toString()));\n if(window.Components) {\n // it's a mozilla browser\n try {\n netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");\n var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]\n .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);\n converter.charset = "UTF-8";\n original = converter.ConvertToUnicode(original);\n }\n catch(e) {\n }\n }\n }\n //DEBUG alert(original);\n this.uploadChangesFrom(original, storeUrl, toFilename, uploadDir, backupDir, \n username, password);\n};\n\nconfig.macros.upload.uploadChangesFrom = function(original, storeUrl, toFilename, uploadDir, backupDir, \n username, password) {\n var startSaveArea = '<div id="' + 'storeArea">'; // Split up into two so that indexOf() of this source doesn't find it\n var endSaveArea = '</d' + 'iv>';\n // Locate the storeArea div's\n var posOpeningDiv = original.indexOf(startSaveArea);\n var posClosingDiv = original.lastIndexOf(endSaveArea);\n if((posOpeningDiv == -1) || (posClosingDiv == -1))\n {\n alert(config.messages.invalidFileError.format([document.location.toString()]));\n return;\n }\n var revised = original.substr(0,posOpeningDiv + startSaveArea.length) + \n allTiddlersAsHtml() + "\sn\st\st" +\n original.substr(posClosingDiv);\n var newSiteTitle;\n if(version.major < 2){\n newSiteTitle = (getElementText("siteTitle") + " - " + getElementText("siteSubtitle")).htmlEncode();\n } else {\n newSiteTitle = (wikifyPlain ("SiteTitle") + " - " + wikifyPlain ("SiteSubtitle")).htmlEncode();\n }\n\n revised = revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");\n revised = revised.replaceChunk("<!--PRE-HEAD-START--"+">","<!--PRE-HEAD-END--"+">","\sn" + store.getTiddlerText("MarkupPreHead","") + "\sn");\n revised = revised.replaceChunk("<!--POST-HEAD-START--"+">","<!--POST-HEAD-END--"+">","\sn" + store.getTiddlerText("MarkupPostHead","") + "\sn");\n revised = revised.replaceChunk("<!--PRE-BODY-START--"+">","<!--PRE-BODY-END--"+">","\sn" + store.getTiddlerText("MarkupPreBody","") + "\sn");\n revised = revised.replaceChunk("<!--POST-BODY-START--"+">","<!--POST-BODY-END--"+">","\sn" + store.getTiddlerText("MarkupPostBody","") + "\sn");\n\n var response = this.uploadContent(revised, storeUrl, toFilename, uploadDir, backupDir, \n username, password, function (responseText) {\n if (responseText.substring(0,1) != '0') {\n alert(responseText);\n displayMessage(config.macros.upload.messages.fileNotUploaded.format([getLocalPath(document.location.toString())]));\n }\n else {\n if (uploadDir !== '') {\n toFilename = uploadDir + "/" + config.macros.upload.basename(toFilename);\n } else {\n toFilename = config.macros.upload.basename(toFilename);\n }\n var toFileUrl = config.macros.upload.toFileUrl(storeUrl, toFilename, uploadDir, username);\n if (responseText.indexOf("destfile:") > 0) {\n var destfile = responseText.substring(responseText.indexOf("destfile:")+9, \n responseText.indexOf("\sn", responseText.indexOf("destfile:")));\n toFileUrl = config.macros.upload.toRootUrl(storeUrl, username) + '/' + destfile;\n }\n else {\n toFileUrl = config.macros.upload.toFileUrl(storeUrl, toFilename, uploadDir, username);\n }\n displayMessage(config.macros.upload.messages.mainFileUploaded.format(\n [toFileUrl]), toFileUrl);\n if (backupDir && responseText.indexOf("backupfile:") > 0) {\n var backupFile = responseText.substring(responseText.indexOf("backupfile:")+11, \n responseText.indexOf("\sn", responseText.indexOf("backupfile:")));\n toBackupUrl = config.macros.upload.toRootUrl(storeUrl, username) + '/' + backupFile;\n displayMessage(config.macros.upload.messages.backupFileStored.format(\n [toBackupUrl]), toBackupUrl);\n }\n var log = new config.macros.upload.UploadLog();\n log.endUpload();\n store.setDirty(false);\n // erase local lock\n if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {\n BidiX.GroupAuthoring.lock.eraseLock();\n // change mtime with new mtime after upload\n var mtime = responseText.substr(responseText.indexOf("mtime:")+6);\n BidiX.GroupAuthoring.lock.mtime = mtime;\n }\n \n \n }\n // for debugging store.php uncomment last line\n //DEBUG alert(responseText);\n }\n );\n};\n\nconfig.macros.upload.uploadContent = function(content, storeUrl, toFilename, uploadDir, backupDir, \n username, password, callbackFn) {\n var boundary = "---------------------------"+"AaB03x"; \n var request;\n try {\n request = new XMLHttpRequest();\n } \n catch (e) { \n request = new ActiveXObject("Msxml2.XMLHTTP"); \n }\n if (window.netscape){\n try {\n if (document.location.toString().substr(0,4) != "http") {\n netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');}\n }\n catch (e) {}\n } \n //DEBUG alert("user["+config.options.txtUploadUserName+"] password[" + config.options.pasUploadPassword + "]");\n // compose headers data\n var sheader = "";\n sheader += "--" + boundary + "\sr\snContent-disposition: form-data; name=\s"";\n sheader += config.macros.upload.formName +"\s"\sr\sn\sr\sn";\n sheader += "backupDir="+backupDir\n +";user=" + username \n +";password=" + password\n +";uploaddir=" + uploadDir;\n // add lock attributes to sheader\n if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {\n var l = BidiX.GroupAuthoring.lock.myLock;\n sheader += ";lockuser=" + l.user\n + ";mtime=" + l.mtime\n + ";locktime=" + l.locktime;\n }\n sheader += ";;\sr\sn"; \n sheader += "\sr\sn" + "--" + boundary + "\sr\sn";\n sheader += "Content-disposition: form-data; name=\s"userfile\s"; filename=\s""+toFilename+"\s"\sr\sn";\n sheader += "Content-Type: " + config.macros.upload.contentType + "\sr\sn";\n sheader += "Content-Length: " + content.length + "\sr\sn\sr\sn";\n // compose trailer data\n var strailer = new String();\n strailer = "\sr\sn--" + boundary + "--\sr\sn";\n //strailer = "--" + boundary + "--\sr\sn";\n var data;\n data = sheader + content + strailer;\n //request.open("POST", storeUrl, true, username, password);\n try {\n request.open("POST", storeUrl, true); \n }\n catch(e) {\n alert(config.macros.upload.messages.crossDomain + "\snError:" +e);\n exit;\n }\n request.onreadystatechange = function () {\n if (request.readyState == 4) {\n if (request.status == 200)\n callbackFn(request.responseText);\n else\n alert(config.macros.upload.messages.errorUploadingContent + "\snStatus: "+request.status.statusText);\n }\n };\n request.setRequestHeader("Content-Length",data.length);\n request.setRequestHeader("Content-Type","multipart/form-data; boundary="+boundary);\n request.send(data); \n};\n\n\nconfig.macros.upload.download = function(uploadUrl, uploadToFilename, uploadDir, uploadBackupDir, \n username, password) {\n var request;\n try {\n request = new XMLHttpRequest();\n } \n catch (e) { \n request = new ActiveXObject("Msxml2.XMLHTTP"); \n }\n try {\n if (uploadUrl.substr(0,4) == "http") {\n netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");\n }\n else {\n netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");\n }\n } catch (e) { }\n //request.open("GET", document.location.toString(), true, username, password);\n try {\n request.open("GET", document.location.toString(), true);\n }\n catch(e) {\n alert(config.macros.upload.messages.crossDomain + "\snError:" +e);\n exit;\n }\n \n request.onreadystatechange = function () {\n if (request.readyState == 4) {\n if(request.status == 200) {\n config.macros.upload.uploadChangesFrom(request.responseText, uploadUrl, \n uploadToFilename, uploadDir, uploadBackupDir, username, password);\n }\n else\n alert(config.macros.upload.messages.errorDownloading.format(\n [document.location.toString()]) + "\snStatus: "+request.status.statusText);\n }\n };\n request.send(null);\n};\n\n//}}}\n////===\n\n////+++!![Initializations]\n\n//{{{\nconfig.lib.options.init('txtUploadStoreUrl','store.php');\nconfig.lib.options.init('txtUploadFilename','');\nconfig.lib.options.init('txtUploadDir','');\nconfig.lib.options.init('txtUploadBackupDir','');\nconfig.lib.options.init('txtUploadUserName',config.options.txtUserName);\nconfig.lib.options.init('pasUploadPassword','');\nsetStylesheet(\n ".pasOptionInput {width: 11em;}\sn"+\n ".txtOptionInput.txtUploadStoreUrl {width: 25em;}\sn"+\n ".txtOptionInput.txtUploadFilename {width: 25em;}\sn"+\n ".txtOptionInput.txtUploadDir {width: 25em;}\sn"+\n ".txtOptionInput.txtUploadBackupDir {width: 25em;}\sn"+\n "",\n "UploadOptionsStyles");\nconfig.shadowTiddlers.UploadDoc = "[[Full Documentation|http://tiddlywiki.bidix.info/l#UploadDoc ]]\sn"; \nconfig.options.chkAutoSave = false; saveOptionCookie('chkAutoSave');\n\n//}}}\n////===\n\n////+++!![Core Hijacking]\n\n//{{{\nconfig.macros.saveChanges.label_orig_UploadPlugin = config.macros.saveChanges.label;\nconfig.macros.saveChanges.label = config.macros.upload.label.saveToDisk;\n\nconfig.macros.saveChanges.handler_orig_UploadPlugin = config.macros.saveChanges.handler;\n\nconfig.macros.saveChanges.handler = function(place)\n{\n if ((!readOnly) && (document.location.toString().substr(0,4) != "http"))\n createTiddlyButton(place,this.label,this.prompt,this.onClick,null,null,this.accessKey);\n};\n\n//}}}\n////===\n
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.\n\n@@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://poomk.tiddlyspot.com/controlpanel]] (your control panel username is //poomk//).\n<<tiddler tiddlyspotControls>>\n@@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.\n\n@@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.\n\n@@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]].\n\n@@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.
| tiddlyspot password:|<<option pasUploadPassword>>|\n| site management:|<<upload http://poomk.tiddlyspot.com/store.cgi index.html . . poomk>>//(requires tiddlyspot password)//<<br>>[[control panel|http://poomk.tiddlyspot.com/controlpanel]], [[download (go offline)|http://poomk.tiddlyspot.com/download]]|\n| 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]]|