class

How to define a new type (class) in Python using C API?

Hi, I am trying to use the Python C API to define a new class inside a module that would expose certain functionality written in C to Python code. I specifically want to have it in the form of a class and not a set of module functions. However, I can't find anything regarding this particular task in the official documentation. The clos...

objective C filling array with custom class pointers

favorites = [[NSMutableArray alloc] init]; for (int i=0; i<9; i++) { [favorites addObject:[[[Favorite alloc] constructUnknown] autorelease]]; } i'm getting: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[Favorite size]: unrecognized selector sent to instance 0x380d9c0' why? Favorite ...

Inheritance of class variables to a subclass

I'm having a huge nightmare with these subclasses and I can't figure out why this isn't working. I have main class BODY with a subclass RECTANGLE. BODY has a function called SetWorld which does the following function BODY:SetWorld( worldnum ) self.world = worldnum end Now, if I do this: rect = RECTANGLE:new() rect:SetWorld(1)...

"No Suggestions" in NetBeans

For a few days now I'm using NetBeans 6.8 for doing PHP work. But even if a class-file is included and the methods are public and there's phpDoc used, NetBeans everytime shows "No Suggestions" in the window. E.g. I type $user-> and press CTRL+Space, I do expect all the methods and variables but there aren't shown any. ideas? ...

How to run a .class file in Windows 7 OS?

Hi, This is probably a stupid question, but how do I run a class file on windows 7? I usually create my own .java files and then use a basic IDE (with JDK6) to compile it to a class and run it automatically. My professor gave a .class file that we are supposed to play with extensively but I have no idea how to to run it here. Note that ...

String :: and __ the double colon and double underscore in PHP .

What do you call with these string :: and __ in PHP and what other strings are similar to them? ...

template function error..

Hi there, I have function which takes in an parameter of a class called "Triple", and am returning the averge of 3 values of type float. template <typename ElemT> float average(Triple ElemT<float> &arg){ float pos1 = arg.getElem(1); float pos2 = arg.getElem(2); float pos3 = arg.getElem(3); return ( (pos1+pos2+po3) /3 );...

What happens to a class in PHP once its been instantiated?

Hi I'm just playing around with some PHP and was wondering what happens when an object from a class is created within another PHP script? I assume once its created and been processed their is no way of then going back and 'playing' around with it from another script? The idea is i'm trying to create a kind of deck of cards using a car...

How to get suggestions in NetBeans for included files

i have a problem to get suggestions for classes which are included in included files. E.g. content of file 'Header.php' is: //File 'Header.php': include('User.php'); //Class file When I now include the Header.php in my file 'Example.php', i do not get any suggestions: //File 'Example.php': include('Header.php'); User:: After typin...

generating class from hibernate mapping file

hi, i have one mapping file viz. student.hbm.xml.. i need to generate Student.java from the same. the file is below :- <?xml version="1.0" encoding="UTF-8"?> <hibernate-mapping> <class name="org.hibernate.entity.ClassRoom" table="class_room"> <id name="roomId" column="room_id" type="int"/> <property name="roomClass" ...

Using a java class from Delphi

I need to use the logic contained in some java classes. I found JNI, but that project seems not updated recently. Is there a way to use it in a Delphi native application? I use Delphi 2009. ...

Manipulate method functionality call

Hello, is it possibly in c# to have some sort of base class functionality which is manipulated slightly based on the class. For instance say i have the following code (which will quite obviously not compile it's meant to only be for demonstrative purposes) class BaseFunctionality { public virtual bool adminCall public static str...

Unable to generate temporary class in Windows 2008 R2 64 bit for C# app.

Hi, I have no clue whats going on here. My c# (VS2008) app runs fine in 32 bit OS but when i run the same in Windows 2008 R2 64bit i am getting following error: Unable to generate a temporary class (result=1). error CS0008: Unexpected error reading metadata from file 'c:\Windows\assembly\GAC_MSIL\xxxx\7.0.1001.0__5b72a65e64576834\xxxx....

How to get progress bar to time Class exectution

Hello, I am trying to use progress bar to show the progress of a script. I want it increase progress after every function in a class is executed. The code I have tried is below: import progressbar from time import sleep class hello(): def no(self): print 'hello!' def yes(self): print 'No!!!!!!' def pro(): ...

django aggregation with objects

model: class Product(models.Model): name = models.CharField(max_length = 128) (...) def __unicode__(self): return self.name class Receipt(models.Model): name = models.CharField(max_length=128) (...) components = models.ManyToManyField(Product, through='ReceiptComponent') def __unicode__(self): return self.nam...

Problem displaying contents of a class in Java

My problem is i have a class and in it there is a list of elements of another class. public class Branch { private ArrayList<Player> players = new ArrayList<Player>(); String brName; public Branch() {} public void setBr(String brName){this.brName = brName;} public String getBr(){return brName;} public ArrayList<P...

Python class decorator and maximum recursion depth exceeded

I try define class decorator. I have problem with __init__ method in decorated class. If __init__ method invokes super the RuntimeError maximum recursion depth exceeded is raised. Code example: def decorate(cls): class NewClass(cls): pass return NewClass @decorate class Foo(object): def __init__(self, *args, **kwargs): ...

Expected class name before ',' or ';'

Hi All, I am getting an "Expected class-name before , or ; and I dont quite get how to fix it. Here is where the error is: class FXHost : public CPLAT::CP_Application, public CPLAT::CP_M_Listener { The file is FXHost.h and CPLAT:: is obviously a namespace where CP_Application and CP_M_Listener are. I dont see why this would be w...

PHP: Class extends problem "Call to private method ... from context ..."

I have 3 classes in WordPress (the question itself is unrelated to it): class WP_Widget class Theme_Widget extends WP_Widget class Specific_Widget extends Theme_Widget Essentially Theme_Widget contains some extension functions to the basic WP_Widget. Inside Specific_Widget I call one of Theme_Widget's methods: class Specific_Widg...

jQuery .hasClass method to omit effect

I've created a simple background effect for some tabs on a page but don't want that effect to fire if the tab has the class 'current'. I presume there is a way to do this using .hasClass Here's what I'm using for the effect: $('ul.htabs a').mouseover(function(){ $(this).stop().animate( {backgroundPosition:"(0 -810px)"}, {durati...