scope

dojox.layout.ContentPane

The followig code is inside a tag script in the head of a JSP. I wanted to emulate this behaviour http://dante.dojotoolkit.org/static/xd/stack-accordion.html. The main differences from that sample are: 1) I use e Tree to navigate contents in the StackContainer; 2) Content are handled by dojoX.Layout.ContenPane beacuse I want to load so...

If I have a variable locally declared in a loop that creats a thread, is it safe to use that variable in the called thread, even after the next iteration of the loop takes place?

I have a question about variable scope and memory management in C. I am writing a program that listens for a socket connection and then launches a new thread to handle that client. The main while() loop can launch many separate threads. My question is this: If I don't use dynamic memory allocation [no malloc()], and instead have a va...

Actionscript 3: Array Scope in a Document Class

I have the following function to set up cards in a game. I created one array to hold the kind of cards, and another array to hold the position of the cards. private function setPlayerCard(cardNumber:int, cardPos:int):void{ for (var i:int = 1; i < _CardGridInstance.numChildren+1; i++) { var _position:MovieClip = MovieClip(_C...

Learning JavaScript variable scope and object instantiation.

var foo = (function() { var proxy = {}, warning = false; proxy.warn = function(msg) { if (!warning) { warning = true; alert(msg); } return this; //For the purpose of method chaining we return proxy object. } function func() { alert(warning); //This is a pri...

'enclosing' scopes for friendship classes

Bjarne Stroustrup writes: "a friend class must be previously declared in an enclosing scope or defined in the non-class scope immediately enclosing the class that is declaring it a friend" Isn't the first part of the statement redundant, because the "non-class scope immediately enclosing the class " includes "previously declared in an...

One resultset across different tablix

Hello, My first post here with 2 questions. Question 1 I am new to SSRS environment and have been looking to get architectural information to explain me how rdl is processed and rendered. For e.g. all datasets executed and resultsets cached, then all tables rendered... etc. So if someone has any link that would give me an overview, i...

Variable outside event handler's scope

I am having a Javascript kerfuffle that goes beyond my knowledge of the language. I am creating a custom plugin for CKEditor. The plugin is an IFrame that opens in a DIV generated by CKEditor. Inside the IFrame, I am displaying a number of images. If the user selects one of those images, the HTML code necessary to display that image i...

access a lambda expression outside of the enclosing scope

I have the following piece of test code and want to access the variable result outside the enclosing lambda expression. Obviously this does not work as result is always null? I have Googled around a bit but seem to got myself more confused. What are my options? RequestResult result = null; RunSession(session => { result = session.Pr...

accessing variable modifications made from within an inline function in javascript

Hello all, I'm trying to pass local variables to an inline function in javascript and have that (inline) function manipulate those variables, then be able to access the changed variable values in the containing function. Is this even possible? Here's a sample of the code I'm working with: function addArtists(artist, request, origE...

JavaScript variable scope question: to var, or not to var

Hi All, Many thanks in advance. I'm working out of a schoolbook and they're using one function to call another which opens a window: function rtest(){ content='dans window'; oneWindow=open("","Window 1","width=450,height=290"); newWindow(oneWindow); } function newWindow(x){ x.document.close(); x.document.open(); x.do...

Why does a global variable captured in a $.get() callback closure always hold the same value?

I'm having a bit of trouble capturing the value of a global variable in my $.get() callback: Relevant markup <div class="block" id="blog"></div> <div class="block" id="music"></div> <div class="block" id="video"></div> Relevant code $('div.block').each(function() { $this_id = $(this).attr('id'); alert($this_id); // outputs: blog...

Scope of the Pages in a Silverlight application

I have an app built with the Silverlight Navigation Application Template. I have a main form (e.g. MainPage.xaml) and a bunch of Silverlight Pages, which are swapped in and out of the main content area. In the MainPage.xaml, I have a DispatcherTimer which hits some Uri resources, regardless of which page I am on. Every now and then, i...

Javascript classes and jQuery event listeners

Hi there, I'm writing a class that needs to attach event listeners to objects within a respective sections (#one and #two in this example), but I'm having issues passing variables from the class to set up the jQuery event listeners. <script type="text/javascript"> function myClass(id) { this.id = id; $(document).ready(funct...

OFHighScoreService was not declared in this scope

Hi, I have OpenFeint integrated, compiling and launching when my app launches. Following the OF website instructions of: 1. Add a leaderboard to your application from the Developer Portal. 2. Note the Unique Identifier of your new leaderboard. 3. In your application, submit the player’s score like this [OFHighScoreService ...

Actionscript 3 array scope / multidimentional array questions

I seem to have an array scope issue. I have a global variable; var itemConnect:Array = new Array(); Which is initialized at the start. I then have a function to populate it as a 2-d array: // Draw connections function initConnections() { for (var i:Number = 0; i < anotherArray.length; i++) { for (var j:Number = 0; j < anotherArray...

Get function caller scope

Is it possible to extract a functions caller scope? I have this example: var myObject = { id: 1, printId: function() { var myId = function() { return this.id; } console.log(myId()); } } myObject.printId(); // prints 'undefined' The example above prints out undefined, because 'this' see...

Confusion with "this" object in JavaScript anonymous functions.

Hi I have following JavaScript code that I am trying to run. My aim is to grasp the meaning of this in different scopes and different types of invocations in JavaScript. If you look in code below: I have a inner anonymous function, which is getting assigned to innerStuff variable. In that anonymous function as such this points to windo...

JavaScript Events Question

Happy New Year 2010 everyone! I have a question on JavaScript events. Lets say I have an event attached to one element, but I want to update another element when it fires. var el = document.getElementById("el"), el1 = document.getElementById("el1"); el.onmouseover = function() { // Here I want to update for example the inne...

Relationship between type system and scope?

As the title suggests I am wondering what the relationship between these two programming concepts are. Does a certain type system (static / dynamic) lend itself to a certain type of scoping (lexical / dynamic), or are these independent language choices? ...

How to create dynamical scoped variables in Python?

Hello, I am translating some code from lisp to Python. In lisp, you can have a let construct with the variables introduced declared as special and thus having dynamic scope. (See http://en.wikipedia.org/wiki/Dynamic_scope#Dynamic_scoping) How can I do likewise in Python? It seems the language does not support this directly, if true,...