I have a txt file on my Desktop: test.txt. I want to open that txt file and copy everything to the clipboard.  How do I do it?  I figured how to open file and read lines:  path = 'C:\Users\Username\Desktop\test.txt'  fo = open(path, 'r').readlines()   But I can't figure out how to get that data into the clipboard.
I'm trying to make a basic Windows application that builds a string out of user input and then adds it to the clipboard. How do I copy a string to the clipboard using Python?
How can I change xfce bottom panel to the top? I am using Xubuntu 12.10 and would like to change the panel which is currently on the bootm to the top.  This is the opposite of what most people using Unity want to do.    I have done this in the past but have forgotten how and could not find the info easily this time. Cheers, How to calculate Area Under the Curve (AUC), or the c-statistic, by hand I am interested in calculating area under the curve (AUC), or the c-statistic, by hand for a binary logistic regression model.  For example, in the validation dataset, I have the true value for the dependent variable, retention (1 = retained; 0 = not retained), as well as a predicted retention status for each observation generated by my regression analysis using a model that was built using the training set (this will range from 0 to 1).  My initial thoughts were to identify the "correct" number of model classifications and simply divide the number of "correct" observations by the number of total observations to calculate the c-statistic. By "correct", if the true retention status of an observation = 1 and the predicted retention status is > 0.5 then that is a "correct" classification. Additionally, if the true retention status of an observation = 0 and the predicted retention status is &lt; 0.5 then that is also a "correct" classification. I assume a "tie" would occur when the predicted value = 0.5, but that phenomenon does not occur in my validation dataset. On the other hand, "incorrect" classifications would be if the true retention status of an observation = 1 and the predicted retention status is &lt; 0.5 or if the true retention status for an outcome = 0 and the predicted retention status is > 0.5. I am aware of TP, FP, FN, TN, but not aware of how to calculate the c-statistic given this information. Testing for significance between means, having one normal distributed sample and one non normal distributed How to adjust the size and placement of chapter heading in report class How could I adjust the size and placement of chapter heading in my custom class? I am using report class as my base. When I used titlesec package inside my custom class, it threw error     ! Package titlesec Error: Not allowed in `easy'   settings. C, C++ and Java IDE for Ubuntu Is there an IDE which can run on Ubuntu that supports C, C++ and Java? I installed , but it only supported Java. I installed the C/C++ package manually, but that package gives an error if I include iostream.   Is there any other IDE which can satisfy my needs? Or can I get NetBeans with all packages pre-installed in it? Where can I download Windows 8 legally, from Microsoft? Which metric to use to evaluate highly imbalance classification model performance How do you decline nouns borrowed from languages with several categories for declining nouns (or none at all)? What is the best way to convert an array to a hash in Ruby In Ruby, given an array in one of the following forms...  [apple, 1, banana, 2] [[apple, 1], [banana, 2]]   ...what is the best way to convert this into a hash in the form of...  {apple =&gt; 1, banana =&gt; 2} var functionName = function() {} vs function functionName() {} I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consistent.  The previous developer used two ways of declaring functions and I can't work out if there is a reason behind it or not.  The two ways are:  var functionOne = function() {     // Some code };     function functionTwo() {     // Some code }   What are the reasons for using these two different methods and what are the pros and cons of each? Is there anything that can be done with one method that can't be done with the other? My Situation:   About $36k USD in graduate student loans.  There are 4 different federal loans in play, each with a fixed rate of 6.8%.   $12k w/ ~$1.2k in unpaid interest  $10k w/ ~$1k in unpaid interest  $8k w/ no unpaid interest (all principal) $6k w/ no unpaid interest (all principal)  All loans are in repayment. Some loans are subsidized, some are not. This no longer matters now that they're all in repayment though, right?     Is there a most cost efficient way to pay these loans off?  Should the interest be ignored for now on the ones that have $1k in unpaid interest for the time being, because payments to the other two loans will will go directly to principal (minus the monthly compounded interest of course)?  On the surface, I would assume that since they're all the same interest rate, it doesn't really matter, but I'm not sure how the accrued interest would factor in. I'm not interested in psychological wins like debt snowballing. I'm looking for the route that will have me paying the least. This is my first question on here. I'm trying to numerically solve the Schrödinger equation for the  and find the energy eigenvalues and eigenfunctions but I am confused about how exactly this should be done.  I've solved some initial value problems in the past using iterative methods such as Runge–Kutta. I've read that  is the way to solve Schrödinger's equation but Wikipedia also describes it as an iterative method for initial value problems.  How do I use it to solve an eigenvalue problem?  This confuses me for the following reasons:   Wouldn't iteratively solving the DE require knowledge of the energy eigenvalues to use as input to the calculation? I don't know the eigenvalues yet; they're precisely what I'm trying to calculate. If I did that, wouldn't I simply get a unique solution, instead of a family of eigenfunctions and eigenvalues?    I've seen some mention of "tridiagonal matrices" being generated somehow, but am not sure what the elements of that matrix would be or how that applies to the problem. Leandro M. mentioned that "the discretization defines a finite dimensional (matrix) eigenvalue problem". This seems like the correct road I should be going down, but I haven't been able to find anything that explicitly explains this process or how the matrix is constructed. If this is the correct procedure, how is such a matrix constructed? Is there a standard delay for consumer ratings of apps on the App Store? I have an app that's been out for a couple of weeks. Its not exactly selling like hot cakes yet, but I'm pretty sure I've gotten a rating or a review by now. But nothing shows when viewing either in iTunes or directly on the AppStore on the iPhone.  Is there a standard delay as to when ratings/reviews show up, that Apple imposes, especially for new apps? Or do you think there is some problem with Apple's system? Does anyone know how to remove this dead bolt that has no screw heads to use a screw driver? Here's a picture below. $\sum_{1}^{n}\left ( a_{i}b_{i} \right )\geq \prod_{1}^{n}\left ( a_{i}^{b_{i}} \right )$ Let $a,b,c,x,y,z&gt;0$ and $x+ y+ z= 1$. Show that $$ax+ by+ cz\geq  a^{x}.b^{y}.c^{z}$$ I have found the generalization of this inequality: For 2 sets of numbers $\left \{ a_{i} \right \}, \left \{ b_{i} \right \}&gt; 0$ and $\sum_{1}^{n}b_{i}= 1$, we have: $$\sum_{1}^{n}\left ( a_{i}b_{i} \right )\geq  \prod_{1}^{n}\left ( a_{i}^{b_{i}} \right )$$ First solution Simply compare the logs: as the natural logarithm is a concave function, one has $$\ln\bigl(a^x b^y c^z)=x\ln a+y\ln b+z\ln c\le \ln(ax+by+cz)$$ for all non-negative $x,y,z$ such that $x+y+z=1$. How about another solution? I really hope to see that. Thanks! In Java, is there any way to use the JDK libraries to discover the private classes implemented within another class? Or do I need so use something like asm? Enable thumbnail preview when uploading files in Google Chrome/Firefox? I have google chrome and when I upload photos to Facebook or Imageshack I cannot find a way to show thumbnails, only detail view. I also tried this in Firefox. This is quite important as it is stopping my friend from switching to Ubuntu over Windows.  Included a picture of the File Upload window, how do I  change this to a thumbnail view rather than the current list? Follow a pipe using less? Can less follow (by pressing F) a piped input (similarly to a file)? For a file that is being written to, the command  less &lt;file&gt;   will follow the file when pressing F.  But if I have a command that pipes output directly into less, like this  command | less   pressing F will do nothing.  So it looks like pipes cannot be followed like files can? Or maybe it has to do with command also writing to STDERR? The effect I'm trying to achieve is always see the latest output of the command: just like keeping PageDown pressed!  A related remark holds for G (go to end): when piping directly to less, it won't work. Installing python module within code I've been working a bash script to automate the process of opening and closing an LVM over LUKS external hard drive. However I continue to receive errors on line 28:   $(vgchange -a n ; cryptsetup luksClose vol)   The error I receive:  $ sudo ./encryption.sh -l Locking System.............. ./encryption.sh: line 28: 0: command not found System Locked!   Here is the rest of the code for reference:  if [ $1 = -u ] ; then     $(cryptsetup luksOpen /dev/sdb2 vol)     echo "Unlocking.................." | pv -qL 10     $(mount /dev/mapper/vol-lvroot /mnt ; mount /dev/mapper/vol-lvvar /mnt/var ; mount /dev/mapper/vol-lvhome /mnt/home ; mount /dev/sdb1 /mnt/boot)     echo "System Mounted!" | pv -qL 10 #   exit 0 fi  if [ $1 = -l ] ; then     $(umount /mnt/var ; umount /mnt/home ; umount /mnt/boot ; umount /mnt/)     echo "Locking System.............." | pv -qL 10     $(vgchange -a n ; cryptsetup luksClose vol)     echo "System Locked!" | pv -qL 10     exit 0 fi   Other information:   I receive no apparent error when running the command in question by itself interactively. I'm new to writing bash, so any recommendations and constructive criticism is appreciated. The process appears to complete successfully, but I don't understand the error or how to make them go away. Upon further research when running the troubled code alone in interactive mode it does provide output after being executed.   This is given after posting the troubled code interactively.   0 logical volume(s) in volume group "vol" now active