reference

What's wrong with this javascript? Array not defined

What's wrong with this code? var divarray = document.getElementById("yui-main").getElementsByTagName("div"); var articleHTML = array(); var absHTML; var keyHTML; var bodyHTML = array(); var i = 0; for ( var j in divarray) { if(divarray[i].className == "articleBody"){ alert("found"); articleHTML = divarray[i]; break; } bodyHT...

How to add reference to EnvDTE project?

Hello, I have the project getting using DTE with C++: pSolution->get_Projects(&pProjects); CComPtr<EnvDTE::Project> pProject; pProjects->get_Items(1, &pProject); Then I need to add reference to this project. How to do that? As far as I know VsLangProj namespace is not accessible for C++ code. Thanks ...

C# Possible unintended reference comparison...

When i try to check Session["userId"] != null why i get this message Possible unintended reference comparrison; to get value comparrison; cast left hand side to string Any suggestion.... ...

System.Threading.Timer keep reference to it.

According to [http://msdn.microsoft.com/en-us/library/system.threading.timer.aspx][1] you need to keep a reference to a System.Threading.Timer to prevent it from being disposed. I've got a method like this: private void Delay(Action action, Int32 ms) { if (ms <= 0) { action(); } System.T...

.NET application silently fails to start when assembly missing

I have a .NET C# winforms application which works great on my machine, but if I try to run it on another machine, it doesn't start up. No error message, no crash message, no window - nothing. I've found that this always happens when a referenced assembly is missing. I guess this is .NET's general behavior and not specific to my app, is ...

How to query through a DBRef in MongoDB/pymongo?

Is it possible to query through a DBRef using a single find spec? user collection { 'age': 30 } post collection { 'user': DBRef('user', ...) } Is it possible to query for all post who's users are 30 in a single find step? If not, would it be wise to create a javascript function to handle the multi-stage operation or will ...

Am I doing AS3 reference cleanup correctly?

In one frame of my fla file (let's call it frame 2), I load a few xml files, then send that data into a class that is initialized in that frame, this class creates a few timers and listeners. Then when this class is done doing it's work. I call a dispatchEvent and move to frame 3. This frame does some things as well, it's initialized a...

How can I reference a file in my drawable folder to put in WebView in android?

For example, I want to make an image appear in webview to utilize the zoom functions. I would use this line of code: this.myWebView.loadUrl("file://"); I just need to know what to put after file to reference the image. ...

How to call a C++ function that takes a reference from C# code

HI, I have a C++ function like the following: int ShowJob(const JobData& data); How does this translate to a DLLImport statement which I can use to call the function from C#? ...

Pointing class property to another class with vectors

I've got a simple class, and another class that has a property that points to the first class: #include <iostream> #include <vector> using namespace std; class first{ public: int var1; }; class second{ public: first* classvar; }; Then, i've got a void that's supposed to point "classvar" to the intended iteration of the clas...

A program that print out itself n times

Is that possible to write a program that reads in a integer n and outputs the program itself n times? ...

"Unhandled exception"/"Access violation writing location" error with referenced array pointers

I'm trying to fill a pointer matrix with values from a text file. It's a double pointer to a simple struct with 2 ints, time and tons. void get_changes(change** &c){ ifstream file("change_data_time.prn"); //data file, time only, size is the same as tons string line, var; //string placeholders for the getlines ...

Silverlight 3-4 reference kind (e-)book.

Hello! I'm looking for a source of information about Microsoft Silverlight to begin practically efficient programming custom functionality applications. I want to pretend just for now that I don't need any ideologically correct refresher (SL tips, top patterns, VS tutorials :) and etc.). Basically, what I want is a reference kind e-book...

What scenarios would ** be useful?

Possible Duplicate: Uses for multiple levels of pointer dereferences? I saw a question about ** (pointer to a pointer) in C here. I'd like to know whats the point of this? When should I use it? ...

Why is my Map broken?

Scenario: Creating a server which has Room objects which contain User objects. I want to store the rooms in a Map of some sort by Id (a string). Desired Behavior: When a user makes a request via the server, I should be able to look up the Room by id from the library and then add the user to the room, if that's what the request needs. ...

IPhone 3.0 specific code on 2.2.1

Hello There, I'm writing games onto IPhone platform and want to leverage the "Play ITunes music while running your app" feature. This is something introduced in OS 3.0 but I want to target OS 2.2.1 with sacrificing that feature, as well. I'm compiling against 3.0 and have the minimum support set to OS 2.2.1. I also weak referenced "Med...

How to make a copy of a char and not a reference in C++

If I declare a function like this: string hash (char* key) then any change I make to key will also change it's value when the function exits, correct? I want to make a copy of it in the function so that I can safely change it without changing the original value. I tried this, but it doesn't work. char temp = key; How can it be do...

Reference Object calling function in Javascript

I have a makeshift events system in JS and the attacher looks like this: events.attach(events.NEW_TASK,this.update); Where this.update is a callback/handler/function. The problem is, when the dispatcher tries to call this handler, it loses it's original context. How can I bind the handler with the context of the object that calls the ...

Good Powershell References

I am looking for a book or a site or something which will hit on the powershell scripting. NOT in command line. I have a couple of scripts I need to write, writing an application is overboard, but the language is confusing. Programming conventions I am used to from php and C# seem to be thrown out the window on some things, like if stat...

Are reference attributes destroyed when class is destroyed in C++?

Suppose I have a C++ class with an attribute that is a reference: class ClassB { ClassA &ref; public: ClassB(ClassA &_ref); } Of course, the constructor is defined this way: ClassB::ClassB(ClassA &_ref) : ref(_ref) { /* ... */ } My question is: When an instance of class 'ClassB' is destroyed, is the object referenced by 'Cl...