Posts

Python selenium webdriver Chrome - Chrome is being controlled by an automated software -

Image
i using selenium webdriver , creating chrome driver instance. when try scroll down , scroll up,i getting following error message. further can see error message 'chrome being controlled automated software'. annoying see error though not able change settings in chrome browser allowing automation. from selenium import webdriver selenium.webdriver.common.keys import keys selenium.webdriver.support import expected_conditions ec selenium.webdriver.common.by import selenium.webdriver.support.ui import webdriverwait wait selenium.common.exceptions import timeoutexception log_util.logger import log log import time log = log() class wiki(object): def __init__(self): self.link = 'http://wikipedia.org' self.path = '/users/swadhikar_c/downloads/chromedriver' self.driver = webdriver.chrome(executable_path=self.path) def open_wiki(self): driver = self.driver driver.get(self.link) return self.wait_for_page_load...

javascript - bootstrapvalidator submit button not allowed after validation error -

i'm running form bootstrapvalidator. if submit form while there still validation errors (for example, forgot input 1 of fields), when finish filling form fields properly, submit button maintains "cursor: not-allowed" style got initial submission: <form id="invoice_form" class="well form-horizontal" action="submit.php" method="post" data-toggle="validator""> <fieldset> ... <!-- button --> <div class="form-group"> <label class="col-md-4 control-label"></label> <div class="col-md-4" style="text-align: left;"> <button type="submit" class="btn btn-primary" > send <span class="glyphicon glyphicon-send"></span></button> </div> </div> </fieldset> </form> thanks, david edit: ...

python - how to modify peter norvig spell checker to get more number of suggestions per word -

i tried peter norvig code spellchecker on http://norvig.com/spell-correct.html how modify more number of suggestions instead of 1 correct spelling import re collections import counter def words(text): return re.findall(r'\w+', text.lower()) words = counter(words(open('big.txt').read())) def p(word, n=sum(words.values())): "probability of `word`." return words[word] / n def correction(word): "most probable spelling correction word." return max(candidates(word), key=p) def candidates(word): "generate possible spelling corrections word." return (known([word]) or known(edits1(word)) or known(edits2(word)) or [word]) def known(words): "the subset of `words` appear in dictionary of words." return set(w w in words if w in words) def edits1(word): "all edits 1 edit away `word`." letters = 'abcdefghijklmnopqrstuvwxyz' splits = [(word[:i]...

r - How to use dplyr to find unique entries in the previous rows -

i have long dataframe, more or less following structure: df <- data.frame( dates = c("2011-10-01","2011-10-01","2011-10-01","2011-10-02","2011-10-03","2011-10-05","2011-10-06","2011-10-06"), ids = c("a","a","b","c","d","a","e","d"), values = c(10,1,25,2,5,10,4,1)) > df dates ids values 1 2011-10-01 10 2 2011-10-01 1 3 2011-10-01 b 25 4 2011-10-02 c 2 5 2011-10-03 d 5 6 2011-10-05 10 7 2011-10-06 e 4 8 2011-10-06 d 1 i following output: dates unique_ids sum_values 1 2011-10-01 2 36 2 2011-10-02 3 38 3 2011-10-03 4 43 4 2011-10-04 4 43 5 2011-10-05 4 53 6 2011-10-06 5 58 i.e. each date unique_ids gives number of unique ids correspon...

java - How to make logger.trace() and logger.info() work together -

i have issue logging trace function in distinct file info function, prepared classic log4j.xml file containing required configuration. logger.info() working. logger.trace() not working. <appender name="file" class="org.apache.log4j.fileappender"> <param name="append" value="true" /> <param name="file" value="c:/logs/transaction.log" /> <layout class="org.apache.log4j.patternlayout"> <param name="conversionpattern" value="%d{yyyy-mm-dd hh:mm:ss} %-5p %c{1}:%l - %m%n" /> </layout> <filter class="org.apache.log4j.varia.levelrangefilter"> <param name="levelmin" value="trace" /> <param name="levelmax" value="trace" /> <param name="acceptonmatch...

ios - TableViews inside ScrollView Autolayout -

Image
i trying create view contains many subviews , can contain many tableviews. need enable scroll of subviews. created scroll view , put superview. put views inside scroll have lot of problems putting tableviews inside scroll using autolayout. dont want scroll inside tableviews, need enable clicks each tableview create. listen of suggestions how can create view. a scrollview inside of scrollview hard handle. maybe it's worth redesign data model combine contents? e.g. (assuming each table contains 2 labels) image -> row cell 0 of type or tableheader label -> row cell 1 of type b label -> row cell 2 of type b label -> row cell 3 of type b label -> row cell 4 of type b table 1 label 1 -> row cell 5 of type c table 1 label 2 -> row cell 6 of type c label -> row cell 7 of type b table 2 label 1 -> row cell 8 of type c table 2 label 2 -> row cell 9 of type c label -> row cell 10 of type b table 3 label 1 -> row cell 11 of...

Add subsequent plot to legend in matlab -

Image
i doing iterative process create figure, add plot , append legend item. doing series of commands have collected in script below. please note cannot script since actual plotting depends on external processes must physically iterate since have no control on them. >> x = [0:1:10] >> y1 = [] >> y2 = [] >> y3 = [] >> figure >> hold on >> = 1:size(x,2) y1(i) = x(i)^2 end >> plot(x,y1,'b') >> legend('x^2') >> = 1:size(x,2) y2(i) = 2*x(i)^2 end >> plot(x,y2,'r') >> legend('2*x^2') >> = 1:size(x,2) y3(i) = 3*x(i)^2 end >> plot(x,y3,'g') >> legend('3*x^2') as expected creates plot 3 functions of interest legend containing last item. not happy since when series of commands must each time create new legend old items new ones. achieve desired result commands must modified follows >> x = [0:1:10] >> y1 = [] >> y2 = [] ...