Can anyone tell me why the following code error?  My guess is, the inner function is somehow detecting a 'new' variable declaration, (i have 'x' on a left side on inner() ).  While it fails because this 'x' appears first on the right side. Is this correct? Am I wrong expecting it to behave normally (i.e Increment the value of x).  In any other context, x can be accessed from the inner function. The only problem happens if I ever put that x on a left side.  def outer(x):     def inner():         x = x + 1         return x     return inner()  outer(1)   UnboundLocalError: local variable 'x' referenced before assignment
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.
I just notice it now as I am new to Illustrator.  When I am in RGB mode, blending transparency seems to be easier as mode such as Screen, Multiply or Overlay looks good naturally.  If I switch the document mode to CMYK then the image is getting messed up.  I'd like to know, if CMYK is not ideal for blending options? No option to create a new Managed Path inside Office 365 SharePoint online 2013 I am working on an Office 365 SharePoint online 2013. Now when I wanted to create a new private site collection, inside the online SharePoint admin center, I did not find the option to create new managed path, as I use to get when creating a site collection inside SharePoint on-premise. So how do I create a new managed paths inside SharePoint online? How to lock compiled Java classes to prevent decompilation? How do I lock compiled Java classes to prevent decompilation?  I know this must be very well discussed topic on the Internet, but I could not come to any conclusion after referring them.  Many people do suggest obfuscator, but they just do renaming of classes, methods, and fields with tough-to-remember character sequences but what about sensitive constant values?  For example, you have developed the encryption and decryption component based on a password based encryption technique. Now in this case, any average Java person can use  to decompile the class file and easily retrieve the password value (defined as constant) as well as  and in turn can decrypt the data by writing small independent program!  Or should such sensitive components be built in native code (for example, VC++) and call them via ? Why does dpkg give me this parsing error? Objects disappear when looking through camera Yesterday, I have downloaded and installed Windows 8 Professional, after downloading it (legally) and burning it to a DVD, on my 3-year-old  (Intel Core Duo 2x2.4&nbsp;GHz, 4&nbsp;GB RAM,  hard disk drive).   The installation failed two or three times, each time differently (error codes, for example 0xc000021a, with an infinite boot loop), but finally I completely formatted the hard drive and installed. Seemingly, everything was OK.  However, after booting successfully, the OS is extremely slow. When I open the task manager, it shows that the HDD is at 100% - however, no application or background process or Windows process can be made responsible. I searched the Internet and found that Windows might try to "index" the hard drive, but I did't find a process that isn't also on my second computer, which still uses the Release Preview (restarting every two hours). Also, the startup is empty, and HD Tune and HDD Health show that the drive health is OK, even though I don't know how reliable these two programs are.  I looked for diagnose software from Toshiba, but they only offer tools for "Fujitsu branded Toshiba devices"; I tried it out, and it did not work on my hard drive.  Does this sound like a hard drive failure? The laptop is 3.5-years-old, has been carried around sometimes roughly and was used (and on) most of the time. However, it would have failed exactly the night before installing Windows&nbsp;8 Profesional, which seems - unlikely.  If this is a software error - then what did I do wrong if this occurs from the moment of installation (even the personalization at the end of installation took half an hour)? How can I fix this? Hot questions no longer work on iPad (ok on iPhone) How can I disable the Windows key from opening the Activities overview? How can I disable the Windows key (or Super) from showing the GNOME Shell Activities overlay? How to identify predatory publishers/journals Prove the following integral inequality: $\int_{0}^{1}f(g(x))dx\le\int_{0}^{1}f(x)dx+\int_{0}^{1}g(x)dx$ Suppose $f(x)$ and $g(x)$ are continuous function from $[0,1]\rightarrow [0,1]$, and $f$ is monotone increasing, then how to prove the following inequality: $$\int_{0}^{1}f(g(x))dx\le\int_{0}^{1}f(x)dx+\int_{0}^{1}g(x)dx$$ Run a Windows Service as a console app Avoiding if statement inside a for loop? Proof for SSS Congruence? Mastering Telekinetic Discipline? The book says about mastering a psychic discipline:   Once a psyker has purchased 8 psychic techniques from a single Discipline, he has attained mastery of that Discipline, and the Psy Rating for all Fettered Psychic Strength uses of techniques from that Discipline gain a +1 bonus. This has no additional effect on the Unfettered or Push Psy Rating of the psyker.  But the Telekinetic discipline only has 7 techniques, then how can you attain mastery of that discipline? (Telepathy has 9 techniques, and Divination 8) Inconsistent accessibility error with the following c# code. Why? I have a script myscript.sh  #!/bin/sh  echo $1 $2   which is used something like ...  ./myscript.sh foo bar   which gives me an output of ...  foo bar     but how can i make this script include custom command options? for example ...  ./myscript.sh -a foo and corespond to $1   and  ./myscript.sh -b bar and corespond to $2 What are the readline word separators? How can I run a specific command for each find result? How would one run a specific command for each file that was found by using the find command? For the purpose of the question lets say that I would simply like to delete each file found by find. Translation help review queue? Phone : nexus 5 version 2013 Android version : 6.0 Kernel version : 3.4.0-g2aa165e Build number : MRA58N   For the last few days, 10118 has been draining my phone's battery. It drains battery by using GPS. I typed 'ps' in a terminal emulator, and there was no application with PID 10118. I don't know what exactly 10118 is. My guess is that it's one of recently installed weather apps.  How can I fix this?    Screenshots (click images for larger variants)