Posts

maven - File lock exception when using graphHopper in java program -

i'm using graphhopper in following way: graphhopper hopper = new graphhopper().forserver(); hopper.setchenable(false); hopper.setgraphhopperlocation(graphhopermasterfile); hopper.setosmfile(osmfile); hopper.setencodingmanager(new encodingmanager("car,bike")); hopper.importorload(); ghrequest req = new ghrequest().addpoint(new ghpoint (latfrom, lonfrom)).addpoint(new ghpoint(latto, lonto)) .setvehicle("car") .setweighting("fastest") .setalgorithm(algorithmoptions.astar_bi);; req.gethints().put("pass_through", true); ghresponse res = hopper.route(req); i obtained graphhopermasterfile downloading zip https://github.com/graphhopper/graphhopper/blob/0.5/docs/core/routing.md . i obtained .osm file http://download.geofabrik.de/europe/great-britain/england/greater-london.html . i added maven dependancy http://mvnrepository.com/artifact/com.graphhopper/graphhopper-we...

php - how make these variables dynamic in foreach loop -

i have cart data , want use paypal want make cart data formate code: $item_1 = new item(); $item_1->setname('item 1') // item name ->setcurrency('usd') ->setquantity(2) ->setprice('15'); // unit price $item_2 = new item(); $item_2->setname('item 2') ->setcurrency('usd') ->setquantity(4) ->setprice('7'); $item_3 = new item(); $item_3->setname('item 3') ->setcurrency('usd') ->setquantity(1) ->setprice('20'); // add item list $item_list = new itemlist(); $item_list->setitems(array($item_1, $item_2, $item_3)); you can define varying data in assoc array first: $data = array( array( 'quantity' => 1, 'price' => '15'), ... // etc ); then iterate on , add result array: $result = array(); for($i = 0; $i < count($data); ++$i) { $obj = new item(); $obj->setname('item ' ....

sql - Execute multiple queries in a single database connection using oracle 10g and php -

i want run multiple sql queries in single database connection using oracle 10g , php. here every sql query queries have create database connection. there way run multiple sql queries in single database connection or have fetch data way only? because when have run 50 queries, have write 50 times below. <?php include("mydb.php"); // run query $sql6 = "select * dat to_char(wd,'dd/mm')='19/08'"; $stid6=oci_parse($conn, $sql6); // set array $arr6 = array(); if(!$stid6){ $e=oci_error($conn); trigger_error(htmlentities($e[message],ent_quotes),e_user_error); } $r6=oci_execute($stid6); if(!$r6){ $e=oci_error($stid6); trigger_error(htmlentities($e[message],ent_quotes),e_user_error); } // through query while($row = oci_fetch_array($stid6,oci_assoc)){ // add each row returned array $arr6[] = array(($row['wd']) , (float)$row['data']); } oci_free_statement($stid6); oci_close($conn); ?> <?php include("mydb.php");...

php - MYSQL Left Join month count from two tables -

i want add columns represent month base counts other table. i have 2 tables. leave application leaveid userid 1 3 2 4 3 5 4 1 leave dates dateid leaveid leavedates 1 1 2015-10-06 2 1 2015-10-07 3 2 2015-11-01 4 2 2015-11-02 5 3 2015-01-01 6 4 2015-02-12 i want end total leave count based on months: userid january fabruary march on... 1 1 3 1 2 2 0 1 2 3 4 1 do conditional summing of entries, this:- select a.userid, sum(if(month(leavedates) = 1, 1, 0)) january, sum(if(month(leavedates) = 2, 1, 0)) february, sum(if(month(leavedates) = 3, 1, 0)) march, sum(if(month(leavedates) = 4, 1, 0)) april, sum(if(month(leavedates) = 5, 1, 0)) may, ...

java - Number picker doesn't show properly as designer -

Image
i have issues number picker control in android studio. control aren't displayed on real device when run application. number picker has no gray background color, no "+" / "-" buttons displayed, transparent ? xml <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#000000" > <expandablelistview android:layout_width="wrap_content" android:layout_height="342dp" android:id="@+id/lvtranexp" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_above="@+id/numberpicker" android:layout_alignparenttop="true" /> <linearlayout andro...

php - issue on printing woocommerce notices after user registration redirect -

i'm playing filter ( woocommerce_registration_redirect ) log out user after registeration , show temporary message. here's i've done add_filter( 'woocommerce_registration_redirect', 'redirect_after_register' ); function redirect_after_register() { wp_logout(); wc_add_notice( __( 'some message', 'woocommerce' ), "notice" ); return wc_get_page_permalink( 'myaccount' ); } after user registration, redirect him account page, wc_print_notices() must display custom notice message. unfortunately, doesn't' work , message doesn't appear. can on this? you're trying message appear after re-direct, correct? code seems add notice page before redirect. have devise mechanism fire function after re-direct happens. same problem faced try upon plugin activation. can use same solution in codex: https://codex.wordpress.org/function_reference/register_activation_hook

excel vba - VBA CommandBars.ExecuteMso ("PasteAsTableSourceFormatting") with link to Source -

i pasted table excel powerpoint code: pptapp.commandbars.executemso ("pasteastablesourceformatting") everything works fine. how link source range? you can use function provided @jamieg reference pasted shape( related question ), can access range of pasted shape accessing linked properties: dim shp shape set shp = getpastedshape() 'assuming pasted shape contains excel spreadsheet if shp.type = msoembeddedoleobject shp.oleformat.object.workbook.sheet(1).range("a1") end if