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 select comments/show I print information about all the replies that are related to that comment. &...
more »

2017-11-25 15:11 (5) Answers

Upcasting and its effect on the heap

For the following classes: public class Parent { //Parent members } public class ChildA : Parent { //ChildA members } public class ChildB : Parent { //ChildB members } If I upcast ChildA or ChildB instance to a Parent instance, then I can't acce...
more »

2017-11-20 11:11 (4) Answers

MATLAB Warning while saving an object

While saving a Matlab object (which is not a handle or a subclass of Copyable), I get the following warning: Warning: While saving an object of class 'PGP': Undefined function 'copy' for input arguments of type 'PGP'. What does this warning m...
more »

2017-11-16 18:11 (0) Answers

Private module method accessible by module classes

I'm trying to wrap the functionality of a command-line utility (let's call it foo) with a Ruby gem. I'm trying to abstract out some of the functionality into different classes, but I'd like to have the logic which deals with calling out to the system...
more »

2017-11-07 04:11 (1) Answers

Calling parent method from child?

I have studied that when a class inherits from parent class, then all properties & functions of parent class come to child class. Now I have declared a method in parent class so that it remains for all child classes. Now I want to call method of ...
more »

2017-10-27 09:10 (3) Answers

Make application layer loosely coupled

I have a Java Spring-boot application which has layers(packages): Controller(controller class) Service (business logic) Domain (database layer) Inside My Domain I have two database classes MysqlDBManager MongoDBManager I have many classes ...
more »

2017-10-10 09:10 (2) Answers

PHP 7 Bool Type Hint Not Working

Im a bit stumped with a scalar Type Hint issue (which PHP7 should be able to handle). Basically, Im creating a method with the bool type hint to only allow booleans to be passed. However it fails and lets other types like strings passed. I believe in...
more »

2017-09-26 16:09 (3) Answers

method not returning anything

I created a method for returning a certain row and there is no error or anything just the method not returning any data from the database. Here is where I invoke the method: <a class="navbar-brand" href="http://localhost/old marketplace website/...
more »

2017-08-30 03:08 (1) Answers