object

In java can i have more than one class/object in a file?

So the way i've been told to do things is you have your file and the file name is Classname.java and then the code is something like this: class ClassName { SOME METHODS main {} } and then thats all. I'd like to have two objects defined and used within the same .java file. (i don't want to have to put the other class in a difern...

How to check the type of object in ArrayList

Hi, Is there a way to get the type of object in the arraylist? I need to make an IF statment as the following (in C#): if(object is int) //code else //code thanks ...

Get the parent class of a null object (C# Reflection)

How would I get the parent class of an object that has a value of null? For example... ClassA contains int? i which is not set to any value when the class is created. Then in some other place in the code I want to pass in i as a parameter to some function. Using i as the only info, I want to be able to figure out that ClassA "owns" i....

Core Data: Merging multiple Managed Object Contexts and deleting objects

I have an iPhone project where I have a series of Managed Objects in a Managed Object Context within the main application thread. On a separate thread, I import new objects from a webserver into a second Managed Object Context. If the import goes ok without errors, I save the import context. This triggers contextDidSave from which I c...

Three20 linker error

I have the following line of code: if( !self.isLoading && TTIsEmptyString !TTIsEmptyString(_username) ) and it results in the following error: Undefined symbols: "_TTIsEmptyString", referenced from: -[UserModel load:more:] in UserModel.o ld: symbol(s) not found collect2: ld returned 1 exit status I've read, that linker error...

Silverlight object not created on page from time to time

Hello everybody, I have a problem I put several silverlight objects on the page with object tag Page is loaded in IE perfect, but Opera/Google Chrome doesn't load some of the objects from time to time. These browsers demonstrate "Install Microsoft Silverlight" image instead of objects and no errors on the page. Please, who has face...

Is it a good idea to create a class for object identified by names?

I have a list of services which can be identified by names. Every service has a set of parameters (IP address, port, availability and so on). There are also method which can be applied to the services (close connection, open connection, send a message to the server, check if it is responding and so on). So, I thought it is a natural app...

Java List with Objects - find and replace (delete) entry if Object with certain attribute already exists

Hi there I've been working all day and I somehow can't get this probably easy task figured out - probably a lack of coffee... I have a synchronizedList where some Objects are being stored. Those objects have a field which is something like an ID. These objects carry information about a user and his current state (simplified). The point...

Passing object from PHP to Mysql Stored procedure

Hi All, Scenario :- I have to call MYSQL stored procedure from PHP and do some operations ( around 15 commands ) on the database Problem :- I have to call stored procedure with 36 parameters. Lot of parameters . I don't think it is a good idea to pass these many individual parameters and even heard passing individul parameters increase...

How can I find out how much memory an instance of a C++ class consumes?

Hi, I am developing a Graph-class, based on boost-graph-library. A Graph-object contains a boost-graph, so to say an adjacency_list, and a map. When monitoring the total memory usage of my program, it consumes quite a lot (checked with pmap). Now, I would like to know, how much of the memory is exactly consumed by a filled object of thi...

ASP.NET MVC: How to transfer more than one object to View method?

I finished NerdDinner tutorial and now I'm playing a bit with project. Index page shows all upcoming dinners: public ActionResult Index() { var dinners = dinnerRepository.FindUpComingDinners().ToList(); return View(dinners); } In DinnerRepository class I have method FindAllDinners and I would like to add to...

Do I correctly understand what a class is?

I've had trouble finding a clear, concise laymans definition of a class. Usually, they give general ideas without specifically spelling it out, and I'm wondering if I'm understanding this correctly. As I understand it, a class is the set of code that controls an object. For example, in an app that has a button for 'Yes' and a button for ...

DDD and distinction between Entity and Value object. Choosing the aggregate root

I am design and EMR. I have determined the central object to the domain is the Patient. The patient must have the following a Doctor and Medical Records. Medical Records is a grouping term refering to the collective of Encounters, Labs, XRays, Prescriptions.... I am new to DDD and I am having trouble with a couple of concepts and my...

Memory management in Qt?

I'm quite new to Qt and am wondering on some basic stuff with memory management and the life of objects. When do I need to delete / destroy my objects? Is any of this handled automatically? In the example below, which of the objects I create do I need to delete? What happens to the instance variable myOtherClass when myClass is destroy...

Spaceship objects

I'm trying to make a program which creates a spaceship and I'm using the status() method to display the ship's name and fuel values. However, it doesn't seem to be working. I think I may have messed something up with the status() method. I'm also trying to make it so that I can change the fuel values, but I don't want to create a new met...

For each <item> in CheckedListBox. <item> returns as Object and not as Control

Hello there. I have a CheckedListBox previously populated. I want to loop with a "for each / next" through all items in the CheckedListBox and do a lot of "stuff" with each iteration element of the checkedlistbox. example code: For Each item In CheckedListBox1.Items If item.Checked = True Then 'do stuff like...

Exporting ActiveRecord objects into POROs

Hello, I'm developing a "script generator" to automatize some processes at work. It has a Rails application running on a server that stores all data needed to make the script and generates the script itself at the end of the process. The problem I am having is how to export the data from the ActiveRecord format to Plain Old Ruby Object...

How to map IEnumerable<SelectListItem> to IList<> for ListBox

I have two classes. Class1 and Class2. public class Class1{ ... public virtual IList<Class2> Class2s{get;set;} ... } public class Class2{ ... public virtual IList<Class1> Class1s{get;set;} ... } The view contains <%=Html.ListBox("Class2s", ViewData.Model.Class2s.Select( ...

C++ object in memory

Hello. Is there a standard in storing a C++ objects in memory? I wish to set a char* pointer to a certain address in memory, so that I can read certain objects' variables directly from the memory byte by byte. When I am using Dev C++, the variables are stored one by one right in the memory address of an object in the order that they were...

How to make a Scala Applet whose Applet class is a singleton?

Hi, I don't know if a solution exists but it would be highly desirable. I'm making a Scala Applet, and I want the main Applet class to be a singleton so it can be accessed elsewhere in the applet, sort of like: object App extends Applet { def init { // do init here } } Instead I have to make the App class a normal instantiatab...