Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/Generic+Calculator+Namespace+Package+Example?V=57
QUERY_STRINGV=57
CONTENT_TYPE
DOCUMENT_URI/revision/Generic+Calculator+Namespace+Package+Example
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
HTTPSon
REMOTE_ADDR172.70.131.42
REMOTE_PORT44456
SERVER_PORT4443
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_X_FORWARDED_FOR3.143.205.169
HTTP_CF_RAY88625db80f1a2db2-ORD
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_VISITOR{"scheme":"https"}
HTTP_ACCEPT*/*
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_CF_CONNECTING_IP3.143.205.169
HTTP_CDN_LOOPcloudflare
HTTP_CF_IPCOUNTRYUS

Body


Error

Unknow state transition: LINE -> END

-code

1

-level

0

-errorstack

INNER {returnImm {Unknow state transition: LINE -> END} {}} CALL {my render_wikit {Generic Calculator Namespace Package Example} ***Generic\ Calculator\ Namespace\ Package\ Example***\n----\ \ \ \nThis\ page\ is\ under\ development.\ Comments\ are\nwelcome,\ but\ please\ load\ any\ comments\nin\ the\ comments\ section\ \nat\ the\ middle\ of\ the\ page.\ Thanks,\[gold\]\n----\n\[gold\]\ Here\ is\ an\ eTCL\ \ script\ for\ngeneric\ calculator\ in\ a\ namespace.\nThe\ original\ program\ used\ global\ statements\nto\ pass\ data\ among\ subroutines.\ Some\ routines\ are\ working\nin\ canvas,\ clear,fillup,exit,load\ new\ \ testcase\ and\ solve\ with\ button.\nWith\ number\ and\ all\ of\ variables\ so\ specified\ upfront,\ not\nsure\ how\ to\ float\ the\ calculations\ into\ the\ shell.\ Other\nthan\ to\ put\ an\ statement\ \ \ answer\ is\ \[\ expr\{\ side1*side2...\}\]\ \n----\ \n***\ Context\ and\ starter\ code\ for\ namespace\ version***\ \n\n\n\[aspect\]\ /excerpted/\ \ many\ of\ your\ examples\ seem\ to\ have\ a\ common\ presentation,\ with\ a\ similar\ GUI\ consisting\ of:\n\na\ set\ of\ labelled\ boxes\ for\ user\ input\na\ \"Solve\"\ button\ which\ calls\ your\ main\ logic\ with\ the\ inputs\ as\ arguments\na\ few\ \"Testcase\"\ buttons\ to\ illustrate\ examples\ and\ test\ the\ code\n\"About\",\ \"Clear\"\ and\ \"Exit\"\ buttons\n\nI\ for\ one\ would\ love\ to\ see\ the\ GUI\ side\ of\ the\ code\ factored\ out\ into\ a\ common\ framework\ which\ each\ example\ could\ share.\ That\ way\ the\ wiki\ page\ for\ each\ calculator\ example\ could\ be\ focussed\ on\ the\ logic,\ looking\ something\ more\ like\ this:\n======\nnamespace\ eval\ linear_interp\ \{\n\ \ set\ name\ \"Linear\ Interpolation\ Calculator\"\n\ \ set\ inputs\ \{\"First\ X\ value\"\ x1\ \"First\ Y\ value\"\ y1\ \"Second\ X\ value\"\ x2\ \"Second\ y\ value\"\ y2\ \"Solve\ for\ x\"\ xx\}\n\ \ set\ about\ \"This\ is\ Gold's\ linear\ interpolation\ calculator,\ ©\ 2011\n\ \ ..\ with\ some\ more\ information\ on\ how\ it\ works\ and\ is\ used,\ etc\"\n\ \ set\ testcases\ \{\n\ \ \ \ \{10.\ 10.\ 200.\ 50.\ 123.\}\n\ \ \ \ #\ etc\n\ \ \}\n\ \ proc\ calculate\ \{x1\ x2\ y1\ y2\ xx\}\ \{\n\ \ \ \ return\ \[expr\ \{some\ magic\ here\ to\ calculate\ the\ result\}\]\n\ \ \}\n\}\nload\ generic_calculator_gui.tcl\ngeneric_calculator_gui\ linear_interp\n======\nAs\ a\ secondary\ advantage,\ your\ calculator\ could\ then\ without\ modification\ be\ used\ in\ other\ contexts,\ such\ as\ a\ command\ line\ or\ web\ tool\ or\ automatically\ invoking\ all\ the\ test\ cases.\ \ Of\ course,\ the\ GUI\ can\ also\ be\ easily\ re-skinned\ to\ the\ user's\ preferences\ without\ impacting\ the\ main\ code.\n\nI\ hope\ you\ don't\ find\ the\ above\ overly\ critical\ or\ discouraging,\ that's\ certainly\ not\ my\ intention\ --\ but\ I\ do\ think\ keeping\ the\ above\ points\ in\ mind\ will\ make\ your\ pages\ more\ appealing\ to\ other\ wiki'ers\ and\ encourage\ collaboration\ ..\ which\ is\ what\ we're\ all\ here\ for,\ after\ all!\n----\n\[gold\]\ changes:\ pulled\ procs\ pi,interlinear,pol,errorx,height5.\ and\ changed\ to\ wm\ .\ \"title\".\nFormer\ idea\ was\ that\ user\ could\ use\ interpolate\ routine\ in\ the\ punched\ console.\ Conjecture\ below\ was\ that\ in\ a\ namespace\ version,\ subroutines\ would\ be\ available,\ but\ not\ all\ called\ from\ the\ namespace.\n----\nIn\ that\ case,\ you\ might\ consider\ placing\ them\ into\ a\ namespace\ (i.e.\ ::gold::)\ and\ placing\ that\ common\ code\ on\ your\ main\ \"gold\"\ page.\ \ Then\ each\ other\ example\ page\ can\ refer\ to\ that\ one\ common\ location\ for\ the\ common\ items.\ \ Of\ course\ you\ would\ want\ to\ modify\ the\ examples\ to\ both\ load\ the\ ::gold\ definitions\ file\ from\ the\ \[gold\]\ page,\ and\ to\ make\ use\ of\ the\ procs\ therein\ instead\ of\ defining\ each\ individually.\n----\n\ Testcase\ 1.\n%|quantity|number|units|%\n&|\ star\ formation\ |\ \ 10.|rate\ per\ year\ \ |&\n&|stars\ with\ planets\ \ \ \ \ \ \ \ \ \ \ \ \ |\ .5|stars|&\n&|\ potential\ life\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ 2.\ ||&\n&|\ actual\ life\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ 1.\ ||&\n&|\ fraction\ develop\ civilization\ \ |.01\ |none|&\n&|\ fraction\ technology\ \ \ \ \ \ \ \ \ \ \ \ |.01|none|&\n&|\ years\ available\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |10000.|years|&\n&|number\ of\ civilizations\ equal\ 10.*\ .5\ *\ 2.\ *\ 1.\ *\ .01\ *\ .01\ *\ 10000.||&\n&|answer:\ 10.\ ||civilizations|&\n\n----\n\n\n***Screenshots\ Section***\n\[http://img13.imageshack.us/img13/9372/image38b.gif\]\n\n----\n'''Comments\ Section'''\n\nPlease\ place\ any\ comments\ here,\ Thanks.\n\ \ \ \ \n----\n***References:***\n\ \ \ *\ http://en.wikipedia.org/wiki/Drake_equation\n\ \ \ *\ http://www.astrodigital.org/astronomy/drake_equation.html\n\ \ \ *\ \[expr\]\n\ \ \ *\ \[Importing\ expr\ functions\]\n\ \ \ *\ \[Category\ Package\]\ \n\ \ \ *\ \[Importing\ expr\ functions,\ part\ 2\]\n\ \ \ *\ \[namespace\]\n\ \ \ *\ \[package\]\n\ \ \ *\ \[Namespace\ resolution\ of\ Variables\ &\ Procedures\]\n\ \ \ *\ \[http://en.wikibooks.org/wiki/Tcl_Programming/expr\]\n\ \ \ *\ \[A\ little\ calculator\]\n\n\n----\n\n****Appendix\ Code****\n****appendix\ TCL\ programs\ and\ scripts\ ****\n----\ \n\n****Pretty\ Print\ Version\ ***\ \n***Trial\ Version\ under\ test***\n======\n\ \ \ \ \ \ \ \ \ \ package\ provide\ calculatorslot\ 1.0\n\ \ \ \ \ \ \ \ \ \ \ \ namespace\ eval\ slot\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ test\ of\ generic\ calculator\ in\ namespace\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ drake\ equation\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ written\ on\ Windows\ XP\ on\ eTCL\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ working\ under\ TCL\ version\ 8.5.6\ and\ eTCL\ 1.0.1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ gold\ on\ TCL\ WIKI\ ,\ 24may2011\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ colorhigh\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ colorback\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ answer2\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ answer3\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side2\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side3\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side4\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side5\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side6\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side7\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side8\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ maxlist\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ namespace\ export\ clearx\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ namespace\ export\ fillup\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ array\ set\ params\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ title\ \ \ \ \ \{calculator\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ width\ \ \ \ \ 400\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ height\ \ \ \ 240\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ratio\ \ \ \ \ 1.6888\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ colorback\ \{aquamarine4\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ colorhigh\ \{brown\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ maxlistx\ \ \ 5\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side1\ \ \ \ \ \ .1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side2\ \ \ \ \ \ .1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side3\ \ \ \ \ \ .1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side4\ \ \ \ \ \ .1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side5\ \ \ \ \ \ .1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side6\ \ \ \ \ \ .1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side7\ \ \ \ \ \ .1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side8\ \ \ \ \ \ .1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ maxlist\ \$params(maxlistx)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ initdisplay\ \{\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ titlex\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ colorhigh\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ colorback\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ quantitylist\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ maxlist\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side2\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side3\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side4\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side5\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side6\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side7\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side8\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ frame\ .frame\ -relief\ flat\ -bg\ \$slot::colorback\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ .frame\ -side\ top\ -fill\ y\ -anchor\ center\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ names\ \$slot::quantitylist\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ i\ \{1\ 2\ 3\ 4\ 5\ 6\ 7\ 8\ 9\ 10\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$i\ >=\ \$maxlist\}\ \{break\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ label\ .frame.label\$i\ -text\ \[lindex\ \$names\ \$i\]\ -anchor\ e\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ entry\ .frame.entry\$i\ -width\ 35\ -textvariable\ side\$i\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ grid\ .frame.label\$i\ .frame.entry\$i\ -sticky\ ew\ -pady\ 2\ -padx\ 1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ frame\ .buttons\ -bg\ \$slot::colorback\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ::ttk::button\ .calculator\ -text\ \"Solve\"\ -command\ \{\ slot::calculate\ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ::ttk::button\ .test2\ -text\ \"Testcase1\"\ -command\ \{slot::clearx\;slot::fillup\ 10.\ .5\ 2.\ 1.\ \ .01\ .01\ 10000.\ 10.\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ::ttk::button\ .test3\ -text\ \"Testcase2\"\ -command\ \{slot::clearx\;slot::fillup\ 11.\ .5\ 2.\ 1.\ \ .01\ .01\ 10001.\ 10.\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ::ttk::button\ .test4\ -text\ \"Testcase3\"\ -command\ \{slot::clearx\;slot::fillup\ 12.\ .5\ 2.\ 1.\ \ .01\ .01\ 10002.\ 10.\ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ::ttk::button\ .clearallx\ -text\ clear\ -command\ \{slot::clearx\ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ::ttk::button\ .about\ -text\ about\ -command\ \{slot::about\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ::ttk::button\ .cons\ -text\ report\ -command\ \{\ slot::reportx\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ::ttk::button\ .exit\ -text\ exit\ -command\ \{exit\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ .calculator\ \ -in\ .buttons\ -side\ top\ -padx\ 10\ -pady\ 5\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \ .clearallx\ .cons\ .about\ .exit\ .test4\ .test3\ \ .test2\ \ \ -side\ bottom\ -in\ .buttons\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ grid\ .frame\ .buttons\ -sticky\ ns\ -pady\ \{0\ 10\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .\ configure\ -background\ \$slot::colorback\ -highlightcolor\ \$slot::colorhigh\ -relief\ raised\ -border\ 30\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ wm\ title\ .\ \$slot::titlex\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ about\ \{\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ msgx\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ msg\ \$slot::msgx\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ tk_messageBox\ -title\ \"About\"\ -message\ \$msg\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ calculate\ \{\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ maxlist\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ answer2\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ answer3\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side2\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side3\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side4\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side5\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side6\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side7\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side8\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer2\ 1.\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer2\ \[\ expr\ \{\$answer2\ *\ \$::side1\ \}\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer2\ \[\ expr\ \{\$answer2\ *\ \$::side2\ \}\]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer2\ \[\ expr\ \{\$answer2\ *\ \$::side3\ \}\]\ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer2\ \[\ expr\ \{\$answer2\ *\ \$::side4\ \}\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer2\ \[\ expr\ \{\$answer2\ *\ \$::side5\ \}\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer2\ \[\ expr\ \{\$answer2\ *\ \$::side6\ \}\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer2\ \[\ expr\ \{\$answer2\ *\ \$::side7\ *1.\ \}\]\ \ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side8\ \$answer2\ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ fillup\ \{aa\ bb\ cc\ dd\ ee\ ff\ gg\ hh\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ maxlist\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ i\ \{1\ 2\ 3\ 4\ 5\ 6\ 7\ 8\ 9\ 10\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$i\ >=\ \$maxlist\}\ \{break\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .frame.entry\$i\ insert\ 0\ \"1.0\"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side2\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side3\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side4\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side5\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side6\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side7\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side8\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side1\ \$slot::params(side1)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side2\ \$slot::params(side2)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side3\ \$slot::params(side3)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side4\ \$slot::params(side4)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side5\ \$slot::params(side5)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side6\ \$slot::params(side6)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side7\ \$slot::params(side7)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side8\ \$slot::params(side8)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side1\ \$aa\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side2\ \$bb\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side3\ \$cc\ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side4\ \$dd\ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side5\ \$ee\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side6\ \$ff\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side7\ \$gg\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side8\ \$hh\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ clearx\ \{\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ maxlist\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ i\ \{1\ 2\ 3\ 4\ 5\ 6\ 7\ 8\ 9\ 10\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$i\ >=\ \$maxlist\}\ \{break\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .frame.entry\$i\ delete\ 0\ end\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ reportx\ \{\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ colorwarning\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ colorback\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ answer2\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ answer3\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side2\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side3\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side4\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side5\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side6\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side7\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side8\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ console\ show\;\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"\ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"\ \ \ \ star\ formation\ /yr:\ \ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"\ \ \ \ fraction\ w/\ planets:\ \ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"\ \ \ \ poss\ life\ :\ \ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"\ \ \ \ actual\ life:\ \ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"\ \ \ \ civiliation\ develop:\ \ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"\ \ \ \ detectable\ signs:\ \ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"\ \ \ \ length\ years:\ \ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"\ \ \ \ civilizations:\ \ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"answer\ is\ \ \ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ #--------------------------\ end\ namespace\n\ \ \ \ \ \ \ \ \ \ \ \ proc\ slotshell\ \{\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ slot::titlex\ \"Drake\ Equation\ Calculator\ in\ Namespace\"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ slot::colorback\ aquamarine4\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ slot::colorhigh\ brown\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ slot::msgx\ \"Drake\ Calculator\ in\ Namespace.\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ from\ TCL\ WIKI,\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ written\ on\ eTCL\ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ slot::quantitylist\ \ \{\{\}\ \{star\ formation\ /yr:\}\ \{fraction\ w/\ planets:\}\ \{poss\ life\ :\}\ \{actual\ life:\}\ \{civiliation\ develop:\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{detectable\ signs:\}\ \{length\ years:\}\ \{\ civilizations:\}\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ namespace\ import\ slot::*\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ array\ set\ slot::params\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ title\ \ \ \ \ \{calculatorx\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ width\ \ \ \ \ 999\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ height\ \ \ \ 999\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ratio\ \ \ \ \ 1.6888\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ colorback\ \{aquamarine4\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ colorhigh\ \{brown\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ maxlist\ \ \ \ \ 9\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side1\ \ \ \ \ \ 10.\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side2\ \ \ \ \ \ .5\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side3\ \ \ \ \ \ 2.\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side4\ \ \ \ \ \ 1.\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side5\ \ \ \ \ \ .01\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side6\ \ \ \ \ \ .01\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side7\ \ \ \ \ \ 10000.\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side8\ \ \ \ \ \ 10.\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ slot::maxlist\ \$slot::params(maxlist)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ slot::initdisplay\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ button\ configure\ statement\ does\ not\ work\ before\ or\ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ if\ initdisplay\ is\ not\ initialized!!!\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .test3\ configure\ \ -text\ \"Testcase5\"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .test3\ configure\ \ -command\ \{slot::clearx\;slot::fillup\ 11.\ .5\ 2.\ 1.\ \ .01\ .01\ 10009.\ 10.\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ slotshell\n\n======\n----\nFor\ the\ push\ buttons,\ the\ recommended\nprocedure\ is\ push\ testcase\ and\ fill\ frame,\nchange\ first\ three\ entries\ etc,\ push\ solve,\ and\nthen\ push\ report.\ Report\ allows\ \ncopy\ and\ paste\ from\ console,\ but\ntakes\ away\ from\ computer\ \"efficiency\".\n----\n\ \ \[A\ little\ calculator\]\n\ \ \ \ \ \ \ \ \ \n======\ \ \ \ \n\ \ \ \ \ \ \ \ \ package\ provide\ calculatorliner\ 1.0\n\ \ \ \ \ \ \ \ \ \ \ \ namespace\ eval\ liner\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ initdisplay\ \{\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[entry\ .e\ -textvar\ e\ -width\ 50\ \]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ bind\ .e\ <Return>\ \{catch\ \{expr\ \[string\ map\ \{/\ *1./\}\ \$e\]\}\ res\;\ set\ e\ \$res\}\ \;#\ RS\ &\ FR\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\}\n\ \ \ \ \ \ \ \ \ \ \ \ proc\ linershell\ \{\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ namespace\ import\ liner::*\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ liner::initdisplay\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .e\ configure\ -bg\ palegreen\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .e\ configure\ -fg\ black\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .e\ configure\ -font\ \{helvetica\ 50\ bold\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ focus\ .e\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ wm\ title\ .\ \"Suchenworth\ 2\ Line\ Calculator\"\n\ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ linershell\n=======\n----\n***\ tcl8.5\ code\ scraps\ ***\n======\n\ push\ report\ button\ and\ etcl\ console\ comes\ up\n\ 1%\ namespace\ import\ ::tcl::mathop::*\n\ 2%\ *\ 5\ 6\ 7\ 8\ 8\n\ 13440\n\ 3%\ *\ 2\ 2\ 2\ 2\ 2\ 2\ 2\ 2\ 2\ 2\ \n\ 1024\n\ *\ \$slot::params(side1)\ \$slot::params(side1)\ \$slot::params(side2)\ \$slot::params(side3)\n\ 2%\ \ *\ \$slot::params(side1)\ \$slot::params(side2)\ \$slot::params(side3)\ \$slot::params(side4)\n\ 10.01\n\ 4%\ winfo\ children\ .\n.frame\ .buttons\ .calculator\ .test2\ .test3\ .test4\ .clearallx\ .about\ .cons\ .exit\n\ .\ configure\ -background\ \$slot::colorback\ -highlightcolor\ \$slot::colorhigh\ -relief\ raised\ -border\ 30\n\ #\ configure\ test\ buttons\ in\ the\ shell\ \n\ #\ statements\ working\ in\ the\ console\ started\ by\ push\ report.\n\ #?\ .test3\ reported\ as\ unknown\ when\ loaded\ in\ the\ shell?\n\ #\ configure\ statement\ does\ not\ work\ if\ initdisplay\ is\ not\ initialized!!!\n\ .test3\ configure\ \ -command\ \{slot::clearx\;slot::fillup\ 19.\ .5\ 2.\ 1.\ \ .02\ .02\ 10009.\ 10.\ \}\n\ .test3\ configure\ \ -text\ \"chg_Testcase5\"\n\ \ #???\ console\ eval\ \{.test3\ configure\ \ -text\ \"Testcase\ 5\"\}\n======\n\n<<categories>>\ Numerical\ Analysis\ |\ Toys\ |\ Calculator\ |\ Example\ |\ Package regexp2} CALL {my render {Generic Calculator Namespace Package Example} ***Generic\ Calculator\ Namespace\ Package\ Example***\n----\ \ \ \nThis\ page\ is\ under\ development.\ Comments\ are\nwelcome,\ but\ please\ load\ any\ comments\nin\ the\ comments\ section\ \nat\ the\ middle\ of\ the\ page.\ Thanks,\[gold\]\n----\n\[gold\]\ Here\ is\ an\ eTCL\ \ script\ for\ngeneric\ calculator\ in\ a\ namespace.\nThe\ original\ program\ used\ global\ statements\nto\ pass\ data\ among\ subroutines.\ Some\ routines\ are\ working\nin\ canvas,\ clear,fillup,exit,load\ new\ \ testcase\ and\ solve\ with\ button.\nWith\ number\ and\ all\ of\ variables\ so\ specified\ upfront,\ not\nsure\ how\ to\ float\ the\ calculations\ into\ the\ shell.\ Other\nthan\ to\ put\ an\ statement\ \ \ answer\ is\ \[\ expr\{\ side1*side2...\}\]\ \n----\ \n***\ Context\ and\ starter\ code\ for\ namespace\ version***\ \n\n\n\[aspect\]\ /excerpted/\ \ many\ of\ your\ examples\ seem\ to\ have\ a\ common\ presentation,\ with\ a\ similar\ GUI\ consisting\ of:\n\na\ set\ of\ labelled\ boxes\ for\ user\ input\na\ \"Solve\"\ button\ which\ calls\ your\ main\ logic\ with\ the\ inputs\ as\ arguments\na\ few\ \"Testcase\"\ buttons\ to\ illustrate\ examples\ and\ test\ the\ code\n\"About\",\ \"Clear\"\ and\ \"Exit\"\ buttons\n\nI\ for\ one\ would\ love\ to\ see\ the\ GUI\ side\ of\ the\ code\ factored\ out\ into\ a\ common\ framework\ which\ each\ example\ could\ share.\ That\ way\ the\ wiki\ page\ for\ each\ calculator\ example\ could\ be\ focussed\ on\ the\ logic,\ looking\ something\ more\ like\ this:\n======\nnamespace\ eval\ linear_interp\ \{\n\ \ set\ name\ \"Linear\ Interpolation\ Calculator\"\n\ \ set\ inputs\ \{\"First\ X\ value\"\ x1\ \"First\ Y\ value\"\ y1\ \"Second\ X\ value\"\ x2\ \"Second\ y\ value\"\ y2\ \"Solve\ for\ x\"\ xx\}\n\ \ set\ about\ \"This\ is\ Gold's\ linear\ interpolation\ calculator,\ ©\ 2011\n\ \ ..\ with\ some\ more\ information\ on\ how\ it\ works\ and\ is\ used,\ etc\"\n\ \ set\ testcases\ \{\n\ \ \ \ \{10.\ 10.\ 200.\ 50.\ 123.\}\n\ \ \ \ #\ etc\n\ \ \}\n\ \ proc\ calculate\ \{x1\ x2\ y1\ y2\ xx\}\ \{\n\ \ \ \ return\ \[expr\ \{some\ magic\ here\ to\ calculate\ the\ result\}\]\n\ \ \}\n\}\nload\ generic_calculator_gui.tcl\ngeneric_calculator_gui\ linear_interp\n======\nAs\ a\ secondary\ advantage,\ your\ calculator\ could\ then\ without\ modification\ be\ used\ in\ other\ contexts,\ such\ as\ a\ command\ line\ or\ web\ tool\ or\ automatically\ invoking\ all\ the\ test\ cases.\ \ Of\ course,\ the\ GUI\ can\ also\ be\ easily\ re-skinned\ to\ the\ user's\ preferences\ without\ impacting\ the\ main\ code.\n\nI\ hope\ you\ don't\ find\ the\ above\ overly\ critical\ or\ discouraging,\ that's\ certainly\ not\ my\ intention\ --\ but\ I\ do\ think\ keeping\ the\ above\ points\ in\ mind\ will\ make\ your\ pages\ more\ appealing\ to\ other\ wiki'ers\ and\ encourage\ collaboration\ ..\ which\ is\ what\ we're\ all\ here\ for,\ after\ all!\n----\n\[gold\]\ changes:\ pulled\ procs\ pi,interlinear,pol,errorx,height5.\ and\ changed\ to\ wm\ .\ \"title\".\nFormer\ idea\ was\ that\ user\ could\ use\ interpolate\ routine\ in\ the\ punched\ console.\ Conjecture\ below\ was\ that\ in\ a\ namespace\ version,\ subroutines\ would\ be\ available,\ but\ not\ all\ called\ from\ the\ namespace.\n----\nIn\ that\ case,\ you\ might\ consider\ placing\ them\ into\ a\ namespace\ (i.e.\ ::gold::)\ and\ placing\ that\ common\ code\ on\ your\ main\ \"gold\"\ page.\ \ Then\ each\ other\ example\ page\ can\ refer\ to\ that\ one\ common\ location\ for\ the\ common\ items.\ \ Of\ course\ you\ would\ want\ to\ modify\ the\ examples\ to\ both\ load\ the\ ::gold\ definitions\ file\ from\ the\ \[gold\]\ page,\ and\ to\ make\ use\ of\ the\ procs\ therein\ instead\ of\ defining\ each\ individually.\n----\n\ Testcase\ 1.\n%|quantity|number|units|%\n&|\ star\ formation\ |\ \ 10.|rate\ per\ year\ \ |&\n&|stars\ with\ planets\ \ \ \ \ \ \ \ \ \ \ \ \ |\ .5|stars|&\n&|\ potential\ life\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ 2.\ ||&\n&|\ actual\ life\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ 1.\ ||&\n&|\ fraction\ develop\ civilization\ \ |.01\ |none|&\n&|\ fraction\ technology\ \ \ \ \ \ \ \ \ \ \ \ |.01|none|&\n&|\ years\ available\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |10000.|years|&\n&|number\ of\ civilizations\ equal\ 10.*\ .5\ *\ 2.\ *\ 1.\ *\ .01\ *\ .01\ *\ 10000.||&\n&|answer:\ 10.\ ||civilizations|&\n\n----\n\n\n***Screenshots\ Section***\n\[http://img13.imageshack.us/img13/9372/image38b.gif\]\n\n----\n'''Comments\ Section'''\n\nPlease\ place\ any\ comments\ here,\ Thanks.\n\ \ \ \ \n----\n***References:***\n\ \ \ *\ http://en.wikipedia.org/wiki/Drake_equation\n\ \ \ *\ http://www.astrodigital.org/astronomy/drake_equation.html\n\ \ \ *\ \[expr\]\n\ \ \ *\ \[Importing\ expr\ functions\]\n\ \ \ *\ \[Category\ Package\]\ \n\ \ \ *\ \[Importing\ expr\ functions,\ part\ 2\]\n\ \ \ *\ \[namespace\]\n\ \ \ *\ \[package\]\n\ \ \ *\ \[Namespace\ resolution\ of\ Variables\ &\ Procedures\]\n\ \ \ *\ \[http://en.wikibooks.org/wiki/Tcl_Programming/expr\]\n\ \ \ *\ \[A\ little\ calculator\]\n\n\n----\n\n****Appendix\ Code****\n****appendix\ TCL\ programs\ and\ scripts\ ****\n----\ \n\n****Pretty\ Print\ Version\ ***\ \n***Trial\ Version\ under\ test***\n======\n\ \ \ \ \ \ \ \ \ \ package\ provide\ calculatorslot\ 1.0\n\ \ \ \ \ \ \ \ \ \ \ \ namespace\ eval\ slot\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ test\ of\ generic\ calculator\ in\ namespace\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ drake\ equation\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ written\ on\ Windows\ XP\ on\ eTCL\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ working\ under\ TCL\ version\ 8.5.6\ and\ eTCL\ 1.0.1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ gold\ on\ TCL\ WIKI\ ,\ 24may2011\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ colorhigh\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ colorback\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ answer2\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ answer3\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side2\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side3\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side4\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side5\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side6\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side7\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side8\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ maxlist\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ namespace\ export\ clearx\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ namespace\ export\ fillup\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ array\ set\ params\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ title\ \ \ \ \ \{calculator\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ width\ \ \ \ \ 400\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ height\ \ \ \ 240\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ratio\ \ \ \ \ 1.6888\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ colorback\ \{aquamarine4\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ colorhigh\ \{brown\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ maxlistx\ \ \ 5\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side1\ \ \ \ \ \ .1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side2\ \ \ \ \ \ .1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side3\ \ \ \ \ \ .1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side4\ \ \ \ \ \ .1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side5\ \ \ \ \ \ .1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side6\ \ \ \ \ \ .1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side7\ \ \ \ \ \ .1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side8\ \ \ \ \ \ .1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ maxlist\ \$params(maxlistx)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ initdisplay\ \{\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ titlex\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ colorhigh\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ colorback\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ quantitylist\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ maxlist\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side2\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side3\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side4\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side5\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side6\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side7\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side8\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ frame\ .frame\ -relief\ flat\ -bg\ \$slot::colorback\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ .frame\ -side\ top\ -fill\ y\ -anchor\ center\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ names\ \$slot::quantitylist\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ i\ \{1\ 2\ 3\ 4\ 5\ 6\ 7\ 8\ 9\ 10\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$i\ >=\ \$maxlist\}\ \{break\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ label\ .frame.label\$i\ -text\ \[lindex\ \$names\ \$i\]\ -anchor\ e\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ entry\ .frame.entry\$i\ -width\ 35\ -textvariable\ side\$i\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ grid\ .frame.label\$i\ .frame.entry\$i\ -sticky\ ew\ -pady\ 2\ -padx\ 1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ frame\ .buttons\ -bg\ \$slot::colorback\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ::ttk::button\ .calculator\ -text\ \"Solve\"\ -command\ \{\ slot::calculate\ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ::ttk::button\ .test2\ -text\ \"Testcase1\"\ -command\ \{slot::clearx\;slot::fillup\ 10.\ .5\ 2.\ 1.\ \ .01\ .01\ 10000.\ 10.\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ::ttk::button\ .test3\ -text\ \"Testcase2\"\ -command\ \{slot::clearx\;slot::fillup\ 11.\ .5\ 2.\ 1.\ \ .01\ .01\ 10001.\ 10.\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ::ttk::button\ .test4\ -text\ \"Testcase3\"\ -command\ \{slot::clearx\;slot::fillup\ 12.\ .5\ 2.\ 1.\ \ .01\ .01\ 10002.\ 10.\ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ::ttk::button\ .clearallx\ -text\ clear\ -command\ \{slot::clearx\ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ::ttk::button\ .about\ -text\ about\ -command\ \{slot::about\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ::ttk::button\ .cons\ -text\ report\ -command\ \{\ slot::reportx\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ::ttk::button\ .exit\ -text\ exit\ -command\ \{exit\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ .calculator\ \ -in\ .buttons\ -side\ top\ -padx\ 10\ -pady\ 5\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \ .clearallx\ .cons\ .about\ .exit\ .test4\ .test3\ \ .test2\ \ \ -side\ bottom\ -in\ .buttons\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ grid\ .frame\ .buttons\ -sticky\ ns\ -pady\ \{0\ 10\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .\ configure\ -background\ \$slot::colorback\ -highlightcolor\ \$slot::colorhigh\ -relief\ raised\ -border\ 30\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ wm\ title\ .\ \$slot::titlex\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ about\ \{\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ msgx\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ msg\ \$slot::msgx\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ tk_messageBox\ -title\ \"About\"\ -message\ \$msg\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ calculate\ \{\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ maxlist\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ answer2\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ answer3\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side2\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side3\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side4\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side5\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side6\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side7\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side8\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer2\ 1.\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer2\ \[\ expr\ \{\$answer2\ *\ \$::side1\ \}\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer2\ \[\ expr\ \{\$answer2\ *\ \$::side2\ \}\]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer2\ \[\ expr\ \{\$answer2\ *\ \$::side3\ \}\]\ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer2\ \[\ expr\ \{\$answer2\ *\ \$::side4\ \}\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer2\ \[\ expr\ \{\$answer2\ *\ \$::side5\ \}\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer2\ \[\ expr\ \{\$answer2\ *\ \$::side6\ \}\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer2\ \[\ expr\ \{\$answer2\ *\ \$::side7\ *1.\ \}\]\ \ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side8\ \$answer2\ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ fillup\ \{aa\ bb\ cc\ dd\ ee\ ff\ gg\ hh\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ maxlist\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ i\ \{1\ 2\ 3\ 4\ 5\ 6\ 7\ 8\ 9\ 10\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$i\ >=\ \$maxlist\}\ \{break\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .frame.entry\$i\ insert\ 0\ \"1.0\"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side2\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side3\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side4\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side5\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side6\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side7\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side8\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side1\ \$slot::params(side1)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side2\ \$slot::params(side2)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side3\ \$slot::params(side3)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side4\ \$slot::params(side4)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side5\ \$slot::params(side5)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side6\ \$slot::params(side6)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side7\ \$slot::params(side7)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side8\ \$slot::params(side8)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side1\ \$aa\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side2\ \$bb\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side3\ \$cc\ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side4\ \$dd\ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side5\ \$ee\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side6\ \$ff\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side7\ \$gg\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::side8\ \$hh\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ clearx\ \{\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ maxlist\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ i\ \{1\ 2\ 3\ 4\ 5\ 6\ 7\ 8\ 9\ 10\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$i\ >=\ \$maxlist\}\ \{break\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .frame.entry\$i\ delete\ 0\ end\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ reportx\ \{\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ colorwarning\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ colorback\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ answer2\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ answer3\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side2\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side3\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side4\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side5\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side6\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side7\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ variable\ side8\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ console\ show\;\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"\ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"\ \ \ \ star\ formation\ /yr:\ \ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"\ \ \ \ fraction\ w/\ planets:\ \ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"\ \ \ \ poss\ life\ :\ \ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"\ \ \ \ actual\ life:\ \ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"\ \ \ \ civiliation\ develop:\ \ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"\ \ \ \ detectable\ signs:\ \ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"\ \ \ \ length\ years:\ \ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"\ \ \ \ civilizations:\ \ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ \"answer\ is\ \ \ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ #--------------------------\ end\ namespace\n\ \ \ \ \ \ \ \ \ \ \ \ proc\ slotshell\ \{\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ slot::titlex\ \"Drake\ Equation\ Calculator\ in\ Namespace\"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ slot::colorback\ aquamarine4\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ slot::colorhigh\ brown\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ slot::msgx\ \"Drake\ Calculator\ in\ Namespace.\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ from\ TCL\ WIKI,\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ written\ on\ eTCL\ \"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ slot::quantitylist\ \ \{\{\}\ \{star\ formation\ /yr:\}\ \{fraction\ w/\ planets:\}\ \{poss\ life\ :\}\ \{actual\ life:\}\ \{civiliation\ develop:\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{detectable\ signs:\}\ \{length\ years:\}\ \{\ civilizations:\}\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ namespace\ import\ slot::*\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ array\ set\ slot::params\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ title\ \ \ \ \ \{calculatorx\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ width\ \ \ \ \ 999\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ height\ \ \ \ 999\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ratio\ \ \ \ \ 1.6888\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ colorback\ \{aquamarine4\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ colorhigh\ \{brown\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ maxlist\ \ \ \ \ 9\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side1\ \ \ \ \ \ 10.\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side2\ \ \ \ \ \ .5\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side3\ \ \ \ \ \ 2.\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side4\ \ \ \ \ \ 1.\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side5\ \ \ \ \ \ .01\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side6\ \ \ \ \ \ .01\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side7\ \ \ \ \ \ 10000.\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ side8\ \ \ \ \ \ 10.\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ slot::maxlist\ \$slot::params(maxlist)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ slot::initdisplay\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ button\ configure\ statement\ does\ not\ work\ before\ or\ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ if\ initdisplay\ is\ not\ initialized!!!\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .test3\ configure\ \ -text\ \"Testcase5\"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .test3\ configure\ \ -command\ \{slot::clearx\;slot::fillup\ 11.\ .5\ 2.\ 1.\ \ .01\ .01\ 10009.\ 10.\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ slotshell\n\n======\n----\nFor\ the\ push\ buttons,\ the\ recommended\nprocedure\ is\ push\ testcase\ and\ fill\ frame,\nchange\ first\ three\ entries\ etc,\ push\ solve,\ and\nthen\ push\ report.\ Report\ allows\ \ncopy\ and\ paste\ from\ console,\ but\ntakes\ away\ from\ computer\ \"efficiency\".\n----\n\ \ \[A\ little\ calculator\]\n\ \ \ \ \ \ \ \ \ \n======\ \ \ \ \n\ \ \ \ \ \ \ \ \ package\ provide\ calculatorliner\ 1.0\n\ \ \ \ \ \ \ \ \ \ \ \ namespace\ eval\ liner\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ initdisplay\ \{\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[entry\ .e\ -textvar\ e\ -width\ 50\ \]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ bind\ .e\ <Return>\ \{catch\ \{expr\ \[string\ map\ \{/\ *1./\}\ \$e\]\}\ res\;\ set\ e\ \$res\}\ \;#\ RS\ &\ FR\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\}\n\ \ \ \ \ \ \ \ \ \ \ \ proc\ linershell\ \{\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ namespace\ import\ liner::*\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ liner::initdisplay\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .e\ configure\ -bg\ palegreen\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .e\ configure\ -fg\ black\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .e\ configure\ -font\ \{helvetica\ 50\ bold\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ focus\ .e\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ wm\ title\ .\ \"Suchenworth\ 2\ Line\ Calculator\"\n\ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ linershell\n=======\n----\n***\ tcl8.5\ code\ scraps\ ***\n======\n\ push\ report\ button\ and\ etcl\ console\ comes\ up\n\ 1%\ namespace\ import\ ::tcl::mathop::*\n\ 2%\ *\ 5\ 6\ 7\ 8\ 8\n\ 13440\n\ 3%\ *\ 2\ 2\ 2\ 2\ 2\ 2\ 2\ 2\ 2\ 2\ \n\ 1024\n\ *\ \$slot::params(side1)\ \$slot::params(side1)\ \$slot::params(side2)\ \$slot::params(side3)\n\ 2%\ \ *\ \$slot::params(side1)\ \$slot::params(side2)\ \$slot::params(side3)\ \$slot::params(side4)\n\ 10.01\n\ 4%\ winfo\ children\ .\n.frame\ .buttons\ .calculator\ .test2\ .test3\ .test4\ .clearallx\ .about\ .cons\ .exit\n\ .\ configure\ -background\ \$slot::colorback\ -highlightcolor\ \$slot::colorhigh\ -relief\ raised\ -border\ 30\n\ #\ configure\ test\ buttons\ in\ the\ shell\ \n\ #\ statements\ working\ in\ the\ console\ started\ by\ push\ report.\n\ #?\ .test3\ reported\ as\ unknown\ when\ loaded\ in\ the\ shell?\n\ #\ configure\ statement\ does\ not\ work\ if\ initdisplay\ is\ not\ initialized!!!\n\ .test3\ configure\ \ -command\ \{slot::clearx\;slot::fillup\ 19.\ .5\ 2.\ 1.\ \ .02\ .02\ 10009.\ 10.\ \}\n\ .test3\ configure\ \ -text\ \"chg_Testcase5\"\n\ \ #???\ console\ eval\ \{.test3\ configure\ \ -text\ \"Testcase\ 5\"\}\n======\n\n<<categories>>\ Numerical\ Analysis\ |\ Toys\ |\ Calculator\ |\ Example\ |\ Package} CALL {my revision {Generic Calculator Namespace Package Example}} CALL {::oo::Obj1658365 process revision/Generic+Calculator+Namespace+Package+Example} CALL {::oo::Obj1658363 process}

-errorcode

NONE

-errorinfo

Unknow state transition: LINE -> END
    while executing
"error $msg"
    (class "::Wiki" method "render_wikit" line 6)
    invoked from within
"my render_$default_markup $N $C $mkup_rendering_engine"
    (class "::Wiki" method "render" line 8)
    invoked from within
"my render $name $C"
    (class "::Wiki" method "revision" line 31)
    invoked from within
"my revision $page"
    (class "::Wiki" method "process" line 56)
    invoked from within
"$server process [string trim $uri /]"

-errorline

4