Posts

Showing posts from May, 2012

jquery - Datatables server side data response error -

i getting following error when try fetch data server side script datatables warning: table id=example - requested unknown parameter '0' row 0. more information error, please see http://datatables.net/tn/4 what doing wrong ? here's html <script> $(document).ready(function(){ $('#example').datatable({ serverside: true, "columndefs": [ { "title": "sr.", "name": "sr", "width": "5%", "targets": 0 }, { "title": "ecode", "name": "code", "width": "5%", "targets": 1 }, { "title": "employee name", "name": "name", "width": "25%", "targets": 2 }, { "title": "guardian", "name": "guardia...

android - Adding a shadow to Sliding Drawer -

i knew sliding drawer deprecated. imported sliding drawer class own package , customized satisfy requirements. scenario is, want add shadow wraps both handle , content of sliding drawer. if add shadow handle , content separately (by giving image shadow background both handle , content),then shadow makes gap between handle , content. not requirement. please guide me through this. navigationdrawer.setdrawershadow(r.drawable.somedrawable,gravitycompat.start); you need use drawable shadow. use setdrawershadow method on navigationdrawer object.

ios - Setting background color apply on part of screen -

i using swift set background color viewcontroller: self.view.backgroundcolor = uicolor.blackcolor() but part of screen still painted in white why that? make sure have assigned class (.swift file) viewcontroller in storyboard. double check in storyboard not have added view whole screen(controller).

.net - System index out range exception C# -

