class

if a php class is defined as final, does it make sense to define it's methods as final as well?

I have a class defined as final. Does it make sense to define the methods as final as well? I know that since the class itself is final it can't be extended, which would make the method final declarations redundant, but I want to work up documentation on the class and others, and thought it'd be help since the final property of the metho...

C++: How to access a class function inside another class?

I am learning how to work with std::vector and want to access its values and functions. I have a vector object inside another object called spectrum. Now when I try to determine the capacity of the vector using .capacity it works fine if I just declare the vector. But when I declare the vector inside another object, I get syntax errors. ...

How to implement this feature in PHP?

When accessing member that doesn't exist, automatically creates the object. $obj = new ClassName(); $newObject = $ojb->nothisobject; Is it possible? ...

C++: How to make constructor for multidimensional vector?

I want to create two and three dimensional vectors using a constructor in a class. However, I do not know how for multidimensional vectors. One dimensional works: class One{ public: vector < float > myvector; One(int length) : myvector(length){} }; Two dimensional does not work: class Two{ public: v...

AS3 window class which can hold components

I need to create a "popup window" in AS3, which can contain things like textboxes and datagrids and stuff like that. I have searched thoroughly, and have been unable to find such a component or class. Why did they remove the AS2 window in as3? That would have been perfect for this. The closest thing I could find was http://fatal-except...

AS3: Accesing function on the maintime line from a extended movieclip class

I have some movieclips on my main timeline with a class to extend these movieclips ClickableMovieClip.as: package { import flash.display.MovieClip; import flash.events.*; public class ClickableMovieClip extends MovieClip { public function ClickableMovieClip():void { this.buttonMode = true; th...

Exporting a C++ class from a .SO ( linux )

How can I export whole class to shared library? Is it posible to use THIS library by other languages? ( pascal ) ...

why class creation throws error

Just playin around class def func(*args, **kwargs): print args, kwargs class Klass(func): pass it throws error TypeError: Error when calling the metaclass bases function() argument 1 must be code, not str What does it mean, i am passing no str nowhere? and yes I should be passing class in bases but why didn't error ...

how to define a class without 'class' statement in Ruby ?

I have many classes to define, but I don't want to repeat the below work: class A < ActiveRecord::Base end Is there any declaration statement to define a class without using the class statement? ...

Python instance has no __call__ method

I've been learning how to use Python for the better part of today after giving up on an ugly bash script. I'm trying to use 2 classes to define a few arrays of objects in which to store some unique strings and integers (1-10). The objects will consist of the following: object[i].user .n # n = i .name .co...

C# Class Inheritance

greetings. i have the following class: public class Ship { public enum ValidShips { Minesweeper, Cruiser, Destroyer, Submarine, AircraftCarrier } public enum ShipOrientation { North, East, South, West } public enum ShipStatus { ...

C++ template class T trouble

template <class T> class List { public: List(); ~List(); ... protected: template <class T> struct Item { struct Item* next; T data; }; ... struct Item<T>* allocate(); }; template <class T> struct Item<T>* List<T>::allocate() // error he...

Find out divs height and setting div height

Hello, Im quite new javascript/jquery stuff, but i would like to do this kind of thing with it: I have four divs side-by-side like this and content in each one. Now if one has more content it gets streched higher. I would like to make the other divs as high too even if they dont have as much content. So basically i want the script goes...

How do you trigger an event across classes?

I am writing a Class Library that will be used by other applications. I am writing it in C#.NET. I am having a problem with triggering events across classes. Here is what I need to do... public class ClassLibrary { public event EventHandler DeviceAttached; public ClassLibrary() { // do some stuff OtherClass....

How do you trigger an event across classes?

I am writing a Class Library that will be used by other applications. I am writing it in C#.NET. I am having a problem with triggering events across classes. Here is what I need to do... public class ClassLibrary { public event EventHandler DeviceAttached; public ClassLibrary() { // do some stuff OtherClass....

What is the best way to parse C++ class architecture in Python?

I want to parse c++ sources in Python. Namely, information about the structure of the classes. I need to construct some object in Python that should contain information about c++ class. Something like this: [namespace] function name [: parent] [constructor([parameters])] [destructor([parameters])] public methods([parameters]) private...

Regarding Object Comparison

I am having a java class Rec. I have two instance of it Rec1 and Rec2. I want to check whether the values of Rec1 and Rec2 are equal. If i do Rec1.equals(Rec2) is it correct way of doing it? class Rec { private BigDecimal RecordId = null; private BigDecimal recSubNum = null; private BigDecimal FileId = null; private Str...

Why we use .class file in ASP.NET ?

Why we use .class files ASP.net? Cant we use multiple classes as inline in the default.aspx.cs (codebehind) ? haha..yea i dont have any idea..so question is we do not use in ASP.net ? then where we will use? ...

Some basic questions on constructors (and multiple-inheritance) in C++?

(I’m sorry if this has been asked before; the search feature seems to be broken: the results area is completely blank, even though it says there are a few pages of results… in Chrome, FireFox, and Safari) So, I’m just learning C++… and the book I’m moving through is doing a really bad job of explaining constructors in a way that I can g...

From where to start a timer for a database polling?

I'm trying to understand a general flow of WPF application, it's not everything clear for me, so, please, help me to understand the following: If I want my database polling Timer in a WPF application was started not from a code behind file of my main window, but from another separate class, how I should implement this? Should this clas...