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'?
If Python does not have a ternary conditional operator, is it possible to simulate one using other language constructs?
If you're not used to seeing the 'low on internal storage' notification, what is it that you're doing to keep your phone's internal memory from filling up so quickly?   The 'SD Card and Phone Storage' menu in the settings doesn't really tell me much other than how much is free. And, I don't really have that many applications installed. The top 5 storage hogging apps on my phone are Gmail (18.6 MB), Twitter (17.5 MB), Facebook (12.55 MB), Maps (9.63 MB), and Swype (6.06 MB).  So, are there apps out there (besides your normal file manager ones, like Astro) that will help monitor internal phone storage? Is there something I should be doing to keep my phone storage use to a minimum? Prove that $a^3+b^3+c^3 \geq a^2b+b^2c+c^2a$ Let $a,b,c$ be positive real numbers. Prove that $a^3+b^3+c^3\geq a^2b+b^2c+c^2a$.   My (strange) proof:  $$ \begin{align*} a^3+b^3+c^3 &amp;\geq a^2b+b^2c+c^2a\\ \sum\limits_{a,b,c} a^3 &amp;\geq \sum\limits_{a,b,c} a^2b\\ \sum\limits_{a,b,c} a^2 &amp;\geq \sum\limits_{a,b,c} ab\\ a^2+b^2+c^2 &amp;\geq ab+bc+ca\\ 2a^2+2b^2+2c^2-2ab-2bc-2ca &amp;\geq 0\\ \left( a-b \right)^2 + \left( b-c \right)^2 + \left( c-a \right)^2 &amp;\geq 0 \end{align*} $$  Which is obviously true.    However, this is not a valid proof, is it? Because I could just as well have divided by $a^2$ rather than $a$:  $$ \begin{align*} \sum\limits_{a,b,c} a^3 &amp;\geq \sum\limits_{a,b,c} a^2b\\ \sum\limits_{a,b,c} a &amp;\geq \sum\limits_{a,b,c} b\\ a+b+c &amp;\geq a+b+c \end{align*} $$  Which is true, but it would imply that equality always holds, which is obviously false. So why can't I just divide in a cycling sum?  Edit: Please don't help me with the original inequality, I'll figure it out. How can I do case insensitive string comparison in Python?  I would like to encapsulate comparison of a regular strings to a repository string using in a very simple and Pythonic way. I also would like to have ability to look up values in a dict hashed by strings using regular python strings. More examples of Simpson's Paradox, barring the ones on Wikipedia, Titanic, and delayed flights. My boot is horribly slow, and I don't know why.  $ systemd-analyze  Startup finished in 10.975s (kernel) + 49.732s (userspace) = 1min 708ms $ systemd-analyze blame           34.971s apt-daily.service          20.590s snapd.refresh.service          17.113s grub-common.service          16.033s apport.service          16.027s networking.service          15.894s ondemand.service          15.860s irqbalance.service          15.655s speech-dispatcher.service          11.695s ModemManager.service           9.772s accounts-daemon.service           8.626s NetworkManager-wait-online.service           8.058s systemd-logind.service           8.053s bluetooth.service           7.944s gpu-manager.service           7.896s alsa-restore.service           7.892s pppd-dns.service           7.882s rsyslog.service           7.860s avahi-daemon.service           7.844s dev-sda1.device           7.842s systemd-user-sessions.service           7.648s lightdm.service           7.610s teamviewerd.service           6.445s apparmor.service   Also, during boot-up, I see a message that says something like:  device descriptor read/all, error -62 ata1 softreset failed (device not ready) #most of the times error loading journal #(sometimes) Test WP failed, assume Write Enabled Asking for cache data failed     #most of the times Assuming drive cache: write through   apt-daily.service slows the boot the most. Any idea on how to tackle that?  I have Ubuntu MATE 16.04. How to take mysqldump with Generated column? I am getting below error while importing the dump,     ERROR 3105 (HY000) at line 82: The value specified for generated   column 'column_name' in table 'table_name' is not allowed.   When I describe the table with error, there are some generated columns in it.     option_type         | varchar(45)  | YES  | MUL | NULL    | VIRTUAL   GENERATED   What is the correct command to use when taking mysql dump for the database contains generated column?  MySQL server source and destination version:     mysqld Ver 5.7.26 for Linux on x86_64 (MySQL Community Server (GPL))   MariaDB mysqldump CLI version:     mysqldump Ver 10.17 Distrib 10.3.12-MariaDB, for Linux (x86_64) Every time I try to create a table using MySQL Workbench 6.3 CE it adds "broken" comments at the end of the script.  Example:  I am trying to create a table called "user". This is what the table should look like:   However when I click the apply button, the script generates incorrectly:  CREATE TABLE `user` (   `userid` INT NOT NULL AUTO_INCREMENT COMMENT '',   `record_status` INT NOT NULL DEFAULT 1 COMMENT '',   `createdby` VARCHAR(75) NOT NULL COMMENT '',   `createddate` DATETIME NOT NULL COMMENT '',   `updatedby` VARCHAR(75) NULL COMMENT '',   `updateddate` DATETIME NULL COMMENT '',   `username` INT NOT NULL COMMENT '',   `password` VARCHAR(75) NULL COMMENT '',   `firstname` VARCHAR(75) NULL COMMENT '',   `lastname` VARCHAR(75) NULL COMMENT '',   `email` VARCHAR(75) NULL COMMENT '',   `facebook_userid` VARCHAR(75) NULL COMMENT '',   `email_verified` VARCHAR(75) NULL COMMENT '',   PRIMARY KEY (`userid`, `username`)  COMMENT '');   The comment in this line should not be there, so the code should be:   PRIMARY KEY (`userid`, `username`));   and the code executes when I paste it into an editor and remove this comment. However I create massive databases daily. (Each with +- 15 tables). I can't keep doing this for each table as it is time consuming.  How can I disable this feature that adds the comments to the script? I don't need them in my databases Request of a domain with no virtualhost in apache ends to default virtualhost If I ask Apache for domain.com that has no Virtual Host setup in Apache configuration, Apache will show the default Virtual Host. How can I prevent this from happening or simply drop the connection? How do I skip specific tests when building an rpm? I am building an RPM of git version 2.13.0. The build has gone ok but one of the tests are failing:  Config variable ${LIB_HTTPD_SVN} is not defined Config variable ${LIB_HTTPD_SVN_PATH} is not defined   I cannot find any info about these variables so I was going to just skip the tests. How can I do that? Idempotent linear operators are projections I have a hard time formulating proofs.  For this problem, I  can see that if $n$ is equal to $8,$ this statement is true.  $(\mathbb{Z}/8\mathbb{Z})^{\times}$ includes elements:  $1,3,5,7$, and all of these are roots of $1-x^2 \pmod 8.$  And obviously $8$ divides $24.$  But how do I prove this without depending on number calculations and only using theorems?  Help Please?  I need a step by step walk through of how to do this proof and what theorems would be appropriate to use. Why are year, pound and mile in the singular form in the phrases below?   five-year-old children  20 pound note 10 mile run   Is that because they're acting as adjectives, which are always invariable in English?  Is it incorrect to say...   five-years-old children? 20 pounds note? 10 miles run? Embedding DLLs in a compiled executable Is it possible to embed a pre-existing DLL into a compiled C# executable (so that you only have one file to distribute)? If it is possible, how would one go about doing it?  Normally, I'm cool with just leaving the DLLs outside and having the setup program handle everything, but there have been a couple of people at work who have asked me this and I honestly don't know. How can I prevent Overflow for the Gamma function? I have a Dirichlet distribution from which I'm maximizing $\alpha$ by calculating the log likelihood with the following equation  $p\left(s|\alpha\right) = \sum\limits_{i=1}^O\log\left(\frac{n_i!}{\prod\limits_{j=1}^kn_{ij}!}\frac{\Gamma\left(\alpha_0\right)}{\Gamma\left(\sum\limits_{j=1}^k\left(n_{ij}+a_j\right)\right)} \prod\limits_{j=1}^k \frac{\Gamma\left(n_{ij}+\alpha_j\right)}{\Gamma\left(\alpha_j\right)}\right)$  I have a python script to calculate the log likelihood. It works for small values, but when $n_{ij}$ gets high $\Gamma\left(\sum\limits_{j=1}^k\left(n_{ij}+a_j\right)\right)$ and $\Gamma\left(n_{ij}+\alpha_j\right)$ python runs into overflow error (the max for math.gamma is between 171 and 172).   Is there a way to change the likelihood function so that $\Gamma\left(\sum\limits_{j=1}^k\left(n_{ij}+a_j\right)\right)$ and $\Gamma\left(n_{ij}+\alpha_j\right)$ don't run into overflow errors. Can I just divide the values in $\Gamma$ by for example 100, if I then compare the likelihood between $p(s|\alpha)$ with different $\alpha$ values do the best $\alpha$ values still have the highest likelihood? In this kind of sentence the second half is an inversion of the first half. Is it a rhetorical artífice? What kind? Complete userChrome.css specification in Firefox Massless charged particles Are there any massless (zero invariant mass) particles carrying electric charge?  If not, why not? Do we expect to see any or are they a theoretical impossibility? "X Department" versus "Department of X" I would like to know whether these phrases "English Department" and "Department of English" have the same meaning. Thanks! How do I manage how many revisions snapd keeps of an application? Adding the PHP json extension