Top "Scope" questions

Scope is an enclosing context where values and expressions are associated.

Use Require_once() to include database connection variables correctly

I'm a php newbie (but long time developer in other languages) and I'm trying some example db connections in "PHP, …

php scope require-once
Local variable access to inner class needs to be declared final

I got a problem of local variable access to inner class need to be declared final. It is from method …

java scope anonymous-class
How do I create a list of Python lambdas (in a list comprehension/for loop)?

I want to create a list of lambda objects from a list of constants in Python; for instance: listOfNumbers = [1,2,3,4,5] square = …

python lambda scope closures list-comprehension
how to access global/outer scope variable from R apply function?

I can't seem to make apply function access/modify a variable that is declared outside... what gives? x = data.frame(…

r scope apply
Creating master-detail pages for entities, how to link them and which bean scope to choose

I have started learning JSF, but sadly most tutorials out there present only a log in or a register section. …

jsf session scope master-detail
how to access $rootscope variable in angularjs?

I want to assign some data to a global variable (may be $rootscope) which gets initialized at pageload. And then …

angularjs scope controllers rootscope
javascript: onload and onerror called together

I'm new to JavaScript and therefore confused for the variable scope... I'm trying to load an image, and replace it …

javascript scope d3.js onload onerror
Is there a generic way to memoize in Scala?

I wanted to memoize this: def fib(n: Int) = if(n <= 1) 1 else fib(n-1) + fib(n-2) println(fib(100)) // times …

scala scope dynamic-programming memoization forward-reference
require_once to global scope within a function

It seems that if require_once is called within function, the included file doesn't extend the global variable scope. How …

php scope require-once
Compilation error : 'this' cannot be implicitly captured in this context

I am trying to add a condition_variable to handle threads, but get a compilation error at this line: this-&…

c++ scope this condition-variable