class

UML Class Diagram solved exercices ?

Hi, I'm finding hard to find solved exercices for UML. Mainly with Class diagrams. Any tips ? Thanks ...

type of class in python

why if I do: class C(): pass type(C()) I got: <type 'instance'>, but if I do: class C(object): pass type(c()) I got: <class '__main__.c'> ? The first is not very userfull ...

I'm having a hard time understanding java objects and classes

Example 1 /** *Program Name: Cis36L0411.java *Discussion: Class -- Data Members ONLY * Method Members ONLY */ class Cis36L0411 { public static void main( String[] args ) { DataOnly data1 = new DataOnly(); System.out.println( "DataOnly\tLIMIT\t\t" + data1.LIMIT ); System.out.print...

Using *this in C++ class method to fully overwrite self instantiation

Is the following code safe? (I already know it compiles properly.) void Tile::clear() { *this = Tile(); } int main() { Tile mytile; mytile.clear(); } ...

How to find and remove unused class files from a project

My XCode project has grown somewhat, and I know that there are class files in there which are no longer being used. Is there an easy way to find all of these and remove them? ...

ruby metaprogramming - getting method names and parameter info for a class

Hi All, I want to get class methods in an object. Please see the following example I have a class "user.rb" class User def say_name end def walk(p1) end def run(p1, p2) end end and I wrote the following code require 'user.rb' a = User.new arr = a.public_methods(all = false) Above code will return the method ...

Class variables messing up

consider this code : Class Controller_xyz extends Controller { protected $res=' '; public function action_reg() { $this->res="blah"; $x="blah" echo $this->res; echo $x; } } output : b blah why am I not able to change class variable? ...

Extending a Php class which extends another class

I have a requirement where a process can be implemented in 2 different situation. One situation would be where the start date cannot be in the past and the other would be where it can. Currently we utilise Value Objects where we perform a series of a validation items on each field submitted using Zend Validate objects. The validation e...

Tutorials/manuals for writing class and style files in LaTeX?

I've searched the net and stackoverflow and found a number of great LaTeX sources, but I couldn't find any decent manual about writing your own class and style files. Some issues I have is which part of the code should be in a class file and which in a style file, how to finetune macros, how to define and use variables,... I figured so...

Looking for a basic PHP / MySQL search class.

Noob-ish question: I'm looking for a lightweight but decent php way to search all fields of a MySql table, regardless the structure. I first gave it a try on my own with the default mysql select but that's too basic. I'm looking for something that should at least order results by best match (keyword highlighting would be nice too). I'm ...

Declare class member at runtime in D

I want the following struct as a class member, but I don't know the type of T, so I need "declare" the struct at runtime. struct Chunk (T) { string id; T[][] data; } class FileBla { this() { Chunk !int ck; // need to be turned in a class member } } Should be missing something easy. ...

phpDoc class constants documentation

Hi, which is the correct way to document class constants for phpDoc? I've read the manual but i can't find anything about them ...

In Xcode, can you specify another default folder for classes, not Classes/ ?

If you create new files, and don't have a Classes/ subdirectory in the project root directory, Xcode dumps them in the project root. I'd like to specify where they go. FWIW, I know you can link individual files a project to anywhere, with lots of options. Also, what I'm talking about here is the actual file system, not the groups, etc. ...

Access property with define()'d token?

I'd like to do this: <?php define('X', 'attribute_name'); // object $thing is created with member attribute_name echo $thing->X; ?> Attempting $thing->X, PHP takes X to be a property of $thing, and ignores the fact (rightly so) that it's a define()'d token. That in mind, I had expected $thing->{X} to work, but no dice. The only solu...

PHP bind_param alternative for ODBC?

Greetings, I am developing an Admin Control panel and I have to use ODBC to connect to the Database. I'm used to using MySQLi so this is extremely awkward for me. I'm trying to make this as OOP as possible, so I'm using classes and prepared statements. I need to know if there is an ODBC alternative to bind_param and how to use it? I'm...

Player class with my C# XNA game

I would usually seek help on the XNA forums but they're down at the moment, so I've come here. I am making a new XNA game, and I want to have a player class. At the moment I have a main game class called Dots. This represents the main game. This is how my Player class is laid out at the moment: namespace Dots { class Player : Micro...

Creating a method in a class and using it in Ruby

Hi, so im trying to write a simple timer program in ruby. I defined my methods in a "Timer" class but when I call them it gives me a NoMethodError. Any ideas why? Thanks for the help. require "Time" class Timer def start $a = Time.now end def stop Time.now - $a end end puts "Type in 'Start'to to start the timer and then type 'S...

Trying to figure out the hierarchy of classes in my XNA game...

I am still kinda new to developing games in XNA and using classes with C#, but I want to start a semi-decent game project where I can learn without throwaway projects. I want to devide my game up into classes. For example a main game class, a player class (i want two players, and they battle against each other), a level class (for drawi...

I'm stuck on my homework, can I get some feedback? java

package javaapplication1; public class Main { public static void main(String[] args) { Student stu = new Student(); System.out.println (stu.getStudentid() +":" + stu.getStudentname()+":"+stu.getStudentgrade()); //1:Bill:A Student stu2 = new Student (); System.out.println (stu2.getStuden...

How do I create a JavaScript Object with defined variables and functions?

Let's say I want to create an Object called 'Vertex'. Usually, in Java I would do this by: public class Vertex { // member variables public data; private id; // member methods public Vertex() { /* default constructor */ } public getID() { return id; } } Now, how would I do that in JavaScript? I want to preserve pri...