scope

WPF UserControl Embedded Animation

Hi all, I have a UserControl called Beetle.xaml which has animation makeing the legs move. So far so good. I added this to my Background.xaml page by decaring the xmlns and xaml as: xmlns:my="clr-namespace:Intellident.Liber8.GUI.Theme.Jungle" and <my:Beetle VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="180,...

Handling events on dynamically generated JavaScript objects

I have an object I created in JavaScript. Let's say it looks like this: function MyObject() { this.secretIdea = "My Secret Idea!"; }; MyObject.prototype.load = function() { this.MyButton = $(document.createElement("a")); this.MyButton.addClass("CoolButtonClass"); this.MyButton.click = MyButton.onButtonClick; someRan...

Objective C object out of scope

Hey All, I have a form that is trying to return a pickerview's value back to another class through an event. The problem is, whenever stepping through this class I keep seeing everything as out of scope... it is weird. When I set a breakpoint on the return value of the pickerview it also says it is out of scope. @interface Campaign :...

Objective-C variable out of scope

Hello, I am having an issue with a variable being labeled as "out of scope". The following method can be found in my code: - (void)CampaignComplete:(Campaign *)controller Picked:(NSString *)value { selectedCampaign = [[NSString alloc] initWithString: value]; The value of variable named "value" can be seen by the debugger. Howev...

What is wrong with the scope in this code?

What is wrong with the scope in the following code? namespace t2 { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { ////// string connectionString = "Data Source=A-63A9D4D7E7834\\SQLEXPRESS;Initial Catalog=Test1;Integrated Security=True"; ...

Access private variable in global scope

For a school assignment I have to find a solution to the following problem; In this below code, the foo function in the global scope tries to access the private variables of a Box, which ofcourse doesn't work. I have to make the foo function work with one line of code at the place show code. #include <iostream> using namespace std; c...

GCD / block scoping in Objective-C++

I'm using GCD to speed up some calculations in a few C++ templates I'm working on. I've already done it successfully for several functions, but now I'm trying to get it to work for a member function and I've encountered this weird scoping problem. The code looks something like this: inline void op::factorOutGaussian(const double *x, c...

what is none scope bean and when to use it?

hi, could some explain what a none scope is and purpose of it? Suppose if i have a bean in request scope as r1 session scope as s1 application scope a1 and say i inject none scope bean n1 in to each of above scopes then i find that n1 gets instantiated for each parent bean when ever its parent bean[r1/s1/a1] is instantiated. no...

ASP.Net Shared Webpart Pages: How do I share changes made when modifying properties of webparts to anonymous users?

By education and initial experience, I am a desktop developer. I am currently working as a SharePoint developer on corporate internal websites. My experience with building ASP.Net applications from scratch is limited. I would like to know how I can build custom webparts on an ASP.Net platform (v3 or v3.5) and allow custom properties to...

Application Transaction + C# + more than one operation

Hello, I would Like to ask you, if there is a way to set some operations into transaction. I have problem such like this: 1) Generate File from data from database 2) Encrypt it 3) Send to server I would like do it in one transaction. Any failured step 1-3 should cause the cancelling transaction. Best regards, ...

Options for granting access to class data members (C++)

This is a basic question about what options are available for defining the scope of some parameters. I'd particularly like to have a sense of the tradeoffs in speed, memory, code clarity, ease of implementation, and code safety. My programming experience is clearly modest, and I have little formal training. I suspect one or two options w...

C# scope and GC: Is outer reference-type object guaranteed to remain valid after assigned to inner object in nested "using" scope?

Is outer reference-type object guaranteed to remain valid after assigned to inner object in nested "using" scope? A x; { using (A y = new A()) { x = y; } } x.foo(); // Is x rock-solid, guaranteed to be still valid here, or is this iffy? i.e. will the call to x.foo() bomb or work only "by chance"? I'm concerned beca...

Nesting reference type object in inner scope has no effect on garbage collection: True or False?

I have been reading the Garbage Collection chapter from Jeffrey Richter's fine book, "CLR via C#". There, he illustrated an example of how the GC conceptually works (how roots are marked) by referring to a disassembly listing of native code emitted from the JIT compiler. From that example, it occurred to me that nesting reference types i...

Disposing scopedregionmanager

Hi I am having some dificulties regarding my application design. I have a module that is resposible for creating scopedregionmanagers based on the outside xaml in which i define regions. When I inject those outside xaml-s i create scoped regionmanagers and then i register them in the container: detailregionmanager = regionmanager1.Regio...

how can python function access its own attributes?

is it possible to access the python function object attributes from within the function scope? e.g. let's have def f(): return SOMETHING f._x = "foo" f() # -> "foo" now, what SOMETHING has to be, if we want to have the _x attribute content "foo" returned? if it's even possible (simply) thanks UPDATE: i'd like the fo...

Assigning value passed by reference to a member variable (in C++)

I am trying to wrap my head about scope in C++. Please consider the following: class C { int i_; public: C() { i_ = 0;} C(int i) { i_ = i; } C(const C &c) { i_ = c.i_; cout << "C is being copied: " << i_ << endl; } int getI() { return i_; } ~C() {cout << "dstr: " << i_ << endl;} }; class D { ...

Help with a method that returns a value by running another object's method

I have a Class that runs the following method (a getter): // the interface @interface MyClass : NSObject{ NSNumber *myFloatValue; } - (double)myFloatValue; - (void)setMyFloatValue:(float)floatInput; @end // the implementation @implementation - (MyClass *)init{ if (self = [super init]){ myFloatValue = [[NSNumber alloc]...

How does Python variable scoping works?

This wants me to dig deeper in Python sources, but since there are many people on SO that already done that, I would love to hear their pointers. >>> import os >>> def scope(): ... print os ... import os ... >>> scope() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 2, in scope U...

rails: how do we call a variable that we can use in all the action that belongs to the same controller?

I would like to do something like using instance variables def index @balance=1000 enb def increment @balance+=1 end what kind of variable should i use? ...

Another Python Scope Question - losing information going into if statement

Not sure if I'm missing something obvious, but here's what is happening: I have a python 2.4.3 script that contains several RegEx objects. Below one of the regex objects is searching for all matches in a string (tMatchList). Even if tMatchList is not null, it is printing an empty set after the 'if p:' step. This behavior occurs even if i...