class

implicit class variable declaration in php?

Hi, I've been looking at some code and am having a hard time working out variable declaration in php classes. Specifically it appears that the code i'm looking at doesn't declare the class variables before it uses them. Now this may be expected but I can't find any info that states that it is possible. So would you expect this: class E...

OO database class

Hi everyone. I'm trying to learn object oriented programming more clearer by creating a database class in PHP. This is what i have right now. I'm getting an error about $mysqli being an undefined variable when i try to call it using $db->query(); Please explain how to make the variable $mysqli defined. <?php class phpDatabaseClass ...

PHP Objects Overwriting problem

Hello everybody, here's my problem: $Me[1] = new User(1); $Me[2] = new User(2); $Me[3] = new User(19); $Me[4] = new User(75); $Me[5] = new User(100); foreach ($Me as $k) echo $k->getId(); I'm trying to create 5 users with, of course, different ID. The problem is that the User with ID 2 'overwrite' the User with ID 1, the User with ID ...

static class allocation

In C# are static classes stack allocated? Since they cannot be instantiated, I guess that must the how it is done. ...

Delphi 7 Personal: class wizard extension?

Hi, I'm wondering if there's any class wizard extension (maybe GExperts extension?) for Delphi 7 Personal? The most important feature for me is to automatically generate properties getters / setters... ...

Ruby - dynamically add property to class (at runtime)

I'm looking for a way to add properties to my already defined class at runtime, or better: class Client attr_accessor :login, :password def initialize args = {} self.login = args[:login] self.password = args[:password] end end But then, I have this hash {:swift_bic=>"XXXX", :account_name=>"XXXX", :id=>"...

Android, activity for each view mode? Or switch statements inside fewer Activity classes?

I know how to functionally do each of the following scenarios, my main question is which is the better design decision? Based on app size/speed and battery life and such. So I will have several activities that will display different lists. They're all lists of the same object, but the objects' states will be different in each of the lis...

error C2039: 'string' : is not a member of 'std', header file problem

I am having problems with a class I am writing. I have split the class into a .h file that defines the class and an .cpp file that implements the class. I receive this error in Visual Studio 2010 Express: error C2039: 'string' : is not a member of 'std' This is the header FMAT.h class string; class FMAT { public: FMAT(); ~...

Quicker Forms html/php ?

Hi lad's, I'm working on a project at the moment that requires alot of forms. I was thinking of a workaround to minimise spending hours of time on the subject. Above all else I don't want to use a framework to do this for me, I'm still learning so its important for me to understand at the core. Ok so I have a class called form builde...

[Wordpress] Getting widget instance settings

Does anyone know if it's possible to access a widget instance settings from a different function than widget(), update() or form() ? For example, in the widget below I want to get the $args and $instance variables from within my_custom_function(). class test extends WP_Widget{ ... function test(){ ... } function my_custom_...

How can I pass a variable from class element to class element? (C++)

My question might not be too correct... What I mean is: class MyClass { public: MyClass() { } virtual void Event() { } }; class FirstClass : public MyClass { string a; // I'm not even sure where to declare this... public: FirstClass() { } virtual void Event() { a = "Hello"; // ...

PHP class methods cascading

Hello Geeks I have seen many php scripts in which you can cascade class method to produce a specific functionality for example as in codeigniter when you load a view you would type <?php class Posts extends Controller { function index() { $this->load->view("BlaBla"); } } ?> I am not completely sure ...

Understanding Classes in PHP

I'm officially mentally retarded. [Let me explain] I've never really given classes and their relationship any thought until today. I'm trying to figure out something that seems to be pretty obvious but since I'm stupid I can't see it. Let's say I have a Core Class that will be extended from different files. How can children classes cal...

How to import an ActionScript class into a package?

I'm having a bit of trouble getting a class to import. Here is my filesystem: - com - test - class1.as - example - class2.as I'm working on class1.as and want to import class2. How can I do that? The following doesn't seem to work: import com.example.class2; How can I access class2 from class1? ...

isMemberOfClass vs comparing classes with ==

Is there any real difference between: id value; BOOL compare1 = [value isMemberOfClass:[SomeClass class]]; BOOL compare2 = [value class] == [SomeClass class]; to check if value is a SomeClass object? ...

Scala - are classes sufficient?

Coming from Java I am confused by the class/object distinction of scala. Note that I do not ask for the formal difference; there are enough references on the web which explain this, and there are related questions on SO. My questions are: Why did the designers of scala choosed to make things more complicated (compared to Java or C#)...

Problems writing a module for phpBMS

I am trying to write a small, simple module for phpBMS. I am basically modifying and simplifying one that exists, and have gotten to the stage of creating the table and pages in phpBMS itself and making the module installable. I am now trying to create the php page that will allow for new records to be inserted into the table via phpBM...

Understanding template classes in c++ - problem with new-operator

Dear all, I've been stuck with this problem now for a few days and my searches were not successful. What I am trying to do: I want a template reader class (VariableReader) to handle different types of variables (usually unsigned int and pointers to vector). I started with #ifndef READER_H_ #define READER_H_ #include <string> namespa...

Nullable class?

I have this class public class FilterQuery { public FilterQuery() { } public string OrderBy { set; get; } public string OrderType { set; get; } public int? Page { set; get; } public int ResultNumber { set; get; } } I would like to use it like this public IQueryable<Listing> ...

How to change the default setting of a domain field in Grails to be nullable

I want any field to be nullable in default. ...