Hi all,
I'm about to implement a hierarchical state machine in C# using the state pattern. As a guide I'm using this example. The example doesn't provide an answer regarding hierarchical states though. Unfortunately, I can't seem to find good examples elsewhere. My first thought is to create nested classed for the hierarchical states. B...
I have the following 3 classes:
class Node {
public Node Parent;
// Edit: to clarify, each of these classes has many fields and methods
public void Method1() { /*...*/ }
public void Method2() { /*...*/ }
/* ... */
public void Method30() { /*...*/ }
}
class Element : Node { public Dictionary<string, string> Attri...
I am looking on how to get the object (or object type) that another object is created in. For example:
public class RootClass
{
public class A
{
public void MethodFromA()
{
}
}
public class B
{
public A A_object = new A();
public void MethodFromB() { }
}
B BObject = ...
Hi all,
I'm looking for a PHP class that would draw me (by fetching data from a mysql table) a competition playoff table in HTML similar to what they do on wikipedia (see under the "Bracket" section):
http://en.wikipedia.org/wiki/2009%E2%80%9310_UEFA_Europa_League_knockout_phase
Any input?
Thanks
...
Hi. I'm new in c#. I have read some book about c# for beginners. Now i can code simple applications. I have 2 forms and 1 class in a project. I want to use a object from that class in 2 forms. I want first form to set a property of the object and secont to display this property. How can i do it. Please help me. Thanks
...
I'm trying to iterate over the members of a static class and invoke all of the members that are fields. I get a MissingFieldException on the line where I attempt to invoke the member.
Something like this:
"Field 'NamespaceStuff.MyClass+MyStaticClass.A' not found."
public class MyClass {
public MyClass() {
Type type = typeo...
Hello Stack Overflow contributers,
I'm a novice programmer learning Python right now, and I came upon this site which helps explain object-oriented paradigms. I know that metaclasses are classes of classes (like how meta-directories are directories of directories, etc. etc.), but I'm having trouble with something: What is the actual dif...
There is any syntax to use something like this?:
<?php
function get_foo() {
return new Foo();
}
get_foo()->foo_method();
?>
...
I'm new to Ruby (experienced with Python, C++ and C). I need to create a class that is only to be used by other classes and methods in a module. In Python, I'd just call it __classname. I'd use an empty typedef in C++. How do I do this in Ruby (or am I barking up the wrong tree and not doing this the "Ruby way"?)
...
What is your favorite tool, plugin, script, to find a java class in a bunch of jar files?
Very often I inherit code that complains about a class that doesn't exist, and it is just because the jar file is not included in the classpath. But, in what jar file is the class?
I obviously would prefer an eclipse plugin, but I'm open to any pi...
Do the methods of a member variable have access to other private member variables within the same class? I have in mind a functor member variable.
Can a pointer to a private member variable be dereferenced and assigned to, outside of the class? What about in the method of another member variable?
Maybe something like
class A
{
some...
I'm getting a bit of a headache trying to figure out how to organise modules and classes together. Coming from C++, I'm used to classes encapsulating all the data and methods required to process that data. In python there are modules however and from code I have looked at, some people have a lot of loose functions stored in modules, wh...
I'm making a site that will be translated into x languages.
All strings must be localized.
There are occasions when I need to display a language name, country name or other information that has been retrieved from a database. The data being dealt with in this way will seldom be changed - as above I'm talking about language names, count...
When the myClass function returns a single string "hii", testClass.getDetails() works fine:
function myClass(name, age) {
this.name = name;
this.age = age;
return "hii";
}
myClass.prototype.getDetails = function() {
return "mydetails";
}
var testClass = new myClass('aneesh', 27);
alert(testClass.getDetails());
But wh...
Hi!
Look at this sample:
//----------------------------------------------------------------------------
type
ISomeInterface = interface
procedure SomeMethod;
end;
// this is wrong, but illustrates that, what i need:
TSomeClassWhichImplementsSomeInterface = class of ISomeInterface;
var
gHardCodedPointer: Pointer; // no m...
This may be a silly question, but it's been bugging me.
I've been writing what I believe to be procedural code, but I'm using classes which group together related public and private functions according to purpose. Instead of using objects and methods, I call the functions when needed with a scope resolution operator. ie: db::execute($s...
Being probably one of the worst OOP programmers on the planet, I've been reading through a lot of example code to help 'get' what a class can be used for. Recently I found this example:
class NextClass: # define class
def printer(self, text): # define method
self.message = text ...
Hi guys.
I was asked to describe the relationship between vehicle, car, toyota in object oriented programming term (let's say in php environment). I was stumped. Can someone help me about it? Thanks...
...
i basically want to use a dif function to extract a different element of a class (ac).
the code is similar to this:
.h:
class MyClass
{
public:
double f1(AnotherClass &);
void MyClass::f0(AnotherClass & ac, double(MyClass::*f1)(AnotherClass &));
};
.cc:
double MyClass::f1(AnotherClass & ac)
{
return ac.value;
}
void M...
Why does is print last "I'm a Child Class." ?
public class Parent
{
String parentString;
public Parent()
{
System.out.println("Parent Constructor.");
}
public Parent(String myString)
{
parentString = myString;
System.out.println(parentString);
}
public void print()
{
S...