Posts

Showing posts from February, 2013

javascript - How to Bind Attribute from Custom Polymer Element to angularjs -

i created custom element called my-slider-input computes values user input. need take use these values in angular controller. i'm wondering what's best practice this? given polymer element: <dom-module id="my-slider-input"> <style> :host { display: block; } </style> <template> <button id="input1">input 1</button> <button id="input2">input 1</button> <button id="input3">input 1</button> </template> </dom-module> <script> (function() { polymer({ is: 'my-slider-input', properties: { value: { type: object, computed: 'computeoutputs()', reflecttoattribute: true, notify: true }, output1: { type: number, reflecttoattribute: true, notify: true }, output3: { type:...

Wordpress - How to create new post from form without admin review? -

i have website built wordpress, users can sign in , post articles in dedicated pages. can create new articles compiling form website. article visible in own page after admin (me) approved it. well, want skip step , make users able publish new articles without admin review. there plugin can that? i'm new wordpress, every appreciated :) yes- of user-submission plugins i've seen have option. one, example: https://wordpress.org/plugins/user-submitted-posts/ has option publish user submissions immediately.

javascript - Parsing handshake.headers['cookie'] -

i want read cookies code: handshake.headers['cookie'] and result: io=mqkovevaz4boro_2aaaa; connect.sid=s%3aerno3mbdek5ymjmcnx4r8gatiooaoj3j.dr1w1a%2fj9fqfzbcjanja6qhnafad8us5zzdgh2d%2bhvc; locale=fa; mongo-express=s%3azd796v1rcrpny8qivdvpeoxu.%2b9mlars1slobgd1kgewr%2bumi1psoneav1svshbsjvbm but how can locale value? how can parse string?

playframework - Logback encoder layout for processing output of org.jboss.netty.handler.logging.LoggingHandler -

i using play 2.3 develop application , has enabled netty log wire using -dhttp.netty.log.wire=true when starting play application. have set level="debug" of logger org.jboss.netty.handler.logging.logginghandler in custom logger.xml file have added conf directory of play application. next wanted take log messages logger file rolling policy. this, have following configuration in logger.xml file. <configuration> <conversionrule conversionword="coloredlevel" converterclass="play.api.logger$coloredlevel" /> <appender name="stdout" class="ch.qos.logback.core.consoleappender"> <encoder> <pattern> %coloredlevel %logger{15} - %message%n%xexception{5} </pattern> </encoder> </appender> <appender name="access_file" class="ch.qos.logback.core.rolling.rollingfileappender"> <fil...

android - Intercept message from specific number in Ionic Framework -

i developing mobile app using ionic framework. found cordova-plugin-sms ( https://github.com/floatinghotpot/cordova-plugin-sms ) can used send sms particular number without opening native app. i wanted know if there way use app process text received 1 specific number only? i.e, if message comes number +1234, app should able read it, if sms arrives number, let native sms app handle it.

c# - How to wait for a return value from an event handler without blocking main UI thread -

so have method uses library generate external webpage allow user enter facebook credentials verification. upon entering creating profile based on user's account , saving database. once save database expecting boolean represent whether or not account unique. need way wait database complete of work before continuing execution. i've tried several different methods including doing work on new thread (which won't work since ui needs on main thread) using autoresetevent wait auth.completed event fire. when using block thread , not present our external webpage user. whats making more complicated trying deal different events without getting ahead of ourselves. first need wait auth.completed fire, inside event need wait asynchronous request.getresponseasync().continuewith<task<bool>>(async t => ... event finish, , wait database complete task , somehow push return value way calling procedure. as of right now, code perform desired functions, return false s...

jquery - Select text within h4 -

how grab text 'peanut brownie' when button pushed. <div class="col-sm-4 col-lg-4 col-md-4"> <div class="thumbnail"> <img src="images/peanutbrownie320x150.jpg" alt="afghan"> <div class="caption"> <h4 class="pull-right">$12.00</h4> <h4>peanut brownie</h4> <p>one dozen (12)</p> <div class="row"> <div class=".col-md-8 addtocart"> <button type="button" class="btn btn-primary">add cart</button> </div> </div> </div> </div> </div> i have tried ... $( "button" ).on( "click", function() { alert( $(this).closest('h4').text() ) }); and few other tricks empty alert. you ...

windows - calling batch file that calls yet another batch file fails -

i have batch file a.bat looks this: call some.bat java -cp "saxon9he.jar" net.sf.saxon.transform abc.xml des.xsl > des.xml call subfolder\other.bat and other.bat in subfolder looks this: call yet_another_batch.bat java -cp "../saxon9he.jar" net.sf.saxon.transform any.xml try.xsl > try.xml java -cp "../saxon9he.jar" net.sf.saxon.transform ../some.xml test.xsl so in first file ( a.bat ), call batch file in same folder , xsl scripts in same folder write xml files same folder. first batch script ( a.bat ) i'd call subfolder\other.bat . however, when that, fails call yet_another_batch.bat in subfolder , xsl scripts in subfolder , doesnt find saxon9he.jar. what's correct way this? have add folder name files referenced in subfolder\other.bat ? seems little cumbersome. i'm on windows 7, if changes anything. add 2 lines lines other.bat this: pushd "%~dp0" call yet_another_batch.bat java -cp "../sa...

javascript - Angular View not updating after retrieving data from database -

i working on app retrieves data on of change of $routeparams. here's how begins: function artistctrl($scope, $http, $location, datafactory, $routeparams){ $scope.artistname = $routeparams.artistname $scope.$watch('artistname', function(newvalue, oldvalue){ $scope.artistinfo = datafactory.getartist(newvalue) }) $scope.artistinfo = { artist_name: datafactory.artistinfo.artist_name, artist_genre: datafactory.artistinfo.artist_genre, artist_imageurl: datafactory.artistinfo.artist_imageurl, artist_bio: datafactory.artistinfo.artist_bio }; } the callback $watch here run. datafactory.getartist retrieves newvalue database being done successfully. done this: datafactory.js datafactory.getartist = function(artist){ return datafactory.checkdb(artist).then(function(dbdata){ if(dbdata.data != "no data"){ datafactory.artistinfo = dbdata.data[0] } return dbdata.data[0] }) } datafactory.artistinfo = "...

android - Close app and reopen Continue read text -

this simple code multi text in 1 textview, int stringidlist[] = {r.string.text1, r.string.text2, r.string.text3, r.string.text4}; int stringlistcounter = 0; textview text1; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); button next = (button) findviewbyid(r.id.next1); button previous = (button) findviewbyid(r.id.pre1); text1 = (textview) findviewbyid(r.id.textview1); next.setonclicklistener(this); previous.setonclicklistener(this); @override public void onclick(view v) { int id = v.getid(); if(id == r.id.next1 && stringlistcounter < stringidlist.length - 1) { stringlistcounter++; } else if (id == r.id.pre1 && stringlistcounter > 0) { stringlistcounter--; } text1.settext(stringidlist[stringlistco...

javascript - How To Make a Hipmunk Style Progress Bar with Twitter Bootstrap and Jquery -

to surprise, i'm not seeing this. the bootstrap docs give plenty of options displaying progress bar, no instructions making something. i'm writing 1 page web app that'll ideally use progress bar transition before switching hidden part of page. here's simplified html: html <div id="part1"> <p>sample app</p> <button class="analyze btn btn-primary">analyze</button> </div> <div id="part2"> <!-- html goes here --> </div> css #part2 { display: none; } jquery $(".analyze").click(function() { $("#part1").hide(); $("#part2").show(); }); this simple. i'd make progress bar dynamically populates on $(".analyze").click , takes fixed amount of time complete before #part2 becomes visible using bootstrap progress bar. something similar hipmunk, or many of other airline aggregator sites do. ideally compa...

jsf - Make active component if check box is selected -

i want make active h:selectonemenu when h:selectbooleancheckbox selected. <h:selectbooleancheckbox value="#{user.rememberme}" /> agree <h:selectonemenu value="#{user.favcoffee1}"> <f:selectitem itemvalue="cream latte" itemlabel="coffee3 - cream latte" /> <f:selectitem itemvalue="extreme mocha" itemlabel="coffee3 - extreme mocha" /> <f:selectitem itemvalue="buena vista" itemlabel="coffee3 - buena vista" /> </h:selectonemenu> in cases let user select value h:selectonemenu when has selected here accepts web site terms. just bind disabled attribute of other component checkbox value , let checkbox ajax-update other component on change. <h:selectbooleancheckbox value="#{user.rememberme}"> <f:ajax render="menu" /> </h:selectbooleancheckbox> <h:selectonemenu id="menu" ... disabled="#{...

jquery - Why doesn't my javascript function swap pi id html contents as written? -

the p id="demo" contents don't switch when click button on testing & hosted environ. not sure why? think code correct? <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script type="text/javascript"> function mywhen() { document.getelementbyid("demo").innerhtml = "when-estimated time complete fall 2016."; } </script> </head> <body> <ul> <li><button onclick="mywhen()"><p>when?</p></button></li> </ul> <div class="textbox"> <p id="demo">a paragraph written<br>another line here</p> </div> </body> </html> your code right & it's working. check results here.. function mywhen() { document.getelementbyid...

Does Scala provide an easy way to convert Infix expressions to postfix ones? -

i beginner in scala , writing program in scala convert infix arithmetic expression postfix 1 meanwhile wondering whether scala provided easier way handle these kind of conversions. can guide me if there easier way it? a way use dijkstra's shunting yard algorithm. here 1 implementation in scala.

Security implications of a socket race when tunnelling a sub-command -

i want tunnel sub-command through connection listening port, running sub-command (to connect port), , forwarding data through connection: package main import ( "fmt" "net" "os" "os/exec" ) func main() { ln, err := net.listentcp("tcp4", &net.tcpaddr{ip: localhost}) if err != nil { fmt.fprintln(os.stderr, err) os.exit(1) } defer ln.close() port := ln.addr().(*net.tcpaddr).port cmd := exec.command( "git", "clone", fmt.sprintf("git://127.0.0.1:%d/project.git", port), ) cmd.stdout = os.stdout cmd.stderr = os.stderr if err := cmd.start(); err != nil { fmt.fprintln(os.stderr, err) os.exit(1) } defer cmd.process.kill() errs := make(chan error, 1) go func() { errs <- cmd.wait() }() conns := make(chan net.conn, 1) go func() { conn, err := ln.a...

console program for php -

in chrome developer tools there console can write javascript function or method , result instantly. that's useful , practical know how function, method works. is there similar php? without need save file , open in browser? looks need sandbox playground like: http://tehplayground.com/ http://3v4l.org/ (even runs script on multiple versions of php can compare output) if code more coupled particular project or has dependancies can't loaded in web sandbox use unit tests suggested @ka_lin.

java - Why is an anonymous inner class containing nothing generated from this code? -

package com.test; public class outerclass { public class innerclass { public class innerinnerclass { } } public class innerclass2 { } //this class should not exist in outerclass after dummifying private class privateinnerclass { private string getstring() { return "hello privateinnerclass"; } } public string getstringfromprivateinner() { return new privateinnerclass().getstring(); } } when run through javac on command line sun jvm 1.6.0_20 , code produces 6 .class files: outerclass.class outerclass$1.class outerclass$innerclass.class outerclass$innerclass2.class outerclass$innerclass$innerinnerclass.class outerclass$privateinnerclass.class when run through jdt in eclipse, produces 5 classes. outerclass.class outerclass$1.class outerclass$innerclass.class outerclass$innerclass2.class outerclass$innerclass$innerinnerclass.class outercla...

java - Accessing an object created by a constructor -

i'm trying learn basic gui implementation in java. i have 2 classes, 1 contains constructor. constructor creates new jframe object. i'm having trouble working jframe constructor - want change size, , other operations, can't figure out how to, after call constructor. here both classes, bmrcalcmain : import javax.swing.*; public class bmrcalcmain { public static void main(string[] args) { bmrcalcv2 frame = new bmrcalcv2(); bmrcalcv2.newframe.setdefaultcloseoperation(jframe.exit_on_close); bmrcalcv2.newframe.setvisible(true); bmrcalcv2.newframe.setsize(650, 475); bmrcalcv2.newframe.setresizable(false); } } bmrcalcv2: package v2; import javax.swing.*; import java.awt.flowlayout; public class bmrcalcv2 { private jlabel agelabel; private jlabel genderlabel; private jlabel img1; static jframe newframe; public bmrcalcv2() { newframe = new jframe("bmr/tdee calculator"); ...

ruby - Is it possible to push browser notifications from a rails app -

i'm wondering if there's way push browser notifications rails app using gem of kind i've been doing lot of googling , can't seem find anything. appreciated! rails server side. able need in javascript you're sending client job you. the way have on client, in javascript, goes server - in async manner - , checks see if there notifications display.

ios - CoreData not saving -

this code: import uikit import coredata class photolist: uiviewcontroller, uitableviewdelegate, uitableviewdatasource, nsfetchedresultscontrollerdelegate { override func viewdidload() { super.viewdidload() fetchedresultscontroller = nsfetchedresultscontroller(fetchrequest: fetchrequest(), managedobjectcontext: moc!, sectionnamekeypath: nil, cachename: nil) fetchedresultscontroller?.delegate = self fetchedresultscontroller?.performfetch(nil) tableview.reloaddata() } override func didreceivememorywarning() { super.didreceivememorywarning() } @iboutlet var tableview: uitableview! var whotookarray: [string] = [] var imagearray: [uiimage] = [] let moc:nsmanagedobjectcontext? = (uiapplication.sharedapplication().delegate as! appdelegate).managedobjectcontext var fetchedresultscontroller: nsfetchedresultscontroller? var whotookname: string = "" func fetchrequest() -> nsfetchrequest { var request = nsfetchrequest(entityname:"photolis...

hibernate - i am passing a model class object but it print ad normal object -

i passing hibernate model class object type list prints [ljava.lang.object;@1ec3adc.i using spring mvc , tile hibernate.i want pass "subtab" type list.but it's passing "object" type list. here's code returning list : daoimpl : public list<subtab> listsubtab(int usertype){ list<subtab> subtablist=sessionfactory.getcurrentsession().createquery("select s.maintab, s.description, s.ref subtab s,authintication s.subtabid = a.subtab , a.usertype = '" + usertype + "'") .list(); return subtablist; } controller : list<subtab> subtablist=(list<subtab>)loginservice.listsubtab(userexists); model.addattribute("subtabslist",subtablist); dao: public list<subtab> listsubtab(int usertype); service : public list<subtab> listsubtab(int usertype); serviceimpl : @transactional public list<subtab> listsubtab(int usertype) { ...

java - HTMLUnit Many Error in Basic Example -

i'm trying basic example working using htmlunit. i trying code search drill on homedepot website: try (final webclient webclient = new webclient(browserversion.chrome)) { // first page final htmlpage page1 = webclient.getpage("http://www.homedepot.ca"); // form dealing , within form, // find submit button , field want change. final htmlform form = page1.getformbyname("search_terms_form"); final htmlsubmitinput button = form.getinputbyvalue("go"); final htmltextinput textfield = form.getinputbyname("q"); // change value of text field textfield.setvalueattribute("drill"); // submit form clicking button button.click(); system.out.println(page1.gettitletext()); } judging error messages, appears code button , textfield incorrect. i've tried variations of getting name, id, , value not having luck. suggestions? a...

Java 8, using .parallel in a stream causes OOM error -

in book java 8 in action , section 7.1.1, authors state stream can benefit parallel processing adding function .parallel() . provide simple method called parallelsum(int) illustrate this. curious see how worked executed code: package lambdasinaction.chap7; import java.util.stream.stream; public class parallelplay { public static void main(string[] args) { system.out.println(parallelsum(100_000_000)); } public static long parallelsum(long n) { return stream.iterate(1l, -> + 1) .limit(n) .parallel() .reduce(0l, long::sum); } } to surprise, received error: exception in thread "main" java.lang.outofmemoryerror @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(unknown source) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(unknown source) @ java.lang.reflect.constructor.newinsta...

php - how to convert this SQL statement for FluentPDO code -

i made sql statement use in project i'm working on , have used fluentpdo before has been while , have never used subquery in before, wondering if out there knows way this, know can join not familiar method , never seen used before don't know enough make work, i'm trying brush on can myself. select * users username = 'admin' , password = 'testing' , company_id in (select company_id company subdomain = 'testing'); $result = $db->from('users') ->innerjoin('company on users.company_id = company.company_id') ->where('username', 'admin') ->where('password', 'testing') ->where('subdomain', 'localhost') ->fetch(); i figured out answer, , wanted post wondering same way was.

c++ - Tokenize sentence into words, considering special characters -

i have function receive sentence, , tokenize words, based on space " ". now, want improve function eliminate special characters, example: i boy. => {i, am, a, boy}, no period after "boy" said :"are ok?" => {i, said, are, you, ok}, no question , quotation mark the original function here, how can improve it? void tokenize(const string& str, vector<string>& tokens, const string& delimiters = " ") { string::size_type lastpos = str.find_first_not_of(delimiters, 0); string::size_type pos = str.find_first_of(delimiters, lastpos); while (string::npos != pos || string::npos != lastpos) { tokens.push_back(str.substr(lastpos, pos - lastpos)); lastpos = str.find_first_not_of(delimiters, pos); pos = str.find_first_of(delimiters, lastpos); } }

c++ - Cocos2d-x CCRef.h Error -

i'm new in cocos2d-x development , have problem everytine want compile game other device iphone 5s, gives me error every type name of class in ccref.h fault. i tried compile every ios version possible , many cocos 2d-x versions. @ moment i'm using cocos 2d-x version 3.6, xcode version , iphone ios 8.3! i hope can me fix this!

playframework 2.3 - java.lang.NullPointerException: null when add value to model play framework -

i new play framework, try add new value model in controller , got java.lang.nullpointerexception: null this model public class dokumenkeluarfilemodel extends model { public dokumenkeluarmodel keluar; public dokumenmasukmodel masuk; @formats.datetime(pattern="dd/mm/yyyy") public date tanggal; public static finder<long, dokumenkeluarfilemodel> find = new finder(long.class, dokumenkeluarfilemodel.class); public static string save(dokumenkeluarfilemodel dok){ try { dok.save(); return "success"; }catch (exception e){ return "failed save data, error message : "+e.getmessage(); } } } this controller public static string savedoc(form<dokumenkeluarmodel> formkel){ string status = ""; for(dokumenmasukmodel doc: candidateunique){ dokumenkeluarfilemodel kelfile = new dokumenkeluarfilemodel(); kelfile.keluar.id = formkel.get().id; kelfile.ma...

TCPDump on rooted android devices -

i tcpdump on rooted android devices. i create ".pcap" file later analysis capture upload / download packets. there library this? how should begin ? first should tcpdump.dat file , push phone following steps. adb root adb remount adb push local_path_to_tcpdumpt.dat /system/xbin/ adb shell chmod 777 system/xbin/tcpdump run below command @ adb prompt start capturing log adb shell tcpdump -i -s 0 -w /sdcard/capture.pcap after capturing tcp logs. pull pcap file adb pull /sdcard/capture.pcap capture.pcap

php - MongoDB document count fluctuation -

i facing issue document count in collection being erratic. here workflow: crawling first done scrapy . scraped items sent through pipeline , prepared writing collection using pymongo library. next, perform check see if item exists (using key) , if so, inherit _id , use db.collection.save() achieve upsert . check done ensure fields exist before writing. if item not exist, new document created in collection . lastly, frontend php webpage allows users search documents in collection using php mongodb driver . issue i started noticing on webpage new documents appear in 1 crawl, disappear view suddenly, , mysteriously appear again after next crawl. went mongo shell , found specific query return fluctuating number of results if sent repeatedly. 1 , down 2 , stable number. the thing don't @ no point in code remove() documents collection . impression db.collection.save() result in equal or increasing number of documents in collection. is there form of b...

c# - Listview with Textbox WIndows10 -

i have 1 big problem. my mainpage shell splitview , framelement load other pages. i added differnet pages 1. page empty 2. page contains listview different items (from observablecollection). if itemtemplate contains textbox apps crashes when switch between pages couple of times. don't know how handle that? memory consumption increases every 2-3 times navigate page #2 xaml: code behind: public day() { this.initializecomponent(); this.lv_schultag.itemssource = (app.current app).schuljahr.actual_day[0].stunden; } the debugger stops here in app.g.i.cs: #if debug && !disable_xaml_generated_break_on_unhandled_exception unhandledexception += (sender, e) => { if (global::system.diagnostics.debugger.isattached)global::system.diagnostics.debugger.break(); }; #endif the unhandled exception e is: für diesen vor...

USB keeps disconnecting...only for mobile devices -

very strange issue, no results find google searches. i running windows 7 64 bit. windows related date, , usb drivers. computer laptop puget systems. computer has 3 usb inputs; 1 usb 2.0, , 2 usb 3.0s. 2.0 versus 3.0 doesn't matter though, because issue happens 3 drives. heres issue: when connected, usb devices found, , recognized. 5-30 sec later, disconnect, reconnect in couple seconds. cycle of disconnecting/reconnecting continues indefinitely. have not been successful keeping usb devices connected more ~30 seconds. at point, number of things causing issue. gets weird. issue happens mobile devices, , happens mobile devices. mobile devices mean phones , ipods. have tested samsung galaxy s4, ipod classic, ipod touch, ipod nano, droid turbo, , iphone 5. issue occurred of these devices. issue did not occur @ 2tb seagate backup harddrive, 1tb wd harddrive, several usb pen drives, external keyboard, or wireless mouse usb receiver plugged in 24/7 in usb 2.0 drive. xbox 1 contro...

c++ - Positioning a top-level object relative to another -

Image
i need position top-level object remains in position relative top-level object. example, rectangle in image below should stick "front" of ellipse: when rotated 180 degrees, should this: instead, position of rectangle incorrect: please run example below (the use of qgraphicsscene demonstration purposes only, actual use case in physics). #include <qtwidgets> class scene : public qgraphicsscene { q_object public: scene() { mellipse = addellipse(0, 0, 25, 25); mellipse->settransformoriginpoint(qpointf(12.5, 12.5)); qgraphicslineitem *line = new qgraphicslineitem(qlinef(0, 0, 0, -12.5), mellipse); line->setpos(12.5, 12.5); mrect = addrect(0, 0, 10, 10); mrect->settransformoriginpoint(qpointf(5, 5)); line = new qgraphicslineitem(qlinef(0, 0, 0, -5), mrect); line->setpos(5, 5); connect(&mtimer, signal(timeout()), this, slot(timeout())); mtimer.sta...

html - CSS positioned element leaves blank space -

i've been struggling issue. have web want put fixed positioned element (kind of alert box users). therefore decided position fixed , put in bottom left corner of web. assumed not matter put piece of html code positioned anyway, put right under opening body tag. went well, box ended wanted be, leaves strip of blank space @ top of web (where html code is). isn't positioned element supposed take no space? logic seems wrong. image of problem. box html: <div class="users-alert-box"> text </div> css: .users-alert-box { background: #fffcd2 none repeat scroll 0 0; border-radius: 5px; bottom: 35px; box-shadow: 1px 1px 5px #888; display: block; font-size: 12px; left: 30px; padding: 10px 15px; position: fixed; z-index: 1000; width:170px; } what missing? thanks! the code have provided not create top space. check fiddle. https://jsfiddle.net/tpoj91u4/ the spacing due margin of other element.

ruby on rails 3 - touch should not updated `updated_at` on destroy in Rails3 -

i working on touch in rails facing on issue here. class user < activerecord::base belongs_to :company, touch: true end but want should not update updated_at of company model when delete user other case should be. how can it? or is there way restrict in destroy . because don't want on destroy .

Facebook SDK V4.1.0 LoginButton crash on startup only in Android less than 5 -

the app crash on startup java.lang.runtimeexception: unable start activity componentinfo{com.appandgo.appyvent/com.appandgo.appyvent.newuser.ndwelcomeactivity}: android.view.inflateexception: binary xml file line #34: error inflating class com.facebook.login.widget.loginbutton @ android.app.activitythread.performlaunchactivity(activitythread.java:2184) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2233) @ android.app.activitythread.access$800(activitythread.java:135) @ android.app.activitythread$h.handlemessage(activitythread.java:1196) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:136) @ android.app.activitythread.main(activitythread.java:5001) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:515) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:785) ...

c# - Point Classification in a set of Bounding Boxes -

i have set of bounding boxes(rectangular) in 3d space. bounds of each box computed , stored in dictionary named "regionbounds". also, set of points populated in list named "pointstocategorize" given point(x,y,z) coordinates list populated , bounding box checked in, can check if point inside box or not. problem is, big dataset. number of points checked 1000 , no of bounding boxes 250-300. so, if loop through each bounding box each given point; total time takes 5-6 minutes. there efficient method process quicker ? if possible, small code great public struct ibounds { public double x1, x2; public double y1, y2; public double z1, z2; } public struct ipoint { public double x,y,z } dictionary<string, ibounds> regionbounds = new dictionary<string, ibounds>(); list<ipoint> pointstocategorize = new list<ipoint>(); int no_of_bounding_boxes = 300; int no_of_points_to_categorize = 1000; (int = 1; <= no_of_bounding_boxes; i++...

desired capabilities not recognized by appium -

my desired capabilities code below: desiredcapabilities capabilities = new desiredcapabilities(); capabilities.setcapability(mobilecapabilitytype.version, "4.4.2"); capabilities.setcapability(mobilecapabilitytype.platform_name, "android"); capabilities.setcapability(mobilecapabilitytype.device_name, "android emulator"); capabilities .setcapability(mobilecapabilitytype.browser_name, "browser"); try { driver = new androiddriver(new url("http://127.0.0.1:4723/wd/hub"), capabilities); } catch (malformedurlexception e) { e.printstacktrace(); } driver.navigate().to("http://google.com"); my appium server debug info showing below lines: > info: --> post /wd/hub/session {"desiredcapabilities":{"browsername":"browser","platformname":"android","version":"5.1.1","devicename...

c# - MVVM - Validating the model when a field in the viewmodel is changed -

i'm using mvvmlight libraries database-first ef model. can't quite figure out how validate model when field in viewmodel has changed. works fine when i'm updating individual properties of model have call validate in set methods. i'm not sure how works elsewhere. for sake of example, have person class (model) in application has property called name implemented in view model: private person _currentperson; // code omitted... [required(errormessage = "name required field.")] public string name { { return _currentperson.name; } set { if (value != _currentperson.name) { _currentperson.name = value; raisepropertychanged(); validate(_currentperson.name); } } } when want create new person, have method attached relaycommand called newperson code: public relaycommand newcommand { { return _newcommand ?? (_newcommand = new relaycommand(newperson)); } } // code omitted... pri...

sql server - get name from another table while using sub query -

i have query this: select f_exhibitioncode, f_exhibitorcode t_exhibitorlocation f_exhibitorcode in ( select f_exhibitor_code t_exhibitor f_exhibitor_name '%''%') i have 2 more tables , 1 * t_exhibition * , 1 "t_exhibitor, f_exhibiton name coming form t_exhibition , f_exhibitorcode coming t_exhibitor , final result need this: f_exhibitonnaem, f_exhibition code,f_exibitorname,f exhibitor code. assuming understand tables structure, suggest along these lines: select el.f_exhibitioncode, el.f_exhibitorcode, e.f_exhibiton_name t_exhibitorlocation el inner join t_exhibitor e on(el.f_exhibitorcode = e.f_exhibitorcode) e.f_exhibitor_name '%''%'

PayPal Developer Account & API ..what happens if account is limited? -

i have hypothetical question paypal developer account. since app developed uses api username ( myname-facilitator_api1.mydomain.com ), api password , api signature transactions, wondering happens api access if paypal account whatever reason becomes limited? i've had account limited in past because did large withdrawal , paypal asked me send in documents lift limits ...but happens during time api access? customers not able transactions through app during time or how affected? there multiple types of account limitations. limitations can continue accept payments. in other cases not. if paypal uncertain whether account may have been compromised, or lacks required piece of paperwork, limit withdrawals merchant can continue business little impact possible while resolve issue. if paypal determines account fraudulent, or engaged in type of enterprise paypal cannot process payments, block acceptance in order protect payers -- alternative being accept reverse transactio...

java - String object is immutable but reference variable is mutable. What does that mean? -

i studying kathy sierra java book. came across 1 question this: public class { public static void main(string args[]){ string s1 = "a"; string s2 = s1; //s1=s1+"d"; system.out.println(s1==s2); } } output: true two points didn't understand here are: when uncomment s1 = s1 + "d" output changes false . same thing happens if replace string wrapper integer or int . again, when change code use stringbuffer this: stringbuffer sb = new stringbuffer("a"); stringbuffer sb2 = sb; //sb.append("c"); system.out.println(sb == sb2); now output doesn't changes i.e. remains true if uncomment sb.append statement. i can't understand strange behavior. can 1 explain me. s2 reference s1 in first case. in second case, + translated s1.concat("d") creates new string, references s1 , s2 point different string objects. in case of stringbuffer , reference never ...

javascript - Text editing with jquery -

i creating simple product list. want implement editing of product. when double-click on product, able edit it. dont understand how can this. hope, understand me because english not primary language. code here: <div class="container"> <h1>product list</h1> <input type="text" name="newproduct" id="newproduct" placeholder="enter product here"/> <ul id="productlist"></ul> <input type="checkbox" id="selectall"/><label for="select all">select all</label> <button id="deletedoneproducts">delete selected</button> </div> css * { box-sizing:border-box; } body { font-family: tahoma, sans-serif; } .container { margin:0 auto; width:600px; } h1, #newproduct { text-align: center; width:598px; } #newproduct { border:1px solid #999; padding: 20px; font-size: 28px; ...

php - Mysql data selecting with particular price range, product limit, and other filtering -

i have database table product example: id name price category 1 pen 70 1 2 banana 50 1 3 potato 10 1 5 apple 20 1 6 guaba 30 1 7 papa 30 2 8 salt 80 2 9 butter 25 2 10 cheese 10 2 11 burger 20 2 12 mashala 25 2 13 chuijal 40 3 14 icecream 20 3 15 chocolate 35 3 i want product mysql database based on price range, product limit, , category based. example: when want 4 products category=1 on cumulative price of 4 products 100 or near 100, show 4 product category 1 , price of 4 products 100 in total. possible output: id name price category 1 pen 10 1 2 banana 50 1 3 potato 10 1 5 apple 20 1 ============================ =90 (near 100) again when want 3 products of category 1, prices cumulative 100, show 3 product category 1 prices cumulative 100 or near 100. possible out put: id name pric...

angularjs - ngAnimate not adding classes with angular-material -

i'm building single page application angular material , reason animations not functioning. it looks not angular material can't basic example on https://docs.angularjs.org/guide/animations page work. it appears classes angular material relies on added css animations hook on not being applied. inspecting elements in chrome see hide , show classes none of transition classes. relevant parts of bower file: "angular": "~1.4.0", "angular-animate": "~1.4.0", "angular-sanitize": "~1.4.0", "angular-messages": "~1.4.0", "angular-i18n": "~1.4.0", "angular-ui-router": "~0.2.15", "angular-material": "~0.9.8", my site (in development) @ http://www.zakhenry.com , animation test page @ http://www.zakhenry.com/#/blog when viewport small (ie mobile width) should able see sidepane animate out on https://material.a...