class

In PHP, are there any advantages to using forward_static_call_array() instead of call_user_func_array() when dynamically calling a static method?

Specifically, is one more efficient than the other? ...

Objective C : Given a Class id, can I check if this class implements a certain protocol? Or has a certain selector?

I want to use this for an object factory: Given a string, create a Class, and if this Class supports a protocol (with a Create() method) then alloc the class and call Create. ...

how to save/read class wholly in Python

som = SOM_CLASS() # includes many big difficult data structures som.hard_work() som.save_to_disk(filename) #then later or another program som = SOM_CLASS() som.read_from_file(filename) som.do_anythink_else() or som = SOM_CLASS() save(som) #... load(som) som.work() what is easiest way to do this? ...

What does it mean: Defining a class with a method that gets an object of the class type?

Suppose that we have a class called class1. The class1 has a method called method1 and this method gets an object of type class1. like this: public class class1 { //instance members // property methods public void method1(class1 obj) { //........... } } What does it mean: the method gets an object of t...

How do I fix class template has already been defined?

I am implementing ZipArchive library into my project, and I fought with it for over an hour getting it setup right to stop all the linker errors. But now I still have this left over and I am not sure of the best approach to fix it, could use some help. C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\afxtls_.h(199) : error...

Asking WebView to load webpage from different class

Hi, I have a WebView that I need to ask to load a website from a different class.Therefore I implemented the following function: -(void)performResearch:(NSString *)aString { NSLog(@"Received Request!"); [[researcher mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:aString]]]; } In my other...

How many private variables are too many? Capsulizing classes? Class Practices?

Okay so i am currently working on an inhouse statistics package for python, its mainly geared towards a combination of working with arcgis geoprocessor, for modeling comparasion and tools. Anyways, so i have a single class, that calculates statistics. Lets just call it Stats. Now my Stats class, is getting to the point of being very lar...

Is it worth cutting down a 540 byte class into smaller chunks? (C++)

So I've been developing a UI toolkit for the past year, and my Window class has gotten to a point where the size of the class (through sizeof) is 540 bytes). I was thinking, that since not all windows have children, I might split parts of the code that handles having children (its alignment etc) into a separate class and have a pointer ...

Memory Management Question

Hi, i thought i getting the hang of Cocoa memory management, but apperently i have a lot more to learn. Take a look at this class i wrote: Word.h #import <UIKit/UIKit.h> @interface Word : NSObject { NSString *word; NSMutableArray *wordArray; } @property (nonatomic ,retain) NSString *word; @property (nonatomic ,retain) NSMut...

Mixing Inheritance and Tree Structure with Fluent nHibernate

Part of a model I'm designing is a hierarchy geographic locations. Since there are multiple layers and share some information I decided to use a class hierarchy like this: public class GeographicNode { public virtual int Id { get; private set; } public virtual string Name { get; set; } public virtual GeographicNode ParentNod...

do i consider (int, double...) as classes

Hi, i'm new to c++ and having a little problem understanding about c++'s casting. According to "C++ Primer", the old style cast is like: int(variable) or (int) variable, and new ones introduced by c++ standard includes static_cast<>, const_cast<>, reinterpret_cast<> and dynamic_cast<>. Is the static_cast<> equivalent to "old style cas...

PHP Fatal error: Using $this when not in object context

Hello Everybody, I've got a problem: I'm writing a new WebApp without a Framework. In my index.php im using: require_once('load.php'); and in * load.php* I'm using require_once('class.php'); to load my class.php. In my class.php I've got this error: Fatal error: Using $this when not in object context in class.php on line ... (in t...

How do I access the Document Class' properties from the time line in AS3?

I am building your standard slideshow flash header for a web page. There are three main parts: The Slideshow class A controller class that is used as the projects Document Class Some linking timeline code. The slideshow class has all the functionality, so I used the Document class to create a new instance of the slideshow and ke...

How to import class into existing Java project, with Eclipse.

Hi there. I downloaded the svgsalamander.jar, with all its pretty classes and stuff. But i can not sucesfully load them into my existing Java project, using Eclipse, so, how can i do it? I am truly sorry about asking this, but i tried with google, stack and found nothing useful. Thanks! ...

Working with separate classes, global/static class ?

Say I have two separate classes, A and B. I also have Repository class C which loads some information from a textfile. E.g. It has methods loadLines(), addLine(), deleteLine(). Ignoring databinding, how can I make A and B both work on the same class C. Is it possible? For example at the moment, in class A and B formload, I have: var...

Broken htmlText in Actionscript 3.0 - funky display from incremented display using string.substring

This is an issue with textField.htmlText in actionScript 3.0 and the class I'm making for it. In an attempt not to post my whole class, I've managed to boil down the problem to what seems like a silly and almost impossible-to-overcome issue. It seems that TextFields (specifically, ones created with ActionScript) have an unbearably hard ...

How do I use Luabind and C++ to create an asset managing class?

I've made countless attempts to get this working, but everything I do gives me run-time errors. I've been trying to make asset managers to manage content for my game engine, and I'm using lua and luabind for my scripting. Getting everything to compile, binding classes and variables, and getting basic variables back from lua have been no ...

How to access my member variables by $instance['name'] in PHP?

$instance = new className(); $instance['name'] How to make it work,an example? ...

How do you get an instance of java.lang.Class for a generic collection like Collection<SomeObject>?

How do you get an instance of java.lang.Class for a generic collection like Collection<SomeObject>? I'm looking for something like the following: Class clazz = Collection<SomeObject>.class; ...

How to access class fields of a class that I only know it by its string name ?

For instance, I have a class called "My_Class_X123.java" like this : public class My_Class_X123 // This file was generated by a java program { static String ABC[]={"1","2",...}; int XYZ=0; } When I wrote my program I didn't know there would be a class by this name, but at run time I found out a class by the name of "My_Class_X1...