I have to check that file exists or not, and if it does, have to return path to it , the main problem is that os.path.isdir returns only True or False depending on existence, so it seems it does not fit. Any hints? Current schema in my mind  is:  def get_config_path():     if exists(path1):         return path1     if exists(path2):         return path2
How do I check whether a file exists or not, without using the  statement?
Is it possible to generate electric energy from the radiation of radioactive materials I wonder if it is possible to generate electric energy from the radiation of radioactive materials like nuclear waste? If it is then wouldn't that also mean that it could be used as an energy source for a very long time since the radiation takes a long time to decay? Prove that $i^i$ is a real number According to WolframAlpha,  but I don't know how I can prove it. I am superimposing CGI over video footage, and have run into a problem in making materials for objects that act as 'shadow catchers'.  Essentially I want a shader that is shadeless—like an emitter—but catches shadows and light from other objects. This is so I can reconstruct objects in footage so other objects in the scene interact convincingly with them.  Here's an overcomplicated diagram to illustrate my point:   (In this particular scenario, the problem could be glossed over by using RGB curves, but that is definitely not the case with more complicated scenes)  Isn't this a common situation? How to the real guys do it? Thank you.  (I am welcome suggestions of other ways of doing this.) Suppose that G is a group and N &lt; G a normal subgroup. Assume that there is no normal subgroup M &lt; G with N &lt; M. Prove that G/N is simple.  This problem is really throwing me for a loop. The concept of quotient groups and how they relate to simple subgroups is confusing me, and so I am not really sure how to begin. If a simple subgroup's only normal subgroup is itself (and the trivial group), then G/N being simple would be proving that when multiplying the entire subgroup N by an element g for all g in G, that the collection of those sets cannot be broken into smaller normal subgroups? Function that returns the second argument of Reap Adding space around section title for in-register in KOMA-script context Show that $\mathbb{Q}(\sqrt{2})$ is the smallest subfield of $\mathbb{C}$ that contains $\sqrt{2}$ How to get dark menu bar and dock in Mojave light mode? I prefer light windows with dark menu bar as in High Sierra. However, it seems I can only choose all-dark or all-light in Mojave now. Are there any way to hybrid or customize it? I'm reading Galois Theory by Steven H. Weintraub (second edition), and finding that I'm at least somewhat short on the prerequisites. However the following proof looks wrong to me - am I misunderstanding something, or is it actually an incorrect proof?  Lemma 2.2.3. Let $F$ be a field and $R$ an integral domain that is a finite-dimensional $F$-vector space. Then $R$ is a field. Proof. We need to show that any nonzero $r \in R$ has an inverse. Consider $\{1, r, r^2, \cdots\}$. This is an infinite set of elements of $R$, and by hypothesis $R$ is finite dimensional as an $F$-vector space, so this set is linearly dependent. Hence $\sum_{i=0}^n{c_i r^i} = 0$ for some $n$ and some $c_i \in F$ not all zero.  It then goes on to show, given the above, that we can derive an inverse for $r$. However, if I consider examples like $r = 2 \in Q[\sqrt{2}]$, $r = \sqrt{2} \in Q[\sqrt{2}]$ or $r = 2 \in Q[X]/{&lt;X^2&gt;}$, the set $\{1, r, r^2, ...\}$ doesn't look linearly dependent to me. I do believe the lemma is true (and might even be able to prove it), but this does not look like a correct proof to me. Am I missing something? [Edit] Well yes, I am. Somehow I had managed to discount the possibility of any $c_i$ being negative, despite repeatedly looking at each fragment of the quoted text in an attempt to find what I might be misunderstanding. I recall being somewhat impressed by a novel I read a few years back – this book may be less than five years old – which featured a college-aged man.  He had a laptop which transformed into a troll goblin that served as his familiar.  In the story's universe, mages had switched to the Internet for most of their magic &amp; communication.  The main character was essentially a magical hacker, and spent much of the book fighting against his evil aunt (I think, I know it was a female relative) with the help of his cousin.  Older forms of magic were also featured, including using special paintings as magical portals, and spells being whistled by wizards.  It features a scene at a gas station where the laptop is disabled by a virus, and the main character whistles a spell to reanimate dinosaurs from the gasoline.  Is this ringing any bells? Did I correctly derive this recurrence equation formula the weak form of 'on' I am confused at whether or not there is a weak form at preposition's 'ON'. I've checked at some dictionaries at Cambridge and Oxford dictionary, they don't mention on the weak form's pronunciation. However, I, am a Japanese, checked at English-Japanese dictionaries, they mention on the weak form as /ən/.  For example, is there the difference of pronunciation between 'It goes on' and 'There is an apple on the table' in connected speech?  Does it exist?  Thanks Yuichi  *It's Edited Updating a field programmatically, hook_node_update Validation Error less than training error? Nicomachus theorem proof - what did I do wrong? The exercise asked me to proof $1^3=1$ $2^3=3+5$ $3^3=7+9+11$ $...$ I formulate the equation as (1)$$a^3 = \sum_{i=0}^{a-1} (a-1)a+1+2i$$ Proof base case: $$1^3=\sum_{i=0}^{1-1} (1-1)(1)+1+2i=1$$ Proof (a+1) case: (2) $$(a+1)^3=a^3+3a^2+3a+1$$ (3) $$(a+1)^3=\sum_{i=0}^{(a+1)-1}((a+1)-1)(a+1)+1+2i=\sum_{i=0}^{a}(a)(a+1)+1+2i$$ factor out last summation term, so number of iterations match (1): $$\sum_{i=0}^{a-1}[(a)(a+1)+1+2i]+(a)(a+1)+1+2a=\sum_{i=0}^{a-1}[(a)(a+1)+1+2i]+a^2+3a+1$$ rearrange the summation term, so part of equation match (1): $$\sum_{i=0}^{a-1}[(a)(a-1)+1+2i]+\sum_{i=0}^{a-1}(2a)+a^2+3a+1$$ substitute summation with (1): (4) $$a^3+\sum_{i=0}^{a-1}(2a)+a^2+3a+1=a^3+(2a)(a-1)+a^2+3a+1=a^3+3a^2+a+1$$ From (2) I got $a^3+3a^2+3a+1$ but from (3) &amp; (4) I got $a^3+3a^2+a+1$ My result with induction is off by 2a. Can someone please help me to understand where I did wrong? I've created a new user by using "User Accounts" in "System Settings". How do I grant rights so that this new user can have the same level of access as root? Calibre stopped working recently. Tried uninstalling and reinstalling. When I open a terminal and call $calibre I get the following error message: Traceback (most recent call last):   File &quot;/usr/bin/calibre&quot;, line 20, in &lt;module&gt;     sys.exit(calibre())   File &quot;/usr/lib/calibre/calibre/gui_launch.py&quot;, line 73, in calibre     main(args)   File &quot;/usr/lib/calibre/calibre/gui2/main.py&quot;, line 543, in main     listener = create_listener()   File &quot;/usr/lib/calibre/calibre/gui2/main.py&quot;, line 514, in create_listener     return Listener(address=gui_socket_address())   File &quot;/usr/lib/calibre/calibre/utils/ipc/server.py&quot;, line 110, in __init__     self._listener._unlink.cancel() AttributeError: 'NoneType' object has no attribute 'cancel'  Do I need to install some dependency that the sudo apt install didn't get? I tried installing via command line and the software installer/updater GUI. I'm on version Ubuntu 20.04.1 LTS. I made sure that my software in general is up to date also. Increasing spacing between section number and title in the table of contents I'm using the simple ordinary \tableofcontents command to produce a table of contents, and I find that the resulting spacing between the section number and the section title is too small:    Can someone tell me how to fix this, please. My documentclass is memoir, if that matters. I have a training set with about 3000 positive instances and 3000 negative instances. But my test data set is pretty much un-balanced. The positive set only has 50 instances and negative has 1500 instances.This causes the precision very low. Are there any approaches to solve this problem? I use SVM to build classifier. If a question is in all-uppercase or all-lowercase, our quality filters should automatically reject it Proposal If a question on an English-language Stack Exchange site does not contain at least one uppercase and one lowercase letter, our quality filter should reject it. (We can make exceptions for sites which don't use a mixed-case alphabet, such as .) Justification The quality filter currently rejects neither all-uppercase nor all-lowercase posts. I've checked. The best Stack Exchange users use mixed case. If an asker is too lazy to use their Shift key, their question tends not to be of very good quality. Don't take my word for it. You can see proof. Sam Saffron helped me write  which lets you see with your very own eyes that what I am saying is true. Single-case askers tend to ask poor-quality questions such as:      In addition, posts which use only uppercase or only lowercase — even if they aren't riddled with typos or grammatical errors — tend to be hard to read. Capitalization aids readability. Why is this proposal not a duplicate? This proposal is not a duplicate of the older proposal . This is because it also deals with all-lowercase questions. All-lowercase questions are 50 times more common than all-caps questions.  Stack Overflow gets only about 100 all-uppercase questions per year; see .  Yet it gets about 5,000 all-lowercase questions per year; see . (These statistics are for Stack Overflow only; the rest of our network wasn't considered.) I suspect that the older proposal was declined for two reasons:  All-uppercase questions are rare.  Therefore, the effort required to block all-uppercase questions is too much.   This proposal is better. For just a bit more effort, the Stack Exchange developers can get a much richer reward. Conclusion What do you think of my proposal? Agree? Disagree? Thoughts? PS: This idea is modified and adapted from  by Stack Exchange user Gilles. My dear sir Gilles, I thank you. Note There's even a  which automatically detects questions with all-caps titles and alerts interested users and moderators.