reference

Segmentation fault while using priority queues

I have a priority queue with elements of a class named A I need elements from this queue which may be lower down the queue (lesses priority). So , I am trying to pop a few elements until i get the element of my choice. Once i get the element of my choice i am planning to push all the elements i stored temporary in an array. I have a loo...

Notice: Array to string conversion - Why?

Hi im trying to execute the following PHP code, however im receiving an error. Im passing a reference into the core class, which i want to assign to a variable within the classes scope.. Notice: Array to string conversion Thanks in advance.. $core = new core($config); $core->execute(); class core { private $config; pub...

How ReferenceEquals can understand references belong same object ?

Hello everybody I am just curious background of some classes and methods in .NET so i just wonder how ReferenceEquals method can understand 2 references belongs to same object or not? ...

The type "x" is defined in an assembly that is not referenced. VS 2010 C#

Hi all, I am having a problem I just couldn't solve and would like some input. I am working with multiple class libraries in Visual Studio 2010, .net 4.0 Framework, in C#. I have a class library project which references the assembly output(.dll file) of another Visual Studio solution. The reference was added correctly to the class li...

C# Compiler says function is not defined, when it is...

I just need another pair of eyes... I don't see anything wrong with the following. In fact, I swear I had something just like this not long ago, and it worked. In my Collections.dll: namespace Collections { public class CSuperAutoPool { public static CSuperAutoPool ActivateByType(Type typeToBeActivated, params object[] act...

Where are reference to DirectX assemblies in Visual Studio 2010

I installed the new Visual Studio 2010. I want to create a C# Winform DirectX application, but I can't find the following assembly when adding the .Net reference list: Microsoft.DirectX Microsoft.DirectX.Direct3D Microsoft.DirectX.Direct3DX How can I use DirectX with Visual Studio 2010? ...

Where to find info on ODBC SQL dialect/grammar, incl. built-in functions/operators?

I'm looking into writing a C++ database library that will run on top of either ODBC or on top of another library that itself uses ODBC (possibly DTL, OTL, or SOCI). At this point I need to know what SQL functions (MIN, MAX, AVG, EXISTS, IN, etc.) and operators (+, -, /, *, etc.) I'll have available through the ODBC SQL dialect without n...

Passing by reference and using ref

I looked at the similar questions and read some articles. THis article has some pictures which makes it clear. SomeObject so = new SomeObject(); somefunction(so); Console.write(so.x); // will print 1 SomeObject so1 = new SomeObject(); somefunctionByRef(so1); Console.write(so1.x); // will print 1 static void somefunction(SomeObject s...

Undefined Reference in JNI

I am declaring a JObject NewObjectV. jobject NewObjectV (JNIEnv *env, jclass cls, jmethodID methodId, WIMAX_API_DEVICE_ID_P pDeviceId); But am getting the following error undefined reference to ' android :: NewObjectV(_JNIEnv *, _jclass *, _jmethodID *, _WIMAX_API_DEVICE_ID_P *). What should be the code to remove this error? My comp...

How do I "Create a Reference To a Different Workbook" that supports closed workbooks.

I want to do something like this: Create a Reference To a Different Workbook (look for this section in the page). However, the instruction says that the documents must be opened for the INDIRECT function to work. How can I make it work even if the documents are closed? Any other solutions / alternatives? I don't want to open each file...

C# asp.net - The type or namespace name 'Helper' could not be found (are you missing a using directive or an assembly reference?)

I'm reworking someone else's code, where they had a helper class with way to much code that shouldn't be there (data access, business logic, everything had slowly been shoved in there). I've moved the relevant code into the appropriate pre-existing classes and created a separate, brand new helper class in the appropriate project, but al...

Upcasting instance and Invoking a function on base class in C++

class PureVirtual { public: virtual PureVirtual& Foo () = 0; virtual ~PureVirtual () {} }; class SemiVirtual : public PureVirtual { public: PureVirtual& Foo () { printf ("foo worked."); return *this; } virtual ~SemiVirtual () {} }; class NonVirtual : public SemiVirtual { public: NonVirtual& Bar () { printf ("bar worked....

Scala, Java and equality

val filesHere = (new java.io.File(".")).listFiles val filesHere2 = (new java.io.File(".")).listFiles scala> filesHere == filesHere2 res0: Boolean = false That is quite counter intuitive. I would rather expect that filesHere and filesHere2 are equal. This is certainly due to a semantics mismatch between Java and Scala, e.g., ab...

Why can't I reference JavaScript files in my View?

My JS works when I reference it in the MasterPage, and it works when I reference it in a Partial View (.ascx), but not when I reference from the View (.aspx). Any ideas why? ...

Target 'Android 1.5' does not support building project with libraries.

I'm trying to build a project in Android 1.5 that references another Android (library) project compiled against Android 1.5 and I keep seeing this error in the Console in Eclipse: Target 'Android 1.5' does not support building project with libraries. I'm running Eclipse 3.5, and version 0.9.7 of the ADT. I followed the instructions he...

Android: How do I reference a stylable that resides in a library that my app references?

I have a custom view I created that resides in a library I'm referencing in my app. In the library I declared a styleable, which the view uses. In my app, I'm using the custom view from the library as such: <nefarious.library.myappname.views.DragDropList xmlns:ddl="http://schemas.android.com/apk/res/nefarious.library.myappname" andro...

Returning reference from a function and modifying it

#include<iostream> int& f(){ static int x = 0; x++; return x; } int main(){ f() += 1; //A f() = f() + 1; //B std::cout << f(); } The above code outputs 6 on gcc and 5 on MSVC. Now when I modify A and B to f()=f() I get 5 on both compilers. What is the big deal here? Is the behavior undefined. If yes , why? ...

When to return a pointer, scalar and reference in C++?

I'm moving from Java to C++ and am a bit confused of the language's flexibility. One point is that there are three ways to store objects: A pointer, a reference and a scalar (storing the object itself if I understand it correctly). I tend to use references where possible, because that is as close to Java as possible. In some cases, e.g....

Is there a way to know what keeps objects alive in C#

I'm trying to optimize memory usage of a program and therefore wants to remove objects when they aren't needed any longer. To check if this works correctly I wrote a console.writeline method in the destructor of the type of object I want to remove. However when I test the program, no lines are written (only when the program terminates of...

R.java file from Android library project not importing into application project

I followed the instructions here on how to create an Android library project, and use it in an Android application: http://developer.android.com/guide/developing/eclipse-adt.html but it is not working. I can see the library project is added to my application but I cannot reference anything in it because it won't build. The R.java file ...