references

add reference to Silverlight project from other non silverlight project

I have Silverlight application using NHibernate as a ORM. I have projects for Data(mapp and entities), data access and Silverlight. I want to add to SL project reference to data access to execute methods, but SL can only get reference from other SL project. How can I omit it? If I host data access project on WCF I could reference WCF to...

C++ pass by reference

I've recently (4 days) started to learn C++ coming from C / Java background. In order to learn a new language I ussualy start by re-implementing different classical algorithms, as language specific as I can. I've come to this code, its a DFS - Depth First Search in an unoriented graph. Still from what I read it's best to pass parameters...

Sorting an Array Reference to Hashes

After executing these lines in Perl: my $data = `curl '$url'`; my $pets = XMLin($data)->(pets); I have an array reference that contains references to hashes: $VAR1 = [ { 'title' => 'cat', 'count' => '210' }, { 'title' => 'dog', 'count' => '210' } ] In Perl, how do I sort the h...

How can I iterate over regular expression match variables in Perl?

I have a long regular expression that parses a text file into various match variables. For robustness, the match variables are likely to contain white space. I'd like to remove the whitespace in a systematic way by iterating over the match variables. For example, I have match variables $2 through $14 that contain some whitespace. I co...

Inserting Array References into Perl Heap

I am inserting 2-dimensional array references into my heap in Perl. How should I define the 'elements' attribute when constructing my heap so that I can properly use my comparator function? my $heap = Heap::Simple->new( order => \&byNumOrStr, elements => [Array => 0] ); ...

Visual Studio 2008 C# project now can't find my references -- likely causes?

Hi everyone, I'm using VS 2008. In one of our web projects, for some reason, I'm suddenly getting yellow exclamation marks indicating missing references. I'm not sure why. If I look at the .csproj file in a text editor the references in question are in the project folder structure, tucked in a subfolder, and sure enough that folder a...

How to let Visual Studio to add references according to USINGS?

Hi, I realized that when dividing a project into two in Visual Studio (2010) I'm still looking for references that are missing in the new project. Can Visual Studio do that for me? It can find all the namespaces I use so it should be easy for it. Thanks! ...

Removing all unused references from a project in Visual Studio 2008 / 2010

Hey I just wondered if it possible within Visual Studio 2008 / 2010 to automatically remove all references from a project that were never been used. ...

how to pass a self-reference to constructors in java?

hi there! i have a class A that needs to instantiate a second class B, whose constructor needs a reference to the same object of class A... would look like: public class A { B b; public A() { b = new B(this); } } public class B { A a; public B(A a) { this.a = a; } } well - eclipse keeps com...

Multiple initialization of auto-vivifying hashes using a new operator in Ruby

I would like to initialize several auto-vivifying hashes by one-line expression. So far I came to an extra method for the AutoHash object: class AutoHash < Hash ... def few(n=0) Array.new(n) { AutoHash.new } end which allows me to do the following a, b, c = AutoHash.new.few 3 However, I feel that one can make the followin...

Library of Objects - Access Index Value or Object Itself? (e.g., deep vs. shallow copy perhaps?)

I've always been confused/unsure about how .Net copies references. Let's say I have a Bitmap object for GDI+. dim foo as new bitmap("c:\foo.bmp") 'Foo' holds the bitmap object. Now let's say I do this. dim bar as bitmap = foo Is this a shallow copy or a deep copy? If I set foo equal to nothing, does bar suddenly reference 'nothing...

Which reference should I take to an exam?

Hello everyone! I have an upcoming exam on Programming using C++ and we can take consultation material. I have decided to take a reference as well as some code examples, etc. Which reference should I take? Here's what I have available at the college's library: The C++ standard library : a tutorial and reference STL tutorial and refe...

What is the usual way to add an external assembly to ASP.NET MVC project?

I have an external compiled assembly with HtmlHelper extension methods. I need to use it in the project so that there wouldn't be any absolute references to this assembly because the project is shared with Team Foundation Server. What is the usual way to solve the problem? ...

Returning references from a C++ methods

Dear friends, i'm concerned if i'm making a bad use of references in C++ In the following method GCC complains warning "reference to local variable ‘me’ returned" MatrizEsparsa& MatrizEsparsa::operator+(MatrizEsparsa& outra){ MatrizEsparsa me(outra.linhas(),outra.colunas()); return me; } But, with the following changes the warning...

Microsoft Application block DLL V2 and V4.1 references

My application is referencing Microsoft Enterprise library V4.1 while one of the older DLL (external application) requires a reference to Microsoft Enterprise library V2.0. I know for sure that i can register both of these assemblies in the GAC and the application will start reading relevant DLL as required but that is not a solution for...

Add reference always picks a certain file, even if I add a local assembly file

I have installed blend which installs Microsoft.Expression.Interactions.dll which I reference in my project. If I copy this dll to a folder local to my solution and reference that copy, when I look at the properties of the reference in visual studio it always shows the path to the version that blend installed. It only changes to the lo...

Why does VS2010 remove my references?

In a small console application I'm writing to test something I need to add a reference to one of the DLLs built from a build of another solution. The Add References dialog works perfectly; after I browse to the DLL on disk and add it I see it with a green tick and it appears in the list of references in Solution Explorer. All fine so far...

Reference as key in std::map

Suppose some data structure: typedef struct { std::string s; int i; } data; If I use the field data.s as key when adding instances of data in a map of type std::map<std::string&, data>, do the string gets copied? Is it safe to erase an element of the map because the reference will become invalid? Also do the answers to these ...

silverlight .xap packaging bug (references of reverenced assemblies)

I encountered this strange issue and was lost for several hours before i found something interesting about how the .xap is packaged. among several things, i came to know that if my project was named "References", it would not be included in the xap, and more strange was another problem that if my SL app is referenceing assbly1 project ...

Strings in Java : equals vs ==

String s1 = "andrei"; String s2 = "andrei"; String s3 = s2.toString(); System.out.println((s1==s2) + " " + (s2==s3)); Giving the following code why is the second comparison s2 == s3 true ? What is actually s2.toString() returning ? Where is actually located (s2.toString()) ? ...