I have an object of class and want to re initialize the object by a function So I am writing a discord bot and there's one object that i want to be recreated every time the bot gets a command. import discord client = discord.Client() obJ_class = bot_friendly.Exec() # this creates the object and everything works fine   now @client.event async def on_message(message):     if message.content.startswith(&quot;&amp;&amp;exit&quot;):     await message.channel.send(&quot;Exiting&quot;)     await client.close()     print(&quot;Successfully logged out&quot;)     if message.content.startswith(&quot;&amp;&amp;update&quot;):     await message.channel.send(&quot;Wait a few seconds&quot;)     obJ_class = bot_friendly.Exec()  here the error is Shadows name 'obJ_class' from outer scope I would like to know if this is even doable or should i just make another function that does what the __init__(self): does but just name it update():
What exactly are the Python scoping rules?  If I have some code:  code1 class Foo:    code2    def spam.....       code3       for code4..:        code5        x()   Where is x found?  Some possible choices include the list below:   In the enclosing source file In the class namespace In the function definition In the for loop index variable Inside the for loop   Also there is the context during execution, when the function spam is passed somewhere else. And maybe  pass a bit differently?  There must be a simple reference or algorithm somewhere.  It's a confusing world for intermediate Python programmers.
Can we please move the  "Start a bounty" link to be in the same location as all of the other action buttons? It makes no sense to me for this to be buried after the comments - It's an action on the Question. It can be very difficult to locate, especially when your question gets .  I don't think this should be that difficult to implement - it's just moving the location of a design element. Can we please get this button moved? How can I pin a program to the Windows 7 Taskbar, with parameters? sir, problem about a host file sir, over department created a host file to run over office program in windows, but they give us dell system having operating system ubuntu 16.4 now my question is that how this add file in ubuntu to run the program. the windows command is given below  TO ACCESS FIORI - Please Follow the Instructions in this Video  Path:- C:\Windows\System32\drivers\etc  Copy attached Hosts File in the above path.  Fiori Link to access SAP in Google Chrome: Elliptic Coordinates - Inverting the transformation The standard way to transform elliptic coordinates $(\mu, \nu)$ $\ to$ Cartesian coordinates $(x,y)$:  $x = a \cosh(\mu) \cos(\nu)$  $y = a \sinh(\mu) \sin(\nu)$  Is there any way to get the transformation $(x,y)$ to $(\mu,\nu)$? Meaning is there a way to find:  $\mu = f(x,y)$  $\nu = g(x,y)$  I'm guessing that it would involve $\sinh^{-1}$'s and $\cosh^{-1}$'s, if it was possible to do this at all. Evaluating indefinite integrals of the form $\int \frac{x^2 \,dx}{a x^5 + b}$ Evaluate the indefinite integral   $$\int \frac{x^2 \,dx}{a x^5 + b},$$   for real parameters $a, b \neq 0$.   No apparent substitutions simplify the expression (if the exponent of $x$ were an integral multiple of $3$, this would suggest the substitution $u = x^3$, $du = 3 x^2 \,dx$, but the exponent is not). Applying integration by parts with $u = a x^5 + b$, $dv = x^2 dx$ is straightforward, but it produces an integrand with a much larger degree in the denominator and so appears only to make the situation worse. Applying integration by parts instead with $dw = \frac{x^k dx}{a x^5 + b}$ results in integrating $\frac{x^k dx}{a x^5 + b}$, which except when $k \equiv 4 \pmod 5$ (which doesn't appear immediately fruitful), doesn't appear much easier than the given integral. Is God either immoral or not omnipotent? The usual (Christian) justification for suffering/evil in the world created by a benevolent God is freedom of the will. However, the more interesting question is not about the source of evil (which the free will may very well be) but why God chose to create the world such as it is. Why not create a world with freedom of the will, but without suffering? Even assuming that God is bound by logic such combination doesn't seem to be logically impossible: creatures certainly can do good of their own free will. There are two alternatives.  1) God is powerful enough for all practical intents and purposes, enough to be called God, but not omnipotent. He created only the best of all possible worlds (Leibniz). This position is perhaps the most defensible philosophically, it also avoids logical problems with , etc., but it does diminish deity's status and invites unpleasant questions like what limits God (logic only, inert matter, outer chaos, other beings), is there someone/thing more powerful, etc.    Interestingly enough, the original Christian theodicy wasn't free will. St.Augustine says poetically "the canvas of creation requires both the black and the white paint". "Requires" here can be interpreted differently,  is to explain the black by the "just punishment" for the original sin, which brings us to Adam and Eve, and back to the free will. But if God is still omnipotent and hence omniscient creating creatures he knew would sin, and then punishing them for it is hardly an improvement.   2) However, Augustine can be read more straightforwardly. Evil is "required" for the perfection of the world just like black paint is required for the perfection of a painting (evil can be interpreted as lack of good rather than something onto itself but that is beside the point). God is immoral, and he is beyond our conception of morality, his notion of perfection is his own. This is much bolder, and similar to Plotinus's position on the existence of the One, the One can not exist because it is "prior to all existence". But it does evoke the unpleasant taste of "ends justify the means". It is one thing to use "God is beyond our logic and comprehension" to get rid of unliftable stones, it is quite another to convince people to worship an immoral perfectionist.  Formally, there is another logical possibility of asserting both morality and omnipotence, but defending the morality of creating a world full of suffering, for a higher purpose perhaps. For example, the suffering only appears bad to us, not to an absolute being in its wisdom. But this simply redefines morality and is only different in phraseology from the Augustine's position. The question is asked in human terms and has to be answered in kind. One is free to argue that God is beyond human logic and/or morality, but it still leaves him immoral as commonly understood.   There does not appear to be a way to square this circle, one has to accept Leibniz's or Augustine's alternative (or both) and deal with the downsides. Option 2) looks more consistent, but it is rarely embraced, at least not openly. Perhaps, for "public relations" reasons it is more attractive to dismiss the question with something like "this is beyond us" or change the subject to the free will.      What are the modern theological positions on the morality/omnipotence in catholisism, protestantism, etc.? Is the question relevant to other religions?   EDIT: I am not sure that it came through but by immoral I did not mean morally deficient or evil. Rather at the God's plane of being morality becomes meaningless, like tastes or smells are meaningless when applied to elementary particles. Table with multiple merging Most of the places, examples for merging of cells in tables are given. But, I could not find a merging of cells in complicated fashion as shown below. This question may summarize all the possible methods of merging and may serve as the reference for all future questions on merging of cells. Experts can add much more complications if required. How do I make a table row on a web page look draggable? I have a table on a web page where I need to let the user reorder the rows. I was thinking of letting the user drag the rows to reorder them. But how would I let the user know that he could do that? Should I make an empty cell as the first column with dots or vertical lines like gmail has for each email in the inbox? Where can I get an image like that? Do I use a "grabbing hand" icon for the cursor or a "move" cursor? Do I show the cursor while hovering over the table or just the "grab area"? Do I let the user grab any part of the row to drag? if recursively find ext, then, else on unix This is what I normally use. But I need to recursively find an extension with, then, and else. The problem with this one is that it is not recursive.  if ls $HOME/Downloads/*.ext &gt;/dev/null 2&gt;&amp;1 then     : else     : fi To better describe the above problem, whenever I start up my Ubuntu/Windows 10 Machine and select Ubuntu, whenever the machine tries to start the GNOME Desktop Environment, it says it started it successfully. however, I never get a graphical desktop environment to use. I can fix this by logging into tty3 and typing gnome-session but I don't really want to do that as, for some reason, that skips login. Can anyone help? using System; using System.Security.Permissions; using Microsoft.SharePoint; using Microsoft.SharePoint.Security; using Microsoft.SharePoint.Utilities; using Microsoft.SharePoint.Workflow;  namespace Change_Title_Event.Change_Title {     /// &lt;summary&gt;     /// List Item Events     /// &lt;/summary&gt;     public class Change_Title : SPItemEventReceiver     {        /// &lt;summary&gt;        /// An item is being added.        /// &lt;/summary&gt;        public override void ItemAdding(SPItemEventProperties properties)        {            properties.AfterProperties["Title"] = "Kevin: Changed by event receiver at" + DateTime.Now.TimeOfDay.ToString();            base.ItemAdding(properties);        }       } }   Where simple example, which works perfect on my local Sharepoint 2010. It is sandboxed.  But when I package this solution, it do not work on Sharepoint Online. I does not give any Errors either.  I think I am doing something wrong, something simple, but I can't simply find anything on Google about it.  Here is another who asks on the MSDN forum, but gets a very wierd reply, that I do not understand. Do spell effects move if the object they are cast on moves? let's suppose that I cast a Silent image of a wall on an airship. Let's suppose that I don't move it with concentration.  Does the image of the wall move with the airship or it will progressively go far? Partition 256 GB SSD for dual Boot, Windows 10 + Ubuntu 19.04 I plan on installing Ubuntu 19.04 and give it 100 GB of my 256 GB SSD space and leave the rest for Windows as I would primarily be using Ubuntu.     A. Now, as I plan to install a lot of applications in Ubuntu, should I give more space to the / partition than the home partition? (Or maybe even drop the /home altogether?).    B. I have another 128 GB SD card for files like photos, audio and video files. Please suggest me the optimal partitioning for the use case.    C. Also, I have 8 GB of RAM so what should be the optimal swap partition size?    D. How would the distribution be if I choose "install Ubuntu alongside Windows" option? I just downloaded a DVD which is for a movie. After uncompressing the DVD file I see .VOB, .IFO and .BUP files. If I open the first .VOB file it shows me the DVD menu but I can't interact with it. So, my question is... is Totem able to play those kind of files? If so, how can I achieve that? What other app could I use in order to reproduce those files?  Edit  Using VLC didn't work neither. I forgot to mention I have already tried that. Let me rephrase: if I open the first video file it shows the DVD menu, BUT I can't interact with it. How to construct a pyramid in blender but the edges of the triangles to be equal? How to make a pyramid in blender and all the edges to be equal size? Is there a way to do that in blender? Or if there is no easy way for that, maybe anybody not that lazy can provide me with a math line? Or maybe a link or whatever? Let $X$ be a set and consider the collection $\mathcal{A}(X)$ of countable or cocountable subsets of $X$, that is, $E \in \mathcal{A}(X)$ if $E$ is countable or $X-E$ is countable. If $X$ is countable, then $\mathcal{A}(X)$ coincides with the power set $\mathcal{P}(X)$ of $X$. Now suppose that $X$ is uncountable. Assuming the axiom of choice, we can conclude that $\mathcal{A}(X) \ne \mathcal{P}(X)$, since $|X| = |X| + |X|$. So the question is:     Can we prove in ZF that $\mathcal{A}(X) \ne \mathcal{P}(X)$ for every uncountable set $X$?   I'm assuming that a set $X$ is uncountable if there is no injective function $f : X \rightarrow \mathbb{N}$. Upgrade or replace a Wubi installation? I've got Windows 7 with Wubi 11.10 installed. I would like to upgrade to 12.04 but I'm not sure what the best path would be.  I'm not skilled enough to use Ubuntu all the time, and my iPhone requires me to run some Windows version for the damn iTunes software. I would love to run Windows XP but I can't figure out how to install it via USB -- my computer has no cd drive.  I'd like to run Windows XP and Wubi 12.04 on top of that. Or, perhaps, Ubuntu 12.04 natively and Windows XP alongside of that. So I guess I have 2 questions:   (lazy) Should I upgrade my Wubi from inside Ubuntu, or should I remove Wubi 11.10 from within Windows and install a brand new Wubi 12.04? (proper) How can I install Windows XP and Ubuntu 12.04 alongside each other?   Update: I am going to create a separate question post about the above #2 question... I realize it's wrong to ask two questions in one post when they are that different. Can not unlock my Android device as have no internet connection? I have an Android device which is running Android 4.0.3 (or something like that).  My little brother decided to try and guess my lock screen pattern the other day, and ended up locking me out.   I have since been unable to log back in to the tablet using my Google Account details. I provided the correct login details, however it says they are incorrect. Could this be connected to the fact I have no internet connection?  I have no internet connection as the device is WiFi only, and the WiFi is currently turned off. I cannot turn it on, as I am locked out.  How can I log back into my tablet without wiping the user data? Which set is unwell-orderable? In textbook it says that every well-orderable set is equipotent to an initial ordinal number. However, of course unwell-orderable cannot equipotent to any ordinal number, but is there any set is unwell-orderable? By axiom of regularity we know that every set is well-founded, so can we conclude that every set is well-orderable? If not, which set is unwell-orderable? Can newsletters take into account a user's ignored tags on that site? I have seen several questions that discuss using your "Favorite" tags to construct a newsletter.   I'm looking for a similar request - but for ignored tags.  I figure it might make sense to split this request from the "favorite" requests because it has different implementation.  Can we exclude questions on the "ignore" tags lists in the newsletter?   For example, I subscribe to the Board and Card Games newsletter.   Currently (and frequently) 6 of the 7 questions are about magic-the-gathering, a tag I have in my ignored list.     I now get a newsletter where at best 1/7 questions is interesting and worth clicking on.  Related questions about using "Favorites":