Posts

Showing posts from June, 2014

HTTP POST to a backbase application -

i need implement requirement in other non-backbase applications send http post request bb application. there pre processing & validation done , based on result client has redirected login page or error page. what best way implement in backbase? you need check documentation integration services . full documentation can find here: https://my.backbase.com/docs/product-documentation/documentation//portal/5.6.2/develop_integrationservices.html the documentation develop own service (i prefer use camel java dsl way), , url like: http://localhost:7777/portalserver/services/rest/v1/myservice . here example of java implementation of service: public class mycamelservice extends routebuilder { @override public void configure() throws exception { from("restlet:/v1/myservice") .setbody().constant("<html><body><b>hello world!</b></body></html>") .setheader("content-type",

Angular datatables - missing sort arrows when columns defined with DTColumnBuilder -

i'm using angular-datatables , when define table using angular renderer can see nice arrows sorting column. <table class="datatable row-border hover" datatable="ng" dt options="vm.dtoptions"> <thead> <tr> <th class="secondary-text"> <div class="table-header"> <span class="column-title">my header</span> </div> </th> </tr> </thead> <tbody> <tr ng-repeat="ex in ::vm.exes"> <td>{{ex.myvalue}}</td> </tr> </tbody> </table> when define columns dtcolumnbuilder.newcolumn arrows missing (sorting works). <table datatable="" dt-options="vm.dtoptions" dt-columns="vm.dtcolumns" class="datatable row-border hover" dt-disable-deep-watchers="true" dt-

linux - How to read an HTTP header value in a CGI Bash script -

i have cgi bash script hw.sh located on server running nginx. script called following command: curl -s -d - -h "range: bytes=1-8" -h "connection: close" -x http://server_ip/cgi-bin/hw.sh?path=/some/path/to/data/ i need fetch value of range request header within hw.sh . please me figure out how can achieved. http headers passed cgi programs environment variables . not case. generally, way access header values in cgi program depends on how web server processes headers. headers may modified, or removed. example, in nginx configuration, possible pass value of range header via custom fastcgi parameter: fastcgi_param range $http_range; it case environment variable called range , depends on implementation of protocol driver. headers may dropped due server configuration. example, following apache 2 configuration drops range header when there more 5 ranges: setenvif range (,.*?){5,} bad-range=1 requestheader unset range env=bad-range thus, impo

smartsheet api exact match during searching -

i have node.js script uses smartsheet library function. search works except not returning exact match instead if search string has few characters match smartsheet, rows returned. how can search exact match ? var options = { sheetid: xxxxxxxxxxx, queryparameters: { query: <string search> } }; // search sheet. smartsheet.search.searchsheet(options) .then(function (data) { console.log(data); } so if search 'test' search string returning results 1 or more characters in 'test' 'tes' match, returns rows.. by default, smartsheet accepts partial matches - both in ui via api. restrict exact match, enclose search term in double quotes ("). using rest api, can try: https://api.smartsheet.com/2.0/search/sheets/xxxxxxxxx?query=%22test%22 or in node: var options = { sheetid: xxxxxxxxxxxx, queryparameters: { query: '"test"' } }; // search sheet. smartsheet.search.searchsheet(opti

c - eclipse debug not work -

Image
i use eclipse run c language program after build project,it print building target: testusb invoking: cross gcc linker gcc -l/opt/local/lib -lusb-1.0 -o "testusb" ./src/testusb.o finished building target: testusb 14:44:40 build finished (took 120ms) 14:44:49 **** incremental build of configuration debug project testusb **** make make: nothing done `all'. 14:44:49 build finished (took 68ms) 14:45:10 **** incremental build of configuration debug project testusb **** make make: nothing done `all'. 14:45:10 build finished (took 65ms) in terminal when cd directory , type testusb,it print success. but when debug use eclipse,it not print success , cannot step main breakpoint. the debug configure the project structure program #include <stdio.h> #include <stdlib.h> #include <libusb-1.0/libusb.h> int main(void) { libusb_context **libcontext; libusb_device ***devicelist; int statu

cypher - Neo4j:Get every node with specified parent child variable -

