Questions tagged [extending]

287 questions
27
votes
5 answers

Symfony2 extending DefaultAuthenticationSuccessHandler

I want to alter default authentication process just after authentication success. I made a service that is called after authentication success and before redirect. namespace Pkr\BlogUserBundle\Handler; use Doctrine\ORM\EntityManager; use…
piotrekkr
  • 2,507
  • 2
  • 17
  • 28
19
votes
4 answers

Adding a constructor prototype to a javascript object

I have several javascript objects like this: var object = { name: "object name", description: "object description", properties: [ { name: "first", value: "1" }, { name: "second", value: "2" }, { name: "third",…
Wilt
  • 33,082
  • 11
  • 129
  • 176
19
votes
3 answers

Extending PHP static classes

I've been struggling in this area for days now, and I have reached a conclusion, but since the conclusion was not what I was looking for, before I give up, I'll try to see what other people say. Faith dies last... Let's say we have a superclass…
treznik
  • 7,455
  • 12
  • 41
  • 55
18
votes
3 answers

Entity Framework 4, inheriting vs extending?

What are the advantages/disadvantages to each method? I know I've read somewhere in either a book or on this site why using table inheritance is crappy for Entity Framework 4. For instance, why not make one table which has an entityId, datecreated,…
SventoryMang
  • 9,656
  • 12
  • 66
  • 103
17
votes
5 answers

Circular ArrayList (extending ArrayList)

So my program has a need of a type of circular ArrayList. Only circular thing about it has to be the get(int index) method, this is the original: /** * Returns the element at the specified position in this list. * * @param index…
Karlovsky120
  • 5,718
  • 7
  • 30
  • 79
15
votes
6 answers

How to add a custom working Shipping Method in WooCommerce 3

I have successfully created a new shipping method and given it support for shipping zones. However when I come to select the method from the dropdown to add it to the zone it does not appear in the 'selected methods list'. I recorded a screencast…
jhob101
  • 372
  • 2
  • 4
  • 13
14
votes
1 answer

How to extend an existing jQuery UI widget?

I am using jQuery v1.8.3 and jQuery UI v1.9.2. I would like to extend an existing jQuery UI widget (in my case the Autocomplete widget) by adding and overriding just some options and methods but keeping the others functionalities as those present in…
user12882
  • 4,216
  • 9
  • 35
  • 53
13
votes
2 answers

Extending entities in Symfony2 with Doctrine2

I'm having trouble finding a way to appropriately extend an Entity across bundles in Symfony2 using Doctrine2 as the ORM. Currently there are three methods that I've found to extending entities in Symfony2 using Doctrine2 as the ORM. Mapped…
Jgarib
  • 166
  • 1
  • 1
  • 6
12
votes
3 answers

Scala, advanced generic extending

I'm trying to rewrite https://gist.github.com/319827 to Scala. But I can't compile it. What is the correct syntax? Error I'm allways getting: class type required but java.util.Comparator[_ >: java.lang.Comparable[java.lang.Object]]…
v6ak
  • 1,568
  • 2
  • 11
  • 26
11
votes
3 answers

What is the purpose of extending an anonymous type in Scala?

I'm trying to get a better understanding of Scala, and I can't seem to find a valid usecase for code like the following: class C extends { def m() { /* ... */ } } What is the rationale for allowing such constructs? Thanks!
Eyvind
  • 4,993
  • 5
  • 38
  • 57
11
votes
3 answers

Missing Python.h while trying to compile a C extension module

I'm following this tutorial on how to extend Python with C\C++ code. The section named "Building the extension module with GCC for Microsoft Windows" fails for me with the following error: fatal error: Python.h: No such file or directory The…
Jonathan
  • 84,911
  • 94
  • 244
  • 345
10
votes
2 answers

Extending class for activity

I'm totally new to Android (Java) Development and I'm so excited about it! The developers guide of Google is fantastic and I learned a lot in a small time. It even keeps me awake during the night ;) Today I went through making menu's and there's…
MartijnG
  • 795
  • 3
  • 11
  • 24
10
votes
4 answers

Copying Javascript getters/setters to another prototype object

// Base class var Base = function() { this._value = 'base'; }; Base.prototype = { constructor: Base, // By function getValue: function() { return this._value; }, // By getter get value() { return…
Ben Fleming
  • 4,571
  • 2
  • 25
  • 26
10
votes
1 answer

Straightforward Way to Extend Class in Node.js

I am moving a plain Javascript class into Node.js. In the plain Javascript I use: class BlockMosaicStreamer extends MosaicStreamer{ } I can't seem to find a simple way to implement this in Node.js. In my node project in BlockMosaicStreamer.js I…
Sara Tibbetts
  • 4,408
  • 6
  • 35
  • 69
9
votes
4 answers

Erlang: simple pubsub for processes — is my approach okay?

Disclaimer: I'm pretty new to Erlang and OTP. I want a simple pubsub in Erlang/OTP, where processes could subscribe at some "hub" and receive a copy of messages that were sent to that hub. I know about gen_event, but it processes events in one…
drdaeman
  • 9,968
  • 6
  • 53
  • 103
1
2 3
19 20