Posts

java - Selenium Webdriver. Error 'org.openqa.selenium.StaleElementReferenceException: Element is no longer valid' -

selenium webdriver + java. code: public list<userdata> getusers() { list<userdata> users = new arraylist<userdata>(); webelement userlist = driver.findelement(by.id("users")); iselementdisplayed(by.xpath("//table[@id='users']/*/tr[position() > 1]"), 10); list<webelement> tablerows = driver.findelements(by.xpath("//table[@id='users']/*/tr[position() > 1]")); (webelement tablerow : tablerows) { list<webelement> cells = tablerow.findelements(by.tagname("td")); userdata user = new userdata(); user.fio = cells.get(2).gettext(); user.login = cells.get(3).gettext(); user.rank = cells.get(4).gettext(); user.cabinet = cells.get(5).gettext(); users.add(user); } return users; } after delete user table, method throws: org.openqa.selenium....

java - How to disable message "Parameter x is not assigned and could be declared final" in Eclipse? -

i cannot find place in eclipse preferences can disable message: parameter pjp not assigned , declared final where place? your warning message never produced eclipse's built-in checks. produced eclipse plug-in called pmd, supports wider range of code checks. the specific pmd rule name methodargumentcouldbefinal .

Compute mean from the object returned by "getSymbols()" in R package "quantmod" -

i compute moments object returned "getsymbols()" in r package " quantmod ". object isn't vector or matrix, there error. how can that? following code: > library(quantmod) > getsymbols("axp", = "2007-01-01", = "2013-12-31") > returns = diff(axp[,6]) / lag(axp[,6]) * 100 # calculate simple return adjusted prices > mean(returns) [1] na > var(returns) axp.adjusted axp.adjusted na how can calculate sample mean , variance? thanks!

Lucene Index: Missing documents -

we have pretty basic lucene set up. noticed documents aren't written index. this how create document: private void addtodirectory(specialdomainobject specialdomainobject) throws ioexception { document document = new document(); document.add(new textfield("id", string.valueof(specialdomainobject.getid()), field.store.yes)); document.add(new textfield("name", specialdomainobject.getname(), field.store.yes)); document.add(new textfield("tags", jointags(specialdomainobject.gettags()), field.store.yes)); document.add(new textfield("contents", getcontents(specialdomainobject), field.store.yes)); (language language : getallassociatedlanguages(specialdomainobject)) { document.add(new intfield("languageid", language.getid(), field.store.yes)); } specialdomainobjectindexwriter.updatedocument(new term("id", document.getfield("id").stringvalue()), document); specialdom...

page refresh - Primefaces tab not updating properly -

i have dialogue commandbutton, , i'm trying do: do java work update primefaces tab make dialogue box disappear go tab. this code i'm using: <p:commandbutton value="submit" action="<some java work>" oncomplete="dialogue.hide(); sidetabs.select(1)" update="<update side tab"> </p:commandbutton> the problem is, works once between refreshes. mean is, click button, , works fine-the tab changes requested tab, tab updated, , dialogue disappears. when click button again, requested tab indeed selected, isn't refreshed until hit f5. once that, can click dialogue button again , tab refresh again, once again, once - until hit f5 again. so, this: click button -> see 1 item in tab click button again -> still see 1 item in tab hit f5 -> see 2 items in tab click button -> see 3 items in tab click button again -> still...

ruby on rails - form tag just one value pass instead of multiple -

i have form_tag in form contains 2 drop down boxes. when submit form both fields id isn't pass dont know did wrong... <%= form_tag '/daily_report' -%> <label>search</label> <%= select_tag "id", options_from_collection_for_select(user.all, "id", "firstname",:selected => @s) %> <%= select_tag "id", options_from_collection_for_select(project.all, "id", "name",:selected => @s) %> <%= submit_tag "search", :name => nil %> <% end -%> if use same name values overwritten , 1 result. change name , make different. <%= select_tag "users", options_from_collection_for_select(user.all, "id", "firstname",:selected => @s) %> <%= select_tag "projects", options_from_collection_for_select(project.all, "id", "name",:selected => @s) %> you can access using names, :users , :project...

python - Replacing a character in Django template -

i want change &amp; and in page's meta description. this tried {% if '&' in dj.name %} {{ dj.name.replace('&', 'and') }} {% else %} {{ dj.name }} {% endif %} this doesn't work. still shows &amp; dj.name.replace('&', 'and') can not invoke method arguments.you need write custom filter. official guide here: https://docs.djangoproject.com/en/1.9/howto/custom-template-tags/#registering-custom-filters ok, here example, say, in app named 'questions', want write filter to_and replaces '&' 'and' in string. in /project_name/questions/templatetags, create blank __init__.py , , to_and.py goes like: from django import template register = template.library() @register.filter def to_and(value): return value.replace("&","and") in template , use: {% load to_and %} then can enjoy: {{ string|to_and }} note, directory name templ...