class

How do you set a "Document class" from an SWC in Flash CS4?

I have an SWC with a class called Content. I want to set it as the "Document Class" in Flash. However, after setting up the SWC in the .fla, I am receiving an error message saying that "A definition for the document class could not be found in the classpath,..." Setting up the direct class folder works fine, but I need to distribute this...

Managing Instances in Python

Hello, I am new to Python and this is my first time asking a stackOverflow question, but a long time reader. I am working on a simple card based game but am having trouble managing instances of my Hand class. If you look below you can see that the hand class is a simple container for cards(which are just int values) and each Player c...

Member is inaccessible from friend class

I have a declaration like this #include "Output/PtPathWriter.h" // class PtPathWriter // I've also tried forward declaring the friend class // leg data is a class designed to hold data for a single leg. class PtPathLeg { friend class PtPathWriter; // doesn't work //friend void PTPathWriter::writeToFile(string fileName, PtPath* ...

C# - What should I do when every inherited class needs getter from base class, but setter only for ONE inherited class

Hello, I have a abstract class called WizardViewModelBase. All my WizardXXXViewModel classes inherit from the base abstract class. The base has a property with a getter. Every sub class needs and overrides that string property as its the DisplayName of the ViewModel. Only ONE ViewModel called WizardTimeTableWeekViewModel needs a se...

Fatal error: Function name must be a string in.. PHP error

Hi I have a class called User and a method called insertUser(). function insertUser($first_name, $last_name, $user_name, $password, $email_address, $group_house_id) { $first_name = mysql_real_escape_string($first_name); $last_name = mysql_real_escape_string($last_name); $user_name = mysql_real_escape_string($user_name); ...

Defining a Class in Objective C, XCode

Hello; I am new to Objective C, and am trying to write a class that defines a complex number. The code seems fine but when I print to the console, my values for instance variables are 0. Here is the code: // // ComplexNumber.h // Mandelbrot Set // // Created by Brett on 10-06-02. // Copyright 2010 __MyCompanyName__. All rights res...

Is there a 128 or 256 bit double class in .net?

I have an application that I want to be able to use large numbers and very precise numbers. For this, I needed a precision interpretation and IntX only works for integers. Is there a class in .net framework or even third party(preferably free) that would do this? Is there another way to do this? ...

Obj-C: Creating an object with a String name

Hey all. I know this sounds simple, but I can't find a way to do it. I have a method in Obj-C that takes in a NSString and then should create a new class with the String as its title. -(DataModel *)createDataModel:(NSString *)dataModel_name { DataModel *[initWithString:dataModel_name] = [[DataModel alloc] init]; } I ...

Why use singleton instead of static class?

When would a singleton actually be easier or better than a static class? It seems to me creating a singleton is just extra effort that's not actually needed, but I'm sure there is a good reason. Otherwise, they wouldn't be used, obviously. ...

Test if a class is a subclass of another class in common lisp

How do I see if one CLOS class is a subclass of another CLOS class? ...

Vb.net Custom Class Property to lower case

I am trying to create a settings class. The Property Test() is a list of strings. When I add a string such as: t.test.Add("asasasAAAAA") I want it to autmatically turn lowercase. For some reason it is not. Any Ideas? p.s. using t.test.Add(("asasasAAAAA").ToLower) will not work for what I need. Thank you. Public Class Form1 Priv...

Passing object element to class not as a string (like constant) in php ?

How can I dynamically pass "items" to class function? For example here it is a piece of some class and its function where I declare an element of object (items) as $b: //.......... public function __add2SomeObj($b) { $namespc = $this -> __someObj(); // __someObj() returns object $namespc -> cats = $b; ...

Easiest way to class "current page" nav element?

I have a navigation bar on my webpage with links to different pages. Is there an easy way to automatically set the class on the navigation element corresponding to the current page? For instance, I want the "About Us" tab on the bar to have a different style if you're currently viewing the "About Us" page. I know I could rig up some P...

How to use derived class shared variables in shared methods of base class

Hi guys, I am trying to add shared members in derived classes and use that values in base classes... I have base class DBLayer public shared function GetDetail(byval UIN as integer) dim StrSql = string.format("select * from {0} where uin = {1}", tablename, uin) .... end function end class my derived class class Us...

When to return bool, throw an Exception and which exception to throw

Hi Stackoverflowers, In designing your class libraries, When you create a method, when do you decide to throw an Exception, or return a boolean. For example. public class MathHelper { public int Divide(int x, int y) { if(y == 0) { throw new DivideByZeroException("Cannot Divide by Zero"); } ...

OOP PHP and MySQL

Hi I'm new to OOP with PHP. I'm wondering how OO comes into play when selecting data from a table. i.e. i have a users table and a user profile page. So I have a User class. Do I select the user data from the table then create a new object of class User and define the properties? Thanks for anyone that can clear this up for me! Regards...

CSS Problem in scrollbar coloring.

.body_c { scrollbar-face-color:#408bc4; scrollbar-shadow-color:#afefff; scrollbar-highlight-color:#afefff; scrollbar-3dlight-color:#000000; scrollbar-darkshadow-color:#006399; scrollbar-track-color:#bfd3e6; scrollbar-arrow-color:#FFFFFF; margin-top:0; margin-left:0; margin-right:0; } I am using this class for coloring scrollb...

Class Library public functions are not accessible in another class library as console application

Hello, I have one class library that have all functions declared as public under public class. Still When I am going to call one of those it gives linker errors. Do I need to export these methods explicitly from class library as we export from native dll. When I export with __declspec(dllexport) it says that function cannot be exported ...

Generic constraints, where T : struct and where T : class

I would like to differentiate between following cases: A plain value type (e.g. int) A nullable value type (e.g. int?) A reference type (e.g. string) - optionally, I would not care if this mapped to (1) or (2) above I have come up with the following code, which works fine for cases (1) and (2): static void Foo<T>(T a) where T : stru...

If class inherited many times can be slower ?

When i try to create good object hierarchy which will help to write less code and avoid to use unnecessary fields ,i feel myself free to create many base classes for good grouping which is usually abstract. What can be disadvantage of doing it like that ? Many times inherited class can be slower ? To see many unnecessary abstract classe...