Posts

Add new column if range of columns contains string in R -

i have dataframe below. add 2 columns: containsanz: indicates if of columns f0 f3 contain 'australia' or 'new zealand' ignoring na values allanz: indicates if non na columns contain 'australia' or 'new zealand' starting dataframe be: dfcontainsanz col.a col.b col.c f0 f1 f2 f3 1 data 0 xxx australia singapore <na> <na> 2 data 1 yyy united states united states united states <na> 3 data 0 zzz australia australia australia australia 4 data 0 ooo hong kong london australia <na> 5 data 1 xxx new zealand <na> <na> <na> the end result should this: df col.a col.b col.c f0 f1 f2 f3 containsanz allanz 1 data 0 xxx australia singapore <na> <na> australia unde...

java - What is the right way to make Spring boot authentication for mobile clients? -

Image
i need make simple crud application user registration , authentication using spring boot, have trouble figuring out how right. have created user table @ rdms , set redis storing user sessions explained here . at spring boot docs it's said if spring security on classpath web applications secure default ‘basic’ authentication on http endpoints. but defined several crudrepository intefaces , after starting application can get it's data using browser without authentication. thought should work out of box without additional tuning , therefore checked if spring security on classpath gradlew dependencies command , appears there: also default user password should displayed during application start not show up. maybe missing here? also not sure if best option mobile app because possibly uses short-living tokens. there several other options, among using webview , cookies (as recommended google long ago), creating custom authentication entry point , using appro...

java - Why can't I inject a WebServiceContext into a Jax-WS logical Handler -

i have logical handler web service need access servlet's context (via web service context, thinking). package test; public class newlogicalhandler implements logicalhandler<logicalmessagecontext> { @resource private webservicecontext context; error when deploy: <servlet: "test.ws1" failed preload on startup in web application: "web". java.lang.classnotfoundexception: test.newlogicalhandler @ java.net.urlclassloader.findclass(urlclassloader.java:381) @ java.lang.classloader.loadclass(classloader.java:424) @ sun.misc.launcher$appclassloader.loadclass(launcher.java:331) @ java.lang.classloader.loadclass(classloader.java:357) if inject web service proper: @webservice(..stuff...) @handlerchain(file = "handler.xml") public class ws1 { @resource private webservicecontext context; that works fine. never mind. can servlet context logicalmessagecontext.get(messagecontext.servlet_context); ...

node.js - how to run 3 function sequentially? -

i have 3 function: function createdir(){ fs.mkdirs('./quickstart',function(){ console.log("thao thanh cong"); }); } function unzip(){ fs.createreadstream('./prestashop_cache/' + quickstart).pipe(unzip.extract({path:'./quickstart'})); console.log("giai nen xong"); } function copydata(){ if (path.extname(folder + '/samples' + version + '/data') != '.ds_store' && path.extname(folder + '/samples' + version + '/data') != '.svn' && path.extname(folder + '/samples' + version + '/data') != '__macosx') { fs.copy(folder + '/samples' + version + '/data','./quickstart/prestashop/install/data/', function () { console.log("coppy thanh cong toi thu muc data"); }); } } i want execute 3 function above : createdir() finished -> unzip(); finished -> copydata(); ...

ios - How to use checkmark for UITableView -

i trying create simple todo list app learning purposes i. want able click on row , add check mark , when clicked again want go away. have looked @ several other examples nothing working. how can achieve this? class firstviewcontroller: uiviewcontroller, uitableviewdelegate, uitableviewdatasource { @iboutlet weak var tbview: uitableview! override func viewdidload() { super.viewdidload() tbview.reloaddata() } override func viewwillappear(animated: bool) { self.tbview.reloaddata() } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int{ return tasks.manager.count } func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell: uitableviewcell = uitableviewcell(style: uitableviewcellstyle.subtitle, reuseidentifier: "default tasks") ...

ios - how to handle the below data -

the problwm iam facing ..when ever iam passing values array inside dictionyy..it showing me error -1005 connection lost..and when ever dont pass values response getting created inthe server side database ofiice price details , office contact information , office document not saving ..can 1 me how handle in advance [ { "officeprice": [ { "office": 1, "making_charge": 1, "wastage": 1, "weight_by": 1, "credit_period": 1, "cartage_price_type": null, "cartage_price": null, "diamond_price": 1, "amethyst_price": 1, "amber_price": 1, "sapphire_price": 1, "emerald_price": null, "ruby_price": null, "id": 1, "createdat": "2016-04-15t08:41:08.000z", "updatedat": "2016-04-16t14:18:39.000z" } ], "officecontactperson": [ { ...

php - Inserting MySQL data as an image path -

when try simple code works fine: <?php require 'connect.php'; if($result = $con->query("select * table")) { if($row = $result->fetch_object()) { echo $row->imgname, ' ',$row->divid, '<br>'; } } ?> but inserting image not working reason: <?php require 'connect.php'; if($result = $con->query("select * table")) { if($row = $result->fetch_object()) { echo "<img src='img/".$row['imgname']."' />"; } } ?> can me out, please! change $row['imgname'] $row->imgname