class

Can PHP static methods legally have a visibilty of protected or private?

I realize that it's possible to define a static class method as private and protected in PHP. This allows for an instantiated class, or public static method to access it's own private/protected static methods. protected static function jumpOver () However I'm not sure if this is legal in the sense of OOP design. I can't find any real...

Dynamic vs non-dynamic class members

In C++, ff I have a class that needs to hold a member which could be dynamically allocated and used as a pointer, or not, like this: class A { type a; }; or class A { A(); ~A(); type* a; }; and in the constructor: A::A { a = new type(); } and destructor: A::~A { delete a; } are there any advantages or ...

Writing my first VB.NET Class

I am trying to make 2 variables available throughout my site. I am parsing the URL in order to retreive both of them. This code on the page itself works fine. Dim countryLanguage As String countryLanguage = (Request.ServerVariables("URL")) Dim langVar = (Mid(countryLanguage, 2, 2)) Dim countryVar = (Mid(countryLanguage, 5, 2)) I have...

PHP Class Design question....

Hi, I am trying to write Classes to show some people in my skill test. One of the questions is as follow: Show how a child would call a parent's method. Show how overloading works. Indicate the syntax for class variables. I think I got most of the question done but not sure what Indicate the syntax for class variables mean...Could som...

Python SESSION (like php) class

Hi All, is there any class to handle a SESSION (like php) in Python? not in django, but I want to use it with PyQt thank you ...

C# classes communication design question

Hi ! I have a design questions about this scenario: Suppose you have a form with many sites to be filled, let's call each site a plugin. Among other classes I've created a PluginManager class that takes evidence of all plugins and provides some functionality and properties: class PluginManager { ... BasePlugin CurrentPlugin {get;se...

iphone release dealloc

hi all! I wish best understand the difference between dealloc and release function.... example... I have my class derived from NSObject calle MyClass in my code, to use this class, I create an instance of MyClass.. // initialization MyClass* test = [[MyClass alloc] init]; //do some stuff.... // release?? [ test release]; is right?? ...

Already included class

Is it possible to make my class file be already included in all files of a folder? ...

How to understand multiple classes in css?

Here is an example that I do not understand: .container_12 .grid_6, .container_16 .grid_8 { width: 460px; } It seems to me that width: 460px is applied to all above mentioned classes. But why some classes are separated by coma (,) and some just by space? I assume that width: 460px will be applied only to those elements which comb...

Can I construct an Object without knowing the class in ActionScript 2?

In AS2, I can certainly do this: var instance = new MyClass(); But is there a way to do something like this? var constructor = MyClass; var instance = new constructor(); This appears to be possible in AS3 by just calling "new" on an instance of the Class object, but I haven't been able to figure out what the syntax would be to get ...

PHP How to use multiple class functions of a class in a single script?

Here's the code I have. Everything works fine except when trying to use the same declared class variable in script more than once with a function. include("include/database.class.php"); $db = new Database(); $db->connect(); function fill_roles() { global $db; $r = $db->get_roles_all_order_by_name(); $drop_down = "<select id...

php: efficiently running functions with one-time loaded classes multiple times in optional files

Hello again, after reading the responses I have rewritten my question. Let's say I have a theoretical php application that uses objects that do different things. For every page that gets loaded by the application, different scripts will be run. now I made a simple php script that creates a simple object. (this is all made up, I'm just ...

C# Custom class collection confusion

The following is my custom class, with collections. My application is an MDI app with the ability to open a "Program" form multiple times for multiple programs and I want to use the ProgramBudget class but I want all of the "subclasses" within the Program budget to be contained within the Program form ProgramBudget class. I am having is...

Ruby class question

Possible Duplicate: class << self idiom in Ruby I have a quick Ruby question. I come from a Java/c background, so I understand in Ruby "self" when referenced inside a instance method acts like "this". And "self." prefix for method defines it as a class method. But what does this mean here?? class << self def some_method ...

access all classes of ontology

dear all i have an ontology that it doesnt have only one root class. it has 4 seperated classes(4 sub graph) ---1---- with listclasses() method i can't access 3 of them. this method lists one root class and its subclasses! i want to get all classes of ontology.then i want to get "Thing" class to access all of classes!!! is this possib...

Two sets of constructor parameters in a scala class

What does this code do? Why is there two sets of constructor parameters? class A(val x: Int)(val y: Int) I can initialize an object and use both fields: val a = new A(5)(7) println(a.x + ", " + a.y) If I make it a case class, I can match only by the first set of parameters. case class A(x: Int)(y: Int) val a = A(5)(7) a match { ...

Object Oriented scope and inheritance in Android activity classes

I'm still very new to Object Oriented programming and am having problems with the class inheritance and the scope of variables from one instantiated class to another. I'm trying to build an android application that can read multiple XML feeds and save them to the phone's SQLite database. Each feed has a different name ("news", "audio_mi...

python newbie question: converting code to classes

i have this code: import csv import collections def do_work(): (data,counter)=get_file('thefile.csv') b=samples_subset1(data, counter,'/pythonwork/samples_subset3.csv',500) return def get_file(start_file): with open(start_file, 'rb') as f: data = list(csv.reader(f)) counter = collecti...

Must declare a body becase it is not marked abstract, extern or partial

Hello all. I'm a tool, tired and completely out of my depth!! I have created the following class based on some old code so one has kindly given me. However, I cannae get past the error as described in the title. The classe is as follows using System; using System.Collections.Generic; using System.Linq; using System.Web; using System....

Including a PHP class file only once

I'm using methods from a PHP class all over my code and I don't want to do "require_once" in every file I'm using that class. Is there a way to include the class in a single file, and then access it from everywhere in the code? Thanks! ...