objects

How to find memory used by each object in a program?

Hello, How do I find out about the memory used by each object in a program? For example : I want to know how much memory(in Kb) is used by this object "someclassinstance".. someclass someclassinstance=new someclass(); I can see the total memory used by the application in the task manager...But Is there a way to see detailed report ab...

Is this a good JavaScript object model? (phone book project)

I need to create a phoneBook. Thanks to a form, I can retrieve a person's data. I need to use objects for that purpose. I created a phoneBook() object with the help of a method that enables to add a person in the phoneBook. I decided (it wasn't asked for though) to divide the "person" concept in 2, which results in a "Person" object and...

Why do the variables behave so strange?

I thought an variable in objective-c is just a reference to an object somewhere in memory. So for my understanding, the result must have been "one", because at the end i assign the object's memory address of str1 to str2, and previously I had assignend the memory adress of str2 to test. NSString *str1 = [NSString stringWithCString:"one"...

Intelligent Selection Algorithm

Hi all, I am using VB.NET and I am trying to come up with some algorithm or some pseudo-code, or some VB.NET code that will let me do the following (hopefully I can explain this well): I have 2 collection objects, Cob1 and Cob2. These collection objects store objects that implement an interface called ICob. ICob has 3 properties. A boo...

How to call a parent class's method from child class in python?

Stackers, I apologize for this question in advance. It must be a FAQ, but I don't seem to be able to find the answer. When creating a simple object hierarchy in python, I'd like to be able to invoke methods of the parent class from a derived class. In Perl and Java, there is a keyword for this (super). In Perl, I might do this: pa...

Parsing files with Python

What type of Python objects should I use to parse files with a specific syntax? Also what sort of loop should be followed to make it through the file. Should one pass be sufficient? Two, three? ...

PHP Listing Dynamic Member Variables

How would I list all the public variables in an instantiated Object given that we do not know the variable names in the first place? Scenario A class may have a function declared like: function addVar($name, $val) { $this->$name = $val; } I want a list of $names that were ever added to the object instance dynamically. ...

I have a Single File And need to serialize multiple objects randomly.how can Iin c# ??

I have a single file and need to serialize multiple objects of the same class when ever a new object is created. I can't store them in arrays as I need to serialize them the instance an object is create. Please, help me. ...

C++ Problem initializing an object twice

Hi, I'm relatively new to C++ and am having a hard trouble understanding the instantiation of object and pointers to objects. Whats the difference between these two declaration in terms of memory and usage? : MyClass obj1; MyClass *obj2; And also the specific problem I am having is that I have a class which has an unsigned short arra...

Extending SSIS 2005 Packages with Custom Objects

Am I right to be concerned about extending SSIS packages with custom objects? I accept custom objects can extend the functionality of SSIS and can reduce repetition & complexity within SSIS. Are there any guidelines as to when to use custom objects? What are the risks e.g. performance, maintainability etc? Where do I draw the line? ...

How do I pass a list of objects from C++ to Lua?

I'm the lead dev for Bitfighter, and am adding user-scripted bots using Lua. I'm working with C++ and Lua using Lunar to glue them together. I'm trying to do something that I think should be pretty simple: I have an C++ object in Lua (bot in the code below), and I call a method on it that (findItems) which causes C++ to search the area...

C++ RTTI Inheritance causes class size to increase

In C++ the problem is simple. I have 2 classes one contains the other as part of its implementation. struct A { void do_something() { }; }; struct B { A obj_A; void hello_world() { }; }; Now the problem is that structure B is one byte larger if A is part of B when I do a sizeof(B) and object of type B. A ...

C#: Printing all properties of an object

Is there a method built in to .NET that can write all the properties and such of an object to the console? Could make one using reflection of course, but I'm curious to if this already exists... especially since you can do it in Visual Studio in the Immediate Window. There you can an object name (while in debug mode), press enter, and it...

LINQ to objects changing the display column

Hi, hope some can help - my webservice returns an object with certain fields i use ling to object to filer the display an dthen bind the annonymous type to the grid. is there a away to do a similar select as to change the display of the grid column? for example Dim wsr As wsTest.Service = New wsTest.Service Dim objs(...

Updating Object inside/outside Method

Okay, Maybe this is by design of c# or maybe I am going about this the wrong way. Please look at the code I have below. I made it where you can copy and paste it into a console app and run it to see what I am talking about. using System; namespace ConsoleTest { class Program { static void Main() { ...

Is everything an object in python like ruby?

I did google. I may not have searched right. I read on another Stack Overflow question/comment that Python was just like Ruby, as it relates to "everything's and object," and everything in Python was an object, just like Ruby. Is this true? Is everything an object in python like ruby? Thank you. EDIT: How are the two different in ...

How to create a method for an array class?

Sorry, I know this is programming 101, but I can't find any good documentation... I have an array, and I want to cast each member as an object and then call them by the name assigned (this would be so much simpler if javascript allowed for non-number index values). For instance: var things = ['chair', 'tv', 'bed']; var costs = ['10',...

Run code on creation of a PHP class?

I want code to run whenever I create a new object. For example, see this: <?php class Test { echo 'Hello, World!'; } $test = new Test; ?> I want it to echo "Hello, World!" whenever I create a new instance of this object, without calling a function afterward. Is this possible? ...

Extract data from PHP Object

I'm using the Facebook API and the class produces this object. object(User)#4 (5) { ["fbc_uid"]=> string(9) "324234324" ["fbc_first_name"]=> string(5) "James" ["fbc_last_name"]=> string(5) "Proud" ["fbc_name"]=> string(11) "James Proud" ["fbc_email"]=> NULL } How do I ...

Sorting an array of objects in Ruby by object attribute

Hi, I have an array of objects in ruby on rails. I want to sort this array by an attribute of the object. Is it possible? ...