I have the following Moo class:
Nem.Ui.Window = new Class({
Implements: [Options, Events],
options: {
caption: "Ventana",
icon: $empty,
centered: true,
id: $empty,
width: $empty,
height: $empty,
modal: false,
desktop: $empty,
...
This may turn out to be an embarrassingly stupid question, but better than potentially creating embarrassingly stupid code. :-) This is an OO design question, really.
Let's say I have an object class 'Foos' that represents a set of dynamic configuration elements, which are obtained by querying a command on disk, 'mycrazyfoos -getconf...
Ok, this is so weird!!! I am running PHP Version 5.1.6 when I try and run the code below it gives a fatal error of an object that has not been instantiated. As soon as I un-comment this line of code
//$cb_db = new cb_db(USER, PASSWORD, NAME, HOST);
everything works. Even though I have declared the $cb_db object as global within in the me...
How to differentiate between overloading the 2 versions of operator ++ ?
const T& operator ++(const T& rhs)
which one?
i++;
++i;
...
Is there a Pattern in Scala that can add a method to an Array object?
I am thinking of the implicit conversion of Int to RichInt. But that can't be done as Array is a final class.
...
Hi All
This might be abit "out there", but here goes:
I have a User Control. And I have a project. How can I have my user control pass a particular "event" to my project, and then have my project run that event?
...
Hi,
I'd like to validate a form using the jquery validate plugin, but I'm unable to use the 'name' value within the html - as this is a field also used by the server app.
Specifically, I need to limit the number of checkboxes checked from a group. (Maximum of 3.) All of the examples I have seen, use the name attribute of each element. W...
We found something similar to the following (don't ask ...):
namespace N {
struct A { struct B; };
}
struct A { struct B; };
using namespace N;
struct ::A::B {}; // <- point of interest
Interestingly, this compiles fine with VS2005, icc 11.1 and Comeau (online), but fails with GCC:
global qualification of class name is inva...
In my project I have a class, NewsItem. Instances of NewsItem act like a wrapper. They can be associated with either an ArtWork instance, or an Announcement instance.
Here's how the NewsItem model looks:
class NewsItem(models.Model):
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
content_o...
Assume you define a class, which has a method which does some complicated processing:
class A(object):
def my_method(self):
# Some complicated processing is done here
return self
And now you want to use that method on some object from another class entirely. Like, you want to do A.my_method(7).
This is what you'd ...
Suppose I have class animal and classes cat and dog extending it. I want to do something along the lines of:
foreach (class a in {cat, dog})
if (a.isValid(parameters))
doStuff();
isValid is a static method from animal that just checks if the given parameters define an object of the given type
doStuff means I'm doing stuf...
Is there a convenient way to transmit an object including its code (the class) over a network (not just the instance data)?
Don't ask me why I want to do this. It's in an assignment. I asked several times if that is really what they meant and the didn't rephrase their answer so I guess they really want us to transmit code (not just the ...
I attempted to do something like this but it does not compile:
class point
{
public:
int x;
int y;
};
int main()
{
vector<point> vp1;
vector<point> vp2;
vector<point> vp3;
map < vector<point>, int > m;
m[vp1] = 1;
m[vp2] = 2;
m[vp3] = 3;
map < vector<point>, int >::iterator it;
...
I know that you can create global constants in terms of each other using string concatenation:
define('FOO', 'foo');
define('BAR', FOO.'bar');
echo BAR;
will print 'foobar'.
However, I'm getting an error trying to do the same using class constants.
class foobar {
const foo = 'foo';
const foo2 = self::foo;
const bar = self::f...
Hi all. I'm trying to make a program that can load an unknown set of plugins from a sub-folder, "Plugins". All of these plugins implement the same interface. What I need to know is how do I find all of the classes in this folder so that I can instantiate and use them?
...
I am migrating some C++ code from structures to classes.
I was using structures mainly for bit-field optimizations which I do not need any more (I am more worried about speed than saving space now).
What are the general guidelines for doing this migration? I am still in the planning stage as this is a very big move affecting a major p...
here is my setup.
class testA {
function doSomething() {
return something;
}
}
$classA = new testA();
class testB {
$classA->doSomething();
}
this wont work inside that class.: $classA->doSomething();
how else would i do it?
...
Essentially I have to use a poorly implemented web service maintained by other programmers. They have two classes that don't derive from a parent class, but have the same properties (Ughh...). So it looks like this in my web service proxy class file:
public partial class Product1
{
public int Quantity;
public int Price;
}
publi...
Hi, I have a string that contains the name of a class variable that I know exists for class A. I need to get the value of this variable (i.e. dereferencing), how do I do it?
...
If I seal a class are all overriden members implicitly sealed or do I have to seal each overriden member explicitly?
public sealed ClassA : ClassB
{
// Is this implicitly sealed or do I have to explicitly seal
public override void Method1()
{}
}
TIA.
Klaus
...