Posts

Showing posts from June, 2013

parse.com - Parse Cloud Code Push + Client-initiated push isn't enabled -

Image
i trying run parse cloud code function sends push user associated installation object. when run following code within cloud function error 115 - client-initiated push isn't enabled. // send push parent var query = new parse.query(parse.installation); query.equalto('user', reservation.get("parent")); parse.push.send({ where: query, // set our installation query data: { alert: "your request has been accepted!" } }, { success: function () { console.log("push worked"); return result; }, error: function (error) { console.log("error: " + error.code + " " + error.message); return result; } }); i don't see anywhere client side pushes need enabled cloud code? missing or need enabled? navigate app's settings in parse dashboard, enable client side push under push notificat...

c++ - Simple program with std::string is not working -

i learning std::string , want : input string every second letter make uppercase output new string #include "stdafx.h" #include <iostream> #include <string> using namespace std; int main() { string mystr; getline(cin,mystr); if (mystr.begin() != mystr.end()) { (auto = mystr.begin(); != mystr.end() ; += 2) *it = toupper(*it); } cout << mystr; system("pause"); return 0; } but after input getting error here : it += 2 leads out of bounds, if loop ending condition it != mystr.end() . dereferencing *it = toupper(*it); is undefined behavior. it += 2 never give exact iterator value of mystr.end() have loops termination condition. as comment: so how can fix ? just keep simple , understandable, e.g. using like for (size_t = 0; < mystr.length() ; ++i) { if(i % 2) { // every second letter ... mystr[i] = toupper(mystr[i]); } }

android - AdMob InterstitialAd "AFMA_ReceiveMessage is not defined" vs "must be called on the main UI thread" -

