references

System.TypeLoadException (WebPartsZone) in mono

I load a user control in a web page which throws an exception: this.LoadControl(someusercontrol); // throws TypeLoadException The details : System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded. at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool) at System.Reflection.Assem...

Difference between pointer to a reference and reference to a pointer

What is the difference between pointer to a reference, reference to a pointer and pointer to a pointer in C++? Where should one be preferred over the other? ...

Do pointers in java actually exist?

I thought I'm pretty experienced in java, but it seems that's not really the case, I just noticed something yesterday, something I used before but never really realised what it did. I googled but didn't find the answer to my question. If I declare an int array, and use Array's static sort function to sort my array, I just need to type ...

Visual Studio autoclean?

Hello, I have a solution with multiple projects - executable, library, and others(unimportant right now). Library contains EF entity classes and executable uses them. When I'm working on some code from the executable then every entity that I use is marked as an error and compiler says that I should check usings and references. Reference...

C++ by-reference argument and c linkage

Hi, I have encountered a working (with XLC8 and MSFT9 compilers) piece of code, containing a c++ file with a function defined with c linkage and a reference argument. This bugs me, as references are c++ only. The function in question is called from c code, where it is declared as taking a pointer argument to the same type in place of th...

Is C++ the single language that have both pointers and references?

Amongst the programming languages I know and those I've been exposed to, C++ looks like the only one to have both pointers and references. Is it true? ...

What is the correct way to add references to libraries in C++/CLI?

I am writing a lib in C++/CLI, and one of the functions is returning a System::Drawing::Color object. I added System.Drawing as a project reference. It works. I then created a test application to link to this lib and added my created lib as a reference. Everything linked fine, but then I tried to the run the application and I had the...

Handling of references in C++ templates

I currently have a function template, taking a reference, that does something in essence equivalent to: template <typename T> void f(T& t) { t = T(); } Now, I can call: int a; f(a); To initialize my variable a. I can even do: std::vector<int> a(10); f(a[5]); However, this will fail: std::vector<bool> a(10); f(a[5]); The re...

Can I detect whether I've been given a new object as a parameter?

Short Version For those who don't have the time to read my reasoning for this question below: Is there any way to enforce a policy of "new objects only" or "existing objects only" for a method's parameters? Long Version There are plenty of methods which take objects as parameters, and it doesn't matter whether the method has the obje...

Constructors accepting string reference. Bad idea?

It's considered a bad idea/bad design, have a class with a constructor accepting a reference, like the following? class Compiler { public: Compiler( const std::string& fileName ); ~Compiler(); //etc private: const std::string& m_CurrentFileName; }; or should I use values? I actually do care about performance. Thank you in adva...

When does the CLR try to load a referenced assembly?

I want to write a small installer app that installs a web site and creates IIS virtual directories. The app should run on Windows XP/Server 2003 (IIS 6) as well as on Vista/2008 (IIS 7). The problem is: for IIS 6 we create virt dirs by calling WMI/Metabase API, for IIS 7 there is a much better API: Microsoft.Web.Administration, but its ...

include assemblies via code? C#

In msvc i can write #pragma comment(lib, "my.lib"); which includes my.lib in the linking stage. In my solution i have 2 projects. One is a class project the other is my main. How do i include the reference dll in code instead of adding the reference in the project? ...

Upcasting pointer reference

I have the following contrived example (coming from real code): template <class T> class Base { public: Base(int a):x(a) {} Base(Base<T> * &other) { } virtual ~Base() {} private: int x; }; template <class T> class Derived:public Base<T>{ public: Derived(int x):Base<T>(x) {} Derived(Derived<T>* &other): Base<T>(other) {} ...

How to make an ambiguous call distinct in C++?

void outputString(const string &ss) { cout << "outputString(const string& ) " + ss << endl; } void outputString(const string ss) { cout << "outputString(const string ) " + ss << endl; } int main(void) { //! outputString("ambigiousmethod"); const string constStr = "ambigiousmethod2"; //! outputString(constStr); } //...

In MonoDevelop, how do I include all assemblies from a package as references?

I want to include all the assemblies in the GtkSharp package. Right now, I have to find every assembly and include it individually. Is there any way to simple include all assemblies in the GtkSharp package? ...

Referencing an unmanaged C++ project within another unmanaged C++ project in Visual Studio 2008

First of all, let me say that I am not a C++ developer. However, I am working on a neural network project that requires me to work with C++. I am working with the Flood Neural Network library. I am trying to use a neural network library in an unmanaged C++ project that I am developing. My goal is to create an instance of a class object w...

How can I reverse an array reference and store that in another array reference in Perl?

I have this example: my $numbers = [ 1, 2, 3, 4, 5, 6 ]; my $newarray = [ reverse @$numbers ]; This example contains some synthetic code to make the $numbers arrayref appropriate for the reverse function. I would like to remove that code and do something more like this: my $newarray = reverse $numbers; I know this doesn't work, it ...

Can someone explain me what is the difference between Strong, Soft, Weak and Phantom references and the usage of it?

I have been trying to understand the difference between different references but the theory does not provoke any ideas for me to visualize the same. Could anyone please explain in brief the different references? An example for each would do better. ...

Java object references with cache layer

We've created a caching layer to our J2EE-application. In this instance we use Ehcache. This has created a few challenges. Let's take this example. OrderItem orderitem = cache.getOrderItemByID("id"); OrderItem old_orderitem = cache.getOrderItemID("id"); orderitem.setStatus(1); old_orderitem.setStatus(2); If we're not carefull, any ...

VS.NET: Project Refs vs. Assembly Refs

There's some debate here over which is better for referencing our common code base from other projects: by project or by assembly. I'm in favor of referencing the project, especially since we have automated unit tests that prove that the common code does what it needs to. The thought from the other camp is to lock down those projects...