Questions tagged [extending]

302 questions
4
votes
1 answer

proper way of extending ActiveRecord::Base

I have extended the ActiveRecord::Base class in the following way: I made a directory under the lib, let's call it now foo wrote the module which provides the extra method has_many_bidirectional to have bidirectional has_many relationships in…
KARASZI István
  • 30,900
  • 8
  • 101
  • 128
4
votes
2 answers

Laravel 5.2: Creating a custom route function - extending route

So basically, I want to create my own Route::custom function. This is because I've been using the same groups and middleware for several routes throughout the site (I'm also using modules with subdomains, so we're talking about saving 5-6 lines of…
theomessin
  • 754
  • 4
  • 13
4
votes
1 answer

Flexbox parent to extend width if the child contains a really long word

I wonder if anyone can help me with this issue, I can't seem to find anyone else who's wanting to do this with flexbox! I've set up a basic Flexbox scenario where several elements (li) appear in a flexbox container (ul). And I've also set it so that…
4
votes
1 answer

VSCode - IntelliSense with custom languages

Hello VS Code Community! I'm currently extending the VS Code editor with a own / custom language. This is easier as I thought but now I'm getting problems with IntelliSense. As you can see, VS Code is suggesting me the content of comments and…
Armitxes
  • 183
  • 1
  • 10
4
votes
1 answer

Python: determining module name from within C function

My application embeds python. The application extends the embedded python by adding it's own function: PyObject *ReadDPoint(PyObject *self, PyObject *args) Then the application runs different python scripts(modules) which invoke the ReadDPoint…
4
votes
1 answer

How to write a ruby application to be extensible via plugins

For example - If I have an application and I want to create an object that will be imported though a plugin, how would I go about writing that? I've put together an example - It works as I'm intending; however I'm not sure if this is the…
TJ Biddle
  • 6,024
  • 6
  • 40
  • 47
4
votes
6 answers

Reimplementation of inherited interface methods

I did not fully understand using Interfaces, so I have to ask :-) I use a BaseClass, which implements the IBaseClass interface.These interface only contains one declaration : public interface IBaseClass { void Refresh (); } So I have implement…
Kooki
  • 1,157
  • 9
  • 30
3
votes
1 answer

Scala extending the List class with a coalesce preappend method

Im attempting to create a new operator :? on lists, which operates the same as :: except if the value if null, then the original list is returned. I have written the following, however it soon dawned that I didn't really know what I was…
J Pullar
  • 1,915
  • 2
  • 18
  • 30
3
votes
2 answers

Testing a private method in an abstract class extends the other one

I'm trying to test a private method in an abstract class. I've got three abstract classes: abstract class AbstractClass1 extends AbstractClass2 { private function _privateFunction() { //method's body } } abstract class…
faramka
  • 2,164
  • 1
  • 18
  • 21
3
votes
1 answer

Extending Shopware entity with foreign keys fails when merging version

I'm developing my first Shopware 6 admin plugin, for which is required to extend one of the existing Shopware plugins - Custom products. I want to add a relation between already existing entities - TemplateExclusion and TemplateOptionDefinition.…
3
votes
1 answer

Extending Core Edmx, multiple Edmx's in EF4

We have an EF4 EDMX which contains ~300 entities which are used in our core product suite (entities imported from database). When we get new clients, more often than not they want to store extra information and have us develop custom processes which…
Sandy
  • 31
  • 2
3
votes
0 answers

Python - How to import module from .so file from egg file without using an absolute file path

I built the pyahocorasick library with python setup.py bdist_egg command and uploaded it onto Spark for my PySpark job. However, the .so file inside pyahocorasick can't be imported through pkg_resources.resource_filename() method on Spark cluster…
GZ92
  • 151
  • 1
  • 10
3
votes
4 answers

C# Extending Selenium Webdriver Class

I would like to add a static string property that will track the name of the current test running. I figured the best way to go about this was to use the WebDriver since it is the only object that is carried throughout all of my page objects. Is…
Milo
  • 3,365
  • 9
  • 30
  • 44
3
votes
2 answers

Trouble extending ArrayObject::offsetGet() function to return null if item not in array

Originally I was thinking this was going to be a piece of cake.. not for me.. I am trying to extend the offsetGet() function to return null if the item is not in the ArrayObject. So far I can not seem to get it working without errors. php -v: 5.3.29…
RonSper
  • 693
  • 1
  • 7
  • 19
3
votes
2 answers

Extend Java.logging for another log level?

I was wondering, if it is possible to extend the standard java logger (java.util.logging.Logger;) for another logger level. The goal is, that there should show up "ERROR" instead of "SEVERE" in the log files. Is that possible? Or do I have to use…
and0r
  • 305
  • 1
  • 4
  • 13