Questions tagged [extending]

302 questions
2
votes
1 answer

How do you extend a class using composition which requires a more specialized constructor argument?

I am trying to extend classes using composition where possible. But I am having trouble with a particular problem. Lets say I have a Base class and an Extending class. The Extending class takes in an instance of the Base class rather than inheriting…
Jonathan
  • 1,256
  • 4
  • 12
  • 18
2
votes
2 answers

How to expose C++ class to Python without using Boost?

I need to expose a C++ class into embedded python, using Python C API. In other words something like this: Exposing a C++ class instance to a python embedded interpreter but without using Boost at all. The application I want to put this in is quite…
Trog
  • 108
  • 11
2
votes
2 answers

How to control placement ordering when using arrangeoverride to extend WPF controls

I am extending the WPF textbox in order to place a custom image on it. I want to capture mouse clicks on this image. So far i have been able to use arrangeOverride to place the image in where i need it but since it happens to be placed "inside" the…
ambog36
  • 301
  • 1
  • 2
  • 13
2
votes
2 answers

Extending FOSUserBundles Registration to have different fields stored in different tables?

I am new with Symfony2 and FOSUserBundle. I am using Symfony2 version 2.4.1. I would like to extend FOSUserBundle in a few ways. I want to add fields to the registration form, some fields i would like to add to the user table which contains username…
bowseph
  • 53
  • 1
  • 6
2
votes
1 answer

Extend PHP Array with __toString()

Is there a way to extend the native PHP array with a __toString() function/method? I would like to be able to do $a = array($x, $y, $z); echo $a; This should neither complain with a Array to string conversion notice nor the dull output of Array but…
raoulsson
  • 14,978
  • 11
  • 44
  • 68
2
votes
1 answer

Extending Prototypes on Knockout Objects

I have a general question about functions as prototypes on Knockout Objects. Currently, I am having great luck using the following means to extend the prototype of an object, however I'm curious as to what benefits and/or pitfalls I could be running…
beauXjames
  • 8,222
  • 3
  • 49
  • 66
2
votes
3 answers

Create a Python3 module at runtime while initialize an embedded Python

We have a DLL that implements a custom programming language. What I want to do is adding support for the python language keeping the same code for "API function". I have succefully embedded python in this DLL, now I'm approaching the problem to…
Antonio
  • 71
  • 8
2
votes
1 answer

backbone extension file loads, some helpers work, one doesn't

I have a backbone-extend.js file that I load in the require define in app.js. It has a Backbone.View extender class defining a couple helper methods. Two of the methods work just fine in my views, one always errors with Uncaught TypeError: Object…
Locohost
  • 1,682
  • 5
  • 25
  • 38
2
votes
0 answers

Extending Python with C - ImportError: can't map

I'm trying to extend Python with C. My C code compiles and I get a .so file, but then on import to Python, I get this error: ImportError: dlopen(/Users/.../python/PYC/isprime.so, 2): no suitable image found. Did find: …
2
votes
1 answer

How to create a new instance, in C/C++ extension module, of a class defined in Python code?

As the message subject says: How can I, in the C/C++ extension module, create a new instance of a class that's defined in Python code? I'll provide more info below. NOTE#1: I'm trying to do this with Python/C APIs, as you'll see below. But any…
yaobin
  • 2,436
  • 5
  • 33
  • 54
2
votes
1 answer

What is the prefered way to extend the Activiti process engine functionalities?

Activiti is a promising business process engine, many organizations has started to develop business process management systems using activiti. In my case I would like to use activiti to develop a BPM system that fulfills a specific business…
2
votes
1 answer

Proper way to override a JQuery Mobile method in $.mobile

The JQuery Mobile app I'm working on tends to freak out when the soft keyboard launches. I've implemented a solution and it works great, but I had to edit jquery.mobile-1.2.0.js directly to do it. I'd much rather keep my changes in a…
Anthony
  • 5,275
  • 11
  • 50
  • 86
2
votes
2 answers

Can I use a method as a lambda?

I have an interface the defines a group of conditions. it is one of several such interfaces that will live with other models. These conditions will be called by a message queue handler to determine completeness of an alert. All the alert calls…
New Alexandria
  • 6,951
  • 4
  • 57
  • 77
2
votes
1 answer

Getting my python c++ extension to compile using Swig and Distutils on Windows

I'm trying to create a python c++ extension on windows. My problem is that I can't seem to generate the .pyd file (link error) even after using swig and distutils. Below is step by step what I did: In Microsoft Visual Studio 2010 I created a…
mlobl
  • 155
  • 1
  • 11
2
votes
3 answers

Codeigniter - extending controller does not work

I am trying to extend a controller with my own class which extends the default CI_Controller class. Except it doesn't work. It says it can't find my sub-class. My subclass is located in application/core and is named My_Control_Panel. My class that…
DijkeMark
  • 1,284
  • 5
  • 19
  • 41