I want to do an inline check to see if an object exists or is None.  Coming from LUA I'm used to writing print user and 'logged in' or 'not logged in'.  However when searching the web, I can't find this method anywhere. Instead people advice you to use print 'logged in' if user else 'not logged in'.  Both methods work though, is there a reason why I shouldn't use print var and 'yes' or 'no'?
I just came across this idiom in some open-source Python, and I choked on my drink.  Rather than:  if isUp:     return "Up" else:     return "Down"   or even:  return "Up" if isUp else "Down"   the code read:  return isUp and "Up" or "Down"   I can see this is the same result, but is this a typical idiom in Python? If so, is it some performance hack that runs fast? Or is it just a once-off that needs a code review?
Find the limit of $\lim\limits_{(x,y)\to (0,0)} \frac{x^2y^2}{x^2y^2+(x-y)^2}$ It is often stated that the Lagrangian formalism and the Hamiltonian formalism are equivalent.   We often hear people talk about eigenvalues of Hamiltonians but I have never ever heard a word about eigenvalues of Lagrangians.   Why is this so? Is it not useful? is it not possible to do it? How to integrate a paper where I am third author, but did a lot of work, into my master's thesis? I am writing my thesis currently and I want to include papers that I am included on as an author.  I will have a couple papers where I am 1st author, but there is one where I am third but did a lot of the work.  How do I go about integrating it into my thesis?  Can I copy/paste most of the text still or do I need to rewrite it?  I don't want to plagiarize but don't want to rewrite it if I don't have to. Intuituive reason why Fermats last theorem holds I am unsure of whether it is normal, but to me, intuitively Fermats last theorem should not hold.  If anyone intuitively believed it to be correct, why?     Can someone explain so I understand somewhat why FLT holds without reading a massive and complex proof? $t^3$ is never equal to Let $t$ be a real number such that $t^2=at+b$ for some positive integers $a$ and $b$. Then for any choice of positive integers $a$ and $b$, $t^3$ is never equal to: (A). $4t+3$ (B). $8t+5$ (C). $10t+3$ (D). $6t+5$  We have $t^3 = at^2+bt$ and so for (A) we have $t^3 = 4t+3 = 4(at^2+bt)+3$. I don't see how to continue since this is a cubic equation. Is there an easier way of finding a contradiction? Are tile bonuses counted twice if 2 new words are formed? An example:    O  O?   There is a triple letter tile to the right of the bottom O, indicated with a ?.  If I place an X on it, making the words OX (vertical) and OX (horizontal), do I score 50 points (scoring the tile twice) or 34 (scoring it once)? How to tell whether two graphs are isomorphic? Installing Autodesk Maya on Ubuntu is possible, but can be a bit challenging.  Assuming that one already has the required specs and a solid graphics card driver installed, how can it be done? While studying the problem of determining the orbit of a binary star system, my astronomy notes say: "the projection of an ellipse onto a plane is still an ellipse (except the special case in which it's a segment)". How could I prove this?  EDIT: As suggested i'm adding what I know about ellipses. I know the basics of ellipses in the plane, the equation of an ellipse in a plane in cartesia coordinates, the equation of an ellipse in polar coordinates, the fact that ellipses can be obtained by the intersection of planes with a cone. In my geometry course we defined ellipses as the the points of the plane such that the ratio between the distance from a point and a line is constant and less than 1. I also know that the sum of the distances of the points of the ellipse from the foci is constant. Using crontab to execute script every minute and another every 24 hours How can I get a copy of a Canadian visa refusal letter? I have applied for a Canadian Temporary Resident Visa (TRV); a previous paper application was refused in 2016. I have lost the copy of my refusal letter and want to submit it when I apply for my new visa. How how can I get the a copy of the 2016 refusal letter from Embassy? Possible Duplicate:          Let $X$ be a compact metric space and $f$ be an isometric map from $X$ to $X$. Prove $f$ is a surjective map. I am a newbie in Latex. My goal is to have the word "Chapter" in the title of any chapter, and the word "Appendix" in the title of appendix. I also want to add "Appendix" in TOC. However, using the following MWE from my university, I end up having "Appendix A" in TOC. How can I remove the letter "A" in TOC.  \documentclass[12]{thesis}  \RequirePackage{tocloft} \RequirePackage{titlesec} \usepackage[titletoc]{appendix}  \newcommand{\spacemultiplier}{1.5} \renewcommand{\baselinestretch}{\spacemultiplier}\normalsize  \renewcommand{\frontmatter}{ %TABLE OF CONTENTS \addcontentsline{toc}{chapter}{Contents} {\renewcommand{\baselinestretch}{1}\normalsize \tableofcontents } \newpage \titleformat{\chapter}[display]{\renewcommand{\baselinestretch}{1.5}\LARGE\sc\fillast}{Chapter   \thechapter}{0pt}{}[\renewcommand{\baselinestretch}{\spacemultiplier}\normalsize] \titlespacing{\chapter}{0pt}{1.4cm}{20pt} \setcounter{chapter}{0} }  % Appendix setup \newcommand{\universityappendix}{ \appendix \titleformat{\chapter}[display]{\renewcommand{\baselinestretch}{1.5}\normalsize \LARGE\sc\fillast}{Appendix}{0pt}{} \titlespacing{\chapter}{0pt}{-30pt}{20pt} \renewcommand{\baselinestretch}{1.5}\normalsize }   \begin{document}  \frontmatter  \chapter{blah blah} This is a chapter  \universityappendix \begin{appendices} \chapter{blah blah} this is appendix \end{appendices} \end{document}   Thanks "To delete" is to "deletion" as "to discard" is to what? "To delete" is to "deletion" as "to discard" is to what? Making separate Python installation that can call ArcPy? I see a lot of Q&amp;As asking how you can create a separate Python installation (e.g. the Anaconda or Python XY distribution) that can use arcpy, while not 'breaking' the original ArcGIS python installation.  I had this same problem, and I think I have found a 'universal' solution. So far we have done this on about 8 computers at work and it all works fine.   How to install a separate Python distribution that can use ArcGIS? MySQL Access denied for user 'root'@'localhost' In the Pottermore article on  it's mentioned that other fractional platforms exist (7 1/2, for instance). Is it ever stated elsewhere where these platforms lead? Perhaps you could get a connection from your hometown by accessing one of these platforms? In the early days of C++ when it was bolted on top of C, you could not use NULL as it was defined as (void*)0. You could not assign NULL to any pointer other than void*, which made it kind of useless. Back in those days, it was accepted that you used 0 (zero) for null pointers.  To this day, I have continued to use zero as a null pointer but those around me insist on using NULL. I personally do not see any benefit to giving a name (NULL) to an existing value - and since I also like to test pointers as truth values:  if (p &amp;&amp; !q)   do_something();   then using zero makes more sense (as in if you use NULL, you cannot logically use p &amp;&amp; !q - you need to explicitly compare against NULL, unless you assume NULL is zero, in which case why use NULL).  Is there any objective reason to prefer zero over NULL (or vice versa), or is all just personal preference?  Edit: I should add (and meant to originally say) that with RAII and exceptions, I rarely use zero/NULL pointers, but sometimes you do need them still. Is it possible to raise stats? I found a lot of dialogue choices requiring high Perception and I started the game with just 10 plus 1 for being an elf. With a magical helm and tower rest bonus I can temporarily boost it to 13, but is it possible to raise it permanently? To debug a JACK/Pulseaudio issue, I want to understand when and why the pulseaudio daemon is started by systemd (on Fedora).  Using:  $ ps -o'pid,ppid,args' `pgrep pulse`   I see that the pulseaudio daemon is being started by systemd (pid=1)   PID  PPID COMMAND 2738     1 /usr/bin/pulseaudio --start   However, I was unable to find any unit-file on my system containing pulseaudio or even just pulse.  My specific questions are:  A) Is there a way to determine the systemd unit that caused the creation of a specific process (in my example output, process 2738, the PA daemon)?  B) Are there alternative approaches to find out which unit-dependency chain or other settings of systemd resulted in the invocation of /usr/bin/pulseaudio --start?