Posts

python - Split or Extract Strings into Arguments of Function? -

lets have function takes string arguments. want dynamically generate them. there not seem way plug in easily. how done? see example here i_take_strings('one', 'two', 'and_the_letter_c') s = 'one 2 and_the_letter_c' i_take_strings(x x in s.split()) #python thinks i'm retarded attempt s.split() returns list can pass function variable arguments prepending * follows: i_take_strings(*s.split())

ios - Unable to set initial radius of one SCNSphere -

i able add twenty small spheres of, say, radius 0.5 scene. however, when attempt add one sphere, no matter radius specify, sphere appears default radius of 1.0. here code i'm using add 1 sphere. merely put code inside loop add twenty spheres -- works fine. func drawspheres() { var x:float = 0.0 var radius:cgfloat = 0.5 let spheregeometry = scnsphere(radius: radius) let spherenode = scnnode(geometry: spheregeometry) spherenode.position = scnvector3(x: x, y: 0.0, z: 0.0) self.rootnode.addchildnode(spherenode) } am missing obvious? the problem seeing scene kit trying smart. working expected. to able render scene, scene kit needs camera point of view. if scene contains camera, automatically made point of view. if scene doesn't have camera in it, scene kit has create own (or fail render together, less preferable). when scene kit creates own "default" point of view, tries adapt content of scene fills view best possible (a slig...

android - How to launch a car navigation to location from the app -

you might find question silly, can't find it. don't know how call tutorial need. i want application after clicking button start example waze , pass on address user can navigate it. if direct me should great. if want launch waze app specifically, can use url scheme @ waze.com/about/dev launch app. don't know of intent protocol or url scheme that's shared , navigation apps.

How to insert tab separated data from text file which has more than 1 million records into a SQL Server table using C#? -

i insert raw data file here in form of .txt , tab separated data sql server table. i perform operation of c# application, stumble upon how file has more 1 million records in it. i appreciate , pointers on this. e.g. have raw data file (tab separated) named myfile.txt , create table in sql server database. file have values may have various form of datatypes, (e.g. has datetime part, integer value, nvarchar string etc.) , have create sql server table same columns , corresponding datatypes. .txt file below 2015-07-28 18:41:07 9f4768273621d04da45e732932278497 sam 2015-07-27 18:41:07 9f4768273621d04da45e732932278497 ricky 2015-07-26 18:41:07 9f4768273621d04da45e732932278497 roxy table structure formed should appear below: date time userid username 2015-07-28 18:41:07 9f4768273621d04da45e732932278497 sam 2015-07-27 18:41:07 9f4768273621d04da45e732932278497 ricky 2015-07-26 18:41:07 9f4768273621d04d...

javascript - Change form submit button text after submition -

how change submit button text after submit?? have form button . change button text click next after submit form. <form> <div class="form-group"> <div class="rightbox"> <label for='phone'>phone</label></div> <div class="leftbox"> <div class="col-sm-12"> <input class="text-box single-line" data-val="true" name="phone" type="tel" value="" /> </div></div> </div> <div class="form-group"> <div class="rightbox"> <label for='phone'>mobile</label></div> <div class="leftbox"> <div class="col-sm-12"> ...

java - Dependency conflict in integrating with Cloudera Hbase 1.0.0 -

i tried connect play framework (2.4.2) web application cloudera hbase cluster. included hbase dependencies in bulid.sbt file , used hbase sample code insert cell table. however, got exception seems dependency conflict between play framework , hbase. attached sample code , build.sbt files well. grateful resolve error. [error] [07/21/2015 12:03:05.919] [application-akka.actor.default-dispatcher-5] [actorsystem(application)] uncaught fatal error thread [application-akka.actor.default-dispatcher-5] shutting down actorsystem [application] java.lang.illegalaccesserror: tried access method com.google.common.base.stopwatch.<init>()v class org.apache.hadoop.hbase.zookeeper.metatablelocator @ org.apache.hadoop.hbase.zookeeper.metatablelocator.blockuntilavailable(metatablelocator.java:434) @ org.apache.hadoop.hbase.client.zookeeperregistry.getmetaregionlocation(zookeeperregistry.java:60) @ org.apache.hadoop.hbase.client.connectionmanager$hconnectionimpl...

PHP-DI Register Instance for ctor Injection -

i'm using php-di , using twig in project. i'd register instance of $twig php-di instance injected ctor argument on objects it's needed. i'd use php definitions , avoid phpdoc annotations, , have read http://php-di.org/doc/php-definitions.html here's basic example: $builder = new containerbuilder(); $builder->adddefinitions(['twig_environment' => $twig]); $container = $builder->builddevcontainer(); then have $twig ctor argument in other classes. possible? clear, don't want have create definition each object uses $twig. public function __construct(\twig_environment $twig) { $twig->render('homepage.twig'); } the error i'm getting indicates php-di trying create new instance of twig_environment instead of using instance created. this correct, except method call create container: $container = $builder->builddevcontainer(); that creates entirely new container , ignores have configured above ;) (it's ...