class

Python raw_input into dictionary declared in a class...

Hi, I am incredibly new to Python and I really need to be able to work this out. I want to be asking the user via raw_input what the module and grade is and then putting this into the dictionary already defined in the Student class as grades. I've got no idea what to do! Thanks in advance! students = [] # List containing all student obj...

Nesting objects and where to retrieve data?

Hi all I am trying to re-write an existing system with objects. I have created a few basic objects but am stuck on exactly how to get them to work how I want. These are the basic classes: Public Class Course Public AcadPeriod As String Public AoSCode As String Public AoSPeriod As String Public Title As String Publ...

PHP: How to instantiate a class with arguments from within another class

Hello All, I am in a situations where i need to instantiate a class with arguments from within an instance of another class. Here is the prototype: //test.php class test { function __construct($a, $b, $c) { echo $a . '<br />'; echo $b . '<br />'; echo $c . '<br />'; } } Now, i need to instantiate above class using below cla...

how to select event by class in prototype

hi , in jQuery. i am invoking an event by class. how do you do same in Prototype. $(".button").click(function() { var element = $(this); var Id = element.attr("id"); }); ...

Eclipse CVS ignores .class files -- how can I turn that off?

I would like to commit new .class files into CVS via Eclipse, but these files get ignored, and I'm not sure where to turn that off. The Preferences windows a section for doing this, but .class isn't listed. ...

Is it possible to define multiple classes in just one .cpp file?

I'm working on a project for school and the instructor insists that all code go into one .cpp file (for easier grading on his part). I would like to define multiple classes within this file. Will I run into any problems in doing this? ...

How do I create my own Classes/Objects in Flex?

When I try to do this in an AS CDATA block, it tells me I can't have a class declared within a class (the MX:Application itself). Makes sense. But where and how do I do it? ...

c# gettype of object from class

How could I make this work?: public class myClass { public string first; public int second; public string third; } public string tester(object param) { //Catch the name of what was passed not the value and return it } //So: myClass mC = new myClass(); mC.first = "ok"; mC.second = 12; mC.third = "ko"; //then would return its type...

PHP: How to return an instantiated class object, given a class name?

They say that eval() is evil. I want to avoid the use of the eval() line using proper PHP5 functionality. Given a class name in a static class method, how do I make it return a real object? class Model { public static function loadModel($sModelPath) { if (!(strpos(' ' . $sModelPath, '/')>0)) { $sModelPath .= '/' . $sModelPat...

Calling base class functions through derived pointers

( Objective C ) How would I call a base class function using a derived pointer where foo is overridden in the derived class. Essentially the equivalent of this C++ code base* b_ptr = 0 ; derived* d_ptr = new derived() ; d->base::foo() ; I would think this should be fairly simple. Do I need to use a selector? ...

Django: how to use bare classes in urls.py urlpatterns?

I've seen somewhere a urls.py construct like this: from project.f import SomeClass urlpatterns = patterns('', (r'^url/$', SomeClass()), ) Nowhere in http://docs.djangoproject.com/en/dev/topics/http/urls/ I can find out what this means, normally an entry is like this: (r'^url/(?P<some_id>\d+)/$', 'project.views.some_view'), C...

finding class name conflicts and jar file version discrepancies and redundancies

Most of the time , the developers will be having hard time to debug the issues related to class loading issues for the reasons like 1 . the class path might have two different jars with the same class having different version. 2. class loading issues. Although we could use jar utility to delve into each and every jar , it is going ...

PHP file naming conventions (.class, .inc)

I see .class and .inc included in file names a lot of the time. My current understanding is that this is just a best practice to make the purpose/contents of the file clear. Is there any instance in PHP where a .class or .inc file name has a special purpose and truly means something? ...

struct vs class as STL functor when using not2

Hi. Studing STL I have written a a simple program to test functors and modifiers. My question is about the difference aon using CLASS or STRUCT to write a functor and try to operate on it with function adaptors. As far as I understand in C++ the difference beetween CLASS and STRUCT is that in the last case the members are public by defau...

Problem with class variables , to use them in if block in function

I am having problem in accessing variables in class here's the code class Text { private $text = ''; private $words = ''; // function to initialise $words private function filterText($value,$type) { $words = $this->words; echo count($words); // works returns a integer if($type == ...

Good PHP Email Library?

Hello There, I would like to know which is the good opensource php email library to incorporate in my next project? Thanks ...

why we need to restart tomcat server when a class file is changed,is there no other way?

why we need to restart tomcat server when a class file is changed,is there no other way? ...

Size of an array

This question is about C++ I always thought that name of an array in C++ is only a pointer, so I thought that int ar[10]; cout << sizeof(ar); will give me the same as sizeof(int *). But it gives 40 - so it is real size of whole array. It also gives 40 when array size is given by variable: int n = 10; int ar[n] I want to copy a cla...

why is python reusing a class instance inside in function

I'm running a for loop inside a function which is creating instances of a class to test them. instead of making new classes it appears to be reusing the same two over and over. Is there something I'm missing about how classes and variables are handled in python methods? how can I generate a new object for each iteration of the loop cl...

is it possible to define a class property dinamically in php?

I have a class definition like: class JConfig { var $offline = '0'; var $editor = 'tinymce'; var $list_limit = '20'; var $helpurl = 'http://help.joomla.org'; var $log_path = '/path/to/logs'; // .... } I want to dinamically define '$log_path' I've tried to define a constant outside the class declaration but no ...