class

C++ vectors of classes with constructors.

//Using g++ and ubuntu. #include <vector> using namespace std; Define a class: class foo(){ (...) foo(int arg1, double arg2); } Constructor: foo::foo(int arg1, double arg2){ (...) //arrays whose length depend upon arg1 and arg2 } I would like to do something like this: vector<foo> bar(10); //error: no matching function for cal...

Ability to specify more than one class declarations and definitions in objective-c interface and implementation sections respectively

I was just wondering if I have the option to specify more than one set of class declarations and definitions in the same file, without breaking it up into multiple files. I'm guessing this is just the sign to break it up, but I was just wondering out of curiosity. Also, bonus, when including, what is the difference between #include and...

C# referencing components in interface class

I'll start with this: I'm no good at C#. I don't for the most part know what I'm doing. Now the disclaimer is out the way, I'm trying to access a TabControl in my Interface (made using VS2008, so parts are in Interface.Designer) from another class - except using Interface.tabControl1 tells me i need an object reference, and if I type . ...

Referring to class names through strings?

I need to parse some text file, create objects for various entities encountered in the text, and put them in some data structure (e.g., a list) for further processing. Example of the text: laptop 17" dell, weight: 12 lb desktop 24" hp I know in advance which entities may exist in the text, and what attributes they are supposed to ha...

how to pass a method from different class to another class in Java?

Hi. There are 2 files named: AnnuityDueGUI.java AnnuityDueResultGUI.java Under AnnuityDueGUI.java, there is this method as below: ============= public double calculateFADGUI(){ //FVA = A{[(1+i)^n – 1] / i} (1+i) String amountStr = amount.getText() ; //convert string to double dAmount = Double.parseDouble(am...

Active class on page load of menu item

Hi all, I have a hardcoded li menu that is using filterable.js to filter a list of items, based on hash tags. I can get focus to work if the item is selected, however, I want the all tag to be selected on page load. I added the class "current" to the "all" menu item, however this did not work. see: http://thinquetanque.com/portfolio ...

java: what is this: [Ljava.lang.Object; ?

I get this when I call toString on an object I received from a function call. I know the type of the object is encoded in this string, but I don't know how to read it. What is this type of encoding called? ...

Jquery: How do I address :before classes?

My goal: Mousehover a link, have a certain element on the page change the .class:before content to something from the link title. Therefore: I want to change the content of a .class:before, namely .test:before. However, $("#test:before").css("content","whatever the content should be"); does not do the job. How do I adress :befor...

Java object creation

Im writing a program that creates an array of classes that run separately. I want to create an array of 500 containing a big class. Whenever i write the loop to create it, it stops at about 30 or so... is there a limit on java or bugging in my program? ...

How can I delete or create classes at run time c#?

I made a program that achieve a knowledge representation, its good but I thing it could be better if I can create and destroy classes on the fly. ...

Trying to convert a xml file to an object

Heya all, I was wondering what your opinion about this would be. I'm trying to convert an xml file to a .net object. It's a xml file from the World of Warcraft armory. Here is an example. <?xml version="1.0" encoding="UTF-8"?> <baseStats> <strength attack="48" base="48" block="-1" effective="58"/> <agility armor="114" attack="-1" ba...

In Objective-C, what happens to the original object when the init method sets self?

I have three Objective-C classes: @interface ClassA : NSObject{ IBOutlet id<ClassAProtocol>delegate //other instance variables } //methods @end @interface ClassB : ClassA{ //instance variables } //methods @end @interface ClassC : ClassA{ //instance variables } //methods @end My objective is so that when an ins...

Problem with ruby class

I've got a problem with this class require "test/unit" require "selenium/client" class Test < Test::Unit::TestCase def setup @verification_errors = [] @selenium = Selenium::Client::Driver.new \ :host => "localhost", :port => 4444, :browser => "*chrome", :url => "http://change-this-to-the-site-you-are-...

Styling elements with a dot (.) in the class name.

Hay I have an element like this <span class='a.b'> Unfortunately this class name comes from an eCommerce application and cannot be changed. Can i style a class name with a dot in it? like .a.b { } Any advice would be great Thanks ...

Ruby - overwrite def method

Hi, How can I overwrite the def method? But it's strange, cause I don't know from where the def method is defined. It's not Module, not Object, not BasicObject (of Ruby 1.9). And def.class don't say nothing ;) I would like to use something like: sub_def hello puts "Hello!" super end def hello puts "cruel world." end # ...an...

Does the order of PHP public functions in a class affect its execution?

I've been following this Symfony tutorial. In some sections it just tells me to add a public function inside a class but it doesn't say if I should add it at the beginning or at the end of the class. For instance: /** * JobeetCategory * * This class has been auto-generated by the Doctrine ORM Framework * * @package jobeet * @s...

val and object inside a scala class?

What is the difference between declaring a field as val, lazy val and object inside a scala class, as in the following snippet: class A class B { val a1 = new A { def foo = 1 } object a2 extends A { def foo = 1 } lazy val a3 = new A { def foo = 1 } } ...

class extending GtkWindow

hi, i'm trying to learn c++, but i can not find if it's possible to extend a class in this way: main.cc #include "mWindow.h" using namespace std; int main( int argc, char* argv[] ) { gtk_init( &argc, &argv ); mWindow win = mWindow(); gtk_main(); return 0; } mWindow.cc #include "mWindow.h" mWindow::mWindow() { gtk...

Include file mess

I'm having 2 classes - one holding Entity information other holding Component information. Now the problem is that the Entity class needs Component class already defined for using it in vector of children, but at the same time Component needs Entity to declare it as it's parent (I'm keeping everything linked in between). This puts out st...

When are inline static variables initialized in a class?

Suppose we have a class like: Public Class Question Private Shared _field as Integer = CrazyIntegersRepository.GetOne() ' Some other useful things go here End Class And the method GetOne throws an exception... How can we manage that? Is a good practice to rewrite that into a static constructor? When is the GetOne method go...