reference

Are arrays or lists passed by default by reference in c#?

Do they? Or to speed up my program should I pass them by reference? ...

using ref with class C#

I want to give a certain linked list to a class I am making. I want the class to write into that list (eg by .addLast()). Should I use the ref keyword for that? I am somewhat puzzled on where to use the ref and out keywords in C#, as all classes are allocated dynamically on the heap and we actually use pointers for most operations. Of ...

Python: How do I pass a variable by reference?

The Python documentation seems unclear about whether parameters are passed by reference or value, and the following code produces the unchanged value 'Original' class PassByReference: def __init__(self): self.variable = 'Original' self.Change(self.variable) print self.variable def Change(self, var): var = 'C...

Actionscript: Using Events vs passing self to Object - which is faster, better?

My Friend and I have this debate about it is faster in AS3 to pass this to another object to be able to have communication/interaction between the two or if Events are the way to go. While using Events to accomplish this task is pretty standard, here is some dummy code to illustrate the question: public class ClassA{ public var i...

Visual studio recursive Copy local

Duplicate - this exact question was asked here - the only solution seems to be post build event. In Visual studio 2008, I have the following projects: A - references B B - references Lib.dll When B is built, Lib.dll appears in B/bin/Debug. (this is ok) When A is built, B.dll appears in A/bin/Debug, but Lib.dll does NOT appear in A/...

undefined reference within the same file

I'm getting an undefined reference to one private methods in a class. Here is a short snippet of the code (but the whole thing currently is in one source file and not separated into header and source files). #include <iostream> using namespace std; struct node { int key_value; node *left; node *right; }; class btree { ...

Two classes that refer to each other

I'm new to C++, so this question may be basic: I have two classes that need to refer to each other. Each is in its own header file, and #include's the other's header file. When I try to compile I get the error "ISO C++ forbids declaration of ‘Foo’ with no type" for one of the classes. If I switch things so the opposite header gets pa...

Is there a right way to return a new object instance by reference in C++?

So I was writing some code, and I had something like this: class Box { private: float x, y, w, h; public: //... Rectangle & GetRect( void ) const { return Rectangle( x, y, w, h ); } }; Then later in some code: Rectangle rect = theBox.GetRect(); Which worked in my debug build, but in release ther...

VS2005 loading project references from GAC

I'm using VS2005 (haven't moved to 2008 because I'm still using some legacy tools) and have a question about the way project references work. If I make a project reference to a project that has been deployed to the GAC, VS will use the assembly in the GAC. This is annoying when I have older code in the GACed assembly and I am making cod...

How do I convert something of "string*" to "const string&" in C++?

For example, if I have the following: void foo(string* s) { bar(s); // this line fails to compile, invalid init. error } void bar(const string& cs) { // stuff happens here } What conversions do I need to make to have the call the bar succeed? ...

Relative file paths in Python packages

How do I reference a file relatively to a package's directory? My directory structure is: /foo package1/ resources/ __init__.py package2/ resources/ __init__.py script.py script.py imports packages package1 and package2. Although the packages can be imported by any other script on the syste...

AS3 Embed or Import all Classes in an external swf without referencing each Class seperatly.

**I have an ArtLibrary.swf file which has hundreds of MovieClips exported with class names. I want to be able to use these movies in multiple different flash files i'm working on but I don't know how to properly reference them after using and embed command. The following works** [Embed(source="ArtLibrary.swf", symbol="BirdBodyColor_...

How to reference a self made assembly that is installed in the GAC in visual studio?

I created a homemade assembly and I think I installed it correctly in the GAC using the .Net 2.0 configuration tool (mscorcfg.msu) However, when I want to reference it in visual studio, where do I find it? ( I know, I should not use the GAC anyway, but indulge me ;-)) EDIT: I did not ask the question clear enough: After installing the ...

Do you know of a good quick reference guide for a number of programming languages?

In the course of my job I am maintaining code in a number of programming languages (listed below). As I haven't mastered most of them I keep forgetting the differences in syntax between them. Is there a good reference which covers (preferably for all of them on a side of A4, in a table) the basic features of the language e.g. condition...

using Interop.SHDocVw.dll Where can i find this namespace/dll at?

I've done this before, I don't remember if i downloaded the DLL from off the net or something but i don't want to get a virus. I need access to this namespace so that I can have extra features that the Webbrowswer control doesn't offer. How do I add a Com reference exactly. Or do I need the dll from someplace Thanks ...

different by ref question using a simple =

I have a variant on the by ref question. I know all about calling with the ref or our parameters and how it affects variables and their values. I had this issue with a DataTable and I want to know why a datatable is different than a simple integer variable. I have the physical answer on how to fix the problem but I want to know why it...

Monkeypatching a method call in Python

How do I put off attribute access in Python? Let's assume we have: def foo(): ... class Bar: ... bar = Bar() Is it possible to implement Bar so that any time bar is accessed, a value returned by the callback foo() would be provided? bar name already exists in the context. That's why it's access semantic...

How to locate DLLs for inter-component referencing

My SAAS company has two C#.NET products, call them Application Alpha and Application Beta. Both of them reference some libraries that we can call Core. At the moment, the codebase is monolithic, stored in a single SVN repository with a single .NET solution, and we're trying to make it more modular/componentized. We've split off into s...

Django - how to let one application reference another

Hello, i have two Django apps in my Project, call them App1 and App2. App1 is the "Home"-application that displays a text to introduce users and shows some news. App2 is a "Content"-app to display pages that only consist of a title and some html retrieved from the DB. I want App1 to display it's text using the model from App2. I can do ...

Adding a tab to the "Add Reference" dialog in VS?

Been working on a personal add-in for VS 2008 and have been researching automation and control. I see there are lots of examples for adding a .dll reference to the registry so they show in the ".NET" tab in the Add Reference dialog. What I would like to do, however, is add a new tab to the reference dialog with some functionality therei...