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? ...
Do they? Or to speed up my program should I pass them by reference? ...
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 ...
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...
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...
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/...
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 { ...
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...
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...
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...
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? ...
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...
**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_...
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 ...
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...
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 ...
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...
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...
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...
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 ...
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...