class

Inherited .Net Class ToString Not Overriding

I have created an inherited class "StorageMedium" from a base I called "DataTypes". StorageMedium has two properties, Name() and Capacity(). In the DataTypes object, which all other objects in the class library have been inherited from, I have suppressed the Equals, ReferenceEquals, GetHashCode, ToString and GetType functions so these f...

Accessing a class after removing from a queue

----What I'm doing---- So I have an assignment that takes an input of characters then calculates the capital gain for the string using a queue. I'm stripping the input data then putting it into an arraylist that I then queue. I'm suppose to then dequeue the data to calculate the the capital gain. ----The problem---- The problem I'm ha...

Send Form to class

How do I send the form to the class? You are making some object? for example : class Myform { public void Myf(Form) { Form f = new Form();//error } } private void Form1_Load(object sender, EventArgs e) { Myform mf = new Myform(); mf.Myf(Form1);//error } ...

PHP class problem

class Gdn { const AliasDispatcher = 'Dispatcher'; protected static $_Factory = NULL; public static function Dispatcher() { $Result = self::Factory(self::AliasDispatcher); return $Result; } public static function Factory($Alias = FALSE) { if ($Alias === FALSE) return self::$_Factory; ...

Tools to convert database tables to c# classes

Is there any free tool or plug-in for Visual Studio to convert the SQL tables to entity,model,facade and DAO classes? I am working on SQL server 2008, Visual Studio 2008 and C#. ...

PHP Class Redefinition Clarification

I have a LinkedIn API class that I've written for PHP that makes use of a third-party stand-alone OAuth class, not the possibly installed PECL PHP OAuth extension. I've designed it this way to allow the many users don't have the ability/access to install the PECL extension to make the needed OAuth calls. So, for PHP installs with no PE...

Question about classes.

Let's say I have a class in php, and it includes some functions. The class is named "something". When I load the file on another file, I noticed it goes like: include("the_file_with_the_class.php"); $something = new something(true); now I can do OOP, I know, like $something->the_function, but what is that "(true)" in the variable? Th...

How to have access to outter class variable inside an inner class

Ok, I am making a wrapper of a class that has very long path to get variables. By example, it has the following: Class1.Location.Point.X Class1.Location.Point.Y Class1.Location.Point.Z Class1.Location.Curve.get_EndPoint(0).X Class1.Location.Curve.get_EndPoint(0).Y Class1.Location.Curve.get_EndPoint(0).Z Class1.Location.Curve.get_EndPoin...

will compiler reserve memory for this object?

I have following two classes: template <size_t size> class Cont{ public: char charArray[size]; }; template <size_t size> class ArrayToUse{ public: Cont<size> container; inline ArrayToUse(const Cont<size+1> & input):container(reinterpret_cast<const Cont<size> &>(input)){} }; I have three following lines of code at global scope: c...

NameError: global name is not defined

I'm using Python 2.6.1 on OS X. I have two simple python files (below) but when I run: python update_url.py I get on the terminal: Traceback (most recent call last): File "update_urls.py", line 7, in <module> main() File "update_urls.py", line 4, in main db = SqliteDBzz() NameError: global name 'SqliteDBzz' is not define...

C# Class library within Class Library

I have a C# solution in VS2010 that contains three projects. This solution has a client project (A) and a server project (B) which both build into applications. The third project (C) is where my classes that are common to both projects go (like a utility library) and this is built into a class library, which I reference in both the clien...

mutually referential classes yield "incomplete type" error

I have a situation in which A has a reference to a class C defined inside B, and C has an instance of class B. When I try to compile the code below, I get "field a has incomplete type". I assume this is because the compiler does not know how much memory it should allocate for an instance of A. class A; class B { public: class C { ...

MVC Error: 'object' does not contain a definition for ''

Hi guys, I'm currently working my way through the MVC Music Store tutorial. I'm stuck on page 53 at the moment and I was wondering if someone could help me out. I'm currently receiving the following two errors: 'object' does not contain a definition for 'Artists' 'object' does not contain a definition for 'Genres' I thi...

Using many classes in GUI that inherit from a base

Hi all, I have classes setup similar to this: <DataContract()> _ Public MustInherit Class SystemTaskProcessBase Public MustOverride ReadOnly Property Name() As String Public MustOverride ReadOnly Property Description() As String Public MustOverride Property Result() As SystemTaskResult <DataMember()> _ Private _T...

Derived classes

Hello, I have, for example, such class: class Base { public: void SomeFunc() { std::cout << "la-la-la\n"; } }; I derive new one from it: class Child : public Base { void SomeFunc() { // Call somehow code from base class std::cout << "Hello from child\n"; } }; And I want to see: la-la-la Hello from child C...

Inheriting problems

class Base { private: int var; }; class Child : protected Base { void someFunc() { var = 5; // Error: Base::var is private } }; What's wrong is there? ...

Derived class function

class Base { protected: int data; public: virtual int getData() { return data; } virtual void setData(int value) { data = value; } }; class Child : protected Base { public: void setData(int value) { Base::setData(value); cout << "Data is set.\n"; } }; class Worker { private: C...

Apply a class depending on current URL | Jquery

I have a main navigation but I need to apply the class of 'current' to the <li> if it matches the URL I have specified it should. This is what I have: $(function() { var url = location.pathname; if(url.indexOf('girls')) { $("li#nav-01").addClass('current'); } if(url.indexOf('boys')) { $("li#nav-02").addClass('current...

class interaction design

Lets say i have something like this coded class Normal_Mode; class Fast_Mode; class File_Control; //handles all operations with reading/writing in file class Main_Control { private: some_class *root; //all other classes need access to root pointer since there is all the data(binary tree) File_Control *c_file_control; Fast_Mode *c_fa...

Is there any reason for using classes in Python if there is only one class in the program?

I've seen some people writing Python code by creating one class and then an object to call all the methods. Is there any advantage of using classes if we don't make use of inheritance, encapsulation etc? Such code seems to me less clean with all these 'self' arguments, which we could avoid. Is this practice an influence from other progra...