Posts

Shutdown embedded Jetty in Spring-Boot Application with Apache CXF -

in spring-boot application register apache-cxf soap service this: @bean(destroymethod = "destroy") org.apache.cxf.endpoint.server server(myservice myservice) { jaxwsserverfactorybean svrfactory = new jaxwsserverfactorybean(); svrfactory.setserviceclass(myservice.class); svrfactory.setaddress("http://0.0.0.0:4711/myservice"); svrfactory.setservicebean(myservice); svrfactory.getininterceptors().add(new loggingininterceptor()); svrfactory.getoutinterceptors().add(new loggingoutinterceptor()); return svrfactory.create(); } it may happen @ other places of spring configuration, context can not initialized succesfully (application startup failed) , application shutdown initiated. unfortunately sever bean, created, stays alive , prevents application shutting down completely. thought destroymethod = "destroy" trick, destroys webapp/soap endpoint (resultig in http error 404) embedded jetty still running. do have chance ...

html - send attachments and data in form in an email with php -

this php code and html form below want data name , email, phone number fields , file attachment. now tried file attached ( without other information entered) in live server environment getting , attachment in mail different format (like have send word doc word file in dat format doesn't display data in word file) <?php if(isset($_post['submit'])) { //the form has been submitted, prep nice thank message $output = '<h1>thanks file , message!</h1>'; //set form flag no display (cheap way!) $flags = 'style="display:none;"'; //deal email $to = 'xxxx@gmail.com'; $subject = 'details , file attachments '; $message = strip_tags($_post['message']); $attachment = (file_get_contents($_files['file']['tmp_name'])); $filename = $_files['file']['name']; $boundary =md5(date('r'...

c++ - Initialize std::shared_ptr by copying a junk of data from a raw pointer -

basically hoping acheive: int pbuf = {1, 2, 3, 4, 5, 6}; std::shared_ptr<int> pptr(pbuf, _arraysize(pbuf)); the following syntax invalid, possible? i'm required use shared_ptr. if mean create copy of array pbuf , assign std::shared_ptr following code should work: int pbuf[] = {1, 2, 3, 4, 5, 6}; std::shared_ptr<int> pptr( new int[_arraysize(pbuf)], std::default_delete<int[]>() ); std::copy( pbuf, pbuf + _arraysize(pbuf), pptr.get() );

excel - Comparison of data in Access -

i have written pretty lengthy vba code in excel comparison of 2 worksheets. code following: lets import 2 sheets comparison arranges columns removes departments require different comparisons new worksheet in sheet 1 checks if id's appear more once checks, row of data use comparison based on latest update, , deletes old rows compares sheets based on header , cell contents header names different, different values highlights them red finally giving me breakdown per column per department of differences , id's missing i have found data set becoming big , looking use ms access, possible copy vba code on access? guys suggest this? any advice helpful. from nature of question sounds may not have used database before. if using access, need totally re-write code using sql statements. eg aggregating sql select statement find updated update , ignore rest. you can use conditional formatting in access form, it's no better using in excel. how many rows data ...

java - How do I convert seconds into accumulated hhh:mm:ss? -

i want convert elapsed amount of accumulated seconds hours:minutes:seconds. example 93599 seconds to: 25:59:59 how can that? (note: 24h should not wrap 0h) the modulus operator % useful here. work well public static void converttime(int seconds) { int secs = seconds % 60; int mins = (seconds / 60) % 60; int hours = (seconds / 60) / 60; system.out.printf("%d:%d:%d", hours, mins, secs); }

android - "Error:Gradle: Content is not allowed in prolog" when running tests -

using android studio, when try run unit tests, fails following error in messages (gradle build): error:gradle: content not allowed in prolog. error:gradle: execution failed task ':module:mergedebugandroidtestresources'. > /users/me/path/to/my/project/src/test/resources/fixtures/activity_feed.json:0:0: error: content not allowed in prolog. seems yet variant of content not allowed in prolog error, doesn't makes sense, found out searching solution. in case, points json file, doesn't contain prolog code. find build variants view: left tool pane view -> tool windows -> build variants once there, locate: test artifact: android instrumentation tests and instead android instrumentation tests select: test artifact: unit tests

MySQL update subselect issue -

before post question, tell all, not duplicate of this or that , since not want solve specific issue, rather desire understand one. reading docs , can see 2 interesting examples of anomalies regarding subqueries inside update command: update t1 set column2 = (select max(column1) t1); the error is error 1093 (er_update_table_used) sqlstate = hy000 message = "you can't specify target table 'x' update in clause" 2. select * t1 s1 in (select s2 t2 order s1 limit 1) the error is error 1235 (er_not_supported_yet) sqlstate = 42000 message = "this version of mysql doesn't yet support 'limit & in/all/any/some subquery'" looking @ first example can tell updating column2 of t1 might or might not change column1 values, instance because of triggers or if columns same. however, wonder why mysql throwing error instead of evaluating subquery normally, or @ least, determining whether possible subquery's result c...