Posts

javascript - Undefined in store reducer -

im trying write reducer action in angular ngrx store architecture: this reducer: export const registration = (state: any, {type, payload}) => { switch (type) { case 'register_user': console.log('reducer ' + payload, type); return payload; default: return state; } }; and function calling reducer register(user: registrationuser) { return this.http.post(global.api_url+'/register', user) .map(response => response.json()) .map(data => ({type: 'register_user', data})) .subscribe(action => {this.store.dispatch(action); console.log(action)}); } the problem im having in payload undefined. console.log(action); returns object. , console log reducer returns proper action type undefined object 'reducer undefined register_user' i think need map data payload: data: register(user: registrationuser) { return this.http.post(global.api_url+'/register', user) ...

c# - Is there any sense in separating Identity models from business models to separate projects? -

a rather newbie question best asp.net mvc solution architecture is there sense in separating identity models business models separate projects? are there bigger advantages? thanks help i agree coding yoshi business models should have business logic in them. believe asking if should keep identity models , if identity models security logic sure should have identity models encapsulated other business logic. allow business protection , if need update security reason have @ least possible layer business rules , possible business secrets. check out this link best practices identity answers.

javascript - Random Aframe environment -

i want have random scenarios every time enter website. i'm trying return pickscenario variable js script aframe in line <a-entity environment="preset: pickscenario"></a-entity> here's code: <a-entity environment="preset: pickscenario"></a-entity> <script> var scenarios = ['ocean', 'universe', 'forest']; var pickscenario = scenarios[math.floor(math.random()*scenarios.length)]; return pickscenario; </script> i bet quite simple haven't figure out yet. for scripts take effect advised write components, this: <script type="text/javascript"> aframe.registercomponent('randomscenario', { init: function(){ var scenarios = ['ocean', 'universe', 'forest']; var pickscenario = scenarios[math.floor(math.random()*scenarios.length)]; this.el.setattribute('enviro...

java - Unable to mock the findAll() method from JPA Repository with JMockit -

i have service implementation method getone makes call findbyid @ repository layer. (my repository extends jparepository, did not have implement findall myself.) have tried mock findall return new facility code below. new mockup<facilityrepository>() { @mock public facility findbyid(int id) { return new facility(1, new date(), "active"); } }; my issue when invoke getone service implementation, expected mock findall called , mock facility returned. doesn't , leaves me stumped. why isn't mock method being called? very new jmockit, appreciated.

How to disable unit testing for Connect SDK Lite on Android project? -

i have added connect sdk lite sources android project , looking use stream apple tv. chose use sources because project has bunch of libraries sources , dependencies connect sdk conflicting these libraries. way rid of them manually edit connect sdk gradle file. i want disable unit testing connect sdk because don't find relevant small function going using for. our build machines keep failing our project build because of unit tests in connect sdk module failing. don't want bother fixing tests since i'm looking use sdk's functionality. changes can make build.gradle these tests aren't run? here gradle file connect sdk: buildscript { repositories { jcenter() } dependencies { //classpath 'com.android.tools.build:gradle:1.2.3' //classpath 'org.robolectric:robolectric-gradle-plugin:1.1.0' } } allprojects { repositories { jcenter() } } apply plugin: 'com.android.library' //apply plugin...

How to setup multiple gemfire/geode WAN clusters on one machine for testing? -

what's needed run multiple gemfire/geode clusters on 1 machine? i'm trying test using wan gateways locally, before setting on servers. i have 1 cluster (i.e. gemfire.distributed-system-id=1) , running 1 locator , 1 server. i trying setup second cluster (i.e. gemfire.distributed-system-id=2), receive following error when attempting connect locator in cluster 2: exception caused jmx manager startup fail because: 'http service failed start' i assume error due jmx manager running in cluster 1, i'm guessing need start second jmx manager on different port in cluster 2. correct assumption? if so, how setup second jmx manager? your assumption correct, exception being thrown because first members started services ( pulse , jmx-manager , etc.) using default ports already you want make sure properties http-service-port , jmx-manager-port (non extensive list, there other properties need at), different in second cluster. hope helps. cheers. ...

java - After ends method doPost() runs method doGet() without calling this method in StartServlet -

this question has answer here: change default homepage in root path servlet doget 2 answers i want validate information user. if user has been entered , trying enter /login page, forward userpage. as of moment have this: startservlet public class startservlet extends httpservlet { @override protected void doget(httpservletrequest req, httpservletresponse resp) throws servletexception, ioexception { userdto userdto = (userdto) req.getsession().getattribute("userdto"); if (userdto == null) { req.getrequestdispatcher(req.getcontextpath() + "/web-inf/pages/login.jspx").forward(req, resp); } else { req.getrequestdispatcher(req.getcontextpath() + "/checklogin").forward(req, resp); } } } validateservlet public class validateservlet extends httpservlet { @overrid...