Questions tagged [extending]

287 questions
9
votes
2 answers

How to extend existing enumerations objects in Scala?

I'm wondering if you can extend already existing enumerations in Scala. For example: object BasicAnimal extends Enumeration{ type BasicAnimal = Value val Cat, Dog = Value } Can this be extended something like this: object…
Henry
  • 145
  • 1
  • 4
9
votes
3 answers

Array change listener

Possible Duplicate: Javascript - How to extend Array.prototype.push()? How can I be notified (run a pre-defined function) of any change to a registered array (or at least any addition or removal of elements)? I tried using prototype. I don't…
Adrian Bartholomew
  • 1,765
  • 6
  • 21
  • 34
8
votes
1 answer

Javascript prototype extend base-class unable to access base-class properties/methods from prototype class

I have created a javascript class TkpSlider being inspired from this w3schools page. (JSFiddle) var TkpSlider = function (args) { args= args|| {}; }; var mainSwiper = new TkpSlider(); I have extended this to add some swipe ability being…
Ardeus
  • 1,721
  • 3
  • 16
  • 25
8
votes
4 answers

Overriding Doctrine_Record (sfDoctrineRecord) instance methods in Doctrine PHP Symfony

My background is in Propel, so I was hoping it would be a simple thing to override a magical getter in a Doctrine_Record (sfDoctrineRecord), but I'm getting either a Segfault or the override method is simply ignored in favor of the one in the…
notbrain
  • 3,166
  • 2
  • 28
  • 42
8
votes
3 answers

Java -- private constructor vs final and more

Suppose there is a class with all of its constructors declared as private. Eg.: public class This { private This () { } public someMethod( ){ // something here } // some more-- no other constructors } From what I know, making…
Roam
  • 4,511
  • 9
  • 36
  • 68
8
votes
1 answer

Inserting code with XJC+xsd+jxb using the options " -Xinject-code -extension "

Im' trying to use the extension "-Xinject-code" of xjc to add some code to my generated classes. For the following simple xsd schema...
Pierre
  • 31,741
  • 29
  • 101
  • 180
7
votes
1 answer

Use JQuery AJAX Prefilter to Inspect Response Data And Conditionally Forward to 'Error' Event Handler

I may be way off course, but I was wondering if it's possible to use the JQuery prefilter functionality and analyze the response data in an Ajax Success and conditionally forward to the error event handler in my ajax calls based on the existence of…
icats
  • 949
  • 3
  • 13
  • 24
7
votes
3 answers

Extending functionality of Grails Plugin

I would like to know, if it is possible and if there is a generic way to extend the functionality of a grails plugin. I recently installed the commentable plugin, but need to do some modifications to it. Since the code is not stored together with…
Nicolas
  • 81
  • 3
7
votes
1 answer

Ecto Changeset add functionality for warnings

I created a fork of ecto repository to extend Ecto.Changeset module with the ability to add warnings to the changeset. I wanted to have an add_warnings/4 function which adds a warning to the changeset as a simple list of warnings with this…
6
votes
2 answers

Extend xUnit.NET to use custom code when processing a class and locating test methods

I'm a big fan of the xUnit.NET framework; I find it light, simple, clean, and extensible. Now let's say that I have a class like so: public class AdditionSpecification { static int result; public void Because() { result = 2 + 2; } …
David Alpert
  • 3,161
  • 1
  • 21
  • 19
6
votes
1 answer

Extending an imported enum in another file and using it

I'm trying to extend an imported enum in a different file, and using that extended enum in another different file. The general case base.enum.ts export enum MyEnum { a = "Foo" } extended.enum.ts import { MyEnum } from './base.enum'; declare…
AnonAppDev
  • 63
  • 1
  • 4
6
votes
2 answers

How do you extend a django pluggable app?

Let's say I am using django-tagging application and I decide I want to add a form class to the existing tagging forms. I do not want to patch the form into the existing forms.py since it will be blown out when updated. How do I extend forms.py to…
chris
  • 825
  • 2
  • 9
  • 22
6
votes
1 answer

ImportError: [libraryname].so: undefined symbol: [function name]

I'm extending my Python program with a C module that uses the GstPhotography interface for GStreamer. My C module compiles fine, but when I try running it from Python, I get this error: $python Program.py Traceback (most recent call last): File…
13guppies
  • 61
  • 1
  • 3
6
votes
10 answers

How to use code from one class in another? (Java)

I'm making a tank game and to avoid redundancy I'm making classes to extend. My MenuPanel looks like this atm (I've only written the code that matters for the question) (knop = dutch for button) public class MenuPanel extends JPanel implements…
Lola
  • 179
  • 8
6
votes
1 answer

Python - SystemError: NULL result without error in PyObject call

The story: I'm trying to interface from C to Python in order to use the faster computational speed of C for an existing Python code. I already had some success, also with passing NumPy arrays - but now there seems to be an issue and I can't resolve…
rammelmueller
  • 855
  • 10
  • 24
1
2
3
19 20