class

Advanced OOP in PHP5?

I want to know more about OOP in PHP 5.2. Can anybody help me with a link to advanced OOP tutorials in PHP? I know about static, public and private class member attributes, I need more info about basic and advanced OO techniques. I hope somebody can help. :) Thanks a lot to all. ...

Can you help me understand PHP Classes a little better?

I am kind of a slow learner I guess when it comes to coding, I have been learning PHP for a couple of years and I still don't understand Classes so it's time I put some effort in to at least understanding them a little better. I use functions for everything. People often make comments to me on here that they can't believe I have a soci...

Generate List of methods of a class with method types

I want to generate a list of all methods in a class or in a directory of classes. I also need their return types. Outputting it to a textfile will do...Does anyone know of a tool, lug-in for VS or something which will do the task? Im using C# codes by the way and Visual Studio 2008 as IDE ...

Adding items to list results in duplicates. What is a better way?

I have this code to return a list of fund sources for our organization. Dim FundSourceList As New List(Of FundSource) Dim fs As New FundSource If results.Count > 0 Then For Each result In results fs.FundID = result.Item("strFundID") fs.FundDescription = result.Item("txtFundIDDescr") ...

Security Exception Calling Shared Class Library from Windows Service

I know this is probably easy but I just don't know that much about .NET security so here goes: I have a VS2008 VB solution that contains 4 projects. Windows Service, Forms Application a Class Library and an install. The service installs fine and runs under the system account. However, as the service starts I call a method in the librar...

Constructor specialization in python

Class hierarchies and constructors are related. Parameters from a child class need to be passed to their parent. So, in Python, we end up with something like this: class Parent(object): def __init__(self, a, b, c, ka=None, kb=None, kc=None): # do something with a, b, c, ka, kb, kc class Child(Parent): def __init__(sel...

How to use jQuery to read/write the values of an elements externally defined css class?

I have a div in an html file defined as follows: <div id="rangeTabAll"></div> In an externally defined style sheet I define the following style. #rangeTabAll{ top:45px; left:124px; width:186px; height:114px; display:none; background:#ffffff url(../images/rangetab0.jpg) no-repeat; } How do i read/write the ba...

How can I group functions in an ASP.NET class?

I currently have a VB.NET class named "Customers" and it's been steadily growing in size and I now have a couple dozen functions in it. Is there a way of maintaining the functions in the same class? Since they still use common private methods, but group them by similarity. For example: Class Customers -GetData ---GetCustomerObject() -...

Inheritance in Javascript - protoyping not in definition-part?

Hi I am currently switching from AS3 to Javascript. I still have some trouble with understanding inharitance-concepts. What I do not understand is why the following code is not working properly: Base = function () { this.coolVar = "great"; } SmallControl = function () { // Inheritance: this.prototype = new Base(); ...

Skipping chosen types in ruby yaml serialisation

I'm serialising some object using YAML::dump(). Unfortunately that includes some elements that shouldn't be serialised, like locks with waiting threads sometimes. Is there any way to exclude selected types from serialisation, or force them to be serialised as an empty object instead? ...

Team Foundation Server - Add rereference to existing dll to a new class library project

I've just started using Team Foundation Server and have added a new Solution that contains a project of type class library. I need to add a reference to the new class library project to an existing class library (dll) that we have created. What is the best way to do this? I've noticed that if I try to add it from the original location...

Dictionary with classes?

In Python is it possible to instantiate a class through a dictionary? shapes = {'1':Square(), '2':Circle(), '3':Triangle()} x = shapes[raw_input()] I want to let the user pick from a menu and not code huge if else statements on the input. For example if the user entered 2, x would then be a new instance of Circle. Is this possible?...

advanced selection problem

Okay... how do I select a element's parent's child with specyfied class name..? ...

What should I name my PHP class file?

I have seen many different naming schemes and extensions used for PHP files that are basically just classes. Some examples: myClass.php myClass.class.php myClass.class What is the difference, and which is better? ...

Dynamically building/loading a class library in PHP

I am fairly new to OO programming... I am building what will eventually turn out to be a large library of classes to be used throughout my site. Clearly, loading the entire library on every page is a waste of time and energy... So what I would like to do is require a single "config" php class file on each page, and be able to "call" or...

Class diagram examples for RPG (Role Playing Game)

Does anyone know where I can find examples of class diagrams for RP game development? Something similar to here would be quite useful. I'm not looking for things I can slavishly copy, but just for different examples that diagram various solutions to the problems I'm discovering as I try and pencil down my own classes. ...

Dynamically call a static variable (array)

Hello everyone. Here's my question for today. I'm building (for fun) a simple templating engine. The basic idea is that I have a tag like this {blog:content} and I break it in a method and a action. The problem is when I want to call a static variable dynamically, I get the following error . Parse error: parse error, expecting `','' or ...

performance of loading php classes and the use of 'extends'

Hi, I have an includes.php page that I load at the start of every page of my website. As I develop the website, the number of classes that I am using is growing. So I end up with something like this: $db = new DB($config); $login = new Login($db, $config); $form = new Form($db, $config); And the list goes on and on. I have two questi...

How do I list all instance variables of a class in Objective-C?

If I have a class, how can I list all its instance variable names? eg: @interface MyClass : NSObject { int myInt; NSString* myString; NSMutableArray* myArray; } I would like to get "myInt", "myString", and "myArray". Is there some way to perhaps get an array of names that I can iterate over? I've tried searching the Obj...

c# .NET dynamic object name

I haven't worked with Reflection since the last time I touched Java and I'm a little rusty. I've created a Windows service that uses timers and for some of the classes I need the object name to be dynamic (pulled from a sql table). The scope of the objects' creation is within a while loop and I need to be able to save each object's prope...