objects

Delay-Load equivalent in unix based systems

What is the delay load equivalent in unix based system. I have a code foo.cpp, While compiling with gcc I link it to shared objects(totally three .so files are there.).Each of the .so file for different option. ./foo -v needs libversion.so ./foo -update needs libupdate.so I need the symbol for those libraries should be resolved only a...

Rails: Serializing objects in a database?

I'm looking for some general guidance on serializing objects in a database. What are serialized objects? What are some best-practice scenarios for serializing objects in a DB? What attributes do you use when creating the column in the DB so you can use a serialized object? How to save a serialized object? And how to access the serializ...

deleting an object

Hi, First, when you want to free the memory assigned to an object in C++, which one is preferred? Explicitly calling destructor or using delete? Object* object = new Object(...); ... delete object; OR object->~Object(); Second, does the delete operator call the destructor implicitly? Thanks, ...

Passing object element to class not as a string (like constant) in php ?

How can I dynamically pass "items" to class function? For example here it is a piece of some class and its function where I declare an element of object (items) as $b: //.......... public function __add2SomeObj($b) { $namespc = $this -> __someObj(); // __someObj() returns object $namespc -> cats = $b; ...

Using Objects throughout application

Hi I have one page where I set up an object of class User. $id = $_SESSION['user_id']; $current_user = new User(); $current_user->getFromID($id); I've tried accessing this object from another page but it comes up blank. Is there any special way to do this? ...

Does Python copy value or reference upon object instantiation?

Hi folks, A simple question, perhaps, but I can't quite phrase my Google query to find the answer here. I've had the habit of making copies of objects when I pass them into object constructors, like so: ... def __init__(self, name): self._name = name[:] ... However, when I ran the following test code, it appears to not be necessa...

Can you cast an object to one that implements an interface? (JAVA)

Can you cast an object to one that implements an interface? Right now, I'm building a GUI, and I don't want to rewrite the Confirm/Cancel code (A confirmation pop-up) over and over again. So, what I'm trying to do is write a class that gets passed the class it's used in and tells the class whether or not the user pressed Confirm or Canc...

C++ pointer to objects

In C++ do you always have initialize a pointer to an object with the new keyword? Or can you just have this too: MyClass *myclass; myclass->DoSomething(); I thought this was a pointer allocated on the stack instead of the heap, but since objects are normally heap allocated, I think my theory is probably faulty?? Please advice. ...

Java: Storing information from database. What collections are appropriate?

I write an application in Java. I get form a database a table (clients) which contains fields like: name | surname | adress What is the best solution to store this data in my app? Should I create an object for each client and store these objects in a list or set? The table contains about 100 records and it's already sorted. Thanks ...

Use of Distinct with list of Custom Object

How can I make the Distinct() method work with a list of custom object(Href in this case), here is what the current object looks like: public class Href : IComparable, IComparer<Href> { public Uri URL { get; set; } public UrlType URLType { get; set; } public Href(Uri url, UrlType urltype) ...

turn array into object active record can use

I'm running a query and then decrypting it in the controller. After it is decrypted I was putting the results into an array and sending that to the view. The problem is with this solution I need to rewrite all of my views to parse the arrays sent instead of the active record objects sent before. Is there a way to turn the decrypted arr...

Why not allow mutation of the this binding?

Hi Everyone, I'm building a interpreter/compiler for a school project (well now its turning into a hobby project) and an instructor warned me not to allow mutation of the 'this' binding (he said it was gross and made a huge deal about it) but I never learned why this is so... dangerous or bad. I'm very curious about why this is so bad....

Hadoop: Processing large serialized objects

I am working on development of an application to process (and merge) several large java serialized objects (size of order GBs) using Hadoop framework. Hadoop stores distributes blocks of a file on different hosts. But as deserialization will require the all the blocks to be present on single host, its gonna hit the performance drasticall...

Data transformation question

I have data composed of a list of employers and a list of workers. Each has a many-to-many relationship with the other (so an employer can have many workers, and a worker can have many employers). The way the data is retrieved (and given to me) is as follows: each employer has an array of workers. In other words: employer n has: wo...

How to replace one object with another everywhere in the program?

I don't really think there is some method to do this… Anyway… How can I replace one object with another everywhere in the program? It would be like all the references to an old object start to point to a new one. ...

VS 2010 Debugger: Any way to search an object for a particular value?

I am trying to search the "this" object in an ASP.NET MVC 2 for a string value. In a view, I set the partial view input tag prefix and am trying to figure out how to reference it in the partial view itself. For example: Html.EditorFor(m => m, "templateName", "fieldPrefix"); In the partial view, I would like to search the "this" obje...

Retaining objects in game iphone

Hello - I am trying to create a game and have run into what is probably a pretty easy problem to solve. As the player goes through the game, many objects (Vehicle) will be added and removed. The Vehicles get added to an array called currentVehiclesMutableArray. My problem is I cant figure out how to retain a Vehicle so that it remai...

jQuery/javascript events - prototype event handler

The following code doesn't work as I intuitively expect it to: function MyObject(input) { input.change(this._foo); this.X = undefined; } MyObject.prototype._foo = function() { alert("This code is never called"); // but if it did this.X = true; } var test_input = $("input#xyz"); // a random, existing input var m = MyObj...

Object in Array is not recognised as having "methods"

I got my application working Awhile back, but after completely and accidentally deleting it, I have tried to create it from square one. unfortunately my rewritten program is a bit cranky; does anyone see or know the possible sources of error? Also, my if statements are acting up. -(void)loadAnnotations { CLLocationCoordinate2D worki...

asp.net mvc2 - update list of objects

I want to display list of objects from database, and on the same page have option to edit them. When submitting, I'd like to submit changes to all of them. I found this link: http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx and http://www.hanselman.com/blog/ASPNETWireFormatForModelBindingToArraysListsCollectionsDictiona...