reference

Resharper says I need to reference a dll, which is already referenced. code compiles ok.

I have a strange problem with resharper. I have a project file which is modified so that references are made by using an environment variable like so: <Reference Include="$(DllLocation)My.Companies.dll"> <Private>false</Private> </Reference> The project references another project, which also has the reference to the same dll in the...

Could I get the name of current reference within Java?

public class RefName { void outRefName() { System.out.println("the current reference name is" + xxx); }; }; public static void main(String[] args) { RefName rf1 = new RefName(); rf1.outRefName(); // should be rf1 RefName rf2 = new RefName(); rf2.outRefName(); // should be rf2 }; As the code above shows,could I mak...

PHP Memory Overflow?

Hi all, Im currently building a php framework... again. I have a class called config. its pretty simple, its called like so: $conf = config::get('general'); $conf is now an array full of config goodies. the class sceleton is like so: final class config { private static $configs = array(); public static function get($name) { ret...

GAC Assembly Missing in Add Reference dialog

I have an Interop assembly lying in GAC; Windows Explorer clearly shows it listed in the C:\WINDOWS\assembly folder. Yet, when I try to add a reference to it in from Visual Studio, I can't see it anywhere in the Add Reference dialog. If this is happened to you too, what is the reason for this? And how do I fix this? (The assembly is ac...

Problem with luabind::object dereferencing (simplified)

Using C++, lua5.1, luabind 0.7 Lua code: -- allocates near 8Mb of memory function fff() local t = {} for i = 1, 300000 do table.insert(t, i) end return t end C++ code: { luaL_dostring(lua_state, "return fff()"); luabind::object obj(luabind::from_stack(ls, -1)); } lua_gc(l_, LUA_GCCOLLECT, 0); // colle...

Reference types in depth

I understand that the semantics of equality checking changes based on whether you are checking value types or rference types. Aren't reference types just a higher level pointer? What exactly is happening when using a reference type? Is all the dereferencing, upcasting etc just being handled by the runtime now? ...

Java references

Is there any way to find all references to an object (in Java)? I have a cache of objects, and would like to periodically scan it to see if removing the object will cause it to be destroyed. ...

Could I change the reference inside one method with this reference as argument in Java?

private static void changeString(String s) { s = new String("new string"); } public static void main(String[] args) { String s = new String("old string"); changeString(s); System.out.println(s); // expect "new string" } How could I make the output of "new string" happen with s as the only argument to method changeStrin...

Is there any way to find the address of a reference?

Is there any way to find the address of a reference? Makingit more specific: The address of the variable itself and not the address of the variable it is initialized with ...

Ampersand inside casting

I come across this code int n1 = 10; int n2 = (int &)n1; I don't understand the meaning of this casting, n2 is not reference since modifying n1 doesn't reflect n1. Strangely this code throws compiler error in gcc where as compiles fine in VC++. Anybody know the meaning of this casting? ...

Why do C++ allow constant to be transformed to reference argument in another method?

void outputString(const string &ss) { cout << "outputString(const string& ) " + ss << endl; } int main(void) { outputString("constant tranformed to reference argument"); //! outputString(new string("abc")); new only return pointer to object return 0; } Since its prohibited to create temporary object reference transform...

How can I avoid creating new wrapper objects all over the place?

I have various classes that wrap an IntPtr. They don't store their own data (other than the pointer), but instead use properties and methods to expose the data at the pointer using an unmanaged library. It works well, but I've gotten to the point where I need to be able to refer to these wrapper objects from other wrapper objects. For ex...

Passing a char** into a function by reference

Season's greetings! I have a function that prints out the contents of a char** that is being used as an array to store a number of strings. The is declared like this: char** commandArray = (char**)malloc(historySize); where historySize is a global int set to 8, for now. The array is populated with commands that the user enters, in s...

Code compiles locally on g++ 4.4.1, but not on codepad.org (g++ 4.1.2)? (reference to reference problem)?)

I was writing a test case out to tackle a bigger problem in my application. I ended trying some code out on codepad and discovered that some code that compiled on my local machine (g++ 4.4.1, with -Wall) didn't compile on codepad (g++ 4.1.2), even though my local machine has a newer version of g++. Codepad calls this a reference to refe...

Does Google Webapp framework for Google App Engine maintain a link to the database?

1) When a script gets data from the database using the db.Model.get_element_by_id("id") method, what id does it refer to, and how can you get it from the database. 2) If you get a result using this method, does that result maintain a link to the database so that any changes to the result are reflected on the database? If not, how would y...

unsetting php reference

So I have this function, and it returns me a reference to a particular point to the array passed in. I want to make a call to unset that will then remove the result from the array/reference, but calling unset only removes the reference, not the data from the original array. Any thoughts? ...

Is using "operator &" on a reference a portable C++ construct?

Suppose I have: void function1( Type* object ); //whatever implementation void function2( Type& object ) { function1( &object ); } supposing Type doesn't have an overloaded operator &() will this construct - using operator & on a reference - obtain the actual address of the object (variable of Type type) on all decently standard-c...

Does a list<> store a reference to the property or instance?

When adding to a list, if I add the property of a class instance, is it set to a reference of the property's value or a reference to the property? Example: If I have: class A { public Action<Guid> SomeDelegate { get; set; } } And in a different class I create an instance of class A, ie: class B { public B() { a ...

How do I call DotNetFactory from VBScript in a stand-alone .vbs file?

I've been exploring options for expanding my QuickTest Professional scripting capabilities, and came across this article this morning, so I decided to experiment a bit. The code below works fine when executed inside the QTP environment, but I could see a use for this outside of the QTP environment as well. Unfortunately, it is causing an...

How do I reference a Perl hash in an array in a hash?

This is the code snippet I am working with: my %photo_details = ( 'black_cat' => ( ('size' => '1600x1200', 'position' => -25), ('size' => '1280x1024', 'position' => 25), ('size' => '800x600', 'position' => 0), ), 'race_car' => ( ('size' => '1600x1200', 'position' => 10), ('size' => '800x600', 'position' => 5), ),...