Data dodania Pytanie
2018-02-14 03:02 PHP Method Chaining setting and getting a value »
I'm currently studying OOP Method Chaining, but I'm having difficulties from making it work. I've created setValue method where it returns a value ba...
(5) odpowiedzi
2018-02-14 03:02 Create environment with variables in Scheme »
I was looking to create something similar to an object or an environment kind of like in OOP This is what I was thinking: (define env (variable 'x 1...
(2) odpowiedzi
2018-02-09 11:02 How to write operator== to work with implicitly casted/constructed types »
Why this does not work, since there is option to 'construct' implicitly? class A {}; template<typename T> class Type { public: Type() = d...
(4) odpowiedzi
2018-02-08 11:02 MVP design pattern issue in Android »
I was doing R&D on MVP and I am thinking to use this design pattern for my next project. But I am facing a problem with this design pattern. Plea...
(2) odpowiedzi
2018-02-06 20:02 Objects in functional programming - Immutability »
Recently I have been learning to program in Erlang as a long time C and C# developer. I am fairly new to functional programming. Now, I am trying to u...
(3) odpowiedzi
2018-02-06 10:02 Creating a new object from another object's attributes in rails »
Before introducing strong params it was working fine. So, on creating a new object using new and passing attributes, id was being set as nil. But no...
(2) odpowiedzi
2018-01-20 05:01 What is the point of OOP visibility in PHP when Closures and Reflections are available? »
Consider this code here: final class TinkerWithMe { protected $key1 = 19; private $key2 = 88; } $class = new TinkerWithMe(); $getKeys = fun...
(2) odpowiedzi
2018-01-19 13:01 Derived property does not get initialized from parent constructor »
In my general controller GeneralController: use App\Http\Controllers\Controller; class GeneralController extends Controller { protected $onLine =...
(3) odpowiedzi
2018-01-19 10:01 How to bind partial function as method on Python class instances »
I want to bind this function as a method on some class: def foo_method(msg, self): print self.prefix + msg This works: class A(object): pr...
(1) odpowiedzi
2018-01-15 12:01 python: bookkeeping dependencies in cached attributes that might change »
I have a class A with three attributes a,b,c, where a is calculated from b and c (but this is expensive). Moreover, attributes b and c are likely to c...
(2) odpowiedzi
2018-01-14 06:01 How to avoid overriding superclass initializer »
I need to initialize Place object using the init method from its superclass GMSMarker. The problem is that Place also inherits an init method from Bas...
(1) odpowiedzi
2018-01-11 18:01 Interface Dependencies »
When you create an interface and you know you will have a dependency on another, do you make the constructor part of the interface? In my case, I wan...
(4) odpowiedzi
2018-01-09 12:01 OOP-Design for validating user input »
Currently, I try to design some things with OO principles in mind. So let's say, before processing user input, I need to validate it. According to OO,...
(3) odpowiedzi
2018-01-06 17:01 Python: How to initialise a OOP List with some values already known? »
I am trying to get into Object Oriented Programming but am getting stuck on something which is probably very simple. I want to have an object which is...
(2) odpowiedzi
2018-01-06 07:01 Is it good practice to override non abstract methods »
I have a situation where I need to modify the super class method to have a subclass specific logic, but the methods logic is same for all other subcla...
(4) odpowiedzi
2018-01-05 18:01 django Inheriting from helper class »
I wanted to make wallets for BTC and LTC coins in my models. But since most of the code will be same apart from the coin_name and tx_fees. So, I thou...
(1) odpowiedzi
2018-01-04 22:01 Why can instance methods be called as class methods in Python 3? »
Consider the following class: class Foo(object): def bar(self): print(self) In Python 2 (2.7.13), calling bar() as a class method raise...
(1) odpowiedzi
2018-01-03 19:01 Python multiple inheritance is not showing class variables or method of second inherited base class »
Hello awesome community, I was learning the OOPS concepts with python as a part of my curriculum. I am having a problem with multiple inheritance in p...
(5) odpowiedzi
2018-01-01 20:01 How can I create lots of objects with different property values? »
I'm programming in C# and I want to instantiate lots of new objects to my application, all of the same type, but with different values for their prope...
(6) odpowiedzi
2017-12-31 16:12 Is this Simple Factory violating the Open Closed Principle? »
Is this Simple Factory violating the Open Closed Principle? The SimpleProductFactory needs to change every time a new concrete product needs to be cr...
(4) odpowiedzi
2017-12-25 05:12 More readable JavaScript code is slower? »
I came across this small JavaScript Program (on Khan Academy) written by someone else: /*vars*/ frameRate(0); var Sz=100; var particles=1000; scale(4...
(0) odpowiedzi
2017-12-19 07:12 How can I use an object literal to make an instance of a class without useing the constructor in JavaScript ES6? »
I am trying to learn JavaScript ES6 which is a very cool language and I thought that I should practice a bit but I am not able to make an exercise. So...
(2) odpowiedzi
2017-12-17 16:12 Calling custom method from within a Ruby core class »
TL;DR; How can I call a method (written in the middle of nowhere) from within a Ruby core class? I'm writing a script that manages text files. Here...
(2) odpowiedzi
2017-12-11 16:12 Can a class and a function have a common name in Python? »
It looks like there is a function as well as a class associated with the name cv2.VideoCapture. Is it possible for a class and a function that share ...
(2) odpowiedzi
2017-12-09 22:12 Find max nested list count »
I have this class object called Person public class Person { .... private List<Person> people; .... public List<Person> g...
(4) odpowiedzi
2017-12-09 17:12 Separating software by utils, data classes and "controllers" »
My company creates software that transforms data, for example csv to xml. I noticed that mostly all classes (we use Java) can be assigned to one of th...
(0) odpowiedzi
2017-12-07 22:12 How (and where) to register a custom query method in Laravel »
In my application I needed to retrieve the users who were registered in last 7 days. Later I realized I also need to check for 30 days and 365 days an...
(2) odpowiedzi
2017-12-07 19:12 obj == null vs null == obj »
I have always used to check for null like if(null==obj) When I compiled my code and looked into .class file after decompiling, I could see that my ...
(2) odpowiedzi
2017-12-05 12:12 AOP in plain PHP that doesn't require any PECL-extentions (Go!) - How? »
There is a framework called Go! Aspect-Oriented Framework for PHP And it is made in plain PHP, doesn't require any PECL-extentions and DI-containers ...
(1) odpowiedzi
2017-12-05 07:12 Accessing Model Through Custom Class »
I'm trying to access a model through a class. I'm trying to get this done on a Laravel 5.5 installation. The folder structure is the default except fo...
(2) odpowiedzi
2017-11-30 08:11 What is the concept behind using "use" keyword in different context on laravel? »
I have two queries regarding the use of "use" keyword in php(laravel). Below is a code excerpt from laravel docs: use App\Flight; $flights = App\Fl...
(2) odpowiedzi
2017-11-28 10:11 No use of base object allowed in private inheritance »
I am using private inheritance, and I am surprised to see that in the derived class use of any base object is not allowed. class A; class B : private...
(2) odpowiedzi
2017-11-27 09:11 Accessing public static members of a base class specified as private »
I'm learning C++. The documentation docs.microsoft.com/en-us/cpp/cpp/member-access-control-cpp says: When you specify a base class as private, it ...
(2) odpowiedzi
2017-11-27 09:11 Ruby on rails active record queries which one is efficient »
I was recently working on a project where I faced a dilemma of choosing between two ways of getting same results. Here is the class structure: class ...
(5) odpowiedzi
2017-11-25 15:11 Rails has_many error - Couldn't find ID »
I have a Comment and Reply. comment has_many replies routes.rb resources :comments do resources :replies end When I open comments/index and then...
(5) odpowiedzi