object

Clarification on lists and removing elements

If I have a list<object*>>* queue and want to pop the first object in the list and hand it over to another part of the program, is it correct to use (sketchy code): object* objPtr = queue->first(); queue->pop_first(); return objPtr; // is this a pointer to a valid memory address now? ? According to the documentation on http://www.cp...

Use javascript variable in object name

I am using CKEditor, and, when referring to the CKEditor instance, I need to use a variable. But, since calling the instance is a object, I am really not sure how to do this. I am using: CKEDITOR.instances.textarea123.insertHtml('<p>Whatever</p>'); The issue is, I need 123 to be a variable, because I need to change the instance base...

C# ILMerge Unable to cast object of type 'ClassY' to type 'ClassX'.

Here's the situation: I am using ILMerge to merge an assembly & all it's references into 1 .dll file using this method (custom.dll). I have an application which dynamically loads this assembly at runtime (program.exe). Both application & assembly use a common library (common.dll). Abstract class ClassX is defined in common.dll whilst...

C++: iterating over a list of a generic type

Yet again I find myself struggling with the C++ syntax. I'm trying to iterate over a list of generic objects. That is I have objects of a class Event<Q>, crammed into a std::list<Event<Q> >. So I'm trying to get an iterator over the list and intuitively thought that std::list<Event<Q> >::iterator it; for (it = events.begin(); it != ev...

looping through a object which contains an object php

I have a PHP Object which contains other objects i.e $obj->sec_obj->some_var; I want to use a foreach loop to loop through the object and all objects objects. I think the max level is 3, so $obj->sec_obj->third_obj->fourth_obj Any ideas? ...

How is reference to java object is implemented?

Is pointer is just used for implementing java reference variable or how it is really implemented? Below are the lines from Java language specification 4.3.1 Objects An object is a class instance or an array. The reference values (often just references) are pointers to these objects, and a special null reference, which refers ...

is it allowed to create a php class inside another class

Hello, I was wondering if it is allowed to create a class inside another class. It's actually the database class or, do I have to create it outside and then pass it in threw the constructor? but then I have created it without knowing if I would need it example: class some{ if(.....){ include SITE_ROOT . 'applicatie/' . 'db.class.p...

Why does every class in .NET inherit from Object?

I don't understand it... Why do they need a common base? ...

Object initialization in CSharp

When i have declaration like: class Professor { string profid; public string ProfessorID { get { return profid;} set { profid=value;} } student st; } class student { string name; string id; public string Name { get { return name;} set { name=value; } } public string StudentID { get { ...

comparing a Node and an Object with a BST data structure

I'm getting a "java.lang.string cannot be cast to node" exception. I thought of converting the localRoot to a string using a provided toString method then comparing them, nut this leaves no concept of 'greater than' or 'less than' which I need to navigate the BST... int computeResult = ((Node<E>)o).compareTo(localRoot); where o is o...

Javascript 'property inheritance'

Is there a way to specify common elements for object literals in an array? For example: var array = [ {key: "hi", label: "Hi", formatter:deleteCheckboxFormatter}, {key: "hello", label: "Hello", formatter:deleteCheckboxFormatter}, {key: "wut", label: "What?", formatter:deleteCheckboxFormatter}]; All three r...

Difference Between Object And NSObject

Hello, I'm learning Objective-C and as I can see, in some tutorials they use Object(imported from objc/Object.h) and in others i see the use of NSObject(imported from Foundation/NSObject.h), but what are the main differences between they? Regards. ...

How to return an instance from a DLL?

Hello buddies: I am programming a DLL. I have to return an instance of TBitmap to the host application. The DLL has another UNIT, wich is a Form, that it has a TImageList for storing images. I wrote a function that I want to return an Image from the TImageList (from the DLL to the host application. How can I do this? Thanks, Yulién. ...

New to programming and having a problem with List<T>

PAW.Btrieve oBtrieve = new PAW.Btrieve(); PAW.CustomerClass oCustomer = new PAW.CustomerClass(); int Status = oBtrieve.Connect("Z:\\payinc"); if (Status == 0) { GC.Collect(); Status = oCustomer.OpenFile(); if (Status == 0) { Status = oCustomer.GetFirst(); int cn...

Accessing SimpleXML Object attribute

Have this print output from print_r($theobject); SimpleXMLElement Object ( [@attributes] => Array ( [label] => a ) [0] => Abnormal psychology : Abnormal psychology : ) Just cannot find a way to get element 0 which is "Abnormal psychology :" Lets call the object as $theobject I did $theobject[0], ...

Is it possible to convert between classes with a common parent?

If I have two classes that each extend a common parent, is it possible to convert between them? class Foo { public $bar; } class FooDatabase extends Foo { public function load() {} public function save() {} } class FooFlatfile extends Foo { public function load() {} public function save() {} } $foo = new ...

Receiving object from memory address on iphone

Hi I'm using 'malloc_error _break' to break on double free error. The stack trace does not lead me to a specific line or object (only to the assembly code). What I can see is the object address: ...malloc: *** error for object 0xfa1340: double free How can I find which object this address represents? (0xfa1340) (I tried to find it...

Singleton Scala actor?

Simple question. Can I do this: object Xyz extends Actor { ... } or do Actors have to be classes with instances? ...

Object to List<Song>

I am currently using ObjectListView, and right now, i'm trying to get it so if i click on an object (row), it will give me information about that song (in list form). Currently, I have a custom list: public Song(string title, string artist, string album, string genre, string time, int playcount, string location) { t...

Run Time Object Graph Builder Composition Library

I am working on a project and have started to use IOC/DI (Unity) and I've looked into MEF. I have come across something which is related to IOC/DI and could probably reuse many of the components that IOC/DI containers use but which isn't the same. This scenario is close to what MEF is trying to accomplish, but rather than assume that f...