object

How to diff Property Values of two objects using GetType GetValue?

I have the following classes: public class Person { public String FirstName { set; get; } public String LastName { set; get; } public Role Role { set; get; } } public class Role { public String Description { set; get; } public Double Salary { set; get; } public Boolean HasBonus { set; get; } } I want to be abl...

Objects and error handling in PHP

What's the best practice to handle errors if using objects? A) Before the method of object is called and not even getting to execute method if there's some error, or B) Just pass parameters and perform error checking in method itself, returning error code or something. Please pick your option and short description, why? Thanks orland...

db4o concerns

I'm interested in using db4o as my persistence mechanism in my Desktop application but I'm concerned about a couple things. 1st concern: Accidentally clipping very complex object graphs. Say I have a tree with a height of 10 and I fetch the root, how does it handle me storing the root object again? From my understanding, it doesn't f...

Is everything in .NET an object?

Please help us settle the: controversy? Is everything in c# an object, I thought that was the case as everything in Visual Studio at least appears as a struct? Please post a reference so that it doesn't become "modern jackass" (this American life). Note that this question reffers to C# not necessarily .NET and how it handles the data un...

Transforming Point object when using simple-xml

I am serializing a class using simple-xml (http://simple.sourceforge.net/) but when i try to use @Element on a Point object i get an error, how can i transform this Point object? ...

What's the difference between an object and a class in Perl?

I'm having a little trouble getting my head around the conceptual difference between an object and a class. I don't really understand the distinction between the two in any programming language, but currently I'm working with Perl, and Moose, so I'd prefer an explanation using those things. Cheers ...

How do I determine the size of an object in Python?

In C, we can find the size of an int, char, etc. I want to know how to get size of objects like a string, integer, etc. in Python. Related question: How many bytes per element are there in a Python list (tuple)? I am using an XML file which contains size fields that specify the size of value. I must parse this XML and do my coding. Whe...

How are java.lang.Object's protected methods protected from subclasses?

The keyword protected grants access to classes in the same package and subclasses (http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html). Now, every class has java.lang.Object as superclass (http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html). Hence I conclude that every class may access java.lang.Object's ...

How to design a User Object Model using MS Roles & Membership

I would like to build a ‘User’ Object model for a somewhat typical web application…however I cannot decide how best to design the object model & role system. Basically I plan to have about 4 user types…which will correspond to user ‘roles’ in the membership provider. These types will be: • Worker • Employer • Guest • Admin Th...

how do i check if an object has a key in javascript ?

which is the right thing to do? if (myObj['key']==undefined) or if (myObj['key']==null) or if (myObj['key']) Exact duplicate of: http://stackoverflow.com/questions/135448/how-do-i-check-to-see-if-an-object-has-an-attribute-in-javascript ...

What is the best method to merge two PHP objects?

We have two PHP5 objects and would like to merge the content of one into the second. There are no notion of subclasses between them so the solutions described in the following topic cannot apply. How do you copy a PHP object into a different object type //We have this: $objectA->a; $objectA->b; $objectB->c; $objectB->d; //We want the ...

Does PHP feature short hand syntax for objects?

In javascript you can easily create objects and Arrays like so: var aObject = { foo:'bla', bar:2 }; var anArray = ['foo', 'bar', 2]; Are simialar things possible in PHP? I know that you can easily create an array using the array function, that hardly is more work then the javascript syntax, but is there a similar syntax for creating o...

C#, How can You make An Object Reinitialize itself?

Ok, in Perl causing an object to reinitialize itself is easy since it is represented by an assignable reference or pointer. C#, however, doesn't appear to like this. I wanted to create a subclass of System.Text.RegularExpressions.Regex whose pattern could be changed without using new objects and consuming memory for each. (private i...

Microsoft reports nested object datasource gives #Error

I am attempting to get nested objects to work in Microsoft reports. I downloaded example code from http://www.gotreportviewer.com/objectdatasources/index.html, and it runs correctly. I built the following little app based on a Windows Form and their code, and all that I ever get when I reference a nested object value is a "#Error" in th...

Is Object constructor called when creating an array in Java?

In Java, an array IS AN Object. My question is... is an Object constructor called when new arrays is being created? We would like to use this fact to instrument Object constructor with some extra bytecode which checks length of array being constructed. Would that work? ...

Copy an object in Java

I have an object that I need to copy in Java. I need to create a copy and run some tests on it without changing the original object itself. I assumed that I needed to use the clone() method, but this is protected. Having done some research on the net, I can see that this can be overrided with a public method in my class, but I cannot fi...

How to check null objects in jQuery

I am using jQuery, I want to check existence of an element in my page. I have done following code, but its not working? if ($("#btext" + i) != null){ //alert($("#btext" + i).text()); $("#btext" + i).text("Branch " + i); } Please tell me what will be the right code? Thanks ...

ninject Linfu databound proxy object.

I have the following scenario. I have a ViewModel object (It's just a regular object, that impliments INotifyPropertyChanged). I'm binding this object to a view, written in WPF. When I bind it it works fine, events fire, and things are updated, perfect!!! Now I've tried to introduce some validation into the object, I'm checking argum...

Why some object doesn't have constructor in IE?

Below javascript has different effect in different browsers. document.write(this.location.constructor); document.write("<br/>"); document.write(this.constructor); document.write("<br/>"); In Chrome, the page has function Location() { [native code] } function DOMWindow() { [native code] } In Firefox, the page has [object Location]...

Designing for High Volumes of Data in an iPhone App

I have an I phone app which upon opening needs to display a table of data containing roughly 25000 records. Each record consists of two fields: TITLE and DESCRIPTION. Both fields are visible in each table cell. The tableview also is fully searchable with a UISearchBar. When the application starts and this view is loaded a "collecti...