Posts

How to show exactly three digits after decimal in legend bar when the values are created by linespace in Matlab -

i have 1 stupid question. have range of value like: n=linspace(1,2,15); now, want show these computed n value 3 digits after decimal in legend bar. have written code: n_rounded = round(n * 1000) / 1000; and in figure set value yticklable: set(h,'yticklabel', n_rounded); but value shown in legend bar didn't show 3 digits after decimal. example shows 1.5 instead of showing 1.500. need show 1.500 how can that? br, try set(h,'yticklabel', num2str(n_rounded, '%.3f\n')); thanks man (comment deleted) line break.

java - Unable to read entire POST request body content formatted as application/json -

i've been having issue jetty processing application/json formatted request body data. essentially, when request body processed jetty, request data cut off. i have relatively large post body of around 74,000 bytes. per advice found online, instantiated new context handler setmaxformcontentsize property set sufficiently large size of 500,000 bytes. servletcontexthandler handler = new servletcontexthandler(server, "/"); handler.setmaxformcontentsize(500000); however, did not seem work correctly. read online property might work form encoded data, not application/json , strict requirement of our application. is there way circumvent issue? there special constraint class can subclass allow processing size increase @ least 500kb? edit #1: should add tried drop size of limit 5 bytes see if cut off more of data in payload. didn't working, seems imply that's ignoring property entirely. edit #2: here read information request stream. @override prote...

performance - Ajax request delay 1 second -

Image
this time problem delay between ajax request, , php file response.i have checked out google chrome statistics, , shows exact 1 second wait time every time function loops , sends ajax request.this makes script pretty unusable cause slows much, browser get's unresponsive till executes full loop. i tried remove mysql queries, exclude mysql problem, , delay still existed.im pretty sure it's not mysql taking long execute. does have idea may delay caused on.maybe it's settings on pc, or ajax? thank maybe explain better. yes!i've figured out.apearantly mysql connection have taken it's time, reason i've used localhost initiate connection instead 127.0.0.1.now it's much faster! :d .no reason blaming ajax, simple 127.0.0.1 did trick.

PHP email content different on PC and iPhone -

i send email (in html format) in php using phpmailer library. my email displayed correctly on pc , iphone, no accents or other problems. but noticed concern in content: indeed, body of email contains characters " =da ". on pc, see " =da " on iphone, these 3 characters replaced " Ú ". the problem appears in body of mail. if display " =da " in email subject, see correctly on pc , iphone. nb : code files in utf-8 , make utf8_decode content of mail before sending (and remember have no worries or other accents). thank in advance help =xx , 2 hex digits commonly seen in emails use 'quoted printable' encoding. since you're using utf-8, won't using quoted printable encoding, sounds iphone may doing conversion anyway. may bug in iphone email client. my suggestion switch quoted printable mode. in phpmailer, this: $mail->encoding = 'quoted-printable';

ios - UITableView with Horizontally wrapping cells -

i looking how to, in swift , interface builder, create uitableview in xcode table has set width (example: padding left , right edges of superview might 8). in table, want cells go across first row. when new cell can no longer fit in first row want go second row. when new cell can no longer fit on second row, want go third row, etc. want table scroll vertically. if can point me examples or documentation on appreciate it. you looking uicollectionview . http://www.raywenderlich.com/78550/beginning-ios-collection-views-swift-part-1 https://developer.apple.com/library/ios/documentation/uikit/reference/uicollectionview_class/

c++ - Small sized binary searches on CUDA GPUs -

i have large device array inputvalues of int64_t type. every 32 elements of array sorted in ascending order. have unsorted search array removevalues . my intention elements in removevalues inside inputvalues , mark them -1 . efficient method achieve this? using 3.5 cuda device if helps. i not looking higher level solution, i.e. not want use thrust or cub, want write using cuda kernels. my initial approach load every 32 values in shared memory in thread block. every thread loads single value removevalues , independent binary search on shared memory array. if found, value set according using if condition. wouldn't approach involve lot of bank conflicts , branch divergence? think branch divergence can addressed using ternary operators while implementing binary search? if solved, how can bank conflict eliminated? since size of sorted arrays 32, possible implement binary search using shuffle instructions? help? edit : have added example show intend achieve. let...

javascript - How to place a new element exactly where a user clicks? -

i project below, set when click on ball(pin), follows , when click second time, ball returns original parent, , newly created ball appended newly created div, appended parent of element in clicked. my goal: have click exact point of newly created ball positioned. issue: have alert shows coordinates of click, , when inspect element after clicking, shows newly created ball has acquired properties. problem is, not every time seem line clicked. i'm getting dom manipulation, please explain in detail, how went solving problem. here code reviewed: http://codepen.io/jobenscott/pen/epzxzq if (elementmouseisover != thefrigginpin) { console.log("the 1 want, doesn't working further"); alert("x: " + relativex + " y:" + relativey); elementmouseparent.append($newhiddenelement); pinnedpinpositioned.appendto($newhiddenelement); pinnedpinpositioned = brandnewpin.css({ left: relativex, // left: e.clientx, ...