Posts

Loopback ACL on an individual property? -

it's possible set acl on method basis in loopback. instance can set access levels on find, update, delete etc. there way filter out sensitive properties on models? say want expose user model via rest, want properties protected acl. example maybe don't want expose phonenumber or address if query isn't made owner or administrator. i see 2 different ways achieve this: extend basic user model own remote method findbyid , check user roles, exposing different data them. add "before" remote hook findbyid , check if user $owner - if call next, if not, call custom method returns data want expose public (check out https://docs.strongloop.com/display/public/lb/remote+hooks ), not 100% sure works built in user methods thought hope helps, greetz

c# - Popup in windows phone app -

is possible show popup in windows phone app based on user action, want display 1 pop when user tap once on screen. for example, in windows phone if select text single tap gives copy button popup, wanted display popup when user tap twice. , should work in app, browser, email, message etc if understand correctly, application show "popup" on user action in other applications. far i'm aware not allowed have interaction of kind other applications , there no system api define or add kind of behavior (would security nightmare). can send/share data other applications, or have background tasks can run code in background.

When does angularjs create new scopes -

angularjs seems create new scopes, in there parent scope, child scope, , sibling scope. what determines when new scope created? example, if use ng-inspector view scopes present, there $rootscope, , other scopes, not obvious me other scopes correspond to, nor clear me when these other scopes created/destroyed. believe created/destroyed because $id changes. changes occur if navigate around , press forwards/back. angular creates new scope every instantiated controller on part of dom. angular creates scope every directive (except scope:false, means directives isolated scope, , scope:true). scope created built in directives such ng-repeat creates scope every repeated item. also when use ng-if directive can remove , add parts of dom , when adds controllers , directives add scopes again.

How to implement a retry mechanism in jersey-client java -

i doing http rest api calls using jersey-client. want retry failure request. if return error code not 200 want retry again few times. how can using jersey client for implementing retries in situation, check out failsafe : retrypolicy retrypolicy = new retrypolicy() .retryif((clientresponse response) -> response.getstatus() != 200) .withdelay(1, timeunit.seconds) .withmaxretries(3); failsafe.with(retrypolicy).get(() -> webresource.post(clientresponse.class, input)); this example retries if response status != 200, 3 times, 1 second delay between retries.

C++ Template Classes and Matlab Mex -

i'm wondering if there elegant way write matlab/mex interface templated c++ code. here situation: have written nice set of c++ template classes so: template<footype t> foo{ private: //some data public: //constructors, methods }; template<bartype s> bar{ private: //some data public: //constructors, methods }; template<footype t, bartype s> myclass{ private: foo<t> *d; bar<s> *m; public: //constructors, methods }; if have say, n different footype s , m different bartype s, have n*m different parameter choices myclass ( footype , bartype custom typename s, incedentally). now, if writing c++ program use these classes, simple: int main() { foo<footype1> *f = new foo<footype1>(params); bar<bartype3> *b = new bar<bartype3>(params); myclass<footype1,bartype3> *m = new myclass(f,b); m->dothing(); re...

tv - Panasonic API for Firefox OS Apps -

thanks mdn deployed simple app on panasonic cxw754. far good. i'd have access screen settings brightness etc. there api provided panasonic or can plain firefox os api somehow? i looked @ https://github.com/mozilla-b2g/gaia/tree/master/tv_apps but navigator.mozsettings null , navigator.tv not exist on tv runtime :( you should able change screen brightness using navigator.mozpower.screenbrightness powermanager api. certified apps can access api though.

FHIR: Nested extensions -

what correct representation of multi-level fhir extension? <extension url="http://example.com/dataelement/researchauth"> <extension url="http://example.com/dataelement/researchauth.type"> <valuecode value="local" /> </extension> <extension url="http://example.com/dataelement/researchauth.flag> <valueboolean value="true" /> </extension> </extension> -- or -- <extension url="http://example.com/dataelement/researchauth"> <extension url="http://example.com/dataelement/researchauth#type"> <valuecode value="local" /> </extension> <extension url="http://example.com/dataelement/researchauth#flag> <valueboolean value="true" /> </extension> </extension> in structuredefinition, should url sub-extensions qualified (url: " http://example.com/dataelemen...