Python3 - Same values different ids
"is" operator behaves unexpectedly with integers
How can I profile a multithread program in Python? I'm developing an inherently multithreaded module in Python, and I'd like to find out where it's spending its time. cProfile only seems to profile the main thread. Is there any way of profiling all threads involved in the calculation? Same e-mail user, different address? I have an iPhone 4s with iOS7 and somehow I see iCloud music which I haven't downloaded yet on my iOS device. How can I get rid of these, I do not need to see them. Touchpad stopped working 20.04 My Arcpy code is not working in ArcMap 10.1 because an error with the last line:      Error 000824: The tool is not licensed.    I have all my extensions turned on, so I don't know why I would be getting this error. It seems I only need to import arcpy.sa.   Did I do this correctly, or are there other modules that should be imported for this code to work?  import arcpy, os, string, glob, sys from arcpy import env from arcpy.sa import *  env.workspace = r"C:\VMshared\small_example_valley8\SD2part" outFolder = r"C:/VMshared/small_example_valley8/SDpartINT/INT"  for rasterFile in arcpy.ListRasters("*.tif"):     oName, oExt = os.path.splitext(rasterFile + ".tif")     outRaster = os.path.join(outFolder, oName + ".tif")      arcpy.gp.Int_sa(rasterFile,outRaster) User is able to edit a file using vim I have a file named file.txt with some contents located in /home/myuser directory and I change the permissions of that file to root.root and 644.   -rw-r--r-- 1 root root 1.4K Jan 15 07:09 file.txt   Then I switched to myuser and opened it with vim(without sudo) and tried to edit and save it :wq! and I got output like:  "file.txt" E949: File changed while writing Press ENTER or type command to continue   Then I hit enter and then again :wq! and the output was :  WARNING: The file has been changed since reading it!!! Do you really want to write to it (y/n)?   I hit y, the file got saved and exit from vim.  The question is why a file with ROOT privileges and read-only access for a user changed by the way?  PS: 1. myuser is a sudo user.   The user permissions after saving the file changed to myuser.myuser as well.  -rw-r--r-- 1 myuser myuser 1.4K Jun 27 18:57 file.txt check the availability of the WCF Web Service I want to check the availability of the WCF web service i.c service is up or down through  the C# code. How to achieve that? Recently, I was wondering how division of aleph numbers would work. First, I thought about how finite cardinality division would work. What I came up with was that the result of $A/B$ where $A$ and $B$ are both cardinalities, is the number of times that each element of $B$ had to be mapped to an element of $A$ in order to ensure that all elements of $A$ were mapped to.  Extending this to aleph numbers, specifically, I thought that $\aleph_1/\aleph_0$ would be $\aleph_1$. The reasoning behind this is that there are an infinite ($\aleph_1$) number of real numbers between any two natural numbers. As such, that mapping would need to be applied.  Can anyone validate this idea? Is this how division of aleph numbers actually works, or am I totally off base?  Thanks. I have a trained logistic regression model that I am applying to a testing data set. The dependent variable is binary (boolean). For each sample in the testing data set, I apply the logistic regression model to generates a % probability that the dependent variable will be true. Then I record whether the acutal value was true or false. I'm trying to calculate an $R^2$ or Adjusted $R^2$ figure as in a linear regression model.  This gives me a record for each sample in the testing set like:  prob_value_is_true         acutal_value    .34                          0    .45                          1    .11                          0    .84                          0     ....                        ....             I am wondering how to test the accuracy of the model. My first attempt was to use a contingency table and say "if prob_value_is_true > 0.80, guess that the actual value is true" and then measure the ratio of correct to incorrect classifications. But I don't like that, because it feels more like I'm just evaluating the 0.80 as a boundary, not the accuracy of the model as a whole and at all prob_value_is_true values.  Then I tried to just look at each prob_value_is_true discrete value, as an example, looking at all samples where prob_value_is_true=0.34 and measuring the % of those samples where the acutal value is true (in this case, perfect accuracy would be if the % of samples that was true = 34%). I might create a model accuracy score by summing the difference at each discrete value of prob_value_is_true. But sample sizes are a huge concern here, especially for the extremes (nearing 0% or 100%), such that the averages of the acutal values are not accurate, so using them to measure the model accuracy doesn't seem right.  I even tried creating huge ranges to ensure sufficient sample sizes (0-.25, .25-.50, .50-.75, .75-1.0), but how to measure "goodness" of that % of actual value stumps me. Say all samples where prob_value_is_true is between 0.25 and 0.50 have an average acutal_value of 0.45. Is that good since its in the range? Bad since its not near 37.5% (the center of the range)?  So I'm stuck at what seems like should be an easy question, and hoping someone can point me to a resource or method to calculate an accuracy stastic for a logistic regression model. How can we disable triggers, Validation Rules and workflow rules in salesforce org. [on off - switch] How can we disable triggers, Validation Rules and workflow rules in salesforce org.  This becomes really needed and important when we are doing data migration(data imports) in salesforce.  The way I handled this is create a custom label and include it in workflow and validation rule logic.   example - Custom label 'Disable workflow' = True then do not fire workflows.            if its False then fire workflow  But wanted to understand if there is any more efficient way to handle these scenarios. A specified Include path is not valid. The EntityType does not declare a navigation property with the name * Should I use the datetime or timestamp data type in MySQL? Mclaurins with $e^{\sin(x)}$ To evaluate $e^{\sin(x)}$ I use the standard series $e^t$ and $\sin(t)$, combining them gives me:  $e^t = 1+t+\dfrac{t^2}{2!}+\dfrac{t^3}{3!}+\dfrac{t^4}{4!}+O(t^5)$  $\sin(t) = t-\dfrac{t^3}{3!}+O(t^5)$  $\therefore e^{\sin(x)} = 1+\sin(x)+\dfrac{\sin^2(x)}{2!}+\cdots+O(x^5)$  $\iff e^{\sin(x)}=1+\left(x-\dfrac{x^3}{6}\right)+\dfrac{\left(x-\frac{x^3}{6}\right)^2}{2}+\dfrac{x^3}{6}+O(x^5) = 1+x +\dfrac{x^2}{2}-\dfrac{x^4}{6} + O(x^5)$  In the last step, I only evaluate up to $\sin^3x$ term, everything above has a grade equal to or greater than $x^5$  However, I'm wrong. According to Wolfram, the series expansion for $e^{\sin x} = 1+x+\dfrac{x^2}{2}-\dfrac{x^4}{8}+O(x^5)$.  What did I do wrong? I can't seem to find what or where. I've recently set up the compiz cube again, and I was very happy to find that that flickering window glitch is gone! However, the cube reflection and deformation plugins are also gone.  I am running a fresh 12.10 install, and I have every compiz plugin package installed (including compiz-plugins-extra, which supposedly contains everything that compiz-fusion-plugins-extra package used to have), but those two plugins are still missing. I haven't been able to find anyone with the same problem.   Any ideas? (thanks!) This question is present as a matter of historical interest.  While you are encouraged to help maintain its answers, please understand that "big list" questions are not generally allowed on Ask Ubuntu and will be closed per the .   It is possible to greatly extend the usage time of a laptop or netbook running on battery by disabling various services and installing various packages.   What tricks or tips do people have for getting an extra hour or two out of their batteries? bisectors of an angle in a triangle intersect at a single point - proof verification Let´s consider a general triangle ABC. Let´s draw two angle bisectors from vertices A and B.  It is obvious that these two angle bisectors intersect at a single point X. Since X lies on the angle bisector from A its distance from side b is the same as its distance from side c. As X also lies on the angle bisector from B, its distance from side c is the same as its distance from side a.  By transitivity the distance from the point X to the side b has to be the same as the distance from X to the side a. Therefore the angle bisector from C (which is the set of points equidistant from b and a) has to go through X.  It seems as a very simple argument. Is it correct? Existence of a Riemannian metric inducing a given distance. Let $M$ be a smooth, finite-dimensional manifold. Suppose $M$ is also a metric space, with a given distance function $d: M \times M \rightarrow \mathbb{R}_{+}$, which is compatible with the original (manifold) topology on $M$.  Question: is there a Riemannian metric $g$ on $M$ such that the distance $$d_g(p, q) = \inf_{\gamma \in \Omega(p, q)} L_g(\gamma)$$ coincides with $d$?  I believe that this setting is very standard, but for the sake of completeness: $L_g$ denotes the Riemannian length of the curve $\gamma$, and $\Omega(p, q)$ the set of all piecewise smooth curves $\gamma : [a, b] \rightarrow M$ s.t. $\gamma(a) = p$ and $\gamma(b) = q$. Thanks in advance. Constructing a continuous function whose graph seems 'special' I've been reading through Zorich's "Analysis I" book recently, and I came across this nice little exercise.  Let $f: [0,1]\to \mathbb R$ be a continuous function such that $f(0)=f(1)$. Show that    for any $n\in \mathbb N$ there exists a horizontal closed interval of length $\frac 1n$ with endpoints on the graph of this function; if the number $\ell$ is not of the form $\frac 1n$ there exists a function of this form on whose graph one cannot inscribe a horizontal chord of length $\ell$.   The first part can be proven like this: Consider $g: [0,(n-1)/n] \to \mathbb R$ given by $g(x) = f(x) - f(x+1/n)$. Then   $$\sum_{k=0}^{n-1} g(k/n) = 0$$  and therefore either all of these points are zero or there exists both a point where $g$ is positive and a point where $g$ is negative. By continuity, there must then also be a point where $g = 0$. So we are done.  Now, the second statement seemed rather counterintuitive, and I have given it some time now, but don't see a counterexample for $\ell &lt; 1/2$.  (For $\ell &gt; 1/2$ the function $f(x) = \sin(2\pi x)$ will do.)  Can anyone help me out?  Cheers, I posted a comment to a duplicate question on . But I decided to delete it. Afterwards I voted as duplicate and thought a comment would be generated like     possible duplicate of ...   But it didn't. My guess is that the duplicate-comment won't be generated if a comment exists with that link, even if deleted. Turning live() into on() in jQuery