class

Android - Passing data from a service to a non activity class/object

Hi all, I currently have a service running in my Android application that makes a wifi scan at a set interval and returns the results. I was then passing the data using an aidl interface and to do this I had to bind the service to my Activity I was passing the data to. However the design has changed and I now need to be able to send t...

questions about an article introducing C++ interface

I have been reading an article about C++ interfaces (http://accu.org/index.php/journals/233) and I am completely lost at the part where it says all the virtual member functions should be made private (the section titled "Strengthening the Separation"). It just does not make sense to me at all. According to the author, the code is like t...

Comparing two object state,before and after update

first things first. I have the following classes: class Employee { private int employeeID; private string firstName; private string lastName; private bool eligibleOT; private int positionID; private string positionName; private ArrayList arrPhone; public IList<Sector> ArrSector {get; private set;} //...

Variable classname in javascript

Hello, Is there a way to make a variable classname in javascript. In php the next is allowed: $classname = "klasse"; $class = new $classname(); Tom ...

Why the main program in Java is put into a class?

Why does the main method have to be put into a class? I understand the main ideas of OOP but I cannot get why the main program is defined within a class. Will such a class instantiated somewhere? I mean there is no code outside the class. What is a reason to define a class and never use objects of this class? ...

Is there a way to clone a class object in C#?

Possible Duplicate: Cloning objects in C# I have this class Object that has about 20 properties (they're all basic or struct types). Is there a simple way to create a clone of an instance of this object. A bit like the copy ctor in C++? This is for a Silverlight application. ...

Evolution of Class

Was class evolve from structures? ...

Matlab function/class history

How to find out about a particular function or class in which version of Matlab/toolbox it was first introduced? I know I can look through all Release Notes, or Google can help sometime, but is there any better way? ...

Using 'const' in class's functions

I've seen a lot of uses of the const keyword put after functions in classes, so i wanted to know what was it about. I read up smth at here: http://duramecho.com/ComputerInformation/WhyHowCppConst.html . It says that const is used because the function "can attempt to alter any member variables in the object" . If this is true, then shoul...

C++ classes and nested members

I'm not sure how to call this. Basically I want to make a class with nested members. Example: ball->location->x; or ball->path->getPath(); right now I only know how to make public and private members such as ball->x; ball->findPath(); Thanks ...

How do I access these PHP class variables?

Hello SO: I have two php files, one manages database connection and the other retrieves data from the database. I am writing this from scratch as a learning experience, and granted it is 5am but for some reason I cannot access the variables I need to. My database connection file is as follows: <? class mysqlManager { var $dbhost ...

What are the benefits of using Classes in VBA?

Hi All! I am doing some VBA programming in excel 2007 and have one workbook where all the datasheets is to be copied from, into another sheet. The new sheet will have several header rows, and I would like to keep track of where they are situated so I don't have to find words in them constantly. Is the simplest thing to use classes and...

Assign session variable to class variable while initialize the class variable in PHP

Hi, I have a problem regarding assign session variable to class variable while initialize the class variable. Check my below code <?php class ModifyProfile { var $userType=$_SESSION['wb_user_type']; var $tablename=WB_CUSTOMER_TABLE; var $primarykey="nCustomerID"; } ?> When i run the above code by creating this class o...

C++ class scope

I'm coming to C++ from Objective C and have a problem... This works :- function1(char *filePath) { Box box(filePath); // construct/create a box using filePath // can use box in this function and destructor is called when function exits } However I need something like this, where function1 and function2 are called asynchrono...

[Java] 2 instances same class

Hi everybody I created a main class which displays a frame, then two JPanel are created and pointed. It is supposed for those Jpanel to give a visual display of some values incoming via serial port. Everhing work fine..but the problem is that those panel are identical and I would need that one Japnel processes and visualizes...

Should I seal all classes I know shouldn't ever be used as a base class?

Should I seal all classes I know shouldn't ever be used as a base class even when there are no tangible performance or security concerns, or is this just adding cruft? ...

am i implementing this template class correctly?

Okay, I'm trying to implement a templated class of an array-based queue called Queue. Here's how I did it. First, is this the right way to implement a templated class? The problem is, when I try to compile, I get the error messages undefined reference to 'Queue::Queue()' undefined reference to 'Queue::~Queue()' Any ideas what...

C# explicit casting of derived types

If I create class A, and class B inherits from class A, why does C# require me to explicitly cast between them? For example: public class Mammal { } public class Dog : Mammal { } ... Mammal foo = new Dog(); // Invalid, wants an explicit cast Mammal bar = (Mammal)new Dog(); // This one works I'm just curious what the reasoning is ...

asp.net use class object on form

Hello , I am creating an object at server side of an aspx (test.cs) page from a class (asp.net 2.0 C#) public partial class Vendor_VendorUsedTicketsPopup : System.Web.UI.Page { ReportInvoice _objReportInvoice = new ReportInvoice(); protected void Page_Load(object sender, EventArgs e) { _objReportInvoice.ReportId = ...

jquery toggle input classes in only 1 TR table row

I have a table with a number of rows each row contain several input fields, example <tr id='1'> <td><input id='a' class='inputa'></td> <td><input id='ab' class='inputa'></td> <td><input id='abc' class='inputa'></td> </tr> <tr id='2'> <td><input id='b' class='inputa'></td> <td><input id='bc' class='inputa'></td> <td><input id='bcd'...