references

Can I use a reference inside a C# function like C++?

In C++ I can do this: int flag=0,int1=0,int2=1; int &iRef = (flag==0?int1:int2); iRef +=1; with the effect that int1 gets incremented. I have to modify some older c# code and it would be really helpful if I could do something similar, but I'm thinking ... maybe not. Anybody? ...

Network tab in Firebug doesn't show any files.

I'm creating a html-layout based on an existing layout. I want to extract all the files, that are currently actually being used, from the old layout, since there is a lot of crap in the directories that's been there from the ancient times or something. So I tried to open the existing layout in Firefox and use Firebug to see which files ...

Create a reference to a variable (similar to PHP's "=&")?

In PHP one can create a reference variable, so that two named variables can look at the same value: $a = 1; $b =& $a; echo $a; // 1 echo $b; // 1 $b = 2; echo $a; // 2 I'm looking to achieve something similar in Python. Specifically, I want to create a reference to an object's property, eg: class Foo(object): @property def bar(se...

Can't load DLL compiled with another one recently moved to the GAC

I have a app that allows users to plug in custom libraries they built. They had to reference a DLL I provided to get attributes needed to make their libs work in my system. Now I need to move this DLL into the GAC, but when I do my app won't load legacy custom libs, even though they were compiled with "Specific Version = False". CreateI...

VS2010 - Getting "type or namespace name could not be found" but everything seems ok?

I'm getting a "type or namespace name could not be found" error for a C# WPF app in VS2010. This area of code was compiling fine, but suddenly I'm getting this error. I've tried removing the Project Reference and Using statement, shutting VS2010 and restarting, but still I have this issue. Any ideas why this might be occurring, where ...

Ruby - How to reproduce the pointers/references behavior ?

Hey :) I am currently trying to create an engine for a new application. Design is quite complex and i realy need a way to create a reference or a pointer or what ever way to remotely modify and access the datas. Datas must be kept in a single place and must not be duplicated. Is there a way do get an object by reference ? For example ...

passing pointers to function that takes a reference?

In C++, when you have a function that takes a reference to an object, how can you pass an object pointer to it? As so: Myobject * obj = new Myobject(); somefunc(obj); //-> Does not work?? Illegal cast?? somefunc(Myobject& b) { // Do something } ...

Different property values on two references to the same object (C#)

I am trying to track down a very elusive bug in an application that manipulates a FlowDocument. I have shown below three consecutive lines of debugging code, together with their output: Debug.Assert(ReferenceEquals(document1, document2)); Debug.WriteLine(document1.Blocks.Count); // 1 Debug.WriteLine(document2.Blocks.Count); // 3 Can a...

Understanding Java's Reference classes: SoftReference, WeakReference, and PhantomReference...

Can someone explain the difference between the three Reference classes (or post a link to a nice explanation)? SoftReference > WeakReference > PhantomReference, but when would I use each one? Why is there a WeakHashMap but no SoftHashMap or PhantomHashMap? And if I use the following code... WeakReference<String> ref = new WeakReference...

C++ object termination notification

In a C++ program, I have two reference counted objects: King and Heir. Heir needs to block until King is destroyed. King is a reference counted object which will be destroyed when it's reference count goes to zero. If Heir holds a reference to King, then King's reference count will never go to zero. How can have Heir block until King...

How do I get my Objects to work in ASP.NET MVC2

I'm rather new to MVC2 (never been in MCV1) though I'm a WebForms developer for some years now... in my MCV 2 start project I created a App_Code folder that I would put my Business Classes on it, I also add 2 References to 2 DLLs used for the API I'm about to use. But I don't get Intellisense on the referenced objects What am I doing ...

C# Main project and child project references

Using Visual Studio 2008: Within the Solution there is a main project (Project1), within the same solution there are other projects (these projects are Excel 2007 Workbook templates). These other projects need to reference classes and objects within Project1, and Project1 needs to be able to access the Workbook projects. What I current...

Query on referencing in Java

Consider the following inheritance example: class A {...} class B extends A { .. .. private static void main(String[] s) { A a1 = new A(); B b1 = new B(); B b2 = b1; // What if it was B b2 = new B(); b2 = b1; } } My question is in the comment. Would it be different, in the sense that, u...

How to get key from the reference of a hash element

suppose $my_ref = \$hash{'mary'}; #my_ref is a reference point to a hash element. .... later on, how can I use $my_ref to retrieve the key of the hash element it point to? i.e how to get string 'mary' from $my_ref? I ask this question because I have several groups of user name list, some user names appear in multiple groups which consum...

Usage of table/figures shown in caption

Hi, is there a way to add the usage of a table/reference in the caption of the reference/table in latex? For example: \begin{table} \begin{tabular}{ll} \textbf{Name} & \textbf{Description} \\ Foo & bar \\ Foo & bar \end{tabular} \caption{Nice Table. Used on pages [2,3,4].} \label{tab:table} \end{tab...

Reference about testing distributed system

Hi, Do you know any good reference about testing distributed systems? It could be about main types of test for distributed systems, major tests, who are the main authors about it ... Thanks for any help, Giovanni ...

Changing the value of a var via reference in AS3

I'm pretty positive what I want to do isn't possible with ActionScript, but it would be nice to be wrong. I need to pass a variable reference to a function, and have the function change the value of the variable. So, simplified and not in completely correct syntax, something like this: function replaceValue(element:*, newValue:String)...

ASP.NET website still looking for old name of renamed referenced assembly

Hi all I have a solution with a website and a class library. I have renamed the class library project from Insight_WebControls to Insight.WebControls. I have also renamed the assembly it produces in its properties. I have removed from the website's references the old class library and added the new. However, when I try to build the we...

C# type defined in an assembly that is not referenced

I have two projects A and B. Project A makes use of type X in project B, so I have a reference to B added in A. Everything built fine. I signed project B using a strong named key file. Everything still built fine. Then I decided to change the strong named key file for B. I rebuilt project B ok. When I try to build project A I rece...

Premature optimization or am I crazy?

I recently saw a piece of code at comp.lang.c++ moderated returning a reference of a static integer from a function. The code was something like this int& f() { static int x; x++; return x; } int main() { f()+=1; //A f()=f()+1; //B std::cout<<f(); } When I debugged the application using my cool Visual Studio debugger ...