Is there more elegant method for filtering dicts in python
How do I sort a dictionary by value?
sqlplus doesn't work in Crontab /oracle/GR1/121/bin/sqlplus / as sysdba &lt;&lt;EOF &gt;&gt; $LOGFILE whenever sqlerror exit sql.sqlcode; set echo on; set serveroutput on; STARTUP; EXIT EOF   Already tried it with the path, but it hasn't worked. When I open the file in Vim, I see strange ^M characters.  Unfortunately, the world's favorite search engine does not do well with special characters in queries, so I'm asking here:   What is this ^M character? How could it have got there? How do I get rid of it? If $a^{n}-1$ is prime then $a=2$ and $n$ is prime? Automatic image format detection in PHP I am looking for a way to take a user uploaded image that is currently put in a temporary location ex: /tmp/jkhjkh78 and create a php image from it, autodetecting the format.  Is there a more clever way to do this than a bunch of try/catching with imagefromjpeg, imagefrompng, etc? Proof that Pi is constant (the same for all circles), without using limits What does \s! do? 1st example:  \starttypescript [\s!serif] [paratype]   \definefontsynonym [ParatypeSerif-Regular] [\s!name:PTSerif-Regular] [\s!features=\s!default]   \definefontsynonym [ParatypeSerif-Italic] [\s!name:PTSerif-Italic] [\s!features=\s!default]   \definefontsynonym [ParatypeSerif-Bold] [\s!name:PTSerif-Bold] [\s!features=\s!default]   \definefontsynonym [ParatypeSerif-BoldItalic] [\s!name:PTSerif-BoldItalic] [\s!features=\s!default] \stoptypescript   2nd example:  \definefont[SerifS][\s!file:GenBkBasR at \smallfontsize]   Is \s! only related to fonts? Should I use it in my typescript files? I have a Storex eZee Tab 702 tablet. My Google Play Store was working very well until a few weeks ago, when it started saying,     Error while retrieving information from server [DF-DFERH-01]   I tried to clear the cache, clear the data, force stop, and downloading another Google Play Store, but I'm still having the same problem.  How can I fix this issue? /oracle/GR1/121/bin/sqlplus / as sysdba &lt;&lt;EOF &gt;&gt; $LOGFILE whenever sqlerror exit sql.sqlcode; set echo on; set serveroutput on; STARTUP; EXIT EOF   Already tried it with the path, but it hasn't worked. I'm self studying J. Lee's Introduction to Topological Manifolds, and after doing all other exercises on chapter 2, I can't seem to come with the proper counterexamples for this one.      For each of the following properties, give an example consisting of two subsets $X, Y \subset \mathbb{R}^2 $, both considered as topological spaces with their Euclidean topologies, together with a map $f: X \rightarrow Y$ that has the indicated property.         Open but not closed/continuous   Closed but not open/continuous    Continuous but not open/closed         etc... (all cases)   I think the reason for my difficulty is a lack of geometric intuition of what open, closed and continuous maps look like as deformations of shapes in $\mathbb{R}^2$ (I can construct counterexamples from artificial made up spaces).   I tried squashing balls and 'pumping space' into lines, as well as joining strips in annulus shapes, but all the examples I seem to come up with are either too well behaved (i.e. all 3) or too misbehaved.   Instead of a case by case answered I would prefer a couple worked out cases and some intuition on how to visualise open / closed maps in this context. What is the Python equivalent of static variables inside a function? I'm in first year. Our class is in lesson " Heat and Thermodynamics". While solving a numerical problem of a reversible engine he told us that 100 degree Celsius is equal to 100 kelvin. I inquired but could not get satisfactory answer. Pleas help me understand it.  Here is the numerical, please consider it: A reversibe engine works between two temperatures whose difference is 100c. If it absorbs 746J of heat from the source and rejects 546J to the sink, calculate the temperature of the source and the sink. Ans (100°C, 0°C) I'm looking for a site, similar to StackOverflow, but with possibility to ask opinion based questions Since opinion based questions are not allowed neither here nor on stackoverflow, I would like to ask if any of you, know some other web page (outside Stack* ecosystem), where we can ask questions like:  "Which Java Web framework would you recommend to learn"   or any other, which by nature are opinion based.  EDIT1:  Allow me to explain a bit more - I know there are webgroups, forums and mailing lists BUT most of those are for single programming language or framework and I'm looking for something more generic. Stackoverflow is great because there are experts from all sort of programming languages and frameworks, so if it would be allowed to ask:   "Best web frameworks similar to ASP.NET MVC4"  I would get a lot of opinions, from different languages and frameworks, and that exactly what I'm looking for. Linear Combination of Random Normal Variables In order to prove that the linear combination of two independent normal distributions(say Z=X+Y) is normal, i am using their MGFs to show that the linear combination also has a similar mgf. This works okay when Z = X+Y. But when Z=X-Y, i run into trouble :  E[$e^{tZ}$] = E[$e^{t(X-Y)}$] = E[$e^{tX}$]E[$e^{-tY}$]  Now i cannot put this as $M_{x}$(t) * $M_{y}$(t) because of the negative sign. The average of inverse square radius $r^{-2}$ for any state quantum $|n\ell\rangle$ using the radial Schrödinger equation Convert timestamps with offset to datetime obj using strptime I am writing a doctoral thesis and I am using  to set the references in APA (American Psychological Association) format. Mostly this has worked perfectly fine, but I would like to suppress the author initials from the compiled version (in-text, not in the end references section). This happens because there are multiple authors with the same name e.g.,     Smith and Jones (1992) or Wells and Smith (1901)    are typeset in-text as:      I. Smith and Jones (1992) or Wells and D. Smith (1901).   Although it may be correct to have the initial in-text in APA format, in reality I am using BPS (British Psychological Society) format, which uses an adapted APA format (and you guessed it, they don't like the initial in text). Thus in-text should look like the first example above (without initial) but looks like the second (with).  To clarify: Any ideas on how to suppress the initial in-text in apacite?  Thanks.  ps. I understand that I could do it with a different bibtex style, but my question pertains to apacite. Proof: $\cos^p (\theta) \le \cos(p\theta)$ I came across this problem when I was at a book store inside of a book made to prepare Berkeley graduates to pass a mandatory exam. I wanted to buy the book, but, alas, I didn't have the money (forty bucks is a lot of money when you don't have a job). So I took my phone out and started taking as many pictures as I could. Unfortunately, I didn't take any pictures of the solutions!  Enough backstory. Time for math. The problem is as follows:  Prove that $\cos^p( \theta) \le \cos(p \theta)$ if $0\le\theta\le\frac\pi2$ and $0\le p\le 1$.  I tried using the series expansion for cosine, but that seemed to be a dead end. Then I tried using Euler's theorem, but I got stuck. Then I got distracted and started to think about other cosine identities. For example, $$\cos\left(\frac\theta2\right)=\pm\sqrt{\frac{1+\cos(\theta)}{2}}.$$ Then what is $\cos(\frac\theta3)$ equal to? I tried to figure it out then I realized that I needed to find the root of a cubic polynomial. Then I realized that I'm better at staying focused than finding the roots of cubic polynomials.  Anyways, a proof would be nice here. I really appreciate any hints or answers. I apologize for my digressions! I'd love your help with finding the sign of the following integral: $\int_{0}^{2 \pi}\frac{\sin x}{x} dx$,I know that computing it is impossible.  I tried to use integration by parts and maybe to learn about the sign of each part and conclude something but It didn't work for me.  Any suggestions? How to show equinumerosity of  the powerset of $A$ and the set of functions from $A$ to $\{0,1\}$ without cardinal arithmetic? How to share data between forms?