I've a tcl script which runs another tcl script. When the script is called, it creates a log file which is supposed to be updated in the text box(TCL GUI). I tried and failed, below is the code  So I'm planning to run the script in a thread thread1 and access the log file created and update the results in GUI text box using another thread2. If this method is right, suggest how can i modify my existing code to run in threads. I'm open for any method, as I'm a noob in TCL.   #!/usr/bin/wish  set excel_path "" set types ""  proc receive {chan} {     .m.consoleText configure -state normal     .m.consoleText insert end [read $chan]     .m.consoleText configure -state disabled     .m.consoleText see end     if {[eof $chan]} {         close $chan     } } proc processLogLine {line} {     # Write this yourself...     .m.consoleText configure -state normal     .m.consoleText insert end $line\n     .m.consoleText configure -state disabled     .m.consoleText see end } proc Run_Button {} {     cd $folder_path    set cmd_err [catch {set command [eval exec ../Run/start.tcl]} err_msg]     if {$cmd_err == 1} {     foreach line [split $err_msg "\n"] {        processLogLine $line       } else {    fconfigure $chan -blocking 0    fileevent $chan readable "receive $chan" } }  frame .m  frame .m.f -borderwidth 5 -relief sunken -width 1800 -height 900  button .m.selectExcel -text "Choose Excel" -command {  set excel_path [tk_getOpenFile -initialdir "/Run" -defaultextension ".xls" ]  } -width 10 label .m.lab -text "No File choosen" button .m.myButton -background red -text "Run" -relief ridge -borderwidth 3 -command "Run_Button" -width 10 button .m.closeButton -background red -text "Close" -relief ridge -borderwidth 3 -command exit -width 10 text .m.consoleText -background white -borderwidth 2 -relief sunken -width 180 -height 50 -yscrollcommand {.m.scrl set} scrollbar .m.scrl -orient vertical -command {.m.consoleText yview}   entry .m.boardName -relief sunken -width 15 -bd 2 -textvariable ::board  grid .m -column 0 -row 0 grid .m.f -column 0 -row 0 -columnspan 18 -rowspan 36  grid .m.selectExcel -column 0 -row 0 -columnspan 2 grid .m.lab -column 2 -row 0 -columnspan 16 grid .m.myButton -column 0 -row 1 -columnspan 2 grid .m.closeButton -column 0 -row 35 -columnspan 2 grid .m.boardName -column 0 -row 2 -columnspan 2 grid .m.consoleText -column 2 -row 2 -columnspan 8 -rowspan 30  grid .m.scrl -column 17 -row 2 -rowspan 32
is a simple way to script small GUIs.  Can anyone give a nice example with a button and a text widget. When the button is pressed should a shell command be executed and the output piped to the text widget.  If you have other nice and clean examples for useful tasks, please add them too.
Searching for a string on multiple zip files Find with proof all positive integers $n$ such that $2^n + 1 \equiv 0 \pmod{n}$ I found this problem in a book and while I understand the given solution, I don't quite understand how somebody would arrive at this solution unless they did out the casework and happened to make the right guesses to solve the problem. Any guidance on solving this from scratch would be greatly appreciated! On every use profile page the search bar on the top of the page already contains user:&lt;id&gt; text to simplify search for post of the currently visible user. But this doesn’t work correctly for the  user:        Instead of searching for posts owned by Community user I’ve got Jeff Atwood posts:        In this case minus sign was just ignored and instead of (-1, i.e. Community user), the (+1, i.e. Jeff Atwood) is used. Same happened for any other negative id for the “user:” option in the search box. What do the "+n" values mean at the end of a method name in a stack trace? How can I make a directory on the desktop?  I tried cd /desktop command but it gives an error  no such file or directory.  What's the correct command? Is there evidence of "think tank" meaning "the brain"? The  Random House Dictionary defines the expression  as:         a research institute or organization employed to solve complex problems or predict or plan future developments, as in military, political, or social areas.      According to  the above connotation  is an extention of an earliar sense  which referred to "the brain":        also think-tank, 1959 as "research institute" (first reference is to Center for Behavioral Sciences, Palo Alto, Calif.); it had been colloquial for "the brain" since 1905.      : shows usage of "think tank" only from the late '50s.  Is there evidence  of earlier usages of "think tank" meaning "the brain"? Despite  its colloquial   usage I assume  the expression was quite widespread before it was adopted by the Stanford University. How does Hisoka see Gon exactly? As a rival or as a toy to entertain himself? Hisoka hinted that Gon is his treasure and also his prey, but it can't be both, right? Because in the end, he didn't want Gon to die no matter what.  So it's weird that he didn't want Gon to die but also made him his prey to fight till death. Is it sexual for Hisoka or what? I still remember the 'Schwing' thing. Making a Comment on a page without being on that page? I have a built a Wordpress site that enables comments on pages and I am using them as reviews, what I would like to do is for someone to be able to make a comment on a page without being on that page.    On the link above, the top right, there is a link that says have your say about a university, it would be good to have a HTML form and then a dropdown box of all the child pages of university-guide; which is where all the universities are stored, and then I can put my comments.php file into this.  So my HTML form appears and when a page is picked from a dropdown box, the comment will then be assigned to that page.  Any help or direction?    New Question for Toscho:  Below is your tweaked plugin to fit into my website, as you can see I have added the select option yearSelect and need this to appear when the comments appear. How would I go about doing this? - Could you provide ay help please?      &lt;?php /* Plugin Name: haveyoursay */  /**  * Call the form in your template with:  * do_action( 'wpse_67527_comment_form' );  */ add_action( 'wpse_67527_comment_form', 'wpse_67527_comment_form' );  /**  * Create a review form.  *  * @return void  */ function wpse_67527_comment_form() {     $select_id = 'page_select';     $url = 'http' . ( is_ssl() ? 's' : '' ) . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];     $url = esc_url( $url );     ?&gt; &lt;form action="&lt;?php echo site_url( '/wp-comments-post.php' ); ?&gt;" method="post"&gt; &lt;h3&gt;Leave us your student perspective &lt;img src="/wp-content/themes/blue-and-grey/images/hmepage-tri.png"&gt;&lt;/h3&gt;     &lt;p&gt;         &lt;label for="author"&gt;&lt;?php _e( 'Name' ); ?&gt;&lt;/label&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;         &lt;input id="author" name="author" type="text" size="40" /&gt;     &lt;/p&gt;     &lt;p&gt;         &lt;label for="email"&gt;&lt;?php _e( 'Email' ); ?&gt;&lt;/label&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;         &lt;input id="email" name="email" type="text" size="40" /&gt;     &lt;/p&gt;     &lt;p&gt;         &lt;label for="&lt;?php echo $select_id; ?&gt;"&gt;             &lt;div class="clear"&gt;&lt;/div&gt;             Pick a university from the list: &amp;nbsp;&amp;nbsp;         &lt;/label&gt;         &lt;?php         // Ordered by page name automatically         wp_dropdown_pages(             array (                 'name' =&gt; 'comment_post_ID',                 'id'   =&gt; $select_id,                 'child_of' =&gt; 2,             )         );         ?&gt;       &lt;/p&gt;     &lt;div class="clear"&gt;&lt;/div&gt;     &lt;p style="margin:10px 0px 0px 0px;"&gt;Please select your year of study: &amp;nbsp;&amp;nbsp;     &lt;select name="yearSelect"&gt;     &lt;option value="1st"&gt;First Year&lt;/option&gt;     &lt;option value="2nd"&gt;Second Year&lt;/option&gt;     &lt;option value="2nd"&gt;Third Year&lt;/option&gt;     &lt;/select&gt;     &lt;/p&gt;     &lt;br /&gt;     &lt;p&gt;         &lt;textarea name="comment" cols="45" rows="8"&gt;&lt;/textarea&gt;     &lt;/p&gt;     &lt;p&gt;         &lt;?php         wp_nonce_field( 'unfiltered-html-comment_' . get_the_ID(), '_wp_unfiltered_html_comment_disabled', FALSE );         ?&gt;         &lt;input type="hidden" name="redirect_to" value="&lt;?php echo $url; ?&gt;" /&gt;         &lt;input type="submit" style="margin:15px 0px 0px 0px; padding:4px 10px;" /&gt;     &lt;/p&gt; &lt;/form&gt;     &lt;?php }  add_filter( 'comment_post_redirect', 'wpse_67527_redirect' );  /**  * Strip '#comment-number' from redirect url.  *  * @param  string $url  * @return string  */ function wpse_67527_redirect( $url ) {     $parts = explode( '#', $url );     return $parts[0]; } ?&gt; Difference between the i386 download and the amd64? What is the difference between standard i386 download and the amd64 download of Ubuntu 11.04? I am currently running the i386 on an amd machine, would my system work better with the amd64 download instead? (my machine was running Windows 7 64bit, but I neglected to look at that prior to installing Ubuntu). What are bitwise operators? How long can I store soaked beans before cooking? Use mathematical induction to prove $ (2n)!\geq 2^n(n!)^2$ for $n \in \mathbb{N}$ Mastering Telekinetic Discipline? The book says about mastering a psychic discipline:   Once a psyker has purchased 8 psychic techniques from a single Discipline, he has attained mastery of that Discipline, and the Psy Rating for all Fettered Psychic Strength uses of techniques from that Discipline gain a +1 bonus. This has no additional effect on the Unfettered or Push Psy Rating of the psyker.  But the Telekinetic discipline only has 7 techniques, then how can you attain mastery of that discipline? (Telepathy has 9 techniques, and Divination 8) Selecting ARIMA orders based on ACF-PACF vs. auto.arima I got pretty confused at that question... Can anyone help me understand this question better and/or drop some hints please? Thank you! When & How often do 4e Monster powers recharge? How often should I roll power recharge rolls and at which point in the monster's turn do I re-roll them?  I'm trying to find the official definition of the recharge mechanic in the online compendium and I'm not seeing it there. Cannot find Background Images feature in Blender 2.8 Cannot find Background Images feature to add in a photo in Blender 2.8  Where is it? Let us look at some sample data for 5 hypothetical subjects.  library(emmeans) library(lme4)  # generate some sample data # condition (Placebo, Treatment) # type (some factor, e.g. two different medications) # value (outcome of interest) # subject  data &lt;- data.frame(condition = as.factor(rep(c(0,1), times = 10)), value = rnorm(20), type = rep(c("A","B"), each = 10), subject = as.factor(rep(rep(1:5, each = 2), times = 2)))   Now we like to conduct a mixed model and post-hoc tests with emmeans, where we test conditions per type in a pairwise fashion:  # caluculate a mixed model fit_data &lt;- lmer(value ~ condition*type + (1|subject), data = data)  # emmeans post-hoc test emmeans(fit_data, pairwise ~ condition | type)   So for each type (A or B), I have paired data (condition 0 has 5 data points and condition 1 has 5 data points). If I would do a paired t-test like so:  # paired t-test t.test(data[data$condition==0 &amp; data$type=="A","value"], data[data$condition==1 &amp; data$type=="A","value"], paired = TRUE) t.test(data[data$condition==0 &amp; data$type=="B","value"], data[data$condition==1 &amp; data$type=="B","value"], paired = TRUE)   I would get degrees of freedom of 4 for the paired t-test, but emmeans says the degrees of freedom are 12. Why is there this huge difference? If the emmeans package also would use df = 4, then the p-values would also be more comparable. Why does kworker cpu usage get so high? I recently installed Ubuntu 12.04 on my Samsung laptop alongside Windows 7. Whenever I use Ubuntu (even when its idle) kworker uses almost 90% of one of 8-cores. Even though it doesn't really affect my usage, it bugs me and I am afraid of that it might harm my processor. I even tried installing another Linux distro (Linux Mint), and kworker caused the same problem. So I don't know what to do. I would really appreciate your  help. I would like a proof of the following result, given on .  For all square matrices $\mathbf{A}$ and column vectors $\mathbf{u}$ and $\mathbf{v}$ over some field $\mathbb{F}$, $$ \det(\mathbf{A}+\mathbf{uv}^\mathrm{T}) = \det(\mathbf{A}) + \mathbf{v}^\mathrm{T}\mathrm{adj}(\mathbf{A})\mathbf{u}, $$ where $\mathrm{adj}(\mathbf{A})$ is the adjugate matrix of $\mathbf{A}$.  Note that $\mathbf{A}$ may be singular. However, the proof given on wikipedia requires that $\mathbf{A}$ is nonsingular.