Python script has no stdout when started via i3blocks In i3blocks, I have defined a block like this: ~/.config/i3blocks/config: [test] interval=persist format=json  The corresponding executable script: ~/.config/i3blocks/config.scripts/test: #!/usr/bin/python  from time import sleep  while True:      print(&quot;test&quot;)      sleep(5)  I intend to replace &quot;test&quot; with an actual JSON-String later, I just stripped it down to this version for debugging purposes. When I execute this on the command line, test gets printed to stdout every 5 seconds, as expected. I can get the PID with ps aux and check strace: $ sudo strace -p82267 -s9999 -e write strace: Process 82267 attached write(1, &quot;test\n&quot;, 5)                   = 5 write(1, &quot;test\n&quot;, 5)                   = 5 [...]  ps aux also shows me the other process that i3blocks has started. strace with that process gives me no output, and I don't understand why. The loop seems to be running, but there is no stdout. To verify this, I removed the loop and restarted i3blocks, and the process is not listed anymore. Why is there no stdout when i3blocks starts the process, and what can I do about that? Edit: I let it run for a long while and just noticed: strace shows me that a whole bunch of text was dumped to stdout all at once: $ sudo strace -p79878 -s9999 -e write strace: Process 79878 attached --- SIGSTOP {si_signo=SIGSTOP, si_code=SI_USER, si_pid=79873, si_uid=1000} --- --- stopped by SIGSTOP --- --- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=79873, si_uid=1000}  write(1, &quot;test\ntest\n[...a big big block of output here...]test\ntest&quot;, 8194) = 8194  The SIGSTOP and SIGCONT also happened several times. So it seems like the output is stored in some buffer for very long, and then dumped to stdout all at once at some point. What can I do about that?
Write Python stdout to file immediately When trying to write the stdout from a Python script to a text file (python script.py &gt; log), the text file is created when the command is started, but the actual content isn't written until the Python script finishes. For example:  script.py:  import time for i in range(10):     print('bla')     time.sleep(5)   prints to stdout every 5 seconds when called with python script.py, but when I call python script.py &gt; log, the size of the log file stays zero until the script finishes. Is it possible to directly write to the log file, such that you can follow the progress of the script (e.g. using tail)?   EDIT It turns out that python -u script.py does the trick, I didn't know about the buffering of stdout.
I want to do research but I'm too old for a PHD I really love research. I started a research project in graduate school for my M.A. in English. My research topic is a very viable and interesting topic for a dissertation. I'll be 60 on my next birthday and I know that many Ph.D programs are traditionally geared toward younger students.I was wondering are there any programs that I can continue this research in without facing the issues of ageism in academia? Do Fortnite V-Bucks Purchases Save on All Platforms? So I'm thinking of buying some V-Bucks on Fortnite, Battle Royale mobile. Do the purchases save cross platform? How To Change The Fonts In Windows 8 In Windows 7, there is an option to change the fonts for things such as the active title bar, menu, etc. It was found by opening the Window Color and Appearance settings in the Control Panel. I just installed Windows 8 and would like to change the fonts, but I can't find anything to change the actual fonts (there is however a limited drop-down list to change a few font sizes in the appearance settings). Does anyone how to change the fonts used in Windows 8? Chemical potential of particles with zero mass Why massless particles have zero chemical potential? A text says:     The surface tension of a liquid results from an imbalance of intermolecular attractive forces, the cohesive forces between molecules:   A molecule in the bulk liquid experiences cohesive forces with other molecules in all directions.   A molecule at the surface of a liquid experiences only net inward cohesive forces   If this is the case: Why is surface tension considered or experienced as a force parallel to the interface while it is so obvious that it must be perpendicular to it? How to buy plane tickets for job interviews? I am currently on the academic job market, and scheduling on-campus interviews with institutions that might want to hire me.  Suppose I am invited to an on-campus interview at the University of X, and must travel there by air.  They handle travel on a reimbursement basis: I buy the plane ticket, and then they reimburse me.  However, the interview is a few weeks away.  Since the job market sometimes moves fast, there is a chance that by the time of the scheduled interview, I may have already accepted another offer (say from the University of Y).  Of course I should then decline the interview at X, but I would have already bought the plane ticket.  How should I plan for this contingency?   I could buy a refundable ticket to X.  However, these are normally several times the price of a non-refundable ticket, and if I do end up traveling to X, they might balk at reimbursing me for such an expensive fare. I could buy a non-refundable ticket to X.  If I end up not going there, I could ask X to reimburse me for the cost of the ticket (or at least the "change fee" charged by the airline to let me use the ticket's value for a future flight).  However, I suspect they will be reluctant to reimburse me for a trip I'm not making, and might refuse to do so altogether, in which case I am out-of-pocket. I could wait until the last minute to buy a non-refundable ticket for X.  But it may still be expensive for them (or may exceed their limits), and the most convenient flights may be sold out. I could contact University of X and ask them for guidance.  I'm a bit hesitant to do this, as I am afraid that if I bring up the possibility that I might accept another position, they might think I am not seriously interested in theirs.   Is there a standard way to handle this situation?  This is in the United States, if it matters. Are there concerns with doing a generalized additive model with a smoothing term of multiple variables? In R, usually one performs a generalized additive model like so:  library(mgcv) x &lt;- gam(depvar ~ s(indvar1) + s(indvar2) + parametricvar)   Say I want to explore the non-parametric interaction of indvar1 and indvar2.  Is the following kosher?  x &lt;- gam(depvar ~ s(indvar,indvar2) + parametricvar) Rules when using a Joker I had on my rack among other tiles, a black 9, 1 x blue 10, and a black 12.  On the table was a set of 3 x 10s including a Joker(no blue 10), and other sets of tiles including an available black 11.  Can I replace the joker with my blue 10 and then set out :  my black 9, the joker(representing a black 10), a black 11 from the table, and my black 12? Elastic collision in two dimensions Suppose a particle with mass $m_1$ and speed $v_{1i}$ undergoes an elastic collision with stationary particle of mass $m_2$. After the collision, particle of mass $m_1$ moves with speed $v_{1f}$ in a direction of angle $\theta$ above the line it was moving previously. Particle with mass $m_2$ moves with speed $v_{2f}$ in a direction of angle $\phi$ below the line which particle with mass $m_1$ was moving previously. Using equations for conservation of momentum and kinetic energy, how can we prove these two equations  $\frac{v_{1f}}{v_{1i}}=\frac{m_1}{m_1+m_2}[\cos \theta \pm  \sqrt{\cos^2 \theta - \frac{m_1^2-m_2^2}{m_1^2}}]$  and  $\frac{\tan(\theta +\phi)}{\tan(\phi)}=\frac{m_1+m_2}{m_1-m_2}$ ?  EDIT. Here is what I've done:  For the first one, set the $xy$ coordinate system so that the positive direction of the $x$ axis points toward the original path of the particle with mass $m_1$. So we have three equations:  $m_1v_{1i}=m_1v_{1f}\cos \theta + m_2v_{2f} \cos \phi$  $0=m_1v_{1f}\sin \theta - m_2v_{2f}\sin \phi$  $m_1v_{1i}^2=m_1v_{1f}^2+m_2v_{2f}^2$.  From the second one, we get:  $v_{2f}=\frac{m_1v_{1f}\sin \theta}{m_2 \sin \phi}$  Plotting this into third equation, we get  $v_{1i}^2=v_{1f}^2(1+\frac{m_1 \sin^2 \theta}{m_2 \sin^2 \phi})$ (1)  From the first equation, we have  $\cos \phi =\frac{m_1(v_{1i}-v_{1f}\cos \theta)}{m_2v_{2f}}$  which after applying the equation we have for $v_2f$ becomes  $\sin^2 \phi = \frac{1}{1+\frac{(v_{1i}-v_{1f}\cos \theta)^2}{\sin^2 \theta \times v_1f^2}}$  Plotting this into equation (1), gives us an equation in terms of $m_1$, $m_2$, $v_{1f}$, $v_{1i}$ and $\theta$, but it is too far from what I expected.  For the second one, assigning the $xy$ coordinate in a way that the positive direction of the $x$ axis points toward the final path of the particle $m_2$, will give us three equations (two for conservation of linear momentum and one for conservation of kinetic energy), but I don't know what to do next. We're all familair with this beautiful proof whether or not an irrational number to an irrational power can be rational. It goes something like this:  Take $(\sqrt{2})^{\sqrt{2}}$  If it's rational, then you proved it, if it's irrational, take $((\sqrt{2})^{\sqrt{2}} ){^\sqrt{2}} = 2$ and you've proved it.  I'm wondering if you can raise $\pi$ or $e$ to a certain non-trivial real power to make it rational? And if not, where is the proof that it can't be done?   p.s. - I almost left out the real part, but then I realized that $e^{i\pi} = -1$. Why is \[ ... \] preferable to $$ ... $$? I've heard that you should use \[ ... \] for displayed equations instead of  $$ ... $$, but why is that?  I'd assumed that it's so that you can more easily tell which are starting and which are ending delimiters, but if I always use a syntax-highlighting text editor, I can see that easily based on the color of the symbols.  Is there any reason for this suggestion? Double-blind review with four references in a row? I've read a lot of answers here about double-blind reviews and thesis or single articles.  My problem comes from having four self-references in my article. I feel that if I include them all, could be very easy to infer that this is the fifth one (It's a 4-year granted project and I have been collaborating in a number of software components inside a bigger architecture, now it's the time to use them all to interact with other applications) . But if I ommit some of them, I could end being accused of self-plagiarism. The other articles have been published in the proceedings of conferences that didn't require double-blind reviews, this is the first submission I make to a conference that asks for it (Maybe because of being CORE A) Also not worthless to mention that I'm going to send it as a short paper, so actually it'd be very helpful to cite rather than to repeat past texts.  What should I do? Starting with the episode "Crossroads Part II" the      final five Cylons begin to hear Bob Dylan's "All Along the Watchtower" in their heads.   Have the creators/writers ever stated why they picked that song in particular and what it might mean to the story? What is *Cell standby* and how can I keep it from eating my battery? Looking up my battery statistics, I almost always find Cell standby amongst the top consumers:    I never thought that "idle" would use so much energy. I saw that other people encounter similar problems:       Answers on those questions just give some raw ideas. I would like to know what exactly stands behind this, an whether there are ways to keep this "standby" from eating my battery? Why is the unit for capacitance so large? How to put a brace on the right, not left, to group cases? How can I get a brace on the right, not the left, to group cases, using cases? (I know actual cases look better with the brace on the left, but the items I need to group are not literally cases. They are a set of steps in an algorithm which I want to consider as an item.)  The following puts the brace on the left. All I need to do is to flip it to the right.  \begin{align} \begin{cases} a&amp;=bbb\\ c&amp;=ddddddd\\ e&amp;=ffffffffff \end{cases} \end{align}   Thanks for any help with this! I am getting the following error frequently. (Example: when running zenity,firefox etc. commands / applications.)  Fontconfig warning: "/etc/fonts/conf.d/90-fonts-unfonts-core.conf", line 11: Having multiple values in &lt;test&gt; isn't supported and may not work as expected   Here is contents of file /etc/fonts/conf.d/90-fonts-unfonts-core.conf:  &lt;?xml version="1.0"?&gt; &lt;!DOCTYPE fontconfig SYSTEM "fonts.dtd"&gt; &lt;fontconfig&gt;     &lt;match target="font"&gt;         &lt;test name="family" qual="any"&gt;             &lt;string&gt;은 바탕&lt;/string&gt;&lt;string&gt;UnBatang&lt;/string&gt;                 &lt;string&gt;은 돋움&lt;/string&gt;&lt;string&gt;UnDotum&lt;/string&gt;                 &lt;string&gt;은 궁서&lt;/string&gt;&lt;string&gt;UnGungseo&lt;/string&gt;                 &lt;string&gt;은 필기&lt;/string&gt;&lt;string&gt;UnPilgi&lt;/string&gt;                 &lt;string&gt;은 그래픽&lt;/string&gt;&lt;string&gt;UnGraphic&lt;/string&gt;         &lt;/test&gt;          &lt;edit name="antialias" mode="assign" binding="strong"&gt;&lt;bool&gt;true&lt;/bool&gt;&lt;/edit&gt;         &lt;edit name="hinting"   mode="assign" binding="strong"&gt;&lt;bool&gt;false&lt;/bool&gt;&lt;/edit&gt;         &lt;edit name="autohint"  mode="assign" binding="strong"&gt;&lt;bool&gt;true&lt;/bool&gt;&lt;/edit&gt;         &lt;edit name="hintstyle" mode="assign" binding="strong"&gt;&lt;const&gt;hintslight&lt;/const&gt;&lt;/edit&gt;     &lt;/match&gt; &lt;/fontconfig&gt;   How to solve it? I sold an investment in a standard brokerage account at a small loss because I needed the money for a down payment.  I still think it is a good investment, can I buy the same investment in a standard IRA without running into wash sale problems?  I will probably just wait the 30 days any way to avoid any headaches, but I want to know if there is a definitive answer on this.    Being as the cost basis in the traditional IRA doesn't matter, I wouldn't think there would be a problem. Notify-send ignores timeout? Maybe I'm doing something wrong, but shouldn't the commands (run separately) notify-send -t 1 &quot;test&quot; notify-send -t 1000 &quot;test&quot; notify-send -t 10000 &quot;test&quot;  have different timeouts? The first being nearly instantaneous, the second taking 1 sec and the third 10 seconds? In all cases it seems to take about six seconds for me. Is there a way around this behaviour? As the developers label this as a &quot;feature&quot; instead of a bug, I would like some alternatives. Extruding Vector Files in Blender I am sure this has been discussed quite a few times, but I found a tutorial recently doing the exact same thing as I did, but in my case my logo is messing up!  Here is the link to the workflow:   This is what it looks like after adding the solidify modifier:   I already recalced the normals of my spline, but besides that it messes up my spline shape, it had no effect.  Any suggestions on how to fix it?