i trying implement iterstitial ads admob. managed displayed in test mode. however, showed blank page "afma_receivemessage not defined" error when running live. i have read many post relating "afma_receivemessage not defined" issue. seemed problem ads has running on separate thread gain network access. however, if move loadad , show methods new thread (like in afma_receivemessage not defined or interstitial admob doesn't work : afma_receivemessage not defined ), complain has run on main thread!! if use runonuithread method, go "afma_receivemessage not defined" problem. i confused conflicting solutions each other. (it has run on uithread while has on separate thread gain network access?) has have working example interstitial ads admob (not in test mode)?

How do you exclude file extensions from command-line JSHint? -

i'm trying exclude *.min.js , *.intellisense.js files being linted command-line jshint . i'm passing in .jshintignore file via --exclude-path looks this: *.min.js *.intellisense.js **.min.js **.intellisense.js **/*.min.js **/*.intellisense.js **\*.min.js **\*.intellisense.js none of patterns seem matching. versions: node v5.3.0, jshint v2.8.0. the full command i'm running (in dir d:\projects\someweb\ ): d:\utils\nodejs\node.exe d:\utils\nodejs\node_modules\jshint\bin\jshint --verbose --show-non-errors --exclude-path d:\utils\nodejs\.jshintignore . update #1: workaround, i'm using powershell command: powershell -nologo -noprofile -command "get-childitem -include *.js -exclude *.min.js,*-vsdoc.js,*.intellisense.js -recurse | % { d:\utils\nodejs\node d:\utils\nodejs\node_modules\jshint\bin\jshint --verbose --show-non-errors $_.fullname }"

php - strpos with two words to find -

i found example on stackoverflow: if (strpos($a,'are') !== false) { echo 'true'; } but how make search 2 words. need this: if $a contains words "are" or "be" or both echo "contains"; i tried xor , || just check both words separately , use boolean or -operator check if either 1 or both contained in $a : if (strpos($a,'are') !== false || strpos($a,'be') !== false) { echo "contains"; } note due or -operator, second check (for 'be') not performed if first 1 showed $a contains 'are'.

How to use the the count number somewhere else in java -

is there anyway in can place count variable. e.g. have count count number of lines. after want use number count has provided, , add number in variable can used somewhere else, e.g. add number, or find percentage or create pie chart using number. public void totalcount12() throws filenotfoundexception { scanner file = new scanner(new file("read.txt")); int count = 0; while(file.hasnext()){ count++; file.nextline(); } system.out.println(count); file.close(); i want use number in count, , use somewhere else (e.g method), have no idea how that. thank you. firstly recommend should complete javatutorial if new programming. if define in class global variable (as attribute of class) out of method, can use in every method in class. but if question using in everywhere of project different class, should use singleton design pattern ; public class classicsingleton { private static ...

scikit learn - sklearn: AUC score for LinearSVC and OneSVM -

one option of svm classifier ( svc ) probability false default. documentation not does. looking @ libsvm source code, seems sort of cross-validation. this option not exist linearsvc nor onesvm . i need calculate auc scores several svm models, including these last two. should calculate auc score using decision_function(x) thresholds? answering own question. firstly, common "myth" need probabilities draw roc curve. no, need kind of threshold in model can change. roc curve drawn changing threshold. point of roc curve being, of course, see how model reproducing hypothesis seeing how ordering observations. in case of svm, there 2 ways see people drawing roc curves them: using distance decision bondary, mentioned in own question using bias term threshold in svm: http://researchgate.net/post/how_can_i_plot_determine_roc_auc_for_svm . in fact, if use svc(probabilities=true) probabilities calculated in manner, using cv, can use draw roc curve. mentioned i...

c++ - Why classes in different files do not find each other without a header? -

please have @ following code main.cpp #include <iostream> using namespace std; int main() { class1 c; } class1.cpp #include <iostream> using namespace std; class class1 { public: void click1() { cout << "click 1" << endl; } }; class2.cpp #include <iostream> using namespace std; class class2 { public: void click2() { cout << "click 2" << endl; } }; if add header files above classes, work. why c++ not understand classes in different files without header file? in c++ source file called translation unit . each translation unit separate each other, , don't know each others existence. have explicitly tell compiler things translation unit should know about. this done declaring things. , instead of having same declaration in many files , places, put them in single header file source files includes.

ios - How to reliably block duplicate animation calls in Objective-C? -

a user can initiate animation swipe gesture. want block duplicate calls animation, make sure once animation has started, cannot initiated again until has completed -- may happen if user accidentally swipes multiple times. i imagine people achieve control using boolean flag ( bool isanimatingflag ) in manner shown @ bottom. i've done things before in apps many times -- never feel 100% whether flag guaranteed have value intend, since animation uses blocks , it's unclear me thread animation completion block being run on. is way (of blocking duplicate animations) reliable multi-thread execution? /* 'atomic' doesn't * guarantee thread safety * i've set flag follows: * correct intended usage? */ @property (assign, nonatomic) bool isanimatingflag; //… @synthesize isanimatingflag //… -(void)starttheanimation{ // (1) return if isanimatingflag true if(self.isanimatingflag == yes)return; /* (2) set isanimatingflag true * intention prevent duplicate animati...

android - Java object notify parent class -

i developing augmented-reality app in android. have 1 class called augmentedview, extends view , responsible draw markers. in ondraw method when detects collisions want notify parent class main class , contains main gui enable 1 button in screen. call augmentedview class in oncreate of main class following code: augmentedview augmentedview = new augmentedview(this); augmentedview.setontouchlistener(this); augmentedview.setlayoutparams(new layoutparams( layoutparams.wrap_content, layoutparams.wrap_content)); livelayout.addview(augmentedview); how can notify main class changes , pass list of markers it? if i'm understanding problem correctly , want notify activity/fragment contains augmentedview . a simple way using java callbacks. // in activity //oncreate() .. augmentedview augmentedview = new augmentedview(this); augmentedview.setontouchlistener(this); augmentedview.setcollisionlistener(new collisionlistener()); augmentedview...

try catch - Java HttpURLConnection dying mysteriously -

i trying use java.net.httpurlconnection make simple http call , running can't explain: public string makegetcall(httpurlconnection con) { try { system.out.println("about make request..."); if(con == null) system.out.println("con null"); else { system.out.println("con not null"); if(con.getinputstream() == null) system.out.println("con's input stream null"); else system.out.println("con's input stream not null"); } } catch(throwable t) { system.out.println("error: " + t.getmessage()); } system.out.println("returning...") return "dummy data"; } when run this, following console output: about make request... con not null and program terminates, without error. no exceptions thrown, doesn't exit unexpectedly, , doesn't hang or timeout...it ...

Does GDB have a "step-to-next-call" instruction? -

windbg , related windows kernel debuggers support "pc" command runs target until reaching next call statement (in assembly). in other words, breaks prior creating new stack frame, sort of opposite of "finish". "start" in gdb runs until main starts, in essence want 'start' wildcard of "any next frame". i'm trying locate similar functionality in gdb, have not found it. is possible? example windbg doc: http://windbg.info/doc/1-common-cmds.html#4_expr_and_cmds simple answer: no, step-to-next-call not part of gdb commands. gdb/python-aware answer : no, it's not part of gdb commands, it's easy implement! i'm not sure understand if want stop before or after call instruction execution. to stop before , need stepi/nexti (next assembly instruction) until see call in current instruction: import gdb class stepbeforenextcall (gdb.command): def __init__ (self): super (stepbeforenextcall, s...

javascript - Local storage saving every input and checkbox value on a page -

is there way save every input field , checkbox without code? have , it's working great save separate input fields, class="stored" on each: $(document).ready(function () { function init() { if (localstorage["fname"]) { $('#fname').val(localstorage["fname"]); } } init(); }); $('.stored').change(function () { localstorage[$(this).attr('name')] = $(this).val(); }); <div class="form-group required"> <label class="label_fn control-label" for="fname">first name (required):</label> <input id="fname" name="fname" type="text" placeholder="" class="input_fn form-control stored"> </div> but there way to, say, set class of "something-container" on container div , using script base, save input fields storage , have them remain populated in fields until user ...

css - jquery-ui icons not showing in production environment -

jquery-ui icons not showing on production server. in browser console, come 404 , fail load. work fine locally on development, i'm not sure going wrong. i'm using custom theme, located in images subdirectory under vendor/assets/stylesheets. does know causing these icons not show in production? i've tried changing paths urls in css , precompiling assets on production already. here how have set up: vendor assets stylesheets images **icons , custom theme** jquery-ui.css application.css.scss *= require_self *= require foundation_and_overrides *= require slick *= require slick-theme *= require jquery-ui *= require main */ image paths here 1 of images not loading in production .ui-widget-content .ui-icon { background-image: url("images/ui-icons_469bdd_256x240.png"); } for asset pipeline fingerprinting work, need use rails' helpers in css file: .ui-widget-content .ui-icon { background-image: url(...

Android view.request focus -

despite, use xml codes: android:focusable="true" android:focusableintouchmode="true" or clear , request focus: countedit1.clearfocus(); countedit1.requestfocus(); or in java set focusable: view.setfocusableintouchmode(true); view.requestfocus(); or use input manager: inputmethodmanager imm = (inputmethodmanager) getsystemservice(context.input_method_service); etv1.requestfocus() imm.showsoftinput(etv1, inputmethodmanager.show_implicit); i didn't solution show input window again(it works first onclick). these relative code snippet: imagearama.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { log.i("tago", "onclicktıklandı"); inputmethodmanager imm = (inputmethodmanager) getsystemservice(context.input_method_service); etv1.requestfocus(); imm.showsoftinput(etv1, inputmethodmanager.show_implicit); edittextayarla(etv1, images...

d3.js - Error: Invalid value for <g> attribute transform="translate(0,NaN)" -

problem chart on d3 . getting above error message working fine dummy data, when use our end data several errors. able fix of it. current code. here codepen .actual data just alot less views getting broken along way. if date/value 0; function viewsprogresschart() { var viewswidgetwidth = $('.viewswidget .thumbnail').width(); var viewswidgetheight = $('.calendarwidget .thumbnail').height() - 90; var fontsize = (math.min(width, height) / 4); var margin = { top: 2, right: 15, bottom: 15, left: 18 }, width = viewswidgetwidth - margin.left - margin.right, height = viewswidgetheight - margin.top - margin.bottom, dateline = height - 20; var data = phpweeklyview.map(function(elem, index) { return { date: new date(elem.date), close: elem.view_count }; ...

java - android app crashes and gives error in registration -

i have in process of developing registration app using android studios, once users try register application says error in registration , logcat not give error, when debugging app, still no errors. please can , tell me going wrong code correct working couple of months ago, since have returned holiday says "error occurred in registration". user data gets entered database not allow user move onto next activity says "error occurred in registration". please can or advise? logcat 01-07 15:14:42.933 2161-4203/com.oakland e/json parser: error parsing data org.json.jsonexception: value 2016-01-07 of type java.lang.string cannot converted jsonobject 01-07 15:14:42.938 2161-2161/com.oakland e/androidruntime: fatal exception: main process: com.oakland, pid: 2161 java.lang.nullpointerexception: attempt invoke virtual method ...

Magento Filter Custom EAV by Attribute Error -

i unable filter custom eav collection, otherwise performs normally: $mymodel = mage::getmodel('mymodel/things'); $collection = $mymodel->getcollection() ->addattributetoselect('*'); various attempts made filter collection, e.g.: $collection->addfieldtofilter('my_attribute','1'); $collection->addattributetofilter('my_attribute', array('like' => '1')); anything try throws error: invalid method mage_eav_model_entity_attribute::isscopeglobal(array ( ) ) #0 c:\wamp\www\magento\app\code\core\mage\catalog\model\resource\collection\abstract.php(186): varien_object->__call('isscopeglobal', array) #1 c:\wamp\www\magento\app\code\core\mage\catalog\model\resource\collection\abstract.php(186): mage_eav_model_entity_attribute->isscopeglobal() thank in advance suggestions , direction. update: hacking following , ->addattributetofilter works should. still need proper solution custom model...

python - SUDS SOAP WSDL not working with Vormetric Appliance -

i trying use jerko suds generate wsdl client calls vormetric key server, show keys on platform. using suds elements construct soap message. from suds.client import client suds.sax.element import element import ssl import logging logging.basicconfig(level=logging.info) logging.getlogger('suds.client').setlevel(logging.debug) ssl._create_default_https_context = ssl._create_unverified_context url = 'https://<dkm>/communication-server/sscontrollercli?wsdl' client = client(url) login = element('logininfo') user = element('username').settext('xxx') auth = element('password').settext('xxx') domain = element('domainname').settext('xxx') keytype = element('switchkey').settext('all') login.append(user) login.append(auth) login.append(domain) result = client.service.showallkeys(login, keytype) print result when execute appears work, , generate soap message, server error when trying execute. ...

java - MIDI OUT transmitter not available -

i've been banging head on day, read can find, followed jdk source around, no luck in finding out gory details how or where java looks obtain data on midi device , determines what's what. i'm trying capture midi messages through ni audio 8 dj midi in port, but, java isn't "seeing" midi in port, out, have used send midi with. same results m-audio usb uno midi device: midisystem.getmidideviceinfo() "sees" output port. i have verified operation of midi in port with: amidi -p hw:2,0 -d and sending signals. works fine. getmaxtransmitters() returns zero. midisystem.getmidideviceinfo() shows 1 entry both devices: audio8dj [hw:2,0] or interface [hw:2,0] the code below works fine receiver , think bits need verify gettransmitter() grabs port, since works other , works fine, midiunavailableexception / transmitter not available exception. i've taken getmaxreceivers() trap out because trying see if device offered 1 entry , sorted out...

java - Collections.sort & Bubble sort -

iam using 2 different ways of sorting results in arraylist. first way collections.sort works fine no problem there. other sorting algoritm bubblesort (i know ineffective, using in study purposes) have collections sort sort results biggest values @ 0 , second biggest @ 1 etc. want bubble sort algoritm sort other way around, smallet values @ 0 etc. mentioned, collections sort works fine bubble sort doesnt sort them way want to. is method or loop wrong? private void sort(boolean resultcomparison, arraylist<result> list) { if (resultcomparison= false) { boolean moved; { moved= false; (int = 1; < list.size(); i++) { result in = list.get(i - 1); result de = list.get(i); if (in.value() < de.value()) { list.set(i - 1, de); list.set(i, in); moved= true; } } } while (moved); } else { ...

javascript - my menu overflows the space -

i have tried make menu collapses earlier expanded chioces cant make work. var currentid; $(document).ready(function () { $(":range").rangeinput({ progress: true }); /* slide toogle */ $("ul.expmenu li > div.header").click(function () { var arrow = $(this).find("span.arrow"); if (arrow.hasclass("up")) { arrow.removeclass("up"); arrow.addclass("down"); } else if (arrow.hasclass("down")) { arrow.removeclass("down"); arrow.addclass("up"); } $('#' + currentid).parent().find("ul.menu").slidetoggle(); $(this).parent().find("ul.menu").slidetoggle(); currentid = $(this).attr('id'); }); }); you can find homepage @ adress: http://admin.dq.se/kramers/nyamenyer.html so if press "bil" want "bil" expand .. , af...

python - Install local dist package into virtualenv -

i have pytest test, let's call test.py . used run test outside of virtualenv; i'm trying run inside virtualenv sandbox. the project structured this: ~/project/test # test.py , virtualenv files live ~/project/mylibrary test.py imports mylibrary . in past, worked because have code in ~/project/mylibrary installed /usr/lib/python2.7/dist-packages/mylibrary . i can't run virtualenv --system-site-packages flag. can't move code ~/project/mylibrary ~/project/test folder. how can access code in mylibrary inside virtualenv? you don't need special - long working inside virtualenv, python setup.py install automatically install packages into $virtual_env/lib/python2.7/site-packages rather system-wide /usr/lib/python2.7/dist-packages directory. in general it's better use pip install mylibrary/ , since way can neatly uninstall package using pip uninstall mylibrary . if you're installing working copy of code you're developing, mig...

sapui5 - How to apply CSS to sap.m.table row based on the data in one of the cell in that row -

i working sap.m.table. have requirement apply or change background color of rows based on data in 1 of column in rows in table. i using following code not working created cssfile: test.css <style type="text/css"> .total { background-color: lightsteelblue !important; } </style> the above css file declare in component.js following way ( correct me if not right way make css file available access in whole ui5 project. "resources": { "css": [ { "uri": "css/test.css" } ] } in controller.i have defined following method apply style sheet particular rows alone in table. rowcolours: function() { var ocontroller = this; console.log("rowcolours() --> start "); var otable = this.oview.byid("tblallocation"); var rows = otable.getitems().length; //number of rows on tab //start index var row; var cells = []; var oc...

linker - What is "ld -Ttext" option doing? -

i following this half-completed tutorial develop simple os. 1 step (on page 50) compile simple kernel $ld -o kernel.bin -ttext 0x1000 kernel.o --oformat binary . don't understand option -ttext doing. to make question specific, why in following experiment md5s of kernel_1000.bin & kernel.bin equal, kernel_1001.bin & kernel_1009.bin equal, , kernel_1007.bin & kernel_1017.bin equal, while other pairs not equal? my experiment i tried compile several different kernels different -ttext in following makefile : ... kernel.o: kernel.c gcc -ffreestanding -c kernel.c kernel.bin: kernel.o ld -o $@ kernel.o --oformat binary kernel_1000.bin: kernel.o ld -o $@ -ttext 0x1000 kernel.o --oformat binary kernel_1001.bin: kernel.o ld -o $@ -ttext 0x1001 kernel.o --oformat binary ... and checked md5: $ ls *.bin | xargs md5sum d9248440a2c816e41527686cdb5118e4 kernel_1000.bin 65db5ab465301da1176b523dec387a40 kernel_1001.bin 819a5638827494a4556b7a96...

java.util.Date get milliseconds -

i have done following: string standardrange = "00:01:01"; simpledateformat rangeformatter = new simpledateformat("hh:mm:ss"); date range = rangeformatter.parse(standardrange); now: range.gettime(); .. output of -3539000 , not 61,000 i'm not sure i'm doing wrong; when debugging, cdate exists, attribute contains fraction , contains value 61,000, want. the reason you're seeing date you're creating in past of date epoch, not 1m1s after it: string standartrange = "00:01:01"; simpledateformat rangeformatter = new simpledateformat("hh:mm:ss"); date range = rangeformatter.parse(standartrange); system.out.println(new date(0l)); system.out.println(new date(0l).gettime()); system.out.println(range); system.out.println(range.gettime()); and output; thu jan 01 01:00:00 gmt 1970 0 thu jan 01 00:01:01 gmt 1970 -3539000 the epoch date incorrect here - should 00:00:00, due historical bug bst/gmt changed dates , ...

eclipse - Can't locate an XML file inside a META-INF directory -

i've set web service i'm trying debug in eclipse. it has directory structure this: root /   + src   + meta-inf   + web-inf inside meta-inf directory, there folder \xfire\services.xml . when start server, have following error: java.io.filenotfoundexception: class path resource [meta-inf/xfire/services.xml] cannot opened because not exist when run procmon.exe sysinternals , see have "path not found" error on following paths: c:\program files\apache software foundation\tomcat 6.0\lib\meta-inf\xfire\services.xml c:\program files\apache software foundation\tomcat 6.0\webapps\mywebservice\web-inf\meta-inf\xfire\services.xml c:\program files\apache software foundation\tomcat 6.0\webapps\mywebservice\web-inf\classes\meta-inf\xfire\services.xml while file stored in: c:\program files\apache software foundation\tomcat 6.0\webapps\mywebservice\meta-inf\xfire\services.xml what doing wrong? it's getressources() used read ...

OOP in python (related to scrapy) -

the question how share data between objecs in safe , maintainable manner. example: i've build scrapy application spawns numerous spiders. although each spider connected separate pipeline object, need compare , sort data between different pipelines (e.g. need outputs sorted different item attributes: prices, date etc.), need shared data area. same applies spiders (e.g. need count maximum total requests). first implementation used class variables shared data between between spiders/pipelines , instance variables each object. class mypipeline(object): max_price = 0 def process_item(self, item, spider): if item['price'] > max_price : max_price = item['price'] (the actual structures more complex) thought out having bunch of statics not oop , next solution have private class data each class , use store values: class mypipelinedata: def __init__(self): self.max_price = 0 class spidersdata: def __init___(self, total_requests, pipeline_data): sel...

Find which, if any, dictionary values exist in a string in Python? -

so i'm finding ways find if key/value exists in string, i'm not finding examples allow me access key/value found in string. basically, have string. let's say: body = "hi name john" ...and have following dictionary: names = {"john": "john", "bill": "bill", "jordan": "jordan"} i want see if of names in dictionary contained in string, , if so, want know 1 (assign variable or whatnot). if assume have these mapped in dictionary reason, i'll show yes it's possible utilize mappings in ways this: class bodytests(): def __init__(self): self.namemap = {"john": "johnathon", "johnathon": "johnathon", "bill": "william", "wil": "william"} self.greetmap = {"hi": "hello", "aloha": "hello", "hello": "hello", "sa...

C++ cast raw table to another table type -

i want write class similar std::array c++11. declaring table of type char inside class , later call placement new on table after use table if regular table of type t , here comes trouble. generally variable like: char tab[size]; is of type char(&)[size] , if that's use reinterpret_cast on table cast table of type, in fact using, more or less code this: char tab[sizeof(t)*size]; t tabt[size] = reinterpret_cast<t(&)[size]>(tab); // more code using tabt however in context tab seen char* type. reason, why thought work ability write following template function template <typename t, size_t size> function(t(&table)[size]){ //do stuff connected table of type t , size size. } i know without fancy magic here, want know, why not work. so question is: there way thing want , there more elegant way mentioned job? ps: not declare raw table of type t : t tab[size] , because wouldn't able create elements, there no constructor without arg...

export - extract data from Google App Engine site -

i have web form on gae site runs python program , produces results. i'd know if there way export produced data , use them compile table in mysql database. need access web application? see docs on bulk upload tool .

c++ - Creating a text file with a timestamp in the title -

i'm trying write program outputs lot of data in separate text files. want title of each file poker_log_timestamp_datestamp.txt however, doesn't create file, nor throw errors! here's code: #include <fstream> #include <iostream> #include <ctime> #include <string> using namespace std; int main(){ char sdate[9]; char stime[9]; fstream log; _strdate_s(sdate); _strtime_s(stime); string filename = "poker_log_"; filename.append(stime); filename.append("_"); filename.append(sdate); filename.append(".txt"); cout<<"filename == "<<filename<<endl; log.open(filename.c_str()); log<<"\n\nhuman won tournament.\n"; log.close(); system("pause"); } how make work? 1 other thing: if comment out filename.append(stime) , filename.append(sdate) , works fine. solved :d file name cant have slashes or colons, replaced the...

python - How can I make a list of elements Selenium? -

i using selenium webdriver python , need make in loop: can this: a=browser.find_element_by_xpath("//tbody[@id='mrc_main_table']/tr/td[1]") b=browser.find_element_by_xpath("//tbody[@id='mrc_main_table']/tr/td[2]") c=browser.find_element_by_xpath("//tbody[@id='mrc_main_table']/tr/td[3]") d=browser.find_element_by_xpath("//tbody[@id='mrc_main_table']/tr/td[n]") 1) want this: var==browser.find_element_by_xpath("//tbody[@id='mrc_main_table']/tr/td[all_value]") 2) need output array this: output=[anderson,isaiah,dwight,....] here's code : import xlwt tempfile import temporaryfile selenium import webdriver browser =webdriver.firefox() browser.get( "https://report.boonecountymo.org/mrcjava/servlet/sh01_mp.i00290s" ) element=browser.find_element_by_xpath("//tbody[@id='mrc_main_table']/tr/td[1]" )#i want list output=element.text #...

java - When I try to run my WEB Application I get this error -

this question has answer here: what nullpointerexception, , how fix it? 12 answers 05-jan-2016 23:44:35.610 severe [http-apr-8080-exec-2] org.springframework.security.web.authentication.usernamepasswordauthenticationfilter.dofilter internal error occurred while trying authenticate user. org.springframework.security.authentication.internalauthenticationserviceexception caused by: java.lang.nullpointerexception @ dao.userdaoimpl.getuser(userdaoimpl.java:36) @ service.userdetailsserviceimpl.loaduserbyusername(userdetailsserviceimpl.java:38) @ org.springframework.security.authentication.dao.daoauthenticationprovider.retrieveuser(daoauthenticationprovider.java:102) my web.xml <display-name>spring mvc application</display-name> <context-param> <param-name>contextconfiglocation</param-name> <param-v...

c# - Get seconds minutes hours days weeks months years from a date -

i method returns string date looks ones in social media websites , forum . examples added 2 seconds ago added 3 mintues ago added 2 weeks ago added month ago and on i pass datetime object , returns string based on difference between currentdate , date passed method. i know how use timespan difference between dates how can switch seconds minutes hours days weeks appropriately? for example if difference between dates 120 minutes not want return 120 minutes, want return 2 hours. how make switch? i prefer custom method in order change language of string arabic. can language changed using libraries? thanks abdullah this overly simplified example of do, using .net classes: public static string timesinceevent(datetime eventtime) { timespan timesince = datetine.now - eventtime; if (timesince.hours > 0) return string.format("added {0} hours ago", timesince.hours); else if (timesince.minutes > 0) return string.fo...

android - IntelliJ cannot resolve resources nor AndroidManifest.xml in SBT (multi)project -

Image
ever since i've migrated android project gradle sbt become unable work resources: each symbol within xml resources (e.g. @string/app_name ) highlighted red , displays error message (e.g. cannot resolve '@string/app_name' symbol ), layouts editors fail work variables in layouts unresolved, cannot edit them, what more ide reports androidmanifest.xml missing , unable run app within ide, because unable configure run configuration. automatic refactoring of manifest , resources e.g. activity class name changed fails. however, resources , manifest in place. facets set correctly can seen in picture: what tried , haven't worked : editing facets - of them set correctly, invalidating cache , restarting intellij, removing .idea directory , reimporting project sbt plugin, syncing projects in gradle ones - there no such option sbt, best was refresh build. normally suspect build reason not working, but: sbt clean app/android:run correctly builds applica...

javascript - How to get value of Date Picker from Material Ui -

if created datepicker material ui, how user's input value? say user selects 01.01.2016-> how grab value , store variable data type date? so far i've tried use states pass json object doesnt seem working. example: getinitialstate: function() { return { startdate: null, enddate:null }; }, render: function() { return ( <div> <datepicker hinttext="start date" value={this.state.startdate} onchange={this._handlestartinput} /> <datepicker hinttext="end date" value={this.state.enddate} onchange={this._handleendinput} /> </div> );}, _handlestartinput: function(value) { this.setstate({ startdate: value }); }, _handleendinput: function(value) { this.setstate({ enddate: value }); }, and there can create function pulls value, right after select date, state never changes , displayed in ui. i tried , paint console value <datep...