As this is my first question on SO, I brought a question that's been bugging me for a couple hours. I began "playing" with Clojure some days ago, and have crossed with a rather interesting behaviour when dealing with text printing.  I wrote a small program to take a number as input and print either "ok" or "not ok" when it'd be a multiple of 3 or not. I also added a line of code to print text asking for the user to input a number before reading a line from stdin. The thing is, this print instruction is before the read-line instruction, still it doesn't print to the screen. I mean, not before actually reading from stdin.  What exactly could the problem be? I don't come from the Lisp world (in fact, CLojure is my first Lisp-like language), so I don't really get why that's happening. Any help will be much appreciated.  The code:  (defn ok [n]   (if (= (mod n 3) 0)     "ok"     "not ok"))  (defn main []   (print "Type a number: ") ; This actually prints *after* the read-line instruction   (flush) ; EDIT: The flush function is the missing part of the code. It's all ok now.   (let [n (Integer/parseInt (read-line))]     (println (ok n)))   (recur)) ; it is supposed to run until Ctrl-C is signalized  (main)   And an image of the output:   Thanks in advance!
While dabbling in Clojure I've written a very basic program to echo whatever the user types into it. However, it doesn't run in a way that I'm perceiving to be natural. Here's the code:  (defn goo []   (print "echo&gt; ")   (def resp (read-line))   (print resp) )   I would expect the code to run like this (for me typing in foo as the input to read-line):  user=&gt; (goo) echo&gt; foo foonil   But instead, the echo and read-line is switched:  user=&gt; (goo) foo echo&gt; foonil   Why does this happen? Is there a subtlety I'm missing?  EDIT: From Joe's answer, the updated correct solution is:  (defn goo []   (print "echo&gt; ")   (flush)   (def resp (read-line))   (print resp)   (flush) )   Also, the flushes aren't necessary if you use println instead of print.
How can I find my Bug-report that I submitted from the Desktop on launchpad?  I have found a partial solution to my own question:  The program that sends the Bug-reports from the desktop is called apport. It doesn't requires a launchpad account. The service whoopsie submits the Bug-Report directly to the server daisy.ubuntu.com (I'm not sure if those bugs actually appear on launchpad publicly.)  But I found my Bug-Report on my Harddisk in /var/crash/ .  From there I can copy and paste parts of the file to my opened bug on launchpad. Thanks for your tips.  Original question:  I had a severe bug, and I found someone with the same problem in launchpad. After I found a temporary fix I was able to submit the bug with the ubuntu-bug-reporter.  How can I find this ubuntu-bug-reporter generated bug-report in launchpad? I would like to combine those two bug-reports (mark as duplicate). Because the generated one has all the debug information and the other one has the description of this bug. I prefer light windows with dark menu bar as in High Sierra. However, it seems I can only choose all-dark or all-light in Mojave now. Are there any way to hybrid or customize it? I would like to use the same pipe for different applications, like in:  cat my_file | {   cmd1   cmd2   cmd3 }   Cmd1 should consume part of the input. Cmd2 should consume another part and so on.  However, each cmd eats more of the input then it read really needs due buffering.  For example:  yes | nl | {    head -n 10 &gt; /dev/null   cat  } | head -n 10   Outputs from line 912 instead of line 11.  Tee is not a good option, because each command is supposed to consume part of the stdin.   Is there a simple way to get this working? Where are the database username and password stored? I'd like to send my Drupal installation to a colleague, but I don't want him to see the username and the password of my database. Where are these informations stored?  I've seen that the username and the password are written in sitename/sites/default/settings.php, but is it the only file with these informations? Is it sufficient if I change the username and the password in this file and then send my colleague all my Drupal files and my database? If $$S=\frac{1}{1+1^2+1^4}+\frac{2}{1+2^2+2^4}+\cdots+\frac{n}{1+n^2+n^4}\,$$ find the value of $14S$.  The question can be simplified to:  Find $S=\sum\limits_{k=1}^n\,t_k$ if $t_n=\dfrac{n}{1+n^2+n^4}$.  As $1+n^2+n^4$ forms a GP, $$t_n=\frac{n(n^2-1)}{n^6-1}\,.$$ But I can't figure out how to solve further. It would be great if someone could help. How did Lucius Malfoy know Sirius's Animagus form? In Order of the Phoenix, Snape eggs on Sirius at Grimmauld Place:  ‘Tell me, how is Lucius Malfoy these days? I expect he’s delighted his lapdog’s working at Hogwarts, isn’t he?’ [Sirius] ‘Speaking of dogs,’ said Snape softly, ‘did you know that Lucius Malfoy recognised you last time you risked a little jaunt outside? Clever idea, Black, getting yourself seen on a safe station platform ... gave you a cast-iron excuse not to leave your hidey-hole in future, didn’t it?’ Order of the Phoenix - Chapter twenty-four, Occlumency - Page 460 - Bloomsbury  How did Lucius Malfoy know that Sirius was a dog Animagus? How did he know it was Sirius in the train station? Some facts to consider: According to the 's timeline, the characters who are considered to be of the Marauders era (born 1959) were only five years younger than Lucius Malfoy (born 1954), so Sirius and Snape, and the other Marauders-era students, and Lucius Malfoy, would have been at Hogwarts together for two years. Prisoner of Azkaban demonstrates it took Sirius, James, and Peter four to five years to master the Animagus transformation, which would have been at least two years after Lucius Malfoy would have left Hogwarts (Although we don't know when Lucius became a school governor.). A canon-based answer would be great; barring one, a speculative answer in the spirit of canon is welcome. Best practices for storing UI settings? we're currently planning a larger WPF LoB application and i wonder what others think being the best practice for storing lots of UI settings e.g.   Expander States Menu orders Sizing Properties etc...   i don't like the idea of having dozens of stored values using the delivered SettingsProvider (i.e. App.config file) although it can be used to store it in an embedded database using a custom SettingsProvider. being able to use some kind of databinding is also a concern. Has anyone had the same problems?   What did you do to store lots of ui user settings? Profile picture cannot have transparent background Square roots of integers and cyclotomic fields For every $ N \in \mathbb Z$ there exists an integer $n$ such that $ \sqrt N \in \mathbb Q(\zeta_n)$.   I am struggling where to start this question, please suggest me few hints. Delete questions/answers in iOS app There is currently no way to delete questions or answers in the iOS app, even with the required Trusted User privilege. We can edit and vote, but not delete.  Can this option please be added to the app? I know that in the case of Gaussian mixture, the "intuition" is that you're drawing from a PDF which itself is just a sum of weighted Gaussian PDFs.  I don't understand the intuition behind how the sum of two iid Gaussian RVs leads to a Gaussian RV. I know the maths behind it, but I'm having a hard time visualizing how the sum of two Gaussian RVs leads to a Gaussian RV (and not a mixture). vertical alignment of text in tikz node The output from the following script \documentclass{article} \usepackage{tikz} \usepackage{graphicx} \begin{document} \begin{tikzpicture}   \node(title)[text width = 0.25\textwidth, text height = 3 cm, draw]{title};   \end{tikzpicture} \end{document}  is  How can I vertically align the text in the node? Specifying the text depth as in \node(title)[text width = 0.25\textwidth, text height = 1cm, text depth = 1 cm, draw]{     title line 1\\     title line 2\\     title line 3};  Does not result in the text being vertically centred. $G$ is an infinite group.  Is it necessary true that there exists a subgroup $H$ of $G$ and $H$ is maximal ?  Is it possible that there exists such series $H_1 &lt; H_2 &lt; H_3 &lt;\cdots &lt;G $ with the property that for every $H_i$ there exists $H_{i+1}$ such that $H_i &lt; H_{i+1}$? Why have the subjunctive and indicative converged in Modern English? Automate on-site plagiarism detection There have been many cases where on-site plagiarism has been coincidentally discovered by  good citizens either while looking for , or while answering questions merely to find out one of their  etc.   Most of the cases have been identified as verbatim copy-paste of the original answer.  I understand plagiarism is considered very offensive and can't be tolerated. It is very unprofessional and unfair. So here are my questions (and possibly a feature request):   Could verbatim plagiarized content be automatically detected?  Should it be pushed into a review queue similar to low quality posts for other users to confirm? Have we ever observed two drosophila lineages that evolved reproductive isolation in labs? Background  The standard definition of species refers to the concept of . If two lineages are found to be reproductively isolated, then we consider these two lineages to belong to different species. My question concerns evolved reproductive isolation in Drosophila sp. following labs due to experimental evolution.  Question  Have we ever demonstrated that two Drosophila sp. lineages that could initially interbreed (in nature or in labs) evolved through artificial selection (and drift and mutations) in labs to finally not be able to interbreed anymore either due pre- or post- zygotic isolation (see )? Or, in other words, have we ever demonstrated that two drosophila lineages evolved to become different species (reproductive isolation definition) in labs experiments?  If not, have we ever observed some partial reproductive isolation such as inbreeding depression for example?    Note: This question is motivated by @LotusBiology that could not receive the answers she/he was waiting for because he/she failed to ask questions that are possibly answerable! So I wanted to ask this question that somehow addresses  question he/she asked (now on-hold)  For more information about the concept of species, please have a look at Quitting a job in the US on a work visa, going to Canada and re-entering on a tourist visa (ESTA waiver) I have been working in the USA on an E-3 visa and intend to return home to Australia, but I want to travel around the US before I do so. I am under the impression that after leaving my current company, I will have 10 days to leave the country.   Will I be able to go into Mexico or Canada and re-enter with an ESTA waiver as a tourist? Does a shortcode with a single attribute have to use an array? The script I use is actually returning this output:  (source /Thetra/Commun/env_ora.sh &gt;/dev/null; sh aclenv/arun)  geIlgif0t1 -DVORACLE geIlgif0t1 prg_25900: ACOMP=X geAhadlAd1 -DVORACLE geAhadlAd1 prg_25948: ACOMP=A syCcgge0t1 -DVORACLE syCcgge0t1 prg_26023: ACOMP=S2 syVcalq0t1 -DVORACLE syVcalq0t1 prg_26071: ACOMP=Y syVvali0t1 -DVORACLE syVvali0t1 prg_26119: ACOMP=Y syAedit0t1 -DVORACLE syAedit0t1 prg_26167: (1312) DBMS WARNING: Column not found in table. (-11238)   RETURN (-6)     END  END     END     IF cm_para_f2('VDEF','abQtip_0n1','unicite',syAedit0t1:$v_unicite)&lt;&gt;0      OR null_convert$(syAedit0t1:$v_unicite,'R') &lt;&gt; 'F' THEN SET syAedit0t1:$v_unicite TO 'R'     SET $v_tips_mrgl TO 'S'     SET $v_rfbt_iban, $v_rfbt_intitule, $v_orga_creancier, $v_orga_tip_adr1, $v_orga_tip_adr2,         $v_orga_tip_adr3, $v_code_docu, $v_tips_centre, $v_code_etab, $v_orga_tip_emetteur,  $v_orga_emetteur, $v_rfbt_compte, $v_orga_banque, $v_rfbt_emetteur TO     SELECT rfbt_iban, rfbt_intitule, orga_creancier, orga_tip_adr1, orga_tip_adr2, orga_tip_adr3 ACOMP=N syAvali0t1 -DVORACLE syAvali0t1 prg_26215: (2751) DBMS WARNING: Column not found in table. (-11238)  + to_string_using$(str_to_val$(substr$(clip_str$(to_string$($f_imme_no)),1,4)),'&amp;&amp;&amp;&amp;')         + to_string_using$(str_to_val$(substr$(clip_str$(to_string$($f_sepa_propriete_no)),1,5)),'&amp;&amp;&amp;&amp;&amp;')     IF syAvali0t1:$v_unicite ='R' THEN  SET $v_sepa_rum3 TO $v_sepa_rum3 + substr$(to_string_using$(syAvali0t1:$v_ordr_direct,'&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;'),7,9)     ELSE ACOMP=N syAcalc0t1 -DVORACLE syAcalc0t1 prg_26263: ACOMP=N syAcalc0t2 -DVORACLE syAcalc0t2 prg_26311: ACOMP=N syAcalc0t3 -DVORACLE syAcalc0t3 prg_26359: ACOMP=N   To check for errors I use the following command:  (source env_ora.sh &gt;/dev/null; sh aclenv/arun) | egrep '^ACOMP=$'   Output:  (1312) DBMS WARNING: Column not found in table. (-11238)   RETURN (-6)     END  END     END     IF cm_para_f2('VDEF','abQtip_0n1','unicite',syAedit0t1:$v_unicite)&lt;&gt;0      OR null_convert$(syAedit0t1:$v_unicite,'R') &lt;&gt; 'F' THEN SET syAedit0t1:$v_unicite TO 'R'     SET $v_tips_mrgl TO 'S'     SET $v_rfbt_iban, $v_rfbt_intitule, $v_orga_creancier, $v_orga_tip_adr1, $v_orga_tip_adr2,         $v_orga_tip_adr3, $v_code_docu, $v_tips_centre, $v_code_etab, $v_orga_tip_emetteur,  $v_orga_emetteur, $v_rfbt_compte, $v_orga_banque, $v_rfbt_emetteur TO     SELECT rfbt_iban, rfbt_intitule, orga_creancier, orga_tip_adr1, orga_tip_adr2, orga_tip_adr3 (2751) DBMS WARNING: Column not found in table. (-11238)  + to_string_using$(str_to_val$(substr$(clip_str$(to_string$($f_imme_no)),1,4)),'&amp;&amp;&amp;&amp;')         + to_string_using$(str_to_val$(substr$(clip_str$(to_string$($f_sepa_propriete_no)),1,5)),'&amp;&amp;&amp;&amp;&amp;')     IF syAvali0t1:$v_unicite ='R' THEN  SET $v_sepa_rum3 TO $v_sepa_rum3 + substr$(to_string_using$(syAvali0t1:$v_ordr_direct,'&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;'),7,9)     ELSE   We can see that grep is returning non matching lines.  When I redirect the stderr to stdout with this command:  (source /Thetra/Commun/env_ora.sh &gt;/dev/null; sh /Thetra/Oracle/transfert/P2016.H.1/aclenv/arun) 2&gt;&amp;1 | egrep '^ACOMP=$'   As expected, the output is void.  Why grep is returning non matching lines when stderr is not redirected ? Bluetooth headset never gives me sound options