i have following code: using mysql.data.mysqlclient; using system; using system.collections.generic; using system.data; using system.linq; using system.text; using system.threading.tasks; namespace timeclock { class company { datatable rows = new datatable(); public company() { mysqlconnection connection = null; try { string connectionstring = timeclock.properties.settings.default.timeclockconnectionstring; connection = new mysqlconnection(connectionstring); connection.open(); mysqlcommand command = new mysqlcommand("select * companies id = @id limit 1", connection); command.parameters.addwithvalue("@id", timeclock.properties.settings.default.companyid); mysqldataadapter da = new mysqldataadapter(command); da.fill(rows); } catch (mysql.data.mysqlclient.my...

Apply jQuery.get() on dropdown menu -

Image
so, have dropdown menu using <ul> <li> menu </li> <ul> . now, 1 of items has large file size , thinking of applying jquery.get() reduce loading amount , speed until clicked. so, example, have following menu: <ul> <li> <button type="button"> <div class="_menu_title">map</div> </button> <ul class="dropdown_menu_sub"> <li class="dropdown_menu_sub_list"> <div class="google_map"> google map content goes here </div> </li> </ul> </li> </ul> here, when map button clicked, google map shown in menu. however, noticed slows down loading thinking unless map button clicked, don't want map content loaded. how can apply loading screen (to give user feedback happening) , load content using jquery.get()? you can ad...

ruby on rails - Facing issue NoMethodError (undefined method `include' for "56":String): -

i facing issue while writing code def sim_state sim_employees = simemployee.find(params[:id].include(:employees)) respond_to |format| format.js { render :layout => false, :locals => { :sim_employees => sim_employee } } end end and in sim_states.js.erb $('#simstate').text('<%= sim_employee.employees.app_state%>'); so gives me error nomethoderror (undefined method `include' "56":string): when use includes gives undefined method `includes' please guide me how solve this. the reason simple params[:id] is return string value "56" , includes works activerecord::relation , not string. not able fire query ways. simemployee.find(params[:id]) this return again result , not relation. try using simemployee.where(id: params[:id]).includes(:employees).first this should you. ps : using includes 1 record same ...

javascript - How to set selected value into p:selectOneMenu? -

i have p:selectonemenu : <p:selectonemenu styleclass="categorylist" filter="true" id="parentcategorylist" style="width: 200px" effect="fade" panelstyleclass="categorylistpanel" converter="#{categoryconverter}" widgetvar="categorylistwv" value="#{categoryservice.category}"> <p:ajax event="change" update="@this" /> <f:selectitem itemlabel="no parent" /> <f:selectitems var="currcateg" value="#{categoryservice.categories}" itemlabel="#{currcateg.name}" itemvalue="#{currcateg}" /> </p:selectonemenu> i need set value via javascript. in web found solution: widgetvar.selectvalue(val...

string - Pluralize method for different language in Ruby on Rails -

i using pluralize method in html files dynamic value user can set per locale. i.e. if user sets label department german word "abteilung", append 's' per current rails inflection rules pluralize string. resulting word "abteilungs" , there no such word in german. i researched , there no such inflection rules specific language. there may many such words in many languages can't make custom inflection rules. not using i18n or tr8n internationalizing such words. can suggest can resolve this?

android - Image's are loading with black background -

Image
i loading image web-service in dynamic horizontal linear layout .some of phones showing images black background moto-x android4.4.4 see image below but on moto-e android 4.4.4 .its showing image correctly check image below instead of imageview, use imagebutton , set android:src image , background color transparent/white.

javascript - Find closest element by attribute -

i have vote snippet, , i'd add disabled class other button user press. example if user vote + on id 1 post - button disabled class, not id 2 ones. <span class="pull-right"> <a href="javascript:void(0)" class="vote" data-id="1" data-type="up">+</a> <span id="votes-1">0</span> <a href="javascript:void(0)" class="vote" data-id="1" data-type="down">-</a> </span> <span class="pull-right"> <a href="javascript:void(0)" class="vote" data-id="2" data-type="up">+</a> <span id="votes-2">0</span> <a href="javascript:void(0)" class="vote" data-id="2" data-type="down">-</a> </span> i tried several things .closest()...

python - How to restore a builtin when parameter has same name? -

i know you're " not supposed to " use builtin names parameters functions, make sense: def foo(range=(4,5), type="round", len=2): but if has been done, , range variable has been processed , no longer needed, how builtin range , use inside foo() ? del range doesn't restore builtin: unboundlocalerror: local variable 'range' referenced before assignment for python 2.x import __builtin__ range = __builtin__.range for python 3.x import builtins range = builtins.range

Sorting within each category separately in R -

i have set of 4000 data points, each specifying time @ incident happened , site @ happened, , there 165 sites. want list of inter-incident times @ each site. if there 1 site, sort times increasing order (t_1 < t_2 < ... < t_n) , find differences s_{n+1} = t_{n+1}-t_n. want separately @ each site. ultimately each data point specify site , list of inter-incident times. another complication: may worth keeping inter-incident times in chronological order. the r commands sort(times) and site[order(times)] would me somewhere if didn't want each site separately. how can in r? using dplyr , this, depending on how data laid out (a dput help): library(dplyr) df %>% group_by(site) %>% arrange(times) %>% mutate(difference = c(0, diff(times)))

javascript - Calling a parameterized callback function within a mongoose async callback function becomes 'undefined' -

i having weird problem calling callback inside callback mongoose. setup : mean stack. myfunc = function (cb) { var projection = { '_id': 0, 'var1': 1, 'var2': 1 } var order = { 'var1': 1 } user.find({}) .select(projection).sort(order) .exec(function(err, docs){ if(err){ console.log(err); cb(err,docs); } else { console.log(docs); cb(err,docs); } }); }; going lines cb(err,docs) result in "referenceerror: cb not defined" the weird part have functions deeper nested callbacks can invoke "cb" normaly. myfunc = function(cb){ model1.count({var1:'test'}, function (err, count) { if(count) { model2.findone({dat1:'hoho'}, function (err, doc){ if (err) { console.error(err); ...

vba - how to return a value of variable from one module to another? -

1st module.. public sub directory_path() dim directory string directory = inputbox("enter directory path contains folders ""this quarter"",""last quarter"",""second_last_quarter"".") if right(directory, 1) = "\" directory = left(directory, len(directory) - 1) end if end sub i called the first module in 2nd module using public sub directory_path() . want directory variable in first module used variable in 2nd module... me. miss something... if question repeated, please answer me , delete post. the obvious solution make function... public function directory_path() sting dim directory string directory = inputbox("enter directory path contains folders " & _ """this quarter"",""last quarter"",""second_last_quarter"".") if right(directory, 1) = "\" ...

java - How to get the Exception from a test target method if it's been caught -

i want expect target method cause exception , target method has try-catch block deal exception, can't exception in test method. you have test target method , junit must according it.if in target method, exception being caught , processed junit test case must assert in no condition target method ends in exception. check being done in catch block of target method , write junit check proper functioning of code in catch block.

mysql - Joining three tables such that extra matches are discarded? -

how can write query give results of 3 tables such there's 1 result per "line"? the tables are: t1 (id, name, ip) t2 (id, date_joined) t3 (id, address, date_modified) the relations are: t1-t2 1:1 , t1-t3 1:m - there can many address rows per id in t3. what want listing of users fields above, if have address, want record 1 (bonus if latest 1 based on t3.date_modified). so should end number of records in t1 (happens equal t2 in case) , no more. i tried: select t.id, t.name, t.ip, tt.id, tt.date_joined, ttt.id, ttt.address t1 t join t2 tt on (t.id = tt.id) join t3 ttt on (t.id = ttt.id) and every sensible combination of left, right, inner, etc joins think of! keep getting multiple duplicate because of t3 this query should work: select t1.id, t1.name, t1.ip, t2.date_joined, t3x.address t1 join t2 on t1.id = t2.id left join ( select t3.* t3 join ( select id, max(date_modified) max_date t3 group id ...

javascript - 'this' and 'prototype', simple function -

i trying resolve problem need understand prototype. i reading , thought got it, still having complications function person(name){ this.name = name; } person.prototype.greet = function(othername){ return "hi " + othername + ", name " + name; } var kate = new person('kate'); //name var jose = new person('jose'); //othername ??? so, mistake when need call function ? or ? the name property of object instance, need use this.name in greet method. from understand, need display hi jose, name kate greeting. in case need pass other person greet method can access persons name using object.name function person(name) { this.name = name; } person.prototype.greet = function(other) { return "hi " + other.name + ", name " + this.name; } var kate = new person('kate'); var jose = new person('jose'); snippet.log(kate.greet(jose)); <!-- provides `snippet` object, see http://...

php - I am writing a script to embed Youtube or vimeo videos into magento product page -

youtube embed code has letters , vimeo embed code has numbers example v?cvxmbd5 , vimeo vimeo.com/6847539 . writing script pull end of embed strings letters match top iframe , pull end of embed strings no letters match bottom iframe. this script supposed embed videos video tab on product view page. <?php $_product = $this->getproduct(); if ($_product->getvideo()) $videos = explode(', ', $_product->getvideo()); foreach ($videos $video) { if (ctype_digit($video)) { echo "<iframe width = '560' height = '315' style = 'max-width:100%;' src = 'https://player.vimeo.com/video/" . $video . "' frameborder = '0' allowfullscreen></iframe>"; } else { echo "<iframe width = '560' height = '315' style = 'max-width:100%;' src = 'http://www.youtube.com/embed/" . $video . "' frameborder = '0' allowfullscreen></iframe>"; } } ?...

Ruby on Rails: Associations User to Orders -

only admin can create orders. orders assigned user user_id. on users profile page, place user can see records. have feeling problem controller. i'm new, please bare me. thanks! class orderscontroller < applicationcontroller before_action :set_order, only: [:show, :edit, :update, :destroy] # /orders # /orders.json def index @orders = order.all end # /orders/1 # /orders/1.json def show end # /orders/new def new @order = user.find_by(params[:id]).orders.build end # /orders/1/edit def edit end # post /orders # post /orders.json def create @order = current_user.orders.build(order_params) respond_to |format| if @order.save format.html { redirect_to @order, notice: 'order created.' } format.json { render :show, status: :created, location: @order } else format.html { render :new } format.json { render json: @order.errors, status: :unprocessable_entity } end ...

c++ - Segmentation fault in a nested loop for doing calculations using each 2 elements in vector -

i have time consuming function, needs calculation using each 2 elements in std::vector . way doing is, std::vector<int> vec; (auto = vec.begin(); != vec.end(); ++ it) (auto it2 = vec.begin(); it2 != vec.end(); ++ it2) if (it2 != it) f(*it, *it2) // function i wondering if there other better ways this, because process cost time. besides, have tried use openmp parallelize outer loop, works fine when use std::vector , if similar things std::map , returns segmentation fault. updates parallel loop. the thing doing calculate music similarity using music tags. tags of each music in std::map called map_tag , , song ids in vector called song_vec . did not use iterator here, major part of code below. seems problems happen when reading data map_tag , because if remove part parallel loop works fine. unsigned int finishcount = 0; std::map<std::string, std::vector<std::string>> map_tag; #pragma omp parallel shared(finishcount) num_threads(2) { ...

c# - Make a page to be accessible only from server -

i have pages executed scheduled tasks regularly on server. how can make these pages accessible server? want if page url used anywhere other server should return empty page. by way, don't want compare request.servervariables["remote_addr"] hard coded ip address edit after original question edited: create second web app on port that's not open. original answer: looks ip request comes. if different server's ip, reject call. here's how can ip how user's client ip address in asp.net?

cloud9 ide - How to run protractor remotely? -

i looking way run/create protractor tests remotely because not able run locally on machine. has experience running commandline on site cloud 9 , protractor? please check out how make protractor work while using cloud9? provides instructions on using protractor cloud9.

javascript - Disabling click event of Controls in Table Data -

Image
i have list of controls in table data enclosed in div tag parent tag , want disable click events on power on , power off button . presently if click buttons request sent website iot . want disable click event on these 2 items . here code looks : <table class="pure-table pure-table-horizontal" style="width: 90%;"> <thead> <tr> <th>#</th> <th>device name</th> <th>status</th> <th>temperature (&#176; c)</th> <th align="left">action</th> </tr> </thead> <tbody> <% devices.foreach(function(device, i){ %> <tr> <td><%= (i + 1) %></td> ...

objective c - Core Data Many to Many Reflexive Relationship -

how model following in core data. entity called task attribute called name. tasks can have task dependencies including task parents must completed prior completing task. tasks have inverse of children require task completed prior completing themselves. screenshot 1 screenshot 2 i have modeled in above screenshot, data not persist between app restarts. should using intermediate join entity? modeling , persisting have nothing each other. model looks fine. look @ code , see saving. make sure save code firing. all relationships populate, , there no errors on save call. issue when stop app (after saving) , restart, relationships empty you not giving detail go on here. not normal state being missed. how setting relationship between 2 managed objects? please show example of code. how testing relationship later? again, showing code make easier solve.

c# - While loop Does not finish even when statement goes false -

i'm writing winform application control encoder engine via serial port. protocol quite simple, send 1st command ask engine moving, , 2nd command confirm it's been in new position, , on other places. here code this: string dataread =""; serialport1.write("p.1=2950\r\n"); //location register (2950) serialport1.write("^.1\r\n"); //moving command while (dataread.contains("px.1=2950") == false) { serialport1.write("?96.1\r\n"); //ask current location respond3 = serialport1.readexisting(); dataread = string.concat(dataread, respond3); } //keep moving 710 after stop @ 2950 serialport1.write("p.1=710\r\n"); //location register (710) serialport1.write("^.1\r\n"); //moving command the problem is, when debug app, it's stuck in while-loop. if break all, , continue again, pass. respond3 used output engine. whenever gets correct respond, while-loop finish. the problem code how readexisting ...

How to open and save/close file using powershell -

i'm looking create hotkey on f10 will, when pressed, open text file named notes. simple part, is: c:\users\matt\notes.txt but want press of same hotkey save file , exit. i interested in script, can run powershell through hotkeys. firing off editor script simple as: $proc = start-process -filepath c:\bin\notepad++.exe -arg c:\users\matt\notes.txt -passthru the trickier part figuring out how save & close file. if editor happens have com object model, use doubt editor word. :-) another general approach use winforms sendkeys functionality. better approach use windows ui automation framework drive ui of arbitrary apps. there's powershell module wraps api make easy use powershell. called uiautomation . here example of how used: start-process calc -passthru | get-uiawindow | get-uiabutton -name [1-3] | invoke-uiabuttonclick; you substitute $proc start-process calc -passthru bit above.

java - Cross-classloader class loading -

i have customclassloader loads classes map<string, byte[]> . classes loading depend on other, unloaded classes. have jar files contain said classes in urlclassloader initiated before customclassloader , when customclassloader tried load class has external import (a jarfile in urlclassloader) exception thrown: exception in thread "main" java.lang.noclassdeffounderror: external/class/in/urlclassloader/classimportedbyloadedclass @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(classloader.java:760) @ java.lang.classloader.defineclass(classloader.java:642) @ customclassloader.defineclass(encryptedbytearrayclassloader.java:35) i need way either: a) load classes in urlclassloader or b) have way set urlclassloader default classloader classes being loaded memory (instead of customclassloader) line 35: public class<?> defineclass(string name, byte[] bytes) { return super.defineclass(name, bytes...

mysql - Catchable fatal error: Object of class mysqli_result could not be converted to string in C:\wamp\www\well01\GapReport\gap_analysis.php on line 31 -

i keep receiving "catchable fatal error: object of class mysqli_result not converted string in c:\wamp\www\well01\gapreport\gap_analysis.php on line 31" error , life of me can't see why fetch_assoc not working. can see wrong code? i'm noob please forgive faux pas feel free point them out can improve result. <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>gap analysis report</title> </head> <body> gap analysis of <?php echo htmlentities($_get["project"])."<br/>";?> </body> </html> <?php /* create database connection */ include 'database.php'; /* set variables */ $project = mysqli_real_escape_string($dbcon, htmlentities ($_get["project"])); /* match conditions ensure items same project_id retrieved */ $project_id = mysqli_query($dbcon, "select id well...

When would you write an infinite loop in Java? -

what practical applications infinite loops in java? for example: while(true){ //statements, loop never set false } when use this? infinite in sense until changes want keep running. until user hits "exit" keep running program. in example need in code break it. if (this happens) break end but might put boolean instead of counter < 1 in while loop. in example it's bad practice. program guess age initialize age while (age != 20) guess user age = guess user end

mongoose validate check database -

is possible have validation in mongoose checks database? i need have this var validemail = require('../helpers/validate/email'); var validdoctor = require('../helpers/validate/doctors'); var schema = mongoose.schema({ email: { type: string, validate: [validemail, "invalid email"], doctor: {type: string, validate: [validdoctor, "invalid doctor"] } and validdoctor like: module.exports = function (doctor) { doctors.findone({email:doctor}, function (err, found) { return (found); }); i have tried put scripts in pre , post hooks, , code getting sloppy. have have validation this you need async validation accepts second argument callback function called either true or false denoting successful or failed validation respectively module.exports = function (doctor, done) { doctors.findone({email:doctor}, function (err, found) { if(found) done(true); else done(false); });

python - pandas dataframe format from elements with multiple identifiers -

i have csv file following format. imagine white spaces comma seperated. slot0 slot1 serial timestamp height width score height width score .... fa125 2015_05 215.00 125.01 156.02 235.23 862.23 135.52 .... this goes on thousands of rows , repeats many slot#'s pattern. slot# associated "height, width, , score" centered on. is, slot0 corresponds first height, width , score , slot1 corresponds second height, width , score. each slot has 3 measurements. i'm having trouble finding best way stick data pandas.dataframe associate slot number particular heights, widths , scores, serial or timestamps. one thing have thought of this, it's not clear if can better. serial timestamp s0_height s0_width s0_score s1_height s1_width s1_score .... fa125 2015_05 215.00 125.01 156.02 235.23 862.23 135.52 .....

python - Why does my use of click.argument produce "got an unexpected keyword argument 'help'? -

running following code results in error: typeerror: __init__() got unexpected keyword argument 'help' import click @click.command() @click.argument('command', required=1, help="start|stop|restart") @click.option('--debug/--no-debug', default=false, help="run in foreground") def main(command, debug): print (command) print (debug) if __name__ == '__main__': main() full error output: $ python3 foo.py start traceback (most recent call last): file "foo.py", line 5, in <module> @click.option('--debug/--no-debug', default=false, help="run in foreground") file "/home/cbetti/python/lib/python3/dist-packages/click-4.0-py3.4.egg/click/decorators.py", line 148, in decorator _param_memo(f, argumentclass(param_decls, **attrs)) file "/home/cbetti/python/lib/python3/dist-packages/click-4.0-py3.4.egg/click/core.py", line 1618, in __init__ parameter.__in...

HTML5 audio not scaling on iPhone -

i got request on friends website. there html5 elements , play button barely visible on iphone (using 5s). shifts until zoom in 100% zoom. added viewport meta tag , css audio { height:0; width:0; } but no luck. ideas? site: http://bit.ly/1hy9i57

css - Stop Resizing Text in Mobile -

folks, so trying eliminate auto-text resizing in mobile browsers website ( boxangeles.com ) makes layout horrible, imo. it seems sections have issue referencing css -- #newpost { background-color: white; border: 1px solid #ec0000; border-radius: 7px; font-size: 20px; line-height: 115%; margin-bottom: 15px; padding: 15px; width: 690px; margin: 0px 15px 15px 0px;} #newpost img { border: 1px solid #ec0000; margin-left: auto; margin-right: auto;} #newpost a:hover { text-decoration: underline;} and text sections work fine using css -- .post-block { background-color: white; border: 1px solid #ec0000; border-radius: 7px; font-size: 20px; float: left; height: 165px; line-height: 115%; margin: 0px 15px 15px 0px; padding: 10px; width: 700px;} p.post-block a:hover { text-decoration: underline;} .post-block a:hover { text-decoration: underline;} .post-block .thumb { background: url(images/thumbbg.jpg) no-repeat; float: left; height: 150px; padding: 4px; margin: 2px 7px 2px 2px;...

javascript - Making carousel, can't scroll after click function animates (JSFiddle link updated) -

problem i'm trying make carousel, when person clicks arrow page .animate , scrolls previous chapter in story. however, after happens page appear stuck , can't scroll anymore. i'm wondering why happening? update #2 - jsfiddle updated: http://jsfiddle.net/vzt2s4b5/4/ $(function(){ /* ------------------------------------- global variables --------------------------------------*/ var nav = 72.5; var splash = 750 + nav; var 1 = $(".one").offset().top - nav; var 2 = $(".two").offset().top - nav; var 3 = $(".three").offset().top - nav; var 4 = $(".four").offset().top - nav; var 5 = $(".five").offset().top - nav; /* ------------------------------------- progress bar --------------------------------------*/ $(window).scroll(function(){ var scroll = $(window).scrolltop(); var documentheight = $(document).height(); var windowheight = $(window)...

java - Try Catch Block Not Working Inside OnClickListener() -

this question has answer here: how fix android.os.networkonmainthreadexception? 45 answers i working on project control lights using arduino + ethernet shield + android app. using android studio app development purpose. issue is, try-catch block has been implemented inside onclicklistener() doesnt seem work. new android app development , cant think of solution same. app installed buttons not perform function. i.e. server doesnt receive package. actually, targetsdkversion set 8, hence holo theme , buttons worked properly. once set 22 (lollipop) material theme gets applied default , buttons no longer work. thanking in advance. public void led(string s) throws exception { byte[] b=(s.getbytes()); if(isonline()) { serverhostname1 = new string ("192.168.1.177"); ip = inetaddress.getbyname(serverhostname1); d1 = new datagramsocket();/...

sql server - Poor Performance on SPs and a Simple Query -

we have staging db (sql server 2012) vm , clustered production db (sql server 2008). both have same db schema. staging has little less data not difference. recently notice production db 4-5 times slower staging when run same stored procedure on both. statistics io can see in general production db has lot more logical reads. they both have same schema couldn't index issue. possible there's wrong memory on production? updated i notice in client statistics, staging db's "wait time on server replies" lower (8-12) production (160-170) looking @ different angle: have taken @ actual execution plan see if can improve performance of query without taking account query executes faster on staging environment? (sometimes small changes in data can lead slower queries)

python - opencv connectedComponentsWithStats -

first post here! i installed python-opencv. according python version is: >>> import cv2 >>> cv2.__version__ '2.4.8' my ubuntu version 14.04. i started python-opencv tutorial suggested code: img = cv2.imread('opencv_chessboard.png') gray = cv2.cvtcolor(img, cv2.color_bgr2gray) # find harris corners gray = np.float32(gray) dst = cv2.cornerharris(gray, 2, 3, 0.04) dst = cv2.dilate(dst,none) ret, dst = cv2.threshold(dst,0.01*dst.max(),255,0) dst = np.uint8(dst) # find centroids ret, labels, stats, centroids = cv2.connectedcomponentswithstats(dst) # define criteria stop , refine corners criteria = (cv2.term_criteria_eps + cv2.term_criteria_max_iter, 100, 0.001) corners = cv2.cornersubpix(gray,np.float32(centroids),(5,5),(-1,-1),criteria) # draw them res = np.hstack((centroids,corners)) res = np.int0(res) img[res[:,1],res[:,0]]=[0,0,255] img[res[:,3],res[:,2]] = [0,255,0] cv2.imwrite('subpixel5.png...

bluetooth - Alt Beacon Android unstable -

i building android application based on alt beacon. should preface fact test device digiland (p-o-s) tablet running android 4.4. i using radius networks usb beacon , alt beacon library found here: https://github.com/altbeacon/android-beacon-library in both own application , in reference application provided library seeing significant instability / extremely slow detection times beacon. example, can see reference application's log below. tablet sitting no more 1/2 meter away beacon whole time. has seen behavior before? doing wrong? broadcast rate on beacon appears set 10hz , power seems set maximum. should different device , try on that? saw other posts suggested turning off wifi did, , log trial wifi off. one thing should note have increased scan frequency following block of code in application subclass: beaconmanager.setbackgroundbetweenscanperiod(9000l); beaconmanager.setbackgroundscanperiod(1000l); beaconmanager.setforegroundbetweenscanperiod(9000l); beaconmanager...

c# - Error: A potentially dangerous Request.Form value was detected from the client -

i use ajax function send data server: function createbuffer() { var xmlsel = parent.parent.mapframe.getselectionxml(); alert(xmlsel); $.ajax({ type: "post", url: '../../taskpanel/createbuffer', data: { "session": '@viewbag.session', "mapname": '@viewbag.layout', "selection": xmlsel }, success: function (result) { parent.parent.zoomtoview(-87.708421, 43.745046, 7196.85673, true); } }); } using row in action method on server retrive xml: public void createbuffer() { string selectionxml = request.params["selection"]; } but in row: string selectionxml = request.params["selection"]; i error: additional information: potentially dangerous request.form value detected client (selection="<?xml version="1.0" ..."). any idea why error above? ...

java - what is the standard output foreman? -

i have following java code system.out.println(client.resource(restful_url_disciplinas)); system.out.println(client.resource(restful_url_disciplinas).path(id.tostring())); system.out.println(client.resource(restful_url_disciplinas).path(id.tostring()).path("curso")); webresource webresource = client.resource(restful_url_disciplinas).path(id.tostring()).path("curso"); why not display when use following command: ┌─[ricardoramos]@[falcon]:~/projetos eclipse/local-clienterest └──> $ foreman start 19:21:45 web.1 | started pid 19740 19:21:45 web.1 | 2015-07-01 19:21:45.879:info:omjr.runner:runner 19:21:45 web.1 | 2015-07-01 19:21:45.880:warn:omjr.runner:no tx manager found 19:21:45 web.1 | 2015-07-01 19:21:45.917:info:omjr.runner:deploying file:/home/ricardoramos/projetos%20eclipse/local-clienterest/target/clienterest-0.0.1-snapshot.war @ / 19:21:45 web.1 | 2015-07-01 19:21:45.943:info:oejs.server:jetty-8.y.z-snapshot 19:21:46 web....

javascript - jshint - Don't make functions within a loop - google maps -

i created google map markers (from wordpress posts), when run "gulp" on console have error: "don't make functions within loop." i created jsfiddle replicate localhost situation, please me fix issue? i know if write "// jshint ignore:line" gulp create script, think problem problem of bug have on chrome :( var infowindow = new google.maps.infowindow(); var gmarkers = []; function initialize() { map = new google.maps.map(document.getelementbyid('map'), { zoom: 10, center: new google.maps.latlng(51.508293, -0.127701), maptypecontrol: false, pancontrol: false, zoomcontroloptions: { position: google.maps.controlposition.right_center }, maptypeid: google.maps.maptypeid.roadmap }); (var = 0; < locations.length; i++) { var marker = new google.maps.marker({ position: locations[i].latlng, icon: locations[i].marker, map: map, animation: google.maps.animation.drop, ...

jquery - Find and replace within attribute values -

i have html code: <div class='images'> <img class='thumbnail' src='background/01.png' /> <img class='thumbnail' src='background/02.png' /> <img class='thumbnail' src='background/03.png' /> <img class='thumbnail' src='background/04.png' /> <img class='thumbnail' src='background/05.png' /> </div> i looking change every "background" "category". using jquery snippet: jquery(document).ready(function(){ $('.thumbnail').attr('src', $('.thumbnail').attr('src').replace('background', 'category')); }); but result : <div class='images'> <img class='thumbnail' src='category/01.png' /> <img class='thumbnail' src='category/01.png' /> <img class='thumbnail' src='category/01.png' /> ...

javascript - Angular Checkboxes not Binding Properly -

having trouble figuring out problem involving angular checkbox form generated api. i can create checkboxes 2 problems: checkedness of boxes not match values in what's coming api, , when click checkboxes name value changes default "true" or "false." have seen other similar questions can't work. plunk here , source code below: <!doctype html> <html ng-app="checktest"> <head> <meta charset="utf-8"> <title>angular multiple checkboxes</title> <style> label {display:block;} </style> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.js"></script> <script type="text/javascript"> var jsonobj = {"fruits":[ { "name": "apple", "desc": "abcdefg", "selec...

Is it possible to have multi realm security with the Grails Spring Security Plugin? -

i have found few examples of how spring security supports ability use different authentication mechanisms different url patterns. use case want distinguish between browser authentication , restful api key authentication depending on url. http://www.javacodegeeks.com/2012/08/spring-security-two-security-realms-in.html today use 2 grails apps accomplish separation. have seen shiro plugin has concepts of realms know if possible accomplish spring sec plugin? from further research believe employing filter chain map it's possible assign specific filter particular urls new filter can created handle rest requests. grails.plugin.springsecurity.filterchain.chainmap = [ '/web/**': 'webfilter1,filter2,filter3,filter4', '/rest/**': 'restfilter1,filter3,filter5', '/**': 'joined_filters', ]

c++ - Enabling `-std=c++14` flag in Code::Blocks -

Image
i have installed code::blocks windows , want compile c++14 code generic lambdas binary version of code::blocks i've installed codeblocks.org doesn't support flag -std=c++14 . how update compiler , enable -std=c++14 flag code::blocks? to compile source code using c++14 in code::blocks, first of need download , install compiler supports c++14 features. here’s how can on windows: download mingw here (particular build) or from official site choose options extract example: c:\ (result c:\mingw) open code::blocks go settings => compiler. go “toolchain executables”. in top field “compiler’s installation directory”, change directory 1 extracted compiler. e.g c:\mingw. change necessary files under “program files” match files under c:\mingw\bin: before hit “ok”, go leftmost tab “compiler settings”. select “compiler flags”. for simplicity, right click in list somewhere , select “new flag”: type in following , click "ok", , tic box o...