Posts

javascript - Updating controller data doesnt update the view - Angular JS - Ionic -

i have controller : .controller("mainctrl",function($scope,$state){ var self = this; var usuario = window.localstorage.getitem('usuario'); this.msjs=[]; var res = window.localstorage.getitem(usuario+'_msjs'); if(res===null) { this.msjs=[]; } else{ this.msjs=json.parse(res); } $scope.$on('newmessagereceived', function(e, msg) { //alert('message received:'+msg); self.msjs.push(msg); alert('mensaje recibido'); alert(json.stringify(self.msjs)); window.localstorage.setitem(usuario+'_msjs',json.stringify(self.msjs)); $state.reload(); }); } and view: <ion-view ng-controller="mainctrl m" > <ion-nav-buttons side="right"> <button class="button" ng-click="m.logout...

html - What is the difference between phrasing content and flow content? -

Image
i new html , css , know difference between flow content , phrasing content. other w3 official documentation mdn documentation helpful , states: flow content defined following: elements belonging flow content category typically contain text or embedded content. phrasing content defined following: phrasing content defines text , mark-up contains. runs of phrasing content make paragraphs. however, documentation gives little difference between two, can clarify major differences between phrasing content , flow content? the easiest way remember, if can inside sentence, it's phrasing content. text can inside sentence, it's phrasing. an emphasised bit can inside sentence, it's phrasing. an image can inside sentence, it's phrasing. a sub-heading or article cannot inside sentence, not phrasing. a link can inside sentence, it's phrasing. of html 5, 1 allowed have link containing whole blocks of text, in case not phrasing. phr...

Highlighting failed field in selenium webdriver during runtime -

i want highlight failed field using selenium webdriver during run time. can tell me code that? in advance!! you can update html elements css @ runtime using little javascript. following method add red border element: // method highlight element public static void highlightelement(webdriver webdriver, webelement element) throws interruptedexception { javascriptexecutor driver = (javascriptexecutor) webdriver; driver.executescript("arguments[0].setattribute('style',arguments[1]);", element, "border: 2px solid red;"); }

java - Access image file inside a Jar file dynamically -

i have java project,exported jar file (desktop application) generates html file output. output html file, needs read 1 image file, page's logo. jar application in x folder. target html file placed dynamically anywhere. how make html,residing in someother location, access image, inside jar file. in short, how determine path below code, above scenario. java.net.url url = getclass().getresource("image.jpg"); fw.write("<tr><td><b>"+csname+"</b></td><td> <img src = "+url.tostring()+"'>/td></tr>"); works fine, when run in eclipse. not when exported jar resultant html file,in other folder has code <img src="rsrc:com/demo/dirapitoword/image.jpg"> you need read image stream classpath , e.g.: inputstream in = getclass().getresourceasstream("image.jpg"); and write stream out file known place on disk. there lots of ways this , if you're using jav...

java - How to reopen connection in JPA -

i have app in springboot jpa. when lost connection app send me error: warn 6812 --- [io-8080-exec-42] o.h.engine.jdbc.spi.sqlexceptionhelper : sql error: 17002, sqlstate: 08006 error 6812 --- [io-8080-exec-42] o.h.engine.jdbc.spi.sqlexceptionhelper : io error: socket read timed out after estabilishin connection can't use entitymanager, because get: warn 6812 --- [io-8080-exec-50] o.h.engine.jdbc.spi.sqlexceptionhelper : sql error: 17008, sqlstate: 08003 error 6812 --- [io-8080-exec-50] o.h.engine.jdbc.spi.sqlexceptionhelper : closed connection my connection properties: spring.datasource.driverclassname=oracle.jdbc.driver.oracledriver spring.datasource.url=jdbc:oracle:thin:@...:..:.. spring.datasource.username=... spring.datasource.password=... spring.datasource.test-on-borrow=true spring.datasource.test-while-idle=true spring.datasource.validation-query=select 1; what should reconnect db connection? try adding external ...

REST Get for multi values with multi keys -

i have restful server implement request entity while entity have multi keys. example, getting contact information specific company in specific country (nike, germany): get: http://hostname/rest/accounts/{company}/{country} i want add functionality allow client query multiple company/countries pairs in 1 call. since have millions of records in db don't ever want return data. also, client may need ~1000 records, don't want him make ~1000 calls. i thought of adding pairs of company/country in body of request, answer here http request body suggested it's bad practice. i can't use query string params because have information , servers have limit on size of url. what's rest practice such case? there official proposal multi-request protocol - here ( background ). possibly because relies on http/2 deliver efficiency gain, doesn't seem have momentum @ present. for few resources, specify them in url. problem de-facto url limit of ~2000 character...

javascript - Hide content inside iframe? -

here situation. i have file called iframe.html. has code in below, <!doctype html> <html lang="eng"> <head> <meta charset="utf-8"/> <title>pluign development</title> <script src="js/jquery-1.11.0.js" type="text/javascript"></script> </head> <body> <iframe id="abc" src="test.html"></iframe> <div id="sub">click</div> </body> <script src="js/script-22.js" type="text/javascript"></script> </html> and have test.html file. has code in below, <!doctype html> <html lang="eng"> <head> <meta charset="utf-8"/> <title>pluign development</title> </head> <body> <div id="red">prasanga karunanayake </div> ...