here example of graph -task -sub task 1 -sub task 2 -sub task 2-1 -sub task 2-2 i need result { task, children : [{ sub task 1, children : [{ sub task 2-1 sub task 2-2 }] }] } how can using cypher, please tell if need elaborate more. thanks

java - How do you execute cron job every 5 minutes? -

jobdetail job1 = jobbuilder.newjob(firstjob.class).withidentity("job1", "group1").build(); trigger trigger1 = triggerbuilder.newtrigger().withidentity("crontrigger1", "group1") .withschedule(cronschedulebuilder.cronschedule("*/10 * * * * ?")).build(); scheduler scheduler1 = new stdschedulerfactory().getscheduler(); scheduler1.start(); scheduler1.schedulejob(job1, trigger1); jobdetail job2 = jobbuilder.newjob(secondjob.class).withidentity("job2", "group2").build(); trigger trigger2 = triggerbuilder.newtrigger().withidentity("crontrigger2", "group2") .withschedule(cronschedulebuilder.cronschedule(new cronexpression("0/7 * * * * ?"))).build(); scheduler scheduler2 = new stdschedulerfactory().getscheduler(); scheduler2.start(); scheduler2.schedulejob(job2, trigger2); thre

android - Crashes in deflateEnd of zlib -

my program android app, , crashes in deflateend(&strm) of zlib. using zlib compress network traffic stream. zlib code below. first, init deflate. then, when stream buffer data has arrived, call deflate compress. and then, when stream encounters eof, program crashes in deflateend() . except above call, zstream_ used in initial code like memset(&zstream_, 0, sizeof(zstream_)); think have little influence on crash. by way, online , issue. occurs 50 times in tens of thousands of running. sorry cannot provide simple verifiable example now. try. in addition, doubt usage of z_sync_flush not correct.

php - MySQL time value in query 838:59:59? -

i ask . i'm trying add time value mysql database .but value added in database 838:59:59 and store timein column 838:59:59 . timeout column result 00:00:00 value. the code below <?php $connect = mysqli_connect("localhost", "root", "root", "database"); global $connect; if(isset($_post['submit'])) { $timeout = strtotime('08:30:00'); $timein = strtotime('12:30:00'); $time_out_user = strtotime($_post['timeout']); $time_in_user = strtotime($_post['timein']); if(($time_out_user >= $timeout) && ($time_out_user <= $timein)) { echo "duplicate time"; } else { $add = "insert table (timeout,timein) values ('$time_out_user','$time_in_user')";

ios - Save received image in XMPP chat -

to store image received xmpp chat tried use code - (void)xmppstream:(xmppstream *)sender didreceivemessage:(xmppmessage *)message{nsstring *attachment = [[message elementforname:@"attachement"] stringvalue]; // getting string data here if(attachment.length > 0) { //save image in local folder of app nsdata *data = [attachment datausingencoding:nsutf8stringencoding]; // got data here uiimage *image = [uiimage imagewithdata:data]; // getting nil image here} in code getting nil in "image" object. should change here save received image via xmppp chat.

mobile - to check with JavaScript whether the page is displayed in a browser? -

can check javascript whether page displayed in browser or bookmark shortcut on homescreen? almost not. reasonable way implement bookmark on home screen use snapshot stored locally. think it: device isn't going visit of pages every time go home screen; eat data transfer allowance, slow, , irritate people. instead, remember snapshot of page of last time visited, store locally, , use that. (for instance, that's how chrome desktop's new tab page works showing popular destinations. that's not exact same thing, it's same use case — , on desktop browser data transfer isn't issue.)

email - How to do colouring the contents of a mail while sending via unix terminal using mailx command? -

