class

Problem with Classes in Python..

Ok guys, I'm really new at python (and programming itself) so sorry for my ignorance, but I really needed to ask this. So im doing a wxPython project where I added several tabs for a notebook (each tab of the notebook = a class) and there is one tab where I added a checkbox (in a tab, lets call it for example Tab1), and what I want is t...

how to use SMTP + PHP + MYSQL ?

I've got a mass mail function that sends e-mail to all email addresses in my mysql table, but they all get received marked as spam. I want to use smtp validate to fix this. How can I use smtp validation with mail($email, $subject, $message, $headers);? ...

C++ Class Access Specifier Verbosity

A "traditional" C++ class (just some random declarations) might resemble the following: class Foo { public: Foo(); explicit Foo(const std::string&); ~Foo(); enum FooState { Idle, Busy, Unknown }; FooState GetState() const; bool GetBar() const; void SetBaz(int); private: struct FooPartialImpl; void HelperFun...

Accessing elements of an array defined in a class (C++)

Assume that int array arrayName is a member of class className, How can I access its element in my main program?? className.arrayName[0] doesn't seem to work ...

Require_once external vars and share those with other funcions in a php class

Hi all, I have an external file with some vars to require in my php class and share those with all functions of my class: vars.inc: <?php $a = 1; ?> class.php: <?php class A{ public function __construct(){ require_once("vars.inc"); } public function aB{ echo $a; } } ?> but it doesn't work: the $a var is undefined ...

Multiple classes in Codeigniter

I want to create an array of objects, so what I did was to create a library but I can't figure out how to actually dynamically create instances of it in a loop and store each instance in an array. Can anyone tell me please? ...

Declare private static members in F#?

I decided to port the class in C# below to F# as an exercise. It was difficult. I only notice three problems 1) Greet is visible 2) I can not get v to be a static class variable 3) I do not know how to set the greet member in the constructor. How do i fix these? The code should be similar enough that i do not need to change any C# sou...

Run unittest in a Class

Hello, I have a test suite to perform smoke tests. I have all my script stored in various classes but when I try and run the test suite I can't seem to get it working if it is in a class. The code is below: (a class to call the tests) from alltests import SmokeTests class CallTests(SmokeTests): def integration(self): ...

Link objects as fields in UML diagram

I'm trying to generate a diagram for a design document. I've generated a class diagram in VS. At the moment it's just a bunch of unconnected boxes as there isn't any inheritance going on. It feels like it would be more useful if I could show how the objects interact through properties and parameters. As an example, a Boy class has a met...

Java Classes in game programming?

I'm doing a little strategy game to help me learn Java in a fun way. The thing is I visioned the units as objects that would self draw on the game map (using images and buffering) and would react to the mouse actions with listeners attached to them. Now, based on some tutorials I've been reading regarding basic game programming, all see...

Chaining CSS classes in IE6 - Trying to find a jQuery solution?

tl;dr = "Anyone know how to apply chained classes for IE6 using jQuery or similar?" Right, perhaps I ask the impossible? I consider myself fairly new to Javscript and jQuery, but that being said, I have written some fairly complex code recently so I am definitely getting there... however I am now possed with a rather interesting issue ...

AS3 Classes - Should I use them?

I'm working on a project in Flash CS4/AS3 and I have a document class set up but I am wondering about using that, as opposed to frame-based scripting. Most of what I have seen so far deals with how to create them, but doesn't offer much about why or when to use them. I know I can also pull in other classes beyond the document class but,...

Looking to write a Tag class

I'm looking to write a Tag class (a tag is a string with no spaces). My first thought is to inherit from String: class Tag < String def initialize(str) raise ArgumentError if str =~ /\s/ super end end Does this look correct? Are there any other methods I should redefine? ...

.Contains on a list of custom class objects

Hello, I'm trying to use the .Contains function on a list of custom objects This is the list: List<CartProduct> CartProducts = new List<CartProduct>(); And the CartProduct: public class CartProduct { public Int32 ID; public String Name; public Int32 Number; public Decimal CurrentPrice; /// <summary> /// ...

Repeating procedure for every item in class

Data.XX.NewValue := Data.XX.SavedValue; Data.XX.OldValue := Data.XX.SavedValue; I need to do the above a large number of times, where XX represents the value in the class. Pretending there were 3 items in the list: Tim, Bob, Steve. Is there any way to do the above for all three people without typing out the above code three times? ...

Referencing a Document Class from a child MovieClip

I have a document class with a child MovieClip on the stage. I have the clip already on the stage because it's part of an complex layout provided by the designer and it seems easier to leave it on the stage than to use addChild (since I would have to add about 60 objects). What is the best way to reference the document class from inside...

Java NetBeans Comments Class Diagram Helper

i am starting to learn Java using Netbeans 6.8 IDE. i am wondering if there is a utility in NetBeans similar to VS2008 that facilitates commenting code and later display these comments in class diagrams? thanks. EDIT: i found the Javadoc feature. it is some help but not that great. ...

Replacement for PHP's __autoload function?

I have read about dynamically loading your class files when needed in a function like this: function __autoload($className) { include("classes/$className.class.php"); } $obj = new DB(); Which will automatically load DB.class.php when you make a new instance of that class, but I also read in a few articles that it is bad to use thi...

Name my class: Pipelined cache? AntiSymetricPipelineCache?

Having trouble coming up with the right name for this class. Basically its a wrapper around a redis data store where writes are "fired off" asynchronously and performed on another thread (to keep the main processing behavior as fast as possible). There are only occasional Get operations and before we can run those we need to make sure th...

Accessing data stored in another unit Delphi

In Unit2 of my program i have the following code: TValue = Record NewValue, OldValue, SavedValue : Double; end; TData = Class(TObject) Public EconomicGrowth : TValue; Inflation : TValue; Unemployment : TValue; CurrentAccountPosition : TValue; AggregateSupply : TValue; AggregateDemand : TValue; ADGovernmentSpending ...