class

Creating a basic class in asp.net

I am new to the .Net world, and was wanting to create a class so I can learn OOP. I have a .sln file, with multiple projects in that file. I want to create a class that will accept 3 parameters, a "stored proc name", "UserID" and "PageName". The stored proc will log the id of the person who launches a particular page, the page name an...

Class diagram for eclipse java project

Possible Duplicate: What is your favorite automatic class diagram generator for Eclipse? Hi Guys, Can you please tell me if its possible to automatically generate class diagram for a java project in eclipse? Can you please suggest a plugin or a tool that is free. If not in eclipse, is it possible in Netbeans? Thanks in advan...

Vectors within classes: handeling copy constructor and destructor (C++)

Take a simple class with the "big 3" (constructor, copy constructor, destructor): #include <vector> using namespace std; //actually goes in the C file that links to this header file ... class planets(){ //stores mass and radii data for planets in a solar system. public: vector <double> mass; vector <double> radius; //...

PHP define() doesn't seem to be working with include()

I've been trying my hand at OO PHP, and currently have three files. I have a class_lib.php which, at the moment, just has a databaseServer class, an index.php file and a definitions.php file. I want to put all my sensitive database info into the definitions file. However, when I do, I get an error when trying to connect to the database: ...

Extends class [PHP]

In kohana 2.3.4 system load first application, after modules and system. I want to extends User_Model in application with User_Model in modules. How to do that? ...

Adding a simple UIView from a class to the main ViewController

Dear scholars, code gurus. My question is rather simple, I have been searching and trying for some time now without any luck, I would greatly appreciate some tiny help. I have a simple class that should generate a view as following: // vipcardclass.h // #import <UIKit/UIKit.h> @interface vipcardclass : UIViewController { } +(IBA...

How to call a derived class method from a base class method within the constructor of base...

I am wondering if it is possible to call a derived class´ function from within a function called by the base constructor (shouldn´t it already be created when the code in the brackets are executed?) #pragma once class ClassA { public: ClassA(void); virtual ~ClassA(void); void Init(); protected: short m_a; short m_b; virtual voi...

Not Able to Set Class' Attributes in Role

Hello all, First off, I'm not really sure how much information is necessary to include because I'm having a really hard time tracing the origin of this problem. I have a Moose role with a subroutine that (along with a few other things) tries to set the attributes for a class like this: $genre = Movie::Genre->new({ genreName => 'Dr...

In Ruby on Rails, how to add an instance variable to a class (and return as JSON in controller)?

Suppose in Ruby on Rails, there is a return of JSON data: render :json => array_of_purchases and this array_of_purchases contains many Purchase objects, each one with a product_id. Now if we want to add a property to the JSON returned, so that each Purchase object will also include its Product object data: "product": { "id": 123, "n...

Should I place variables in class or constructor? PHP

My question(s) is one of best practices for OOP. Im using Codeigniter framework/PHP. I have a class: class Test() { var $my_data = array(); function my_function() { //do something } } Is it ok to declare $my_data in the class like that? or should it go in the constructor? Basically every function will be writ...

Class Hierarchy - Data design in an RPG game where classes overlap (VB.Net)

This is a followup to the question I asked here: http://stackoverflow.com/questions/3445398/class-hierarchy-data-design-in-an-rpg-game-vb-net I understand the answer in the post above, which is absolutely amazing, by the way. It's about implementing interfaces with a class. However, what if a class needs to share features with anot...

isMemberOfClass problem

Hi All, I'm trying to log if an object in my mutable array is a member of the class NSString. Here is my code: id obj = [mutArr objectAtIndex:1]; BOOL classMem = [obj isMemberOfClass:[NSString class]]; NSLog(@"%@", classMem); Instead of printing YES or NO, I get the output (null). Can you please tell me why this is the case? Than...

dynamicly move records in a dataset into a class is there a way to do it in c#?

assuming we use this on a table using "select * from table " ? i want to create an array of classes that use filed names (of the datatable) as class field names initalise them with the datatable fields is it possible ? if so please help :) soory for the spelling my writen english is not that good but i hope i was clear ...

javascript 'this' usage

let's say I have code like this: var object1 = {}; object1.class1 = function() { this.property1 = null; this.property2 = 'ab'; } in this case, what does 'this' stand for? object1 or class1? And whenever I want to define a class constructor inside an object, what is the best way to do it? ...

Calling a method with a java.lang.Class in Jython

Hi I'm trying to use SimpleLog from Jython but I can't find any way of using its constructors because one of the arguments is always a java.lang.Class. logger = SimpleLogger(name) <--doesn't work logger = SimpleLogger(self) <--doesn't work logger = SimpleLogger(SimpleLogger.class) <--doesn't work The problem right now is with ...

Simulate a class of type enum

Hello, how can I do to simulate a class of type enum in java <5.0 ..?? public final class Week { private static final Day[] _week = {Day.MONDAY, Day.TUESDAY, Day.WEDNESDAY, Day.THURSDAY, Day.FRIDAY, Day.SATURDAY, Day.SUNDAY}; public static Day getDayOfWeek(final int index) { if (index >= 1 && index <= 7) { ...

Class menu in Tkinter Gui.

Hello, I'm working on a Gui and I'd like to know if it is possible to make the menu property of a window a separate class on my script for a clearer and more enhancement prone code. my code currently is : class Application(Frame): """ main window application """ def __init__(self, boss = None): (...) self.menu = Menu(self)...

why would I forbid allocation in the heap?

I recently read a lot about "preventing heap allocation for a class" (see this question). I was able to understand "how", but now I can't figure out "why" someone would like to do that. I guess there must be legitimate reasons for this, but I just can't figure them out. In short: "Why may I want to forbid users from creating objects o...

How to create an instance of a class in another class

I might be missing something here, I'm not sure. A Google search didn't really help either. What I'm wanting to do is call the databaseServer class and use its methods within my userControl class. Here is my lib_class.php file: <?php include('definitions.php'); class databaseServer { var $con; var $db; var $close; va...

Help me name my class

Okay, first, here's my rather poor diagram... It's worth noting the "Name Me" class may be listening to more than one RequestNotifier It's safe to assume all Work Items that are put on the Work Queue are taken off the work queue by something else not shown and are processed exactly the same. The only difference between the work items...