i have file(.txt) below details(i having more 50 files listed 4) , while sending file via mail want implement coloring it. not sure while possible or not, please me on please ? date filename_now avg_timestamp space count status nov 4 chck01_20161104.txt 06:39 2.15m 17153 delayed --> red nov 4 trips11_20161104.txt 09:03 0.00m 024 on_time --> green nov 4 ar02_20161104.txt 09:31 0.00m 007 no_files --> yellow nov 4 ar01_20161104.txt 09:31 0.04m 433 delayed --> red this getting in mail(ms outlook), can implement coloring status field requested? thanks lot time. if want surround lines html font tags based on value of status column, awk code should trick: { if ( /on_time/ ) print "<font color=\"#00ff00\">", $0, "</font>" if ( /delayed/ ) print "<font color=\"#ff0000\">", $0, "</fo

javascript - Label names are not displayed from input data in pie transition chart of d3.js -

i using d3.js draw pie transition chart. when labels placed in data array show below: data = [{"label":"sector1", "value":25}, {"label":"sector2", "value":45}] the pie chart won't displayed. instead " nan " printed. the complete code pasted below: var w = 400, h = 400, r = math.min(w, h) / 2, data = [{"label":"sector1", "value":25}, {"label":"sector2", "value":45}], // data label-value pairs color = d3.scale.category20(), arc = d3.svg.arc().outerradius(r), donut = d3.layout.pie(); var vis = d3.select("body").append("svg") // place chart in 'pie-chart-div' .data([data]) .attr("width", w) .attr("height", h); var arcs = vis.selectall("g.arc") .data(donut) .enter().append("g") .attr("class", "arc") .attr("transform",

Need the PHP query to display the date as MM-DD-YYYY instead of YYYY-MM-DD -

this question has answer here: convert 1 date format in php 12 answers i need php query display date mm-dd-yyyy instead of yyyy-mm-dd. here code retrieve date, don’t know how convert date format. $sql = 'select * tmp order photodate asc'; //display results $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo "<tr class=table-row><td align=center>".$row["photodate"]."<br><center>"."</center><br></td></tr>"; } echo "</table>"; } else{ echo "0 results"; } arsort($band); $conn->close(); ?> you can in mysql in following way: select date_format(photodate, '%m-%d-%y') tmp order

how to set "objects" property in aframe raycaster component -

i want use raycaster component in <a-cursor> entity intersect cubes. set objects property '#box' (my cube's id), cursor still intersects element. step raycaster source code, , data.objects '' . so, wonder if set property in wrong way? there bug in a-frame dependency components. it's been fixed in dev builds: https://github.com/aframevr/aframe/tree/master/dist#dev-builds , released 0.4.0. a workaround put raycaster component before cursor: <a-entity raycaster="..." cursor="..."></a-entity>

c# - Bluetooth LE device as proximity sensor, BluetoothLEAdvertisementWatcher cyclically stops listening for advertisements -

in way of learning ble programming using c#, i'm trying write winform application should detec ble devices , use them proximity sensors. purpose i've applied bluetoothadvertisementwatcher class, filtering advertisements provided signal strength. problem detection seems quite crappy... device @ no distance pc, listener returns rssi value of -127, wich stands "no detection" i've understood. i've tried setting outofrangetimeout 10 seconds and, if things better, problems still heavy. major issue detection can flows without interruption bunch of seconds, debugger signals me thread exiting code 0, , listener can't receive new advertisements (with device ever aside pc) 30-40 seconds, restarts , loops. know if how intended work or if missing something? there way, eventually, intercept interruption , restart listener? this how initialize watcher: public blescanner(short maxdbrange, timespan outofrangetimeout) { this.inrange = maxdbrange; th

java - split video without knowing file duration -

i want make chunks of video each chunks not more 3 minutes using ffmpeg.i have read command of ffmpeg. ffmpeg -i output.mp4 -ss 0 -t 180 -c copy outputvideosegment.mp4 i using in code like string command = "ffmpeg -i videos/testing.vob -ss 0 -t 180 -c copy outputvideosegment.mp4"; processbuilder processbuilder = new processbuilder("/bin/sh", "-c", command); try { process process = processbuilder.start(); process.waitfor(); // wait process builder finish // process } catch (exception exception) { log.error("exception occured in making chunks due " + exception.getcause()); } the above command working fine , spliting video 3 min, in case have read file dont know duration of file.do need run above command inside loop or other way.please help. the segment duration 180s if have keyframe present e

internet explorer - IE truncates frame's src due to ampersand encoding -

never have felt alone, lonelier this guy. found no 1 having same problem. here's problem i've been stuck weeks now. have page frame in (also happens iframe). frame's src long string multiple url parameters. of these parameters parts of sql query. now, happens in ie, in combination of these url parameters in frame's src, ampersands (&) encoded &amp ; while length of src string remains if weren't encoded. i.e. following string: example.html?param1=value1&param2=value2 will transformed into example.html?param1=value1&amp;param2=va and i'll blank page. i've examined exact url parameters cause this, there nothing special them. also, in combinations cause problem, while in other don't. i've examined i'm sending ie, , in not encoded url. i've tried encoding explicitly, still happens. the problem occurs on ie (10, 11 , edge), not on firefox or chrome. any appreciated.

mips32 - line 294: Runtime exception at 0x004002b0: address out of range 0x10400000 -

i learning mips assembly language , and i'm having issue part of program getting error "address out of range." please assist me this. error line 294: runtime exception @ 0x004002b0: address out of range 0x10400000 .data filename: .space 8 filecontents: .space 50000 legalwords: .space 50000 correctwords: .space 50000 .text ----------------------gets length of current word in filecontents--------------------------------------------# getlength: li $a2, 0 #word length getlengthstart: lb $a1, filecontents($a0) # line 294 beq $a1, 10, getlengthend #new line char found current word length stored add $a0, $a0, 1 #move forward 1 position in file contents add $a2, $a2, 1 #add 1 wordlength j getlengthstart getlengthend: add $a0, $a0, 1 move $v0, $a2 j findnineletterword ---------------------------------end getlength------------------

C# Ping.PingCompleted returning the reply -

i writing app needs store response times ping.sendasync method, delegate void :- public delegate void pingcompletedeventhandler( object sender, pingcompletedeventargs e ) would possible change delegate or define delegate , attach pingcompleted event ?

android - How to set Google Place Picker for selcet place in one country? -

i using google place sdk , want set placepicker selecting place in 1 country (ukraine). this code: try { placepicker.intentbuilder intentbuilder = new placepicker.intentbuilder(); intent intent = intentbuilder.build(this); // start intent requesting result, // identified request code. startactivityforresult(intent, request_place_picker); } catch (googleplayservicesrepairableexception e) { // ... } catch (googleplayservicesnotavailableexception e) { // ... } and work result in activity.onresult()

qt - How to switch the base language for my .ts files -

now, after few years, i'm going replace german strings english ones in c++ sources. question how turn existing german-to-targetlanguage .ts files english-to-targetlanguage .ts files. i've got en_us.ts file translates german english. example, there tool can turn old fr_fr.ts file (based on german source strings) new 1 (based on english source strings) of en_us.ts? it had been quite easy modify/extend lupdate tool doing that. done.

java - Selenium webdriver iterate through rows and retrieve only certain columns -

i have tbody multiple tr s , 10 td s per tr . i want iterate through tr s , .text() of specific td s. below section itterate throught tr s have been assigned list ( alertstablerowslist ) for (int = 0; < alertstablerowscount; i++){ string reference = alertstablerowslist.get(i).findelement(by.xpath("//td[@data-title-text = 'reference']")).gettext(); //td number 3 string classification = alertstablerowslist.get(i).findelement(by.xpath("//td[@data-title-text = 'classification']")).gettext(); //td number 4 string description = alertstablerowslist.get(i).findelement(by.xpath("//td[@data-title-text = 'description']")).gettext(); //td number 7 string status = alertstablerowslist.get(i).findelement(by.xpath("//td[@data-title-text = 'status']")).gettext(); //td number 8 string date = alertstablerowslist.get(i).findelement(by.xpath("//td[@dat

angularjs - Black box appears only in iOS when navigating back to view in ionic -

Image
i building ionic app , have login , register page. when start app land on "login" page. can click on register , brings there. when come register state login state, have huge black bar appearing (i hid company logo in red) : this routing code : .state('login', { url: '/', templateurl: 'templates/login.html', controller: 'logincontroller' }) .state('register', { url: '/register', templateurl: 'templates/register.html', controller: 'registercontroller' });

c# - JSON .NET serialization of generic collections -

it feels have simple problem. i've got data class couple of generic collections , i'd have them serialized well. reading internet here's i'm doing: the class: public class questmodel { public string nametag { get; set; } public string desctag { get; set; } public int questlevel { get; set; } public queue<questobjectivebase> objectives { get; set; } public list<questrewardbase> rewards { get; set; } public bool completed { get; set; } public bool trackingprogress { get; set; } public questmodel() { objectives = new queue<questobjectivebase>(); rewards = new list<questrewardbase>(); trackingprogress = false; completed = false; } } the code: var json = jsonconvert.serializeobject(sidequests[0].model, formatting.indented, new jsonserializersettings { typenamehandling = typenamehandling.auto }); the output: { "nametag": "quests_test_name"

actionscript 3 - Game doesn't play on second frame -

i'm trying work on game, college assignment. i'm using flash , actionscript 3 (i'm using older version of flash, 2015 version, when still called adobe flash). when placing code within first frame, player object movement works fine, when place in second frame, not work. why? code same! , think more convenient if had gameplay start frame 2 (at least have first level held @ frame). @ frame 1, want have main menu. so, here code have @ frame 1: import flash.display.movieclip; import flash.events.event; stop(); var optionsactive:boolean = false; var gamepaused:boolean = false; startgame(); function startgame():void { if (optionsactive == false) { optionsui.visible = false; } else { optionsui.visible = true; } menutextoptions_active.addeventlistener(mouseevent.click, activatemenuoptions); menutextnewgame_active.addeventlistener(mouseevent.click, activatestartnewgame); } function activatestartnewgame(event:event) { go

python 2.7 - BeautifulSoup parse special character -

i extract text links beautifulsoup like: from beautifulsoup import beautifulsoup import urllib2 response = urllib2.urlopen(link) html = response.read() soup = beautifulsoup(html) #print(soup) in soup.findall('a',attrs={"class":"link"}): print(a.text) but characters " &#8211 " simple " - ". how these characters readable humans? try following: for in soup.findall('a',attrs={"class":"link"}): print(a.get_text())

angularjs - Angular Tooltip on Focus -

i'm using angular tooltip in application , want trigger tooltip on focus having issue trigger this. works fine mouseover , mouseleave not work on focus event. here how i'm using it <input type="password" tooltip-show-trigger="focus" tooltips tooltip-template="password must include @ least 1 upper case letter, 1 lower case letter, 1 numeric digit , 1 special character." id="password" name="password" class="form-control" placeholder="new password" required autofocus ng-model="password" /> i don't know i'm doing wrong or missing something. kind of appreciated. it may else... focus isn't actual event trigger angular tooltip on focus. focusin , focusout according this issue discussion . resolved issue. tooltip-show-trigger="focusin" tooltip-hide-trigger="focusout"

javascript - chart.JS i want to put different color for each Y axis value grid line color -

i using mvc 4.0 , chart.js generate graph. want put horizontal line of y axis each value , success develop using below property. scaleshowgridlines = true; scaleshowhorizontallines: true, //boolean - whether show vertical lines (except y axis) scaleshowverticallines: false, but actual requirement want put different color of horizontal line. scalegridlinecolor: "rgba(0,0,0,.05)" above line change color of horizontal line apply line. please guide me. you can set individual colors horizontal , vertical gridlines adding scales configuration options : scales: { yaxes: [{ gridlines: { color: 'green' } }], xaxes: [{ gridlines: { color: 'red' } }] }

xml - Android layout: chat bubble with date text in bottom right and baseline of message text -

Image
this question has been asked many times never got correct answer. how can build layout (that similar common messaging apps whatsapp, telegram) following characteristics: it has view acts container , has background image of bubble. in container there 2 elements, text message , text date. the text message start top left , can have multiple lines. the text date aligned baseline of last text message line, , on right of it. i've tried reach relative layout. <relativelayout android:id="@+id/message_bubble_container" android:layout_below="@+id/message_date_separator_container" android:layout_height="wrap_content" android:layout_width="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:background="@drawable/chat_message_background" android:padding="4dp"> <relativelayout

android - AndroidSVG fuzzy edges on image -

Image
i want display barcode on android. input svg string. svg library use androidsvg . used sample code library website , seem fine. when zoom on image, distorted edges (anti-alias?). tried disable flags. image still has fuzzy edges. can wrong code? picture: try zoom max, see fuzzy edges. code: private void loadqrcode(string svgstring) { svg svg = null; try { svg = svg.getfromstring(svgstring); } catch (svgparseexception e) { e.printstacktrace(); } if (svg.getdocumentwidth() != -1) { int widthpx = utils.pxfromdp(400); int heightdp = utils.pxfromdp(300); svg.setdocumentwidth(widthpx); svg.setdocumentheight(heightdp); int width = (int) math.ceil(svg.getdocumentwidth()); int height = (int) math.ceil(svg.getdocumentheight()); bitmap newbm = bitmap.createbitmap(width, height, bitmap.config.argb_8888); canvas bmcanvas = new canvas(newbm); final drawfilter filter = new paintfl

javascript - Bootstrap image zoom -

Image
i doing e-commerce site. use bootstrap. should use when doing product detail page? want follows. i want picture grow when comes picture. here have code may you, grow image pure css. css * { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; margin: 0; padding: 0; } .hoverdiv { position: relative; overflow: hidden; border:1px solid black; width:360px; margin: 10px; } .hoverdiv img { max-width: 100%; text-align:center; -moz-transition: 0.3s; -webkit-transition: 0.3s; transition: 0.3s; } .hoverdiv:hover img { -moz-transform: scale(1.1); -webkit-transform: scale(1.1); transform: scale(1.1); } img { display: inline-block; border: 1px solid #ddd; border-radius: 4px; padding: 5px; transition: 0.3s; position:relative; z-index:1; } img:hover { box-shadow: 0 0 2px 1px rgba(0, 140, 186, 0.5); -webkit-transform: skewx(-20deg); -ms-transform: skewx(-20deg); transform: s

c++ - QTableView Expansion -

Image
i have qtableview , wish allow table expansion second column. problem last column expanding. ui -> tableview -> setmodel(m_model); ui -> tableview ->setcolumnwidth(cmodel::colno, 30); ui -> tableview ->setcolumnwidth(cmodel::colname, 30); ui -> tableview ->setcolumnwidth(cmodel::coln, 30); ui -> tableview ->setcolumnwidth(cmodel::colfx, 30); ui -> tableview ->setcolumnwidth(cmodel::colfy, 30); ui -> tableview ->setcolumnwidth(cmodel::colfxy, 30); ui -> tableview -> header() -> setsectionresizemode(cmodel::colno, qheaderview::fixed); ui -> tableview -> header() -> setsectionresizemode(cmodel::colname, qheaderview::stretch); ui -> tableview -> header() -> setsectionresizemode(cmodel::coln, qheaderview::fixed); ui -> tableview -> header() -> setsectionresizemode(cmodel::colfx, qheaderview::fixed); ui -> tableview -> heade

c++ - Difference between Eclipse CDT ast and model packages -

i use eclipse cdt analyse c/c++ source code part of research project. noticed cdt's api has 2 packages of "accessible" interfaces: (1) package org.eclipse.cdt.core.dom.ast (2) package org.eclipse.cdt.core.model i assume (1) ast traversal, purpose of (2)? the "model" less detailed model of source code ast. models entities variables, functions, classes, , preprocessor directives, not other things statements , expressions. it's used generating outline view, contents of project explorer, , entries in other views call hierarchy , type hierarchy. i believe model pre-dates ast, , @ least of uses rewritten use ast instead.

javascript - Positioning fixed element within an iframe depending on parent window scroll -

goal: i'm trying accomplish have sticky element in iframe positioned @ bottom of browser window - until hits bottom of iframe window, then, when scrolling further down on parent page element stays put, , if 1 scrolling again element positions @ bottom of browser window again. without iframe simple solution (and showcase of want achieve) this: https://jsfiddle.net/30a1sxk9/2/ my page containing iframe looks this: https://jsfiddle.net/q9m1h2j5/1/ -> since scrolling happening outside iframe fixed position @ bottom. i'm looking robust , performant solution position element (with proper boundaries) in iframe within iframe . main problem have no access surrounding page - except via javascript within iframe (cross origin should not make problems since container , iframe have same domain) can't guarantee outside of iframe, have take account determining position of element. can't change general setup of page. my approach this, inside iframe: let $footer = $(

sapui5 - Add items to the sap.m.list using declarative support -

i want add items list using declaritive support. example: this code. want put list element mark saysing: // want insert elements here...... thanks <!doctype html> <html> <head lang="en"> <meta charset="utf-8"> </head> <body> <script id='sap-ui-bootstrap' type='text/javascript' src='https://openui5.hana.ondemand.com/1.38.10/resources/sap-ui-core.js' data-sap-ui-libs="sap.ui.commons,sap.m" data-sap-ui-modules='sap.ui.core.declarativesupport' > </script> <div data-sap-ui-type='sap.m.listbase' > <div data-sap-ui-aggregation="content"> // want insert elements here...... </div> </div> <div data-sap-ui-type='sap.ui.ux3.navigationbar'> <div data-sap-ui-type="sap

android - Drag and Drop not working in Fragment -

the code working in activity , not in fragment . can see elements there, can't drag , drop them, stops in long click. can provide solution? error log: *e/androidruntime: fatal exception: main process: com.example.future.buildingautomationsystem, pid: 10526 java.lang.nullpointerexception @ com.example.future.buildingautomationsystem.slidefragment.onitemlongclick(slidefragment.java:179) @ android.widget.abslistview.performlongpress(abslistview.java:3175) @ android.widget.abslistview$checkforlongpress.run(abslistview.java:3124) @ android.os.handler.handlecallback(handler.java:808) @ android.os.handler.dispatchmessage(handler.java:103) @ android.os.looper.loop(looper.java:193) @ android.app.activitythread.main(activitythread.java:5395) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:5

c# - Route attribute routing with query strings when there are multiple routes -

i have this: [httpget] [route("cats")] public ihttpactionresult getbycatid(int catid) [httpget] [route("cats")] public ihttpactionresult getbyname(string name) they called providing query string eg cats?catid=5 however mvc web api can't have multiple routes same (both routes "cats". how can work mvc web api recognize them separate routes? there can put route property? says ? invalid character put route. you can merge 2 actions in question one [httpget] [route("cats")] public ihttpactionresult getcats(int? catid = null, string name = null) { if(catid.hasvalue) return getbycatid(catid.value); if(!string.isnullorempty(name)) return getbyname(name); return getallcats(); } private ihttpactionresult getallcats() { ... } private ihttpactionresult getbycatid(int catid) { ... } private ihttpactionresult getbyname(string name) { ... } or more flexibility try route constraints referencing attribute rout

html - PHP Form Upload - Extension invalid when file left blank -

i have php form allows multiple uploads of accepted extentions: $allowedextensions = array("pdf","doc","docx","gif","jpeg","jpg","png","rtf","txt"); if extention isn't valid enters this: if(!in_array($ext,$allowedextensions)) { die("file $file_name has extensions $ext not allowed"); } at moment i'm getting error "file has extensions not allowed" when field left blank. have tried adding array empty" ", blank file's extention be? what best way around this? load in preset image when not filled in or have solution? here source code, maybe can else: <?php error_reporting(e_all); ini_set('display_errors', 1); if(isset($_files) && (bool) $_files) { $allowedextensions = array("pdf","doc","docx","gif","jpeg","jpg","png","rtf"

php - Codeigniter order_by name not working -

so pulling 10 records database @ time using ajax call. below code: public function get_next_10($offset = 0) { $this->db->limit(15, $offset); $query = $this->db->get("postovi"); return $query->num_rows() > 0 ? $query->result_array() : null; } i tried putting: $this->db->order_by("name", "asc"); but it's throwing error. its working fine public function get_next_10($offset = 0) { $this->db->limit(15, $offset); $this->db->order_by('name', 'asc'); $query = $this->db->get("postovi"); return $query->num_rows() > 0 ? $query->result_array() : null; }

javascript - Bubbling events in nested Backbone (Marionette) Models / Collections -

we have large marionette app, uses backbone.trackit monitor unsaved changes in our models. we have nested models, in fact have model, collection of models, contain collection of models. trackit doesn't support top level model being marked 'dirty' when child models change - due backbone not bubbling these change events. i know manually monitor these change events, im looking generic solution. has had experience of following libs or other solutions this? backbone-deep-model backbone associations events custom backbone.model.set override bubbles change events the immediate requirement trackit working nested events - cant find branches trackit add this. so wondering if has approached this, or used above libs in conjunction trackit ? ideally, if library trigger standard 'change' event way chain, trackit pick on , start working. so, if model.countries[3].regions[4].name changed, change:countries event triggered on model . if model had t

java - Include Null check in MongoRepository query by example -

i trying find collection match search criteria using mongorepository using following method: <s extends t> page<s> findall(example<s> example, pageable pageable); to building examplematcher fields included in search. so: private examplematcher buildmatcher(formsearchparameters formsearchparameters) { examplematcher examplematcher = examplematcher.matching() .withignorepaths("f1", "f2", "f3", "f4" , "f5"); if (!stringutils.isempty(formsearchparameters.getname())) { examplematcher = examplematcher.withmatcher("name", match -> match.regex()); } if (!stringutils.isempty(formsearchparameters.getfoo())) { examplematcher = examplematcher.withmatcher("foo", matcher -> matcher.exact().ignorecase()); } if (null != formsearchparameters.getfilter()) { examplematcher = examplematcher.withmatcher("filter", matcher -> ma

Extract static methods from main() file in java -

i'm quite new java , wrote little to-do list project. @ beginning of project added bunch of static methods file main() code is, , got little out of hand. want transfer these methods file. there proper way this, or have create sort of behaviour class these methods, , in main() create instance of call it's methods? you can extract these methods separate class (say fooutils ), , in main method can call them using class name - fooutils.somestaticmethod() depending on have, may make sense group methods different classes, or make them instance methods.

Ruby with EventMachine: How to get the body result automatically of the last_effective_url -

i have 'post' redirect 'get' in eventmachine using 'redirect =>1' redirect automatically. what 'post' redirect 'get' how can redirect automatically obtain latest url response (the 1 of last url, last_effective_url) should call(last_effective_url) inside call?? m sure there better way it. thanks def test em.run { http = eventmachine::httprequest.new("http://localhost:5000/foo/bar") .post({ :body => params.to_json, :head => { 'content-type' => 'application/json; charset=utf-8' } }) http.callback {
 p http.response_header.status
 p http.response_header
 p http.response
 p http.last_effective_url 
 eventmachine.stop
 }
} end => :test irb(main):247:0> test 302 {"connection"=>"close&

goto - Is there a way to jump to a defined by a variable in C? -

so, have program, store line number in variable, using int x = __line__; the value of x can keep changing. possible jump arbitrary line 1 given x, using goto or other keyword in c? i'm looking 'keyword' x; where program shifts line defined variable x. is there workaround if not possible? the gcc compiler supports, extension, using labels values can work them in way resembles you're after. it allows do: void *ptr = &&label; label: and then goto *ptr; to jump label . this typically useful inside core of virtual machine, , can of course lead horrible spaghetti. also, again, it's gcc extension (also supported clang, think).

osx - Git won't open diff tool in terminal -

when ' git pull ' in terminal, results in merge conflict. i have tried set default diff tool these conflicts using: git config --global merge.tool opendiff if type opendiff file1.txt file2.txt in terminal manually works, not work automatically merge conflicts. instead, after merge conflict vi text editor opened, not show actual conflict - screen can fill in commit message. am missing step set default merge tool? check if more complete merge.tool definition work better: git config --global merge.tool opendiff git config --global mergetool.opendiff.cmd 'opendiff -merge "$merged" "$local" "$remote"' git config --global mergetool.opendiff.trustexitcode false (and make sure opendiff in $path , should case already)

php - Laravel ReflectionException in Controller -

Image
i'm trying inject class hotelstransformer without success next code: usertransformer <?php namespace app\transformers; class usertransformer extends transformer { ... } hotelstransformer <?php namespace app\transformers; class hotelstransformer extends transformer { ... } apihotelscontroller <?php namespace app\http\controllers\api; use illuminate\http\request; use app\http\requests; use app\http\controllers\controller; use \app\hotel; use \app\transformers\hotelstransformer; class apihotelscontroller extends apicontroller { protected $hotelstransformer; public function __construct(hotelstransformer $hotelstransformer) { $this->hotelstransformer = $hotelstransformer; dd($this->hotelstransformer); } when inject usertransformer, it's ok, when change usertransformer hotelstransformer throws me error. i don't know why happening, because cloned usertransformer , change name same error persists.