Posts

Showing posts from September, 2015

meteor - inserting data to database gives error "insert failed: Method '/texts/insert' not found" -

i have other project broke somehow(i have no idea) , rebuilt app same file names , code , working fine. problem when go insert data database called texts error insert failed: method '/texts/insert' not found not know wrong because copied every line of code previous project , problem came wasn't there before. confuses me when create user accounts accounts.createuser() works fine. sendtext.js import react "react"; import {texts} "./../api/text"; import {withrouter} 'react-router-dom'; import {meteor} "meteor/meteor"; import {accounts} "meteor/accounts-base" class sendtext extends react.component{ send(e){ e.preventdefault(); let message = this.refs.message.value; let name = accounts.user().username if(name != ""){ if(message){ texts.insert({ name, message }); this.refs.m

Python + rope: setting ignored resource patterns? -

the rope documentation says that: each project has set of ignored resource patterns but mention how configure list. how configure list of ignored resources project? every project has hidden subdirectory .ropeproject/ . take @ config.py file there. file documented.

bash - how to run simple php script from Daemon at CentOS? -

i need run simple php script every second in centos. told me should use daemon run php script every second in background. there guide how it? know nothing daemon , when search internet, looks complicated. anyone can help? this current code. keep running when run : php -q /check_status.php but when disconnect server, stops running. should keep running? !/usr/bin/php -q <?php require_once "system/daemon.php"; $daemon_options = array("appname" => "channel_usage"); system_daemon::setoptions($daemon_options); system_daemon::start(); while (true) { //some php code } sleep(1); ?> you can run command nohup infront of it, have continue executing if session ends. example: nohup ping google.com this keep pinging google if close ssh session. or can schedule cronjob doing following (change command own needs): echo "* * * * * /path/to/script.sh" >> /etc/crontab

design - Leaflet.js - How can I draw a polygon that automatically covers a group of markers? -

Image
i´m working leaflet.js , have lot of markers want polygon drawn automatically containing specific group of markers. there´s image: every marker has specific radio, if use it, this: but don't want that, want area contains markers, don't know how can that. you might want create convex hull. https://gis.stackexchange.com/questions/215137/how-to-create-a-convex-hull-with-leaflet-points : "the easiest way javascript use turf.js's convex functionality." a working sample - http://bl.ocks.org/ebrelsford/c31f61d39d2cd559e18a

c - Can't see the error -

for reason, can't see code faulty. #include <stdio.h> #include <stdlib.h> int main() { int age; printf("how old \n"); scanf("%s", &age); if (age > 18){ printf("you may enter \n"); } /* above program runs, prints "you may enter"*/ if (age < 18){ printf("nothing see here \n"); } return 0; } / thanks / hint: $ gcc main.c main.c: in function ‘main’: main.c:10:11: warning: format ‘%s’ expects argument of type ‘char *’, argument 2 has type ‘int *’ [-wformat=] scanf("%s", &age); ^ $

java - Prevent Depth First Search Algorithm from getting stuck in an infinite loop ,8 Puzzle -

so code works basic 8 puzzle problems, when test harder puzzle configurations runs infinite loop. can please edit code prevent happening. note have included code prevents loops or cycles. tried including the iterative depth first search technique, did not work. can please review code. /** implementation depth first search algorithm */ static boolean depthfirstsearch(string start, string out ){ linkedlist<string> open = new linkedlist<string>(); open.add(start); set<string> visitedstates = new hashset<string>(); // prevent cyle or loop linkedlist<string> closed = new linkedlist<string>(); boolean isgoalstate= false; while((!open.isempty()) && (isgoalstate != true) ){ string x = open.removefirst(); system.out.println(printpuzzle(x)+"\n\n"); jtr.append(printpuzzle(x) +"\n\n"); if(x.equals(out)){ // if x goal isgoalstat

android - Getting a error with Firebase Cloud Messaging -

i'm starting firebase , trying kind of complex code saw on tutorial, , error, copied simple code, basic, i'm still getting same error, please me, i'm gonna put firebaseinstanceidservice , firebasemessagingservice , if need further information please let me know. the error i'm getting fatal exception: main process: com.bim.tech.construbimapp, pid: 30988 android.app.remoteserviceexception: bad notification posted package com.bim.tech.construbimapp: couldn't expand remoteviews for: statusbarnotification(pkg=com.bim.tech.construbimapp user=userhandle{0} id=0 tag=fcm-notification:250274573 score=0 key=0|com.bim.tech.construbimapp|0|fcm-notification:250274573|10184: notification(pri=0 contentview=com.bim.tech.construbimapp/0x1090077 vibrate=null sound=null defaults=0x0 flags=0x10 color=0x00000000 vis=private)) @ android.app.activitythread$h.handlemessage(activitythread.java:1638) @ android.os.handler.dispatchmessage(handler.java:111) @ android.

javascript - Dynamically append multiple options selected into one select jquery -

i'm trying add options selected 1 select element another. i'm guessing it'll this. var selected = $("#selectwithoptions").append("<option'>" + options[selectedindex].value + "</option>"); this not work. the logic pretty straight-forward , can follow inline comments in js function: // fire function when dropdown item selected $('#dd1').change(function() { // grab text of selected item var selectedoption = $('#dd1 :selected').text(); // if not in second dropdown list, append if( $('#dd2 option').filter(function () { return $(this).text() == selectedoption; }).length <= 0 ) { $('#dd2').append('<option>'+selectedoption); } }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div>dropdown 1: <select id="dd1"> <option selected disabled>

Calling a Google Script web app only available to users inside domain from another Google Script -

i have google script deployed web app, unfortunately due company policy, have deploy , make available inside domain, not anonymous. here's web app code function dopost(e) { var functionname = json.parse(e.postdata.contents).functionname; return contentservice.createtextoutput(json.stringify({result:functionname})) .setmimetype(contentservice.mimetype.json); } here's google script code i'm trying call web app through it, tried pass access token in request header. function callwebapp(functionname) { var response = urlfetchapp.fetch(url, { headers: { "authorization": "bearer " + scriptapp.getoauthtoken(), }, contenttype: 'application/json', mutehttpexceptions:true, method : 'post', payload:json.stringify({functionname: functionname}), }); logger.log(response) } you can use session service , filter out users not in company domain. for example: var user = session.g

mysql - Inserting information into table in PHP (Issue) -

this question has answer here: fatal error: call member function bind_param() on boolean in php [duplicate] how mysqli error in different environments? 1 answer reference - error mean in php? 29 answers $stm2 = $conn->prepare("insert (onet, twot) values (?, ?)"); $userone ="netsgets"; $usertwo="netsgets2"; $stm2->bind_param('ss',$userone,$usertwo); $stm2->execute(); $stm2->store_result(); the code above should add netsgets , netsgets2 table of together. reason error. fatal error: call member function bind_param(). mean?

testing - How to test for leaking connections in a Go test? -

Image
after i've found leaks in program, i've solved problem. however, now i'm trying find out how " test " leaking connections in go test? question. i've tried change number of requests in test, didn't matter. no matter do, current number of tcp connections in test stay same. func testleakingconnections(t *testing.t) { getter := myhttp.new() s := newserver(ok) defer s.close() cur := tcps(t) := 0; < 1000; i++ { r, _ := getter.getwithtimeout(s.url, time.millisecond*10) r.body.close() } tries := 10; tries >= 0; tries-- { growth := tcps(t) - cur if growth > 5 { t.error("leaked") return } } } // find tcp connections func tcps(t *testing.t) (conns int) { lsof, err := exec.command("lsof", "-n", "-p", strconv.itoa(os.getpid())).output() if err != nil { t.skip("skipping test; error finding or

dependency injection - How can I abstract dependent type from base C# base project using microsoft identity framework? -

i have authentication project reuse. i have aspnetcore identity project called authentication intended reusable authentication project. if have looked @ aspnetcore identity implementation see type called usermanager application user class store implementation of user in aspnetusers database table. public class applicationuser : identityuser { } the problem having there controller in isolated authentication project called accountcontroller holds logging in/out, registering, , other related account actions. wish abstract application user out of project's class can change based on needs of project multiple solutions. the authentication project has startup class initiated follows within project in being used: authenticationstartup.configureservices<applicationuser, mydatabase> (services, configuration); as can see, subscribing project adds own implementation of applicationuser. next, comes configuration of identity references tapplicationuser in services.add

eclipse - JSP not picking up CSS file -

i have created simple dynamic web project in eclipse mars, using spring. jsp referring css file css file not getting pickup. eclipse project folder structure: enter image description here here how, referring in jsp: my project structure same yours , refer css file via: href="css/anotherstylesheet.css"

php - passing variable value into where condition laravel 5.2 -

Image
im trying make condition variable value this. rekapcontroller@show public function show($tanggal) { $absen = absen::where('date(created_at)', '=', $tanggal) ->get(); } but when run code, show error column not found: 1054 unknown column 'date(created_at)' in 'where clause' (sql: select * absen date(created_at) = 2017-08-17) thanks you can used $absen = absen::where(db::raw("date_format(created_at,'%d/%m/%y')"), '=', $tanggal) ->get();

Name for domain service -

imaging have domain model named " service ". in case have domain service name " serviceservice " , it's confusing name. is alternative name "service"? why need add "service" it's name? , why name "service"? naming 1 should find out (single) responsibility of domain service. example, have goodservicepayingcustomerfilter or invoiceforservicegenerator .

sql server - Use Always Encrypted on decimal(18,2) -

i using new sql server 2016 feature - encrypted. cool , simple technology - not decimal type. when insert value, getting errors 1 ( zp_test - db name): operand type clash: decimal(4,2) encrypted (encryption_type = 'randomized', encryption_algorithm_name = 'aead_aes_256_cbc_hmac_sha_256', column_encryption_key_name = 'colomnkey', column_encryption_key_database_name = 'zp_test') incompatible decimal(18,2) encrypted (encryption_type = 'randomized', encryption_algorithm_name = 'aead_aes_256_cbc_hmac_sha_256', column_encryption_key_name = 'colomnkey', column_encryption_key_database_name = 'zp_test') statement(s) not prepared. my api written in c#, please see code maybe know solution. sql query creating table create table [dbo].[empinfo] ( [empid] [int] null, [natid] [nvarchar](max) collate cyrillic_general_bin2 encrypted (column_encryption_key = [colomnkey], encryption_type = randomized, algorithm

DataNucleus: duplicate plugin.xml in multiple jars on android -

on android, build apk: duplicate plugin.xml in following jars. compile group: 'org.datanucleus', name: 'datanucleus-core', version: '5.1.1' compile group: 'org.datanucleus', name: 'datanucleus-api-jpa', version: '5.1.1' compile group: 'org.datanucleus', name: 'datanucleus-rdbms', version: '5.1.1' how solve this? merge them? update merged 3 jars , plugin.xml described 1 jar, , created manifest.mf inside merged jar described. bundle-symbolicname: org.datanucleus;singleton:=true premain-class: org.datanucleus.enhancer.datanucleusclassfiletransformer when building android apk, jar manifest.mf discarded android build. @ runtime: java.lang.noclassdeffounderror: failed resolution of: lorg/datanucleus/enhancement/detachable; is error related manifest.mf? there workaround? example, rename manifest.mf can included in apk.

reactjs - Is React implementing the Actor Model? -

the actor model asserts individual actors can only: receive messages modify own local state create actors send messages actors addresses have received or have created. react asserts components can only: receive data through props modify own local state only send messages components have created passing props. in sense, react implementing subset of actor model, albeit in 1 direction (parent child)?

xamarin - How can we perform an action when as switch is changed in a TableView List? -

our application displays list of category groups: list<categorygroupwordcountvm> categorygroups; on screen looks this: sports 23 [switch on] hobbies 5 [switch on] countries 55 [switch on] occupations 0 [switch off] the rows objects this: public class categorygroupwordcountvm : observableproperty { public int id { get; set; } public string name { get; set; } public bool istoggled { get; set; } } page xaml: <contentpage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:japanese;assembly=japanese" x:class="japanese.categorygrouppage" x:name="categorygrouppage"> <contentpage.content> <tableview x:name="tableview" intent="settings"> </tableview> </contentpage.content> </contentpage> row xaml: <viewcell

Indefinitely returning the next Monday, Wednesday and Friday with Javascript or PHP -

i want indefinitely print next monday, wednesday , friday on webpage. at moment using javascript unsure how proceed days of following weeks. function nextmon(date) { var ret = new date(date||new date()); ret.setdate(ret.getdate() + (1 - 1 - ret.getday() + 7) % 7 + 1); return ret; } function nextwed(date) { var ret = new date(date||new date()); ret.setdate(ret.getdate() + (4 - 1 - ret.getday() + 7) % 7 + 1); return ret; } function nextfri(date) { var ret = new date(date||new date()); ret.setdate(ret.getdate() + (5 - 1 - ret.getday() + 7) % 7 + 1); return ret; } function nextsession(date){ var today = new date(date||new date()); //monday - wednesday if(today.getday() >= 1 && today.getday() < 3){ return nextwed(); } //wednesday - friday else if(today.getday() >= 3 && today.getday() < 5){ return nextfri(); } else{ return nextmon(); } } setinterval(fu

Cannot edit MySQL table from Excel -

i've got table in mysql non-null primary key field. i've selected within excel file option edit database table. when entering data cell , selecting "commit" changes, error , change not go through. i've tried deleting tab , trying again, or trying new excel file, , neither approach works. when looking @ sql string sent database confusing me. essentially, statement standard update db_name.table_name set 'change_col' = "new_val" <where clause> except <where clause> nuts. first operand i'd like, i.e. equality of primary key on value corresponding edited row, huge mess of nested conjunctions , disjunctions on other fields follows. , isn't might expect. example, i've got trans_num field , on edited row value 22 . reason <where-clause> contains and ((22 null , `trans_num` null) or `trans_num`=22) which quite bizarre. i haven't seen questions online, i'm not sure causing behavior or how can fix

javascript - PHP Post and and print to innerHTML -

i trying post employee sql , display employee data after submit has button. can post , display not both @ same time. way should jsbin: https://jsbin.com/nenupupifo/edit?html,js,output when implement php code post employee database refreshes form , not display output information. there better way this? var employees=[]; function process() { 'use strict'; var firstname = document.getelementbyid('firstname').value; var lastname = document.getelementbyid('lastname').value; var department = document.getelementbyid('department').value; // 2) create employeeid variable , store randomly generated 8 digit employee id number. make sure id number unique. var employeeid = parseint(math.random() * 100000000); // reference output goes: var output = document.getelementbyid('output'); // 3) add employeeid property employee object , set value employeeid variable. // 4) make employee object json object , send end json object. var employee =

javascript - All set But my Moving rainbow canvas not working -

there 1 canvas , 4 buttons. 4 buttons circle,rectangle,square , animated rainbow. when click on cicle button in canvas circle show.and when click on rectangle button rectangle canvas show on canvas. i done code moving rainbow on jsfiddle . when run code on local sublime. code not work. can me solve problem. here code: function circle() { create(); var c = document.getelementbyid("main_canvas"); var ctx = c.getcontext("2d"); ctx.fillstyle="#ff0000"; ctx.strokestyle="#ff0000"; ctx.beginpath(); ctx.arc(500, 235, 90, 0, 2 * math.pi); ctx.stroke(); } function rectangle() { create(); var c = document.getelementbyid("main_canvas"); var ctx = c.getcontext("2d"); ctx.rect(300, 180, 250, 100); ctx.fillstyle="cyan"; ctx.strokestyle="#ff0000"; ctx.stroke(); } function square() { create(); var c = document.getelementbyid("main_canvas"); var ctx = c.g

string - Using python and postgres, variables within execute function? -

i had question regarding usage of variables inside python function accesses postgresql server. example, following: def delete(): cur.execute( """delete potluck name = var_1;""" however, if wanted update function take in variables var_1, how so? for example, want function in form: def delete(var_1): cur.execute( """delete potluck name = %s;""", (var_1)) however, typing didn't work. in addition, how in case when: def delete(name, var_1): cur.execute( """delete potluck %s = %s;""", (name, var_1)) where don't want "name" have quotation marks when inserted string? any appreciated! to pass identifiers use psycopg2.extensions.asis from psycopg2.extensions import asis def update(table_name, var_1, var_2): cur.execute(""" update %s set %s = 'y' %s = 'john';

Converting from jsonschema to swagger 2.0 -

new swagger , know if there way convert , existing jsonschema model swagger specification. you try swagger toolbox - https://swagger-toolbox.firebaseapp.com/ in own words, swagger toolbox - utility saves time converting json swagger compatible yaml models

asp.net mvc - C# MVC multipletabs session issue -

we facing 1 issue user using multiple tabs, each tab share 1 session particular user want each tab have unique session, have session mode in "inproc" added cookieless="useuri" i.e. sessionstate mode="inproc" cookieless="useuri". adding helped each tab having unique session worked in ie private mode not in ie normal mode, chrome & firefox, gets stuck on login page, our login method azure active directory i.e. (federation)authentication, page keeps loading , not moving homepage of our application, don't know what's going on please help. fyi, storing class properties in session using sessionstate mode="inproc" cookieless="useuri" or bad way? here code have used aad authentication public void configureauth(iappbuilder app) { app.setdefaultsigninasauthenticationtype(cookieauthenticationdefaults.authenticationtype); // authentication type cookies app.usecookieauthentication(new cookieauthenticationop

java servlet - Registration issue -

package jdbc; import java.io.ioexception; import java.io.printwriter; import java.sql.*; import static java.lang.system.out; import java.util.logging.level; import java.util.logging.logger; import javax.servlet.servletexception; import javax.servlet.http.httpservlet; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; public class registration extends httpservlet { protected void processrequest(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { response.setcontenttype("text/html;charset=utf-8"); try { string name = request.getparameter("name"); string email = request.getparameter("email"); string pass = request.getparameter("password"); string sql="insert regis(name,email,password) values(?,?,?)"; class.forname("com.java.mysql.driver");

Azure OpenId Token validation -

i new azure, tokens , on... have "digged" microsoft documentation , google , stackoverflow, still didn't full understanding. so using openid owin library connect azure web app(vs2013 .net 4.5.1). , have next code it: public void configuration(iappbuilder app) { app.setdefaultsigninasauthenticationtype( cookieauthenticationdefaults.authenticationtype); app.usecookieauthentication(new cookieauthenticationoptions()); app.useopenidconnectauthentication( new openidconnectauthenticationoptions { metadataaddress = string.format(aadinstance, tenant, policy), authenticationtype = policy,                clientid = clientid, redirecturi = redirecturi, postlogoutredirecturi = redirecturi, notifications = new openidconnectauthenticationnotifications { a

proc - PHP Script hangs when passing a param to process -

i have downloaded open-source terminal emulator github , modified little. class running process looks this: <?php class cprocess { const proc_ok = true; const proc_failed = false; private static $instance = null; public static function factory() { if (!isset(self::$instance)) { self::$instance = new cprocess(); } return self::$instance; } private $pipes; private $process; private $stdinref; private $stdoutref; private $stderref; private function __construct() { } public function __destruct() { return $this->close(); } public function open($command) { $spec = array( array("pty"), // stdin array("pty"), // stdout array("pty") // stderr ); if (!$this->process = proc_open($command, $spec, $this->pipes)) { return self::proc_failed; } $this->s

Insert record into mysql with Jquery drag and drop -

i n need of inserting / updating records when drag , drop list items 1 other. good, list items dragged , dropped around, can't update database record. can me please? frustrating. i have 4 <ul> tags: <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"></script> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <style> #sortable0, #sortable1, #sortable2, #sortable3 { list-style-type: none; float: left;

firebase select count for 1 day -

Image
so lets have few of data on 1 day , set of data on day. these data store in same table. there way me select count each day: lets day 1 has 20 counts , day 2 has 13 counts? the easiest way add child object. call date , save date yyyymmdd . gives date stamp on each object. then can query like; firebase.database() .ref('/button_log') .orderbychild('date') .equalto('20170818') .once('value') .then(snapshot => { console.log(snapshot.numchildren()); // number of records }); otherwise if don't want new child, try like; firebase.database() .ref('/button_log') .orderbychild('time') .startat('2017-08-10') .endat('2017-08-10 23:59:59') .once('value') .then(snapshot => { console.log(snapshot.numchildren()); // number of records }); edit thomas has suggested use unix timestamp it's more flexible. when savings data set created timestamp firebase.d

powershell - Script to organize folders -

i need organize many folders, folders must have kind of format in names. need rename them , put them this: parent folder 2nd name + "_" + 2 digits + "_" + folder name this needs happen every folder .ps1 executed. here better explanations, here have folders: 00_00_master folder +- 00_01_activities `- 00_02_schedules +- 02_00_dir1 `- 02_01_dir2 as can see, subfolders inside 00_02_schedules start 2nd "name" . etc, folders (never files). better explanation, added (it happen lot) 3 more folders inside 00_02_schedules. should (before , after executing .ps1) before: ... `- 00_02 schedules +- 02_00_dir1 +- 02_01_dir2 +- dir3 +- 12345dir4 `- 01_01_dir5 after: ... `- 00_02 schedules +- 02_00_dir1 +- 02_01_dir2 +- 02_02_dir3 +- 02_03_dir4 `- 02_04_dir5 i try explain little (i put code had, when think useless now) $var1 = 0 $var2 = 0 # has work in same place, never fixed path # c:\users\etc\etc $a

jpa - Orphan removel behaving weirdly , removing the other child records too -

orphan removel removes child records, removing needed child records example if customer has 3 orders a, b, c , if customer removes order c , adds order d after merging have 1 order d. a, b got removed, before merging see list size 3, missing here @onetomany(mappedby = "lgrule", orphanremoval = true, cascade = cascadetype.all) private list<lgarrangment> lgarrangements; and child table @entity @table(name = "lg_arrangement") public class lgarrangement implements serializable { private static final long serialversionuid = 1l; @embeddedid private lgarrangementpk id; // bi-directional many-to-one association lgrule @manytoone @joincolumn(name = "lg_rule_id") private lgrule lgrule; ... any insights helpfull, thanks

api - Where do I retrieve the photo_reference value to make a Google Places Photos request? -

from google's place photos documentation should able retrieve photo_reference key making request nearby search, radar, or place details services. i'm hitting place details service, , i'm receiving array of photos 10 elements, these elements contain height , width , , html_attribution keys. missing here or has api changed without updating documentation? here's request place details, place response: export function placedetailsfetchdata(placeid) { return (dispatch) => { const request = { placeid }; const service = new google.maps.places.placesservice(document.createelement('div')); service.getdetails(request, (place, status) => { if (status == google.maps.places.placesservicestatus.ok) { dispatch({ type: place_details_fetch_data_success, place }); } else { dispatch(placedetailshaserrored(true)); } }); } } here's photos value in response: [ { "h

python - Create layer of any shape in NumPy -

Image
i create layered model this: import numpy np import pandas pd import matplotlib.pyplot plt = np.full((9,10),1) a[:5,] = 1 a[5:10,] = 2 print(a) plt.imshow(a) >>> output: [[1 1 1 1 1 1 1 1 1 1] [1 1 1 1 1 1 1 1 1 1] [1 1 1 1 1 1 1 1 1 1] [1 1 1 1 1 1 1 1 1 1] [1 1 1 1 1 1 1 1 1 1] [2 2 2 2 2 2 2 2 2 2] [2 2 2 2 2 2 2 2 2 2] [2 2 2 2 2 2 2 2 2 2] [2 2 2 2 2 2 2 2 2 2]] the result of plt.imshow() shown here . lets consider have 2 vectors: x = np.linspace(0,10,10) z = np.random.uniform(0, 9, size=(1,9)).round(0) where x row, , z column (coordinates if keep simple). how change numpy array in way, assign value=10 corresponding pairs of x , z (x[i],z[i]) = 1? in end can have this . here example of how index numpy arrays using iterables : import numpy np import matplotlib.pyplot plt = np.full((10,10),1) x = np.arange(10) z = np.random.randint(0, 10, size=(1,10)) a[x,z] = 2 plt.imshow(a) plt.show() note how use astype(int) instead o

c# - Automated tests on contracts between microservices? -

say have creditcardservice microservice depends on threedsecureservice microservice, communicating using json. minor changes in api (or implementation) of threedsecureservice silently break creditcardservice (and other potential clients). so, automated tests. i see 2 flawed approaches, , wondering how improve. integration testing in threedsecureservice.tests. the accompanying test project of threedsecureservice have integration test fixed json input. faking out dependencies, run otherwise complete call input, confirming service swallows input. the problem here if fails realize how changes break clients, 'fix' tests match changes. integration testing in creditcardservice.tests. the client 1 wants test assertions threedsecureservice's expected input. however, require client solution include threedsecureservice project, projects depends on. negate many of advantages using microservices! how make assertions client (safeguarding dependency) without break

Wicket CheckBoxMultipleChoice -

how change css style of rendered html of checkboxmultiplechoice? checkboxmultiplechoice renders html output default want change css style of rendered output <div class="ca-info__cat-roles js-roles-1 expanded" wicket:id="categories" id="categoriesb"> <input name="categories" type="checkbox" value="819" id="categoriesb categories_819"> <label for="categoriesb-categories_819">index&gt;root&gt;categorycatalog.png&gt;9</label> <input name="categories" type="checkbox" value="829" id="categoriesb-categories_829"> <label for="categoriesb-categories_829">index&gt;root&gt;tv.png&gt;9</label> </div> i want change styles of inputs , labels, don't know how checkboxmultiplechoice. i have done way. there 2 ways add css in html page . inside style tag add style

authentication - Authenticating users with IdentityServer4 without a Login page -

we built xamarin.forms app operates identityserver4 client using webview implementation approach, worked perfectly. however, apple not accept our app in store because want authentication , new account creation occur within app. therefore, i've been trying post credentials entered within app's login screen identityserver hope can simulate same process occurs when user enters credentials , submits (posts) login page: public async task<iactionresult> authenticate([frombody] userloginviewmodel model) { string result = string.empty; try { if (!string.isnullorwhitespace(model.username)) { userkey user = await _usermanager.findbynameasync(model.username.tolowerinvariant()); if (string.isnullorempty(user?.ssid)) { result = authenticateresultenum.userdoesnotexist.tostring(); } else { var signin_result = await _signinmanage