objects

What is business object and what are the softwares available to for working with business objects?

What is business object? In a school management application, what is said to be an business object? Is there any software packages available to create a business objects ...

Java override Object equals() method

How do I override the equals method in the object class? i.e I have class Person{ //need to override here public boolean equals (Object obj){ } I want to convert the parameter obj to a type Person, but if I do (Person) obj it won't work. ...

print_r functionality in iPython

Is there a way to get PHP-like 'print_r(object)' funcionality in iPython? I know I can use '?' to get info about an object, but how do I view the values of the object? ...

Moving 3D objects in iphone

Hi, I'm a beginner to the iPhone development. I need some example source code or idea about moving 3D objects in iPhone gaming application. Thanks Khushi ...

How can I get an extension method to change the original object?

I want to be able to write extension methods so that I can say: lines.ForceSpaceGroupsToBeTabs(); instead of: lines = lines.ForceSpaceGroupsToBeTabs(); However, the following code currently outputs: ....one ........two instead of: Tone TTtwo What do I have to change in the following code to make it output: Tone TTtwo (not...

.NET casting objects

I have an abstract class called user, and 2 sub classes: RegisteredUser & VisitorUser. I have a need to convert a VisitorUser object to a RegisteredUser object - do I use casting to achieve this? If so, how? ...

Copy C# object along with reference.

I have an object created in c# say Object1. I need to temporarily back up this object to another object say ObjectOriginal. However if I do ObjectOriginal = Object1, any changes to Object 1 affect ObjectOriginal. How do I go about this? ...

Is it possible to store multiple objects using object archving?

Okay, of course it is possible, that's no issue. In my code I have multiple objects that I work with, and they need to be data persistent. To do that I've used object encoding and storing them in a data file. Such as: -(NSString *)dataFilePath { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomai...

One Vs Multiple Objects - Java or any other OOP

Let's say I need to design a system for a collection of books. And let's assume I have millions of books and for simplicity we don't need to add or remove books from the system. I can create a Book class and initiate an array in the size of the collection: Book book = new Book[number of books]; In this case, Book would include fields...

php sort an object by two criteria?

Trying to sort this array of objects according to (1) depth and (2) weight, and am unsure how to modify the function I'm using to include this other level... I'm using this function: function cmp( $a, $b ) { if( $a->weight == $b->weight ){ return 0 ; } return ($a->weight < $b->weight) ? -1 : 1; } And then doing this: $menu = g...

Getting info from all related objects in django

I'm trying to do something pretty simple, but I'm new to Django. I have a quiz system set up for an experiment I'm running. The relevant entries in models.py follow: class Flavor(models.Model): name = models.CharField(max_length=100) def __unicode__(self): return self.name class Passage(models.Model): name = models.CharFie...

serialize without a form?

Hello all i'm turning objects "on (adding the class .active) and off" on a html page with html objects, not forms. And on every click i want it to create an array of the items with the class .active but i can't seem to get any results?! is this in the right direction? var data = $('li.tagToggle.active').serializeArray(); // li id forma...

Trying to clean my data before reaching JSON.Simple

I think the word "clean" isn't the right idea, but I am trying to make sure that the data I am getting from the database is ready to be inserted into JSON objects. I would like to find a packaged deal for this, or if JSON.Simple does this and I just haven't run into it. But double quotes, single quotes (for obvious reasons), and new line...

Initializing Java object instances containing an array of objects

The following code is correct: public Sample mOboeSamples[] = { new Sample(1,1), new Sample(1,2) }; public Sample mGuitarSamples[] = { new Sample(1,1), new Sample(1,2) }; public SampleSet mSampleSet[] = { new SampleSet( "oboe", mOboeSamples ), new SampleSet( "guitar", mGuitarSamples) }; but I'd like to write ...

Django Query in a loop fails for no good reason

Hi all, I have this code: msgs = int(post['time_in_weeks']) for i in range(msgs): tip_msg = Tip.objects.get(week_number=i) it always results in an error saying that no values could be found. week_number is an integer field. When I input the value of i directly, the query works. When i print out the value of i I get the expected ...

How to create a dynamic object in a loop?

Basically I want to create one large object of many object in JavaScript. Something like: var objects = {} for (x) objects.x = {name: etc} Any ideas? ...

Objective-C: changing object inside NSMutableArray

In my program I have two classes: Collector and Entity. Collector stores Entities in NSMutableArray. @interface Entity : NSObject { ... } @interface Collector : NSObject { NSMutableArray *entities; uint someInt; ... } - (void)addEntity:(Entity*)newEntity; // implemented as [entities addObject:newEntity]; Collectors ...

Dynamically adding members to a javascript object

I'm working on a scoring script for contract bridge, just for giggles. I'm storing the game as an object: var game = { team1 : { player1 : prompt("Team 1, first player: "), player2 : prompt("Team 1, second player:") }, team2 : { player1 : prompt("Team 2, first player: "), player2 : prompt("Team 2, second player:") }, } functio...

How can I tell how much memory a handle object uses in matlab

If I delcare an object to be a subclass of handle classdef obj < handle my object is now essentially a "pointer" to some memory somewhere. How do I find out how much memory my object is using up? For example, say I have a class foo with a field bar classdef foo < handle properties bar = randn(1000); end bar takes up 8 megabytes...

how can i find out how many objects are created of a class in C#

how can i find out how many objects are created of a class in C# ...