Posts

Showing posts from March, 2015

android - PHP Firebase Clood Messaging (FCM) error missing registration -

i building push notification server fcm server. getting following errors: error=missingregistration my php code given below. function send($id,$title,$text){ $msg = [ 'title' => $title, 'body' => $text, 'icon' => 'myicon', 'sound' => 'mysound' ]; $fields = [ 'to' => $id, 'notification' => $msg ]; $headers = [ 'authorization: key=' . $api_key, 'content-type: application/json' ]; $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt ( $ch, curlopt_post, true ); curl_setopt ( $ch, curlopt_httpheader, $headers ); curl_setopt ( $ch, curlopt_returntransfer, true ); curl_setopt ( $ch, curlopt_postfields, $fields ); $result = curl_exec ( $ch ); curl_close ( $ch ); echo $result; } i calling function this: send($id,$title,$text); for sending data fcm need create json data. please add line after field...

javascript - jquery datatable retain row highlight after reload -

i reloading datatable on 10 second intervals. when user clicks on row, row highlight. when datatable reloads, highlight gone. here shortened code datable: $(document).ready(function() { // set datatable $('#example1').datatable({ "ajax": { "url": "api/process.php", "type": "post", "datasrc": '' }, "columns": [ { "data": "" }, { "data": "column1" }, { "data": "column2" }, { "data": "column3" } ], "idisplaylength": 25, "order": [[ 6, "desc" ]], "scrolly": 600, "scrollx": true, "bdestroy": true, "statesave": true }); // reload datatable every 30 seconds setinterval(function() { var table = $('#example1').datatable(); table.ajax.r...

java - How to resolve javax.xml.bind.UnmarshallException? -

i new restful web services , after going through documentation in state invoke web service. looks receiving 200 status service producer when @ response object getting javax.xml.bind.unmarshallexception . exception when code reaches read entity. little lost not sure or @ in order resolve error. xml representation of object @xmlrootelement( name = "somethig", namespace = "http://respone.something.com" ) @releaseinfo( version = "v4", description = "response validate email service" ) public class thirdpartyvalidateemailaddressresponse extends baseresponse { private string emailaddressprovided; private string emailaddressreturned; private string mailboxname; private string domainname; private string topleveldomain; private string topleveldomaindesc; private boolean syntaxcorrected; private boolean casestandardized; private boolean domainnameupdated; client code: public validateemailaddressserviceresponse validateemailaddress( validateema...

mysql - Sub-Select required in Sequelize include -

i have ignore rows fetched include in sequelize query. friend showed me how work in sql have no idea how map sequelize. i tried things group , distinct, don't work required. this sequelize query: surveysuggestdate.findall({ where: { surveysforeignkey: survey.surveysid }, include: [ { model: surveytime }, { model: surveyanswer } ], order: [ [ 'date', 'asc' ] ] }).then((datetimeanswers) => { resolve(datetimeanswers); }).catch((error) => { reject(error); }); the model surveytime has column "time" appears @ least twice in database. have ignore these records , use latest one. this sql code generated sequelize code above: select `surveysuggestdate`.`suggestdate_id` `suggestdateid`, `surveysuggestdate`.`date` `date`, `surveysuggestdate`.`datestring` `datestring`, `surveysuggestdate`.`fieldcnt` `fieldcount`, `sur...

Why sequential code outperfom parallel code in R -

i converted serial code parallel, don't know why parallel code takes longer sequential code. in sequential takes few seconds while in parallel takes 8 9 minutes. how can improve code? i able create similar problem original one. here code. data structure same in original problem , can't change (i believe). parallel code: rm(list=ls()) library(foreach); library(doparallel) cores<-16 c1<-makecluster(cores) registerdoparallel(c1) cases<-64 prev<-list() (i in 1:cases) prev[[i]]<-c(110, 1340, 4560, 230, 10) #mimicking original problem #=========================================== out<-list() (i in 1:cases) out[[i]]<-list() out1<-matrix(0,nrow=131041,ncol=6) (i in 1:cases){ out1[,]<-runif(6*131041,1,100) out[[i]]<-rbind(out[[i]],out1) } #=========================================== y1<-y2<-y3<-y4<-y5<-c(0) tol <- 1e-3 time1<-sys.time() status<-foreach (j = 1:cases, .combine='rbind', .inorder=false) %dopar%...

.net - Get name of column from PowerShell sql query -

i'm running sql query powershell. can row data , number of columns correctly, need gather name of columns sql table generated in query. example, if table looked this: column1 column2 1 |row1item1 |row1item2 | 2 |row2item1 |row2item2 | 3 |row3item1 |row3item2 | then values need "column1", "column2". code have below tell me there 2 columns, don't know how names of columns. $cmd = new-object system.data.sqlclient.sqlcommand($sqlquery, $connection) $connection.open() $reader = $cmd.executereader() $reader.fieldcount #returns number of columns --> 2 use sqldataadapter.fill() instead of reader. way can have script populate datatable object retain column names: $cmd = new-object system.data.sqlclient.sqlcommand($sqlquery, $sqlconnection) $sqlconnection.open() # create adapter, associate command $adapter = [system.data.sqlclient.sqldataadapter]::new($cmd) # create empty datatable $datatable = new-object system.data.datatable ...

javascript - Firing GTM event and simultaneously updating history API with replaceState -

when firing gtm tag this: datalayer.push({ 'event': 'gtm.trackevent', 'eventcategory': 'offices', 'eventaction': 'search', 'eventlabel': '1234ab', 'eventnoninteraction': 1 }); while updating url bar history api so: window.history.replacestate({}, '', '/offices?office=1234ab'); the url bar behaves unexpectedly. happens this: the url bar starts current state (e.g. /path?office=current-param the url bar gets replaced history api (e.g. /path?office=1234ab) the url bar gets replaced first state of page view (e.g. /path?param=first-state the way when third part doesn't occur, when disable/comment gtm tag. therefore i'm assuming gtm doesn't handle states history api well. i wondering if there possibility disable whatever happens history api inside gtm. update eventcallback property, can ensure whenever event has been fired, histo...

android - Phonegap - where do I put setWebContentsDebuggingEnabled(true)? -

can put me out of misery , tell me java file i'm supposed put setwebcontentsdebuggingenabled(true); in, allow remote debugging? i've found ton of articles on this, 3 or 4 years old , referencing files don't seem exist in modern pg/cordova environments (examples: cordovawebview.java; mainactivity.java).

javascript - Change div color on checking all check boxes in hidden form -

have several problems , can't find solution. code https://jsfiddle.net/46qybyrh/2/ upper table html <div class="block"> <table> <tr> <th>nr.</th> <th style="width: 200px">task</th> <th>progresas</th> <th></th> </tr> <tr> <td>1</td> <td>air port scedules</td> <td>0/3</td> <td> <button onclick="showdiv()">expand</button> </td> </tr> </table> hidden div <div id="popup" class="popupbox"> <table class="block"> <tbody> <tr> <td></td> <form> <td>xml</td> <td> <span>comment</span><br> ...

loopbackjs - loopback 2 - defining an array of objects on a model -

if have usermodel , define: "events": { "type": [ "object" ] }, do need define else in usermodel.js able post things like: [{name: 'sample', ...}, ...] user table's events column? i ask because if remove particular definition .json app compiles , database migrates, in, app compiles database states there issue users findbyid . debugging has narrowed down particular set of code. i think can use structure { "events":{ "type": [ { "key": "type", "key2": "type" } ] } } you can see .js example here , .json example here . can see issue implementation here says this model has problem. when fetch data call, renders particular field ["object object"] though data saved in database. which recommend try on own depend lot on versions , drivers. though ask kind of database using?

How to create group push for android 4.4.2? -

i want create group push same notification. code works on android 7.0, doesn't worked android 4.4.2. private static int notification_id = new random().nextint(); private void sendandroidnoticiation(intent[] intents, string title, string text, bitmap image, string group) { if (image == null) image = bitmapfactory.decoderesource(getresources(), r.mipmap.ic_launcher); pendingintent pendingintent = pendingintent.getactivities(this, ++notification_id, intents, pendingintent.flag_one_shot); uri uri = ringtonemanager.getdefaulturi(ringtonemanager.type_notification); notificationcompat.builder mbuilder = new notificationcompat.builder(this) .setsmallicon(r.drawable.ic) .setlargeicon(image) .setcontenttitle(title) .setcontenttext(text) .setsound(uri) .setautocancel(true) .setcontentintent(pendingintent) .setsmallicon(r.drawable.ic) .setcategory(n...

javascript - React Native Dynamic Checxbox -

i new in react native. have problem when try dynamically checkbox in react native. checkbox cannot checked, data shown. please me, code: constructor(props) { super(props); this.state = { loaded: false, datagedung : null, datasource: new listview.datasource({ rowhaschanged: (row1, row2) => row1 !== row2, }), books : [], }; this.fetchdata = this.fetchdata.bind(this); this.togglecheck = this.togglecheck.bind(this); this.renderbook = this.renderbook.bind(this); }

reactjs - Need a workaround for Adobe SnapSVG-animator running in React.js -

Image
snapsvg extension adobe animate.cc 2017 able create interactivity , animations web. i'm trying use exported snapsvg adobe animate.cc project in react js webapplication. what did far published html file snapsvg project(animate.cc 2017) copyed custom json file created snapsvg project in animate.cc in react app. installed snapsvg npm install in react app. imported js file copyed html publication created animate.cc importing code. ( snapsvg-animator isn't available in npm) the custom json file animate.cc/snap svg project loaded async , added svganim(snapsvganimator.min.js) function object create svg animation in de browser. the code import axios 'axios'; import snapsvg 'snapsvg'; import { svganim } './snapsvganimator.min.js'; let jsonfile = "circle.json", responsetype: 'json'; componentdidmount(){ axios.get(jsonfile) .then(response => { const json = response.request.responsetext; ...

mysql - get rows from two tables using join and sub query -

i have table of persons person_id , person_name another table of person_vehicle_relation pv_id , person_id , vehicle_id, role i want build query in can list of pv_id , person_name where vehicle_id= 3 , role = 'driver' . i have tried join in following way not working. how can desired data? select persons.person_name , person_vehicle_relation.pv_id persons inner join person_vehicle_relations on persons.person_id = (select person_id person_vehicle_relations vehicle_id = 3 , role= 'driver') and error msg 512, level 16, state 1, line 1 subquery returned more 1 value. not permitted when subquery follows =, !=, <, <= , >, >= or when subquery used expression. why need subquery/inline view? simple should work. select p.person_name , pvr.pv_id persons p inner join person_vehicle_relations pvr on p.person_id = prv.person_id pvr.vehicle_id = 3 , pvr.role= 'driver' the reason why had error beca...

symfony - __construct() must be an instance of Doctrine\Common\Persistance\ObjectManager -

i use objectmanger use doctrine .. create instance of objectmanager , create service have bug: catchable fatal error: argument 1 passed tag\tagbundle\form\types\tagstype::__construct() must instance of doctrine\common\persistance\objectmanager, instance of doctrine\orm\entitymanager given, called in /var/www/html/tagproject/var/cache/dev/appdevdebugprojectcontainer.php on line 2412 , defined code tagstype: <?php namespace tag\tagbundle\form\types; use symfony\component\form\abstracttype; use symfony\component\form\extension\core\type\texttype; use tag\tagbundle\form\datatransformer\tagstransformer; use symfony\bridge\doctrine\form\datatransformer\collectiontoarraytransformer; use symfony\component\form\formbuilderinterface; use doctrine\common\persistance\objectmanager; class tagstype extends abstracttype { /** * @var objectmanager */ private $manager; public function __construct(objectmanager $manager){ ...

php - Woocommerce View Order Need to Add Current Currency -

i looking @ view-order.php file within woocommerce , see following action: do_action( 'woocommerce_view_order', $order_id ); this pulls in of details of completed order. need add line within summary shows order's currency. our site works in 2 currencies, usd , cad. appreciated. thanks rob

How to devide data into 10 fold and save in an array in Python -

i have data set don't know number of records in it. want implement cross validation manually, make long story short want devide data 10 fold , save each fold in array or list. should do? appreciate help. you can use this: length = int(len(data)/10) #length of each fold folds = [] in range(9): folds += [data[i*length:(i+1)*length]] folds += [data[9*length:len(data)]] to list of lists containing 1/10th of array or list, last containing remainder.

python - Managing calls to rate-limited API from Flask application -

i have flask application (among other things) must interact rate-limited api ( i.e. , cannot make more x requests api within given unit of time). however, demand flask application makes on api uneven -- demand far exceeds api allow, there's no demand minutes or hours @ time. it's fine calls api occur asynchronously -- there's no need flask application block , wait response. so i'm wondering how best implement this. i'm thinking best approach have separate process fifo queue makes calls @ fixed interval (less limit rate api) -- kind of leaky-bucket algorithm. from multiprocessing import queue q = queue() ... # runs time while true: sleep(some_time) if q.empty() == false: # pop data , use make api call but i'm not sure how set , have flask application interact queue (just pushing new requests on occur). it seems celery (or similar) overkill. should looking python-daemon or creating subprocess multiprocessing.queue? what's b...

mobx - ReactJS handle user Authentication with server-side rendering -

i building reactjs application mobx, , trying make universal app (server-rendering), have issues , questions. first of all, don't know how handle user authentication on server-side rendering. saving before token of user in browser's localstorage, server-rendring, seems cannot access localsotrage through window. fo example if have paths user go if signed in, cannot handle because window undefined. suggestions?

windows - Use space in batch file -

this question has answer here: how write full path in batch file having folder name space? 3 answers i want run this: java -jar c:\users\me\desktop\example.jar @c:\users\me\desktop\my folder\text.txt but error: error: c:\user\me\desktop\my (access denied) obviously, problem space ("my folder"). how can fix this? you can try use double quotes java -jar "c:\users\me\desktop\example.jar" "c:\users\me\desktop\my folder\text.txt"

the following classes could not be found :-android.support.design.widget.NavigationView" -

Image
when use <navigationview /> tag of <navigation drawer /> , right corner of screen shows line: "the following classes not found :-android.support.design.widget.navigationview" so how can fix solution? make sure have added below line in app level build.gradle. compile 'com.android.support:design:26.+' change '26.+' according tarketsdkversion.

Go convert int64 (from UnixNano) to location time string -

i have int64 like: 1502712864232 which result of rest service. can convert string enough. unixnano timestamp. what need convert string related timezone "europe/london". such as:- "14/08/2017, 13:14:24" such produced handy utility: http://www.freeformatter.com/epoch-timestamp-to-date-converter.html would appreciate assistance. ==> update. thanks @evanmcdonnal such useful answer. appreciated. turns out data had not unixnano @ (sorry) milliseconds epoch. source jenkins timestamp.... so... wrote following helper function need: // arg 1 int64 representing millis since epoch // arg 2 timezome. eg: "europe/london" // arg 3 int relating formatting of returned string // needs time package. obviously. func getformattedtimefromepochmillis(z int64, zone string, style int) string { var x string secondssinceepoch := z / 1000 unixtime := time.unix(secondssinceepoch, 0) timezonelocation, err := time.loadlocation(zone) ...

javascript - Fill remaining length of array with falsy values using Ramda -

i have array of arrays looks this: const difficulties = [ [true, true], [true], [true, true, true], [true] ] what i’d perform transform on array using ramda, each of sub-arrays filled false , looking this: [ [true, true, false], [true, false, false], [true, true, true], [true, false, false] ] how go doing this? with ramda use r.times , r.propor : const difficulties = [ [true, true], [true], [true, true, true], [true] ]; let difficultiesfilled = r.map(e => r.times(i => r.propor(false, i, e), 3), difficulties); console.log(difficultiesfilled); <script src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.24.1/ramda.min.js"></script> if max length of arrays unknown do: let maxlength = r.reduce(r.maxby(r.length), [], difficulties); and use instead of 3 .

Jasper Reports Missing Bottom Line When Text Wraps -

when you're creating jasper report has rows of reports might have subreport rows, problem can occur when text in 1 of report row cells long , wraps several lines. when happens, bottom horizontal line doesn't drawn. here image 2 report rows, one of has subreport, other of not. 1 without subreport missing bottom horizontal line: missing bottom line a clue in following image, in report has wrapping text have subreport. in case can see little gaps in vertical lines @ level of top of subreport: wrapping text causes gaps what causing this? i'm new jasperreports , have spent quite time looking answer. the 2 files total 1000 lines, , can post of code might suspect. thank you! edit: believe have found culprit: <line> <reportelement positiontype="float" x="0" y="29" width="918" height="1" isprintwhendetailoverflows="true" uuid="b39fe748-fb03-4807-b13a-40bcacc2b53e"> <print...

deployment - How to deploy a Node.js + webpack bundled web app to production? -

i have web app has frontend , backend. want deploy production server. frontend bundled webpack. files go single file in dist folder. folder has index.html file copied project. client access file when uses web app. use babel command bundle server side files lib sub-folder of dist folder. have inside dist folder when build project production. my project has express http server , websocket server. assume deploy server side code pm2 , how serve users client side? need use web server host client side? do? one way is, use nginx web server to route node application. assuming server side code working fine , able serve static/dynamic content backend.

Loading class in Jenkins : No such property for class -

i'm trying load class file in jenkins pipeline. here's code : pipeline{ agent none stages{ stage('testclass'){ agent{ label 'testslave' } steps{ script{ def cl = load 'c:\\users\\test\\desktop\\testclass.groovy' def b = cl.b echo b.greet("test") } } } } here's class file : class a{ def greet(name){ return "greet a: $name!" } } class b{ def greet(name){ return "greet b: $name!" } } // method have nice access create class name object getproperty(string name){ return this.getclass().getclassloader().loadclass(name).newinstance(); } return when build pipeline, gives me groovy.lang.missingpropertyexception: no such property: b class... someone knows why? thx. it worked with: def b = cl.getproperty('b') !

algorithm - Java Performance Very Slow in Competitive Programming -

i've spent hour trying optimize code, yet still seems tle. public static void main(string[] args) { int testcase = sc.nextint(); for(int testcasecount = 0; testcasecount < testcase; ++testcasecount) { int m = sc.nextint(); int r = sc.nextint(); int[] arr = new int[m]; (int = 0; < m; i++) { arr[i] = i; } (int = 0; < r; i++) { int x = sc.nextint() - 1; int index = arr[x]; out.print(index + " "); shift(arr, x, index); } out.println(); } out.close(); } public static void shift(int[] arr, int x, int pos) { for(int = 0; < arr.length; i++) { if(arr[i] < pos) ++arr[i]; } arr[x] = 0; } this original problem i'm trying solve https://open.kattis.com/problems/moviecollection . tried use stack @ first found out that's way slow. in version, made array keeps track of index ith movie box loca...

javascript - Get x and y value of a series in highcharts when curve is being plotted -

i using custom formatter yaxis in highcharts. following gives me current y axis value: yaxis: { labels:{ formatter: function(){ return this.value } } } is there way can access coordinate's x-axis value, , z-axis value inside formatter function? can values, not corresponding x, , z values. first of need check chart object console this; yaxis: { labels:{ formatter: function(){ console.log(this); } } } you can find needed value in object. example; this.chart.xaxis[0].categories[0] give value of first element on xaxis.

sql server - how to make a field auto increment in a table in grails? and when deleted it adjust the other records -

Image
i have table called trip users can create trips, , on edit screen have button users can click on , create legs selected trip. question how make field in triplegs domain auto increment? lets user creates 4 trip legs, stop number field "the 1 wanted auto populate" 1 2 3 4 if user goes , delete trip leg 2 how change stop number in rest 3 legs 1 2 3 instead of 1 3 4 i have agree vahid's comment on original question. preferred approach dynamically set value transient value on domain after sorted collection criteria. if wanted maintain same sort order every time based on leg created sequentially, add 'created_date' column table , sort based on value when list. alternatively, if store stop_number value (which there plenty of reasons why might want to) might want consider following approach: override default delete action triplegs: class triplegcontroller { def delete = { def triplegid = params.triplegid long def tripleg = tripleg.get(tr...

php - How to create Nested Array inside Array with View_ID as common variable -

i want view_id common both objects.i try it. not proper response.there way combine both of them single array how want it: { "success":true, "total":2, "view_id":"v1", "config":[ { "id":"1", "button_id":"acc123_b1" }, { "id":"2", "button_id":"acc123_b2" } ] } here php code: <?php include_once 'dbconfig.php'; if($_server['request_method'] == 'post') { // variables input data $mac_qr_code = $_post['mac_qr_code']; // variables input data $resultarr = array(); $sql = "select * config mac_qr_code='".$mac_qr_code."'"; $result = $conn->query($sql); if ($result->num_rows > 0) { $resultarr = array('success' => true, 'total' => $result->num_rows); while($row = $r...

Is it possible to filter out empty Optionals and map over the present ones in a single line with Java streams? -

i find myself writing code this: return collectionofoptionals.stream() .filter(optional::ispresent) .map(optional::get) .collect(tolist()); but there way compress middle 2 lines single operation? i can this, feels less satisfactory: return collectionofoptionals.stream() .flatmap(o -> o.map(stream::of).orelseget(stream::empty)) .collect(tolist()); it seems possible in java 9, based on this question . return collectionofoptionals.stream() .flatmap(optional::stream) .collect(tolist()); this nicer. have have in java 8.

java - AngularJS Eclipse IDE 1.2.0 - Cannot Convert Dynamic Web Project into AngularJS Project -

strange issue, i'm not sure if has come across it's worth shot. i've been told that, normally, can convert dynamic web projects angularjs projects can allow content-assisting angularjs directives, modules, etc. i can convert normal projects angularjs projects fine, reason cannot convert dynamic web project one. created new 1 entirely, generating deployment descriptor it, , tested out. option not appear. is there i'm missing and, if so, it? i installed angularjs eclipse ide 1.2.0 , have javascript development tools in eclipse (it's part of javascript build eclipse 1.1.0).

javascript - Ionic shows a blank page without any error -

i getting blank pages ionic. no errors show in chrome debugger. , when inspect debugger, saw nothing inside of ion-nav-view, means reason ui router not working. need in figuring out error. here code: index.html: <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> <title></title> <link rel="manifest" href="manifest.json"> <!-- un-comment code enable service worker <script> if ('serviceworker' in navigator) { navigator.serviceworker.register('service-worker.js') .then(() => console.log('service worker installed')) .catch(err => console.log('error', err)); } </script>--> <link href="lib/ionic/css/ionic.css" rel="stylesheet"...

angularjs - Deployment for PHP and Angular JS Based Web Application -

currently have developed web application using php backend , angular js front , have tested app hosting in xampp local server, wanted move real server best way . there build tool available . below details angular js : 1.2.32 php :7.0.22 and application folder structure below css(folder) ->contains css js(folder) -> contains angular js related controllers img(folder) -> contains images index.html -> start page configuration file -> contains credentials info

javascript - Toggling div requires 2 clicks. Should be 1 click -

i got here on hiding div on mobile, there additional issue have. starting learn more javascript, newbie. this working example of content div hidden on mobile unless button clicked. works fine, except takes 2 clicks open div. want 1 click. i’ve seen answers on type of question, , have tried them beyond ability understand right now. i’m not getting it. how rework script takes 1 button click open div? thanks! function togglegallery() { var x = document.getelementbyid('image-gallery'); if (x.style.display === 'none') { x.style.display = 'block'; } else { x.style.display = 'none'; } } #image-gallery { display: block; width: 600px; border: 1px solid black; } #image-gallery li { width: 150px; height: 150px; color: white; text-align: center; margin: 10px; background-color: gray; display: inline-block; } button { display: none; } @media (max-width: 600px) { #image-gallery { ...

tsql - Modulo seems to not be working in SQL Server 2012 -

i have simple select statement uses 1 table. 1 of columns take value of column, divides it, modulo after end decimal. why modulo not working? select (numeric_datatype_column / 10000) % 100 table all of values coming out decimals. shouldn't modulo give me integer? shouldn't modulo give me integer? no. modulo returns remainder of value after division. if value decimal value, modulo return decimal component. not truncated. as working example: select (123.1234 / 10) % 5 2.3123400 if want remove decimals, can convert result int , modulo: select convert(int, (123.1234 / 10)) % 5 2

How can I classify each comma-separated value of CSS styles so that they can be accumulated? -

for example, i want make elements like: <div style=" transition: opacity 250ms linear, background-color 250ms linear; "></div> <span style=" transition: opacity 250ms linear, color 250ms linear; "></span> , , classify styles make them( css classes ) easy reuse: .smooth-opacity-change {transition: opacity 250ms linear;} .smooth-color-change {transition: color 250ms linear;} .smooth-background-color-change {transition: background-color 250ms linear;} ; write it: <div class="smooth-opacity-change smooth-background-image-change"></div> <span class="smooth-opacity-change smooth-color-change"></span> but they're exclusive; transition style can have multiple values, 1 transition style can applied. how can solve problem, or discouraged by design ? thank comment, marvin . unfortunately, seems css still have long way go. wish someday experience evolution...

javascript - How can I add an image from my computer behind an already set image with Fabric.JS? -

Image
i have image frame transparent inside. set background of canvas css. i'm able add images canvas able add 1 image @ time behind transparent portion of frame. how might accomplish this? thank in advance! var id = document.getelementbyid('rectangle') && rectangle || document.getelementbyid('anothercanvas') && anothercanvas; var canvas = new fabric.canvas(id); document.getelementbyid('file').addeventlistener("change", function (e) { var file = e.target.files[0]; var reader = new filereader(); reader.onload = function (f) { var data = f.target.result; fabric.image.fromurl(data, function (img) { var oimg = img.set({ width: 125, height: 170 }) canvas.add(oimg).renderall(); var = canvas.setactiveobject(oimg); var dataurl = canvas.todataurl({ format: 'png', ...

Using ansible playbook to edit config file inside running docker container -

i have searched , found few modules/plugins docker_image , docker_service handle docker images , containers. want edit configuration file(any application specific/service ) inside running docker container using ansible playbook. there module available ? if have python executable inside container , run ansible on same host docker daemon, can use docker connection plugin run tasks inside containers. test this: ansible -c docker -i 'mycontainer,' -m copy -a 'content=hello dest=/tmp/world'

scala - interpolation out of range apache -

i interpolation outside of known range. instance, need interpolated value point index 0. here code: import org.apache.commons.math3.analysis.interpolation.splineinterpolator val = array(0.4, 0.6, 0.8, 1.0) val b = a.zipwithindex.map(i => (i._2.todouble + 1.0, i._1)) val interp = new splineinterpolator() val filler = interp.interpolate(b.map(_._1), b.map(_._2)) println(filler.value(0.0)) however, following exception (exception in thread "main" org.apache.commons.math3.exception.outofrangeexception: 0 out of [1, 4] range...). there way interpolated value?

OAuth with Azure AD v2.0: What is the ext_expires_in parameter returned by Azure AD v2.0 in response to access token requests? -

according azure ad documentation , section “request access token” describes parameter keys should returned azure ad in response access token requests via azure v2.0 endpoint https://login.microsoftonline.com/{my_tenant}/oauth2/v2.0/token . example of response body returned azure ad v2.0: "token_type": "bearer", "scope": "user.read", "expires_in": 3599, "ext_expires_in": 0, "access_token": "eyj0exaio ...", "refresh_token": "oaqabaaaaaaa9ktklh ..." "id_token": "eyj0exaioijkv1qilc ..." the documentation not mention ext_expires_in 1 of returned parameters. questions are: what definition of key? what kind of other expiration ext_expires_in describe in addition current expires_in key does?

postgresql - Postgres: How to change the case of JSON keys? -

my address column being stored json using format: { "street1": "800 smithe st", "street2": null, "city": "vancouver", "region": null, "state": "bc", "zip": "v6z 2e1" } how can change column values camel case / lowercase, appear this? { "street1": "800 smithe st", "street2": null, "city": "vancouver", "region": null, "state": "bc", "zip": "v6z 2e1" } with j(j) ( values ($$ { "street1": "800 smithe st", "street2": null, "city": "vancouver", "region": null, "state": "bc", "zip": "v6z 2e1" } $$::jsonb)) select json_object_agg(lower(key), value) j, jsonb_each(j) je group j; ...

ios - Error: removing the root node of a scene from its scene is not allowed -

i getting error @ last line of code. - (scnscene *)getworkingscene { scnscene *workingsceneview = self.scene; if (workingsceneview == nil){ workingsceneview = [[scnscene alloc] init]; workingsceneview.background.contents = self.skycolor; self.scene = workingsceneview; self.allowscameracontrol = true; self.autoenablesdefaultlighting = true; self.showsstatistics = true; self.backgroundcolor = self.skycolor; self.delegate = self; } return workingsceneview; } dpoint *point = [coodinate convertcooridnateto3dpoint]; nsurl *pathtoresource = [nsurl urlwithobjectname:objectname oftype:@"dae"]; nserror *error; scnscene *scene = [scnscene scenewithurl:pathtoresource options:nil error:&error]; scnnode *node = scene.rootnode; node.position = scnvector3make(point.x, point.y, point.z); node.rotation = scnvector4make(0, 1, 0, ((m_pi*point.y)/180.0)); scnscene *workingscene = self.getworkingscene; [w...

Using xcopy or copy for a single file from multiple folders -

so in batch script i'm building taking single file folder, copying on destination folder, , renaming based on number of times script has been looped. need take file that's named samething bunch of different folders spread across multiple computers @ times , copy them new folder work with. i've read on xcopy , copy seemed thing use haven't been able find lets me tell copy on single named file. i've posted have far script below commented lines sections haven't figured out: echo off setlocal enabledelayedexpansion echo note: combined permission list cvs can found in desktop folder set /a #=-1 :start set /a #+=1 :again echo please input file path permissionoutput.txt set /p permissionoutputpath= set "sourcefolder=%permissionoutputpath%" set "destinationfolder=c:\users\kayla\desktop\holder-combinedpermissionslists" if not exist "%sourcefolder%\permissionoutput.txt" echo file not found&goto again copy "%sourcefolde...

scikit image - Watershed segmentation in Python with skimage does not stop running -

i'm having trouble implementation of watershed segmentation algorithm in python using scikit-image. my sample code below: from scipy import ndimage ndi skimage import feature import numpy np cells = binary_image_of_interest distance = ndi.distance_transform_edt(cells) local_maxi = feature.peak_local_max( distance, footprint=np.ones((3, 3), dtype=np.bool), indices=false, labels = measure.label(cells) ) but when run code seems continue long time (up 1 h) no solution. i'm pretty sure it's not machine being slow because other scripts run times comparable on skimage website. if able out it'd appreciated!

node.js - ENOENT Error in Node When Calling Ffmpeg binary from Fluent-Ffmpeg Api -

background i wiring firebase function in node. purpose parse inbound audio clip set length. using ffmpeg , fluent-ffmpeg. problem when function triggered in firebase, getting enoent error when fluent-ffmpeg attempts access ffmpeg binary firebase debug output error: { error: spawn ./cloud/functions/node_modules/ffmpeg-binaries/bin/ffmpeg enoent @ exports._errnoexception (util.js:1018:11) @ process.childprocess._handle.onexit (internal/child_process.js:193:32) @ onerrornt (internal/child_process.js:367:16) @ _combinedtickcallback (internal/process/next_tick.js:80:11) @ process._tickdomaincallback (internal/process/next_tick.js:128:9) code: 'enoent', errno: 'enoent', syscall: 'spawn ./cloud/functions/node_modules/ffmpeg-binaries/bin/ffmpeg', path: './cloud/functions/node_modules/ffmpeg-binaries/bin/ffmpeg', spawnargs: [ '-formats' ] } expected outcome inbound file downloaded temp...

asp.net mvc - Trying to generate a new AntiForgeryToken, post authentication -

recently during scanning test security team, have been asked after user logs in, new requestverificationtoken should generated. currently, antiforgerytoken in _layout.cshtml. @using (html.beginform(null, null, formmethod.post, new { id = "aftoken" })) { @html.antiforgerytoken() } on view, have: $('loginform').check( { submithandler: function (form) { var token = $("#aftoken input").val(); var dataobject = { __requestverificationtoken: token, username: $('#name').val(), password: $('#password').val }; $.ajax( { type: 'post', url: '@url.action("checkuser", "account")', data: dataobject, }).done(function (result) and on controller, have: [httppost] [validateantiforgerytoken] public jsonresult validate(loginhelper logindata) looks in order generate...

python - Passing parameters between cells in a Jupyter Noteboook -

how 1 pass parameter python cell sas cell in jupyter notebook? found documentation rather vague in area. 1 possible way seems using sos kernel create parent cell sub cells; seems parent cell have context. prefer methodology not require kernel accomplish task of passing parameter.

How do we validate a kendo angular 2 combobox custom value? -

i'm implementing combobox control in child component , want display bootstrap .help-block change class of kendo combo box control use validation state class .has-error if user enters value not valid. there way achieve validation on control?

sql - Invalid length parameter error -

i'm passing list of names ssrs sql server stored procedure i'm getting error: invalid length parameter passed left or substring function this code: select substring(item, 1, len(item) - 36) dbo.fnsplit(@manager, ',') the reason substring remove 36 character guid attached end of manager name. names passed this: john smith, tom perry i've read error caused spaces, can't figure out how fix this. just use case : select (case when len(item) <= 36 item else left(item, len(item)-36) end) dbo.fnsplit(@manager, ',')

javascript - Warning script not working on Explorer 11 -

Image
i created website it's mandatory inform viewers if leaving website. i'm using javascript function. problem have won't work on explorer 11. or, more specifically, received report customer informing me exact version of explorer using 11.0.9600.18738. i have tested site on of versions of explorer, chrome, firefox, mobile device (several browser versions) , tablet, , functioning except, of course, version of explorer reported customer. i have screen capture customer: the code have links looks this: <a href="javascript:external('http://www.ccenterdispatch.com/')" target="_blank" title="visit clay center dispatch newspaper website, local newspaper , community pages."><i class="fa fa-external-link" aria-hidden="true"></i>&nbsp;&nbsp;clay center dispatch (local newspaper , community pages)</a> when customer makes selection on version of explorer comes url (as shown in screen capt...

vuex - Is it possible to mutate a state prop in a module using another’s module mutator in vuejs2? -

lets have this: const modulea = { state: { name: 'cristian' }, namespaced: true, } const moduleb = { state: { color: 'red' }, namespaced: true, } const store = new vuex.store({ state: { user: null, }, modules: { a: modulea, b: moduleb }, mutations: { setpropvalue(state, payload) { (let [key, value] of object.entries(payload)) { state[key] = value; } }, }, }) on vue instance have firebase observer when user logs in/out , change state accordingly. want achieve this: const payload = { module: 'root', payload: { user, }, } this.$store.commit('setpropvalue', {payload}); then module: const payload = { module: 'a', payload: { name: 'alexander', }, } and run same logic, different load , change props module a: this.$store.commit('setpropvalue', {payload}); instead of committing mutation directly, consider using action this.$store.dispatch('set...

python - pandas syntax for more complex sql query -

i looking pandas syntax following aggregation pandas dataframe. cannot find example how accomplish following sql query in pandas. #sum , divide select click, ctr, sum(click)/sum(imp) ctr mytable group website #normalize each subgroup select imp, imp/sum(imp) on (partition website) n_imp mytable sql: #normalize each subgroup select imp, imp/sum(imp) on (partition website) n_imp mytable pandas: df[['website','imp']].assign(n_imp=df['imp']/df.groupby('website')['imp'].transform('sum'))

c# - How to add record well using ASP.NET MVC and KnockoutJS? -

<button class="btn btn-primary" data-bind="click:function(){show('add');}">add</button> my purpose adding input record values backend automatically id number. after click button add, show me internal server error. record saved database sometimes. id 0. have set id property nullable. below add function , object. may ideas smart guys? thank much. self.addcustomer = function () { debugger; var cus = { name : self.cusname(), address: self.cusaddress()} var url = "/customer/addcustomer"; $.ajax({ type: "post", url: url, data: cus, success: function (data) { alert("insert successful!"); getcustomers(); $('#addcustomer').modal('hide'); }, error: function (error) { alert(error.statustext); } }); }; self.customers = ko.observablearray([]); getcustomers(); function getcustomers...