EDITED TO INCLUDE WORKING SCRIPT  Here is working script based on user's answers  import sys, subprocess, socket, string import wmi, win32api, win32con    pst = subprocess.Popen(         ["D:\pstools\psloggedon.exe", "-l", "-x", "\\\\10.10.10.10"],         stdout = subprocess.PIPE,         stderr = subprocess.PIPE     )  out, error = pst.communicate()  userLoggedOn = out.split('\n')[1].strip()   print userLoggedOn, "is output"           I am trying to format output from a subprocess  Python script  import sys, subprocess, socket, string import wmi, win32api, win32con    pst = subprocess.Popen(         ["D:\pstools\psloggedon.exe", "-l", "-x", "\\\\10.10.10.10"],         stdout = subprocess.PIPE,         stderr = subprocess.PIPE     )  out, error = pst.communicate()  userLoggedOn = out.strip('Users logged on locally:')   print userLoggedOn, "is output"   Gives the following output  Users logged on locally:         DOMAIN\user is output   How do I strip out "Users logged on locally:" so that it outputs  DOMAIN\user is output
I have some simple python code that searches files for a string e.g. path=c:\path, where the c:\path part may vary. The current code is:  def find_path(i_file):     lines = open(i_file).readlines()     for line in lines:         if line.startswith("Path="):             return # what to do here in order to get line content after "Path=" ?   What is a simple way to get the text after Path=?
Add a duplicate:0|1 search operator I often search for closed questions and sift through the ones that are not duplicates to see if any of them need to be killed. Technically, closure is the first step towards deletion and the only closed posts that are actually useful are duplicates (unless it's a crappy one).  For the rest, if the community hasn't bothered to reopen it after a while or if the OP has made no effort to edit their question, I delete it if it has no redeeming content. For example, the only closed posts seen on  are exact dupes.  But this does become tedious when there are several results for various close reasons with duplicates interspersed between them. I'd like to be able to search as:  closed:1 duplicate:0   so that it gives a list of questions closed as OT/NaRQ/NC/TL. This will be similar in behaviour to migrated:0|1.   This will also be useful for 10k+ users on all sites (2k+ in beta) in the network, especially SO, so that they can search for questions to spend their delete votes on— especially closed, non-dupe questions in the tag they specialize in. More often than not, I hesitate to vote on questions that are outside my area of interest (unless it is crappy). Number of possible marriage arrangements if Marriage Condition is satisfied Suppose I have a set of $n$ boys and each subset of $1\leqslant k \leqslant n$ boys knows at least $k$ girls then this means that the set of boys $B$ satisfies the marriage condition.  I am doing an exercise from a Graph Theory book and it says we can show by induction on $n$ that the number of possible marriage arrangements is $\geqslant t!$ if every individual boy knows at least $t \leqslant n$ girls or there are $\geqslant t!/(t-n)!$ possible marriages if each individual boy knows at least $t&gt;n$ girls.   I am struggling to see how the induction hypothesis can be implemented to prove the $n+1$ case. When you swap from the $n$ to $n+1$ case the conditions change and I can't see the link between them.  Would anyone be able to point me in the right direction? Disable OS X startup sound How can I permanently disable the startup sound (or chime) in Yosemite?  (I am using a late-2014 13" macbook pro)  I already tried several options found here and there :    installed StartNinja.app => did not work installed Auto-Mute.app  => did not work tried to install the old StartupSound prefPane => did not work tried the command "sudo nvram SystemAudioVolume=%80" => volume does not change (I also tried other values than 80, such as 00, 01, or nothing)   NOTE: I know that it is possible to mute the next startup sound by turning the volume down, but this is not a permanent solution. How to combine measurement error with statistic error What are good learning resources for a LaTeX beginner? Which book (free or otherwise) was the most useful to you when you started learning LaTeX?  I am frequently asked this question by friends who want to learn LaTeX, and I recommend the book which got me started, , but I feel that there might be better options around.  Also see . $\infty = -1 $ paradox I puzzled two high school Pre-calc math teachers today with a little proof (maybe not) I found a couple years ago that infinity is equal to -1:   Let x equal the geometric series: $1 + 2 + 4 + 8 + 16 \ldots$  $x = 1 + 2 + 4 + 8 + 16 \ldots$ Multiply each side by 2:  $2x = 2 + 4 + 8 + 16 + 32 \ldots$ Again from the equation in step 1, move the $1$ term to the left hand of the equation:  $x - 1 = 2 + 4 + 8 + 16 + 32 \ldots$ So the following appears to be true:  $2x = x - 1 \implies x = -1$   This is obviously illogical. The teachers told me the problem has to do with adding the two infinite geometric series, but they weren't positive. I'm currently in Pre-calc, so I have extremely little knowledge on calculus, but a little help with this paradox would be appreciated. No chatoutput in tellraw onClick Event I'm using a /tellraw command to display some kind of menu to the player. How can I react to the clickEvent without posting something in the chat? When I try using the scoreboard, I get an output in my chat like this Set score of &lt;objective&gt; for player &lt;playername&gt; to &lt;value&gt;. The same thing happens, when trying /setblock, /entitydata or /trigger Is there any way, I can execute a command which commandblocks can detect without writing a success/fail message in the chat?  the only commands without a "real" response message I found were /say, /tell and /tellraw. But all of these are impossible to detect(also, they write something else in the chat). When an account is deleted, don't auto delete its negatively scored posts on the meta site Meta is different. Negatively scored questions are not always bad questions, and sometimes they have merit and draw good answers, especially discussions.  When an account (in the main site) is deleted, either by self deletion or by a moderator, all questions with score of -1 or less are being deleted regardless of their answers, both in the main and meta site.  Can you please change this behavior so that the questions on the per-site meta will survive and won't be auto-deleted? Derivative of an even function is odd and vice versa Prove that $u\cdot v = \frac{1}{4}||u+v||^2 - \frac{1}{4}||u-v||^2 \forall u,v \in \mathbb{R^n}$ I am trying to prove the above statement but I'm not sure if my proof is correct. My proof is as follows,  Given $u\cdot v$, we know by the C-E Inequality that $|u \cdot v| \leq ||u|| \ ||v||$  Consider $\frac{1}{4}||u+v||^2 - \frac{1}{4}||u-v||^2$  We can manipulate this as follows $$\frac{1}{4}(||u+v||^2 - ||u-v||^2) = \frac{1}{4}(||u+v||- ||u-v||)(||u+v||+||u-v||)$$ Using the triangle inequality the above can be written as follows, $$...\leq \frac{1}{4}(||u|| +||v|| -||u||+||v||) (||u|| +||v|| +||u||-||v||) = \frac{1}{4} (4||u||||v||) = ||u||||v||$$  As such both $u\cdot v$ and $u\cdot v = \frac{1}{4}||u+v||^2 - \frac{1}{4}||u-v||^2 \forall u,v \in \mathbb{R^n}$ are $\leq ||u|| ||v||$  I'm not sure whether I've proven this correctly because I ended up proving that both sides of the equation are less than or equal to something entirely different (the magnitude of v multiplied by the magnitude of u). Is this acceptable? I don't think it is, since if both can be less than or equal to the magnitudes multiplied then they do not necessarily have to be equal to each other. If this is the case, can someone give me a hint on how to move forward with this proof? How can I easily share links or text between my Android phone and my laptop? How do I remove diacritics (accents) from a string in .NET? I'm trying to convert some strings that are in French Canadian and basically, I'd like to be able to take out the French accent marks in the letters while keeping the letter. (E.g. convert é to e, so crème brûlée would become creme brulee)  What is the best method for achieving this? How to integrate OpenCV Manager in Android App Is there an official C# guideline for the order of items in terms of class structure?  Does it go:   Public Fields Private Fields Properties Constructors Methods ?   I'm curious if there is a hard and fast rule about the order of items? I'm kind of all over the place. I want to stick with a particular standard so I can do it everywhere.  The real problem is my more complex properties end up looking a lot like methods and they feel out of place at the top before the constructor.  Any tips/suggestions? The importance of a factor depends on how importance is defined.   The word importance has a fuzzy nature open to different   interpretations and the importance of a factor depends on how   importance is defined.      In other words, importance is ...   How can I complete this sentence with one word?   Edit:  I prefer to use a neutral word without negative connotations, since I'm not against having different interpretations in this case. Rather, I mean depending on how importance is defined, we need a different method. How can I get a reference to a method? Impact of deleting 100GB table on Mirroring I'm about to delete a large table which is approximately 100GB in size.  I'd like to understand the impact on the mirroring that's in place on this db.  Can anyone confirm? Can a dichotomous variable (yes/no) be merged with a Likert measure (1,2,3,4) using z scores? Caps-lock remapping stops working How to Setup GIMP 2.10 on Ubuntu 16.04 (Xenial Xerus)